query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Get update metadta endpoint arguments. | private function get_update_metadata_args() {
return [
'rows' => [
'required' => true,
'description' => esc_html__( 'No meta rows found to update.', 'rank-math' ),
'validate_callback' => [ '\\RankMath\\Rest\\Rest_Helper', 'is_param_empty' ],
],
];
} | [
"function getUpdateParams($request, $response, $args){\r\n\t\treturn $request->getParams();\r\n\t}",
"public function getParametersForUpdate();",
"private function get_update_metadata_args() {\n\t\treturn [\n\t\t\t'objectType' => [\n\t\t\t\t'type' => 'string',\n\t\t\t\t'required' => true,\n\t\t\t\t'description' => esc_html__( 'Object Type i.e. post, term, user', 'rank-math' ),\n\t\t\t\t'validate_callback' => [ '\\\\RankMath\\\\Rest\\\\Rest_Helper', 'is_param_empty' ],\n\t\t\t],\n\t\t\t'objectID' => [\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'required' => true,\n\t\t\t\t'description' => esc_html__( 'Object unique id', 'rank-math' ),\n\t\t\t\t'validate_callback' => [ '\\\\RankMath\\\\Rest\\\\Rest_Helper', 'is_param_empty' ],\n\t\t\t],\n\t\t\t'meta' => [\n\t\t\t\t'required' => true,\n\t\t\t\t'description' => esc_html__( 'Meta to add or update data.', 'rank-math' ),\n\t\t\t\t'validate_callback' => [ '\\\\RankMath\\\\Rest\\\\Rest_Helper', 'is_param_empty' ],\n\t\t\t],\n\t\t];\n\t}",
"public function parseUpdate(&$arguments)\n {\n $arguments['action'] = 'update';\n $arguments['table'] = $this->getNextWord();\n\n if (strpos($arguments['table'], '.')) {\n list($arguments['db'], $arguments['table']) = explode('.', $arguments['table']);\n }\n\n /* Look for some main keywords */\n while ($word = $this->getNextWord()) {\n switch (true) {\n /* Grab the value-set */\n case (strtolower(substr($word, 0, 3)) == 'set'):\n {\n $this->c -= strlen($word) + 1;\n $this->getValueSet($arguments);\n\n break;\n }\n\n /* Parse the where clause */\n case (strtolower($word) == 'where'):\n {\n $this->parseWhere($arguments);\n $this->c--;\n\n break;\n }\n\n /* Parse the orderby clause */\n case (strtolower($word) == 'orderby'):\n {\n $this->parseOrderBy($arguments);\n\n break;\n }\n\n /* Parse the limit clause */\n case (strtolower($word) == 'limit'):\n {\n $this->parseLimit($arguments);\n\n break;\n }\n }\n }\n\n /* Return whatever results we got back */\n return $arguments;\n }",
"private function get_update_schemas_args() {\n\t\treturn [\n\t\t\t'objectType' => [\n\t\t\t\t'type' => 'string',\n\t\t\t\t'required' => true,\n\t\t\t\t'description' => esc_html__( 'Object Type i.e. post, term, user', 'rank-math' ),\n\t\t\t\t'validate_callback' => [ '\\\\RankMath\\\\Rest\\\\Rest_Helper', 'is_param_empty' ],\n\t\t\t],\n\t\t\t'objectID' => [\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'required' => true,\n\t\t\t\t'description' => esc_html__( 'Object unique id', 'rank-math' ),\n\t\t\t\t'validate_callback' => [ '\\\\RankMath\\\\Rest\\\\Rest_Helper', 'is_param_empty' ],\n\t\t\t],\n\t\t\t'schemas' => [\n\t\t\t\t'required' => true,\n\t\t\t\t'description' => esc_html__( 'schemas to add or update data.', 'rank-math' ),\n\t\t\t\t'validate_callback' => [ '\\\\RankMath\\\\Rest\\\\Rest_Helper', 'is_param_empty' ],\n\t\t\t],\n\t\t];\n\t}",
"function readUpdateParams(&$archive) {\n\t\t$this->import('OAIHarvester');\n\n\t\t$returner = array();\n\t\t$set = Request::getUserVar('set');\n\t\tif (count($set) == 1 && $set[0] == '') $set = null;\n\n\t\t$returner['set'] = $set;\n\n\t\t$dateFrom = Request::getUserDateVar('from', 1, 1);\n\t\t$dateTo = Request::getUserDateVar('until', 32, 12, null, 23, 59, 59);\n\t\tif (!empty($dateFrom)) $returner['from'] = OAIHarvester::UTCDate($dateFrom);\n\t\tif (!empty($dateTo)) $returner['until'] = OAIHarvester::UTCDate($dateTo);\n\n\t\treturn $returner;\n\t}",
"function getUpdateQueryWithPositionalParameters();",
"public function getArgs(): array\n {\n return array_merge($_GET, $_POST);\n }",
"public function getUpdateOptions()\n {\n return $this->updateOptions;\n }",
"public function args() {\n\t\treturn array_merge(\n\t\t\t$this->request->named,\n\t\t\t$this->request->passedArgs,\n\t\t\t$this->request->query\n\t\t);\n\t}",
"protected function get_request_args() {\n\t\treturn $this->get_request()->get_callback_params();\n\t}",
"function getRequestArgs() {\n\t\treturn $this->_RequestArgs;\n\t}",
"function getRequestArgs() {\n\t\t$press = $this->getPress();\n\t\treturn array(\n\t\t\t'pressId' => $press->getId()\n\t\t);\n\t}",
"public function getUpdateQueryWithPositionalParameters();",
"private function getTemplateArgs(): array\n {\n $starting_view = preg_replace('/([^\\w \\-\\@\\.\\,])+/', '', $_POST['starting_view']);\n $envelope_id= isset($_SESSION['envelope_id']) ? $_SESSION['envelope_id'] : false;\n $args = [\n 'envelope_id' => $envelope_id,\n 'account_id' => $_SESSION['ds_account_id'],\n 'base_path' => $_SESSION['ds_base_path'],\n 'ds_access_token' => $_SESSION['ds_access_token'],\n 'starting_view' => $starting_view,\n 'ds_return_url' => $GLOBALS['app_url'] . 'index.php?page=ds_return'\n ];\n\n return $args;\n }",
"public function getArgs(): array {\n $args = $this->entry;\n $args['creator']['name'] = $args['creator']['fullName'];\n $args['start_time'] = $this->createDateTime($args['startDate']);\n $args['end_time'] = $this->createDateTime($args['endDate']);\n // Sometimes when a event hasnt been modified yet, the modificationDate item will not even exist leading to an\n // error, in this case the creation date will be used as the date of last modification\n if (array_key_exists('modificationDate', $args)) {\n $args['modification_time'] = $this->createDateTime($args['modificationDate']);\n } else {\n $args['modification_time'] = $this->createDateTime($args['creationDate']);\n }\n\n // 06.01.2019\n // It is possible, that the 'location' and 'address' fields, which are present in the original response array\n // have the value NULL, but it is super important, that only strings are returned, which is why we will add\n // this loop, that replaces every NULL value with an empty string\n foreach ($args as $key => $value) {\n if ($value === NULL) {\n $args[$key] = '';\n }\n }\n\n return $args;\n }",
"private function getTemplateArgs(): array\n {\n $args = [\n 'account_id' => $_SESSION['ds_account_id'],\n 'base_path' => $_SESSION['ds_base_path'],\n 'ds_access_token' => $_SESSION['ds_access_token'],\n ];\n\n return $args;\n }",
"public function getUpdateAllFields()\n {\n return $this->getUrl('zohocrm/field/update', ['_current' => false]);\n }",
"public static function getArgs() {\n\t\treturn WConfig::get('route.args');\n\t}",
"protected function getAllArgs()\n {\n $this->methodExpectsRequest(__METHOD__);\n $params = [];\n foreach ($this->getRequest()->getAllArgs() as $index => $value) {\n if (isset($this->argument_position_name[$index])) {\n $param_name = $this->argument_position_name[$index];\n $params[$param_name] = $value;\n }\n }\n return $params;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Invokes any cron handlers implementing hook_cron. | protected function invokeCronHandlers() {
$module_previous = '';
// If detailed logging isn't enabled, don't log individual execution times.
$time_logging_enabled = \Drupal::config('system.cron')->get('logging');
$logger = $time_logging_enabled ? $this->logger : new NullLogger();
// Iterate through the modules calling their cron handlers (if any):
$this->moduleHandler->invokeAllWith('cron', function (callable $hook, string $module) use (&$module_previous, $logger) {
if (!$module_previous) {
$logger->info('Starting execution of @module_cron().', [
'@module' => $module,
]);
}
else {
$logger->info('Starting execution of @module_cron(), execution of @module_previous_cron() took @time.', [
'@module' => $module,
'@module_previous' => $module_previous,
'@time' => Timer::read('cron_' . $module_previous) . 'ms',
]);
}
Timer::start('cron_' . $module);
// Do not let an exception thrown by one module disturb another.
try {
$hook();
}
catch (\Exception $e) {
watchdog_exception('cron', $e);
}
Timer::stop('cron_' . $module);
$module_previous = $module;
});
if ($module_previous) {
$logger->info('Execution of @module_previous_cron() took @time.', [
'@module_previous' => $module_previous,
'@time' => Timer::read('cron_' . $module_previous) . 'ms',
]);
}
} | [
"public function customRunAllCrons() {\n foreach ($this->moduleHandler->getImplementations('cron') as $module) {\n try {\n $this->moduleHandler->invoke($module, 'cron');\n $this->logger->notice('Ran hook_cron from @name module.', array('@name' => $module));\n } catch (\\Exception $e) {\n watchdog_exception('cron', $e);\n }\n }\n drupal_set_message(t('Ran all crons'));\n return new RedirectResponse(\\Drupal::url('<front>', [], ['absolute' => TRUE]));\n }",
"function do_cron() {\n global $files_dir;\n ct_log(\"Cron-Job started.\", 2, -1, 'cron');\n\n //delete temporary files (and sessions) older than one day\n $tempDir = $files_dir . '/tmp/';\n foreach (array_slice(scandir($tempDir), 2) as $file) {\n $path = $tempDir . $file;\n if (is_file($path) && filemtime($path) < time() - (3600 * 24)) {\n unlink($path);\n }\n }\n //launch the cronjobs of the individual CT modules\n $modulesSorted = churchcore_getModulesSorted(false, false);\n foreach ($modulesSorted as $key) {\n include_once (constant(strtoupper($key)) . \"/$key.php\");\n if (function_exists($key . \"_cron\") && getConf($key . \"_name\")) {\n call_user_func($key . \"_cron\");\n }\n }\n ct_sendPendingNotifications();\n\n ct_log(\"Cron-Job finished.\", 2, -1, 'cron');\n}",
"public function cron() {\n global $argv;\n\n // Determine which cron method needs to be executed\n $method = (isset($argv) && isset($argv[1])) ? $argv[1] : \"five_minutes\";\n\n // Handle the local Marmalade cron controller\n $controller = new Controllers\\CronController();\n if (method_exists($controller, $method)) {\n call_user_func(array($controller, $method)); // Execute the Marmalade cron job\n }\n \n // Handle the custom cron controller\n $controller = Hooks::get_cron_controller();\n $controller = ($controller !== false) ? new $controller() : false;\n if ($controller !== false && method_exists($controller, $method)) {\n call_user_func(array($controller, $method)); // Execute the userspace cron job\n }\n }",
"public function cronRun() {\n $this->drupalGet('cron/' . \\Drupal::state()->get('system.cron_key'));\n }",
"public function executeCron()\n {\n $this->mode = 'cron';\n $this->execute();\n }",
"abstract function cron_action();",
"public function executeCronManagement(){\n $dateTime= new \\DateTime();\n $actualFrequency= array(\n 'i' => $dateTime->format('i'),\n 'H' => $dateTime->format('H'),\n 'd' => $dateTime->format('d'),\n 'm' => $dateTime->format('m'),\n 'w' => $dateTime->format('w')\n );\n $file= $this->app->context->getConfigFolderDomain() . 'cronJobs';\n $definedCrons= $this->app->context->readConfigurationFile($file)['crons'];\n $cronsToExeture= array();\n foreach ($definedCrons as $cronEsp) {\n $frecuenciaActiva= $this->activeFrequency($cronEsp['frequency'], $actualFrequency);\n if($frecuenciaActiva){\n $cronsToExeture[]= $cronEsp;\n }\n }\n //Ejecuto las tareas en la que su frecuencia sea activa\n foreach ($cronsToExeture as $cronEsp) {\n $propertiesEsp= isset($cronEsp['properties']) ? $cronEsp['properties'] : NULL;\n $this->executeCron($cronEsp['cronController'], $cronEsp['method'], $propertiesEsp);\n } \n }",
"public function schedule_plugin_cron_tasks() {\n\t\tif (!wp_next_scheduled('wpo_plugin_cron_tasks')) {\n\t\t\twp_schedule_event(current_time(\"timestamp\", 0), 'twicedaily', 'wpo_plugin_cron_tasks');\n\t\t}\n\n\t\tadd_action('wpo_plugin_cron_tasks', array($this, 'do_plugin_cron_tasks'));\n\t}",
"public function run()\n\t{\n\t\t$this->logic(Testcron::class);\n\t\t//Add as many cron jobs as you like\n\t}",
"public function maybe_schedule_cron() {\n\t\t\tif ( !$this->is_http_worker_disabled() && ! wp_next_scheduled( 'http_worker_cron' )) {\n // Schedule health check\n wp_schedule_event( time(), 'http_worker_cron_interval', 'http_worker_cron' );\n\t\t\t}\n\t\t}",
"private function schedule_cron() {\n if ( ! wp_next_scheduled( 'jpww_cron_hook' ) ) {\n wp_schedule_event( time(), 'fifteen_minutes', 'jpww_cron_hook' );\n }\n }",
"private function loadCronJobs(){\n //remove urls\n add_action('aios_check_urls_removed', array( __NAMESPACE__ . '\\\\Library\\\\CronJobs\\\\AutoCronJobs', 'cs_check_urls_removed'));\n add_action('csmbp_cron_monitorKeyword', array( __NAMESPACE__ . '\\\\Library\\\\CronJobs\\\\AutoCronJobs', 'monitor_keyword'));\n }",
"function zeek_install_cron($should_install) {\n\tif (platform_booting()) {\n\t\treturn;\n\t}\n\t$cron_cmd = ZEEK_LOCALBASE . \"/bin/zeekctl cron \";\n\n\tif (($should_install) && (zeek_enabled())) {\n\t\tlog_error(\"[zeek] Adding cronjobs ...\");\n\t\tinstall_cron_job(\"{$cron_cmd}\", $should_install, \"*/5\", \"*\", \"*\", \"*\", \"*\", \"root\");\n\t} else {\n\t\tlog_error(\"[zeek] Removing cronjobs ...\");\n\t\tinstall_cron_job(\"{$cron_cmd}\", false);\n\t}\n}",
"public static function cron_trigger() {\n\t\t$watcher = new CLI\\SVN_Watcher();\n\t\t$watcher->watch();\n\t}",
"public function cronHandler()\n {\n // Process Reminder notifications\n if ($this->configuration->getSettingsReminderemail()) {\n // Get Settings\n $days = abs($this->configuration->getSettingsReminderemailDays());\n\n // Send reminders\n foreach ($this->extension->getPendingReminders() as $orderId) {\n $order = $this->getOrder($orderId);\n if (!$order) {\n continue;\n }\n\n // Calculate trigger time\n $triggerTime = strtotime($order->getCreatedAt()) + ($days * 24 * 60 * 60);\n if (time() >= $triggerTime) {\n // Send Reminder\n try {\n $this->extension->sendReminderNotificationEmail($orderId);\n } catch (\\Exception $e) {\n $this->logger->critical('sendReminderNotificationEmail failure',\n [\n $orderId,\n $e->getMessage(),\n $e->getTraceAsString()\n ]\n );\n }\n\n $this->extension->setReminderSent($orderId);\n }\n }\n\n // Get Orders for reminding\n $orders = $this->extension->getOrdersForReminding();\n foreach ($orders as $orderId) {\n $order = $this->getOrder($orderId);\n if (!$order) {\n continue;\n }\n\n if (self::STATUS_PENDING === $order->getStatus()) {\n // Get Payment Status from Ingenico\n $paymentResult = $this->getPaymentInfo($orderId, $order->getPayId());\n\n // Check if Payment is unpaid\n if (!$paymentResult->isTransactionSuccessful() &&\n (in_array($paymentResult->getErrorCode(), ['50001130', '50001131']) ||\n $paymentResult->getNcStatus() === 'none'\n )\n ) {\n // Payment Status is failed. Error: 50001130 unknown orderid 691 for merchant\n // Payment Status is failed. unknown payid/orderID 3046675410/300062 for merchant\n // Enqueue Reminder\n $this->extension->enqueueReminder($orderId);\n }\n }\n\n // Get cancelled orders in latest 2 days\n if (self::STATUS_CANCELLED === $order->getStatus() &&\n ((strtotime($order->getCreatedAt()) >= time()) &&\n (strtotime($order->getCreatedAt()) <= strtotime(sprintf('-%s days', $days))))\n ) {\n if (!$this->extension->isCartPaid($orderId)) {\n $this->extension->enqueueReminder($orderId);\n }\n }\n }\n }\n }",
"public function run_cleanup_cron()\n {\n }",
"function uninstall_cron(){\n wp_clear_scheduled_hook( 'cuentadigital_cron_hook' );\n }",
"public static function unschedule_cron_jobs() {\n\t\t\twp_clear_scheduled_hook( 'wp_job_board_check_for_expired_jobs' );\n\t\t\twp_clear_scheduled_hook( 'wp_job_board_delete_old_previews' );\n\t\t\twp_clear_scheduled_hook( 'wp_job_board_email_daily_notices' );\n\t\t}",
"public function cron()\n {\n $this->log('Starting CRON job', \\JLog::DEBUG);\n\n // Makes sure SiteGround's SuperCache doesn't cache the CRON view\n $this->app->setHeader('X-Cache-Control', 'False', true);\n\n if (empty($this->secret))\n {\n $this->log('No secret key configured', \\JLog::ERROR);\n\t\t\theader('HTTP/1.1 503 Service unavailable due to configuration');\n jexit();\n }\n\n // Authenticate request\n if ($this->app->input->get('secret', null, 'raw') != $this->secret)\n {\n $this->log('Wrong secret key provided in URL', \\JLog::ERROR);\n\t\t\theader('HTTP/1.1 403 Forbidden');\n jexit();\n }\n\n // Validate command to run\n $command = $this->app->input->get('command', null, 'raw');\n $command = trim(strtolower($command));\n $commandEscaped = \\JFilterInput::getInstance()->clean($command, 'cmd');\n\n if (empty($command))\n {\n $this->log('No command provided in URL', \\JLog::ERROR);\n\t\t\theader('HTTP/1.1 501 Not implemented');\n jexit();\n }\n\n // Register a new task-specific Convert Forms CRON logger\n \\JLog::addLogger(['text_file' => \"convertforms_cron_$commandEscaped.php\"], \\JLog::ALL, ['convertforms.cron.' . $command]);\n $this->log(\"Starting execution of command $commandEscaped\", \\JLog::DEBUG);\n\n // Import plugins and trigger the cron task event\n \\JPluginHelper::importPlugin('system');\n \\JPluginHelper::importPlugin('convertforms');\n $this->app->triggerEvent('onConvertFormsCronTask', [$command, ['time_limit' => 10]]);\n\n $this->log(\"Finished running command $commandEscaped\", \\JLog::DEBUG);\n \n echo $commandEscaped . ' OK';\n jexit();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that the 'canonical request' used in the AWS signature algorithm matches the example in | public function testCanonicalRequest()
{
$this->setupEnv();
$AwsClient = new Idealstack\DynamoDbSessionsDependencyFree\AwsClient([
'region' => 'us-east-1',
'version' => 'latest',
'service' => 'service',
'credentials' => [
'key' => 'AKIDEXAMPLE',
'secret' => 'wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY'
]
]);
$method = new ReflectionMethod('Idealstack\DynamoDbSessionsDependencyFree\AwsClient', 'getCanonicalRequest');
$method->setAccessible(true);
$result = $method->invoke(
$AwsClient,
'GET',
'https://example.amazonaws.com',
[
'Param2' => 'value2',
'Param1' => 'value1'
],
[
'X-Amz-Date' => '20150830T123600Z'
],
'',
strtotime('20150830T123600Z')
);
$canonical_request_string = "GET
/
Param1=value1&Param2=value2
host:example.amazonaws.com
x-amz-date:20150830T123600Z
host;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
$canonical_request_string_hash = '816cd5b414d056048ba4f7c5386d6e0533120fb1fcfa93762cf0fc39e2cf19e0';
$this->assertEquals($canonical_request_string, $result['CanonicalRequest']);
//Hash it
$this->assertEquals(
$canonical_request_string_hash,
hash('sha256', $result['CanonicalRequest'])
);
$this->restoreEnv();
} | [
"public function testGetSignature()\n {\n $valid = 'cJadffbdVWLPv+t7cxlbgAB4HlM=';\n $this->assertEquals($valid, $this->request->getSignature());\n }",
"public function testSignatureUisPost()\n {\n }",
"public function testSignedRequestParsing()\n {\n $qs = 'SAMLRequest=nVLBauMwEP0Vo7sjW7FpKpJA2rBsoNuGOruHXhZFHm8EsuRqxtv27yvbWWgvYelFgjfvzbx5zBJVazu56enkHuG5B6TktbUO5VhYsT446RUalE61gJK0rDY%2F7qSYZbILnrz2ln2QXFYoRAhkvGPJbrtiv7VoygJEoTJ9LOusXDSFuJ4vdH6cxwoIEGUjsrqoFUt%2BQcCoXLHYKMoRe9g5JOUoQlleprlI8%2FyQz6W4ksXiiSXbuI1xikbViahDyfkRSM2wD40DmjnL0bSdhcE6Hx7BTd3xqnqoIPw1GmbdqWPJNx80jCGtGIUeWLL5t8mtd9i3EM78n493%2FzWr9XVvx%2B58mj39IlUaR%2FQmKOPq4Dtkyf4c9E1EjPtzOePjREL5%2FXDYp%2FuH6sDWy6G3HDML66%2B5ayO7VlHx2dySf2y9nM7pPprabffeGv02ZNcquux5QEydNiNVUlAODTiKMVvrX24DKIJz8nw9jfx8tOt3&RelayState=https%3A%2F%2Fbeta.surfnet.nl%2Fsimplesaml%2Fmodule.php%2Fcore%2Fauthenticate.php%3Fas%3DBraindrops&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=b%2Bqe%2FXGgICOrEL1v9dwuoy0RJtJ%2FGNAr7gJGYSJzLG0riPKwo7v5CH8GPC2P9IRikaeaNeQrnhBAaf8FCWrO0cLFw4qR6msK9bxRBGk%2BhIaTUYCh54ETrVCyGlmBneMgC5%2FiCRvtEW3ESPXCCqt8Ncu98yZmv9LIVyHSl67Se%2BfbB9sDw3%2FfzwYIHRMqK2aS8jnsnqlgnBGGOXqIqN3%2Bd%2F2dwtCfz14s%2F9odoYzSUv32qfNPiPez6PSNqwhwH7dWE3TlO%2FjZmz0DnOeQ2ft6qdZEi5ZN5KCV6VmNKpkrLMq6DDPnuwPm%2F8oCAoT88R2jG7uf9QZB%2BArWJKMEhDLsCA%3D%3D';\n $_SERVER['QUERY_STRING'] = $qs;\n\n $hr = new SAML2_HTTPRedirect();\n $request = $hr->receive();\n $this->assertInstanceOf('SAML2_Request', $request);\n $relaystate = $request->getRelayState();\n $this->assertEquals('https://beta.surfnet.nl/simplesaml/module.php/core/authenticate.php?as=Braindrops', $relaystate);\n }",
"public function testCreateOldRequestSignature()\n {\n $shop_id = 1;\n $order_id = 1;\n $order_price = 3000;\n $goods = '[{\"name\":\"\\u041d\\u0430\\u0443\\u0448\\u043d\\u0438\\u043a\\u0438 Sony\",\"price\":3200,'\n . '\"quantity\":1,\"is_returnable\":1}]';\n $callback_url = 'https://example.com';\n $is_loan_postponed = 1;\n $is_test_mode_enabled = 1;\n $secret_key = 'FMNDesQ58G8y4O8bgGPvsEGFPwEe8Gdj';\n\n $expected = hash('sha256', $shop_id . $order_id . $order_price . $callback_url\n . $is_loan_postponed . $goods . $is_test_mode_enabled . $secret_key);\n\n $this->assertEquals($expected, Request::createOldRequestSignature(\n $shop_id,\n $order_id,\n $order_price,\n $callback_url,\n $is_loan_postponed,\n $goods,\n $is_test_mode_enabled,\n $secret_key\n ));\n }",
"public function testBuildRequestSignature()\n {\n $message = file_get_contents(TEST_ROOT . '/data/logout_requests/logout_request_deflated.xml.base64');\n $relayState = 'http://relaystate.com';\n $signature = $this->_auth->buildRequestSignature($message, $relayState);\n $validSignature = 'Pb1EXAX5TyipSJ1SndEKZstLQTsT+1D00IZAhEepBM+OkAZQSToivu3njgJu47HZiZAqgXZFgloBuuWE/+GdcSsRYEMkEkiSDWTpUr25zKYLJDSg6GNo6iAHsKSuFt46Z54Xe/keYxYP03Hdy97EwuuSjBzzgRc5tmpV+KC7+a0=';\n $this->assertEquals($validSignature, $signature);\n }",
"public function testSignRequest()\n {\n $headers = [\n 'Content-Type' => 'text/plain',\n 'X-Authorization-Timestamp' => $this->timestamp,\n ];\n\n $request = new Request('GET', 'https://example.acquiapipet.net/v1.0/task-status/133?limit=10', $headers);\n\n $digest = new Digest();\n\n $authHeaderBuilder = new AuthorizationHeaderBuilder($request, $this->authKey, $digest);\n $authHeaderBuilder->setRealm($this->realm);\n $authHeaderBuilder->setId($this->authKey->getId());\n $authHeaderBuilder->setNonce('d1954337-5319-4821-8427-115542e08d10');\n $authHeader = $authHeaderBuilder->getAuthorizationHeader();\n\n $signer = new MockRequestSigner($this->authKey, $this->realm, $digest, $authHeader);\n\n $signedRequest = $signer->signRequest($request);\n\n $this->assertFalse($signedRequest->hasHeader('X-Authorization-Content-SHA256'));\n $this->assertTrue($signedRequest->hasHeader('X-Authorization-Timestamp'));\n $this->assertEquals($this->timestamp, $signedRequest->getHeaderLine('X-Authorization-Timestamp'));\n $this->assertTrue($signedRequest->hasHeader('Authorization'));\n $this->assertStringContainsString('signature=\"MRlPr/Z1WQY2sMthcaEqETRMw4gPYXlPcTpaLWS2gcc=\"', $signedRequest->getHeaderLine('Authorization'));\n\n // Ensure that we can get the AuthorizationHeader back from the request.\n $signedAuthRequest = $signer->getAuthorizedRequest($signedRequest);\n $this->assertStringContainsString('signature=\"MRlPr/Z1WQY2sMthcaEqETRMw4gPYXlPcTpaLWS2gcc=\"', $signedAuthRequest->getHeaderLine('Authorization'));\n }",
"public function testRequestSigning() {\n\t\t$signer = new Auth_OAuth_Signer();\n\n\t\t// test 1\n\t\t$params = array('file'=>'vacation.jpg', 'size'=>'original', 'oauth_version'=>'1.0',\n\t\t\t\t\t'oauth_consumer_key'=>'dpf43f3p2l4k3l03', 'oauth_token'=>'nnch734d00sl2jdk',\n\t\t\t\t\t'oauth_timestamp'=>'1191242096', 'oauth_nonce'=>'kllo9940pd9333jh');\n\t\tself::build_request('GET', 'http://photos.example.net/photos', $params);\n\t\t$request = Auth_OAuth_RequestImpl::fromRequest();\n\t\t$server = new Auth_OAuth_Store_ServerImpl('key', 'kd94hf93k423kf44');\n\t\t$server->setSignatureMethods( array('PLAINTEXT', 'HMAC-SHA1') );\n\t\t$token = new Auth_OAuth_TokenImpl('token', 'pfkkdhi9sl3r4s00', 'key', 'access');\n\n\t\t$signer->sign($request, $server, $token);\n\t\t$this->assertEquals('PLAINTEXT', $request->getSignatureMethod());\n\t\t$this->assertEquals('kd94hf93k423kf44&pfkkdhi9sl3r4s00', $request->getSignature());\n\n\n\t\t// test 2\n\t\t$params = array('file'=>'vacation.jpg', 'size'=>'original', 'oauth_version'=>'1.0',\n\t\t\t\t\t'oauth_consumer_key'=>'dpf43f3p2l4k3l03', 'oauth_token'=>'nnch734d00sl2jdk',\n\t\t\t\t\t'oauth_timestamp'=>'1191242096', 'oauth_nonce'=>'kllo9940pd9333jh');\n\t\tself::build_request('GET', 'http://photos.example.net/photos', $params);\n\t\t$request = Auth_OAuth_RequestImpl::fromRequest();\n\t\t$server = new Auth_OAuth_Store_ServerImpl('key', 'kd94hf93k423kf44');\n\t\t$server->setSignatureMethods( array( 'INVALID-METHOD', 'HMAC-SHA1', 'PLAINTEXT') );\n\t\t$token = new Auth_OAuth_TokenImpl('token', 'pfkkdhi9sl3r4s00', 'key', 'access');\n\n\t\t$signer->sign($request, $server, $token);\n\t\t$this->assertEquals('HMAC-SHA1', $request->getSignatureMethod());\n\t\t$this->assertEquals('tR3+Ty81lMeYAr/Fid0kMTYa/WM=', $signer->getSignature($request, $server, $token));\n\t}",
"public function testSignedMessageSign()\n {\n }",
"function aws_signed_request($region, $params, $public_key, $private_key, $associate_tag=NULL, $version='2011-08-01')\n\t{\n\t\t/*\n\t\tCopyright (c) 2009-2012 Ulrich Mierendorff\n\n\t\tPermission is hereby granted, free of charge, to any person obtaining a\n\t\tcopy of this software and associated documentation files (the \"Software\"),\n\t\tto deal in the Software without restriction, including without limitation\n\t\tthe rights to use, copy, modify, merge, publish, distribute, sublicense,\n\t\tand/or sell copies of the Software, and to permit persons to whom the\n\t\tSoftware is furnished to do so, subject to the following conditions:\n\n\t\tThe above copyright notice and this permission notice shall be included in\n\t\tall copies or substantial portions of the Software.\n\n\t\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n\t\tTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n\t\tFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n\t\tDEALINGS IN THE SOFTWARE.\n\t\t*/\n\t\t\n\t\t/*\n\t\tParameters:\n\t\t\t$region - the Amazon(r) region (ca,com,co.uk,de,fr,co.jp)\n\t\t\t$params - an array of parameters, eg. array(\"Operation\"=>\"ItemLookup\",\n\t\t\t\t\t\t\t\"ItemId\"=>\"B000X9FLKM\", \"ResponseGroup\"=>\"Small\")\n\t\t\t$public_key - your \"Access Key ID\"\n\t\t\t$private_key - your \"Secret Access Key\"\n\t\t\t$version (optional)\n\t\t*/\n\t\t\n\t\t// some paramters\n\t\t$method = 'GET';\n\t\t$host = 'webservices.amazon.'.$region;\n\t\t$uri = '/onca/xml';\n\t\t\n\t\t// additional parameters\n\t\t$params['Service'] = 'AWSECommerceService';\n\t\t$params['AWSAccessKeyId'] = $public_key;\n\t\t// GMT timestamp\n\t\t$params['Timestamp'] = gmdate('Y-m-d\\TH:i:s\\Z');\n\t\t// API version\n\t\t$params['Version'] = $version;\n\t\tif ($associate_tag !== NULL) {\n\t\t\t$params['AssociateTag'] = $associate_tag;\n\t\t}\n\t\t\n\t\t// sort the parameters\n\t\tksort($params);\n\t\t\n\t\t// create the canonicalized query\n\t\t$canonicalized_query = array();\n\t\tforeach ($params as $param=>$value)\n\t\t{\n\t\t\t$param = str_replace('%7E', '~', rawurlencode($param));\n\t\t\t$value = str_replace('%7E', '~', rawurlencode($value));\n\t\t\t$canonicalized_query[] = $param.'='.$value;\n\t\t}\n\t\t$canonicalized_query = implode('&', $canonicalized_query);\n\t\t\n\t\t// create the string to sign\n\t\t$string_to_sign = $method.\"\\n\".$host.\"\\n\".$uri.\"\\n\".$canonicalized_query;\n\t\t\n\t\t// calculate HMAC with SHA256 and base64-encoding\n\t\t$signature = base64_encode(hash_hmac('sha256', $string_to_sign, $private_key, TRUE));\n\t\t\n\t\t// encode the signature for the request\n\t\t$signature = str_replace('%7E', '~', rawurlencode($signature));\n\t\t\n\t\t// create request\n\t\t$request = 'http://'.$host.$uri.'?'.$canonicalized_query.'&Signature='.$signature;\n\t\t\n\t\treturn $request;\n\t}",
"private function signature () {\n\t\t$url = $this->defaults['method'].\"\\n\".$this->defaults['url'].$this->region.\"\\n\".$this->defaults['uri'].\"\\n\".$this->query_string;\n\t\t$signature = base64_encode(hash_hmac($this->defaults['hash'], $url, $this->private_key, true));\n\t\treturn str_replace(\"%7E\", \"~\", rawurlencode($signature));\n\t}",
"public function testSignatureUisIdGet()\n {\n }",
"public function test_getSignature_called_returnValidSignatureWithSHA1Sign()\n {\n $expected = self::$cyphered_signature;\n $content_cyphered = self::$cyphered_content;\n $sut= $this->getSut();\n $actual = $sut->getSignature($content_cyphered);\n $this->assertEquals($expected,$actual);\n }",
"public function testChangeSignature()\n {\n }",
"public function testSignatureUisIdPut()\n {\n }",
"public function testSignRequest()\n {\n foreach ($this->fixtures as $test) {\n $client = new SignatureClient(\n $this->API_BASE_URL,\n $test['signature_key'],\n $test['signature_version']\n );\n $expectedSignature = hash_hmac(\n Signer::HASH_ALGORITHM,\n $test['request']['base_string'],\n $test['signature_key']\n );\n $request = new Request('GET', $test['request']['url'], [], $test['request']['body']);\n $request = $client->signRequest($request, $test['timestamp']);\n $signatureVersion = $request->getHeaderLine(SignatureClient::SIGNATURE_VERSION_HEADER);\n $timestamp = $request->getHeaderLine(SignatureClient::TIMESTAMP_HEADER);\n $signature = $request->getHeaderLine(SignatureClient::SIGNATURE_HEADER);\n $this->assertEquals($signatureVersion, $client->getSignatureVersion());\n $this->assertEquals($timestamp, $client->getTimestamp());\n $this->assertEquals($signature, $expectedSignature, \"Error in test {$test['testname']}:\");\n }\n }",
"public function verifySignature()\n {\n $webhooksService = $this->ostObj->services->webhooks;\n $params = array();\n $params[\"version\"] = \"2\";\n $params[\"webhook_secret\"] = \"mySecret\";\n $data = array();\n $data[\"hello\"] = \"hello\";\n $params[\"stringified_data\"] = json_encode($data);\n $params[\"request_timestamp\"] = \"1559902637\";\n $params[\"signature\"] = \"2c56c143550c603a6ff47054803f03ee4755c9c707986ae27f7ca1dd1c92a824\";\n $response = $webhooksService->verifySignature($params);\n $this->assertTrue($response == true);\n }",
"function calcSignatureREST($dataCenter, $secretKey, $httpMethod, $apiMethod, $parameters) {\r\n $l = 'http://socialize.'.$dataCenter.'.gigya.com/socialize.'.$apiMethod;\r\n // echo $l.\"\\n\";\r\n $req = OAuthRequest::from_request($httpMethod,$l,$parameters);\r\n $baseString = $req->get_signature_base_string();\r\n return base64_encode(hash_hmac('sha1', $baseString, base64_decode($secretKey), true));\r\n}",
"public function testNormalizeRequestParametersWithOauthSignatureIncluded()\n {\n $requestParameters = $this->requestParameters;\n $requestParameters['oauth_signature'] = 'testSignature';\n $normalizedParameters = $this->normalizedParameters;\n $normalizedParametersCalculated = $this->oauthServerService->normalizeRequestParameters($requestParameters);\n\n $this->assertEquals($normalizedParameters, $normalizedParametersCalculated);\n }",
"function getSignature($request, $key)\n {\n return base64_encode(hash_hmac('sha256', $request, $key, true));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
export category tree to dropdown element by groupCat 'member' | function dropdownCategoryMember($id_selected = '')
{
$cat_all = categoryParentChildTree(0,'member','','');
$export ='';
foreach ($cat_all as $items=>$item)
{
$id = $item['id'];
$name = $item['name'];
if(!empty($id_selected))
{
if ($id == $id_selected)
{
$export .= '<option value="'.$id.'" selected>'.$name.'</option>';
}
else
$export .= '<option value="'.$id.'">'.$name.'</option>';
}
else
{
$export .= '<option value="'.$id.'">'.$name.'</option>';
}
}
return $export;
return "<select id=\"category\">$export</select>";
} | [
"private function getDrilldownCatChooser() {\n\t\t$content_item = '';\n\t\t$this->outerArray['###WTDIRECTORY_CAT_TITLE###'] = $this->pi_getLL('wtdirectory_cat_title', 'Search form'); // title\n\t\t$this->outerArray['###WTDIRECTORY_CAT_ACTION###'] = $this->conf['filter.']['cat.']['clearOldFilter'] == 0 ? htmlentities($this->pi_linkTP_keepPIvars_url(array('hash' => 1), 1)) : htmlentities($this->cObj->typolink('x', array('returnLast' => 'url', 'additionalParams' => '&' . $this->prefixId . '[hash]=1', 'parameter' => $GLOBALS['TSFE']->id, 'useCacheHash' => 1))); // target for form\n\t\t$this->outerArray['###WTDIRECTORY_CAT_METHOD###'] = 'post'; // form method\n\t\t$this->outerArray['###CAT_BREADCRUMB###'] = $this->div->createCatBreadcrumb($this);\n\t\t$this->cat = $this->div->getTreeCategories($this);\n\n\t\tforeach ((array)$this->cat as $level1 => $value1) {\n\t\t\t$this->markerArray['###WTDIRECTORY_CAT_UID###'] = $level1;\n\t\t\t$this->markerArray['###LEVEL###'] = '1';\n\t\t\t$this->markerArray['###WTDIRECTORY_CAT_TITLE###'] = $value1['title'];\n\t\t\t$this->markerArray['###WTDIRECTORY_CAT_SELECTED###'] = ($this->piVars['catfilter'] == $level1 ? ' selected=\"selected\"' : '');\n\t\t\t$content_item .= $this->cObj->substituteMarkerArrayCached($this->tmpl['filter']['item'], $this->markerArray);\n\n\t\t\tforeach ((array)$this->cat[$level1]['_children'] as $level2 => $value2) {\n\t\t\t\t$this->markerArray['###WTDIRECTORY_CAT_UID###'] = $level2;\n\t\t\t\t$this->markerArray['###LEVEL###'] = '2';\n\t\t\t\t$this->markerArray['###WTDIRECTORY_CAT_TITLE###'] = $value2['title'];\n\t\t\t\t$this->markerArray['###WTDIRECTORY_CAT_SELECTED###'] = ($this->piVars['catfilter'] == $level2 ? ' selected=\"selected\"' : '');\n\t\t\t\t$content_item .= $this->cObj->substituteMarkerArrayCached($this->tmpl['filter']['item'], $this->markerArray);\n\n\t\t\t\tforeach ((array)$this->cat[$level1]['_children'][$level2]['_children'] as $level3 => $value3) {\n\t\t\t\t\t$this->markerArray['###WTDIRECTORY_CAT_UID###'] = $level3;\n\t\t\t\t\t$this->markerArray['###LEVEL###'] = '3';\n\t\t\t\t\t$this->markerArray['###WTDIRECTORY_CAT_TITLE###'] = $value3['title'];\n\t\t\t\t\t$this->markerArray['###WTDIRECTORY_CAT_SELECTED###'] = ($this->piVars['catfilter'] == $level3 ? ' selected=\"selected\"' : '');\n\t\t\t\t\t$content_item .= $this->cObj->substituteMarkerArrayCached($this->tmpl['filter']['item'], $this->markerArray);\n\n\t\t\t\t\tforeach ((array)$this->cat[$level1]['_children'][$level2]['_children'][$level3]['_children'] as $level4 => $value4) {\n\t\t\t\t\t\t$this->markerArray['###WTDIRECTORY_CAT_UID###'] = $level4;\n\t\t\t\t\t\t$this->markerArray['###LEVEL###'] = '4';\n\t\t\t\t\t\t$this->markerArray['###WTDIRECTORY_CAT_TITLE###'] = $value4['title'];\n\t\t\t\t\t\t$this->markerArray['###WTDIRECTORY_CAT_SELECTED###'] = ($this->piVars['catfilter'] == $level4 ? ' selected=\"selected\"' : '');\n\t\t\t\t\t\t$content_item .= $this->cObj->substituteMarkerArrayCached($this->tmpl['filter']['item'], $this->markerArray);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t$this->subpartArray['###CONTENT###'] = $content_item;\n\n\t\t$this->content = $this->cObj->substituteMarkerArrayCached($this->tmpl['filter']['cat'], $this->outerArray, $this->subpartArray);\n\t\t$this->content = $this->dynamicMarkers->main($this->conf, $this->cObj, $this->content);\n\t\t$this->content = preg_replace('|###.*?###|i', '', $this->content);\n\t}",
"function print_root_category_pulldown($selected = '', $cattype = '', $fieldname = 'cid', $slng = 'eng', $categorycache = array(), $showselectall = true, $showcanassigntoall = false, $shownone = false, $id = 'cid')\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n\t\t// #### use existing cache for building level 1 nodes ##########\n\t\tif (is_array($categorycache) AND count($categorycache) > 0)\n\t\t{\n\t\t\t$this->cats = $categorycache;\n\t\t}\n\t\t// #### build level 1 category nodes ###################\n\t\telse\n\t\t{\n\t\t\t$this->cats = $this->build_array($cattype, $_SESSION['ilancedata']['user']['slng'], 0, true, '', '', 0, -1, 1);\n\t\t}\n $html = '<select name=\"' . $fieldname . '\" id=\"' . $id . '\" class=\"select\">';\n\t\tif ($shownone)\n\t\t{\n\t\t\t$html .= '<option value=\"0\">{_none}</option>';\n\t\t}\n\t\tif ($showcanassigntoall AND defined('LOCATION') AND LOCATION == 'admin')\n {\n $html .= '<option value=\"-1\" style=\"background:yellow; color:#000\">{_assign_to_all_available_categories}</option>';\n\t\t\t$html .= '<option value=\"\">-----------------------</option>';\n }\n if (isset($selected) AND $selected > 0)\n {\n $html .= $this->fetch_recursive_category_options($selected, $cattype, $slng);\n\t\t\tif ($showselectall)\n\t\t\t{\n\t\t\t\t$html .= '<option value=\"\">└ {_all_categories_upper}</option>';\n\t\t\t}\n\t\t\t$html .= '<option value=\"\">-----------------------</option>';\n }\n else\n {\n\t\t\tif ($showselectall)\n\t\t\t{\n\t\t\t\t$html .= '<option value=\"\">{_all_categories_upper}</option>';\n\t\t\t}\n\t\t\t$html .= '<option value=\"\">-----------------------</option>';\n }\n $count = count($this->cats);\n for ($i = 0; $i < $count; $i++)\n {\n if ($this->cats[$i]['visible'] AND $this->cats[$i]['level'] == 1)\n {\n $html .= '<option value=\"' . $this->cats[$i]['cid'] . '\">' . handle_input_keywords($this->cats[$i]['title']) . '</option>';\n }\n }\n $html .= '</select>';\n return $html;\n }",
"function buildCategoryOptions($catId = 0)\r\n{\r\nglobal $conn;\r\n\t$sql = \"SELECT cat_code, cat_name\r\n\t\t\tFROM tbl_categories\r\n\t\t\tORDER BY cat_code\";\r\n\t$result = mysqli_query($conn, $sql) or die('Cannot get Category Name. ' . mysqli_error());\r\n\t\r\n\t$categories = array();\r\n\twhile($row = mysqli_fetch_array($result)) {\r\n\t\tlist($id, $name) = $row;\r\n\t\r\n\t\t\t// the child categories are put int the parent category's array\r\n\t\t\t$categories[$id]['children'][] = array('id' => $id, 'name' => $name);\t\r\n\t\r\n\t}\t\r\n\t\r\n\t// build combo box options\r\n\t$list = '';\r\n\tforeach ($categories as $key => $value) {\r\n\t\t//$name = $value['name'];\r\n\t\t$children = $value['children'];\r\n\t\t\r\n\t\t$list .= \"<optgroup label=\\\"$name\\\">\"; \r\n\t\t\r\n\t\tforeach ($children as $child) {\r\n\t\t\t$list .= \"<option value=\\\"{$child['id']}\\\"\";\r\n\t\t\tif ($child['id'] == $catId) {\r\n\t\t\t\t$list.= \" selected\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$list .= \">{$child['name']}</option>\\r\\n\";\r\n\t\t}\r\n\t\t\r\n\t\t$list .= \"</optgroup>\";\r\n\t}\r\n\t\r\n\treturn $list;\r\n}",
"function construct_insertion_group_pulldown($insertiongroup, $cattype)\r\n {\r\n global $ilance, $myapi, $phrase;\r\n \r\n $html = '<select name=\"insertiongroup\" style=\"font-family: verdana\">';\r\n $html .= '<option value=\"0\">'.$phrase['_no_insertion_group'].'</option>';\r\n \r\n $sql = $ilance->db->query(\"\r\n SELECT *\r\n FROM \" . DB_PREFIX . \"insertion_groups\r\n WHERE state = '\".$cattype.\"'\r\n GROUP BY groupname\r\n \");\r\n if ($ilance->db->num_rows($sql) > 0)\r\n {\r\n while ($res = $ilance->db->fetch_array($sql))\r\n {\r\n if (isset($insertiongroup) AND $insertiongroup == $res['groupname'])\r\n {\r\n $html .= '<option value=\"'.$res['groupname'].'\" selected=\"selected\">'.ucfirst($res['groupname']).'</option>';\t\r\n }\r\n else \r\n {\r\n $html .= '<option value=\"'.$res['groupname'].'\">'.ucfirst($res['groupname']).'</option>';\t\r\n }\r\n }\r\n }\r\n $html .= '</select>';\r\n \r\n return $html;\r\n }",
"public function getJSCategoryTree($grouping) {\n Warecorp::loadSmartyPlugin('modifier.utf8truncate.php');\n $Script = \"\";\n $tree_name = \"tree_\" . $grouping['id'];\n $tree_targete = \"tree_div_\" . $grouping['id'];\n $Script .= $tree_name.\" = new YAHOO.widget.TreeView('\".$tree_targete.\"');\";\n $Script .= \"treeCollection[treeCollection.length] = \".$tree_name.\";\";\n $Script .= \"var el_\".$grouping['id'].\" = \".$tree_name.\".getRoot();\";\n $tree_categories = $this->getCategoryTree($grouping['id']);\n if ( sizeof($tree_categories) != 0 ) {\n foreach ( $tree_categories as $category ) {\n if ( $category['type'] == 'category' ) {\n $label = $this->getJSCategoryLabel($category, $tree_name, $div_name);\n $Script .= \"categoryObj = { label : '\".$label.\"', catid : '\".$category['id'].\"', level : '\".($category['level'] - 1).\"', divid : '\".$div_name.\"', groupid: '\".$grouping['id'].\"'};\";\n $Script .= \"el_\".$category['id'].\" = new YAHOO.widget.TextNode(categoryObj, el_\".$category['parent'].\", true);\";\n $Script .= \"el_\".$category['id'].\".labelStyle = '';\";\n } elseif ( $category['type'] == 'item' ) {\n $g = Warecorp_Group_Factory::loadById($category['group_id'],Warecorp_Group_Enum_GroupType::GROUP_TYPE_SIMPLE);\n // @todo сделать проверку на существование группы\n $label = $this->getJSItemLabel($category, $tree_name, $g, $div_name);\n\n $Script .= \"categoryObj = { label : '\".$label.\"', divid : '\".$div_name.\"', treeObj : tree_\".$grouping['id'].\", groupID : '\".$g->getId().\"'};\";\n $Script .= \"el_\".$category['id'].\" = new YAHOO.widget.TextNode(categoryObj, el_\".$category['parent'].\", true);\";\n $Script .= \"el_\".$category['id'].\".labelStyle = '';\";\n\n $Script .= \"var dragged = new TreeDDProxy('treegroupitems\".$category['id'].\"');\";\n $Script .= \"dragged.relatedNode = el_\".$category['id'].\";\";\n $Script .= \"dragged.parentNode = el_\".$category['parent'].\";\";\n $Script .= \"dragged.groupID = '\".$g->getId().\"';\";\n $Script .= \"dragged.groupName = '\".smarty_modifier_utf8truncate(str_replace(\"'\", \"\\'\", str_replace(\"\\\\\", \"\\\\\\\\\", $g->getName())),27).\"';\";\n }\n }\n }\n $Script .= $tree_name.\".draw();\";\n return $Script;\n }",
"public function tree_dropdown()\n\t{\n\t\t$category_tree = $this->get_category_tree(array('category_status' => 1));\n\t\t$category_select = $this->_build_tree_select($category_tree, $selected);\n\t\treturn $this->_folder_list;\n\t}",
"function Coptgroup(){\r\n \r\n print('</optgroup>');\r\n \r\n }",
"function wc_walk_category_dropdown_tree(...$args)\n {\n }",
"function print_category_pulldown($catid = 0, $level)\r\n\t{\r\n\t\tglobal $ilance, $appendstr, $gbcatid;\r\n\t\t{\r\n\t\t\t$sql = $ilance->db->query(\"\r\n\t\t\t\tSELECT *\r\n\t\t\t\tFROM \" . DB_PREFIX . \"kbcategory\r\n\t\t\t\tWHERE categoryid = '\" . intval($catid) . \"'\r\n\t\t\t\tORDER BY sort ASC\r\n\t\t\t\", 0, null, __FILE__, __LINE__);\r\n\t\t\tif ($obj = $ilance->db->fetch_object($sql))\r\n\t\t\t{\r\n\t\t\t\t$sel = $spacer = '';\r\n\t\t\t\tif ($gbcatid == $catid)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sel = ' selected=\"selected\" ';\r\n\t\t\t\t}\r\n\t\t\t\t$appendstr = $appendstr . '<option ' . $sel . ' value=\"' . $catid . '\">';\r\n\t\t\t\t\r\n\t\t\t\tfor ($i = 0; $i < $level; $i++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$spacer .= ' ';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$appendstr = $appendstr . $spacer . $obj->catname . '</option>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sql2 = $ilance->db->query(\"\r\n\t\t\tSELECT *\r\n\t\t\tFROM \" . DB_PREFIX . \"kbcategory\r\n\t\t\tWHERE parent = '\" . intval($catid) . \"'\r\n\t\t\tORDER BY sort ASC\r\n\t\t\", 0, null, __FILE__, __LINE__);\r\n\t\twhile ($obj2 = $ilance->db->fetch_object($sql2))\r\n\t\t{\r\n\t\t\t$catid = $obj2->categoryid;\r\n\t\t\t$this->print_category_pulldown($catid, ($level + 1));\r\n\t\t}\r\n\t}",
"function getCategorySelect()\n\t\t{\n\t\t\t$categorys = $this->manage_content->getValue('category','*');\n\t\t\t\n\t\t\techo '<select class=\"form-control\" name=\"category\">';\n\t\t\tforeach ($categorys as $category) {\n\t\t\t\techo '<option value=\"'.$category['categoryId'].'\">'.$category['name'].'</option>';\n\t\t\t}\n\t\t\t\n\t\t\techo '</select>';\n\t\t}",
"function outputCategoryOptions($categories){\n foreach($categories as $category){\n echo \"<option value=\\\"\" . $category->getId() . \"\\\">\" . htmlspecialchars($category->getCategory()) . \"</option>\";\n }\n}",
"public function tmplDropDownCat() {\n\n ?>\n <div class=\"item-group item-control clearfix\">\n <label for=\"alicategories\" class=\"col-sm-6\" for=\"dropcat\"><?php _e(\"Categories\", 'ae') ?></label>\n <div class=\"col-sm-14\">\n <select name=\"dropcat\" id=\"dropcat\" class=\"w100\">\n <option value=\"0\"> ---- </option>\n <?php $this->taxonomy_options( 'shopcategory', 0, 0, null ); ?>\n </select>\n <p><em><?php _e(\"Select the category if you want to upload products in your own categories. Leave this field blank to make the Plugin create categories and upload products automatically. Necessary when selected All Categories\", 'ae') ?></em><br />\n <a href=\"<?php echo admin_url('edit-tags.php?taxonomy=shopcategory&post_type=products') ?>\"\n target=\"_blank\">+ <?php _e(\"Add new Category\", 'ae') ?></a></p>\n </div>\n </div>\n <div class=\"item-group control-group clearfix\">\n <label for=\"alistatus\" class=\"col-sm-6\"><?php _e('Status', 'ae') ?></label>\n <div class=\"col-sm-14\">\n <select id=\"alistatus\" name=\"publishstatus\" class=\"standart\">\n <?php\n $status = ad_constant_status();\n foreach( $status as $key => $val )\n printf(\n '<option value=\"%1$s\">%2$s</option>',\n $key,\n $val\n );\n ?>\n </select>\n <p><em><?php _e(\"Use Publish option if you want to publish products instantly. Use Draft option if you need to edit products before they appear on your site.\", 'ae') ?></em></p>\n </div>\n </div>\n <?php\n }",
"public static function get_cat_yerahical_option($cat=[], $parent=\"\", $nr= 0, $url=\"\", $is_in=''){\n $return =\"\";\n $split=\"\";\n for($i=1;$i<=$nr;$i++){\n $split .= \" \"; \n }\n $nr= $nr + 2;\n //$split = $parent==0? \"\": $split; \n foreach($cat as $maincat){\n if($maincat->parent==$parent){\n $id_or_url= strpos($url, 'admin') !== false ? $maincat->id : \n \\Wh::generate_cat_url($maincat->id);\n \n $val= !empty($url) ? $url.\"/\".$id_or_url : $maincat->id;\n \n \n $selected = @$maincat->id == $is_in? 'selected=\"\"': \"\";\n $return .='<option value=\"'.$val.'\" '.$selected.'> '.$split.$maincat->title.'</option>'; \n $return .= \\Wh::get_cat_yerahical_option($cat, $maincat->id, $nr, $url, $is_in);\n } \n }\n return $return; \n}",
"function getXMLCategTree() {\n if (isset($this->categs) && is_array($this->categs)) {\n $result = sprintf(\n '<listview title=\"%s\">'.LF,\n papaya_strings::escapeHTMLChars($this->_gt('Categories'))\n );\n $result .= '<items>'.LF;\n $selected = empty($this->params['categ_id']) ? ' selected=\"selected\"' : '';\n $result .= sprintf(\n '<listitem href=\"%s\" title=\"%s\" image=\"%s\" %s/>'.LF,\n papaya_strings::escapeHTMLChars($this->getLink()),\n papaya_strings::escapeHTMLChars($this->_gt('Base')),\n papaya_strings::escapeHTMLChars($this->images['places-desktop']),\n $selected\n );\n $result .= $this->getXMLCategSubTree(0, 0);\n $result .= '</items>'.LF;\n $result .= '</listview>'.LF;\n $this->layout->addLeft($result);\n }\n }",
"function print_filter_show_category() {\n\tglobal $t_select_modifier, $t_filter;\n\t?>\n\t\t<!-- Category -->\n\t\t<select <?php echo $t_select_modifier;?> name=\"<?php echo FILTER_PROPERTY_CATEGORY;?>\">\n\t\t\t<option value=\"<?php echo META_FILTER_ANY?>\" <?php check_selected( $t_filter[FILTER_PROPERTY_CATEGORY], META_FILTER_ANY );?>>[<?php echo lang_get( 'any' )?>]</option>\n\t\t\t<?php print_category_filter_option_list( $t_filter[FILTER_PROPERTY_CATEGORY] )?>\n\t\t</select>\n\t\t<?php\n}",
"function toggle_child_categories() {\n\t\techo '\n\t\t\t<script>\n\t\t\tjQuery(\".selectit input\").change(function(){\n\t\t\t\tvar $chk = jQuery(this);\n\t\t\t\tvar ischecked = $chk.is(\":checked\");\n\t\t\t\t$chk.parent().parent().siblings().children(\"label\").children(\"input\").each(function(){\n\t\t\t\tvar b = this.checked;\n\t\t\t\tischecked = ischecked || b;\n\t\t\t\t})\n\t\t\t\tcheckParentNodes(ischecked, $chk);\n\t\t\t});\n\t\t\tfunction checkParentNodes(b, $obj)\n\t\t\t{\n\t\t\t\t$prt = findParentObj($obj);\n\t\t\t\tif ($prt.length != 0)\n\t\t\t\t{\n\t\t\t\t $prt[0].checked = b;\n\t\t\t\t checkParentNodes(b, $prt);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction findParentObj($obj)\n\t\t\t{\n\t\t\t\treturn $obj.parent().parent().parent().prev().children(\"input\");\n\t\t\t}\n\t\t\t</script>\n\t\t\t';\n\t}",
"public function getCategoryDropdown()\n\t{\n\t\t$parents = GenericImageBankCategory::model()->findAll('parentcatid IS NULL'); //quering all parent categories\n\t\t$data = array();\n\t\t$nochild = array();\n\t\tforeach($parents as $parent)\n\t\t{\n\t\t\t$sub_data = array();\t\t\t\t\n\t\t\tif (empty($parent->children)) { // seperating parent categories those have no children\n\t\t\t\t$nochild [$parent->categoryid] = $parent->category_name;\n\t\t\t}\n\t\t\telse {\t\n\t\t\t\tforeach($parent->children as $child) // grouping child categories with parent category heading\n\t\t\t\t{\n\t\t\t\t\t$sub_data[$child->categoryid] = $child->category_name;\n\t\t\t\t}\n\t\t\t\t$data[$parent->category_name] = $sub_data;\n\t\t\t}\n\t\t\t$data[\"Main\"] = $nochild;\n\t\t}\n\t\treturn $data;\n\t}",
"public function multiselect_children_of_category_fields($args) {\n\t \n\t /*\n\t * retain selection values in c !ase of repost due to error\n\t */\n\t $category = $args['category'];\n\t $subcategories = $args['subcategories'];\n\t $type = 'div';\n\t if ( ! empty( $args['type'] ) ) {\n\t $type = $args['type'];\n\t }\n\t $page = '';\n\t $ms_var_name = '_vmat_volunteer_' . strtolower($category);\n\t if ( array_key_exists( 'value', $args ) ) {\n\t $ms_var = array_map('strval', $args['value']);\n\t } else {\n\t $ms_var = [];\n\t /*\n\t * retain selection values in case of repost due to error\n\t */\n\t if ( array_key_exists( $ms_var_name, $_POST ) ) {\n\t $ms_var = $_POST[$ms_var_name];\n\t $ms_var = array_map('strval', $ms_var);\n\t }\n\t }\n\t if ( $type != 'div') {\n\t $page .= '<th>Choose your ' . $category . '</th>';\n\t $page .= '<td>';\n\t }\n\t $page .= '<fieldset>';\n\t if ( $type == 'div' ) {\n\t $page .= '<legend>Choose your ' . $category . '</legend>';\n\t }\n\t foreach ($subcategories as $subcategory) {\n\t $page .= '<div>';\n\t $page .= '<input type=\"checkbox\"\n \t id=\"' . 'vmat-' . esc_attr( $subcategory->slug ) . '\"\n \t name=\"' . $ms_var_name . '[]\"\n \t value=\"' . esc_attr( $subcategory->name ) . '\" ';\n\t if ( in_array($subcategory->name, $ms_var) ) {\n\t $page .= \"checked\";\n\t }\n\t $page .= '/>';\n\t $page .= '<label for=\"vmat-' . esc_attr( $subcategory->slug ) . '\">' . esc_html( __($subcategory->name, 'vmattd') ) . '</label>';\n\t $page .= '</div>';\n\t }\n\t $page .= '</fieldset>';\n\t if ( $type != 'div' ) {\n\t $page .= '</td>';\n\t }\n\t return $page;\n\t}",
"public function buildCategoryOptionsTree()\n\t{\n\t\t$sort_column = 'cat_order';\n\t\tif ($this->sort_order == 'a')\n\t\t{\n\t\t\t$sort_column = 'cat_name';\n\t\t}\n\n\t\treturn $this->buildCategoryList(\n\t\t\t$this->Categories->filter('parent_id', 0),\n\t\t\t$sort_column\n\t\t);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return product for current item | public function getProductItem()
{
return $this->getItem()->getProduct();
} | [
"public function getProduct()\r\n {\r\n return Mage::registry('current_product');\r\n }",
"public function getProduct()\n {\n return app()->make($this->order_item_type)->find($this->order_item_id);\n }",
"public function getProduct()\n {\n return $this->_coreRegistry->registry('current_product');\n }",
"private function getCurrentProduct()\n {\n return $this->registry->registry('current_product');\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"public function getCurrentProduct()\n {\n return $this->_registry->registry('current_product');\n }",
"public function getCurrentProduct()\n {\n return $this->catalogHelper->getProduct();\n }",
"public function getProduct() {\n\t\t$this->db->setQuery(\"SELECT * FROM products WHERE product_id=$this->productId\");\n\t\t$result = $this->db->executeQuery();\n\t\treturn $result;\n\t}",
"public function getProduct(): Product\n {\n return $this->product;\n }",
"public function product()\n\t{\n\n\t\t//prints specific product details to screen based on user choice\n\n\t\t// Make sure the correct parameter was passed to the page\n\t\tif (!isset($_REQUEST['itemID']))\n\t\t\t$this->__default();\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t$this->templateFileName = 'product.tpl';\n\t\t\t\n\t\t\t// Get the item data\n\t\t\t$itemSQL = \"SELECT * FROM b_item WHERE item_id = ?\";\n\t\t\t$item = $this->dbConnection->prepareRecord($itemSQL, $_REQUEST['itemID']);\n\t\t\tif (!$item)\n\t\t\t\tthrow new \\Exception(\"Item not found\");\n\t\t\t\n\t\t\t// Get the breadcrumb data\n\t\t\t$breadcrumbs = $this->getBreadcrumbs($_REQUEST['itemID'], 'I');\n\t\t\t\n\t\t\t\n\t\t\t// Check if the item has a current special\n\t\t\t$special_sql = \"SELECT special_id, item_id, DATE_FORMAT(start_date, '%W, %M %D %Y') AS start_date, DATE_FORMAT(end_date, '%W, %M %D %Y') AS end_date, price FROM b_item_special s WHERE s.item_id = ? AND CURRENT_DATE() BETWEEN start_date AND end_date ORDER BY price LIMIT 1\";\n\t\t\t$special = $this->dbConnection->prepareRecord($special_sql, $_REQUEST['itemID']);\n\t\t\t\n\t\t\t\n\t\t\t// Set the output data\n\t\t\t$this->set('item', $item);\n\t\t\t$this->set('breadcrumbs', $breadcrumbs);\n\t\t\t$this->set('special', $special);\n\t\t\t\n\t\t}\n\n\t}",
"private function getProduct()\n\t{\n\n\t\tif ($this->product === null) {\n\t\t\t$productData = $this->requisitionListProduct->prepareProductData(\n\t\t\t\t$this->getRequest()->getParam('product_data')\n\t\t\t);\n\t\t\t$this->product = $this->requisitionListProduct->getProduct($productData->getSku());\n\t\t}\n\t\treturn $this->product;\n\t}",
"public function getProduct()\r\n {\r\n return $this->fields['Product']['value'];\r\n }",
"public function getProduct() \n {\n return $this->_fields['Product']['FieldValue'];\n }",
"public function getProduct() {\r\n\r\n if( empty($this->Product) ) {\r\n $this->Product = Product::create($this->getId());\r\n }\r\n return $this->Product;\r\n }",
"private function getProduct()\n {\n $productId = $this->design->getProductId();\n $parentIds = $this->catalogProductTypeConfigurable->getParentIdsByChild($productId);\n\n return $this->product->load(reset($parentIds));\n }",
"public function getProductObject()\n\t{\n\t\treturn $this->product_object;\n\t}",
"public function getRelatedProduct()\n {\n return $this->getProducts()->getItemById($this->getRelatedProductId());\n }",
"public function getProductData() \n { \t\t\n\t\t$quoteId = $this->getRequest()->getParam('id');\n\t\t$product = Mage::getModel('qquoteadv/qqadvproduct')->getCollection()\n\t\t\t\t\t\t->addFieldToFilter('quote_id',$quoteId);\n\t\treturn $product;\t\n }",
"public function getProductById( $productId );"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SendOutputs is similar to the existing sendmany call in Bitcoind, and allows the caller to create a transaction that sends to several outputs at once. This is ideal when wanting to batch create a set of transactions. | public function SendOutputs(\Walletrpc\SendOutputsRequest $argument,
$metadata = [], $options = []) {
return $this->_simpleRequest('/walletrpc.WalletKit/SendOutputs',
$argument,
['\Walletrpc\SendOutputsResponse', 'decode'],
$metadata, $options);
} | [
"public function sendOutputGroup($outputs)\n {\n $firstOutput;\n $formatted = array();\n foreach($outputs as $output)\n {\n if(empty($firstOutput)) $firstOutput = $output;\n $formatted[] = $this->formatOutput($output, strtolower($output->method) . 'Response', $returnRaw = true);\n }\n\n $userID = isset($firstOutput->userID) ? $firstOutput->userID : 0;\n $method = isset($firstOutput->method) ? $firstOutput->method : '';\n $result = isset($firstOutput->result) ? $firstOutput->result : 'success';\n $finalOutput = $this->appendResponseHeader($formatted, $userID, $firstOutput->users, $method, $result);\n die($this->app->encrypt($finalOutput));\n }",
"function sendToMany(array $addressesAmounts)\n {\n // send to many addresses\n// foreach ($addressesAmounts as $address => $amount){\n// $this -> bitcoind -> sendtoaddress($address, $amount);\n// }\n\n $this->bitcoind->sendmany(\"\", $addressesAmounts, (int)config('marketplace.bitcoin.minconfirmations'));\n\n\n if ($this->bitcoind->error) {\n $errorString = \"\";\n foreach ($addressesAmounts as $address => $amount){\n $errorString .= \"To $address : $amount \\n\";\n }\n throw new \\Exception( $this->bitcoind->error . \"\\nSending to: $errorString\" );\n }\n }",
"public function transferCoins($ownerKey, array $coins, array $outputs) {\n $inputs = array_map(function (Coin $coin) {\n return $coin->getInput();\n }, $coins);\n\n $transferred = Coin::transfer($inputs, $outputs, new Signer($this->key, $ownerKey));\n (new Verification($this->key))->verifyAll($transferred)->mustBeOk();\n return $transferred;\n }",
"public function setOutputs(array $outputs) : void\n {\n $this->outputs = [];\n $this->addOutputs($outputs);\n }",
"public static function send_bitcoin($input, $outputs) {\n\n\t$money = new Money();\n\n\t$ch = curl_init();\n\n\tcurl_setopt($ch, CURLOPT_URL, \"https://api.coinprism.com/v1/sendbitcoin?format=raw\");\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\tcurl_setopt($ch, CURLOPT_HEADER, FALSE);\n\n\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\n\t\t$from = \"\\\"$input\\\"\";\n\t\t\n\t\t$to = '';\n\t\tforeach($outputs as $output) {\n\t\t$amount = $output['amount'];\n\t\t$to .= \"{\\\"address\\\": \\\"{$output['address']}\\\", \\\"amount\\\": \\\"$amount\\\"}, \";\n\t\t}\n\t\t\n\t$to = substr($to, 0, -2);\n\t$fees = DEFAULT_TRANSACTION_FEE;\n\n\t$json = \"{\n\t \\\"fees\\\": $fees,\n \t \\\"from\\\": $from,\n \t \\\"to\\\": [\n \t\t $to\n\t\t]\n\t}\";\n\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n\t\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n \t \"Content-Type: application/json\"\n\t));\n\n\t$response = json_decode(curl_exec($ch));\n\tcurl_close($ch);\n\n\treturn $response->raw;\n\t}",
"public static function send_asset($input, $outputs) {\n\n\t$ch = curl_init();\n\n\tcurl_setopt($ch, CURLOPT_URL, \"https://api.coinprism.com/v1/sendasset?format=raw\");\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\tcurl_setopt($ch, CURLOPT_HEADER, FALSE);\n\n\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\n\t\t$from = \"\\\"$input\\\"\";\n\n\t\t$to = '';\n\t\tforeach($outputs as $output) {\n\t\t$to .= \"{\\\"address\\\": \\\"{$output['address']}\\\",\n\t\t\t \\\"amount\\\": \\\"{$output['amount']}\\\",\n\t\t\t \\\"asset_id\\\": \\\"{$output['asset_id']}\\\"\n\t\t \t}, \";\n\t\t\n\t\t}\n\t$to = substr($to, 0, -2);\n\n\t$fees = DEFAULT_TRANSACTION_FEE;\n\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, \"{\n\t \\\"fees\\\": $fees,\n \t \\\"from\\\": $from,\n \t \\\"to\\\": [\n \t\t $to\n\t\t]\n\t}\");\n\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n \t\t\"Content-Type: application/json\"\n\t));\n\n\t$response = json_decode(curl_exec($ch));\n\tcurl_close($ch);\n\n\treturn $response->raw;\n\t}",
"public function sendTransaction(\n int $anonymity,\n array $transfers,\n int $fee,\n array $addresses = null,\n int $unlockTime = null,\n string $extra = null,\n string $paymentId = null,\n string $changeAddress = null\n ):JsonResponse {\n $params = [\n 'anonymity' => $anonymity,\n 'transfers' => $transfers,\n 'fee' => $fee,\n ];\n\n if (!is_null($addresses)) $params['addresses'] = $addresses;\n if (!is_null($unlockTime)) $params['unlockTime'] = $unlockTime;\n if (!is_null($extra)) $params['extra'] = $extra;\n if (!is_null($paymentId)) $params['paymentId'] = $paymentId;\n if (!is_null($changeAddress)) $params['changeAddress'] = $changeAddress;\n\n return $this->rpcPost('sendTransaction', $params);\n }",
"public function addOutputs(array $outputs)\n {\n foreach ($outputs as $output) {\n $this->addOutput($output);\n }\n }",
"public static function _encode_outputs($vout_arr, $output_count)\n {\n // If $vout_arr is empty, check if it's MEANT to be before failing.\n if (count($vout_arr) == 0) {\n return ($output_count == 0) ? '' : false;\n }\n\n $outputs = '';\n for ($i = 0; $i < $output_count; $i++) {\n $satoshis = $vout_arr[$i]['value'] * 1e8;\n $amount = self::_dec_to_bytes($satoshis, 8);\n $amount = self::_flip_byte_order($amount);\n\n $script_size = strlen($vout_arr[$i]['scriptPubKey']['hex']) / 2; // number of bytes\n $script_varint = self::_encode_vint($script_size);\n $scriptPubKey = $vout_arr[$i]['scriptPubKey']['hex'];\n\n $outputs .= $amount . $script_varint . $scriptPubKey;\n }\n return $outputs;\n }",
"public function send()\n {\n $requests = $this->getBatch()->flush();\n\n $results = array();\n foreach($requests as $request){\n $response = $request->getResponse();\n $results[] = $this->buildResult($response);\n }\n\n $exceptions = $this->getBatch()->getExceptions();\n if ($exceptions){\n foreach($exceptions as $exception){\n $this->exceptions[] = $exception->getPrevious();\n $exceptionRequests = $exception->getBatch();\n\n foreach($exceptionRequests as $requestE){\n $responseE = $requestE->getResponse();\n $statusCode = $responseE->getStatusCode();\n if ($statusCode == 200){\n $results[] = $this->buildResult($responseE);\n }\n }\n }\n $this->getBatch()->clearExceptions();\n }\n\n\n return $results;\n }",
"public function sendTransactions($input)\r\n {\r\n return $this->getBlockChainSdkObj()->sendTransactions($input);\r\n }",
"public function sendAll();",
"public function setOutputs(&$var)\n {\n $arr = GPBUtil::checkMapField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->outputs = $arr;\n }",
"public function setExpectedOutputs($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Remoteworkers\\V1test2\\CommandTask\\Outputs::class);\n $this->expected_outputs = $var;\n\n return $this;\n }",
"private function send_data_multiple($users, $action, $params) {\n\t\t$data = array('action' => $action, 'params' => $params);\n\t\t$json = json_encode($data);\n\t\t\n\t\t//Iterate all users\n\t\tforeach($users as $user) {\n\t\t\t\n\t\t\t//For each user iterate over their connections\n\t\t\tif(isset($this->clients[$user->id])) {\n\t\t\t\tforeach($this->clients[$user->id] as $conn) {\n\t\t\t\t\t$conn->send($json);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new Twitter_FriendsAndFollowers_OutgoingFriendships_Execution($this->session, $this, $inputs, $async, $store_results);\n }",
"protected function wrapResults($outputs)\n {\n return new Twitter_FriendsAndFollowers_OutgoingFriendships_Results($outputs);\n }",
"protected function wrapResults($outputs)\n {\n return new Twitter_DirectMessages_SendDirectMessage_Results($outputs);\n }",
"public function getOutputs(): array {\n return $this->_outputs;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The text parsers are defined as plugins. | private function initialise_text_parser()
{
$plugin_path = $this->system_folder.DS.'plugins'.DS.$this->text_parser.DS;
require_once $plugin_path.'plugin.'.$this->text_parser.'.php';
$class = 'Plugin_'.$this->text_parser;
$this->parser = new $class;
} | [
"public function parse($text)\n {\n }",
"abstract public function registerParsers();",
"public function getParser($text, $parserId = '');",
"abstract protected function parse($text = null);",
"public function textParser($text) {\n $text = preg_replace('#\\x{00a0}#iu', ' ', $text);\n // Iterate over terms and search matches for each of them\n foreach($this->terms as $term) {\n /** @var Term $termObject */\n $termObject = $term['term'];\n $replacements = &$term['replacements'];\n\n //Check replacement counter\n if(0 !== $term['replacements']) {\n /*\n * Regex Explanation:\n * Group 1: (^|[\\s\\>[:punct:]])\n * ^ = can be begin of the string\n * \\G = can match an other matchs end\n * \\s = can have space before term\n * \\> = can have a > before term (end of some tag)\n * [:punct:] = can have punctuation characters like .,?!& etc. before term\n *\n * Group 2: (' . preg_quote($term->getName()) . ')\n * The term to find, preg_quote() escapes special chars\n *\n * Group 3: ($|[\\s\\<[:punct:]])\n * Same as Group 1 but with end of string and < (start of some tag)\n *\n * Group 4: (?![^<]*>|[^<>]*<\\/)\n * This Group protects any children element of the tag which should be parsed\n * ?! = negative lookahead\n * [^<]*> = match is between < & > and some other character\n * avoids parsing terms in self closing tags\n * example: <TERM> will work <TERM > not\n * [^<>]*<\\/ = match is between some tag and tag ending\n * example: < or >TERM</>\n *\n * Flags:\n * i = ignores camel case\n */\n $regex = '#' .\n '(^|\\G|[\\s\\>[:punct:]])' .\n '(' . preg_quote($termObject->getName()) . ')' .\n '($|[\\s\\<[:punct:]])' .\n '(?![^<]*>|[^<>]*<\\/)' .\n '#i';\n\n // replace callback\n $callback = function ($match) use ($termObject, &$replacements) {\n //decrease replacement counter\n if(0 < $replacements) {\n $replacements--;\n }\n // Use term match to keep original camel case\n $termObject->setName($match[2]);\n\n // Wrap replacement with original chars\n return $match[1] . $this->termWrapper($termObject) . $match[3];\n };\n\n // Use callback to keep allowed chars around the term and his camel case\n $text = preg_replace_callback($regex, $callback, $text, $replacements);\n }\n }\n\n return $text;\n }",
"public function startParser($text)\n\t{\n\t\t$this->text = $text;\n\t\tHook::event(\"AllyPageParserBegin\", array($this));\n\t\t$me = $this;\n\t\t$this->text = preg_replace_callback(\"/\\{list\\:([^\\\"]+)\\|(yes|no)\\|(yes|no)\\|(yes|no)\\}/siU\", function($matches) use($me) {\n\t\t\treturn $me->replaceList($matches[1], $matches[2], $matches[3], $matches[4]);\n\t\t}, $this->text);\n\t\t$this->text = preg_replace_callback(\"/\\{member\\|(yes|no)\\|([^\\\"]+)\\}/siU\", function($matches) use($me) {\n\t\t\treturn $me->replaceMember($matches[1], $matches[2]);\n\t\t}, $this->text);\n\t\t$this->text = str_replace(\"{points}\", $this->getPoints(), $this->text);\n\t\t$this->text = str_replace(\"{totalmember}\", $this->getTotalMember(), $this->text);\n\t\t$this->text = str_replace(\"{average}\", $this->getAverage(), $this->text);\n\t\t$this->text = str_replace(\"{no}\", $this->getNumber(), $this->text);\n\t\t$this->text = preg_replace(\"~src=['\\\"]([^'\\\"]+)['\\\"]~i\", \"src=\\\"\".BASE_URL.\"img/remote.php?file=\\\\1\\\"\", $this->text);\n\t\tHook::event(\"AllyPageParserEnd\", array($this));\n\t\treturn $this->text;\n\t}",
"function pbe_run_parsers($text)\n{\n\t// Run our parsers, as defined in the ACP, to remove the original \"replied to\" message\n\t$text_save = $text;\n\t$result = pbe_parse_email_message($text);\n\n\t// If we have no message left after running the parser, then they may have replied\n\t// below and/or inside the original message. People like this should not be allowed\n\t// to use the net, or be forced to read their own messed up emails\n\tif (empty($result) || (trim(strip_tags(pbe_filter_email_message($text))) === ''))\n\t{\n\t\t$text = $text_save;\n\t}\n\n\treturn $text;\n}",
"public function get_text_parser() {\n\t\t// Lazy-load text parser.\n\t\tif ( ! isset( $this->text_parser ) ) {\n\t\t\t$this->text_parser = new Parse_Text( $this->encodings );\n\t\t}\n\n\t\treturn $this->text_parser;\n\t}",
"function parse()\n {\n // described interwiki links\n $tmp_regex = '/\\[' . $this->regex . ' (.+?)\\]/';\n $this->wiki->source = preg_replace_callback(\n $tmp_regex,\n array(&$this, 'processDescr'),\n $this->wiki->source\n );\n \n // standalone interwiki links\n $tmp_regex = '/' . $this->regex . '/';\n $this->wiki->source = preg_replace_callback(\n $tmp_regex,\n array(&$this, 'process'),\n $this->wiki->source\n );\n \n }",
"function parse()\n {\n // described wiki links\n $tmp_regex = '/\\[' . $this->regex . ' (.+?)\\]/';\n $this->wiki->source = preg_replace_callback(\n $tmp_regex,\n array(&$this, 'processDescr'),\n $this->wiki->source\n );\n \n // standalone wiki links\n $tmp_regex = '/(^|[^A-Za-z0-9\\-_])' . $this->regex . '/';\n $this->wiki->source = preg_replace_callback(\n $tmp_regex,\n array(&$this, 'process'),\n $this->wiki->source\n );\n }",
"abstract public function processText($text);",
"function parse() {\n // standalone interwiki links\n $tmp_regex = '/\\[(' . $this->regex . ')\\]/';\n $this->wiki->source = preg_replace_callback(\n $tmp_regex, array(&$this, 'process'), $this->wiki->source);\n\n // described interwiki links\n $tmp_regex = '/\\[' . $this->regex . ' (.+?)\\]/';\n $this->wiki->source = preg_replace_callback(\n $tmp_regex, array(&$this, 'processDescr'), $this->wiki->source);\n\n }",
"function parse_plugins($html) {\n $PluginParser = Singleton::getInstance('PluginParser');\n $PluginParser->execute($html);\n return $PluginParser->getHtml();\n}",
"public function parseText( string $text )\n {\n $parsed = $text;\n $replace = [ ];\n \n # Parse it:\n preg_match_all($this->regex, $text, $result, PREG_SET_ORDER, 0);\n \n # Loop over the matches:\n foreach( $result as $r )\n {\n $content = (count($r) > 3) ? $this->app->parseShortcodes($r[3]) : null;\n $attributes = [ ];\n \n # Parse the attributes:\n if( ! empty($r[2]) )\n {\n preg_match_all($this->attrRegex, trim(str_replace('"', '\"', $r[2])), $attResult);\n \n $attributes = (empty($attResult[1])) ? [ ] : array_combine(array_filter($attResult[1]), $attResult[2]);\n }\n \n $replace[] = $this->execCallback( $attributes, $content );\n }\n \n # Loop over and replace it:\n foreach( $result as $i => $r )\n {\n $parsed = str_replace($r[0], $replace[$i], $parsed);\n }\n \n return $parsed;\n }",
"function parserHook( $input, $args, &$parser ) \n\t\t{\n $output = $parser->parse( $input, $parser->mTitle, $parser->mOptions, false, false );\n return $output->getText();\n }",
"private function parseText($text) {\n\t$lines = explode(\"\\r\\n\", $text);\n\t\n\tforeach($lines as $id => $line) {\n\t $this->parseLine($id, $line);\n\t}\n }",
"abstract public function getAvailableParsers(): array;",
"function parse()\n\t{\n\t\t// have to get all the heading entries before we can parse properly.\n\t\t$this->_getEntries();\n\t\t\n\t\t// now parse the source text for TOC entries\n\t\tparent::parse();\n\t}",
"protected function registerDefaultParsers()\n {\n $this->parsers = [\n new AutolinkParser(),\n new RawHTMLParser(),\n new CodeSpanParser(),\n new ImageParser(),\n new LinkParser(),\n new StrongEmphasisParser(),\n new EmphasisParser(),\n new LineBreakParser(),\n new TextParser(),\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
END FUNCTION added by unixman to extend syntax: ~Subscript~ | private function inlineSubscript($Excerpt) {
//--
if(!isset($Excerpt['text'][0])) {
return;
} //end if
//--
if($Excerpt['text'][0] === '~' AND $Excerpt['text'][1] !== '~' AND preg_match('/^~(?=\S)(.+?)(?<=\S)~/', $Excerpt['text'], $matches)) {
return array(
'extent' => strlen($matches[0]),
'element' => array(
'name' => 'sub',
'text' => $matches[1],
'handler' => 'line',
),
);
} //end if
//--
} | [
"function sub() {\n\t\t$this->marks[] = [\n\t\t\t'type' => 'subsup',\n\t\t\t'attrs' => [\n\t\t\t\t'type' => 'sub'\n\t\t\t]\n\t\t];\n\t\treturn $this;\n\t}",
"static function getSubCommands();",
"function WordRightEndExtend(){}",
"public function testSuperscript() {\n $this->assertEquals('<sup>Superscript</sup>', $this->object->reset('[sup]Superscript[/sup]')->parse());\n }",
"public function visitBinarySub(Node $node);",
"function getSubComponent( $suffix = false )\n{ \n\t$suffix = $suffix ? '_' . $suffix : '';\n\n \treturn [\n\t\t'label' => 'Description (sub)',\n\t\t'name' => 'subCompDescription' . $suffix,\n\t\t'type' => 'group',\n\t\t'instructions' => '',\n\t\t'required' => 0,\n\t\t'wrapper' => [\n\t\t\t'width' => '',\n\t\t\t'class' => '',\n\t\t\t'id' => '',\n\t\t],\n\t\t'layout' => 'block',\n\t\t'sub_fields' => getSubFields( true )\n \t]; \n\n}",
"public function addSubChapter(){}",
"function sup() {\n\t\t$this->marks[] = [\n\t\t\t'type' => 'subsup',\n\t\t\t'attrs' => [\n\t\t\t\t'type' => 'sup'\n\t\t\t]\n\t\t];\n\t\treturn $this;\n\t}",
"function testTextSubscript(){\n $this->openRandomPage();\n parent::verifyTextSubscript();\n parent::doLogout();\n }",
"public function sup($content = '')\n\t{\n\t\treturn $this->append('sup', $content);\n\t}",
"public function testSubCommandsPluginDotNotation(): void\n {\n $this->exec('completion subcommands test_plugin_two.example');\n $this->assertExitCode(Command::CODE_SUCCESS);\n\n $expected = 'say_hello';\n $this->assertOutputContains($expected);\n }",
"function ncurses_use_extended_names($flag)\n{\n}",
"function WordRightExtend(){}",
"function superscript_close() {\n $this->_close();\n }",
"public function manageMultipleExtends()\n\t{\n\t\t// destroy the actual node and creat many nodes that have\n\t\t// mono extend. the first one gets all the css rules\n\t\tforeach($this->parts as $keystr => $codestr)\n\t\t{\n\t\t\tif(strpos($keystr, 'extends') !== FALSE)\n\t\t\t{\n\t\t\t\t$result = $this->regex_extend($keystr);\n\t\t\t\t\n\t\t\t\t$parent = trim($result[3][0]);\n\t\t\t\t$child = trim($result[1][0]);\n\t\t\t\t\n\t\t\t\tif(strpos($parent, '&') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$kill_this = $child.' extends '.$parent;\n\t\t\t\t\t\n\t\t\t\t\t$parents = explode(' & ', $parent);\n\t\t\t\t\t$with_this_key = $child.' extends '.$parents[0];\n\t\t\t\t\t\n\t\t\t\t\t$add_keys = array();\n\t\t\t\t\t$count_parents = count($parents);\n\t\t\t\t\tfor($i = 1; $i < $count_parents; $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($add_keys, $child.' extends '.$parents[$i]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->parts = $this->add_node_at_order($kill_this, $with_this_key, $codestr, $add_keys);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function balise_TAILLE_DOC($p) {\r\n\t$p->code = '$Pile[$SP][\\'taille\\']';\r\n\t$p->interdire_scripts = false;\r\n\treturn $p;\r\n}",
"public function getIsSuperscript()\n\t{\n\t\treturn $this->isSuperscript;\t\n\t}",
"public function remove_subcommand( $name ) {\n }",
"function swf_endsymbol()\n{\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Destroy this object, ensure that the Guzzle client is nulled out | function __destroy()
{
$this->client = null;
} | [
"private static function destroy()\n {\n self::$client = null;\n }",
"public function __destruct() {\n\t\t\t$this->service->destroy();\n\t\t}",
"public function __destroy()\r\n\t{\r\n\t\tcurl_close($this->curl);\r\n\t}",
"public function destroy()\n {\n curl_close($this->curl);\n }",
"public function destroy(){\n $id = $this->id();\n if($id){\n $this->_rest->deleteObject($this->objectClass,$id);\n $this->clearDirtyKeys();\n $this->attributes($this->resetAttributes($this->attributes()));\n }\n }",
"public function __destruct()\n {\n curl_close($this->apiConnection);\n }",
"function __destruct()\n {\n $this->_invalidateBearerToken();\n }",
"public function __destruct()\n {\n unset($this->manager);\n }",
"public function destroy() {\n $this->actual['sid'] = null;\n $this->actual['tok'] = null;\n }",
"public function disconnect()\n {\n $this->arangoClient = null;\n }",
"public function resetClient() {\n $this->client = new Client([\n 'base_uri' => $this->base_url,\n 'headers' => $this->headers\n ]);\n $this->errors = new Collection();\n $this->response = null;\n }",
"public function __destruct()\n {\n if ($this->resource instanceof \\Gmagick) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n }",
"public function __destruct() {\r\n if(is_resource($this->curl_handle)){\r\n @curl_close($this->curl_handle);\r\n }\r\n }",
"public function tearDown()\n {\n static::destroySingleton(Client::class);\n\n parent::tearDown();\n }",
"public function __destruct() {\n if (is_resource($this->curl)) {\n curl_close($this->curl);\n }\n }",
"public function __destruct ()\n {\n curl_close($this->_curl);\n $this->_curl = null;\n }",
"public function __destruct()\n {\n Promise\\unwrap(self::$promises);\n }",
"public static function destroyMock() {\n\t\tself::$__mockedInstance = null;\n\t}",
"public static function destroy()\n {\n self::$instance = null;\n }",
"public function __destruct()\n {\n if ($this->resource instanceof \\Imagick) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Testing _fcpoGetUpdateQuery inserting a new entry | public function test__fcpoGetUpdateQuery_Insert()
{
$oTestObject = $this->getMock('fcpoerrormapping', array('_fcpoIsValidNewEntry'));
$oTestObject->expects($this->any())->method('_fcpoIsValidNewEntry')->will($this->returnValue(true));
$oMockUtilsObject = $this->getMock('oxUtilsObject', array('generateUID'));
$oMockUtilsObject->expects($this->any())->method('generateUID')->will($this->returnValue('someId'));
$oHelper = $this->getMockBuilder('fcpohelper')->disableOriginalConstructor()->getMock();
$oHelper->expects($this->any())->method('fcpoGetUtilsObject')->will($this->returnValue($oMockUtilsObject));
$this->invokeSetAttribute($oTestObject, '_oFcpoHelper', $oHelper);
$sMockMappingId = 'someMapId';
$sMockPaymentId = 'somePaymentId';
$sMockPayoneStatus = 'someStatus';
$sMockFolder = 'someFolder';
$aMockData = array('sPaymentType' => $sMockPaymentId, 'sPayoneStatus' => $sMockPayoneStatus, 'sShopStatus' => $sMockFolder);
$sResponse = $sExpect = $oTestObject->_fcpoGetUpdateQuery($sMockMappingId, $aMockData, 'someErrorType');
$this->assertEquals($sExpect, $sResponse);
} | [
"public function testTableUpdate()\r\n {\r\n\r\n }",
"public function testCreateOrUpdateWithExistingRecord()\n {\n\n // Create item and servers.\n $item = $this->__item();\n $server1 = $this->__server();\n $server2 = $this->__server();\n\n // Create object.\n $object = $this->__object($item, $server1, 'pid:test', 'DC,content');\n\n // Capture starting count.\n $count = $this->objectsTable->count();\n\n // Update record.\n $object = $this->objectsTable->createOrUpdate(\n $item, $server2->id, 'pid:new', array('DC', 'new'));\n\n // Check for count.\n $this->assertEquals($this->objectsTable->count(), $count);\n\n // Check attributes.\n $this->assertEquals($object->item_id, $item->id);\n $this->assertEquals($object->server_id, $server2->id);\n $this->assertEquals($object->pid, 'pid:new');\n $this->assertEquals($object->dsids, 'DC,new');\n\n }",
"public function testAddUpdate()\n {\n $query = (new Query)\n ->addUpdate([\n 'foo' => 'Bar',\n 'date' => new Raw('NOW()'),\n 'value' => function (Query $query) {\n $query->addAvg('height')->from('table');\n }\n ])\n ->addUpdate([\n 'foo' => 12345,\n 'field' => null\n ]);\n\n $this->assertEquals([\n 'foo' => 12345,\n 'date' => new Raw('NOW()'),\n 'value' => (new Query)->addAvg('height')->from('table'),\n 'field' => null\n ], $query->update);\n\n // Incorrect column name\n $this->assertException(InvalidArgumentException::class, function () {\n (new Query)->addUpdate([ 'foo' => 'bar', 'baq']);\n });\n\n // Incorrect value\n $this->assertException(InvalidArgumentException::class, function () {\n (new Query)->addUpdate([ 'foo' => [1, 2, 3]]);\n });\n }",
"public function testCreateOrUpdateWithExistingRecord()\n {\n\n // Create item and servers.\n $item = $this->_item();\n $server1 = $this->_server();\n $server2 = $this->_server();\n\n // Create object.\n $object = $this->_object($item, $server1, 'pid:test', 'DC,content');\n\n // Capture starting count.\n $count = $this->objectsTable->count();\n\n // Update record.\n $object = $this->objectsTable->createOrUpdate(\n $item, $server2->id, 'pid:new', array('DC', 'new'));\n\n // Check for count.\n $this->assertEquals($this->objectsTable->count(), $count);\n\n // Check attributes.\n $this->assertEquals($object->item_id, $item->id);\n $this->assertEquals($object->server_id, $server2->id);\n $this->assertEquals($object->pid, 'pid:new');\n $this->assertEquals($object->dsids, 'DC,new');\n\n }",
"function test_update_normal()\n {\n //assert update did not return false\n $result = my_sql::update(\"useraccount\", array(\"lastName\", \"firstName\"), array(\"Shlongers\", \"Bobby\"), \"userEmail=:0\", array(\"bob@email.com\"));\n $this->assertNotEquals(false, $result);\n\n //assert validity of update data\n $expected = [\n [\"userEmail\" => \"bob@email.com\", \"profileImageID\" => null, \"firstName\" => \"Bobby\", \"lastName\" => \"Shlongers\", \"shippingAddressID\" => null, \"billingAddressID\" => null]\n ];\n $values = my_sql::select(\"*\", \"useraccount\", \"userEmail=:0\", array(\"bob@email.com\"));\n $this->assertEquals($expected, $values);\n }",
"public function testTableCategoryUpdate()\r\n {\r\n\r\n }",
"public function testSave_Update()\n {\n self::$reuse_db = false;\n\n $data = array(\n array('id' => null, 'name' => 'KLM', 'ext' => 'qq'),\n array('id' => 4, 'name' => 'MON', 'ext' => 'mu'),\n array('id' => null, 'name' => 'NOP', 'ext' => 'tv')\n );\n\n $id = Connection::conn()->save('foo', $data);\n $this->assertEquals(6, $id);\n\n $result = Connection::conn()->query(\"SELECT * FROM foo WHERE id >= 4 ORDER BY id\");\n $this->assertEquals(4, $result->num_rows);\n $this->assertEquals(array('id' => 4, 'name' => 'MON', 'ext' => 'mu'), $result->fetch_assoc());\n $this->assertEquals(array('id' => 5, 'name' => 'Ops', 'ext' => 'rs'), $result->fetch_assoc());\n $this->assertEquals(array('id' => 6, 'name' => 'KLM', 'ext' => 'qq'), $result->fetch_assoc());\n $this->assertEquals(array('id' => 7, 'name' => 'NOP', 'ext' => 'tv'), $result->fetch_assoc());\n }",
"function test_updateQuery($tableName,$cell,$value,$result)\r\n {\r\n $obj=new Dbal();\r\n $this->assertEquals($obj->updateQuery($tableName,$cell,$value),$result);\r\n }",
"public function test__fcpoGetQuery_Update() \n {\n $oTestObject = $this->getMock('fcpoforwarding', array('_fcpoGetUpdateQuery'));\n $oTestObject->expects($this->any())->method('_fcpoGetUpdateQuery')->will($this->returnValue('someValue'));\n\n $aMockData = array('donotdelete' => true);\n $sMockOxid = 'someId';\n $sExpect = \"someValue\";\n\n $this->assertEquals($sExpect, $oTestObject->_fcpoGetQuery($sMockOxid, $aMockData));\n }",
"public function testUpsert()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testPostUpsert()\n {\n\n }",
"function updatetest()\n {\n $cateDao = new CategoryDao();\n $row = new Category(1, \"trung\", \" abc\");\n return $cateDao->update($row);\n }",
"public function testEntryInsertedIntoDatabaseWithGoodData()\n {\n $dbHandle = $this->db->prepare(\"SELECT COUNT(id) FROM fancyservice_product_info\");\n $dbHandle->execute();\n $result = $dbHandle->fetch(PDO::FETCH_ASSOC);\n\n $priorRows = $result['COUNT(id)'];\n\n $this->upc->storeUPCByCode(\"1234\");\n\n $dbHandle->execute();\n $result = $dbHandle->fetch(PDO::FETCH_ASSOC);\n\n $currentRows = $result['COUNT(id)'];\n\n $this->assertGreaterThan(\n $priorRows,\n $currentRows\n );\n }",
"public function testUpsertCustomUpdate(): void\n {\n // SQL query which should be generated by the implementation\n $sql = 'INSERT INTO ' . $this->quoteIdentifier('example.example') . ' (' .\n $this->quoteIdentifier('id') . ',' .\n $this->quoteIdentifier('id2') . ',' .\n $this->quoteIdentifier('name') . ',' .\n $this->quoteIdentifier('bla43') . ',' .\n $this->quoteIdentifier('judihui') .\n ') VALUES (?,?,?,?,?) ON DUPLICATE KEY UPDATE ' .\n $this->quoteIdentifier('name') . '=?,' .\n $this->quoteIdentifier('lala45') . '=?,judihui = judihui + 1,' .\n $this->quoteIdentifier('evenmore') . '=?,' .\n $this->quoteIdentifier('lastone') . '=?';\n\n $vars = [\n 5,\n 6,\n 'value',\n 'niiiiice',\n 5,\n 'value5',\n '534',\n 8,\n 'laaaast',\n ];\n\n // Doctrine statement and result\n $statement = \\Mockery::mock(Statement::class);\n $statementResult = \\Mockery::mock(Result::class);\n\n $this->bindValues($statement, $vars);\n\n $statement\n ->shouldReceive('executeQuery')\n ->once()\n ->withNoArgs()\n ->andReturn($statementResult);\n\n // SQL query should be received by \"prepare\"\n $this->connection\n ->shouldReceive('prepare')\n ->once()\n ->with(IsEqual::equalTo($sql))\n ->andReturn($statement);\n\n // Close result set\n $statementResult\n ->shouldReceive('free')\n ->once();\n\n // Test the upsert\n $this->db->insertOrUpdate('example.example', [\n 'id' => 5,\n 'id2' => 6,\n 'name' => 'value',\n 'bla43' => 'niiiiice',\n 'judihui' => 5,\n ], [\n 'id',\n 'id2',\n ], [\n 'name' => 'value5',\n 'lala45' => '534',\n 'judihui = judihui + 1',\n 'evenmore' => 8,\n 'lastone' => 'laaaast',\n ]);\n\n $this->assertTrue(true);\n }",
"public function testUpdateClause()\n {\n $connection = $this->getQueryBuilderConnection();\n\n $query = $connection->update('strings')->set(['value' => 'asdf'])->asString();\n $expected = 'UPDATE strings SET value = :value';\n\n $this->assertEquals($expected, $query);\n }",
"public function testAdminMessageUpsertWithWhere()\n {\n\n }",
"public function testJournalEntriesUpdate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testAddToDB()\n {\n $MigrationLog = new \\MigrationLog();\n \n // add some data to db\n $data = new \\SetterGetter();\n $data->setMigrationId(1);\n $data->setQuery('test');\n $data->setDuration('1.300');\n \n $MigrationLog->Add($data);\n \n // check if the data is in db\n $filters = [ 'query' => 'test' ];\n $Collection = $MigrationLog->Get($filters);\n \n $this->assertCount(1, $Collection);\n $Item = $Collection->getItem();\n $this->assertEquals('test', $Item->getQuery());\n $this->assertEquals('1.300', $Item->getDuration());\n }",
"public function testCheckingIfEntityUpdateIsDetectedAfterReturningFromFunction()\n {\n $foo = $this->getInsertedEntity();\n $foo->setUsername('bar');\n $this->unitOfWork->commit();\n $this->assertEquals($foo, $this->dataMapper->getById($foo->getId()));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes the named page configuration from the set, calls edit, and returns the calling object. $pcs>deletePageConfiguration( 'XML' )>dump(); Asset Exception | public function deletePageConfiguration( string $name ) : Asset
{
if( $this->getDefaultConfiguration() == $name )
{
throw new \Exception(
S_SPAN . "Cannot delete the default configuration." . E_SPAN );
}
if( !$this->hasConfiguration( $name ) )
return $this;
$id = $this->page_configuration_map[ $name ]->getId();
$service = $this->getService();
$service->delete( $service->createId( c\T::CONFIGURATION, $id ) );
$this->reloadProperty();
$this->processPageConfigurations(
$this->getProperty()->pageConfigurations->pageConfiguration );
return $this;
} | [
"public function deletePage() {\n\t\t\n\t\t$output = array();\n\t\t$url = Request::post('url');\n\t\t$title = Request::post('title');\n\n\t\t// Validate $_POST.\n\t\tif ($url && ($Page = $this->Automad->getPage($url)) && $url != '/' && $title) {\n\n\t\t\t// Check if the page's directory and parent directory are wirtable.\n\t\t\tif (is_writable(dirname($this->getPageFilePath($Page))) && is_writable(dirname(dirname($this->getPageFilePath($Page))))) {\n\n\t\t\t\tFileSystem::movePageDir($Page->path, '..' . AM_DIR_TRASH . dirname($Page->path), $this->extractPrefixFromPath($Page->path), $title);\n\t\t\t\t$output['redirect'] = '?context=edit_page&url=' . urlencode($Page->parentUrl);\n\t\t\t\tCore\\Debug::log($Page->url, 'deleted');\n\n\t\t\t\t$this->clearCache();\n\n\t\t\t} else {\n\t\t\n\t\t\t\t$output['error'] = Text::get('error_permission') . '<p>' . dirname(dirname($this->getPageFilePath($Page))) . '</p>';\n\t\t\n\t\t\t}\n\t\n\t\t} else {\n\t\t\t\n\t\t\t$output['error'] = Text::get('error_page_not_found');\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t\t\n\t}",
"function deleteCmsPage()\n\t{\n\t\t$ObjClsDBInteraction = new class_dbconnector();\n\t\tif($this->page_id!=\"\")\n\t\t{\n\t\t\t$sSQL =\"DELETE FROM admin_post_page WHERE page_id='$this->page_id'\"; \n\t\t}\n\t\t//print $sSQL;\n\t\t$objRecordSet = $ObjClsDBInteraction->select( $sSQL );\n\t\t$ObjClsDBInteraction->connection_close();\n\t\treturn $objRecordSet;\n\t}",
"protected function deleteConfiguration() {\r\n Configuration::deleteByName($this->name.'_settings');\r\n }",
"public static function removePage()\n {\n if(!isset($_POST['id'])) Status::message(Status::ERROR, \"Didn't set element to remove\");\n // Remove the element\n $res = DatabaseManager::query(\"main\", \"DELETE FROM `admin_pages` WHERE id = :id\", $_POST);\n if(!$res) Status::message(Status::ERROR, \"Couldn't update the DB\");\n\n // Refresh Cache to apply changes\n CacheManager::loadDefaults(true);\n Status::message(Status::SUCCESS, \"Updated Successfully! :)\");\n }",
"protected function deleteConfiguration() {\r\n Configuration::deleteByName($this->name . '_settings');\r\n }",
"public function delete() {\n unset($this->xml[0]);\n\n return $this->save();\n }",
"public function deleteAction () {\n\t\t\t$api = Mage::getModel (\"cloudflare/api_pageRules_pageRules\");\n\t\t\t$response = $api->deleteEntry ( $this->_request->getParam (\"id\") );\n\t\t\treturn $this->_sendResponse ( $response );\n\t\t}",
"protected function deleteHiddenConfig()\n {\n // select form element id (there is only one \"hidden\" config form element\n $sql = \"SELECT id FROM `s_core_config_elements` \"\n . \"WHERE `name` LIKE '\" . ShopwareShopgatePluginConfig::HIDDEN_CONFIG_IDENTIFIER . \"'\";\n $result = Shopware()->Db()->fetchCol($sql);\n if ($result && count($result) > 0) {\n $id = $result[0];\n\n $sql = \"\n\t\t\t\tDELETE FROM `s_core_config_values` WHERE `element_id` = ?;\n\t\t\t\tDELETE FROM `s_core_config_element_translations` WHERE `element_id` = ?;\n\t\t\t\tDELETE FROM `s_core_config_elements` WHERE `id` = ?;\n\t\t\t\";\n Shopware()->Db()->query(\n $sql,\n array(\n $id, // element_id in s_core_config_values\n $id, // element_id in s_core_config_element_translations\n $id, // id in s_core_config_elements\n )\n );\n }\n }",
"function delete() {\r\n // the first 56 pages are structural and can not be deleted\r\n if ($this->id < 56)\r\n return;\r\n\r\n $this->db->delete(self::table_name, array('id' => $this->id));\r\n }",
"function deletePage() {\n\t\n}",
"function saveXML() {\r\n\t\t/*\r\n\t\t * We must check if this->settings has any children, if not we *must* remove it from the tree.\r\n\t\t */\r\n\t\tif ( !$this->settings->hasChildNodes() ) {\r\n\t\t\t$this->root->removeChild( $this->settings );\r\n\t\t}\r\n\t\t/*\r\n\t\t * Now we can do the inhereted stuff.\r\n\t\t */\r\n\t\treturn parent::saveXML();\r\n\t}",
"public function sitePageDeleteAction ()\n {\n\t\t$Page = Tg_Site::getInstance ()->getPageById($this->_getParam ('id'));\n\t\tif (!$Page)\n\t\t\tthrow new Exception (\"Page not found\");\n\t\t\t\n\t\tif ($Page->locked)\n\t\t\tthrow new Exception (\"Page is locked\");\n\t\t\n \t$Page->delete();\n \t\n\t\techo '{\"success\":true,\"msg\":\"Delete successful\"}';\n\t\tdie;\n }",
"public function deleteAction() {\n $pageID = $this->getRequest()->getParam('id');\n\n $this->view->currentPage = 'pages';\n $pageDatasource = new Datasource_Cms_Pages();\n $page = $pageDatasource->getByID($pageID);\n $pageDatasource->remove($pageID);\n\n\t\t// Record activity\n\t\t$auth = Zend_Auth::getInstance();\n $auth->setStorage(new Zend_Auth_Storage_Session('hl_admin'));\n $username = $auth->getStorage()->read()->username;\n Application_Core_ActivityLogger::log('CMS Page Deleted', 'complete', 'CMS-Admin', $username, \"Page URL: /\". $page['url']);\n \n // Changes saved - so send them back with a nice success message\n $this->_helper->getHelper('FlashMessenger')->addMessage(array('deleted' => true));\n $this->_helper->getHelper('Redirector')->goToUrl('/cms-admin/pages');\n }",
"function del() {\n\t\tif (!empty($this->id)) {\n\t\t\t$query = \"DELETE FROM page WHERE id = ?\";\n\t\t\t$statm = $this->db->prepare($query);\n\t\t\t$statm->execute([ $this->id ]);\n\t\t}\n\t}",
"function goopro_remove_page() {\n\t\t\n //the id of our page\n $the_page_id = get_option(\"goopro_page_id\");\n\t\t\n if($the_page_id) {\n\t\t\twp_delete_post($the_page_id); // this will trash, not delete\n }\n\n delete_option(\"goopro_page_title\");\n delete_option(\"goopro_page_name\");\n delete_option(\"goopro_page_id\");\n\t}",
"private static function _delete_settings() {\r\n\t\tdelete_option( self::SLUG_PREFIX . 'settings' ); \r\n\t\tself::$settings = self::$default_settings;\r\n\t\tself::_add_rewrite_rules( true );\r\n\r\n\t\treturn \"Settings removed from database and reset to default values.\\n\";\r\n\t}",
"function delete() {\n $revisions = (array) Revisions::buildPageHistory($this->getId(), $this->getProject());\n foreach($revisions as $revision) {\n $revision->delete();\n }\n return parent::delete();\n }",
"public static function delete() {\n\t\tdelete_transient( 'jetpack-sitemap-state-lock' );\n\t\tdelete_option( 'jetpack-sitemap-state' );\n\t}",
"public function super_admin_delete_page(){\t\n\t\t$page_id=$this->input->get(\"id\");\n\t\t$result=$this->delete(\"Id=$page_id\",\"webpages\");\n\t\treturn true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Based on restrict posts list hide posts list callback | function sh_set_hide_posts_callback($query) {
//check if user not logged in hide selected posts
if(!is_user_logged_in()){
//set
$query->set('post__not_in', sh_hide_posts_list_callback());
}
} | [
"public function hide_post_from_searchengines() {\n\t\t\t$hidden_posts = get_option( 'unlist_posts', array() );\n\n\t\t\tif ( in_array( get_the_ID(), $hidden_posts ) && false !== get_the_ID() ) {\n\t\t\t\twp_no_robots();\n\t\t\t}\n\t\t}",
"function mgm_hide_protected($query) {\r\n\tglobal $post;\r\n\t\r\n\t// do not run when admin section loaded #1459\r\n\tif( is_admin() ){\r\n\t\treturn $query;\r\n\t}\r\n\r\n\t// if loading from feed\t\r\n\tif (is_feed() && isset($_GET['token']) && mgm_use_rss_token()) {\r\n\t// get user by rss token, only for feed\t\r\n\t\t$user = mgm_get_user_by_token(strip_tags($_GET['token']));\t\r\n\t}else {\r\n\t\t// current user\r\n\t\tif( function_exists( 'wp_get_current_user' ) ){\r\n\t\t\t$user = wp_get_current_user();\r\n\t\t}else{\r\n\t\t\tglobal $user_ID;\r\n\t\t\t// pick\r\n\t\t\t$user = get_userdata($user_ID);\r\n\t\t}\r\n\t}\t\t\r\n\t\r\n\t// get system\r\n\t$system_obj = mgm_get_class('system');\r\n\t\r\n\t// flag\r\n\t$run_cat_notin = $run_term_notin = false;\t\t\r\n\t// user is not a spider\r\n\tif (!mgm_is_a_bot()) {\r\n\t \t// hide post\t\r\n\t\t$hide_posts = mgm_content_exclude_by_user($user->ID, 'post');// hide post\r\n\t\t\r\n\t\t//get access\r\n\t\t$access_posts = mgm_default_site_access_posts();\r\n\t\t//check\r\n\t\tif(!empty($access_posts)) {\r\n\t\t\t//init\r\n\t\t\t$access_posts = array_unique($access_posts);\r\n\t\t\t$temp = array();\r\n\t\t\t//loop\r\n\t\t\tforeach ($hide_posts as $hide_post) {\r\n\t\t\t\tif(in_array($hide_post,$access_posts)){\r\n\t\t\t\t\t$temp[] =$hide_post;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//check\r\n\t\t\tif(!empty($temp)) {\r\n\t\t\t\t$hide_posts = array_diff($hide_posts,$temp);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// set filter\t\t\t\t\t\t\t\t\r\n\t\tif (is_array($hide_posts) && !empty($hide_posts)) {\t\t\t\t\t\t\t\t\r\n\t\t\t$query->set('post__not_in', array_unique($hide_posts)); // set negation\t\t\t\r\n\t\t}\t\t\r\n\r\n\t \t// hide cats\t\r\n\t\t$hide_cats = mgm_content_exclude_by_user($user->ID, 'category');//hide cats\t\t\r\n\t\t\t\t\r\n\t\t// set filter\t\t\t\t\t\r\n\t\tif (is_array($hide_cats) && !empty($hide_cats)) {\r\n\t\t\t// flag\t\t\t\t\r\n\t\t\t$run_cat_notin = true;\t\t\t\t\r\n\t\t\t//category not found redirection\t\t\t\t\t\t\t\t\t\r\n\t\t\t//skip admin and home \r\n\t\t\t//consider only posts:\t\r\n\t\t\tif(!is_super_admin() && !is_home() && is_single() ) {\t\r\n\t\t\t\t// url\r\n\t\t\t\t$category_access_redirect_url = $system_obj->get_setting('category_access_redirect_url');\t\t\t\t\r\n\t\t\t\t//skip if same url:\r\n\t\t\t\tif(!empty($category_access_redirect_url) && trailingslashit(mgm_current_url()) != trailingslashit($category_access_redirect_url)) {\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t//check returned category ids belongs to the loaded post:\r\n\t\t\t\t\tif(isset($post->ID) && is_numeric($post->ID)) {\r\n\t\t\t\t\t\t//get post categories\r\n\t\t\t\t\t\t$post_cats = wp_get_post_categories($post->ID);\r\n\t\t\t\t\t\t// loop\r\n\t\t\t\t\t\tforeach ($post_cats as $cat) {\r\n\t\t\t\t\t\t\t//redirect if post category exists in blocked categories\r\n\t\t\t\t\t\t\tif(in_array($cat, $hide_cats)) {\r\n\t\t\t\t\t\t\t\t//redirect:\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tmgm_redirect($category_access_redirect_url);exit;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//issue#: 510\t\t\t\t\t\r\n\t\t\tif($run_cat_notin) {\r\n\t\t\t\t// set\t\r\n\t\t\t\t$query->set('category__not_in', array_unique($hide_cats)); // set negation\t\t\t\t\t\r\n\t\t\t\t// issue#: 510\r\n\t\t\t\tif(substr(get_bloginfo('version'), 0,3) > 3.0 && !is_page()) {\t\t\t\t\t\r\n\t\t\t\t\t//Note: selectively attach the filter to not apply in other scenarios\r\n\t\t\t\t\t//issue #1600\r\n\t\t\t\t\t$post_name = $query->query_vars['name'];\t\t\t\t\t\r\n\t\t\t\t\tif(empty($post_name)) {\r\n\t\t\t\t\t\t$current_uri = trim($_SERVER['REQUEST_URI']);\r\n\t\t\t\t\t\t$uri = explode('?', $current_uri);\r\n\t\t\t\t\t\t$uriArr = explode('/',$uri[0]);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif (!empty($uriArr)){\r\n\t\t\t\t\t\t\t$post_name = $uriArr[1];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t$member = mgm_get_member($user->ID);\r\n\t\t\t\t\t$membership_type = $member->membership_type;\r\n\t\t\t\t\t$membership_type = (empty($membership_type)) ? 'guest' : $membership_type;\r\n\t\t\t\t\t$arr_memberships = mgm_get_subscribed_membershiptypes($user->ID, $member);\r\n\t\t\t\t\tif(!in_array($membership_type, $arr_memberships)) $arr_memberships[] = $membership_type;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$accessible = false;\r\n\t\t\t\t\t$post_data = mgm_get_post_data_by_name($post_name);\r\n\t\t\t\t\t// check found\r\n\t\t\t\t\tif( isset($post_data->ID) ){\r\n\t\t\t\t\t\t$post_obj = mgm_get_post($post_data->ID);\t\r\n\t\t\t\t\t\tif(count(array_intersect($post_obj->access_membership_types, $arr_memberships)) > 0){\r\n\t\t\t\t\t\t\t$accessible = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\t//not accessible add filter\r\n\t\t\t\t\tif(!$accessible) {\r\n\t\t\t\t\t\t//to filter posts as per category__not_in values\r\n\t\t\t\t\t\tadd_filter('posts_search', 'mgm_attach_category_not_in');\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t// if on category archive listing page: check cateory is accessible, if not redirect to category_access_redirect_url setting url \r\n\t\t\tif(!is_super_admin() && !is_home() && is_category() ) {\t\r\n\t\t\t\t// url\t\t\t\r\n\t\t\t\t$the_url = mgm_current_url();\r\n\t\t\t\t//get archived category details\r\n\t\t\t\t$loaded_cat = get_category_by_path($the_url, false);\r\n\t\t\t\t\r\n\t\t\t\t//getting subcategory by path - issue #1578\r\n\t\t\t\tif(empty($loaded_cat)){\t\t\t\t\t\r\n\t\t\t\t\t$flag = false;\t\t\t\t\t\r\n\t\t\t\t\t$url_segments= preg_split('#/#',$the_url);\t\t\t\t\t\r\n\t\t\t\t\tforeach ($url_segments as $key=> $url_segment) {\r\n\t\t\t\t\t\tif(strtolower($url_segment) == 'category') {\r\n\t\t\t\t\t\t\t$flag = $key;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t\tif($flag){\r\n\t\t\t\t\t\tif(!empty($url_segments[$flag+2])){\r\n\t\t\t\t\t\t\t$slug = $url_segments[$flag+2];\r\n\t\t\t\t\t\t\t$loaded_cat = get_category_by_slug($slug);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t// url\r\n\t\t\t\tif(!isset($category_access_redirect_url))\r\n\t\t\t\t\t$category_access_redirect_url = $system_obj->get_setting('category_access_redirect_url');\t\t\r\n\t\t\t\t// issue #: 657\r\n\t\t\t\t// if the loaded category cannot be accessed by the user, and if category_access_redirect_url is set, redirect\t\t\t\t\r\n\t\t\t\tif(isset($loaded_cat->cat_ID) && in_array($loaded_cat->cat_ID, $hide_cats) && !empty($category_access_redirect_url) && trailingslashit($the_url) != trailingslashit($category_access_redirect_url))\r\n\t\t\t\t{\r\n\t\t\t\t\t// redirect:\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tmgm_redirect($category_access_redirect_url);exit;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t } // endif\r\n\t\r\n\t // hide terms\t\r\n\t $hide_terms = mgm_content_exclude_by_user($user->ID, 'taxonomy');//hide terms\t\t\t \r\n\t\r\n\t // set filter\t\t\t\t\t\r\n\t if (is_array($hide_terms) && !empty($hide_terms)) {\t\r\n\t \t// flag\t\t\t\t\r\n\t $run_term_notin = true;\t\r\n\t\t\r\n\t\t// set filter\r\n\t\t$query->set('tag__not_in', array_unique($hide_terms)); // set negation\t\r\n\t\t\r\n\t\t// set in search\r\n\t\tif(substr(get_bloginfo('version'), 0,3) > 3.0 && !is_page()) {\r\n\t\t\t//note: selectively attach the filter to not apply in other scenarios\r\n\t\t\tadd_filter('posts_search', 'mgm_attach_tag_not_in');//to filter posts as per tag__not_in values\t\r\n\t\t}\t\r\n\t } \r\n\t\r\n\t // term check\r\n\t if($run_cat_notin || $run_term_notin){\r\n\t \tadd_filter('list_terms_exclusions', 'mgm_exclude_terms'); // terms\t\t\r\n\t }\r\n\t // return \r\n\t return $query;\r\n}",
"function be_display_posts_off( $out, $pairs, $atts ) {\n\t$out['display_posts_off'] = true;\n\treturn $out;\n}",
"function cc_medonline_remove_display_posts_shortcode_from_whistles( $posts ) {\n\tforeach( $posts as $post ) {\n\t\tif( $post->post_type == 'whistle') {\n\t\t\tif( ! empty( get_metadata( 'post', $post->ID, 'ajax-load', true ) ) || strpos( $post->post_content, '[display-posts' ) !== false ) {\n\t\t\t\tremove_shortcode( 'display-posts' );\n\t\t\t\t//error_log(print_r($post,1));\n\t\t\t\treturn $posts;\n\t\t\t}\n\t\t}\n\t}\n\treturn $posts;\n}",
"public function filterPosts();",
"function postlist_tag() {\n\t\t$p = $this->get ( 'p' );\n\t\tif (! $p) {\n\t\t\t$p = '1';\n\t }\n\n\t\t$this->m->ArkPost->reset ();\n\t\t$post_list =$this->m->ArkPost->get_post_list ( $p );\n\t\t$this->assign ( 'postlist', $post_list['postlist'] );\n\t\n\t\t$this->display ( 'actions/post_list.html' );\n\t}",
"function hide_custom_post_types(){\n $agency_options = get_option('agency_settings');\n if(isset($agency_options)) {\n $website_use = (isset($agency_options['website_use'])?$agency_options['website_use']:null);\n $all_posttypes = [ \"brochure\", \"partner\", \"feedback\", \"service\", \"host\", \"voyage\", \"estimate\", \"facility\" ];\n $to_hide = array();\n if (isset($website_use)) {\n $posttypes = array();\n switch ($website_use) {\n case 'travel':\n $posttypes = $agency_options['travel_agency_posttypes'];\n break;\n case 'hotel':\n $posttypes = $agency_options['hotel_posttypes'];\n break;\n default:\n $posttypes = $agency_options['tourist_office_posttypes'];\n break;\n }\n $to_hide = array_diff($all_posttypes, $posttypes);\n }\n foreach ($to_hide as $value) {\n if (post_type_exists($value))\n remove_menu_page('edit.php?post_type=' . $value);\n }\n }\n}",
"function filter_posts( $sql = false ) {\n\t\t\tif (\n\t\t\t\t! $this->options->capa_protect_show_only_allowed_attachments &&\n\t\t\t\t! $this->options->capa_protect_show_unattached_files &&\n\t\t\t\tstrpos( $sql,'attachment' )\n\t\t\t)\n\t\t\t\treturn $sql;\n\n\t\t\tif ( $this->check_user() )\n\t\t\t\treturn $sql;\n\n\t\t\t// Is Feed or User/Visitor got the right to see the titel / message\n\t\t\tif (\n\t\t\t\t( is_feed() && $this->options->capa_protect_post_policy && 'hide' != $this->options->capa_protect_post_policy ) ||\n\t\t\t\t( in_array( $this->options->capa_protect_post_policy, array( 'show title', 'show message' ) ) )\n\t\t\t) {\n\t\t\t\t// Only Frontend, Backend(wp-admin) no visual change\n\t\t\t\tif ( ! strpos( $_SERVER['REQUEST_URI'], '/wp-admin/' ) ) {\n\t\t\t\t\treturn $sql;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$inclusive_page\t= (array) $this->get_valid_pages();\n\n\t\t\t$inclusive = $this->get_value_categories( true );\n\t\t\tif ( 0 == count( $inclusive ) )\n\t\t\t\t$inclusive = array( 0 );\n\n\t\t\tglobal $wpdb;\n\t\t\t$ids = $wpdb->get_col(\n\t\t\t\t$wpdb->prepare(\n\t\t\t\t\t\"SELECT ID FROM {$wpdb->posts} p INNER JOIN {$wpdb->term_relationships} t ON ( p.ID = t.object_id ) WHERE t.term_taxonomy_id in ( %s ) AND p.post_type NOT IN ( 'revision', 'page' )\",\n\t\t\t\t\timplode( ',', $inclusive )\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$ids = array_unique( array_merge( $ids, $inclusive_page ) );\n\t\t\tif ( 0 < count( $ids ) ) {\n\t\t\t\t$ids[] = (\n\t\t\t\t\t$this->options->capa_protect_show_only_allowed_attachments && $this->options->capa_protect_show_unattached_files ?\n\t\t\t\t\t'0' :\n\t\t\t\t\t'-1'\n\t\t\t\t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$ids[] = (\n\t\t\t\t\t$this->options->capa_protect_show_unattached_files ?\n\t\t\t\t\t'0' :\n\t\t\t\t\t'-1'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// In case sql is for the attachments\n\t\t\t$fld_id = ( strpos( $sql, \"post_type = 'attachment'\" ) ) ? 'post_parent' : 'ID';\n\t\t\treturn $sql . $wpdb->prepare( \" AND {$fld_id} IN ( %s )\", implode( ', ', $ids ) );\n\t\t}",
"function hide_private_post() {\n if( is_admin() ) {\n global $pagenow;\n if( 'edit.php' == $pagenow || 'post-new.php' == $pagenow || 'post.php' == $pagenow) {\n echo '<style type=\"text/css\">';\n echo 'a.edit-visibility {display:none;}';\n echo '</style>';\n }\n }\n}",
"public function hide_posts()\n {\n //Here we are comparing stored value with 1. Stored value is 1 if user checks the checkbox otherwise empty string.\n echo '<input type=\"checkbox\" name=\"db-hide-posts\" value=\"1\" ' . checked(1, get_option('db-hide-posts'), false) . '/>';\n }",
"function hide_hidden_post_id() {\n ?>\n <style type=\"text/css\">\n #acf-hidden_post_id, #acf-hidden_categories, #minor-publishing {\n display: none;\n }\n </style>\n <?php\n}",
"function rehub_exclude_feature_posts()\r\n{\t\t\t\t\t\t\r\n\t\t// check which featured area layout is activated\r\n\t\tif(rehub_option('rehub_featured_select') == '1') :\t\t\t\t\r\n\t\t\t\t$exclude_posts_slider = rehub_option('rehub_featured_slider');\r\n\t\t\t $exclude_posts_right = rehub_option('rehub_featured_right');\r\n\t\t\t $exclude_posts = array_merge($exclude_posts_slider,$exclude_posts_right);\r\n\t\t\t\treturn $exclude_posts;\r\n\t\t\t\t\r\n\t\t\telse :\r\n\t\t\t\r\n\t\t\t\t$args = array(\r\n\t\t\t\t\t'showposts' => 5,\r\n\t\t\t\t\t'meta_query' => array(\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t'key' => 'is_featured',\r\n\t\t\t\t\t\t\t'value' => '1',\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t)\r\n\t\t\t\t );\r\n\t\t\t\t$postslist = get_posts( $args );\r\n\t\t\t\t\r\n\t\t\t\tforeach($postslist as $post) {\r\n\t\t\t\t\t$exclude_posts[] = $post->ID;\r\n\t\t\t\t}\r\n\t\t\t\treturn $exclude_posts;\r\n\t\tendif;\r\n\r\n}",
"public function show_on_post_edit_screen() {\n\t\treturn false;\n\t}",
"function ContentSchedPostsOptions(){\n $post_id = $_GET['post'];\n $custom_types = get_post_types(array('public'=> true,\"_builtin\"=>false));\n $ptypes = array_merge(array(\"post\",\"page\"),$custom_types);\n $post_type = $post_id ? get_post_type($post_id):$_GET['post_type'];\n if($post_type){\n if (!in_array($post_type,$ptypes) )return false; //do not display option on pages\n }else{\n return false;\n }\n\n global $WishListMemberInstance;\n $wpm_levels=$WishListMemberInstance->GetOption('wpm_levels');\n ?>\n <div class=\"postbox\" >\n <h3><a class=\"togbox\"></a><?php _e(\"WishList Content Scheduler ({$post_type})\"); ?></h3>\n <div class=\"inside\">\n <p><?php _e('Make this post available/hidden after the number of days specified below for each level.','wl-contentcontrol'); ?></p>\n <blockquote>\n <hr />\n <?php\n foreach((array)$wpm_levels AS $id=>$level){\n if ( $post_id != '' ) $post_sched_data = $this->GetContentSched($post_id,$id,0,0,'',array('publish','draft','pending'));\n echo \"Show after <input style='text-align:center;' size='5' type='text' name='scheddays[{$id}]' value='\" .($post_sched_data[0]->num_days ? $post_sched_data[0]->num_days : \"\" ) .\"' /> days\";\n echo \" \";\n echo \"Show for <input style='text-align:center;' size='5' type='text' name='hidedays[{$id}]' value='\" .($post_sched_data[0]->hide_days ? $post_sched_data[0]->hide_days : \"\" ) .\"' /> days\";\n echo \" \";\n echo \"<strong>{$level[name]}</strong><br /><br />\";\n }\n ?>\n </blockquote>\n <i>Leave blank or put 0 to disable the Schedule on each level for this content.</i>\n <blockquote>\n <p><strong>SHORTCODE:</strong></p>\n\n <p>The Content Scheduler short code allows you to embed a list of upcoming posts in your pages/posts. Here's an example of the shortcode:</p>\n <blockquote>\n <p><code>[content-scheduler title=My Upcoming Posts,showtime=yes,showposts=20]</code></p>\n </blockquote>\n <p>Here's an explanation of each paramater:</p>\n\n <blockquote>\n <p><a title=\"Click to show details\" class=\"wlcctogglenext\" href=\"javascript:void(0);\">ptype</a> - Show Posts,Page or both.</p>\n <blockquote style=\"display:none;\">\n <p>Accepted Values: all | post | page.</p>\n <p>Default: all.</p>\n <p>Example: <code>ptype=post</code></p>\n </blockquote>\n\n <p><a title=\"Click to show details\" class=\"wlcctogglenext\" href=\"javascript:void(0);\">title</a> - The title of the Upcoming Posts.</p>\n <blockquote style=\"display:none;\">\n <p>Accepted Values: Any string of text.</p>\n <p>Default: None.</p>\n <p>Example: <code>title=My Upcoming Posts</code></p>\n </blockquote>\n\n <p><a title=\"Click to show details\" class=\"wlcctogglenext\" href=\"javascript:void(0);\">showposts</a> - The maximum number of upcoming posts you want to show.</p>\n <blockquote style=\"display:none;\">\n <p>Accepted Values: Any whole number.</p>\n <p>Default: 10.</p>\n <p>Example: <code>showposts=8</code></p>\n </blockquote>\n\n <p><a title=\"Click to show details\" class=\"wlcctogglenext\" href=\"javascript:void(0);\">sort</a> - How you would like to sort the list.</p>\n <blockquote style=\"display:none;\">\n <p>Accepted Values: ID | date | days | menu_order | title.</p>\n <p>Default: Scheduled date.</p>\n <p>Example: <code>sort=title</code></p>\n </blockquote>\n\n <p><a title=\"Click to show details\" class=\"wlcctogglenext\" href=\"javascript:void(0);\">showdate</a> - If you want to show the date.</p>\n <blockquote style=\"display:none;\">\n <p>Accepted Values: Yes or No</p>\n <p>Default: yes.</p>\n <p>Example: <code>showdate=yes</code></p>\n </blockquote>\n\n <p><a title=\"Click to show details\" class=\"wlcctogglenext\" href=\"javascript:void(0);\">showtime</a> - If you want to show the time.</p>\n <blockquote style=\"display:none;\">\n <p>Accepted Values: Yes or No</p>\n <p>Default: no.</p>\n <p>Example: <code>showtime=yes</code></p>\n </blockquote>\n\n <p><a title=\"Click to show details\" class=\"wlcctogglenext\" href=\"javascript:void(0);\">separator</a> - The date/time separator.</p>\n <blockquote style=\"display:none;\">\n <p>Accepted Values: Any string of text or special character.</p>\n <p>Default: @.</p>\n <p>Example: <code>separator=on or around</code></p>\n </blockquote>\n\n <p><a title=\"Click to show details\" class=\"wlcctogglenext\" href=\"javascript:void(0);\">px</a> - Spacing between lists in pixels.</p>\n <blockquote style=\"display:none;\">\n <p>Accepted Values: Any whole number.</p>\n <p>Default: 4.</p>\n <p>Example: <code>px=5</code></p>\n </blockquote>\n </blockquote>\n </blockquote>\n </div>\n </div>\n <?php\n }",
"function unapprovedPosts($posts, $pagelinks) {\r\n$IPBHTML = \"\";\r\n//--starthtml--//\r\n$IPBHTML .= <<<EOF\r\n{parse js_module=\"topic\"}\n<if test=\"disablelightbox:|:!$this->settings['disable_lightbox']\">\n{parse template=\"include_lightbox\" group=\"global\" params=\"\"}\n</if>\n<script type='text/javascript'>\n\tipb.topic.inSection\t= 'topicview';\n</script>\n<style type='text/css'>\n\t.post_mod { display: none; }\n</style>\n<div>{$pagelinks}</div>\n{parse template=\"subTabLoop\" group=\"modcp\" params=\"\"}\n<div class='clearfix'>\n\t<if test=\"hasPosts:|:is_array( $posts ) AND count( $posts )\">\n\t\t<div id='ips_Posts2'>\n\t\t\t<foreach loop=\"post_data:$posts as $post\">\n\t\t\t\t{parse template=\"modCPpost\" group=\"modcp\" params=\"$post, array(), $post, 'unapproved'\"}\n\t\t\t</foreach>\n\t\t</div>\n\t<else />\n\t\t<div class='no_messages'>\n\t\t\t{$this->lang->words['no_unapproved_posts']}\n\t\t</div>\n\t</if>\n\t<div>{$pagelinks}</div>\n</div>\r\nEOF;\r\n//--endhtml--//\r\nreturn $IPBHTML;\r\n}",
"function toggle_post_visibility($pids)\n\t{\n\t\tglobal $db;\n\n\t\t// Make sure we only have valid values\n\t\t$pids = array_map('intval', $pids);\n\n\t\t$pid_list = implode(',', $pids);\n\t\t$query = $db->simple_select(\"posts\", 'pid, visible', \"pid IN ($pid_list)\");\n\t\twhile($post = $db->fetch_array($query))\n\t\t{\n\t\t\tif($post['visible'] != 0)\n\t\t\t{\n\t\t\t\t$unapprove[] = $post['pid'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$approve[] = $post['pid'];\n\t\t\t}\n\t\t}\n\t\tif(is_array($unapprove))\n\t\t{\n\t\t\t$this->unapprove_posts($unapprove);\n\t\t}\n\t\tif(is_array($approve))\n\t\t{\n\t\t\t$this->approve_posts($approve);\n\t\t}\n\t\treturn true;\n\t}",
"function filter_protected_posts( $posts, $query ) {\r\n\t\t\t$filtered_posts = array();\r\n\r\n\t\t\t//if empty\r\n\t\t\tif ( empty( $posts ) )\r\n\t\t\t\treturn $posts;\r\n\r\n\t\t\t$restricted_global_message = UM()->options()->get( 'restricted_access_message' );\r\n\r\n\t\t\t//other filter\r\n\t\t\tforeach ( $posts as $post ) {\r\n\r\n\t\t\t\t//Woocommerce AJAX fixes....remove filtration on wc-ajax which goes to Front Page\r\n\t\t\t\tif ( ! empty( $_GET['wc-ajax'] ) /*&& $query->is_front_page()*/ ) {\r\n\t\t\t\t\t$filtered_posts[] = $post;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$restriction = $this->get_post_privacy_settings( $post );\r\n\r\n\t\t\t\tif ( ! $restriction ) {\r\n\t\t\t\t\t$filtered_posts[] = $post;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( is_object( $query ) ) {\r\n\t\t\t\t\t$is_singular = $query->is_singular();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$is_singular = ! empty( $query->is_singular ) ? true : false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//post is private\r\n\t\t\t\tif ( '0' == $restriction['_um_accessible'] ) {\r\n\t\t\t\t\t$this->singular_page = true;\r\n\t\t\t\t\t$filtered_posts[] = $post;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} elseif ( '1' == $restriction['_um_accessible'] ) {\r\n\t\t\t\t\t//if post for not logged in users and user is not logged in\r\n\t\t\t\t\tif ( ! is_user_logged_in() ) {\r\n\t\t\t\t\t\t$this->singular_page = true;\r\n\r\n\t\t\t\t\t\t$filtered_posts[] = $post;\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\tif ( current_user_can( 'administrator' ) ) {\r\n\t\t\t\t\t\t\t$filtered_posts[] = $post;\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ( empty( $is_singular ) ) {\r\n\t\t\t\t\t\t\t//if not single query when exclude if set _um_access_hide_from_queries\r\n\t\t\t\t\t\t\tif ( empty( $restriction['_um_access_hide_from_queries'] ) ) {\r\n\r\n\t\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_noaccess_action'] ) || '0' == $restriction['_um_noaccess_action'] ) {\r\n\r\n\t\t\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_restrict_by_custom_message'] ) || '0' == $restriction['_um_restrict_by_custom_message'] ) {\r\n\t\t\t\t\t\t\t\t\t\t$post->post_content = stripslashes( $restricted_global_message );\r\n\t\t\t\t\t\t\t\t\t} elseif ( '1' == $restriction['_um_restrict_by_custom_message'] ) {\r\n\t\t\t\t\t\t\t\t\t\t$post->post_content = ! empty( $restriction['_um_restrict_custom_message'] ) ? stripslashes( $restriction['_um_restrict_custom_message'] ) : '';\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t$filtered_posts[] = $post;\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$this->singular_page = true;\r\n\r\n\t\t\t\t\t\t\t//if single post query\r\n\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_noaccess_action'] ) || '0' == $restriction['_um_noaccess_action'] ) {\r\n\r\n\t\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_restrict_by_custom_message'] ) || '0' == $restriction['_um_restrict_by_custom_message'] ) {\r\n\t\t\t\t\t\t\t\t\t$post->post_content = stripslashes( $restricted_global_message );\r\n\t\t\t\t\t\t\t\t} elseif ( '1' == $restriction['_um_restrict_by_custom_message'] ) {\r\n\t\t\t\t\t\t\t\t\t$post->post_content = ! empty( $restriction['_um_restrict_custom_message'] ) ? stripslashes( $restriction['_um_restrict_custom_message'] ) : '';\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t$this->current_single_post = $post;\r\n\t\t\t\t\t\t\t\tadd_filter( 'the_content', array( &$this, 'replace_post_content' ), 9999, 1 );\r\n\r\n\t\t\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t\t\t * UM hook\r\n\t\t\t\t\t\t\t\t *\r\n\t\t\t\t\t\t\t\t * @type action\r\n\t\t\t\t\t\t\t\t * @title um_access_fix_external_post_content\r\n\t\t\t\t\t\t\t\t * @description Hook for 3-d party content filtration\r\n\t\t\t\t\t\t\t\t * @change_log\r\n\t\t\t\t\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t\t\t\t\t * @usage add_action( 'um_access_fix_external_post_content', 'function_name', 10 );\r\n\t\t\t\t\t\t\t\t * @example\r\n\t\t\t\t\t\t\t\t * <?php\r\n\t\t\t\t\t\t\t\t * add_action( 'um_access_fix_external_post_content', 'my_access_fix_external_post_content', 10 );\r\n\t\t\t\t\t\t\t\t * function my_access_fix_external_post_content() {\r\n\t\t\t\t\t\t\t\t * // your code here\r\n\t\t\t\t\t\t\t\t * }\r\n\t\t\t\t\t\t\t\t * ?>\r\n\t\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\t\tdo_action( 'um_access_fix_external_post_content' );\r\n\r\n\t\t\t\t\t\t\t\t$filtered_posts[] = $post;\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t} elseif ( '1' == $restriction['_um_noaccess_action'] ) {\r\n\t\t\t\t\t\t\t\t$curr = UM()->permalinks()->get_current_url();\r\n\r\n\t\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_access_redirect'] ) || '0' == $restriction['_um_access_redirect'] ) {\r\n\r\n\t\t\t\t\t\t\t\t\texit( wp_redirect( esc_url( add_query_arg( 'redirect_to', urlencode_deep( $curr ), um_get_core_page( 'login' ) ) ) ) );\r\n\r\n\t\t\t\t\t\t\t\t} elseif ( '1' == $restriction['_um_access_redirect'] ) {\r\n\r\n\t\t\t\t\t\t\t\t\tif ( ! empty( $restriction['_um_access_redirect_url'] ) ) {\r\n\t\t\t\t\t\t\t\t\t\t$redirect = $restriction['_um_access_redirect_url'];\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t$redirect = esc_url( add_query_arg( 'redirect_to', urlencode_deep( $curr ), um_get_core_page( 'login' ) ) );\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\texit( wp_redirect( $redirect ) );\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} elseif ( '2' == $restriction['_um_accessible'] ) {\r\n\t\t\t\t\t//if post for logged in users and user is not logged in\r\n\t\t\t\t\tif ( is_user_logged_in() ) {\r\n\r\n\t\t\t\t\t\tif ( current_user_can( 'administrator' ) ) {\r\n\t\t\t\t\t\t\t$filtered_posts[] = $post;\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$custom_restrict = $this->um_custom_restriction( $restriction );\r\n\r\n\t\t\t\t\t\tif ( empty( $restriction['_um_access_roles'] ) || false === array_search( '1', $restriction['_um_access_roles'] ) ) {\r\n\t\t\t\t\t\t\tif ( $custom_restrict ) {\r\n\t\t\t\t\t\t\t\t$this->singular_page = true;\r\n\r\n\t\t\t\t\t\t\t\t$filtered_posts[] = $post;\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$user_can = $this->user_can( get_current_user_id(), $restriction['_um_access_roles'] );\r\n\r\n\t\t\t\t\t\t\tif ( isset( $user_can ) && $user_can && $custom_restrict ) {\r\n\t\t\t\t\t\t\t\t$this->singular_page = true;\r\n\r\n\t\t\t\t\t\t\t\t$filtered_posts[] = $post;\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ( empty( $is_singular ) ) {\r\n\t\t\t\t\t\t\t//if not single query when exclude if set _um_access_hide_from_queries\r\n\t\t\t\t\t\t\tif ( empty( $restriction['_um_access_hide_from_queries'] ) ) {\r\n\r\n\t\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_noaccess_action'] ) || '0' == $restriction['_um_noaccess_action'] ) {\r\n\r\n\t\t\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_restrict_by_custom_message'] ) || '0' == $restriction['_um_restrict_by_custom_message'] ) {\r\n\t\t\t\t\t\t\t\t\t\t$post->post_content = stripslashes( $restricted_global_message );\r\n\t\t\t\t\t\t\t\t\t} elseif ( '1' == $restriction['_um_restrict_by_custom_message'] ) {\r\n\t\t\t\t\t\t\t\t\t\t$post->post_content = ! empty( $restriction['_um_restrict_custom_message'] ) ? stripslashes( $restriction['_um_restrict_custom_message'] ) : '';\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t$filtered_posts[] = $post;\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$this->singular_page = true;\r\n\r\n\t\t\t\t\t\t\t//if single post query\r\n\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_noaccess_action'] ) || '0' == $restriction['_um_noaccess_action'] ) {\r\n\r\n\t\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_restrict_by_custom_message'] ) || '0' == $restriction['_um_restrict_by_custom_message'] ) {\r\n\t\t\t\t\t\t\t\t\t$post->post_content = stripslashes( $restricted_global_message );\r\n\r\n\t\t\t\t\t\t\t\t\t$this->current_single_post = $post;\r\n\t\t\t\t\t\t\t\t\tadd_filter( 'the_content', array( &$this, 'replace_post_content' ), 9999, 1 );\r\n\r\n\t\t\t\t\t\t\t\t\tif ( 'attachment' == $post->post_type ) {\r\n\t\t\t\t\t\t\t\t\t\tremove_filter( 'the_content', 'prepend_attachment' );\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} elseif ( '1' == $restriction['_um_restrict_by_custom_message'] ) {\r\n\t\t\t\t\t\t\t\t\t$post->post_content = ! empty( $restriction['_um_restrict_custom_message'] ) ? stripslashes( $restriction['_um_restrict_custom_message'] ) : '';\r\n\r\n\t\t\t\t\t\t\t\t\t$this->current_single_post = $post;\r\n\t\t\t\t\t\t\t\t\tadd_filter( 'the_content', array( &$this, 'replace_post_content' ), 9999, 1 );\r\n\r\n\t\t\t\t\t\t\t\t\tif ( 'attachment' == $post->post_type ) {\r\n\t\t\t\t\t\t\t\t\t\tremove_filter( 'the_content', 'prepend_attachment' );\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t\t\t * UM hook\r\n\t\t\t\t\t\t\t\t *\r\n\t\t\t\t\t\t\t\t * @type action\r\n\t\t\t\t\t\t\t\t * @title um_access_fix_external_post_content\r\n\t\t\t\t\t\t\t\t * @description Hook for 3-d party content filtration\r\n\t\t\t\t\t\t\t\t * @change_log\r\n\t\t\t\t\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t\t\t\t\t * @usage add_action( 'um_access_fix_external_post_content', 'function_name', 10 );\r\n\t\t\t\t\t\t\t\t * @example\r\n\t\t\t\t\t\t\t\t * <?php\r\n\t\t\t\t\t\t\t\t * add_action( 'um_access_fix_external_post_content', 'my_access_fix_external_post_content', 10 );\r\n\t\t\t\t\t\t\t\t * function my_access_fix_external_post_content() {\r\n\t\t\t\t\t\t\t\t * // your code here\r\n\t\t\t\t\t\t\t\t * }\r\n\t\t\t\t\t\t\t\t * ?>\r\n\t\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\t\tdo_action( 'um_access_fix_external_post_content' );\r\n\r\n\t\t\t\t\t\t\t\t$filtered_posts[] = $post;\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t} elseif ( '1' == $restriction['_um_noaccess_action'] ) {\r\n\r\n\t\t\t\t\t\t\t\t$curr = UM()->permalinks()->get_current_url();\r\n\r\n\t\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_access_redirect'] ) || '0' == $restriction['_um_access_redirect'] ) {\r\n\r\n\t\t\t\t\t\t\t\t\texit( wp_redirect( esc_url( add_query_arg( 'redirect_to', urlencode_deep( $curr ), um_get_core_page( 'login' ) ) ) ) );\r\n\r\n\t\t\t\t\t\t\t\t} elseif ( '1' == $restriction['_um_access_redirect'] ) {\r\n\r\n\t\t\t\t\t\t\t\t\tif ( ! empty( $restriction['_um_access_redirect_url'] ) ) {\r\n\t\t\t\t\t\t\t\t\t\t$redirect = $restriction['_um_access_redirect_url'];\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t$redirect = esc_url( add_query_arg( 'redirect_to', urlencode_deep( $curr ), um_get_core_page( 'login' ) ) );\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\texit( wp_redirect( $redirect ) );\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif ( empty( $is_singular ) ) {\r\n\t\t\t\t\t\t\tif ( empty( $restriction['_um_access_hide_from_queries'] ) ) {\r\n\r\n\t\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_noaccess_action'] ) || '0' == $restriction['_um_noaccess_action'] ) {\r\n\r\n\t\t\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_restrict_by_custom_message'] ) || '0' == $restriction['_um_restrict_by_custom_message'] ) {\r\n\t\t\t\t\t\t\t\t\t\t$post->post_content = stripslashes( $restricted_global_message );\r\n\t\t\t\t\t\t\t\t\t} elseif ( '1' == $restriction['_um_restrict_by_custom_message'] ) {\r\n\t\t\t\t\t\t\t\t\t\t$post->post_content = ! empty( $restriction['_um_restrict_custom_message'] ) ? stripslashes( $restriction['_um_restrict_custom_message'] ) : '';\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t$filtered_posts[] = $post;\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$this->singular_page = true;\r\n\r\n\t\t\t\t\t\t\t//if single post query\r\n\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_noaccess_action'] ) || '0' == $restriction['_um_noaccess_action'] ) {\r\n\r\n\t\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_restrict_by_custom_message'] ) || '0' == $restriction['_um_restrict_by_custom_message'] ) {\r\n\t\t\t\t\t\t\t\t\t$post->post_content = stripslashes( $restricted_global_message );\r\n\r\n\t\t\t\t\t\t\t\t\t$this->current_single_post = $post;\r\n\t\t\t\t\t\t\t\t\tadd_filter( 'the_content', array( &$this, 'replace_post_content' ), 9999, 1 );\r\n\r\n\t\t\t\t\t\t\t\t\tif ( 'attachment' == $post->post_type ) {\r\n\t\t\t\t\t\t\t\t\t\tremove_filter( 'the_content', 'prepend_attachment' );\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} elseif ( '1' == $restriction['_um_restrict_by_custom_message'] ) {\r\n\t\t\t\t\t\t\t\t\t$post->post_content = ! empty( $restriction['_um_restrict_custom_message'] ) ? stripslashes( $restriction['_um_restrict_custom_message'] ) : '';\r\n\r\n\t\t\t\t\t\t\t\t\t$this->current_single_post = $post;\r\n\t\t\t\t\t\t\t\t\tadd_filter( 'the_content', array( &$this, 'replace_post_content' ), 9999, 1 );\r\n\r\n\t\t\t\t\t\t\t\t\tif ( 'attachment' == $post->post_type ) {\r\n\t\t\t\t\t\t\t\t\t\tremove_filter( 'the_content', 'prepend_attachment' );\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t\t\t * UM hook\r\n\t\t\t\t\t\t\t\t *\r\n\t\t\t\t\t\t\t\t * @type action\r\n\t\t\t\t\t\t\t\t * @title um_access_fix_external_post_content\r\n\t\t\t\t\t\t\t\t * @description Hook for 3-d party content filtration\r\n\t\t\t\t\t\t\t\t * @change_log\r\n\t\t\t\t\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t\t\t\t\t * @usage add_action( 'um_access_fix_external_post_content', 'function_name', 10 );\r\n\t\t\t\t\t\t\t\t * @example\r\n\t\t\t\t\t\t\t\t * <?php\r\n\t\t\t\t\t\t\t\t * add_action( 'um_access_fix_external_post_content', 'my_access_fix_external_post_content', 10 );\r\n\t\t\t\t\t\t\t\t * function my_access_fix_external_post_content() {\r\n\t\t\t\t\t\t\t\t * // your code here\r\n\t\t\t\t\t\t\t\t * }\r\n\t\t\t\t\t\t\t\t * ?>\r\n\t\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\t\tdo_action( 'um_access_fix_external_post_content' );\r\n\r\n\t\t\t\t\t\t\t\t$filtered_posts[] = $post;\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t} elseif ( '1' == $restriction['_um_noaccess_action'] ) {\r\n\r\n\t\t\t\t\t\t\t\t$curr = UM()->permalinks()->get_current_url();\r\n\r\n\t\t\t\t\t\t\t\tif ( ! isset( $restriction['_um_access_redirect'] ) || '0' == $restriction['_um_access_redirect'] ) {\r\n\r\n\t\t\t\t\t\t\t\t\texit( wp_redirect( esc_url( add_query_arg( 'redirect_to', urlencode_deep( $curr ), um_get_core_page( 'login' ) ) ) ) );\r\n\r\n\t\t\t\t\t\t\t\t} elseif ( '1' == $restriction['_um_access_redirect'] ) {\r\n\r\n\t\t\t\t\t\t\t\t\tif ( ! empty( $restriction['_um_access_redirect_url'] ) ) {\r\n\t\t\t\t\t\t\t\t\t\t$redirect = $restriction['_um_access_redirect_url'];\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t$redirect = esc_url( add_query_arg( 'redirect_to', urlencode_deep( $curr ), um_get_core_page( 'login' ) ) );\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\texit( wp_redirect( $redirect ) );\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn $filtered_posts;\r\n\t\t}",
"public function shouldHideForFeed() {\n // a sensitive action.\n return true;\n }",
"function mmsf_not_to_display_post() {\n if ( current_user_can( 'edit_posts' ) )\n return;\n if ( is_singular( 'event' ) ) {\n global $post;\n if ( !$publication = $post->publication ) {\n $archive_link = get_post_type_archive_link( $post->post_type );\n wp_redirect( $archive_link );\n }\n }\n if ( is_singular( 'space' ) ) {\n global $post;\n if ( 1 !== absint( $post->phase ) ) {\n $archive_link = get_post_type_archive_link( $post->post_type );\n wp_redirect( $archive_link );\n }\n }\n}",
"function _hide_post_type_post(): void {\n\tunregister_taxonomy_for_object_type( 'category', 'post' );\n\tunregister_taxonomy_for_object_type( 'post_tag', 'post' );\n\tglobal $wp_post_types;\n\t$wp_post_types['post']->public = false;\n\t$wp_post_types['post']->publicly_queryable = false;\n\t$wp_post_types['post']->show_in_admin_bar = false;\n\t$wp_post_types['post']->show_in_menu = false;\n\t$wp_post_types['post']->show_in_nav_menus = false;\n\t$wp_post_types['post']->show_in_rest = false;\n\t$wp_post_types['post']->show_ui = false;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set inject if not empty. | public function setInjectIfNotEmpty($injectIfNotEmpty)
{
$this->injectIfNotEmpty = $injectIfNotEmpty;
return $this;
} | [
"public function injectIfNotEmpty()\n {\n return $this->injectIfNotEmpty;\n }",
"public function shouldInjectIfNotEmpty()\n {\n return $this->injectIfNotEmpty;\n }",
"public function setInject($inject) {\n $this->inject = $inject;\n }",
"public function setInjectVariationFields($inject);",
"public function setInjections(array $injections);",
"public function injectInjectOrSetMethod($value)\n {\n $this->injectOrSetMethod = 'inject';\n }",
"protected function injectAdditionsAndEdits($inject = false)\n {\n $injectedCollection = $this->collection->map(function ($record) {\n $attrs = array_keys($record->getAttributes());\n\n foreach ($this->customColumns as $column) {\n if ($record->{$column['name']} instanceof Carbon) {\n $value = $this->getColumnValue($column['value'], $record->{$column['name']}, $record);\n $record->timestamps = false;\n $record->{$column['name']} = $value;\n } else {\n $record->{$column['name']} = $this->getColumnValue($column['value'], $record->{$column['name']}, $record);\n }\n }\n\n return $record;\n });\n\n if ($this->collection instanceof LengthAwarePaginator)\n $this->collection->setCollection($injectedCollection);\n else\n $this->collection = $injectedCollection;\n\n if ($inject)\n $this->options->set('AE.injected', true);\n }",
"public function inject($name = null) {\n\t\tif (isset($name)) {\n\t\t\treturn isset($this->_definition['inject'][$name]) ? $this->_definition['inject'][$name] : array() ;\n\t\t}\n\t\treturn $this->_definition['inject'] ;\n\t}",
"public function inject( CommandCollectionInterface $commands ): void;",
"private function injectDependencies()\n {\n if (!method_exists($this, 'inject')) {\n return;\n }\n\n $container = Container::getInstance();\n\n $reflector = new \\ReflectionClass(static::class);\n $method = $reflector->getMethod('inject');\n $parameters = $method->getParameters();\n\n // make the required parameters\n $buildParams = [];\n foreach ($parameters as $parameter) {\n $buildParams[] = $container->make($parameter->getClass()->name);\n }\n\n\n call_user_func_array([$this, 'inject'], $buildParams);\n }",
"private function processSetterInjectionRegistry() {\t\t\n\t\twhile (count($this->setterInjectionRegistry)>0) {\n\t\t\t$currentSetterData = $this->setterInjectionRegistry;\n\t\t\t$this->setterInjectionRegistry = array();\n\t\t\tforeach ($currentSetterData as $setterInjectionData) {\n\t\t\t\t$this->handleSetterInjection($setterInjectionData[0], $setterInjectionData[1], $setterInjectionData[2]);\n\t\t\t}\n\t\t}\n\t}",
"public function _injectGetVars(array $getVars = [])\n {\n $this->getVars = $getVars;\n $this->resetMergedVars();\n }",
"public function addInjection($injection);",
"public function mockAllInjections()\n {\n $this->injectServiceMock(UserRepository::class);\n $this->injectServiceMock('security.user_password_encoder.generic');\n $this->injectServiceMock(JwtUtil::class);\n $this->injectServiceMock(TokenRepository::class);\n }",
"protected function registerInjections()\n {\n if (! $this->injector) {\n return;\n }\n\n $mappingsKey = $this->getMappingsKey();\n if (! $this->config->hasKey($mappingsKey)) {\n return;\n }\n $mappings = $this->config->getSubConfig($mappingsKey);\n $this->injector->registerMappings($mappings);\n }",
"public function testInjectNull()\n {\n $container = ContainerBuilder::buildDevContainer();\n $result = $container->injectOn(null);\n\n $this->assertEquals($result, null);\n }",
"public function prepareStrings()\n {\n $this->strings = collect($this->argument('strings'));\n\n if ($this->strings->count() == 1) {\n $this->strings = trim($this->strings[0], ',');\n $this->strings = collect(explode(',', $this->strings));\n }\n\n $this->strings = $this->strings->unique()->values();\n }",
"protected function injectSharedContent()\n\t{\n\t if ($this->hasSharedContent()) {\r\n \t $this->populateInstance($this->getPopulableInstance(), $this->getSharedContent());\n\t }\n\t}",
"protected function injectDefaults() {\n\t\t$defaults = $this->parseExtConfTemplate();\n\t\t\n\t\tforeach ($defaults as $key => $value) {\n\t\t\tif (!isset($this->extensionConfiguration[$key])) {\n\t\t\t\t$this->extensionConfiguration[$key] = $value;\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get rule public descriptions by rule uids | public static function get_public_descriptions($context, $rule_uids)
{
$descriptions = array();
$rule_uids = (array) $rule_uids;
// Check if at least one rule uid is set
if (!empty($rule_uids) && is_array($rule_uids)) {
// Get rules by uids
$rules = RP_WCDPD_Rules::get($context, array('uids' => $rule_uids), true);
// Iterate over applicable rules and append their public descriptions
foreach ($rules as $rule) {
if (isset($rule['public_note']) && !RightPress_Helper::is_empty($rule['public_note'])) {
$descriptions
/* change code 2018 */
//[$rule['uid']]
= $rule['public_note'];
}
}
}
return !empty($descriptions) ? $descriptions : null;
} | [
"protected function _fetchRules($userId)\n {\n $group = Js_Query::create()\n ->select('gm.group_id')\n ->from('Model_Group_Membership gm')\n ->where('gm.user_id = ?', $userId)\n ->fetchOne(array(), Doctrine::HYDRATE_ARRAY);\n\n $groupId = $group['group_id'];\n\n $rules = Js_Query::create()\n ->select('rule.type, priv.name, resource.name, rule.group_id')\n ->from('Model_Acl_Rule rule')\n ->leftJoin('rule.Acl_Privilege priv')\n ->where('rule.user_id = ?', $userId)\n ->orWhere('rule.group_id = ?', $groupId)\n ->fetchArray();\n\n return $rules;\n }",
"function getHumanReadableRules ($rules,$ruleConstants)\t{\n\t\t$rulesArr = $this->parseRegexIntoArray ($rules);\n//\t\t$constantsArr = $this->\n\n#debug ($rulesArr);\n\t\treturn $this->parseRulesArrayIntoDescription ($rulesArr, $constantsArr);\n\t}",
"private function parse_sudo_rule($rule){\n $rule_seg = explode(')', $rule);\n $users_str = trim($rule_seg[0]);\n $users_str = ltrim($users_str, '(');\n $users = explode(',', $users_str);\n foreach($users as $key => $user){\n $users[$key] = trim($user);\n }\n\n $cmds = array('allow' => array(), 'deny' => array());\n $cmds_str = trim($rule_seg[1]);\n $tmp_cmds = explode(',', $cmds_str);\n foreach($tmp_cmds as $key => $cmd){\n $tmp_cmd = trim($cmd);\n if($tmp_cmd[0] == '!'){\n $cmds['deny'][] = ltrim($tmp_cmd, '!');\n }else{\n $cmds['allow'][] = $tmp_cmd;\n }\n }\n\n return array('user' => $users, 'cmd' => $cmds);\n \n }",
"public function getMaintainersOfPlaylist($pid) {\n\n // prepare ret\n $ret['message'] = \"\";\n $ret['status'] = 'fail';\n $ret['users'] = array();\n\n // array to hold uids of maintainers\n $uids = array();\n\n\n // GET UIDS\n try {\n \n $stmt = $this->dbh->prepare('\nSELECT uid\nFROM maintains\nWHERE pid=:pid\n ');\n\n $stmt->bindParam(':pid', $pid);\n\n if ($stmt->execute()) {\n\n // add all (if any) found uids to uids\n foreach($stmt->fetchAll() as $row) {\n array_push($uids, $row['uid']);\n }\n\n } else {\n $ret['message'] = \"Statement didn't execute correclty\";\n return $ret;\n }\n\n } catch (PDOException $ex) {\n $ret['message'] = $ex->getMessage();\n return $ret;\n }\n\n // prepare userManager\n $userManager = new UserManager($this->dbh);\n\n // FOR EACH UID IN UIDS -> FETCH USER OBJECT FROM USERMANAGER\n foreach ($uids as $uid) {\n $ret_getuser = $userManager->getUser($uid);\n\n if ($ret_getuser['status'] == 'fail') {\n $ret['message'] = \"Couldn't get user object : \" . $ret_getuser['message'];\n return $ret;\n } else {\n array_push($ret['users'], $ret_getuser['user']);\n }\n }\n\n\n // if got this far -> ok\n $ret['status'] = 'ok';\n\n return $ret;\n }",
"function qa_get_userids_from_public($publicusernames)\n{\n\t// Until you edit this function, always return null\n\n\t// return null;\n\n\t/*\n\t\tExample 1 - suitable if:\n\n\t\t* You use textual user identifiers that are also shown publicly\n\n\t\t$publictouserid = array();\n\n\t\tforeach ($publicusernames as $publicusername)\n\t\t\t$publictouserid[$publicusername] = $publicusername;\n\n\t\treturn $publictouserid;\n\t*/\n\n\t/*\n\t\tExample 2 - suitable if:\n\n\t\t* You use numerical user identifiers\n\t\t* Your database is shared with the Q2A site\n\t\t* Your database has a users table that contains usernames\n\n\t\t$publictouserid = array();\n\n\t\tif (count($publicusernames)) {\n\t\t\t$escapedusernames = array();\n\t\t\tforeach ($publicusernames as $publicusername)\n\t\t\t\t$escapedusernames[] = \"'\" . qa_db_escape_string($publicusername) . \"'\";\n\n\t\t\t$results = qa_db_read_all_assoc(qa_db_query_raw(\n\t\t\t\t'SELECT username, userid FROM users WHERE username IN (' . implode(',', $escapedusernames) . ')'\n\t\t\t));\n\n\t\t\tforeach ($results as $result)\n\t\t\t\t$publictouserid[$result['username']] = $result['userid'];\n\t\t}\n\n\t\treturn $publictouserid;\n\t*/\n\t\n return get_admidio_user_ids_from_user_names($publicusernames);\n}",
"function pfb_filterrules() {\n\tglobal $pfb;\n\n\t$rule_list\t\t= array();\n\t$rule_list['id']\t= array();\n\t$rule_list['other']\t= array();\n\t$rule_list['int']\t= array();\n\n\texec(\"{$pfb['pfctl']} -vvsr 2>&1\", $results);\n\tif (!empty($results)) {\n\t\tforeach ($results as $result) {\n\t\t\tif (substr($result, 0, 1) == '@') {\n\n\t\t\t\t$type = strstr(ltrim(strstr($result, ' ', FALSE), ' '), ' ', TRUE);\n\t\t\t\tif (in_array($type, array('block', 'pass', 'match'))) {\n\n\t\t\t\t\t// Since pfSense CE 2.6 and pfSense Plus 22.01, pf rules use an 'ridentifier' string\n\t\t\t\t\tif (strrpos($result, 'ridentifier') !== FALSE) {\n\t\t\t\t\t\t$id_begin_delim = 'ridentifier ';\n\t\t\t\t\t\t$id_end_delim = ' ';\n\t\t\t\t\t} elseif (strpos($result, '(') !== FALSE && strpos($result, ')') !== FALSE) {\n\t\t\t\t\t\t$id_begin_delim = '(';\n\t\t\t\t\t\t$id_end_delim = ')';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get the rule ID\n\t\t\t\t\t$id_begin_offset\t= strpos($result, $id_begin_delim) + strlen($id_begin_delim);\n\t\t\t\t\t$id_end_offset\t\t= strpos($result, $id_end_delim, $id_begin_offset);\n\n\t\t\t\t\tif ($id_end_offset !== FALSE) {\n\t\t\t\t\t\t$id_length = $id_end_offset - $id_begin_offset;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$id_length = strlen($result) - $id_begin_offset;\n\t\t\t\t\t}\n\t\t\t\t\t$id = substr($result, $id_begin_offset, $id_length);\n\t\t\t\t\tif (!is_numeric($id)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add the rule to the list\n\t\t\t\t\tif (strpos($result, ' <pfB_') !== FALSE) {\n\t\t\t\t\t\t$descr = ltrim(stristr($result, '<pfb_', FALSE), '<');\n\t\t\t\t\t\t$descr = strstr($descr, ':', TRUE);\n\t\t\t\t\t\t$type = strstr(ltrim(strstr($result, ' ', FALSE), ' '), ' ', TRUE);\n\t\t\t\t\t\tif ($type == 'match') {\n\t\t\t\t\t\t\t$type = 'unkn(%u)';\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif (!is_array($rule_list[$id])) {\n\t\t\t\t\t\t\t$rule_list[$id] = array();\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t$rule_list['id'][]\t= $id;\n\t\t\t\t\t\t$rule_list[$id]['name']\t= $descr;\n\t\t\t\t\t\t$rule_list[$id]['type']\t= $type;\n\t\n\t\t\t\t\t\t$int = strstr(ltrim(strstr($result, ' on ', FALSE), ' on '), ' ', TRUE);\n\t\t\t\t\t\tif (!empty($int)) {\n\t\t\t\t\t\t\t $rule_list['int'][$int] = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// All other non-pfBlockerNG Tracker IDs\n\t\t\t\t\t\t$rule_list['other'][$id] = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $rule_list;\n}",
"public function getResourcesFromConstraintsByOwner(ObjectConstraints $oc, User $owner, $publicOnly = false);",
"public static function getPublics(){\n\t\t$sql = \"select * from \".self::$tablename.\" where ES_PUBLICO=1\";\n\t\t$query = Executor::doit($sql);\n\t\treturn Model::many($query[0],new StatusData());\n\t}",
"function MyApp_Handle_SU_Users_Read_Per_Profile()\n {\n $people=$this->MyApp_Handle_SU_Users_Read();\n \n $profile2people=array();\n foreach ($this->MyApp_Handle_SU_Profiles_Allowed() as $profile)\n {\n if (preg_match('/^(Public)$/',$profile)) { continue; }\n\n $profile2people[ $profile ]=$this->SublistKeyEqValue($people,\"Profile_\".$profile,2);\n }\n\n return $profile2people;\n }",
"function chpprop_retrieve_enforcement($uid) {\n $account = user_load(array('uid' => $uid));\n $profiles = array();\n\n // As Admin, get all\n if ((in_array('Admin', array_values($account->roles)) and $account->status) or\n $account->uid == 1) {\n foreach (chdbprop_get_all_enforcement() as $profile) {\n $profiles[$profile['ProfileId']] =\n\tarray('data' => $profile,\n\t 'readonly' => FALSE,\n\t 'source' => 'Admin');\n }\n return $profiles;\n }\n\n // Via relations\n foreach (chdbprop_cc_get_enforcement($uid) as $profile) {\n $profiles[$profile['ProfileId']] =\n array('data' => $profile,\n\t 'readonly' => TRUE,\n\t 'source' => 'Relations');\n }\n\n return $profiles;\n}",
"private function calcPermissions( array $params, $ids ) {\n\t\tif ( $params['owner'] !== null && $params['token'] !== null ) {\n\t\t\t// Caller supplied token - treat them as trusted, someone who could see even private\n\t\t\treturn [ $this->getWatchlistUser( $params ), true ];\n\t\t}\n\n\t\tif ( $params['owner'] !== null ) {\n\t\t\t// Caller supplied owner only - treat them as untrusted, except\n\t\t\t// if owner == currentUser, allow private\n\t\t\t$owner = User::newFromName( $params['owner'], false );\n\t\t\tif ( !( $owner && $owner->getId() ) ) {\n\t\t\t\t// Note: keep original \"bad_wlowner\" error code for consistency\n\t\t\t\t$this->dieUsage( 'Specified user does not exist', 'bad_wlowner' );\n\t\t\t}\n\t\t\t$showPrivate = $owner->getId() === $this->getUser()->getId();\n\t\t} elseif ( !$ids ) {\n\t\t\t// neither ids nor owner parameter is given - shows all lists of the current user\n\t\t\t$owner = $this->getUser();\n\t\t\tif ( !$owner->isLoggedIn() ) {\n\t\t\t\t$this->dieUsage( 'You must be logged-in or use owner and/or ids parameters',\n\t\t\t\t\t'notloggedin' );\n\t\t\t}\n\t\t\t$showPrivate = true;\n\t\t} else {\n\t\t\t// ids given - will need to validate each id to belong to the current user for privacy\n\t\t\t$owner = false;\n\t\t\tif ( !$this->getUser()->isLoggedIn() ) {\n\t\t\t\t$showPrivate = false; // Anonymous user - optimize, none of the results are private\n\t\t\t} else {\n\t\t\t\t$showPrivate = null; // check each id against current user's ID\n\t\t\t}\n\t\t}\n\t\tif ( $showPrivate !== false ) {\n\t\t\t// Both 'null' and 'true' may be changed to 'false' here\n\t\t\t// Private is treated the same as 'viewmywatchlist' right\n\t\t\tif ( !$this->getUser()->isAllowed( 'viewmywatchlist' ) ) {\n\t\t\t\t$showPrivate = false;\n\t\t\t}\n\t\t}\n\t\treturn [ $owner, $showPrivate ];\n\t}",
"public function get_rules() {\n $rules = $this->_get_rules();\n \n // We don't need the IDs, so drop them.\n $rules = array_values($rules);\n \n // Return that the to the JS callback.\n $this->rc->output->command('plugin.dystill.get_rules_callback', array('rules' => $rules));\n }",
"public function getUsefulRules()\n {\n }",
"private function getPublicPlurks()\n\t{\n\t\t$url = sprintf('%sTimeline/getPublicPlurks', self::HTTP_URL);\n\t\t$offset = $this->_setting->offset;\n\t\t$time = ($offset instanceof DateTime) ? $offset : new DateTime($offset);\n\t\t$args = array(\n\t\t\t'user_id'\t=> $this->_setting->userId,\n\t\t\t'offset'\t=> $time->format('Y-m-d\\TH:i:s'),\n\t\t\t'limit'\t\t=> $this->_setting->limit,\n\t\t\t'filter'\t=> $this->_setting->filter\n\t\t);\n\n\t\t$this->setResultType(PlurkResponseParser::RESULT_PLURKS_USERS);\n\t\treturn $this->sendRequest($url, $args);\n\t}",
"function getStreamUrls($ids)\n\t{\n\t\tif(!isset($ids) || $ids == \"\"){ exit(\"Error: missing objec ID\"); }\n\t\tif(!is_array($ids))\n\t\t{\n\t\t\t$ids = explode(\",\",$ids);\n\t\t}\n\t\t\n\t\t$post = array('Operation'=>'getStreamUrls');\n\t\tfor($i=1; $i<=count($ids); $i++)\n\t\t{\n\t\t\t$post['trackIdList.member.'.$i] = $ids[$i-1];\n\t\t}\n\t\t\n\t\treturn $this->request($this->cirrus,$post);\n\t\t\t\n\t}",
"public function getAllPublicLink() {\n $query = $this->pdo->prepare(\"SELECT id,name,url,category FROM link_link WHERE user = :id AND priv8 = '0' ORDER BY name\");\n $query->execute(array(':id' => $this->id));\n if($query->rowCount() > 0) {\n $ris = $query->fetchAll();\n return $ris;\n }\n else\n return false;\n }",
"function test_resources_by_public_ids() {\r\n $result = $this->api->resources_by_ids(array(self::API_TEST, self::API_TEST_2, self::API_TEST_3), array(\"context\" => true, \"tags\" => true));\r\n $id_map = function($resource) {\r\n return $resource[\"public_id\"];\r\n };\r\n $context_map = function($resource) {\r\n return $resource[\"context\"][\"custom\"][\"key\"];\r\n };\r\n $tags_map = function($resource) {\r\n return $resource[\"tags\"] == array(API_TEST_TAG, ApiTest::$timestamp_tag);\r\n };\r\n $public_ids = array_map($id_map, $result[\"resources\"]);\r\n $context_values = array_map($context_map, $result[\"resources\"]);\r\n $tags = array_map($tags_map, $result[\"resources\"]);\r\n $this->assertContains(self::API_TEST, $public_ids);\r\n $this->assertContains(self::API_TEST_2, $public_ids);\r\n $this->assertContains(\"value\", $context_values);\r\n $this->assertNotContains(FALSE, $tags);\r\n }",
"function getAllAdvSharingRulePerm($module,$id)\n{\n\tglobal $adb,$mod_strings;\n\t\t$query = \"select tbl_s_advancedrule.advrule_id,tbl_s_advancedrule.title,tbl_s_advancedrule.description,\n\t\ttbl_s_advancedrule_rel.permission from tbl_s_advancedrule\n\t\tleft join tbl_s_advancedrule_rel on tbl_s_advancedrule_rel.advrule_id = tbl_s_advancedrule.advrule_id\n\t\t where tbl_s_advancedrule.module_name=? and (id is null or id <> ?)\";\n\t\t$result=$adb->pquery($query, array($module,$id));\n\t\t$num_rows=$adb->num_rows($result);\n\t\tfor($j=0;$j<$num_rows;$j++)\n\t\t{\n\t\t\t$advrule_id=$adb->query_result($result,$j,\"advrule_id\");\n\t\t\t$title=$adb->query_result($result,$j,\"title\");\n\t\t\t$description=$adb->query_result($result,$j,\"description\");\n\t\t\t$permission=$adb->query_result($result,$j,\"permission\");\n\n\t\t\t$access_permission [] = $advrule_id;\n\t\t\t$access_permission [] = $title;\n\t\t\t$access_permission [] = $description;\n\t\t\t$access_permission [] = $permission;\n\t\t}\n\n\tif(is_array($access_permission))\n\t\t$access_permission = array_chunk($access_permission,4);\n\treturn $access_permission;\n}",
"function ratty_admin_get_rule($scope, $id) {\n return ratty_do_call('admin_get_rule', array($scope, $id));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the current proxy used for requests. | public function getProxy()
{
return $this->client->getProxy();
} | [
"public static function getProxy() {\r\n\t\treturn self::$proxy;\r\n\t}",
"public function getProxy()\n {\n return $this->client->getProxy();\n }",
"public function getProxy()\n {\n return $this->_proxy;\n }",
"public function getProxy() {\n return $this->proxy;\n }",
"function getProxy()\r\n{\r\n\t$proxy = '';\r\n\t\r\n\tif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n\t\t$proxy = isset($_SERVER['HTTP_CLIENT_IP']) ? $_SERVER['HTTP_CLIENT_IP'] : $_SERVER['REMOTE_ADDR'];\r\n\t} \r\n\t\r\n\treturn $proxy;\r\n}",
"public function getProxyUrl()\n {\n return $this->proxyUrl;\n }",
"public function getProxyUrl() { return $this->proxyUrl; }",
"public function getProxyServer()\n {\n return $this->proxyServer;\n }",
"public function get_proxy_ip()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n return $this->_get_configuration_value('proxyip');\n }",
"private static function getProxy()\n {\n /** @var Proxy $proxy */\n $proxy = ServiceRegister::getService(Proxy::CLASS_NAME);\n\n return $proxy;\n }",
"public function getProxy()\n {\n $proxiesExit = $this->dataCache->getProxy();\n if ($proxiesExit == false) {\n self::newProxyList();\n $proxiesExit = $this->dataCache->getProxy();\n }\n $proxy = explode(':', $proxiesExit);\n while (self::checkProxy($proxy['ip'], $proxy['port'])) {\n if ($proxiesExit == false) {\n self::newProxyList();\n $proxiesExit = $this->dataCache->getProxy();\n }\n $proxy = explode(':', $proxiesExit);\n }\n return implode(':', $proxy);\n }",
"public function getProxyHostAndPort()\n {\n $proxy = $this->proxy;\n if ($this->proxy_port) {\n $proxy .= ':' . $this->proxy_port;\n }\n return $proxy;\n }",
"public function getResponseProxy() {\r\n\t\treturn $this->responseProxy;\r\n\t}",
"public function getProxy()\n {\n }",
"public function getProxyServer()\n {\n \treturn getenv('PROXY_SERVER');\n }",
"public function getActiveProxy()\n {\n //if no proxy was used, then it will return false\n if (getConfig(\"useProxy\")) {\n $this->proxy = ProxyList::getActive($this->url);\n if ($this->proxy) $this->proxyType = CURLPROXY_HTTP;\n }\n //if we already have activated tor, then use it\n if (getConfig('useTor')) {\n //IMPORTANT: instead of Tor we use one single proxy\n if (getConfig('ProxyStarted')) $this->proxy = \"84.43.90.42:24409\";\n else $this->proxy = false;\n //$this->proxy=TorProxy::get();\n if ($this->proxy) $this->proxyType = 5;\n\n }\n }",
"public function getProxy()\n\t\t{\n\t\t\treturn array('proxy' => $this->proxy, 'credentials' => $this->credentials, 'type' => $this->proxtype);\n\t\t}",
"function getProxy(){\n return array(\"host\"=>$this->proxy_host,\"port\"=>$this->proxy_port,\n \"user\"=>$this->proxy_user,\"pass\"=>$this->proxy_pass);\n }",
"public function getProxyHost()\n\t{\n\t\treturn($this->proxySettings['host']);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ writes out everything that has changed from the previous state to the later one. returns an array that contains only the differences between the passed arrays. | public static function diffarrays($former, $latter){
$one = (array)$former;
$two = (array)$latter;
$diff = array();
foreach($one as $key => $val1){
if (array_key_exists($key, $two)){
$val2 = $two[$key];
if ($val1 === $val2){
// same value, no diff
continue;
}
if ($val1 === null && $val2 === null){
// discard if both are null
continue;
}
$type1 = gettype($val1);
$type2 = gettype($val2);
if ($val2 === null){
$diff[$key] = $val1;
} else if ($val1 === null){
$diff[$key] = $val2;
} else if (is_numeric($val1) && is_numeric($val2)){
$diff[$key] = $val2 - $val1;
} else if ($type1 == "boolean" && $type2 == "boolean"){
$diff[$key] = $val2;
} else if ($type1 == "string"){
$diff[$key] = (string)$val2;
} else if ($type2 == "string"){
$diff[$key] = (string)$val2;
} else if (($type1 == "array" || $type1 == "object") && ($type2 == "array" || $type2 == "object")){
$diff[$key] = self::diffarrays($val1, $val2);
} else {
$diff[$key] = $val2;
}
} else {
// only in first, ignore since diff always only against old state
}
}
foreach($two as $key => $val2){
if (!array_key_exists($key, $one)) {
$diff[$key] = $val2;
}
}
return $diff;
} | [
"public function testDiff_returnsArray_ifDiffIsUpdate()\n\t{\n\t\t$from = ['foo'];\n\t\t$to = ['bar'];\n\t\t\n\t\t$expected = [['value' => 'foo', 'mask' => -1], ['value' => 'bar', 'mask' => 1]];\n\t\t$actual = Arr::diff($from, $to);\n\t\t\n\t\t$this->assertEquals($expected, $actual);\n\t\t\n\t\treturn;\n\t}",
"public function diff(array $a, array $b): array;",
"private function diff(): array\n {\n return $this->subDiff($this->loadFileConfigs(), $this->config);\n }",
"public function getDiff()\n {\n $diff = [];\n\n foreach ($this->getUpdated() as $key) {\n $diff[$key]['old'] = $this->old($key);\n\n $diff[$key]['new'] = $this->new($key);\n }\n\n return $diff;\n }",
"public function differenceBetweenTwoArrays()\r\n\t{\r\n\t\treturn array_diff($this->arrayFromDatabase, $this->arrayFromForm);\r\n\t}",
"function arrayDiffEmulation($arrayFrom, $arrayAgainst) {\r\n\t\tforeach ($arrayFrom as $key => $value) {\r\n\t\t\tif($this->in_array_($value,$arrayAgainst)) {\r\n\t\t\tunset($arrayFrom[$key]);\r\n\t\t}\r\n\t}\r\n\r\n\t\treturn $arrayFrom;\t\r\n\t}",
"private function array_multi_diff($_oldQueue, $_newQueue)\n\t{\n\t\t$diff = array();\n\t\tforeach ($_oldQueue as $key => $value)\n\t\t{\n\t\t\tif (array_search($value, $_newQueue) === false)\n\t\t\t{\n\t\t\t\t$diff[$key] = $value;\n\t\t\t}\n\t\t}\n\t\treturn $diff;\n\t}",
"function findMD5ArrayDiff($current,$past)\t{\n\t\tif (!is_array($current))\t$current = array();\n\t\tif (!is_array($past))\t\t$past = array();\n\t\t$filesInCommon = array_intersect($current,$past);\n\t\t$diff1 = array_keys(array_diff($past,$filesInCommon));\n\t\t$diff2 = array_keys(array_diff($current,$filesInCommon));\n\t\t$affectedFiles = array_unique(array_merge($diff1,$diff2));\n\t\treturn $affectedFiles;\n\t}",
"public function getOldInput(): array;",
"public function getChangedData()\n {\n $changedData = array();\n\n foreach ($this->_data as $k => $v) {\n if (!array_key_exists($k, $this->_originalData) || $this->_originalData[$k] !== $v) {\n $changedData[$k] = $v;\n }\n }\n\n return $changedData;\n }",
"public function previous_changes(){\n\t\treturn Dictionary::diff($this->record, $this->previous_record, $this->diff_options);\n\t}",
"public function getOldChanges()\n {\n \t$result = [];\n\n \tif( null !== $this->getPush() )\n \t{\n $result = reset($this->getPush()['changes'])['old'];\n }\n\n return $result;\n }",
"private function internalDiff($oldState, $newState)\n {\n $added = array();\n $modified = array();\n $removed = array();\n $oldName = $oldState->name;\n $newName = $newState->name;\n\n $app = Bootstrap::getApplication();\n $helpers = $app['helpers'];\n $wpCfmSettings = $helpers->getWPCFMSettings();\n\n foreach ($oldState->options as $name => $value) {\n if (in_array($name, $this->excludedOptions)) {\n continue;\n }\n if (isset($newState->options[$name])) {\n if (md5(serialize($value)) != md5(serialize($newState->options[$name]))) {\n $modified[] = array(\n 'state' => 'MOD',\n 'name' => $name,\n $oldName => $this->valueToString($value),\n $newName => $this->valueToString($newState->options[$name]),\n 'managed' => isset($wpCfmSettings->$name) ? 'Yes' : 'No',\n );\n }\n } else {\n $removed[] = array(\n 'state' => 'DEL',\n 'name' => $name,\n $oldName => $this->valueToString($value),\n $newName => null,\n 'managed' => isset($wpCfmSettings->$name) ? 'Yes' : 'No',\n );\n }\n }\n foreach ($newState->options as $name => $value) {\n if (in_array($name, $this->excludedOptions)) {\n continue;\n }\n if (!isset($oldState->options[$name])) {\n $added[] = array(\n 'state' => 'NEW',\n 'name' => $name,\n $oldName => null,\n $newName => $this->valueToString($value),\n 'managed' => isset($wpCfmSettings->$name) ? 'Yes' : 'No',\n );\n }\n }\n\n return array_merge($added, $modified, $removed);\n }",
"function array_diff_values($new, $old) {\n\t$diff = [];\n\tforeach($new as $k => $v) {\n\t\tif (!isset($old[$k]) || $v != $old[$k])\n\t\t\t$diff[$k] = $v;\n\t}\n\treturn $diff;\n}",
"public function get_diff() {\n\t\t$diff = array (\n\t\t\t\t0 => array (),\n\t\t\t\t1 => array () \n\t\t);\n\t\tforeach ( $this->_data as $key => $val ) {\n\t\t\tif ($this->is_changed ( $key )) {\n\t\t\t\t$diff [0] [$key] = array_key_exists ( $key, $this->_original ) ? $this->_original [$key] : null;\n\t\t\t\t$diff [1] [$key] = $val;\n\t\t\t}\n\t\t}\n\t\tforeach ( $this->_data_relations as $key => $val ) {\n\t\t\t$rel = static::relations ( $key );\n\t\t\tif ($rel->singular) {\n\t\t\t\t$new_pk = null;\n\t\t\t\tif (empty ( $this->_original_relations [$key] ) !== empty ( $val ) or (! empty ( $this->_original_relations [$key] ) and ! empty ( $val ) and $this->_original_relations [$key] !== $new_pk = $val->implode_pk ( $val ))) {\n\t\t\t\t\t$diff [0] [$key] = isset ( $this->_original_relations [$key] ) ? $this->_original_relations [$key] : null;\n\t\t\t\t\t$diff [1] [$key] = isset ( $val ) ? $new_pk : null;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$original_pks = empty ( $this->_original_relations [$key] ) ? array () : $this->_original_relations [$key];\n\t\t\t\t$new_pks = array ();\n\t\t\t\tif ($val) {\n\t\t\t\t\tforeach ( $val as $v ) {\n\t\t\t\t\t\tif (! in_array ( ($new_pk = $v->implode_pk ( $v )), $original_pks )) {\n\t\t\t\t\t\t\t$new_pks [] = $new_pk;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$original_pks = array_diff ( $original_pks, array (\n\t\t\t\t\t\t\t\t\t$new_pk \n\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (! empty ( $original_pks ) or ! empty ( $new_pks )) {\n\t\t\t\t\t$diff [0] [$key] = empty ( $original_pks ) ? null : $original_pks;\n\t\t\t\t\t$diff [1] [$key] = empty ( $new_pks ) ? null : $new_pks;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $diff;\n\t}",
"public function getDiff()\n {\n $diff = [];\n foreach ($this->getUpdated() as $key) {\n $diff[$key]['old'] = array_get($this->old, $key);\n $diff[$key]['new'] = array_get($this->new, $key);\n }\n\n return $this->formatDiff($diff);\n }",
"public function testDiff()\r\n {\r\n $array1 = [ 1, 2, 9, 3, 5, 6, 8, 'string' ];\r\n $array2 = [ 1, 2, 4, 5, 7, 8 ];\r\n $expect = [ 9, 3, 6, 'string', 4, 7 ];\r\n $result = Arrays::Diff($array1, $array2);\r\n $this->assertEqual($expect, $result);\r\n }",
"function getDifference( $array1, $array2)\n\t{\n\t\t$copyArray1 = $array1;\n\t\tif( count($copyArray1) <= count($array2))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\tfor( $i = 0; $i < count($array2); $i++)\n\t\t{\n\t\t\t$foundIn = array_search($array2[$i], $copyArray1);\n\t\t\tif( $foundIn !== FALSE)\n\t\t\t{\n\t\t\t\tunset( $copyArray1[$foundIn]);\n\t\t\t}\n\t\t}\n\t\treturn $copyArray1;\n\t}",
"public function getChanged(): array\n {\n return $this->changed;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
new function to log info message, with variable to hold any user message | function logInfo($message)
{
logMessage("INFO", $message);
} | [
"public function logInfo($message);",
"private function info($message){\n $this->printSting(\"0;33m\",$message);\n }",
"public function logInfo($message)\n {\n \\log::add(\"mystrom\", \"info\", $message);\n }",
"public function info($message)\r\n {\r\n $this->log($message, 1);\r\n }",
"function info($msg)\t{\n\t\t$this->errmsg .= $msg.\"\\n\";\n\t}",
"abstract public function addInfoMessage($value);",
"public static function log_info(string $info) {\n self::write_log($info, \"info.log\");\n }",
"protected function info($message = \"\\n\")\n {\n $this->output .= \"$message\\n\";\n }",
"public static function info($message){\n\t\tLogger::log(Logger::INFO, $message);\n\t}",
"function info($message, $caller = null) {\r\n if ($this->repository->isDisabled(LOGGER_LEVEL_INFO)) {\r\n return;\r\n }\r\n if (LOGGER_LEVEL_INFO >= $this->getEffectiveLevel()) {\r\n $this->forcedLog($caller, LOGGER_LEVEL_INFO, $message);\r\n }\r\n }",
"public function info($message) {\r\n\t\t$this->add('info', $message);\r\n\t}",
"public function addInfoMessage($message);",
"public function logInfo($text)\n {\n $this->saveToLogFile(Logger::getPrefix(\"info\") . $text);\n }",
"public abstract function log($message);",
"protected function _messageUserInfoText()\r\n\t{\r\n\t}",
"function add_info ($arg_str_info_msg, $arg_arr_info_params=array(), $arg_type=\"info\") {\r\n\tglobal $__info;\r\n\t$arr_info = array();\r\n\t$arr_info['info_msg'] = $arg_str_info_msg;\r\n\tif ($arg_arr_info_params) $arr_info['info_params'] = $arg_arr_info_params;\r\n\t$arr_info['type'] = $arg_type;\r\n\t$__info[] = $arr_info;\r\n}",
"public function info($info)\n {\n $this->write('INFO', $this->logFile, $info);\n }",
"private function _write_log($message) {\n //$this->EE->TMPL->log_item(\"AutoMin Module: $message\");\n }",
"function logMessage($message) {\n\t\techo date('D M d Y h:i:s A') . ': ' . $message . \"\\n\";\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check for shares having both included and excluded disks set | function shareIncludeExcludeSet() {
global $fixPaths, $fixSettings, $autoUpdateOverride, $developerMode, $communityApplicationsInstalled, $dockerRunning, $ignoreList, $shareList;
foreach ($shareList as $share) {
if ( is_file("/boot/config/shares/$share.cfg") ) {
$shareCfg = my_parse_ini_file("/boot/config/shares/$share.cfg");
if ( ($shareCfg['shareInclude'] ?? "") && ($shareCfg['shareExclude'] ?? "") ) {
$shareURL = str_replace(" ","+",$share);
addWarning("Share <b>$share</b> is set for both included (".$shareCfg['shareInclude'].") and excluded (".$shareCfg['shareExclude'].") disks","While if you're careful this isn't a problem, there is absolutely no reason ever to specify BOTH included and excluded disks. It is far easier and safer to only set either the included list or the excluded list. Fix it here: ".addLinkButton("$share Settings","/Shares/Share?name=$shareURL"),"https://forums.unraid.net/topic/120220-fix-common-problems-more-information/?tab=comments#comment-1098712");
}
}
}
# Check for global share settings having both included and exluded disks set
if ( is_file("/boot/config/share.cfg") ) {
$shareCfg = my_parse_ini_file("/boot/config/share.cfg");
if ( $shareCfg['shareUserInclude'] && $shareCfg['shareUserExclude'] ) {
addWarning("<b>Global Share Settings</b> is set for both included (".$shareCfg['shareUserInclude'].") and excluded (".$shareCfg['shareUserExclude'].") disks","While if you're careful this isn't a problem, there is absolutely no reason ever to specify BOTH included and excluded disks. It is far easier and safer to only set either the included list or the excluded list. Fix it here: ".addLinkButton("Global Share Settings","/Settings/ShareSettings"),"https://forums.unraid.net/topic/120220-fix-common-problems-more-information/?tab=comments#comment-1098712");
}
}
} | [
"function shareIncludeExcludeSet() {\n global $fixPaths, $fixSettings, $autoUpdateOverride, $developerMode, $communityApplicationsInstalled, $dockerRunning, $ignoreList, $shareList;\n \n foreach ($shareList as $share) {\n if ( is_file(\"/boot/config/shares/$share.cfg\") ) {\n $shareCfg = my_parse_ini_file(\"/boot/config/shares/$share.cfg\");\n if ( $shareCfg['shareInclude'] && $shareCfg['shareExclude'] ) {\n $shareURL = str_replace(\" \",\"+\",$share);\n addWarning(\"Share <font color='purple'><b>$share</b></font> is set for both included (\".$shareCfg['shareInclude'].\") and excluded (\".$shareCfg['shareExclude'].\") disks\",\"While if you're careful this isn't a problem, there is absolutely no reason ever to specify BOTH included and excluded disks. It is far easier and safer to only set either the included list or the excluded list. Fix it here: \".addLinkButton(\"$share Settings\",\"/Shares/Share?name=$shareURL\"));\n }\n }\n }\n # Check for global share settings having both included and exluded disks set\n\n if ( is_file(\"/boot/config/share.cfg\") ) {\n $shareCfg = my_parse_ini_file(\"/boot/config/share.cfg\");\n if ( $shareCfg['shareUserInclude'] && $shareCfg['shareUserExclude'] ) {\n addWarning(\"<font color='purple'><b>Global Share Settings</b></font> is set for both included (\".$shareCfg['shareUserInclude'].\") and excluded (\".$shareCfg['shareUserExclude'].\") disks\",\"While if you're careful this isn't a problem, there is absolutely no reason ever to specify BOTH included and excluded disks. It is far easier and safer to only set either the included list or the excluded list. Fix it here: \".addLinkButton(\"Global Share Settings\",\"/Settings/ShareSettings\"));\n }\n }\n}",
"private function externalSharesChecks() {\n\t\tif (!$this->reflector->hasAnnotation('NoIncomingFederatedSharingRequired') &&\n\t\t\t$this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') !== 'yes') {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$this->reflector->hasAnnotation('NoOutgoingFederatedSharingRequired') &&\n\t\t\t$this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') !== 'yes') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"function shareNameSameAsDiskName() {\n\tglobal $fixPaths, $fixSettings, $autoUpdateOverride, $developerMode, $communityApplicationsInstalled, $dockerRunning, $ignoreList, $shareList, $unRaidVersion;\n\n\t$disks = my_parse_ini_file($fixPaths['disks.ini'],true);\n\n\tforeach ($disks as $disk) {\n\t\tif ( $disk['name'] == \"parity\" ) { continue; }\n\t\tif ( is_dir(\"/mnt/user/\".$disk['name']) ) {\n\t\t\taddError(\"Share <b>\".$disk['name'].\"</b> is identically named to a <b>disk share</b>\",\"While there *may be* (doubtful) valid use cases for having a share named identically to a disk share, this is only going to cause some confusion as if disk shares are enabled, then you will have duplicated share names, and possibly if disk shares are not enabled, then you might not be able to gain access to the share. This is usually caused by moving the contents of one disk to another (XFS Conversion?) and an improperly placed <b>slash</b>. The solution is to move the contents of the user share named \".$disk['name'].\" to be placed within a validly named share. Ask for assistance on the forums for guidance on doing this.\",\"https://forums.unraid.net/topic/120220-fix-common-problems-more-information/?tab=comments#comment-1098739\");\n\t\t}\n\t}\n}",
"public function hasExcluded();",
"function get_external_shares(array $filteropts)\n {\n global $userref;\n\n $validfilterops = array(\n \"share_group\",\n \"share_user\",\n \"share_order_by\",\n \"share_sort\",\n \"share_type\",\n \"share_collection\",\n \"share_resource\",\n \"access_key\",\n \"ignore_permissions\",\n );\n foreach($validfilterops as $validfilterop)\n {\n if(isset($filteropts[$validfilterop]))\n {\n $$validfilterop = $filteropts[$validfilterop];\n }\n else\n {\n $$validfilterop = NULL;\n }\n }\n\n $valid_orderby = array(\"collection\",\"user\", \"sharedas\", \"expires\", \"date\", \"email\", \"lastused\", \"access_key\", \"upload\");\n if(!in_array($share_order_by, $valid_orderby))\n {\n $share_order_by = \"expires\";\n }\n $share_sort = strtoupper($share_sort) == \"ASC\" ? \"ASC\" : \"DESC\";\n\n $conditions = array();\n if((int)$share_user > 0 && ($share_user == $userref || checkperm_user_edit($share_user))\n )\n {\n $conditions[] = \"eak.user ='\" . (int)$share_user . \"'\";\n }\n elseif(!checkperm('a') && !$ignore_permissions)\n {\n $usercondition = \"eak.user ='\" . (int)$userref . \"'\";\n if(checkperm(\"ex\"))\n {\n // Can also see shares that never expire\n $usercondition = \" (expires IS NULL OR \" . $usercondition . \")\";\n }\n $conditions[] =$usercondition;\n }\n\n if(!is_null($share_group) && (int)$share_group > 0 && checkperm('a'))\n {\n $conditions[] = \"eak.usergroup ='\" . (int)$share_group . \"'\";\n }\n \n if(!is_null($access_key))\n {\n $conditions[] = \"eak.access_key ='\" . escape_check($access_key) . \"'\";\n }\n\n if((int)$share_type === 0)\n {\n $conditions[] = \"(eak.upload=0 OR eak.upload IS NULL)\";\n }\n elseif((int)$share_type === 1)\n {\n $conditions[] = \"eak.upload=1\";\n }\n if(is_int_loose($share_collection) && $share_collection != 0)\n {\n $conditions[] = \"eak.collection ='\" . (int)$share_collection . \"'\";\n }\n if((int)$share_resource > 0)\n {\n $conditions[] = \"eak.resource ='\" . (int)$share_resource . \"'\";\n }\n\n $conditional_sql=\"\";\n if (count($conditions)>0){$conditional_sql=\" WHERE \" . implode(\" AND \",$conditions);}\n\n $external_access_keys_query = \n \"SELECT access_key,\n ifnull(collection,'-') collection,\n CASE \n WHEN collection IS NULL THEN resource\n ELSE '-'\n END AS 'resource',\n user,\n eak.email,\n min(date) date,\n MAX(date) maxdate,\n max(lastused) lastused,\n eak.access,\n eak.expires,\n eak.usergroup,\n eak.password_hash,\n eak.upload,\n ug.name sharedas,\n u.fullname,\n u.username\n FROM external_access_keys eak\n LEFT JOIN user u ON u.ref=eak.user \n LEFT JOIN usergroup ug ON ug.ref=eak.usergroup \" .\n $conditional_sql .\n \" GROUP BY access_key, collection\n ORDER BY \" . escape_check($share_order_by) . \" \" . $share_sort;\n\n $external_shares = sql_query($external_access_keys_query);\n return $external_shares;\n }",
"static public function CommandListShares() {\n $devicelist = ZPushAdmin::ListDevices();\n if (empty($devicelist)) {\n echo \"\\tno devices/users found\\n\";\n return true;\n }\n $shares = array();\n $folderToStore = array();\n\n // It's necessary to always get all users and devices and then the shares of the device\n // as the shares are only available in the device.\n foreach ($devicelist as $deviceId) {\n $users = ZPushAdmin::ListUsers($deviceId);\n foreach ($users as $user) {\n $device = ZPushAdmin::GetDeviceDetails($deviceId, $user);\n if ($device instanceof ASDevice) {\n $sharedFolders = $device->GetAdditionalFolders();\n if (!empty($sharedFolders)) {\n foreach ($sharedFolders as $sharedFolder) {\n if (!isset($sharedFolder['store'], $sharedFolder['folderid'], $sharedFolder['name'])) {\n printf(\"User '%s' has a shared folder configured on device '%s', but store, folderid, or name of this share are not set: %s\", $user, $deviceId, print_r($sharedFolder, 1));\n continue;\n }\n $folderToStore[$sharedFolder['folderid']] = strtolower($sharedFolder['store']);\n $shares[strtolower($sharedFolder['store'])][$sharedFolder['folderid']][] = array('user' => $user, 'deviceId' => $deviceId, 'name' => $sharedFolder['name']);\n }\n }\n }\n }\n }\n\n\n if (empty($shares)) {\n print(\"There currently aren't any opened shares.\\n\");\n return;\n }\n\n if (self::$command == self::COMMAND_LISTFOLDERSHARES) {\n if (!isset($folderToStore[self::$folderid])) {\n printf(\"The folder with the requested id '%s' isn't currently opened by anyone.\\n\", self::$folderid);\n return;\n }\n printf(\"Displaying opened shares for folderid %s.\\n\", self::$folderid);\n self::printShares(array($folderToStore[self::$folderid] => array(self::$folderid => $shares[$folderToStore[self::$folderid]][self::$folderid])));\n }\n elseif (self::$command == self::COMMAND_LISTSTORESHARES) {\n $store = strtolower(self::$store);\n if (!isset($shares[$store])) {\n printf(\"None of the folders of the requested store '%s' is currently opened.\\n\", self::$store);\n return;\n }\n self::printShares(array($store => $shares[$store]));\n }\n else {\n print(\"Displaying opened shares of all users.\\n\");\n self::printShares($shares);\n }\n }",
"public function checkFoldersShared($id_shared);",
"function sameShareDifferentCase() { \n global $fixPaths, $fixSettings, $autoUpdateOverride, $developerMode, $communityApplicationsInstalled, $dockerRunning, $ignoreList, $shareList;\n \n foreach ( $shareList as $share ) {\n $dupShareList = array_diff(scandir(\"/mnt/user/\"),array(\".\",\"..\",$share));\n foreach ($dupShareList as $dup) {\n if ( strtolower($share) === strtolower($dup) ) {\n addError(\"Same share <font color='purple'>($share)</font> exists in a different case\",\"This will confuse SMB shares. Manual intervention required. Use the dolphin / krusader docker app to combine the shares into one unified spelling\");\n break;\n }\n }\n }\n}",
"public function getAcceptedShares() {\n\t\treturn $this->getShares(true);\n\t}",
"function disabledDisksPresent() {\n\tglobal $fixPaths, $fixSettings, $autoUpdateOverride, $developerMode, $communityApplicationsInstalled, $dockerRunning, $ignoreList, $shareList;\n\n\t$disks = my_parse_ini_file($fixPaths['disks.ini'],true);\n\n\tforeach ($disks as $disk) {\n\t\tif ( startsWith($disk['status'],'DISK_DSBL') ) {\n\t\t\taddError(\"<b>\".$disk['name'].\" (\".$disk['id'].\")</b> is disabled\",\"Begin Investigation Here: \".addLinkButton(\"Unraid Main\",\"/Main\"));\n\t\t}\n\t}\n}",
"public function check_exclude() {\n\t\t\t$is_excluded = false;\n\t\t\t$excluded_list = array();\n\n\t\t\tif (!empty($this->plugin_settings['general']['exclude']) && is_array($this->plugin_settings['general']['exclude'])) {\n\t\t\t\t$excluded_list = $this->plugin_settings['general']['exclude'];\n\t\t\t\t$remote_address = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';\n\t\t\t\t$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';\n\t\t\t\t\n\t\t\t\tforeach ($excluded_list as $item) {\n\t\t\t\t\tif (empty($item)) { // just to be sure :-)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tif (strstr($remote_address, $item) || strstr($request_uri, $item)) {\n\t\t\t\t\t\t$is_excluded = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$is_excluded = apply_filters('wpmm_is_excluded', $is_excluded, $excluded_list);\n\n\t\t\treturn $is_excluded;\n\t\t}",
"function sharePermission() {\n\tglobal $fixPaths, $fixSettings, $autoUpdateOverride, $developerMode, $communityApplicationsInstalled, $dockerRunning, $ignoreList, $shareList;\n\n\tforeach ($shareList as $share) {\n\t\tif ( ! is_dir(\"/mnt/user/$share\") ) { continue; }\n\t\t$sharePermission = substr(sprintf(\"%o\",fileperms(\"/mnt/user/$share\")),-4);\n\n\t\tif ( $sharePermission != \"0777\" ) {\n\t\t\taddWarning(\"Share <b>$share</b> has non-standard permissions set\",\"The permission on the share is currently set to <b>$sharePermission</b> (standard permissions are <b>0777</b>). You may have trouble accessing this share locally and/or over the network due to this issue. You should run the \".addLinkButton(\"New Permissions\",\"/Tools/DockerSafeNewPerms\").\"tool to fix this issue. (Don't know what these numbers mean? Look <a href='http://permissions-calculator.org/decode/' target='_blank'>HERE</a> NOTE that if this is your appdata share then you will need to manually run the command to fix this. Ask for assistance on the forums\");\n\t\t}\n\t}\n}",
"public function hasMounts()\n {\n return ($this->mountlist != '');\n }",
"public function checkshare($id_folder);",
"function missingDisksPresent() {\n\tglobal $fixPaths, $fixSettings, $autoUpdateOverride, $developerMode, $communityApplicationsInstalled, $dockerRunning, $ignoreList, $shareList;\n\n\t$disks = my_parse_ini_file($fixPaths['disks.ini'],true);\n\tforeach ($disks as $disk) {\n\t\tif ( ( $disk['status'] == \"DISK_NP\") || ( $disk['status'] == \"DISK_NP_DSBL\" ) ) {\n\t\t\tif ( $disk['id'] ) {\n\t\t\t\taddError(\"<b>\".$disk['name'].\" (\".$disk['id'].\")</b> is missing\",\"Unraid believes that your hard drive is not connected to any SATA port. Begin Investigation Here: \".addLinkButton(\"Unraid Main\",\"/Main\").\" And also look at the \".addLinkButton(\"Diagnostics\",\"/Tools/Diagnostics\"));\n\t\t\t}\n\t\t}\n\t}\n}",
"function check_disks($disk_to_add = array())\n {\n $msgs = array();\n\n /* Check 'disk' combinations.\n * - There can be four primary partitions.\n * - If there is at least one 'logical' partition, then there can be only\n * three 'primary' partitions.\n */\n if ($this->FAIdiskType == 'disk') {\n $types = array('logical' => array(), 'primary' => array());\n $types[$disk_to_add['FAIpartitionType']][$disk_to_add['FAIpartitionNr']] = 1;\n foreach ($this->partitions as $key => $part) {\n $types[$part['FAIpartitionType']][$part['FAIpartitionNr']] = 1;\n }\n\n // There can only be four primary partitions per disk - without any logical partition.\n if (count($types['logical']) == 0) {\n if (count($types['primary']) > 4) {\n $msgs[] = _('You have more than four primary partition table entries in your configuration');\n }\n } else {\n if (count($types['primary']) > 3) {\n $msgs[] = _('You cannot have more than three primary partition while using logical partitions');\n }\n }\n }\n return $msgs;\n }",
"function check_shared_space_usage($extra)\n{\n\tglobal $SITE_INFO;\n\tif (array_key_exists('throttle_space_registered',$SITE_INFO))\n\t{\n\t\t$views_till_now=intval(get_value('page_views'));\n\t\t$bandwidth_allowed=$SITE_INFO['throttle_space_registered'];\n\t\t$total_space=get_directory_size(get_custom_file_base().'/uploads');\n\t\tif ($bandwidth_allowed*1024*1024>=$total_space+$extra) return;\n\t}\n\tif (array_key_exists('throttle_space_complementary',$SITE_INFO))\n\t{\n//\t\t$timestamp_start=$SITE_INFO['custom_user_'].current_share_user();\n//\t\t$days_till_now=(time()-$timestamp_start)/(24*60*60);\n\t\t$views_till_now=intval(get_value('page_views'));\n\t\t$space_allowed=$SITE_INFO['throttle_space_complementary']+$SITE_INFO['throttle_space_views_per_meg']*$views_till_now;\n\t\t$total_space=get_directory_size(get_custom_file_base().'/uploads');\n\t\tif ($space_allowed*1024*1024<$total_space+$extra)\n\t\t\tcritical_error('RELAY','The hosted user has exceeded their shared-hosting \"disk-space to page-view\" ratio. More pages must be viewed before this may be uploaded.');\n\t}\n}",
"public function hasExcludes()\n {\n return count($this->get(self::EXCLUDES)) !== 0;\n }",
"function _exists($share)\n {\n return $this->_datatree->exists($share);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the collTigPairss collection. By default this just sets the collTigPairss collection to an empty array (like clearcollTigPairss()); however, you may wish to override this method in your stub class to provide setting appropriate to your application for example, setting the initial array to the values stored in database. | public function initTigPairss()
{
$this->collTigPairss = new PropelObjectCollection();
$this->collTigPairss->setModel('TigPairs');
} | [
"public function setPairs($pairs)\n {\n $this->pairs = $pairs;\n }",
"public function initCoursess()\n\t{\n\t\t$this->collCoursess = array();\n\t}",
"public function setPairs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Ydb\\ValuePair::class);\n $this->pairs = $arr;\n\n return $this;\n }",
"public function initStudentTags()\n\t{\n\t\t$this->collStudentTags = array();\n\t}",
"public function initPathwayStudents()\n\t{\n\t\t$this->collPathwayStudents = array();\n\t}",
"public function initTeachers()\n {\n $this->collTeachers = new PropelObjectCollection();\n $this->collTeachers->setModel('Teacher');\n }",
"public function initJ817tProcesoStis()\n\t{\n\t\t$this->collJ817tProcesoStis = array();\n\t}",
"public function initPilots()\n\t{\n\t\t$this->collPilots = array();\n\t}",
"function setPairs($pairs = array())\n {\n if (!is_array($pairs)) return false;\n \n $this->_pairs = $pairs;\n return true;\n }",
"public function initIssuess()\n {\n $this->collIssuess = new ObjectCollection();\n $this->collIssuessPartial = true;\n\n $this->collIssuess->setModel('\\Issues');\n }",
"public function setPairs(array $pairs)\n {\n $this->pairs = $pairs;\n return $this;\n }",
"public function initPreferences()\n\t{\n\t\t$this->collPreferences = array();\n\t}",
"public function pairs()\n {\n return $this->belongsToMany('App\\SkeletalElement', 'se_pair', 'pair_id', 'se_id')\n ->withoutGlobalScope(ProjectScope::class)\n ->withPivot('se_id', 'pair_id', 'org_id', 'project_id', 'created_by', 'updated_by',\n 'compare_method', 'compare_method_settings', 'measurements_used', 'num_measurements', 'sample_size',\n 'pvalue', 'mean', 'sd', 'elimination_reason', 'elimination_date')\n ->withTimestamps();\n }",
"public function initialize() {\r\n\t\tif (!$this->initializedTSFE) {\r\n\t\t\t$this->initializedTSFE = TRUE;\r\n\t\t\t$this->initializeTca();\r\n\t\t\t$this->initializeTsfe();\r\n\t\t}\r\n\t}",
"public function initUserBikess()\n\t{\n\t\t$this->collUserBikess = array();\n\t}",
"public function initVictims()\n {\n $collectionClassName = UserVictimsTableMap::getTableMap()->getCollectionClassName();\n\n $this->collVictims = new $collectionClassName;\n $this->collVictimsPartial = true;\n $this->collVictims->setModel('\\DB\\Victim');\n }",
"public function initGearInfos()\n\t{\n\t\t$this->collGearInfos = array();\n\t}",
"public function initWorkflowratingss()\n\t{\n\t\t$this->collWorkflowratingss = new PropelObjectCollection();\n\t\t$this->collWorkflowratingss->setModel('Workflowratings');\n\t}",
"public function initUserEquipements()\n\t{\n\t\t$this->collUserEquipements = array();\n\t}",
"public function initInsuranceRatess()\n\t{\n\t\t$this->collInsuranceRatess = array();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns dir of JavaScript files (including Kekule.js and its dependencies). | static public function getScriptDir()
{
return self::getKekuleDir() . 'jslib/';
} | [
"public static function GetJsSupportFilesRootDir ();",
"function get_js_path() {\n\n\n return JS_FOLDER_PATH;\n }",
"public function getJavascriptFolders()\n {\n return $this->paths['javascript'];\n }",
"public function getJSLangDirectories()\n {\n $sources = $this->getTransifexSources();\n $dirs = [];\n foreach ($sources as $source) {\n // Strip out /src/ dir and trailing file.js\n if (preg_match('#^(?<dir>.+)\\\\/src\\\\/(?<file>[^\\\\/]+)\\\\.js(on)?$#', $source, $matches)) {\n $dirs[] = $this->getDirectory() . '/' . $matches['dir'];\n }\n }\n return $dirs;\n }",
"public function getJSLangDirectory() {\n\t\t$dir = $this->getMainDirectory() . '/javascript/lang';\n\n\t\t// Special case for framework which has a nested 'admin' submodule\n\t\tif($this->getName() === 'framework') {\n\t\t\treturn array(\n\t\t\t\t$this->getMainDirectory() . '/admin/javascript/lang',\n\t\t\t\t$dir\n\t\t\t);\n\t\t} else {\n\t\t\treturn $dir;\n\t\t}\n\n\t}",
"private function getJSUrl()\n\t{\n\t\t$p = $this->framework->getRootDir() . \"static/\" . $this->module->getPathName() . \"/js/\";\n\n\t\tif (! $this->filesystem->exists($p))\n\t\t{\n\t\t\t$this->filesystem->mkdir($p);\n\t\t}\n\n\t\t$jsfile = $p . \"all.js\";\n\t\t$jsurl = $this->rootUrl . \"static/\" . $this->module->getPathName() . \"/js/all.js\";\n\n\t\t// check if we have it in cache\n\t\tif ($this->filesystem->exists($jsfile) && ! $this->isCacheDue())\n\t\t{\n\t\t\treturn $jsurl;\n\t\t}\n\n\t\t// get all our JS files\n\t\t$files = $this->framework->getTheme()->getJSFiles();\n\t\tif (isset($files[$this->module->getPathName()]))\n\t\t{\n\t\t\t$files = $files[$this->module->getPathName()];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$files = array();\n\t\t}\n\n\t\t// add the files for the plugins\n\t\t$plugins = $this->pluginManager->getPlugins();\n\t\tforeach ($plugins as $plugin)\n\t\t{\n\t\t\t$pluginFiles = $plugin->getJsFiles();\n\t\t\tif (array_key_exists($this->module->getPathName(), $pluginFiles))\n\t\t\t\t$files = array_merge($files, $pluginFiles[$this->module->getPathName()]);\n\t\t}\n\n\t\t// and all dirs\n\t\t$dirs = $this->framework->getTemplateDirs();\n\n\t\t// go through all \"files\" that are folders\n\t\tforeach ($files as $a => $file)\n\t\t{\n\t\t\tforeach ($dirs as $dir_)\n\t\t\t{\n\t\t\t\t$f = $dir_ . $this->module->getPathName() . \"/_public/js/\" . $file;\n\t\t\t\tif (is_dir($f))\n\t\t\t\t{\n\t\t\t\t\t$dirs[] = $f;\n\t\t\t\t\tunset($files[$a]);\n\t\t\t\t\t$filesDir = scandir($f);\n\t\t\t\t\tforeach ($filesDir as $f2)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (substr($f2, - 3) == \".js\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$files[] = $f . '/' . $f2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// now find all the actual files\n\t\tforeach ($files as $a => $file)\n\t\t{\n\t\t\tforeach ($dirs as $dir_)\n\t\t\t{\n\t\t\t\t$f = $dir_ . $this->module->getPathName() . \"/_public/js/\" . $file;\n\t\t\t\tif (file_exists($f))\n\t\t\t\t\t$files[$a] = $f;\n\t\t\t}\n\t\t}\n\n\t\t// get all the files\n\t\t$jsoutput = $this->loadFiles($files, \".js\");\n\n\t\t// shall we minify?\n\t\tif ($this->minifyJs)\n\t\t\t$jsoutput = \\JShrink\\Minifier::minify($jsoutput, array(\n\t\t\t\t\t'flaggedComments' => false\n\t\t\t));\n\n\t\t\t// delete the existing file\n\t\tif ($this->filesystem->exists($jsfile))\n\t\t\t$this->filesystem->remove($jsfile);\n\n\t\t\t// save the new\n\t\t$this->filesystem->dumpFile($jsfile, $jsoutput);\n\n\t\t// return the url\n\t\treturn $jsurl;\n\t}",
"function getJsPath() {\r\n\t\t$baseDir = Core::getBaseDir();\r\n\t\treturn $baseDir . '/' . parent::getPluginPath() . '/js/';\r\n\t}",
"function getJsPath() {\n\t\t$baseDir = Core::getBaseDir();\n\t\treturn $baseDir . '/' . parent::getPluginPath() . '/js/';\n\t}",
"public function getJavascripts()\n {\n return $this->getFilesByPattern('*.js');\n }",
"public abstract function getJSFiles();",
"protected function getJavascriptPath()\n {\n\n return __DIR__ . '/../resources/assets/js';\n\n }",
"public function load_all_js_files() {\n $path = APP_ROOT.'/js';\n $dir = opendir($path);\n\n while (($file = readdir($dir)) !== false) {\n if (is_dir(APP_ROOT.'/js/'.$file) && $file != '.' && $file != '..') {\n $d = opendir(APP_ROOT.'/js/'.$file);\n while (($f = readdir($d)) !== false) {\n if (!is_dir(APP_ROOT.'/js/'.$file.'/'.$f) && $f != '.' && $f != '..' && strstr($f, '.js')) {\n $js_file = $file.'/'.$f;\n if (!in_array($js_file , $this->js_needed)) {\n echo '<script type=\"text/javascript\" src=\"http://'.SERVER_NAME.APP_DIR.'/js/'.$file.'/'.$f.'\"></script>'.\"\\n\";\n }\n }\n }\n closedir($d);\n }\n }\n closedir($dir);\n }",
"function get_js_path() {\n\t\treturn trailingslashit( DASHICONS_MM_URL ) . 'assets/js';\n\t}",
"protected function _getScriptPaths()\n\t{\n\t\t$scriptNames = [\n\t\t\t'turndown.js',\n\t\t\t'htmlToMarkdownConverter.js',\n\t\t\t'Markdown.Converter.js',\n\t\t\t'Markdown.Sanitizer.js',\n\t\t\t'Markdown.Editor.js',\n\t\t\t'editorForm.php?INPUT_ID=' . self::INPUT_ID\n\t\t];\n\n\t\t$scriptPaths = $this->_buildAssetPaths($scriptNames, self::JS_DIRECTORY);\n\n\t\treturn $scriptPaths;\n\t}",
"public function getJsFolder($file = \"\")\n {\n if(strlen($file) > 0) {\n return $this->jsFolder. $file;\n }\n return $this->jsFolder;\n }",
"public function giveJavaScriptFiles() {\n\t\treturn [\n\t\t];\n\t}",
"public function getJavascriptFiles()\r\n {\r\n return $this->_javascriptSources;\r\n }",
"public function getJsFiles() {\n\n return apply_filters(\n 'kolbekus_theme_js_file',\n array(\n KOLBEKUSSOFT_THEME_URI . '/assets/vendor/jquery/jquery.min.js',\n KOLBEKUSSOFT_THEME_URI . '/assets/vendor/bootstrap/js/bootstrap.bundle.min.js',\n KOLBEKUSSOFT_THEME_URI . '/assets/vendor/jquery.easing/jquery.easing.min.js',\n KOLBEKUSSOFT_THEME_URI . '/assets/vendor/php-email-form/validate.js',\n KOLBEKUSSOFT_THEME_URI . '/assets/vendor/waypoints/jquery.waypoints.min.js',\n KOLBEKUSSOFT_THEME_URI . '/assets/vendor/counterup/counterup.min.js',\n KOLBEKUSSOFT_THEME_URI . '/assets/vendor/venobox/venobox.min.js',\n KOLBEKUSSOFT_THEME_URI . '/assets/vendor/owl.carousel/owl.carousel.min.js',\n KOLBEKUSSOFT_THEME_URI . '/assets/vendor/isotope-layout/isotope.pkgd.min.js',\n KOLBEKUSSOFT_THEME_URI . '/assets/vendor/aos/aos.js',\n KOLBEKUSSOFT_THEME_URI . '/assets/js/main.js'\n )\n );\n }",
"public function getScriptDir() {\n return isset($this->lazyScriptDir)\n ? $this->lazyScriptDir\n : ($this->lazyScriptDir = $this->getBaseDir() . '/scripts');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
///////////////////////////////////////////////////////////////////////// Create a virtual collection from configuration object $obj add a new OCA\files_irods\iRodsApi\Collection object to array $collection if all requirements are met ///////////////////////////////////////////////////////////////////////// | protected function createVirtualCollection(&$collections, $obj)
{
if(array_key_exists("if_group", $obj))
{
if(!array_key_exists($obj['if_group'], $this->roles))
{
// group is not allowed
return false;
}
}
if(array_key_exists("type", $obj))
{
$type = $obj['type'];
}
else
{
$type = '';
}
if(array_key_exists("path", $obj))
{
$path = str_replace (['{ZONE}',
'{USER}',
'{HOME}'],
[$this->params['zone'],
$this->params['user'],
'/'.$this->params['zone']."/home/".$this->params['user']],
$obj['path']);
}
else
{
$path = '';
}
switch($type)
{
case 'Collection':
$collections[$obj['name']] = new Collection($this,
$path);
return true;
break;
case 'FilteredCollection':
$collections[$obj['name']] = new FilteredCollection($this,
$path,
$obj['filter']);
return true;
break;
case 'FilteredHomeCollection':
foreach($this->getUsersOfGroup($obj['group']) as $user)
{
$path = str_replace(["{ZONE}", "{USER}"],
[$this->params['zone'], $user],
$obj['path']);
$name = str_replace("{USER}", $user, $obj['name']);
$coll = new FilteredCollection($this,
$path,
$obj['filter']);
if($coll->acl())
{
//at least read
$collections[$name] = $coll;
}
}
return true;
break;
default:
throw StorageNotAvailableException("invalid type '$type' in configuration ".json_encode($obj));
}
} | [
"public function setCollectionObject(&$obj)\n {\n $this->_c = $obj;\n }",
"private function createCollection(): void\n\t{\n\t\t$customer = new Customer();\n\n\t\t$application = new Application();\n\t\t$application->setCustomer($customer);\n\n\t\t$applicationVersion = new Application\\Version();\n\t\t$applicationVersion->setApplication($application);\n\n\t\t$this->collection = new Collection();\n\t\t$this->collection->setApplicationVersion($applicationVersion);\n\t\t$this->collection->setIdentifier('locations');\n\t}",
"function si_add_collection_policy_to_object(array $object) {\n list($item, $dsid, $xml) = si_get_objects_item_and_metadata($object);\n si_add_collection_policy($item);\n}",
"abstract protected function createConfigCollection(): ConfigCollectionInterface;",
"abstract public function getCollection($url, $collectionId, $collectionObj);",
"public function setCollection($collection);",
"protected function createCollectionResource($collection) : Collection\n {\n return new Collection($collection, $this->resolveTransformerFromCollection($collection));\n }",
"public function setCollection(\\MongoCollection $collection);",
"public function addCollection(ConfigCollectionInterface $collection): void;",
"protected function _create_collection($bind_info)\n {\n // Create an OCI-Collection object\n if(is_array($bind_info['type'])){\n $schema_and_type = $bind_info['type'];\n $collection = oci_new_collection($this->ci->conn,$schema_and_type[1], $schema_and_type[0]);\n }\n else{\n $collection = oci_new_collection($this->ci->conn,$bind_info['type']);\n }\n foreach ($bind_info['value'] as $array_item){ //add the items to the collection\n $collection->append($array_item);\n }\n return $collection;\n }",
"protected function processModifier_objColl($property, $calledProperty) {\n\n $type \t\t\t= $this->getConfig($property, 'type');\n $internal_type \t= $this->getConfig($property, 'internal_type');\n $foreign_table\t= $this->getConfig($property, 'foreign_table');\n\n tx_pttools_assert::isTrue(\n ($type == 'inline') || (($type == 'group') && ($internal_type == 'db') || (($type == 'select') && ($foreign_table))),\n array(\n 'message' \t\t\t=> 'Invalid modifier \"objColl\" for called property! ' . $property,\n 'modifier'\t\t\t=> 'objColl',\n 'type' \t\t\t\t=> $type,\n 'internal_type' \t=> $internal_type,\n 'property'\t\t\t=> $property,\n 'calledProperty' \t=> $calledProperty\n )\n );\n \n $classname = tx_tcaobjects_div::getForeignClassName($this->_table, $property);\n\n $propertyCollectionName = tx_tcaobjects_div::getCollectionClassName($classname);\n\n // create object collection\n $value = new $propertyCollectionName(); /* @var $value tx_tcaobjects_objectCollection */\n \n \n \n \n if ($type == 'inline') {\n \t\n /*******************************************************************\n * Case 1: TCA type: \"inline\"\n ******************************************************************/\n \t\n tx_pttools_assert::isNotEmpty($foreign_table, array('message' => 'No \"foreign_table\" defined for property \"'.$property.'\" in table \"'.$this->_table.'\"!'));\n\n $foreign_field = $this->getConfig($property, 'foreign_field');\n \n if (!empty($foreign_field)) {\n \t\n\t // array of records of the foreign table (mm records with uids or final data)\n\t $dataArr = tx_tcaobjects_objectAccessor::selectByParentUid(\n\t $this->__get('dluid'), // default language uid\n\t $foreign_table,\n\t $foreign_field,\n\t $this->getConfig($property, 'foreign_sortby')\n\t // TODO: consider foreign_table_field if available!\n\t );\n\t \n\t if (!empty($dataArr)) {\n\t\n\t $isMM = tx_tcaobjects_div::ForeignTableIsMmTable($this->_table, $property);\n\t\n\t // TODO: Document how and when to use the \"foreign_mm_field\"!\n\t if ($isMM == true) {\n\t $foreign_mm_field = $this->getConfig($property, 'foreign_mm_field');\n\t }\n\t\n\t // add items to the collection\n\t foreach ($dataArr as $data) {\n\t try {\n\t \t\n\t // create object directly or by its uid (in case of an mm table)\n\t \tif ($isMM) {\n\t \t\t$tmpObj = tx_tcaobjects_genericRepository::getObjectByUid($classname, $data[$foreign_mm_field]); \n\t \t} else {\n\t \t\t$tmpObj = new $classname('', $data);\n\t \t}\n\t \n\t } catch (tx_pttools_exception $exceptionObj) {\n\t $exceptionObj->handleException();\n\t $uid = $isMM ? $data[$foreign_mm_field] : $data['uid'];\n\t throw new tx_pttools_exception('Was not able to construct object \"'.$classname.':'.$uid.'\" (over mm-table: '. ($isMM ? 'yes' : 'no').') and add it to the collection! Original exception message: '.$exceptionObj->getMessage());\n\t }\n\t \n\t \tif ($tmpObj->isDeleted() == false) {\n\t\t\t\t\t\t\t$value->addItem($tmpObj);\n\t\t\t\t\t\t}\n\t }\n\t }\n\n } else {\n \t// If no foreign_field is defined, the field in the original table contains a comma separated list of uids in the foreign_table. \n \t// See TYPO3 Core Apis. This may be implemented here...\n\n \tif (($tmpPropertyValue = $this->__get($property)) == true) {\n\t \t$uids = t3lib_div::trimExplode(',', $tmpPropertyValue);\n\t \ttx_pttools_assert::isValidUidArray($uids);\n\t \tforeach ($uids as $uid) {\n\t \t\ttry {\n\t // create object\n\t $tmpObj = tx_tcaobjects_genericRepository::getObjectByUid($classname, $uid, true); // ignoring enable fields\n\t\n\t if ($tmpObj->isDeleted() == false) {\n\t $value->addItem($tmpObj);\n\t }\n\t } catch (tx_pttools_exception $exceptionObj) {\n\t $exceptionObj->handleException();\n\t throw new tx_pttools_exception('Was not able to construct object \"'.$classname.':'.$uid.'\" and add it to the collection!');\n\t }\n\t \t}\n \t}\n \t\n }\n\n } elseif (($type == 'group') && ($internal_type == 'db')) {\n /*******************************************************************\n * Case 2: TCA type \"group\"\n ******************************************************************/\n throw new tx_pttools_exception('Not implemented yet :)');\n } elseif (($type == 'select') && ($foreign_table)) {\n \t/*******************************************************************\n * Case 3: TCA type \"select\"\n ******************************************************************/\n \t\n \t$tmpPropertyValue = $this->__get($property);\n \tif (!empty($tmpPropertyValue)) {\n\t \t$uids = t3lib_div::trimExplode(',', $tmpPropertyValue);\n\t \ttx_pttools_assert::isValidUidArray($uids, false, array('message' => sprintf('Value was \"%s\"', $tmpPropertyValue)));\n\t foreach ($uids as $uid) {\n\t \ttry {\n\t // create object\n\t $tmpObj = tx_tcaobjects_genericRepository::getObjectByUid($classname, $uid, true); // ignoring enable fields\n\t\n\t if ($tmpObj->isDeleted() == false) {\n\t $value->addItem($tmpObj);\n\t }\n\t } catch (tx_pttools_exception $exceptionObj) {\n\t $exceptionObj->handleException();\n\t throw new tx_pttools_exception('Was not able to construct object \"'.$classname.':'.$uid.'\" and add it to the collection!');\n\t }\n\t }\n \t}\n } else {\n \tthrow new tx_pttools_exception('Not supported!');\n }\n\n tx_pttools_assert::isInstanceOf($value, 'tx_tcaobjects_objectCollection');\n // replace collection by translated collection if translation is supported\n if ($value->supportsTranslation() && $this->supportsTranslations()) {\n \t$value = $value->translate(true, $this->getLanguageUid());\n }\n \n return $value;\n }",
"public function createCollections()\n {\n foreach ($this->metadataFactory->getAllMetadata() as $class) {\n if ($class->isMappedSuperclass || $class->isEmbeddedDocument) {\n continue;\n }\n $this->createDocumentCollection($class->name);\n }\n }",
"function init_collections() {\n $this->collection = new Collections;\n $this->collection->objType = \"p\";\n $this->collection->objClass = \"cbphoto\";\n $this->collection->objTable = \"photos\";\n $this->collection->objName = \"Photo\";\n $this->collection->objFunction = \"photo_exists\";\n $this->collection->objFieldID = \"photo_id\";\n $this->photo_register_function( 'delete_collection_photos' );\n }",
"public function testObjectCollectionAdd()\n {\n // Load a contact object\n $contactObjectLocator = new RepositoryLocator(self::$repository, '/2016/01/08/2-contact/2');\n $contactObject = self::$repository->loadObject($contactObjectLocator);\n $this->assertInstanceOf(Contact::class, $contactObject);\n\n // Load a collection\n $selector = SelectorFactory::createFromString('/2015/*/*/*-article');\n $collection = self::$repository->findObjects($selector);\n $this->assertInstanceOf(Collection::class, $collection);\n $articleCount = count($collection);\n\n // Add the contact to the collection\n $collection = $collection->add($contactObject);\n $this->assertEquals($articleCount + 1, count($collection));\n\n // Add another object by repository locator\n /** @var Collection $collection */\n $collection = $collection->add(new RepositoryLocator(self::$repository, '/2016/02/07/3-article/3'));\n $this->assertEquals($articleCount + 2, count($collection));\n\n // Add invalid object\n $collection->add(null);\n }",
"function create_collection( $collectionId, $inFolderId, $collection ) {\n\t\tif ( empty( $inFolderId ) )\n\t\t\t$inFolderId = \"root\";\n\t\t$this->log( sprintf( \"create_collection %d (%s) in %s.\", $collectionId, $collection['name'], $inFolderId ), true );\n\t}",
"abstract protected function getCollection();",
"public function putCollection();",
"public function __construct($collection) {\n\t\t\t$this->collection = $collection;\n\t\t}",
"protected function createCollectionService(): APICollectionService\n {\n $collectionValidator = new CollectionValidator();\n $collectionValidator->setValidator($this->createValidator());\n\n return new CollectionService(\n $this->transactionHandler,\n $collectionValidator,\n $this->createCollectionMapper(),\n new CollectionStructBuilder(\n new ConfigStructBuilder()\n ),\n $this->createParameterMapper(),\n $this->createConfigMapper(),\n $this->collectionHandler\n );\n }",
"function AsCollection() {\n $collection = (object) array(\n 'collection_id' => (isset($this->principal_id) ? $this->principal_id : 0),\n 'is_calendar' => false,\n 'is_addressbook' => false,\n 'is_principal' => true,\n 'type' => 'principal' . (substr($this->dav_name(), 0, 12) == '/principals/'?'_link':''),\n 'user_no' => (isset($this->user_no) ? $this->user_no : 0),\n 'username' => $this->username(),\n 'dav_name' => $this->dav_name,\n 'parent_container' => '/',\n 'email' => (isset($this->email) ? $this->email : ''),\n 'created' => (isset($this->created) ? $this->created : date('Ymd\\THis')),\n 'updated' => (isset($this->updated) ? $this->updated : date('Ymd\\THis'))\n );\n $collection->dav_etag = (isset($this->dav_etag) ? $this->dav_etag : md5($collection->username . $collection->updated));\n $collection->dav_displayname = (isset($this->dav_displayname) ? $this->dav_displayname : (isset($this->fullname) ? $this->fullname : $collection->username));\n\n return $collection;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a list of all available graph URIs of the store. It can also respect access control, to only returned available graphs in the current context. But that depends on the implementation and can differ. | public function getGraphs()
{
// if successor is set, ask it first before run the command yourself.
if ($this->successor instanceof Store) {
return $this->successor->getGraphs();
// dont run command by myself
} else {
throw new \Exception(
'Addition\Erfurt\QueryCache does not support get available graphs, only by successor.'
);
}
} | [
"public function getAllUrls()\n {\n $urls = [];\n $stores = $this->storeManager->getStores(false);\n foreach ($stores as $store) {\n $urls[] = $store->getBaseUrl();\n }\n\n return $urls;\n }",
"public function getStoreUrls()\n {\n if (is_null($this->_storeUrls))\n {\n $this->_storeUrls = array();\n\n foreach (Mage::app()->getStores() as $store)\n {\n $storeUrl = parse_url($store->getBaseUrl());\n\n $this->_storeUrls[$store->getId()] = $storeUrl['host'] . $storeUrl['path'];\n }\n }\n\n return $this->_storeUrls;\n }",
"protected function getGraphUris(): array {\n if ($bundle_conditions = $this->getBundleConditions()) {\n // When the query has at least a bundle condition, we optimize the list of\n // graphs to be searched.\n $bundle_uris = ['IN' => [], 'NOT IN' => []];\n $entity_type_graph_uris = $this->graphHandler->getEntityTypeGraphUris($this->getEntityTypeId());\n foreach ($bundle_conditions as $type => $bundle_ids) {\n foreach ($bundle_ids as $bundle_id) {\n foreach (array_values(array_intersect_key($entity_type_graph_uris[$bundle_id], array_flip($this->graphIds))) as $uri) {\n $bundle_uris[$type][] = $uri;\n }\n }\n }\n $bundle_uris['IN'] = $bundle_uris['IN'] ?: $this->graphHandler->getEntityTypeGraphUrisFlatList($this->getEntityTypeId(), $this->graphIds);\n return array_diff($bundle_uris['IN'], $bundle_uris['NOT IN']);\n }\n return $this->graphHandler->getEntityTypeGraphUrisFlatList($this->getEntityTypeId(), $this->graphIds);\n }",
"public function getConnectionDefaultStoreViewCollection()\n {\n $connections = Mage::helper('shopgate/config')->getShopgateConnections();\n\n $result = array();\n foreach ($connections as $connection) {\n if ($connection->getScope() == 'websites') {\n $collection = Mage::getModel('core/config_data')->getCollection()\n ->addFieldToFilter(\n 'path',\n Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_SHOP_DEFAULT_STORE\n )\n ->addFieldToFilter('scope', $connection->getScope())\n ->addFieldToFilter('scope_id', $connection->getScopeId());\n\n if ($collection->getSize()) {\n $storeViewId = $collection->getFirstItem()->getValue();\n }\n } elseif ($connection->getScope() == 'stores') {\n $storeViewId = $connection->getScopeId();\n }\n\n if (!isset($storeViewId)) {\n continue;\n }\n\n $result[] = $storeViewId;\n }\n\n return $result;\n }",
"private function generateForAllStores()\n {\n $stores = $this->storeResolver->getAllStoreIds();\n\n $result = [];\n foreach ($stores as $store) {\n $result[] = $this->storeUrlConfigMetadataFactory->create($store);\n }\n\n return $result;\n }",
"function listGraphNames()\r\n\t{\r\n\t\t$recordSet =& $this->dbConnection->execute(\"SELECT graphURI FROM dataset_model WHERE datasetName ='\".$this->setName.\"'\");\r\n\r\n\t\t$return=array();\r\n\t\twhile (!$recordSet->EOF)\r\n\t\t{\r\n\t\t $return[] = $recordSet->fields[0];\r\n\t\t $recordSet->moveNext();\r\n\t\t}\r\n\t\treturn $return;\r\n\t}",
"public function getUsedStoreConfigPaths();",
"static public function getListGraph() {\n $query = 'SELECT DISTINCT ?graph WHERE {GRAPH ?graph {?s ?p ?o}}';\n $results = SPARQL::runSPARQLQuery($query);\n $jsnResults = json_decode($results);\n $list_graphs = Array();\n if (!empty($jsnResults)) {\n foreach ($jsnResults->results->bindings as $res) {\n array_push($list_graphs, $res->graph->value);\n }\n }\n return list_graphs;\n }",
"public function getActiveSharedCatalogStoreIds();",
"protected function _getStores()\n {\n $stores = Mage::getModel('core/store')\n ->getResourceCollection()\n ->setLoadDefault(true)\n ->load()\n ;\n return $stores;\n }",
"function getGraphIds(){\n return array_keys( $this->aGraphs );\n }",
"function listGraphNames()\r\n\t{\r\n\t\treturn array_keys($this->graphs);\r\n\t}",
"public function getStoreHierarchy();",
"protected function _getListStoreView()\r\n {\r\n $websites = Mage::getModel('core/website')->getCollection()->addFieldToFilter('code', ['neq' => 'admin']);\r\n\r\n $store_view_list = [];\r\n\r\n $id = Mage::app()->getRequest()->getParam('id');\r\n\r\n $currentStoreViewList = Mage::getModel('megamenu/megamenu')->load($id)->getData('store_view');\r\n\r\n $currentStoreViewArray = explode('|', trim($currentStoreViewList, '|'));\r\n\r\n foreach ($websites as $website) {\r\n $store_view_list[] = array(\r\n 'value' => 'website:' . $website->getData('website_id'),\r\n 'label' => Mage::helper('megamenu')->__($website->getData('name')),\r\n );\r\n\r\n foreach ($website->getGroupCollection() as $store) {\r\n $store_view_list[] = array(\r\n 'value' => 'store_group:' . $store->getData('group_id'),\r\n 'label' => Mage::helper('megamenu')->__('--------' . $store->getData('name') . '--------')\r\n );\r\n\r\n foreach ($store->getStoreCollection() as $storeView) {\r\n $store_view_list[] = array(\r\n 'value' => $storeView->getData('store_id'),\r\n 'label' => Mage::helper('megamenu')->__('----------------' . $storeView->getData('name') . '----------------')\r\n );\r\n }\r\n }\r\n }\r\n\r\n return $store_view_list;\r\n }",
"public function getAllStoreIds()\n {\n $ids = array();\n\n $allStores = Mage::app()->getStores();\n foreach ($allStores as $storeId => $val) {\n $ids[] = Mage::app()->getStore($storeId)->getId();\n }\n\n return $ids;\n }",
"public function getAvailablePaths();",
"public function getStoreIds()\n {\n return $this->getData(self::STORE_IDS);\n }",
"public function getGlobalEndpoints(): array;",
"public function getSiteUrls()\n {\n $urls = array();\n $q = $this->modx->newQuery('modContextSetting');\n $q->where(array(\n 'key' => 'site_url',\n 'context_key:!=' => 'mgr'\n ));\n $collection = $this->modx->getCollection('modContextSetting', $q);\n foreach ($collection as $item) {\n $urls[$item->get('value')] = $item->get('context_key');\n }\n return $urls;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the individual Elements value based on the Dispatcher | public function setValue(Dispatcher $dispatcher): void{
$this->content = $dispatcher->get($this->name);
} | [
"public abstract function setValue(Dispatcher $dispatcher): void;",
"protected function setElement() {}",
"public function setElement() {}",
"public function setDispatcher($value) {\n\t\t\t$this->dispatcher=$value;\n\t\t}",
"protected function setElement() {\n\n $this->element = new Input($this->name,$this->props);\n\n }",
"public function set_elements() {\n\t\tif ( ! $this->elements ) {\n\t\t\t$api = Theme_Blvd_Builder_API::get_instance();\n\t\t\t$this->elements = $api->get_elements();\n\t\t}\n\t}",
"function setValue($xpath, $value)\n {\n \n }",
"function setValue($value) \n {\n global $_HTML_TEMPLATE_FLEXY_TOKEN;\n $this->tag = strtoupper($value[0]);\n $this->oTag = $value[0];\n if (isset($value[1])) {\n $this->attributes = $value[1];\n }\n \n foreach(array_keys($this->attributes) as $k) {\n $this->ucAttributes[strtoupper($k)] =& $this->attributes[$k];\n }\n \n }",
"protected function initValueForElements() {\n $authViewElement = $this->getElement('auth_view');\n $authCommentElement = $this->getElement('auth_comment');\n\n $auth = Engine_Api::_()->authorization()->context;\n if ($authViewElement && !$authViewElement instanceof Engine_Form_Element_Hidden) {\n foreach ($this->_roles as $key => $role) {\n if ($auth->isAllowed($this->_playlist, $key, 'view')) {\n $authViewElement->setValue($key);\n break;\n }\n }\n }\n if ($authCommentElement && !$authCommentElement instanceof Engine_Form_Element_Hidden) {\n foreach ($this->_roles as $key => $role) {\n if ($auth->isAllowed($this->_playlist, $key, 'comment')) {\n $authCommentElement->setValue($key);\n break;\n }\n }\n }\n }",
"public function setValue($value)\n\t{\n\t\tif ($value instanceof LSF_View_Node) {\n\t\t\t$this->_nodes = array($value);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$index = null;\n\t\t\tif (is_array($value) && count($value))\n\t\t\t{\n\t\t\t\t$valueCopy = $value;\n\t\t\t\t$index = array_shift(array_keys($valueCopy));\n\t\t\t}\n\t\t\t$this->getFirstNode($index)->setValue($value);\t\n\t\t}\n\t}",
"public function setValue()\n {\n $this->assertSame($this->element, $this->element->setValue('test'));\n $this->assertEquals('test', $this->element->getValue());\n }",
"private function setElements()\n {\n $active = Personnage::where([\n \"owner_id\" => $this->user_id,\n \"active\" => true\n ])->with([\"assignations\", \"assignations.group\"])->firstOrFail();\n $this->currentPersonnageName = $active->name;\n\n /**\n * Find main group to set color\n */\n if(!($active->assignations->isEmpty()))\n {\n $mainGroup = $active->assignations->filter(function($item) {\n return $item->isMain == true;\n })->first();\n $this->color = $mainGroup->color;\n }\n }",
"public function set_elements($val)\n {\n if (!empty($val) && strpos($val, 'uniqueID') === false) {\n $val = 'uniqueID,' . $val;\n }\n $this->_elements = $val;\n }",
"public function set_elements()\n\t{\n\t\t// Combine core elements with custom elements\n\t\t$this->elements = array_merge( $this->core_elements, $this->custom_elements );\n\n\t\t// Remove elements\n\t\tif ( $this->remove_elements ) {\n\t\t\tforeach ( $this->remove_elements as $element_id ) {\n\t\t\t\tif ( isset( $this->elements[$element_id] ) ) {\n\t\t\t\t\tunset( $this->elements[$element_id] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Extend\n\t\t$this->elements = apply_filters( 'anva_elements', $this->elements );\n\n\t}",
"public function applyFilter() {\n foreach($this->getFormElements() as $name => $child) {\n $this->value->offsetSet($name, $child->getValue(TRUE));\n }\n }",
"abstract public function set($selector);",
"function setElement($element, $value) {\n $this->_elements[$element]['value'] = $value;\n }",
"protected function setElementValue()\n {\n $iblockList = $this->getListByType('iblock_element');\n $queryBuilder = new Entity\\Query(Iblock\\ElementTable::getEntity());\n $queryBuilder->setSelect(array('ID', 'NAME', 'IBLOCK_ID', 'IBLOCK_SECTION_ID'))\n ->setFilter(array('IBLOCK_ID' => $iblockList, 'ACTIVE' => 'Y'))\n ->setOrder(array());\n\n $elementResult = $queryBuilder->exec();\n while ($element = $elementResult->fetch()) {\n foreach ($this->highLoadBlockFields as &$field) {\n if ($field['USER_TYPE_ID'] != 'iblock_element') {\n continue;\n }\n\n if ($field['SETTINGS']['IBLOCK_ID'] == $element['IBLOCK_ID']) {\n $field['VALUE_LIST'][] = $element;\n }\n }\n }\n }",
"function set(){\n if(is_object($this->value) and in_array('set',get_class_methods($this->value)))\n return(call_user_func_array(array(&$this->value,'set'),func_get_args()));\n else \n return($this->value = func_get_arg(0));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Construct a new counterbased onetime password shared parameters instance. | public function __construct($secret, $counter = null)
{
if (null === $counter) {
$counter = 1;
}
parent::__construct($secret);
$this->counter = $counter;
} | [
"public function create()\n {\n return $this->counterRegistry->create();\n }",
"public function __construct()\n {\n self::$counter++;\n $this->uid = self::$counter;\n }",
"public function build(\n CounterId $anId,\n CounterName $anName,\n CounterValue $aValue,\n $status,\n $aPassword\n ) {\n return new Counter($anId, $anName, $aValue, $status, $aPassword);\n }",
"private function createCounter(): object\n {\n return new class ()\n {\n private $count = 0;\n public function increment() { $this->count++; }\n public function total() { return $this->count; }\n };\n }",
"public function __construct() {\n \n //Check if session is started\n if (isset($_SESSION) == false) {\n //throw exception so the class cannot vbe instantiated before session_start is called.\n throw new Exception(\"Session IS NOT started, ReloadCounter uses session, please call session_start() before any calls to ReloadCounter\");\n } \n \n //Make sure the count is updated only once per HTTP request\n if (ReloadCounter::$g_hasBeenConstructedBeforeThisCall == false) {\n \n //if this is the first call set the counter to 1 else set it to (n + 1)\n // isset checks if the adress exists in the session array\n if (isset($_SESSION[ReloadCounter::SESSION_ADRESS]) == false) {\n $_SESSION[ReloadCounter::SESSION_ADRESS] = 1;\n } else {\n $_SESSION[ReloadCounter::SESSION_ADRESS]++;\n }\n ReloadCounter::$g_hasBeenConstructedBeforeThisCall = true;\n }\n \n }",
"public function __construct($length,$strength){ \n\t\t\t$this->_generateOTP($length,$strength);\n\t\t}",
"public function createPass()\n {\n $this->password = sprintf('%06d', mt_rand(0, 999999));\n }",
"protected function initializeCounter(){\n $placeService = $this->get('place_service')['entity'];\n $criteria = ['place'=>$placeService->getPlace()->getId(), 'service'=>$placeService->getService()->getId()];\n $this->data['counter']['entity'] = $this->entityManager->getRepository($this->get('counter')['data_class'])->findBy($criteria,['onDate'=>'DESC'],3);\n\n return $this;\n }",
"protected function create_pass2_instance() {\r\n\t\treturn new PasswordHash02(8, FALSE);\r\n\t}",
"public function __construct() { \n\t\t$this->cnt = 1;\n\t}",
"public function __construct()\n {\n $this->instance = ++self::$instances;\n }",
"private function buildCounter(array $row)\n {\n\n return new Counter(\n new CounterId($row['uuid']),\n new CounterName($row['name']),\n new CounterValue($row['value']),\n $row['status'],\n $row['password']\n );\n }",
"public function __construct()\n {\n define('DEF_X_FROM', '112001'); // Auto-incremental index starting point\n\n define('ID_TRY', '2000'); // max number of attempts to obtain new ID\n define('ID_MIN', '5101010101'); // 1010101010 5101010101\n define('ID_MAX', '9898989898'); // 4294967289 9898989898\n\n define('CONFIRMED', '1'); // confirmed status value\n }",
"public function __construct()\n\t{\n\t\t$this->_hmacSha1IPad = str_pad(\"\", self::HAMCSHA1_BITLENGTH, chr(0x36));\n\t\t$this->_hmacSha1OPad = str_pad(\"\", self::HAMCSHA1_BITLENGTH, chr(0x5c));\n\t}",
"public function __construct()\n\t{\n\t\t$this->generateKey();\n\t}",
"private function counter_inc($addition,$COUNTER)\n \t{\t\n\tif ($addition=='32b')\n\t\t{$n=4;$pack=\"N\";}\n\telse if ($addition=='64b')\n\t\t{$n=8;$pack=\"J\";}\n\n\t$SALT = substr($COUNTER,0,16-$n);\t\t\t\n\textract(unpack($pack.\"count\",substr($COUNTER,-$n)));\t\n\treturn $SALT.pack($pack, $count+1);\t \n\t}",
"public function testThatIdTokenLeewayFromConstructorIsUsed(): void\n {\n $token = (new TokenGenerator())->withHs256([\n 'exp' => time() - 100,\n ]);\n\n $auth0 = new Auth0(self::$baseConfig + [\n 'tokenAlgorithm' => 'HS256',\n 'tokenLeeway' => 120,\n ]);\n\n $auth0->setIdToken($token);\n $this->assertEquals($token, $auth0->getIdToken());\n }",
"function do_password_create() {\n\t# grab some globals\n\t\tglobal $_CCFG;\n\n\t# Initialize new password to null and set some parameters\n\t\t$_nps\t\t= '';\n\t\t$i\t\t\t= 0;\n\t\t$_alphanum\t= 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n\t\tIF ($_CCFG['AUTOPASSWORD_STRENGTH']) {$_alphanum .= '~!@#$%^&*()-+=;:,<.>/?';}\n\t\t$_bl = strlen($_alphanum);\n\n\t# Set password length. Halfway between min and max, min = min\n\t\t$_length = $_CCFG['CLIENT_MIN_LEN_PWORD'] + ($_CCFG['CLIENT_MAX_LEN_PWORD'] - $_CCFG['CLIENT_MIN_LEN_PWORD']) /2;\n\n\t# Loop while we generate a character and add it to the string\n\t\twhile ($i < $_length) {$_nps .= $_alphanum[mt_rand(0, $_bl)]; $i++;}\n\n\t# Return results\n\t\treturn $_nps;\n}",
"public function __construct(int $passCodeLength = 6, int $secretLength = 10, ?\\DateTimeInterface $instanceTime = null, int $codePeriod = 30)\n {\n\n $this->passCodeLength = $passCodeLength;\n $this->secretLength = $secretLength;\n $this->codePeriod = $codePeriod;\n $this->periodSize = $codePeriod < $this->periodSize ? $codePeriod : $this->periodSize;\n $this->pinModulo = 10 ** $passCodeLength;\n $this->instanceTime = $instanceTime ?? new \\DateTimeImmutable();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the index within this string of the last occurrence of the specified string. | public function lastIndexOf($string, int $offset = 0): int
{
Assert::typeOf(['string', __CLASS__], $string);
$pos = mb_strrpos($this->data, (string) $string, $offset, $this->encoding);
return $pos > -1 ? $pos : -1;
} | [
"public function lastIndexOf(string $string){\n return strripos($this->string, $string);\n }",
"public function getLastIndexOf(string $string){\n return $this->subString(0, $this->lastIndexOf($string));\n }",
"function last_index_of($sub_str,$instr) {\n\tif(strstr($instr,$sub_str)!=\"\") {\n\t\treturn(strlen($instr)-strpos(strrev($instr),$sub_str));\n\t}\n\treturn(-1);\n}",
"public function last_index_of($str, $offset = 0) {\n\n $offset = intval($offset);\n\n $index = mb_strrpos($this->toString(), $str, $offset, \"UTF-8\");\n\n if($index === false) {\n $index = -1;\n }\n\n return $index;\n }",
"public static function lastIndexOf($str, $search, $startPos = 0)\n {\n $result = self::validateIndexOf($str, $search, $startPos);\n if (true !== $result) {\n return $result;\n }\n\n if (true === self::isEmpty($search)) {\n return $startPos;\n }\n\n $pos = \\strrpos($str, $search, $startPos);\n\n return (false === $pos)\n ? -1\n : $pos;\n }",
"public function indexOfLast(string $needle, int $offset = 0): int\n {\n return StrCommon::indexOfLast($this->str, $needle, $offset);\n }",
"public function testLastIndexOfReturnsMinusOneIfStringDoesNotContainNeedle()\n {\n $index = $this->create('abcabc')->lastIndexOf('d');\n $this->assertEquals(-1, $index);\n }",
"public function indexOfLast(string $needle, int $offset = 0)\n {\n return $this->utf8::strrpos(\n $this->str,\n $needle,\n $offset,\n $this->encoding\n );\n }",
"public function lastIndexOf($ch) {\n\t\treturn \\strrpos($this->string, $ch) === false ? -1 : \n\t\t\t\\strrpos($this->string, $ch);\n\t}",
"public static function LastIndexOf(string $String, string $Search, bool $CaseSensitive = true): int {\n return (($Position = $CaseSensitive ? \\strrpos($String, $Search) : \\strripos($String, $Search)) !== false) ? $Position : -1;\n }",
"function lastIndexOf(string $str, int $fromIndex)\n {\n if (!$fromIndex) $fromIndex = 0;\n $pos = strrpos($this->str, $str, $fromIndex);\n return $pos;\n }",
"function lastIndexOf($ch)\n {\n if (is_int($ch)) {\n $search = chr($ch);\n $result = strrpos($this->inner, $search);\n return $result === false ? -1 : $result;\n } else if (is_string($ch)) {\n $result = strrpos($this->inner, $ch);\n return $result === false ? -1 : $result;\n }\n return -1;\n }",
"public static function lastIndexOf( $haystack, $needle ) {\n\n\t\treturn strrpos( $haystack, $needle );\n\t}",
"public function getLastCharIndex() {}",
"public function lastIndexOf($value){\n\t\t\n\t\t$i = $this->count() - 1;\n\t\t\n\t\twhile($i >= 0 && $this->_Arr[$i] !== $value){\n\t\t\t--$i;\n\t\t}\n\t\t\n\t\treturn $i;\n\t\t\n\t}",
"public function lastIndexOf($o = null);",
"public function testLastIndexOfReturnsCorrectIndex()\n {\n $index = $this->create('abcabc')->lastIndexOf('b');\r\n $this->assertEquals(4, $index);\n }",
"private static function lastPosition(string $string, DecimalSeparator $separator): int\n {\n $lastPosition = strrpos($string, $separator->value);\n\n return $lastPosition !== false ? $lastPosition : -1;\n }",
"public function getAfterLastIndexOf(string $needle) : Str{ \n $pos = strripos($this->string, $needle);\n if($pos > -1){\n $this->string = substr($this->string, $pos+1);\n }else{\n $this->string = '';\n }\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets or sets compressionThreshold | public function compressionThreshold($compressionThreshold = null)
{
if(null === $compressionThreshold)
{
return $this->property('compressionThreshold');
}
return $this->property('compressionThreshold', (int) $compressionThreshold);
} | [
"public function getCompressionThreshold()\n {\n return $this->getProperty('compressionThreshold');\n }",
"public function getCompressingThreshold(): int\n {\n return 256;\n }",
"public function compression() {\n\t\treturn $this->compression;\n\t}",
"public function getCompression()\n {\n return $this->compression;\n }",
"public function getCompressionSpeedLevel();",
"public function getThreshold() {\n \treturn $this->threshold;\n }",
"private static function get_threshold(){\n $config = self::get_config();\n return isset($config['threshold']) ? (int) $config['threshold'] : 0;\n }",
"function getImageCompressionQuality(){}",
"protected function getCompressionType()\n {\n return $this->compression_type;\n }",
"public function getBufferCompression()\n {\n return $this->buffer_compression;\n }",
"public function getCompression() {\n\t}",
"public function getLevelThreshold() {\n return $this->levelThreshold;\n }",
"public function getDefaultJpegQuality()\n {\n $result = $this->config->get('concrete.misc.default_jpeg_image_compression');\n if ($this->valn->integer($result, 0, 100)) {\n $result = (int) $result;\n } else {\n $result = static::DEFAULT_JPEG_QUALITY;\n }\n\n return $result;\n }",
"public function getCompressTypeHint()\n {\n return $this->compress_type_hint;\n }",
"public function customJpegQuality() {\n\t\treturn 80;\n\t}",
"final public static function getSupportedCompression () {}",
"public function compressionId() { return $this->_m_compressionId; }",
"public function getCompressionMethod()\n {\n return $this->compressionMethod;\n }",
"public function setThreshold($var)\n {\n GPBUtil::checkDouble($var);\n $this->threshold = $var;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the Quality Control object for the Loom resource | public function getQualityControl()
{
return new QualityControl([
]);
} | [
"public function landscapeQualityModel() { return $this->landscapeQualityModel; }",
"public function getQuality();",
"public function getQualityId()\n {\n if (array_key_exists(\"qualityId\", $this->_propDict)) {\n return $this->_propDict[\"qualityId\"];\n } else {\n return null;\n }\n }",
"public function getIQuality()\n {\n return $this->get(self::IQUALITY);\n }",
"public function getQualityInfo()\n {\n return $this->quality_info;\n }",
"public function getQualityFactor();",
"public function portraitQualityModel() { return $this->portraitQualityModel; }",
"public function getCapacity() {\n try {\n Log::info('Get capacity depends on load type: ' . Auth::id(), array('c' => '1'));\n $roleId = Auth::User()->lkp_role_id;\n //Update the user activity to the buyer get capacity\n if ($roleId == BUYER) {\n CommonComponent::activityLog(\"BUYER_CAPACITY\", BUYER_CAPACITY, 0, HTTP_REFERRER, CURRENT_URL);\n }\n\n $load_type = $_REQUEST['load_type'];\n $load_types = DB::table('lkp_load_types')->select('ftl_measurement')->where('id', $load_type)->get();\n echo $load_types[0]->ftl_measurement;\n } catch (Exception $e) {\n echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n }\n }",
"function getHighestQuality(){\n $quality = null;\n\n $qualities = $this->_getQualities();\n if(count($qualities) > 0){\n $quality = $qualities[0];\n }\n\n return $quality;\n }",
"public function getResource()\n {\n if (! $this->resource) {\n // create a log channel\n $this->makeResource();\n }\n\n return $this->resource;\n }",
"public function getQuality(): int\n {\n return $this->quality;\n }",
"public static function getMinQuality(): int\n {\n return static::$min_quality;\n }",
"public function getQualityFactor()\n {\n return $this->clientPref->getQualityFactor() * $this->serverPref->getQualityFactor();\n }",
"public function quality()\n {\n return $this->config()['quality'] ?? 90;\n }",
"public function getIHeroQuality()\n {\n return $this->get(self::IHEROQUALITY);\n }",
"public function getQualityWeight()\n {\n return $this->qualityWeight;\n }",
"public function getQualityScore()\n {\n return $this->quality_score;\n }",
"public function resource()\n {\n $resource = $this->value->getResource();\n return $this->getAdapter($resource->getResourceName())\n ->getRepresentation($resource);\n }",
"public function getAudioQuality() {\n return $this->audioQuality;\n }",
"public function getQualityIndex()\n {\n return $this->qualityIndex;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the public 'TYPO3\CMS\Fluid\ViewHelpers\Link\ActionViewHelper' autowired service. | protected function getActionViewHelperService()
{
return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\Fluid\ViewHelpers\Link\ActionViewHelper::class);
} | [
"protected function getTermLinkIndexingActionService()\n {\n $a = ${($_ = isset($this->services['Yoast\\\\WP\\\\SEO\\\\Builders\\\\Indexable_Link_Builder']) ? $this->services['Yoast\\\\WP\\\\SEO\\\\Builders\\\\Indexable_Link_Builder'] : $this->getIndexableLinkBuilderService()) && false ?: '_'};\n\n if (isset($this->services['Yoast\\\\WP\\\\SEO\\\\Actions\\\\Indexing\\\\Term_Link_Indexing_Action'])) {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Actions\\\\Indexing\\\\Term_Link_Indexing_Action'];\n }\n $b = ${($_ = isset($this->services['Yoast\\\\WP\\\\SEO\\\\Repositories\\\\Indexable_Repository']) ? $this->services['Yoast\\\\WP\\\\SEO\\\\Repositories\\\\Indexable_Repository'] : $this->getIndexableRepositoryService()) && false ?: '_'};\n\n if (isset($this->services['Yoast\\\\WP\\\\SEO\\\\Actions\\\\Indexing\\\\Term_Link_Indexing_Action'])) {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Actions\\\\Indexing\\\\Term_Link_Indexing_Action'];\n }\n\n $this->services['Yoast\\\\WP\\\\SEO\\\\Actions\\\\Indexing\\\\Term_Link_Indexing_Action'] = $instance = new \\Yoast\\WP\\SEO\\Actions\\Indexing\\Term_Link_Indexing_Action($a, $b, ${($_ = isset($this->services['wpdb']) ? $this->services['wpdb'] : $this->getWpdbService()) && false ?: '_'});\n\n $instance->set_helper(${($_ = isset($this->services['Yoast\\\\WP\\\\SEO\\\\Helpers\\\\Taxonomy_Helper']) ? $this->services['Yoast\\\\WP\\\\SEO\\\\Helpers\\\\Taxonomy_Helper'] : $this->getTaxonomyHelperService()) && false ?: '_'});\n\n return $instance;\n }",
"protected function getTemplating_Helper_ActionsService()\n {\n return $this->services['templating.helper.actions'] = new \\Symfony\\Bundle\\FrameworkBundle\\Templating\\Helper\\ActionsHelper($this->get('controller_resolver'));\n }",
"public function getActionFactory()\n {\n return $this->container[self::ACTIONS];\n }",
"protected function getHateoas_Helper_LinkService()\n {\n return $this->services['hateoas.helper.link'] = new \\Hateoas\\Helper\\LinkHelper(($this->privates['hateoas.link_factory'] ?? $this->getHateoas_LinkFactoryService()), ($this->privates['hateoas.configuration.relations_repository'] ?? $this->getHateoas_Configuration_RelationsRepositoryService()));\n }",
"protected function getIndexableHeadActionService()\n {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Actions\\\\Indexables\\\\Indexable_Head_Action'] = new \\Yoast\\WP\\SEO\\Actions\\Indexables\\Indexable_Head_Action(${($_ = isset($this->services['Yoast\\\\WP\\\\SEO\\\\Surfaces\\\\Meta_Surface']) ? $this->services['Yoast\\\\WP\\\\SEO\\\\Surfaces\\\\Meta_Surface'] : $this->getMetaSurfaceService()) && false ?: '_'});\n }",
"protected function getTableAccessViewHelperService()\n {\n return \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Beuser\\ViewHelpers\\Display\\TableAccessViewHelper::class);\n }",
"protected function getPostLinkIndexingActionService()\n {\n $a = ${($_ = isset($this->services['Yoast\\\\WP\\\\SEO\\\\Builders\\\\Indexable_Link_Builder']) ? $this->services['Yoast\\\\WP\\\\SEO\\\\Builders\\\\Indexable_Link_Builder'] : $this->getIndexableLinkBuilderService()) && false ?: '_'};\n\n if (isset($this->services['Yoast\\\\WP\\\\SEO\\\\Actions\\\\Indexing\\\\Post_Link_Indexing_Action'])) {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Actions\\\\Indexing\\\\Post_Link_Indexing_Action'];\n }\n $b = ${($_ = isset($this->services['Yoast\\\\WP\\\\SEO\\\\Repositories\\\\Indexable_Repository']) ? $this->services['Yoast\\\\WP\\\\SEO\\\\Repositories\\\\Indexable_Repository'] : $this->getIndexableRepositoryService()) && false ?: '_'};\n\n if (isset($this->services['Yoast\\\\WP\\\\SEO\\\\Actions\\\\Indexing\\\\Post_Link_Indexing_Action'])) {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Actions\\\\Indexing\\\\Post_Link_Indexing_Action'];\n }\n\n $this->services['Yoast\\\\WP\\\\SEO\\\\Actions\\\\Indexing\\\\Post_Link_Indexing_Action'] = $instance = new \\Yoast\\WP\\SEO\\Actions\\Indexing\\Post_Link_Indexing_Action($a, $b, ${($_ = isset($this->services['wpdb']) ? $this->services['wpdb'] : $this->getWpdbService()) && false ?: '_'});\n\n $instance->set_helper(${($_ = isset($this->services['Yoast\\\\WP\\\\SEO\\\\Helpers\\\\Post_Type_Helper']) ? $this->services['Yoast\\\\WP\\\\SEO\\\\Helpers\\\\Post_Type_Helper'] : $this->getPostTypeHelperService()) && false ?: '_'});\n\n return $instance;\n }",
"protected function getUriViewHelperService()\n {\n return \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Fluid\\ViewHelpers\\Be\\UriViewHelper::class);\n }",
"public function getActionControllerService()\n {\n return $this->container['actionControllerService'];\n }",
"public function get_action_link() {\n return $this->actionlink;\n }",
"protected function getIndexableIndexingCompleteActionService()\n {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Actions\\\\Indexing\\\\Indexable_Indexing_Complete_Action'] = new \\Yoast\\WP\\SEO\\Actions\\Indexing\\Indexable_Indexing_Complete_Action(${($_ = isset($this->services['Yoast\\\\WP\\\\SEO\\\\Helpers\\\\Indexable_Helper']) ? $this->services['Yoast\\\\WP\\\\SEO\\\\Helpers\\\\Indexable_Helper'] : $this->getIndexableHelperService()) && false ?: '_'});\n }",
"protected function getMenuViewHelperService()\n {\n return \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Backend\\ViewHelpers\\ModuleLayout\\MenuViewHelper::class);\n }",
"protected function getUriViewHelper2Service()\n {\n return \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Fluid\\ViewHelpers\\Widget\\UriViewHelper::class);\n }",
"protected function getCshViewHelper2Service()\n {\n return \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Fluid\\ViewHelpers\\Be\\Labels\\CshViewHelper::class);\n }",
"public function getActionFactory()\n {\n if (null === $this->actionFactory) {\n $this->actionFactory = new ActionFactory();\n }\n return $this->actionFactory;\n }",
"protected function getSearchActionService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\sonata-project\\\\admin-bundle\\\\src\\\\Action\\\\SearchAction.php';\n\n return $this->services['Sonata\\\\AdminBundle\\\\Action\\\\SearchAction'] = new \\Sonata\\AdminBundle\\Action\\SearchAction(($this->services['sonata.admin.pool'] ?? $this->getSonata_Admin_PoolService()), ($this->services['sonata.admin.search.handler'] ?? $this->getSonata_Admin_Search_HandlerService()), ($this->services['sonata.admin.global_template_registry'] ?? $this->getSonata_Admin_GlobalTemplateRegistryService()), ($this->services['sonata.admin.breadcrumbs_builder'] ?? $this->getSonata_Admin_BreadcrumbsBuilderService()), ($this->services['twig'] ?? $this->getTwigService()));\n }",
"protected function getDebugViewHelperService()\n {\n return \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Fluid\\ViewHelpers\\DebugViewHelper::class);\n }",
"protected function getFosRest_Routing_Loader_Reader_ActionService()\n {\n @trigger_error('The fos_rest.routing.loader.reader.action service is deprecated since FOSRestBundle 2.8. You can disable it by setting the config `fos_rest.routing_loader.enabled` to `false`.', E_USER_DEPRECATED);\n\n include_once \\dirname(__DIR__, 4).'/vendor/friendsofsymfony/rest-bundle/Request/ParamReaderInterface.php';\n include_once \\dirname(__DIR__, 4).'/vendor/friendsofsymfony/rest-bundle/Request/ParamReader.php';\n\n $a = ($this->privates['annotations.cached_reader'] ?? $this->getAnnotations_CachedReaderService());\n\n return new \\FOS\\RestBundle\\Routing\\Loader\\Reader\\RestActionReader($a, new \\FOS\\RestBundle\\Request\\ParamReader($a), $this->getFosRest_Inflector_DoctrineService(), true, ['json' => false, 'xml' => false, 'html' => true], true);\n }",
"protected function getOroDatagrid_Extension_ActionService()\n {\n $this->services['oro_datagrid.extension.action'] = $instance = new \\Oro\\Bundle\\DataGridBundle\\Extension\\Action\\ActionExtension($this, $this->get('oro_security.security_facade'), $this->get('translator.default'));\n\n $instance->registerAction('navigate', 'oro_datagrid.extension.action.type.navigate');\n $instance->registerAction('ajax', 'oro_datagrid.extension.action.type.ajax');\n $instance->registerAction('delete', 'oro_datagrid.extension.action.type.delete');\n\n return $instance;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for adding the profiles count | public function addProfilesCount(): self {
$this->addStep('profilesCount');
return $this;
} | [
"private function _set_bcs_profile_count() {\n\t\t \t$this->db->where('active','1');\n\t\t \t$this->db->from('bcs_profiles');\n\t\t \t$this->_bcs_profile_count = $this->db->count_all_results();\n\t}",
"public function getFeaturedProfilesCount();",
"public final function getNumberProfile()\n {\n return count($this->profiles);\n }",
"public function getFeaturedProfilesCount()\n {\n\t\t\t\t\treturn self::$featuredProfileCount;\n\t\t}",
"public function countByProfileScore()\n {\n return $this->tutor\n ->live()\n ->whereHas('profile', function($q) {\n $q->where('quality', '!=', '0');\n })\n \n ->count();\n }",
"public function getFeaturedProfilesCount()\n {\n\t\t\t\t\treturn self::$featuredProfileCount;\n\t\t\t\t}",
"public static function count(){\n return DB::table('profiles')->selectRaw('count(id) as cnt')->first()->cnt;\n }",
"public function getActiveUsersCount();",
"public function count()\n {\n// foreach ($list as $user) {\n// echo $user->profile_count . '<br/>';\n// }\n\n// $list = UserModel::withSum('profile', 'status')->all([19,20,21]);\n// foreach ($list as $user) {\n// echo $user->profile_sum.'<br>';\n// }\n\n// $list = UserModel::withSum(['profile'=>'p_s'], 'status')->all([19,20,21]);\n// foreach ($list as $user) {\n// echo $user->p_s.'<br>';\n// }\n\n\n $list = UserModel::with('profile')->select();\n // 隐藏主表字段或附属表的字段;\n// return json($list->hidden(['profile.status']));\n// return json($list->hidden(['username','password','profile'=>['status','id']]));\n // 只显示相关的字段\n// return json($list->visible(['profile.status']));\n // 添加一个额外字段\n return json($list->append(['book.title']));\n }",
"public function getUsersCount();",
"public function increaseCount(){\n Person::$count++;\n }",
"public function countRecord($profileId)\n\t{\n $sql = \"SELECT COUNT(*) AS CNT FROM newjs.SEARCH_AGENT WHERE\";\n $sql.=\" PROFILEID = :PROFILEID\";\n $res = $this->db->prepare($sql);\n\t\t$res->bindParam(\":PROFILEID\", $profileId, PDO::PARAM_INT);\n $res->execute();\n $row = $res->fetch(PDO::FETCH_ASSOC);\n return $row[\"CNT\"];\n\t}",
"private function setCount()\n\t{\n\t\t$this->import_count = $this->twitter_count + $this->instagram_count + $this->facebook_count;\n\t}",
"public function ConsumerProfileEmptyFieldCount() {\n //Utils::debug();\n $user = $this->auth();\n if (empty($this->auth())) {\n Utils::response(['status' => false, 'message' => 'Forbidden access.'], 403);\n }\n if (($this->input->method() != 'get')) {\n Utils::response(['status' => false, 'message' => 'Bad request.'], 400);\n }\n\t\t//$items['consumer_id'] = $user['id'];\t\t\n\t\t$consumer_id = $user['id'];\n //$items['total_fields_to_update_profile_all'] = $this->Productmodel->getTotalCountConsumerProfileFieldsAvailableUpdateAll($consumer_id);\n\t$items = $this->Productmodel->getConsumerProfileFieldsRequireUpdate($consumer_id);\n\t$items['total_fields_to_update_profile'] = 100;\n\t$items['fields_to_update_personal_profile'] = 100;\n\t$items['fields_to_update_family_profile'] = 100;\n\t$items['fields_to_update_lifestyle_profile'] = 100;\n\t$items['fields_to_update_others_profile'] = 100;\n\t\t//$items = $this->Productmodel->getTotalCountConsumerProfileFieldsAvailableUpdateAll($consumer_id);\n\t\t\n Utils::response(['status'=>true,'message'=>'Consumer Profile Empty Field Count Listed here.','data'=>$items]); \n }",
"function count_all() {\n $username = $this->session->userdata('username');\n $this->db->where('username', $username);\n return $this->db->count_all($this->tbl_profile);\n }",
"public function getDealerProfileCount(){\r\n \r\n $cmd = \"SELECT COUNT(*) FROM login WHERE acc_type='1' AND sub_acc='0'\"; \r\n if (($result = $this->db->executeSQL($cmd)) === false) { \r\n return array(\r\n 'success'=>false,\r\n 'errcode'=>'0003', \r\n 'errmsg'=>$this->error->getErrorMessage('0003')\r\n ); \r\n }\r\n \r\n $row = $result->fetch_row();\r\n $total = $row[0]; \r\n $this->db->freeResultSet($result);\r\n \r\n return array(\r\n 'success'=>true,\r\n 'errcode'=>0, \r\n 'data'=>$total\r\n ); \r\n }",
"public function getSubscriberCount()\n {\n $sql = $this->_getSqlForTable('sd_profile_users');\n\n $ret = $this->_sqlExecute($sql,\n $sql->select()\n ->columns(array(new Literal('count(user_id) as total')))\n ->where(array(\n 'profile_id' => $this->getId(),\n 'type_id' => 3,\n ))\n );\n\n if(!count($ret)) {\n return 0;\n } else {\n $val = $ret->current();\n return (int)$val['total'];\n }\n }",
"function getOnlineUsersCount();",
"function updateProfileSeriousnessCount($profileArr)\n\t{\n\t\tif(!is_array($profileArr) || !count($profileArr)) {\n\t\t\tthrow new jsException(\"Param is not array or an empty is provided\");\n\t\t}\n\n\t\ttry{\n\t\t\t$now=date('Y-m-d h:i:s');\n\t\t\t$szINs = implode(',',array_fill(0,count($profileArr),'?'));\n\n\t\t\t$sql=\"UPDATE newjs.JPROFILE SET SERIOUSNESS_COUNT=SERIOUSNESS_COUNT+1,SORT_DT=? WHERE PROFILEID IN ($szINs)\";\n\t\t\t$pdoStatement = $this->db->prepare($sql);\n $count =1;\n\t\t\t$pdoStatement->bindValue($count, $now,PDO::PARAM_STR);\n\t\t\t//Bind Value\n\t\t\t\n\t\t\tforeach ($profileArr as $k => $value)\n\t\t\t{\n\t\t\t\t++$count;\n\t\t\t\t$pdoStatement->bindValue(($count), $value,PDO::PARAM_INT);\n\t\t\t}\n\t\t\t$pdoStatement->execute();\n\t\t\treturn true;\n\t\t} catch (Exception $ex){\n\t\t\tthrow new jsException($ex);\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Publish the filesystem service. | public static function publishFilesystem(Container $container): void
{
$config = $container->getSingleton(Config::class);
$container->setSingleton(
Filesystem::class,
new \Valkyrja\Filesystem\Managers\Filesystem(
$container->getSingleton(Factory::class),
$config['filesystem']
)
);
} | [
"private function publishFiles(): void\n {\n $this->progress->setMessage('Publishing files');\n\n $this->callSilent('vendor:publish', ['--tag' => 'directus']);\n }",
"public function publish()\n\t{\n\t\tparent::publish();\n\t\t$this->publishImages();\n\t}",
"private function publishPackage(): void\n {\n if ($this->app->runningInConsole()) {\n if (function_exists('config_path')) {\n $this->publishes([\n __DIR__ . '/../config/config.php' => config_path('hascrudactions.php'),\n ], 'config');\n }\n\n // Publishing the views.\n $this->publishes([\n __DIR__ . '/../resources/views' => resource_path('views/vendor/hascrudactions'),\n ], 'views');\n\n // Publishing the translation files.\n $this->publishes([\n __DIR__ . '/../resources/lang' => resource_path('lang/vendor/hascrudactions'),\n ], 'lang');\n\n // Publishing the assets files.\n $this->publishes([\n __DIR__ . '/../resources/assets' => public_path('vendor/hascrudactions'),\n ], 'assets');\n\n // Registering package commands.\n if (function_exists('config_path')) {\n $this->commands([\n CreateRepositoryCommand::class,\n CreateHascruActionCommand::class,\n InstallCommand::class,\n CreateViewCommand::class,\n CreateLatableCommand::class,\n CreateControllerCommand::class\n ]);\n } else {\n $this->commands([\n CreateHascruActionCommand::class,\n CreateRepositoryCommand::class,\n InstallCommand::class,\n ]);\n }\n }\n }",
"private function publishFiles(): void\n {\n $this->publishes([\n __DIR__.'/../config/utils.php' => config_path('utils.php'),\n ], 'utils-config');\n\n $this->publishes([\n __DIR__.'/Console/Commands/stubs' => base_path('stubs'),\n ], 'utils-stubs');\n }",
"private function publishFiles()\n {\n $publishTag = $this->_packageTag;\n\n $this->publishes([\n __DIR__.'/config/roles.php' => config_path('roles.php'),\n ], $publishTag.'-config');\n\n $this->publishes([\n __DIR__.'/Database/Migrations' => database_path('migrations'),\n ], $publishTag.'-migrations');\n\n $this->publishes([\n __DIR__.'/Database/Seeders/publish' => database_path('seeds'),\n ], $publishTag.'-seeds');\n\n $this->publishes([\n __DIR__.'/config/roles.php' => config_path('roles.php'),\n __DIR__.'/Database/Migrations' => database_path('migrations'),\n __DIR__.'/Database/Seeders/publish' => database_path('seeds'),\n ], $publishTag);\n\n $this->publishes([\n __DIR__.'/resources/views' => base_path('resources/views/vendor/'.$publishTag),\n ], $publishTag.'-views');\n\n $this->publishes([\n __DIR__.'/resources/lang' => base_path('resources/lang/vendor/'.$publishTag),\n ], $publishTag.'-lang');\n }",
"public function publishFiles() {\n\n $this->publishes([\n __DIR__ . '/../resources/views' => base_path('themes/avored/default/views/vendor')\n ],'avored-module-views');\n\n $this->publishes([\n __DIR__ . '/../database/migrations' => database_path('avored-migrations'),\n ]);\n }",
"private function registerPublishedPaths()\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n\n $this->publishes([\n __DIR__ . '/../config/splade.php' => config_path('splade.php'),\n ], 'config');\n\n $this->publishes([\n __DIR__ . '/../config/splade-seo.php' => config_path('splade-seo.php'),\n ], 'seo');\n\n $this->publishes([\n __DIR__ . '/../resources/views/components' => base_path('resources/views/vendor/splade/components'),\n __DIR__ . '/../resources/views/form' => base_path('resources/views/vendor/splade/form'),\n __DIR__ . '/../resources/views/table' => base_path('resources/views/vendor/splade/table'),\n ], 'views');\n\n $this->publishes([\n __DIR__ . '/../resources/lang' => base_path('resources/lang/vendor/splade'),\n ], 'translations');\n }",
"public function publishFiles()\n {\n $this->publishes([\n $this->getTranslationsDirectory() => $this->getPublishedTranslationsDirectory(),\n ]);\n }",
"public function publishFiles() {\n $this->publishes([\n __DIR__ . '/../resources/views' => base_path('themes/avored/default/views/vendor')\n ],'avored-module-views');\n $this->publishes([\n __DIR__ . '/../database/migrations' => database_path('avored-migrations'),\n ]);\n }",
"protected function registerPublishableFiles()\n {\n $this->publishes([\n __DIR__.\"/../config/{$this->name}.php\" => config_path(\"{$this->name}.php\"),\n ], 'config');\n\n $this->publishes([\n __DIR__.\"/../resources/views\" => resource_path(\"views/vendor/{$this->name}\"),\n ], 'views');\n\n $this->publishes([\n __DIR__.\"/../resources/lang\" => resource_path(\"lang/vendor/{$this->name}\"),\n ], 'lang');\n }",
"private function registerFileSystem()\n {\n $this->app->singleton('steroids.fileSystem', function($app)\n {\n return new Filesystem;\n });\n }",
"public function publish()\n\t{\n\t\t$run_task = false;\n\t\t$asset_directory = path('public').'bundles/';\n\n\t\t// This set of code check whether the application has the right set \n\t\t// of directory configuration in order to be updated through web. If \n\t\t// such issue exist it would be best to flush the directory and let \n\t\t// web server file/group permission to create the folder.\n\t\tif ( ! is_dir($asset_directory) or ! is_writable($asset_directory))\n\t\t{\n\t\t\t// only remove directory if it's exist.\n\t\t\tis_dir($asset_directory) or File::rmdir($asset_directory);\n\n\t\t\t// try mkdir, in certain scenario this would be possible if the \n\t\t\t// public folder ownership is set correctly.\n\t\t\tif ( ! @mkdir($asset_directory, 0755, true))\n\t\t\t{\n\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"Unable to create directory [{$asset_directory}] due to permission issue.\"\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$run_task = true;\n\t\t}\n\n\t\t// If it's still unable to be writable, return false.\n\t\tif ( ! is_writable($asset_directory)) return false;\n\n\t\t// Avoid web server to run extensive file migration process unless \n\t\t// necessary (if the folder is remove and re-created). \n\t\tif (true === $run_task)\n\t\t{\n\t\t\tforeach (array_keys(Bundle::$bundles) as $bundle)\n\t\t\t{\n\t\t\t\tIoC::resolve('task: orchestra.publisher', array($bundle));\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function publishFiles()\n {\n $this->publishes([\n __DIR__ . '/../resources/views' => base_path('themes/avored/default/views/vendor')\n ], 'avored-banner-views');\n $this->publishes([\n __DIR__ . '/../database/migrations' => database_path('migrations'),\n ]);\n $this->publishes([\n __DIR__ . '/../dist/js' => public_path('avored-admin/js'),\n ]);\n }",
"public function offerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../resources/views' => resource_path('views/vendor/samlidp'),\n ], 'samlidp_views');\n\n $this->publishes([\n __DIR__ . '/../config/samlidp.php' => config_path('samlidp.php'),\n ], 'samlidp_config');\n }\n }",
"public function publish(): void\n {\n $this->publishes(\n\t\t\t[__DIR__.'/../../config/telegram.php' => config_path('telegram.php')],\n\t\t\t'telegram-config'\n\t\t);\n\n $this->publishes(\n\t\t\t[__DIR__.'/../database/migrations' => database_path('migrations')],\n\t\t\t'telegram-migrations'\n\t\t);\n }",
"public function publishToRegistry()\n {\n $filename =explode('.',$this->file);\n $tmpfile = $filename[0];\n //$isPublished = $this->isFilePublished($tmpfile);\n\n $ckan = new Ckan_Client($this->api_key);\n try{\n if($this->is_pushed_to_registry){\n $response = $ckan->put_package_entity($tmpfile,$this->json_data);\n if($response){\n $this->saveRegistryPublishInfo($response,true);\n } else {\n $this->error = \"Your file could not be published in IATI Registry.\";\n $this->error .= \" {$ckan->getError()}\";\n }\n } else{\n $response = $ckan->post_package_register($this->json_data);\n if($response){\n $this->saveRegistryPublishInfo($response);\n } else {\n $this->error = \"Your files could not be published in IATI Registry.\";\n $this->error .= \" {$ckan->getError()}\";\n }\n }\n\n } catch (Exception $e) {\n print '<p><strong>Caught exception on Publishing to Registry: ' . $e->getMessage() . '</strong></p>';\n exit;\n }\n unset($ckan);\n }",
"private function publish () {\n\n // Publish Translations\n $this->publishes([\n $this->packagePath('resources/lang') => resource_path('lang/vendor/redprint'),\n ], 'redprint-translations');\n\n // Publish views\n $this->publishes([\n $this->packagePath('resources/views') => resource_path('views/vendor'),\n ], 'redprint-views');\n \n // Publish assets\n $this->publishes([\n $this->packagePath('resources/assets') => public_path('vendor/redprint'),\n ], 'redprint-assets');\n\n // Publish Menu Config\n $this->publishes([\n $this->packagePath('config/menu.php') => config_path('menu.php'),\n ], 'redprint-menu');\n\n // Publish Redprint Config\n $this->publishes([\n $this->packagePath('config/redprint.php') => config_path('redprint.php'),\n ], 'redprint-config');\n\n }",
"public function publish()\n {\n $result = file_exists(static::getStubDir());\n if ($result) {\n $this->printConsole(\"Package's stubs already published ...\", 'warn');\n return;\n }\n $this->mkdir(static::getStubDir());\n $this->recurse_copy($this->getAssetsFolderPath(), static::getStubDir());\n $this->printConsole('Package\\'s stubs published successfully');\n }",
"public function registerFilesystem() : void\n {\n $this->container->singleton('files', function () : Filesystem {\n return new Filesystem();\n });\n }",
"private function addPublishedFiles()\n {\n $this->publishes([\n __DIR__ . '/../config/rested.php' => config_path('rested.php'),\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract the HTTP message from a response | public static function extractMessage($response_str)
{
preg_match("|^HTTP/[\d\.x]+ \d+ ([^\r\n]+)|", $response_str, $m);
if (isset($m[1])) {
return $m[1];
} else {
return false;
}
} | [
"function get_response() {\n $text = $this->message->text;\n if($text)\n return extract_response($text);\n else\n return '';\n }",
"public function getResponseMessage() {\n\t\tif(!empty($this->response->info)) {\n\t\t\treturn $this->response->info;\n\t\t}\n\t}",
"protected function getResponseMessage() : string {\n return json_decode($this->response->body, true)['message'];\n }",
"public function getRawResponseMessage()\n {\n }",
"public function getMessage()\n\t{\n\t\treturn wp_remote_retrieve_response_message(\n\t\t\t$this->response\n\t\t);\n\t}",
"function parse_response($message)\n{\n return Utils::parse_response($message);\n}",
"function http_parse_message ($message) {}",
"function parseResponse($response){\n // This might look weird but it needs to be mb safe.\n $fp = fopen(\"php://memory\", 'r+');\n fputs($fp, $response);\n rewind($fp);\n\n $line = fgets($fp);\n while(preg_match('/connection established/i', $line)){\n $line = fgets($fp);\n $line = fgets($fp);\n }\n if(preg_match('/^HTTP\\/\\d\\.\\d (\\d{3}) /', $line, $m)) $this->status = $m[1];\n\n while($line = fgets($fp)){\n if(!preg_match('/^(.*?): ?(.*)/', $line, $m)) break;\n $this->headers[$m[1]] = trim($m[2]);\n }\n\n $this->html = $this->body = stream_get_contents($fp);\n fclose($fp);\n }",
"function scalr_parse_http_response($response) { \n // Split response into header and body sections \n list($response_headers, $response_body) = explode(\"\\r\\n\\r\\n\", $response, 2); \n $response_header_lines = explode(\"\\r\\n\", $response_headers); \n\n // First line of headers is the HTTP response code \n $http_response_line = array_shift($response_header_lines); \n if(preg_match('@^HTTP/[0-9]\\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; } \n\n // put the rest of the headers in an array \n $response_header_array = array(); \n foreach($response_header_lines as $header_line) { \n list($header,$value) = explode(': ', $header_line, 2); \n $response_header_array[$header] .= $value.\"\\n\"; \n } \n\n return array(\n 'code' => $response_code,\n 'header' => $response_header_array,\n 'body' => $response_body,\n ); \n}",
"private function parseResponse() {\n $token = \"\\n\";\n $line = strtok($this->returnedTransfer, $token);\n\n if (stripos($line, ' 100 Continue') !== false && stripos($line, 'HTTP') === 0) {\n do {\n $line = strtok($token);\n } while (0 < strlen(trim($line)));\n strtok($token); // also slip next HTTP TAG\n }\n\n // Proxy connection support.\n if (stripos($line, ' 200 Connection established') !== false && stripos($line, 'HTTP') === 0) {\n do {\n $line = strtok($token);\n } while (0 < strlen(trim($line)));\n strtok($token); // also slip next HTTP TAG\n }\n\n while (0 < strlen(trim($line = strtok($token)))) {\n $this->parseResponseHeaderLine($line);\n }\n $this->parsedResponse = strtok(\"\");\n }",
"public function getResponseMessage()\n {\n return $this->responseMessage;\n }",
"function _process_respond() {\n $lines = explode(\"\\r\\n\", $this->_header);\n $header_done = false;\n // $this->_error_log($this->_buffer);\n // First line should be a HTTP status line (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6)\n // Format is: HTTP-Version SP Status-Code SP Reason-Phrase CRLF\n list($ret_struct['status']['http-version'], \n $ret_struct['status']['status-code'], \n $ret_struct['status']['reason-phrase']) = explode(' ', $lines[0],3);\n \n // print \"HTTP Version: '$http_version' Status-Code: '$status_code' Reason Phrase: '$reason_phrase'<br>\";\n // get the response header fields\n // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6\n for($i=1; $i<count($lines); $i++) {\n if (rtrim($lines[$i]) == '' && !$header_done) {\n $header_done = true;\n // print \"--- response header end ---<br>\";\n \n } \n if (!$header_done ) {\n // store all found headers in array ...\n list($fieldname, $fieldvalue) = explode(':', $lines[$i]);\n $ret_struct['header'][$fieldname] = trim($fieldvalue);\n } \n }\n // print 'string len of response_body:'. strlen($response_body);\n // print '[' . htmlentities($response_body) . ']';\n $ret_struct['body'] = $this->_body; \n return $ret_struct;\n }",
"private function _extractHeadersAndBody($response){\n //First split by 2 'CRLF'\n $responseComponents = preg_split(\"/(?:\\r?\\n){2}/\", $response);\n $body = null;\n for ($count = 0; \n $count < count($responseComponents) && $body == null; \n $count++) {\n \n $headers = $responseComponents[$count];\n $responseStatus = $this->_extractHttpStatusCode($headers);\n \n if($responseStatus != null && \n $this->_httpHeadersHaveContent($headers)){\n \n $responseHeaderMetadata = $this->_extractResponseHeaderMetadata($headers);\n //The body will be the next item in the responseComponents array\n $body = $responseComponents[++$count];\n }\n }\n \n //If the body is null here then we were unable to parse the response and will throw an exception\n if($body == null){\n require_once(dirname(__FILE__) . '/Exception.php');\n $exProps[\"Message\"] = \"Failed to parse valid HTTP response (\" . $response . \")\";\n $exProps[\"ErrorType\"] = \"HTTP\";\n throw new FBAOutboundServiceMWS_Exception($exProps);\n }\n\n return array(\n 'Status' => $responseStatus, \n 'ResponseBody' => $body, \n 'ResponseHeaderMetadata' => $responseHeaderMetadata);\n }",
"function HTTP_response($raw)\n{\n $fragments = explode(\"\\n\\n\", $raw, 2);\n $HTTP_headers = $fragments[0];\n $HTTP_body = $fragments[1];\n foreach (explode(\"\\n\", $HTTP_headers) as $HTTP_header)\n {\n $fragments = explode(\":\", $HTTP_header, 2);\n if ($fragments[0] == \"Status\")\n {\n http_response_code(intval($fragments[1]));\n }\n else\n header($HTTP_header);\n }\n echo $HTTP_body;\n}",
"#[Pure]\n public function getRawResponseMessage() {}",
"public function getMessageResponse()\n {\n return $this->messageResponse;\n }",
"function parse_response($message)\n {\n }",
"private function parseMessageBody()\n {\n return mb_substr($this->raw, mb_strlen($this->http_message));\n }",
"function parseHttpResponse($content=null) {\n if (empty($content)) { return false; }\n // split into array, headers and content.\n $hunks = explode(\"\\r\\n\\r\\n\",trim($content));\n if (!is_array($hunks) or count($hunks) < 2) {\n return false;\n\t}\n $header = $hunks[count($hunks) - 2];\n $body = $hunks[count($hunks) - 1];\n $headers = explode(\"\\n\",$header);\n unset($hunks);\n unset($header);\t\n if (in_array('Transfer-Coding: chunked',$headers)) {\n return trim(unchunkHttpResponse($body));\n\t} else {\n return trim($body);\n\t}\n}",
"function http_parse_response($response) {\n\n\t// Init the return value.\n\t$ret_val = array();\n\n\t// Separate the fields in the response.\n\t$fields = explode(\"\\r\\n\", preg_replace('/\\x0D\\x0A[\\x09\\x20]+/', ' ', $response));\n\n\t// Get the very last field and store it.\n\t$ret_val['Content'] = $fields[count($fields) - 1];\n\n\t// Delete the last field that we set as content;\n\tunset($fields[count($fields) - 1]);\n\n\t// Iterate through the fields.\n\tforeach ($fields as $field) {\n\n\t\t// Do not process empty fields.\n\t\tif (empty($field)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Match the header pattern.\n\t\tif (preg_match('/([^:]+): (.+)/m', $field, $match)) {\n\n\t\t\t// Replace pattern by strtoupper.\n\t\t\t$match[1] = preg_replace('/(?<=^|[\\x09\\x20\\x2D])./e', 'strtoupper(\"\\0\")', strtolower(trim($match[1])));\n\n\t\t\t// Check if that header has been already set in the return array.\n\t\t\tif (isset($ret_val[$match[1]])) {\n\n\t\t\t\t// If this header is not an array.\n\t\t\t\tif (!is_array($ret_val[$match[1]])) {\n\n\t\t\t\t\t// Transform it into one (array).\n\t\t\t\t\t$ret_val[$match[1]] = array($ret_val[$match[1]]);\n\n\t\t\t\t}\n\n\t\t\t\t// Append the new header.\n\t\t\t\t$ret_val[$match[1]][] = trim($match[2]);\n\n\t\t\t} else {\n\n\t\t\t\t// Store the header.\n\t\t\t\t$ret_val[$match[1]] = trim($match[2]);\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// If this no-header-like contains HTTP.\n\t\t\tif (preg_match('/HTTP\\//', $field)) {\n\n\t\t\t\t// Following HTTP standards which are space-separated\n\t\t\t\tpreg_match('/(.*?) (.*?) (.*)/', $field, $matches);\n\n\t\t\t\t// Store the HTTP values.\n\t\t\t\t$ret_val['HTTP']['version'] = $matches[1];\n\t\t\t\t$ret_val['HTTP']['code'] = $matches[2];\n\t\t\t\t$ret_val['HTTP']['reason'] = $matches[3];\n\n\t\t\t} else {\n\n\t\t\t\t// Store the content.\n\t\t\t\t$ret_val['Content'][] = $field;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn $ret_val;\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rolls a license expiration date back when refunding a renewal payment. | function edd_sl_rollback_expiration_on_renewal_refund( $payment ) {
$is_renewal = edd_get_payment_meta( $payment->ID, '_edd_sl_is_renewal', true );
if ( ! $is_renewal ) {
return;
}
foreach ( $payment->cart_details as $cart_item ) {
if ( is_array( $cart_item['item_number']['options'] ) ) {
// See if the `is_renewal` key exists and if the license_id exists, since these were added later, they may not on some legacy payments.
if ( array_key_exists( 'is_renewal', $cart_item['item_number']['options'] ) && ! empty( $cart_item['item_number']['options']['license_id'] ) ) {
$license = edd_software_licensing()->get_license( (int) $cart_item['item_number']['options']['license_id'] );
if ( false !== $license ) {
$license->expiration = strtotime( '-' . $license->license_length(), $license->expiration );
}
}
}
}
} | [
"function renewSubscription(&$subscription){\n\t\t$subscriptionTypeDAO =& DAORegistry::getDAO('SubscriptionTypeDAO');\n\t\t$subscriptionType =& $subscriptionTypeDAO->getSubscriptionType($subscription->getTypeId());\n\t\t\n\t\t$duration = $subscriptionType->getDuration();\n\t\t$dateEnd = strtotime($subscription->getDateEnd());\n\t\t\n\t\t// if the subscription is expired, extend it to today + duration of subscription\n\t\t$time = time();\n\t\tif ($dateEnd < $time ) $dateEnd = $time;\n\n\t\t$subscription->setDateEnd($this->dateToDB(mktime(0, 0, 0, date(\"m\", $dateEnd)+$duration, date(\"d\", $dateEnd), date(\"Y\", $dateEnd))));\n\t\t$this->updateSubscription($subscription);\n\t}",
"public function rollbackSubscription(): void\n {\n $this->subscription\n ->setCurrency($this->oldSubscription->getCurrency())\n ->setFeatures($this->oldSubscription->getFeatures())\n ->setRenewInterval($this->oldSubscription->getRenewInterval())\n ->setNextRenewAmount($this->oldSubscription->getNextRenewAmount())\n ->setNextRenewOn($this->oldSubscription->getNextRenewOn());\n }",
"public function renewExpiration()\n {\n if ($oReserved = $this->getReservations()) {\n $iTime = oxRegistry::get(\"oxUtilsDate\")->getTime();\n $oReserved->oxuserbaskets__oxupdate = new oxField($iTime);\n $oReserved->save();\n\n oxRegistry::getSession()->deleteVariable(\"iBasketReservationTimeout\");\n }\n }",
"public function renew(int $expiry = 15): void\n {\n if ($this->isConfirmed()) {\n throw new NotAllowedException(\n 'User invitation',\n 'Renew',\n 'A confirmed user invitation cannot be renewed'\n );\n }\n $this->expiration = new LocalTimestamp(\n Timestamp::createFromDateTime(\n new DateTime(\"now +$expiry days\")\n ),\n 'UTC'\n );\n }",
"public function refund();",
"public function onExpirationDateChange( \\IPS\\nexus\\Purchase $purchase )\n\t{\n\t\n\t}",
"function checkSubscriptionRenewal($order)\n {\n $plan = & $order['PaidOrder']['plan_info']['plan_array'];\n if($order['PaidOrder']['order_status'] == 'Complete') /* The order had already been procesed in the past */\n {\n $PaidTxnLog = ClassRegistry::getClass('PaidTxnLogModel');\n $PaidTxnLog->addNote(\"Subscription Renewal\");\n $new_expiration = PaidOrderModel::getExpirationDate($plan['duration_period'],$plan['duration_number'],$order['PaidOrder']['order_expires']);\n $order['PaidOrder']['order_expires'] = $new_expiration;\n $plan['moderation'] = 0; // If it was published before no need to moderate it again\n }\n\n return $order;\n }",
"function listen_for_licensekey_renewal() {\n\t\t\tif ( empty($_GET['foolic_renewal_license_key']) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//make sure we are on the check out page\n\t\t\tif ( !function_exists( 'edd_is_checkout' ) || !edd_is_checkout() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//make sure the user is logged in\n\t\t\tif ( !is_user_logged_in() ) {\n\t\t\t\tauth_redirect();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//remove any previous items from the cart\n\t\t\tedd_empty_cart();\n\n\t\t\t//get the license key id\n\t\t\t$licensekey_id = $_GET['foolic_renewal_license_key'];\n\n\t\t\t//get the key\n\t\t\t$licensekey = foolic_licensekey::get_by_id( $licensekey_id );\n\n\t\t\t//add any errors regarding the renewal\n\t\t\t$renewal_error = false;\n\n\t\t\tif ( $licensekey->ID === 0 ) {\n\t\t\t\t//if the license key does not exist then get out!\n\t\t\t\t$this->set_error( 'foolic_renewal_error_license', __( 'License Renewal Error : Invalid license!!', 'edd_foolic' ) );\n\t\t\t\t$renewal_error = true;\n\t\t\t}\n\n\t\t\tif (!$renewal_error) {\n\t\t\t\t$licensekey_user = $licensekey->get_user();\n\n\t\t\t\t//make sure the license key is for the currently logged in user\n\t\t\t\tif ( $licensekey_user === false || $licensekey_user->ID !== wp_get_current_user()->ID ) {\n\t\t\t\t\t$this->set_error( 'foolic_renewal_error_user', __( 'License Renewal Error : You may only renew licenses that belong to you!', 'edd_foolic' ) );\n\t\t\t\t\t$renewal_error = true;\n\t\t\t\t}\n\n\t\t\t\t//make sure the license key is not deactivated\n\t\t\t\telse if ( $licensekey->is_deactivated() ) {\n\t\t\t\t\t$this->set_error( 'foolic_renewal_error_deactivated', __( 'License Renewal Error : You cannot renew licenses that have been deactivated!', 'edd_foolic' ) );\n\t\t\t\t\t$renewal_error = true;\n\t\t\t\t}\n\n\t\t\t\t//make sure the license key expires\n\t\t\t\telse if ( !$licensekey->does_expire() ) {\n\t\t\t\t\t$this->set_error( 'foolic_renewal_error_not_expire', __( 'License Renewal Error : You do not need to renew licenses that do not expire!', 'edd_foolic' ) );\n\t\t\t\t\t$renewal_error = true;\n\t\t\t\t}\n\n\t\t\t\t$renewal_fee_key = 'edd_foolic_renewal_' . $licensekey_id;\n\n\t\t\t\t//gather some info needed for the cart\n\t\t\t\t$download_id = edd_foolic_find_download_id( $licensekey );\n\t\t\t\t$price_id = edd_foolic_find_price_id( $licensekey, $download_id );\n\t\t\t\t$cart_options = array(\n\t\t\t\t\t'edd_foolic_renewal_licensekey' => $licensekey_id,\n\t\t\t\t\t'edd_foolic_renewal_fee' => $renewal_fee_key\n\t\t\t\t);\n\n\t\t\t\tif ( $price_id !== false ) {\n\t\t\t\t\t$cart_options['price_id'] = $price_id;\n\t\t\t\t\t$download_price = edd_get_price_option_amount( $download_id, $price_id );\n\t\t\t\t} else {\n\t\t\t\t\t$download_price = edd_get_download_price( $download_id );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( empty ( $download_id ) ) {\n\n\t\t\t\t$this->set_error( 'foolic_upgrade_error_download', __( 'License Upgrade Error : The download could not be found!', 'edd_foolic' ) );\n\t\t\t\t$renewal_error = true;\n\t\t\t}\n\n\t\t\t//we had no renewal errors so we can apply the discount\n\t\t\tif ( !$renewal_error ) {\n\n\t\t\t\t//add the item to the cart\n\t\t\t\t$cart_key = edd_add_to_cart( $download_id, $cart_options );\n\n\t\t\t\tif ( isset($cart_key) ) {\n\n\t\t\t\t\t//only add the discount fee once to the cart\n\t\t\t\t\tif ( EDD()->fees->get_fee( $renewal_fee_key ) === false ) {\n\n\t\t\t\t\t\t//apply renewal discount\n\t\t\t\t\t\t$discount_perc = foolic_renewal_percentage( $licensekey );\n\t\t\t\t\t\t$download_price = floatval( $download_price );\n\n\t\t\t\t\t\tif ( $download_price > 0 && $discount_perc > 0 ) {\n\t\t\t\t\t\t\t$discount = ($download_price * $discount_perc / 100) * -1;\n\t\t\t\t\t\t\t$discount = number_format( $discount, 2, '.', '' );\n\t\t\t\t\t\t\t$renewal_name = '[ ' . $discount_perc . '% ' . __( 'Renewal Discount', 'edd_foolic' ) . ' ] - ' . $licensekey->get_license()->name;\n\t\t\t\t\t\t\tEDD()->fees->add_fee( $discount, $renewal_name, $renewal_fee_key );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tadd_action( 'edd_cart_empty', array($this, 'print_errors') );\n\n\t\t\tif ( !empty($licensekey_id) && !empty($_GET['send_mail']) ) {\n\t\t\t\t$emails = new edd_foolic_emails();\n\t\t\t\t$emails->send_renewal_reminder( $licensekey_id, true );\n\t\t\t}\n\t\t}",
"public function renew(){\n\t$account_id = $this->input->post('account_id');\n\t$term = $this->input->post('term');\n\t$userid = $this->userobj->userid;\n\t$role = $this->userobj->role;\n\t$name = $this->userobj->name;\n\n\tif($role != 'admin') {\n\t $data['error'] = '<br><h1 style=\"text-align: center;\">Sorry, '.$name.'\n\t <br>You Don\\'t Have The Right to Modify This Account.</h1>';\n\t $data['page_title'] = 'Account Renew Error';\n\t $this->load_view('errors/generic_error',$data);\n\t return;\n\t}\n\t\n\t// set the new expire date based on the old one\n\t$accountInfo = $this->account_model->get_account_info($account_id);\n\t$expire_date = $accountInfo['expire_date'];\n\t$expire_date = $this->get_expire_date($expire_date, '', $term);\n\n\t// update the database now\n\t$this->account_model->renew_account($expire_date,$term,$account_id);\n\n\t// update the initiation file now\n\t$props = array(\n\t 'lis.expire' => $expire_date,\n\t);\n\t$this->admin_filemanager->modify_initiation_file($account_id, $props);\n\n\tredirect('admin/accounts/edit'.$account_id);\n }",
"public function removeExpiration()\n {\n // We dont do anything if there is no expiration\n if ($this->expiration == null) {\n return;\n }\n $this->apply(\n new SubscriptionExpirationRemoved(\n $this->id\n )\n );\n }",
"private function expireSalesRule()\n {\n // expire sales rules\n $salesRule = $this->salesRule->setToDate((new \\DateTime('yesterday'))->format('Y-m-d'));\n $this->ruleResource->save($salesRule);\n }",
"function subscriptionCancel() {\n $subscriptionId = getSubscriptionId();\n $cancelStatus = $_POST['cancel_status'];\n $params = array();\n if( $cancelStatus == \"cancel_on_next_renewal\" ) {\n $params['end_of_term'] = 'true';\n }\n $result = ChargeBee_Subscription::cancel($subscriptionId,$params);\n header(\"Location: subscription\");\n}",
"function refund($id, $amt);",
"public function expire()\n {\n $this->transitionTo(ReservationState::EXPIRED);\n $this->sendExpirationMessage();\n $this->removeFromCalendar();\n }",
"function resetDateReminded($args, $institutional = false) {\n\t\t$journal =& Request::getJournal();\n\t\t$subscriptionId = (int) array_shift($args);\n\n\t\tif ($institutional) {\n\t\t\t$subscriptionDao =& DAORegistry::getDAO('InstitutionalSubscriptionDAO');\n\t\t} else {\n\t\t\t$subscriptionDao =& DAORegistry::getDAO('IndividualSubscriptionDAO');\n\t\t}\n\n\t\tif ($subscriptionDao->getSubscriptionJournalId($subscriptionId) == $journal->getId()) {\n\t\t\t$subscription =& $subscriptionDao->getSubscription($subscriptionId);\n\t\t\tswitch (Request::getUserVar('type')) {\n\t\t\t\tcase 'before':\n\t\t\t\t\t$subscription->setDateRemindedBefore(null);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'after':\n\t\t\t\t\t$subscription->setDateRemindedAfter(null);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$subscriptionDao->updateSubscription($subscription);\n\t\t}\n\t}",
"function edd_rcp_force_auto_renew( $data ) {\n\n\tif( '45 Days' == $data['subscription_name'] ) {\n\t\t$data['auto_renew'] = false;\n\t}\n\n\treturn $data;\n}",
"public function markExpiredInvoiceAsReleased()\n {\n $this->newQuery()\n ->where('expires_on', '<=', Carbon::now())\n ->where('is_released', false)\n ->update([\n 'is_released' => true,\n ]);\n }",
"public function deductTrialDay(){\n if($this->hasActiveTrial()){\n // Deduct a day from trial days\n $this->agent_trial_days = $this->agent_trial_days - 1;\n $this->save(false);\n\n // Disable Trial if no days left\n if($this->agent_trial_days == 0){\n $this->_disableAgentAndManagedAccounts();\n\n // Log to Slack that this customer trial expired & no billing setup\n Yii::info(\"[Agent #\".$this->agent_id.\" Trial Expired] Owned by \".$this->agent_name.\" and has \".count($this->instagramUsers).\" accounts\", __METHOD__);\n\n // Send Email to Customer that his trial expired & need to setup billing\n Yii::$app->mailer->compose([\n 'html' => 'billing/trial-expired',\n ], [\n 'agent' => $this,\n ])\n ->setFrom([\\Yii::$app->params['supportEmail'] => \\Yii::$app->name ])\n ->setTo($this->agent_email)\n ->setSubject('Your trial has expired. Thanks for giving Plugn a try!')\n ->send();\n }\n }\n }",
"public function changeExpiryDate(Request $request)\n {\n if (Gate::denies('globe-admin-above')) {\n \\Session::flash('alert_message', 'Unauthorized action.');\n return redirect('/home');\n }\n\n $refined_expiry_date = date('Y-m-d H:i', strtotime($request->expiry_date));\n $company = Company::find($request->company_id);\n $company->credit_expiry = $refined_expiry_date;\n\n if($company->save()){\n \\Session::flash('success_message', 'Credit expiry date has been changed.');\n }else{\n \\Session::flash('alert_message', 'Credit expiry date cannot be changed.');\n }\n\n return redirect()->back();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get configurable options source for original product. | protected function getOriginalProductOptionsSource()
{
return $this->product->getDataFieldConfig('configurable_options')['source'];
} | [
"public function getOptionsSource();",
"public function getConfigSource()\n {\n return $this->configSource;\n }",
"public function getSourceConfig() {\n if (empty($this->sourceConfig)) {\n $source_config_name = ConfigName::createByFullName($this->definition['source']);\n $this->sourceConfig = $this->configReverter->getFromExtension($source_config_name->getType(), $source_config_name->getName());\n }\n\n return $this->sourceConfig;\n }",
"public function getSourceConfig()\n {\n return $this->source_config;\n }",
"public function getConfigSource() {\n return $this->config->getSource();\n }",
"public function getProductOptions()\n {\n\t\t//echo \"<br>22222222222-----\".$this->getItem()->getProduct()->getId();\n\t\t//echo \"<pre>\".print_r($this->getItem()).\"</pre>\";\n /* @var $helper Mage_Catalog_Helper_Product_Configuration */\n $helper = Mage::helper('catalog/product_configuration');\n return $helper->getCustomOptions($this->getItem());\n }",
"public function getSourceConfig()\n {\n return isset($this->source_config) ? $this->source_config : null;\n }",
"public function getProductOptions(){\n\t\t$options = parent::getProductOptions(); //get default relevant translated option labels & values\n\t\t\n\t\t$dhelper = Mage::helper('delightfully_wrappedgiftcard');\n\t\t\n\t\treturn $dhelper->extendOptionsWithDeliveryMethod($options); //edit options to include correct names for delivery options\n\t}",
"public function getProductCustomOptions() {\n /**\n * Getting for product custom options enabled or not\n */\n $storeScope = \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE;\n return $this->scopeConfig->getValue ( static::XML_PATH_PRODUCT_CUSTOM_OPTIONS, $storeScope );\n }",
"protected function getDynaPartSourceOptionName()\n {\n return 'source';\n }",
"public function getMagentoSampledataSource()\n {\n if ($this->magento && $this->magento->sampledata) {\n $value = $this->magento->sampledata;\n if ($value instanceof \\Zend_Config) {\n return ($value->source) ? $value->source : null;\n }\n return $value;\n }\n }",
"public function getOptionProvider()\n {\n }",
"public function getPriceConfig()\n {\n if ($this->getTypeId() != \\Magento\\ConfigurableProduct\\Model\\Product\\Type\\Configurable::TYPE_CODE)\n return;\n /* @var $product \\Magento\\Catalog\\Model\\Product */\n $product = $this;//->getProduct();\n /** @var \\Magento\\Framework\\Locale\\FormatInterface $localeFormat */\n $localeFormat = \\Magento\\Framework\\App\\ObjectManager::getInstance()->get(\n 'Magento\\Framework\\Locale\\FormatInterface'\n );\n /** @var \\Magento\\Framework\\Pricing\\PriceCurrencyInterface $priceCurrency */\n $priceCurrency = \\Magento\\Framework\\App\\ObjectManager::getInstance()->get(\n 'Magento\\Framework\\Pricing\\PriceCurrencyInterface'\n );\n\n /** @var \\Magento\\Framework\\Json\\EncoderInterface $jsonEncoder */\n $jsonEncoder = \\Magento\\Framework\\App\\ObjectManager::getInstance()->get(\n 'Magento\\Framework\\Json\\EncoderInterface'\n );\n if (!$this->hasOptions()) {\n $config = [\n 'productId' => $product->getId(),\n 'priceFormat' => $localeFormat->getPriceFormat()\n ];\n return $jsonEncoder->encode($config);\n }\n\n $tierPrices = [];\n $tierPricesList = $product->getPriceInfo()->getPrice('tier_price')->getTierPriceList();\n if(!empty($tierPricesList)){\n foreach ($tierPricesList as $tierPrice) {\n $value = ($tierPrice['price'])?$tierPrice['price']->getValue():0;\n $tierPrices[] = $priceCurrency->convert($value);\n }\n }\n $oldPrice = ($product->getPriceInfo()->getPrice('regular_price')->getAmount())?$product->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue():0;\n $basePrice = ($product->getPriceInfo()->getPrice('final_price')->getAmount())?$product->getPriceInfo()->getPrice('final_price')->getAmount()->getBaseAmount():0;\n $finalPrice = ($product->getPriceInfo()->getPrice('final_price')->getAmount())?$product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue():0;\n\n $config = [\n 'productId' => $product->getId(),\n 'priceFormat' => $localeFormat->getPriceFormat(),\n 'prices' => [\n 'oldPrice' => [\n 'amount' => $priceCurrency->convert(\n $oldPrice\n ),\n 'adjustments' => []\n ],\n 'basePrice' => [\n 'amount' => $priceCurrency->convert(\n $finalPrice\n ),\n 'adjustments' => []\n ],\n 'finalPrice' => [\n 'amount' => $priceCurrency->convert(\n $finalPrice\n ),\n 'adjustments' => []\n ]\n ],\n 'idSuffix' => '_clone',\n 'tierPrices' => $tierPrices\n ];\n\n return $jsonEncoder->encode($config);\n }",
"function CloudLinuxLicenses_ConfigOptions() {\n $package = new \\CloudLinuxLicenses\\classes\\models\\Package();\n return $package->getConfig();\n}",
"public function get_source_option_name()\n {\n }",
"public function getProductOptions()\r\n {\r\n $item = $this->getItem();\r\n $product = $item->getProduct();\r\n $options = array();\r\n $buyRequest = json_decode($item->getBuyRequest(),true);\r\n $optionIds = array_keys($buyRequest['options']);\r\n if ($optionIds) {\r\n $options = array();\r\n foreach ($optionIds as $optionId) {\r\n $option = $product->getOptionById($optionId);\r\n if ($option) {\r\n $itemOption = $buyRequest['options'][$optionId];\r\n if(!$itemOption) continue;\r\n if(is_array($itemOption)) $itemOption = implode(\",\", $itemOption);\r\n $group = $option->groupFactory($option->getType())\r\n ->setOption($option)\r\n ->setConfigurationItem($item)\r\n ->setConfigurationItemOption($itemOption);\r\n if ('file' == $option->getType()) {\r\n $downloadParams = $item->getFileDownloadParams();\r\n if ($downloadParams) {\r\n $url = $downloadParams->getUrl();\r\n if ($url) {\r\n $group->setCustomOptionDownloadUrl($url);\r\n }\r\n $urlParams = $downloadParams->getUrlParams();\r\n if ($urlParams) {\r\n $group->setCustomOptionUrlParams($urlParams);\r\n }\r\n }\r\n }\r\n $options[] = array(\r\n 'label' => $option->getTitle(),\r\n 'value' => $group->getFormattedOptionValue($itemOption),\r\n 'print_value' => $group->getPrintableOptionValue($itemOption),\r\n 'option_id' => $option->getId(),\r\n 'option_type' => $option->getType(),\r\n 'custom_view' => $group->isCustomizedView()\r\n );\r\n }\r\n }\r\n }\r\n \r\n $addOptions = $item->getOptionByCode('additional_options');\r\n if ($addOptions) {\r\n $options = array_merge($options, unserialize($addOptions->getValue()));\r\n }\r\n \r\n return $options;\r\n }",
"public function getJsonConfig()\n {\n /* @var $product \\Magento\\Catalog\\Model\\Product */\n $product = $this->getProduct();\n\n if (!$this->hasOptions()) {\n $config = [\n 'productId' => $product->getId(),\n 'priceFormat' => $this->_localeFormat->getPriceFormat()\n ];\n return $this->_jsonEncoder->encode($config);\n }\n\n $tierPrices = [];\n $priceInfo = $product->getPriceInfo();\n $tierPricesList = $priceInfo->getPrice('tier_price')->getTierPriceList();\n foreach ($tierPricesList as $tierPrice) {\n $tierPrices[] = $tierPrice['price']->getValue() * 1;\n }\n $config = [\n 'productId' => (int)$product->getId(),\n 'priceFormat' => $this->_localeFormat->getPriceFormat(),\n 'prices' => [\n 'oldPrice' => [\n 'amount' => $priceInfo->getPrice('regular_price')->getAmount()->getValue() * 1,\n 'adjustments' => []\n ],\n 'basePrice' => [\n 'amount' => $priceInfo->getPrice('final_price')->getAmount()->getBaseAmount() * 1,\n 'adjustments' => []\n ],\n 'finalPrice' => [\n 'amount' => $priceInfo->getPrice('final_price')->getAmount()->getValue() * 1,\n 'adjustments' => []\n ]\n ],\n 'idSuffix' => '_clone',\n 'tierPrices' => $tierPrices\n ];\n\n $responseObject = new \\Magento\\Framework\\DataObject();\n $this->_eventManager->dispatch('catalog_product_view_config', ['response_object' => $responseObject]);\n if (is_array($responseObject->getAdditionalOptions())) {\n foreach ($responseObject->getAdditionalOptions() as $option => $value) {\n $config[$option] = $value;\n }\n }\n\n return $this->_jsonEncoder->encode($config);\n }",
"private function getProductSwatchOptionsBlock(): Configurable\n {\n $this->page->addHandle([\n 'default',\n 'catalog_product_view',\n 'catalog_product_view_type_configurable',\n ]);\n $this->page->getLayout()->generateXml();\n\n return $this->page->getLayout()->getChildBlock('product.info.options.wrapper', 'swatch_options');\n }",
"public function getConfigItemOptions()\n {\n return Mage::helper('cataloginventory')->getConfigItemOptions();\n }",
"public function getShopConfig();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to get store details whose payemnt is released this month | public function getReleasePaymentInfo($storeId = NULL) {
$releasedStore = DB::table('store_payment AS SP')
->addSelect('SD.store_name')
->addSelect('SP.fk_order_id AS storeOrderId')
->addSelect('SO.order_id AS orderId')
->addSelect('users.email')
->addSelect(DB::raw('SUM(SP.amount) AS totalPrice'))
->addSelect(DB::raw("DATE_FORMAT(SP.updated_at,'%d %b,%Y') AS date"))
->addSelect(DB::raw("SP.id AS payment_id"))
->addSelect(DB::raw("DATE_FORMAT(SP.updated_at,'%r') AS time"))
->addSelect(DB::raw("MONTH(SP.updated_at) AS month"))
->leftJoin('sub_store_details AS SD', 'SD.fk_users_id', '=', 'SP.fk_store_id')
->leftJoin('sales_order AS SO', 'SO.id_sales_order', '=', 'SP.fk_order_id')
->join('users', 'users.id', '=', 'SP.fk_store_id');
if (NULL != $storeId){
$releasedStore = $releasedStore->addSelect('SP.fk_store_id AS id')
->where('SP.parent_store_id', '=', $storeId)
->groupBy('SP.fk_order_id');
}else{
$releasedStore = $releasedStore
->addSelect('SP.parent_store_id AS id')
->groupBy('SP.parent_store_id');
}
$releasedStore = $releasedStore->orderBy('SP.updated_at', 'DESC')->get();
return $releasedStore;
} | [
"function getBillingDate();",
"function fn_is_store_live()\n{\n $result = 'N';\n $timestamp = Settings::instance()->getSettingDataByName('current_timestamp');\n $install_time = (int) $timestamp['value'];\n $time = strtotime('-30 day');\n\n if ($install_time < $time && db_get_row(\"SELECT order_id FROM ?:orders WHERE timestamp >= ?i LIMIT 1\", $time)) {\n $result = 'Y';\n }\n\n return $result;\n}",
"function monthly_per_store_report($month_per_store,$year_per_store)\n {\n \n // $param['year'] = $month;\n // $param['month'] = $year;\n\n\n // $monthName = date('F', strtotime($year.\"-\".$month));\n\n $date = $this->getDateNeed($year_per_store, $month_per_store);\n\n $arr = array('monthly' => array());\n $arr['monthly'] = array(\n 'mdscsi' => array(),\n 'voice' => $this->queryForMonthStore($date['year'], $date['month'], $date['from'], $date['to'], 'voice'),\n 'web' => $this->queryForMonthStore($date['year'], $date['month'], $date['from'], $date['to'], 'web'),\n 'gcashminiprogram' => $this->queryForMonthStore($date['year'], $date['month'], $date['from'], $date['to'], 'gcashminiprogram'),\n 'mobile_app' => $this->queryForMonthStore($date['year'], $date['month'], $date['from'], $date['to'], 'mobile_app'),\n 'ctc' => $this->queryForMonthStore($date['year'], $date['month'], $date['from'], $date['to'], 'ctc'),\n 'fbchatbot' => $this->queryForMonthStore($date['year'], $date['month'], $date['from'], $date['to'], 'fbchatbot')\n );\n $arr['monthly']['mdscsi'] = $this->forMonth_getOvrAllStore($arr);\n\n \n \n $temp_arr = $arr;\n\n $temp_arr['monthly']['voice']['0'] = $this->complete_arr($arr,'voice');\n $temp_arr['monthly']['web']['0'] = $this->complete_arr($arr,'web');\n $temp_arr['monthly']['gcashminiprogram']['0'] = $this->complete_arr($arr,'gcashminiprogram');\n $temp_arr['monthly']['mobile_app']['0'] = $this->complete_arr($arr,'mobile_app');\n $temp_arr['monthly']['ctc']['0'] = $this->complete_arr($arr,'ctc');\n $temp_arr['monthly']['fbchatbot']['0'] = $this->complete_arr($arr,'fbchatbot');\n\n $this->get_csv_report_monthly_store($temp_arr,$year_per_store, $month_per_store);\n\n return $temp_arr;\n }",
"function monthly_per_store_day_report($month_per_store_day,$year_per_store_day)\n {\n \n // $param['year'] = $month;\n // $param['month'] = $year;\n\n\n // $monthName = date('F', strtotime($year.\"-\".$month));\n\n // $date = $this->getDateNeed($year_per_store, $month_per_store);\n\n\n $arr = array('monthly' => array());\n $arr['monthly'] = array(\n 'store' => $this->queryForMonthStoreMonth(),\n 'mdscsi' => array(),\n '01' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '1'),\n '02' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '2'),\n '03' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '3'),\n '04' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '4'),\n '05' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '5'),\n '06' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '6'),\n '07' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '7'),\n '08' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '8'),\n '09' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '9'),\n '10' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '10'),\n '11' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '11'),\n '12' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '12'),\n '13' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '13'),\n '14' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '14'),\n '15' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '15'),\n '16' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '16'),\n '17' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '17'),\n '18' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '18'),\n '19' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '19'),\n '20' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '20'),\n '21' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '21'),\n '22' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '22'),\n '23' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '23'),\n '24' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '24'),\n '25' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '25'),\n '26' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '26'),\n '27' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '27'),\n '28' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '28'),\n '29' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '29'),\n '30' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '30'),\n '31' => $this->queryForMonthStoreDay($year_per_store_day, $month_per_store_day, '31')\n );\n\n \n \n $temp_arr = $arr;\n\n $temp_arr['monthly']['01']['0'] = $this->complete_arr_per_day($arr,'01');\n $temp_arr['monthly']['02']['0'] = $this->complete_arr_per_day($arr,'02');\n $temp_arr['monthly']['03']['0'] = $this->complete_arr_per_day($arr,'03');\n $temp_arr['monthly']['04']['0'] = $this->complete_arr_per_day($arr,'04');\n $temp_arr['monthly']['05']['0'] = $this->complete_arr_per_day($arr,'05');\n $temp_arr['monthly']['06']['0'] = $this->complete_arr_per_day($arr,'06');\n $temp_arr['monthly']['07']['0'] = $this->complete_arr_per_day($arr,'07');\n $temp_arr['monthly']['08']['0'] = $this->complete_arr_per_day($arr,'08');\n $temp_arr['monthly']['09']['0'] = $this->complete_arr_per_day($arr,'09');\n $temp_arr['monthly']['10']['0'] = $this->complete_arr_per_day($arr,'10');\n $temp_arr['monthly']['11']['0'] = $this->complete_arr_per_day($arr,'11');\n $temp_arr['monthly']['12']['0'] = $this->complete_arr_per_day($arr,'12');\n $temp_arr['monthly']['13']['0'] = $this->complete_arr_per_day($arr,'13');\n $temp_arr['monthly']['14']['0'] = $this->complete_arr_per_day($arr,'14');\n $temp_arr['monthly']['15']['0'] = $this->complete_arr_per_day($arr,'15');\n $temp_arr['monthly']['16']['0'] = $this->complete_arr_per_day($arr,'16');\n $temp_arr['monthly']['17']['0'] = $this->complete_arr_per_day($arr,'17');\n $temp_arr['monthly']['18']['0'] = $this->complete_arr_per_day($arr,'18');\n $temp_arr['monthly']['19']['0'] = $this->complete_arr_per_day($arr,'19');\n $temp_arr['monthly']['20']['0'] = $this->complete_arr_per_day($arr,'20');\n $temp_arr['monthly']['21']['0'] = $this->complete_arr_per_day($arr,'21');\n $temp_arr['monthly']['22']['0'] = $this->complete_arr_per_day($arr,'22');\n $temp_arr['monthly']['23']['0'] = $this->complete_arr_per_day($arr,'23');\n $temp_arr['monthly']['24']['0'] = $this->complete_arr_per_day($arr,'24');\n $temp_arr['monthly']['25']['0'] = $this->complete_arr_per_day($arr,'25');\n $temp_arr['monthly']['26']['0'] = $this->complete_arr_per_day($arr,'26');\n $temp_arr['monthly']['27']['0'] = $this->complete_arr_per_day($arr,'27');\n $temp_arr['monthly']['28']['0'] = $this->complete_arr_per_day($arr,'28');\n $temp_arr['monthly']['29']['0'] = $this->complete_arr_per_day($arr,'29');\n $temp_arr['monthly']['30']['0'] = $this->complete_arr_per_day($arr,'30');\n $temp_arr['monthly']['31']['0'] = $this->complete_arr_per_day($arr,'31');\n\n $temp_arr['monthly']['mdscsi'] = $this->forMonth_perday_getOvrAllStore($temp_arr);\n\n\n $this->get_csv_report_monthly_store_perday($temp_arr,$year_per_store_day, $month_per_store_day);\n\n return $temp_arr;\n }",
"function getCcExpMonth();",
"function currentMonthProudctQuantity()\n\t{\n\t $sql = \"select sum(b.product_qty) as productquantity from products_table a inner join order_products_table b on a.product_id=b.product_id inner join orders_table c on c.orders_id=b.order_id where month(c.date_purchased)=MONTH(CURRENT_DATE) \";\n\t\t\t $obj = new Bin_Query();\n\t\tif($obj->executeQuery($sql))\n\t\t{\t\t\n\t\t\t\t$output=$obj->records[0]['productquantity'];\n\t\t\t\treturn $output;\n\t\t}\n\t}",
"public function get_store_info($id_store)\n {\n $data = array('storeId' => $id_store);\n return $this->mage_api->store_info($data);\n }",
"public function getMonthlyInstalment();",
"public function get_date(){\n\t\treturn $this->_purchaseDate;\n\t}",
"function drush_mailchimp_ecommerce_mc_ecommerce_get_stores() {\n $api_key = variable_get('mailchimp_api_key', '');\n\n if (!empty($api_key)) {\n /* @var \\Mailchimp\\MailchimpEcommerce $mc_ecommerce */\n $mc_ecommerce = mailchimp_get_api_object('MailchimpEcommerce');\n $stores = $mc_ecommerce->getStores();\n\n drush_print(\"\");\n\n foreach ($stores->stores as $store) {\n drush_print(\"ID: \" . $store->id);\n drush_print(\"Name: \" . $store->name);\n drush_print(\"List ID: \" . $store->list_id);\n drush_print(\"Platform: \" . $store->platform);\n drush_print(\"\");\n }\n }\n}",
"function searchByMonth($month){\n\t\t return $this->query(\"select * from school_feeding where year(date)='$month'\");\n\t\t }",
"public function getPaymentDetailByMonth(int $monthNumber){\n \t\t$pay = new Payment;\n \t\t$paymentCollection =DB::table('customer_payment') \n \t\t\t\t\t\t\t->join('customers', 'customer_payment.customer_id', '=', 'customers.id')\n\t\t\t\t\t\t\t->select('customer_payment.*', 'customers.name', 'customers.phone', 'customers.username')\n\t\t\t\t\t\t\t->where(['customer_payment.gym_id' => $this->GYM_ID, 'customer_payment.status' => 1, 'customer_payment.is_deleted' => 1])\n \t\t\t\t\t\t\t->whereRaw('MONTH(customer_payment.created_at) = ?', [$monthNumber])\n\t\t\t\t\t\t\t->orderByDesc('customer_payment.created_at')\n \t\t\t\t\t\t\t->get();\n \t\treturn $paymentCollection;\n\n \t}",
"function thisbankdeposite($month, $year) {\n $this->db->select_sum('amount');\n $array = array('MONTH(date)' => $month, 'YEAR(date)' => $year);\n $this->db->where($array);\n $query = $this->db->get('bank_deposit');\n return $query->row()->amount;\n }",
"public function getMonthToPayAttribute()\n {\n\n $buyer = Auth::user();\n $lastPayment = $this->payments()->orderBy('created_at', 'desc')->first();\n if($lastPayment){\n $month_to_pay = $lastPayment->month + 1;\n if($month_to_pay == 13)\n $month_to_pay = 1;\n\n return $month_to_pay;\n }\n else{\n return Carbon::parse($this->created_at)->format('m');\n }\n }",
"function cpm_get_store_status( $store_id ){\n $current_day = strtolower( date( 'l',current_time('timestamp') ) );\n $cur_time_str = date ( 'g:i A' , current_time( 'timestamp' ) );\n $cur_time = strtotime( $cur_time_str );\n $store_time = get_post_meta( $store_id, 'wpsl_hours' );\n\n if( !empty($store_time) )\n $store_day = $store_time[0][$current_day];\n if( !empty($store_day) ){\n $exploded_time = explode(',', $store_day[0]);\n $start_time = strtotime($exploded_time[0]);\n $end_time = strtotime($exploded_time[1]);\n$current_status = \"Closed\";\n\n if( ($cur_time >= $start_time) && ( $cur_time <= $end_time ) ){\n $current_status = \"Open Now\";\n }\n } else {\n$current_status = \"Closed\";\n\n }\n return $current_status;\n }",
"public function getThisMonth();",
"public function lastMonthDieselSupply() {\n $thisFirstDay = $this->thisFirstDay();\n $preFirstDay = $this->preFirstDay();\n $lastStockSupplied = $this->db->select('SELECT stock, amount, date FROM diesel WHERE date BETWEEN :preFirstDay AND :thisFirstDay ', array('preFirstDay' => $preFirstDay, 'thisFirstDay' => $thisFirstDay));\n// var_dump($lastStockSupplied);die;\n $suppliedTotalAmount = 0;\n foreach ($lastStockSupplied as $key => $value) {\n $suppliedTotalAmount = $suppliedTotalAmount + $value['amount'];\n }\n return $suppliedTotalAmount;\n// echo $suppliedTotalAmount;die;\n }",
"function getMonthPriceList($mode,$pass){\r\n\tif($mode == 'updatePriceList'){\r\n\t\t\r\n\t\t$currMonth = date('n');\r\n\t\t$currDate = date('j');\r\n\t\t\r\n\t\tif($currDate >= 1 && $currDate <=15){\r\n\t\t$arr = $currMonth;\r\n\t\t} else {\r\n\t\t$arr = $currMonth + 1;\r\n\t\t}\r\n\t\treturn $arr;\t\r\n\t}\r\n\r\n\t\r\n\t\r\n\r\n\t\r\n\r\n}",
"function monthSales(){\n\t\t$q1 = \"SELECT * FROM sbl_beer\n\t\t\t\t INNER JOIN beers_sold ON nr=beer_id\n\t\t\t\t WHERE MONTH(timestamp)=MONTH(CURRENT_DATE) AND YEAR(timestamp)=YEAR(CURRENT_DATE)\";\n\t\t\t$result= $this -> mysqli -> query($q1) or die (\"query failed!\");\n\n\t\t\tif (mysqli_num_rows($result)==0){\n\t\t\t\techo \"No sales this month\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this -> makeSaleTable($result);\n\t\t\t}\n\t\t\t$result -> close();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add Id Add card's id to session order variable | public static function addId($id) {
$session = Yii::$app->session;
if (isset($session['order']) && count($session['order']) != 0) {
$order = $session['order'];
$order[] = $id;
$session['order'] = $order;
return $session['order'];
} else {
$session['order'] = array($id);
return "New cart created";
}
} | [
"public function updateId() {\n $this->Id = session_id();\n }",
"function get_order_id()\n\t{\n\t\t// after that a card has been processed,\n\t\t// sometime it is possible retrieve the order id if assign by the gateway.\n\t\treturn $this->order['o_orderID'];\n\t}",
"public function setCartId() \n {\n \tif( $this->_cartId == '' ) \n \t{\n \t // If ID is in the session, get it from there \n \t\tif( isset( $_SESSION['cart_id'] ) ) \n \t\t{\n \t\t\t$this->_cartId = $_SESSION['cart_id'];\n \t }\n \t\t// If not, check wether the ID was saved as a cookie\n \t elseif( isset( $_COOKIE['cart_id'] ) )\n \t\t{\n \t\t\t$this->_cartId = $_COOKIE['cart_id'];\n \t\t\t$_SESSION['cart_id'] = $this->_cartId;\n \t\t\t\n \t\t\t// Regenerate cookie to be valid for 7 days (604800 seconds)\n \t\t\tsetcookie( 'cart_id', $this->_cartId, time() + 604800 );\n \t\t}\n \t\telse \n \t\t{\n \t\t\t// Generate cart id and save it to $_cartId, the session and a cookie\n \t\t\t$this->_cartId = md5( uniqid( rand(), true ) );\n \t\t\t$_SESSION['cart_id'] = \t$this->_cartId;\n \t\t\tsetcookie( 'cart_id', $this->_cartId, time() + 604800 );\n \t\t}\n }\n\t}",
"public function addProductToCart($id){\r\n if (!empty($id)){\r\n if (isset($_SESSION['products'][$id])){\r\n $_SESSION['products'][$id] += 1;\r\n }\r\n else {\r\n $_SESSION['products'][$id] = 1;\r\n }\r\n }\r\n }",
"static function MyCart()\n\t{\n\t\tif (Auth::guard('account')->id()) {\n\t\t\t$key['customer_id']=Auth::guard('account')->id();\n\t\t}else{\n\t\t\t$key['session_id']=session()->getId();\n\t\t}\n\t}",
"public function getAnonymousCartId();",
"private function _initialize_cart_id()\n\t{\n\t\t// If ID is in the session, get it from there \n\t\t$this->_cart_id = Session::get('cart_id');\n\n\t\tif(!$this->_cart_id)\n\t\t{\n\t\t\t// Generate cart_id and save it to $cart_id and the session\n\t\t\t$this->_cart_id = md5( uniqid(rand(), true) );\n\t\t\tSession::put('cart_id', $this->_cart_id);\n\t\t}\n\n\t\treturn;\n\t}",
"function set_id ($id)\r\n {\r\n $_SESSION[\"id\"] = $id;\r\n }",
"static function add($carID)\r\n\t{\r\n\t\tif (array_key_exists('ShoppingCart', $_SESSION))\r\n\t\t{\r\n\t\t\tarray_push($_SESSION['ShoppingCart'], $carID);\r\n\t\t} else {\r\n\t\t\t$_SESSION['ShoppingCart'] = array($carID);\r\n\t\t}\t\t\t \r\n\t\t\r\n\t}",
"public static function setOrderId($value)\n {\n Yii::$app->session->set(self::ORDER_ID, $value);\n }",
"public static function add_subscription_card_id( $order_id ) {\n\t\tif ( ! function_exists( 'wcs_get_subscriptions_for_order' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$order = wc_get_order( $order_id );\n\t\t$subscriptions = wcs_get_subscriptions_for_order( $order_id, array( 'order_type' => 'parent' ) );\n\t\tforeach ( $subscriptions as $subscription ) {\n\t\t\t/** @var WC_Subscription $subscription */\n\t\t\t// Add payment meta\n\t\t\t$paymentId = $order->get_meta( '_payex_payment_id' );\n\t\t\t$paymentOrderId = $order->get_meta( '_payex_paymentorder_id' );\n\n\t\t\t/** @var \\WC_Subscription $subscription */\n\t\t\tif ( ! empty( $paymentId ) ) {\n\t\t\t\t$subscription->update_meta_data( '_payex_payment_id', $paymentId );\n\t\t\t}\n\n\t\t\tif ( ! empty( $paymentOrderId ) ) {\n\t\t\t\t$subscription->update_meta_data( '_payex_paymentorder_id', $paymentOrderId );\n\t\t\t}\n\n\t\t\t// Add payment token\n\t\t\t$tokens = $order->get_payment_tokens();\n\t\t\tif ( count( $tokens ) > 0 ) {\n\t\t\t\tforeach ( $tokens as $token_id ) {\n\t\t\t\t\t$token = new WC_Payment_Token_Swedbank_Pay( $token_id );\n\t\t\t\t\tif ( self::PAYMENT_ID !== $token->get_gateway_id() ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$subscription->add_payment_token( $token );\n\t\t\t\t\t$subscription->add_order_note(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t__( 'Card: %s', 'swedbank-pay-woocommerce-checkout' ),\n\t\t\t\t\t\t\tstrip_tags( $token->get_display_name() )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$subscription->save_meta_data();\n\t\t\t$subscription->save();\n\t\t}\n\t}",
"function addFilmAtPositionInSessionCart($filmId, $position, $quantity = 1) {\n $_SESSION['film_id_in_cart_' . $position] = ((integer) $filmId);\n $_SESSION['film_quantity_in_cart_' . $position] = ((integer) $quantity);\n}",
"function addToShoppingCartSession()\n\t{\n\t\t$art_object_id = $this->input->post('id');\n\t\t$price = $this->input->post('price');\n\t\t$title = $this->input->post('title');\n\t\t$artist = $this->input->post('artist');\n\t\t\n\t\t//LOCK ITEM IN DATABASE\n\t\t$locked = $this->sales_model->update_lock_artObject($art_object_id,1);\n\t\t \n\t\t\n\t\tif($locked)\n\t\t{\n\t\t\t$data = array(\r\n\t\t\t\t\t'id' => $art_object_id,\r\n\t\t\t\t\t'qty' => 1,\r\n\t\t\t\t\t'price' => $price,\r\n\t\t\t\t\t'name' => $title,\r\n\t\t\t\t\t'artist' => $artist\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\tif($this->cart->insert($data))\r\n\t\t\t{\r\n\t\t\t\t$response = 1;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$response = 0;\r\n\t\t\t}\r\n\t\t\techo $response;\n\t\t}\n\t\t\n\t}",
"public function storeDataInSession() {\n\t\t$_SESSION['Order__id'] = $this->insertedOrderId;\n\t\t$_SESSION['transactionAmount'] = $this->totalPrice;\n\t}",
"function storeOrder($sessionID) {\n\t\n\t//$sessionID = filter_input(INPUT_GET, $sessionID, FILTER_SANITIZE_SPECIAL_CHARS);\n\t\n\tglobal $dbc;\n\t//Query highest value of order_id to increment and assign to newest order!\n\t$query = 'SELECT MAX(order_id) FROM ICS199db.tblConfirmedOrder;';\n\t$statement = $dbc->prepare($query);\n\t$statement->execute();\n\t$result = $statement->fetch();\n\t\n\tif (!isset($result)) {\n\t\t$newOrderID = 1;\n\t} else {\n\t\t$newOrderID = $result[\"MAX(order_id)\"] + 1;\n\t}\n\n\t//Get current cart and clone into tblConfirmedOrder table with new order_id\n\t$custID = getCustomerID($sessionID);\n\t\n\t$query = 'SELECT * FROM ICS199db.tblOrder\n\t\t\t\tWHERE tblCustomers_cust_id = :custID;';\n\t$statement = $dbc->prepare($query);\n\t$statement->bindValue(':custID', $custID);\n\t$statement->execute();\n\t$finalCart = $statement->fetchAll();\n\t$statement->closeCursor();\n\t\n\t$query = 'INSERT INTO ICS199db.tblConfirmedOrder (tblProducts_prod_id, tblCustomers_cust_id, prod_qty, order_date, order_id)\n\t\t\tVALUES (:productID, :custID, :qty, :date, :order_id);';\n\t$statement = $dbc->prepare($query);\n\t\n\tforeach ($finalCart as $product) {\n\t\t$statement->bindValue(':productID', $product['tblProducts_prod_id']);\t\n\t\t$statement->bindValue(':custID', $product['tblCustomers_cust_id']);\n\t\t$statement->bindValue(':qty', $product['prod_qty']);\n\t\t$statement->bindValue(':date', $product['order_date']);\n\t\t$statement->bindValue(':order_id', $newOrderID);\n\t\t$statement->execute();\n\t\t$statement->closeCursor();\n\t}\n \n //remove cart from customers current cart so they can make a new one if they want\n clearCart($sessionID);\n\treturn $newOrderID;\n}",
"public function getCardIdFromCustomerSession()\n {\n return $this->customerSession->getData(LSR::SESSION_CUSTOMER_CARDID);\n }",
"public function returnCart($id){\n $oldSave = Session()->get(\"save\")->items;\n if($oldSave){\n if(array_key_exists($id, $oldSave)){\n $savedItem = $oldSave[$id];\n }\n }\n $this->items[$id] = $savedItem;\n $this->total_Quantity += $savedItem[\"quantity\"];\n $this->total_price += $savedItem[\"price\"];\n }",
"public function add_fundraiser_id_to_order( $orderId, $postedData, $order )\n {\n update_post_meta( $orderId, 'fundraiser_id',\n \t$this->get_feature()->get_user_fundraiser() );\n\n\n }",
"public function addSingleProductToCart($id);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets ID of this update user. | public function setUserId($id)
{
$this->user_id = $id;
} | [
"public function setId($id)\n {\n $this->_data['ai.user.id'] = $id;\n }",
"function setIdUser($value) {\n $this->idUser = $value;\n }",
"public function setUserId($id)\n {\n $this->user_id = (integer) $id;\n }",
"public function setIdUser($idUser)\n {\n $this->idUser = (int)$idUser;\n }",
"function setUser($id) {\n $this->user_id = $id;\n }",
"protected function setUserId()\n {\n $user = User::getInstance();\n if ( $user->isSignedIn() ) {\n $this->record->set('user_id', $user->get('id'));\n return;\n }\n $this->error = true;\n $this->data['error']['user'] = 'User is not logged in.';\n }",
"public function set_user_id() {\r\n\t\t\tif( $this->user_id == 0 ) {\r\n\t\t\t\t$this->user_id = get_current_user_id();\r\n\t\t\t}\r\n\t\t}",
"public function setUserID($id) {\n\n if(is_numeric($id))\n $this->user_id = intval($id);\n else if(is_null($id))\n $this->user_id = NULL;\n }",
"public function setUserId() {\n $this->user_id = $user_id;\n }",
"public function set_current_user_id($id)\n {\n $this->current_user_id = $id;\n }",
"public function setIdentityUserId(IdentityUserInterface $user, $id): void\n {\n $user->setIdentityUserId($this->getServiceName(), $id);\n }",
"public function set_id( $id ) {\r\n\t\t$this->login_id = $id;\r\n\t}",
"protected function _set_user_id()\n {\n if ( ! isset($this->user_id))\n {\n $user = new User_base;\n $user->read_session();\n $this->user_id = $user->get_ID();\n }\n }",
"protected function setUserId($user_id): void {\n $this->user_id = $user_id;\n }",
"function set_user_id( $user_id = 0 ) {\n\t\tif(!$user_id)\n\t\t\t$user_id = $this->get_logged_user_id();\n\n\t\t$this->user_id = $user_id;\n\n\t\treturn $this->user_id;\n\t}",
"public function setUserId()\n {\n if (isset($this->user_id) && !empty($this->user_id)) { $_SESSION['rep_zone_user'] = $this->user_id; $this->rememberUser($this->user_id); }\n }",
"public function setId($value) { $this->id = $value; }",
"private function setCurrentUserId()\n {\n// $this->currentUserId = get_current_user_id();\n }",
"function setWPUserId($id)\n {\n $this->__wpUserId = $id ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the `group/[digit]/employees` endpoint. | public function testListGroupsEmployees() : void
{
$results = self::$client->get(array('a' => 'group/1/employees'));
$this->assertNotNull($results[0]);
$this->assertEquals('1', $results[0]['empUID']);
$this->assertEquals('tester', $results[0]['userName']);
$this->assertEquals('tester', $results[0]['lastName']);
$this->assertEquals('tester', $results[0]['firstName']);
$this->assertEquals('tester', $results[0]['middleName']);
$this->assertEquals('tester', $results[0]['phoneticFirstName']);
$this->assertEquals('tester', $results[0]['phoneticLastName']);
$this->assertEquals('', $results[0]['domain']);
$this->assertEquals('0', $results[0]['deleted']);
$this->assertEquals('0', $results[0]['lastUpdated']);
} | [
"public function testEmployeesEmployeeIDPost()\n {\n }",
"public function testFetchAllEmployees()\n {\n $this->withoutExceptionHandling();\n $this->json('GET', route('employee.index'), $this->headers)\n ->assertStatus(200)\n ->assertJsonFragment([\n 'statusCode' => 200,\n 'message' => 'success'\n ]);\n }",
"public function testListGroupEmployeesDetailed() : void\n {\n $results = self::$client->get(array('a' => 'group/1/employees/detailed'));\n $this->assertNotNull($results['users']);\n $this->assertEquals('1', $results['users'][0]['empUID']);\n $this->assertEquals('1', $results['users'][0]['groupID']);\n $this->assertNull($results['users'][0]['positionID']);\n $this->assertNull($results['users'][0]['isActing']);\n $this->assertEquals('tester', $results['users'][0]['userName']);\n $this->assertEquals('tester', $results['users'][0]['lastName']);\n $this->assertEquals('tester', $results['users'][0]['firstName']);\n $this->assertEquals('tester', $results['users'][0]['middleName']);\n $this->assertEquals('tester', $results['users'][0]['phoneticFirstName']);\n $this->assertEquals('tester', $results['users'][0]['phoneticLastName']);\n $this->assertEquals('', $results['users'][0]['domain']);\n $this->assertEquals('0', $results['users'][0]['deleted']);\n $this->assertEquals('0', $results['users'][0]['lastUpdated']);\n }",
"public function testSearchEmployeesByNameWithRestrictionCheck()\n\t{\n\t\t$headers = array(\n\t\t\t'HTTP_AUTHORIZATION' => HttpHeader::BEARER.' '.self::$token,\n\t\t);\n\n\t\t//The string to search for\n\t\t$name = 'pet';\n\n\t\t// HTTP client\n\t\t$client = static::createClient();\n\t\t$client->request(\n\t\t\tRequest::METHOD_GET,\n\t\t\t'/api/v1/employees?name='.$name,\n\t\t\tarray(),\n\t\t\tarray(),\n\t\t\t$headers\n\t\t);\n\n\t\t/** @var Response $response */\n\t\t$response = $client->getResponse();\n\n\t\t// Test if response is OK\n\t\t$this->assertSame(Response::HTTP_OK, $response->getStatusCode());\n\n\t\t// Test that response is not empty\n\t\t$this->assertNotEmpty($response->getContent());\n\n\t\t// Test if Content-Type is valid application/json\n\t\t$this->assertSame(HttpHeader::APPLICATION_JSON, $response->headers->get(HttpHeader::CONTENT_TYPE));\n\n\t\t//Deserialize response\n\t\t$employees = json_decode($response->getContent(), true);\n\n\t\t//Test that the association array is not empty\n\t\t$this->assertTrue(sizeof($employees) > 0);\n\n\t\t//Test if exactly 2 employees are returned\n\t\t$this->assertTrue(2 === count($employees['data']));\n\n\t\t//Test that each person has at minimum the below values\n\t\tforeach ($employees['data'] as $employee) {\n\t\t\t$this->assertArrayHasKey('id', $employee);\n\t\t\t$this->assertArrayHasKey('firstname', $employee);\n\t\t\t$this->assertArrayHasKey('assignments', $employee);\n\t\t\t$this->assertArrayHasKey('registers', $employee);\n\t\t\tif (43 == $employee['id']) {\n\t\t\t\t$this->assertEquals('Pet', $employee['lastname']);\n\t\t\t}\n\t\t\tif (52 == $employee['id']) {\n\t\t\t\t$this->assertEquals('Peter', $employee['firstname']);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Test query with departmentId and searchByName query parameters.\n\t\t */\n\n\t\t//The string to search for\n\t\t$name = 'ende';\n\t\t$departmentId = 56;\n\n\t\t// HTTP client\n\t\t$client = static::createClient();\n\t\t$client->request(\n\t\t\tRequest::METHOD_GET,\n\t\t\t'/api/v1/employees?departmentId='.$departmentId.'&name='.$name,\n\t\t\tarray(),\n\t\t\tarray(),\n\t\t\t$headers\n\t\t);\n\n\t\t/** @var Response $response */\n\t\t$response = $client->getResponse();\n\n\t\t// Test if response is OK\n\t\t$this->assertSame(Response::HTTP_OK, $response->getStatusCode());\n\n\t\t// Test that response is not empty\n\t\t$this->assertNotEmpty($response->getContent());\n\n\t\t// Test if Content-Type is valid application/json\n\t\t$this->assertSame(HttpHeader::APPLICATION_JSON, $response->headers->get(HttpHeader::CONTENT_TYPE));\n\n\t\t//Deserialize response\n\t\t$employees = json_decode($response->getContent(), true);\n\n\t\t//Test that the association array is not empty\n\t\t$this->assertTrue(sizeof($employees) > 0);\n\n\t\t//Test if exactly 2 employees are returned\n\t\t$this->assertTrue(2 === count($employees['data']));\n\n\t\t//Test that each person has at minimum the below values\n\t\tforeach ($employees['data'] as $employee) {\n\t\t\t$this->assertArrayHasKey('id', $employee);\n\t\t\t$this->assertArrayHasKey('firstname', $employee);\n\t\t\t$this->assertArrayHasKey('assignments', $employee);\n\t\t\t$this->assertArrayHasKey('registers', $employee);\n\t\t\tif (19 == $employee['id']) {\n\t\t\t\t$this->assertEquals('Ende', $employee['lastname']);\n\t\t\t}\n\t\t\tif (60 == $employee['id']) {\n\t\t\t\t$this->assertEquals('Evelien', $employee['firstname']);\n\t\t\t}\n\t\t}\n\t}",
"public function testIndexEmployees()\n {\n }",
"public function testInvalidEmployeesPost()\n {\n $client = self::createClient();\n $entityManager = $client->getContainer()->get('doctrine.orm.entity_manager');\n $jsons = $this->generateInvalidEmployeeJsons($entityManager);\n\n foreach ($jsons as $json){\n $client->request('POST','/api/employees', [], [], ['CONTENT_TYPE' => 'application/json'], $json);\n $response = $client->getResponse();\n self::assertNotEquals(Response::HTTP_CREATED, $response->getStatusCode());\n }\n }",
"public function testGetEnemies(): void\n {\n $response = $this->get(route('service.game.enemies.index'));\n $response->assertStatus(200)\n ->assertJsonCount(12, 'data');\n }",
"public function testGetAllEmployeesWithRestrictionCheckAndPagination()\n\t{\n\t\t// manually set phonelistRestrict on if its off;\n\t\t/** @var SystemConfigRepository $systemConfigRepo */\n\t\t$systemConfigRepo = self::$em->getRepository(SystemConfig::class);\n\t\t$currentPhonelistRestrictState = self::$originalPhonelistRestrictState;\n\t\tif (!$currentPhonelistRestrictState) {\n\t\t\t/** @var SystemConfig $dorPhonelistRestrict */\n\t\t\t$dorPhonelistRestrict = $systemConfigRepo->findOneByKey(SystemConfigKey::DOR_PHONELIST_RESTRICT);\n\t\t\t$dorPhonelistRestrict->setValue('yes');\n\t\t\tself::$em->flush();\n\t\t\tself::$em->refresh($dorPhonelistRestrict);\n\t\t\t$currentPhonelistRestrictState = $systemConfigRepo->findOneByKey(SystemConfigKey::DOR_PHONELIST_RESTRICT)->getNormalizedValue();\n\t\t}\n\n\t\t$headers = array(\n\t\t\t 'HTTP_AUTHORIZATION' => HttpHeader::BEARER.' '.self::$token,\n\t\t);\n\n\t\t// HTTP client\n\t\t$client = static::createClient();\n\t\t$client->request(\n\t\t\t Request::METHOD_GET,\n\t\t\t '/api/v1/employees',\n\t\t\t array(),\n\t\t\t array(),\n\t\t\t $headers\n\t\t);\n\n\t\t/** @var Response $response */\n\t\t$response = $client->getResponse();\n\n\t\t// Test if response is OK\n\t\t$this->assertSame(Response::HTTP_OK, $response->getStatusCode());\n\n\t\t// Test that response is not empty\n\t\t$this->assertNotEmpty($response->getContent());\n\n\t\t// Test if Content-Type is valid application/json\n\t\t$this->assertSame(HttpHeader::APPLICATION_JSON, $response->headers->get(HttpHeader::CONTENT_TYPE));\n\n\t\t//Deserialize response\n\t\t$employees = json_decode($response->getContent(), true);\n\n\t\t//Test that the association array is not empty\n\t\t$this->assertTrue(sizeof($employees) > 0);\n\n\t\t//Test if exactly x employees are returned\n\t\t$this->assertTrue(12 === count($employees['data']));\n\n\t\t//Test that each person has at minimum the below values\n\t\tforeach ($employees['data'] as $employee) {\n\t\t\t$this->assertArrayHasKey('id', $employee);\n\t\t\t$this->assertArrayHasKey('firstname', $employee);\n\t\t\t$this->assertArrayHasKey('assignments', $employee);\n\t\t\t$this->assertArrayHasKey('registers', $employee);\n\t\t}\n\n\t\t// manually set phonelistRestrict off if its on;\n\t\t$dorPhonelistRestrict = $systemConfigRepo->findOneByKey(SystemConfigKey::DOR_PHONELIST_RESTRICT);\n\t\t$dorPhonelistRestrict->setValue('no');\n\t\tself::$em->flush();\n\t\tself::$em->refresh($dorPhonelistRestrict);\n\t\t$currentPhonelistRestrictState = $systemConfigRepo->findOneByKey(SystemConfigKey::DOR_PHONELIST_RESTRICT)->getNormalizedValue();\n\n\t\t// HTTP client\n\t\t$client = static::createClient();\n\t\t$client->request(\n\t\t\tRequest::METHOD_GET,\n\t\t\t'/api/v1/employees',\n\t\t\tarray(),\n\t\t\tarray(),\n\t\t\t$headers\n\t\t);\n\n\t\t/** @var Response $response */\n\t\t$response = $client->getResponse();\n\n\t\t// Test if response is OK\n\t\t$this->assertSame(Response::HTTP_OK, $response->getStatusCode());\n\n\t\t// Test that response is not empty\n\t\t$this->assertNotEmpty($response->getContent());\n\n\t\t// Test if Content-Type is valid application/json\n\t\t$this->assertSame(HttpHeader::APPLICATION_JSON, $response->headers->get(HttpHeader::CONTENT_TYPE));\n\n\t\t//Deserialize response\n\t\t$employees = json_decode($response->getContent(), true);\n\n\t\t//Test that the association array is not empty\n\t\t$this->assertTrue(sizeof($employees) > 0);\n\n\t\t//Test if exactly x employees are returned\n\t\t$this->assertTrue(82 === count($employees['data']));\n\n\t\t//Test that each person has at minimum the below values\n\t\tforeach ($employees['data'] as $employee) {\n\t\t\t$this->assertArrayHasKey('id', $employee);\n\t\t\t$this->assertArrayHasKey('firstname', $employee);\n\t\t\t$this->assertArrayHasKey('assignments', $employee);\n\t\t\t$this->assertArrayHasKey('registers', $employee);\n\t\t}\n\n\t\t// HTTP client\n\t\t$client = static::createClient();\n\t\t$client->request(\n\t\t\tRequest::METHOD_GET,\n\t\t\t'/api/v1/employees?page=2&limit=50',\n\t\t\tarray(),\n\t\t\tarray(),\n\t\t\t$headers\n\t\t);\n\n\t\t/** @var Response $response */\n\t\t$response = $client->getResponse();\n\n\t\t// Test if response is OK\n\t\t$this->assertSame(Response::HTTP_OK, $response->getStatusCode());\n\n\t\t// Test that response is not empty\n\t\t$this->assertNotEmpty($response->getContent());\n\n\t\t// Test if Content-Type is valid application/json\n\t\t$this->assertSame(HttpHeader::APPLICATION_JSON, $response->headers->get(HttpHeader::CONTENT_TYPE));\n\n\t\t//Deserialize response\n\t\t$employees = json_decode($response->getContent(), true);\n\n\t\t//Test that the association array is not empty\n\t\t$this->assertTrue(sizeof($employees) > 0);\n\n\t\t//Test if exactly x employees are returned\n\t\t$this->assertTrue(32 === count($employees['data']));\n\n\t\t//Test that each person has at minimum the below values\n\t\tforeach ($employees['data'] as $employee) {\n\t\t\t$this->assertArrayHasKey('id', $employee);\n\t\t\t$this->assertArrayHasKey('firstname', $employee);\n\t\t\t$this->assertArrayHasKey('assignments', $employee);\n\t\t\t$this->assertArrayHasKey('registers', $employee);\n\t\t}\n\n\t\t// HTTP client\n\t\t$client = static::createClient();\n\t\t$client->request(\n\t\t\tRequest::METHOD_GET,\n\t\t\t'/api/v1/employees?limit=25',\n\t\t\tarray(),\n\t\t\tarray(),\n\t\t\t$headers\n\t\t);\n\n\t\t/** @var Response $response */\n\t\t$response = $client->getResponse();\n\n\t\t// Test if response is OK\n\t\t$this->assertSame(Response::HTTP_OK, $response->getStatusCode());\n\n\t\t// Test that response is not empty\n\t\t$this->assertNotEmpty($response->getContent());\n\n\t\t// Test if Content-Type is valid application/json\n\t\t$this->assertSame(HttpHeader::APPLICATION_JSON, $response->headers->get(HttpHeader::CONTENT_TYPE));\n\n\t\t//Deserialize response\n\t\t$employees = json_decode($response->getContent(), true);\n\n\t\t//Test that the association array is not empty\n\t\t$this->assertTrue(sizeof($employees) > 0);\n\n\t\t//Test if exactly x employees are returned\n\t\t$this->assertTrue(25 === count($employees['data']));\n\n\t\t//Test that each person has at minimum the below values\n\t\tforeach ($employees['data'] as $employee) {\n\t\t\t$this->assertArrayHasKey('id', $employee);\n\t\t\t$this->assertArrayHasKey('firstname', $employee);\n\t\t\t$this->assertArrayHasKey('assignments', $employee);\n\t\t\t$this->assertArrayHasKey('registers', $employee);\n\t\t}\n\n\t\t// return phonelist restrict to original state\n\t\tif ($currentPhonelistRestrictState !== self::$originalPhonelistRestrictState) {\n\t\t\t$dorPhonelistRestrict = $systemConfigRepo->findOneByKey(SystemConfigKey::DOR_PHONELIST_RESTRICT);\n\t\t\t$dorPhonelistRestrict->setValue('yes');\n\t\t\tself::$em->flush();\n\t\t\tself::$em->refresh($dorPhonelistRestrict);\n\t\t}\n\t}",
"public function employeeShowViaId()\n {\n $company = factory('App\\Company')->create();\n $employee = factory('App\\Employee')->create();\n\n $response = $this->call(\n 'GET',\n '/employee/' . $employee->id\n );\n\n $response->assertOk();\n $response->assertSee($employee->first_name);\n }",
"public function getEmployees()\n\t{ \n\t\treturn $this->setRequest(\n\t\t\tarray(\n\t\t\t\t'module' => 'staff.employees',\n\t\t\t\t'method' => 'GET'\n\t\t\t)\n\t\t);\n\t}",
"public function testGetEmployeesByDepartmentWithRestrictionCheck()\n\t{\n\t\t// manually set phonelistRestrict on if its off;\n\t\t/** @var SystemConfigRepository $systemConfigRepo */\n\t\t$systemConfigRepo = self::$em->getRepository(SystemConfig::class);\n\t\t$currentPhonelistRestrictState = self::$originalPhonelistRestrictState;\n\t\tif (!$currentPhonelistRestrictState) {\n\t\t\t/** @var SystemConfig $dorPhonelistRestrict */\n\t\t\t$dorPhonelistRestrict = $systemConfigRepo->findOneByKey(SystemConfigKey::DOR_PHONELIST_RESTRICT);\n\t\t\t$dorPhonelistRestrict->setValue('yes');\n\t\t\tself::$em->flush();\n\t\t\tself::$em->refresh($dorPhonelistRestrict);\n\t\t\t$currentPhonelistRestrictState = $systemConfigRepo->findOneByKey(SystemConfigKey::DOR_PHONELIST_RESTRICT)->getNormalizedValue();\n\t\t}\n\n\t\t//The department to get employees from\n\t\t$departmentId = 56;\n\n\t\t$headers = array(\n\t\t\t 'HTTP_AUTHORIZATION' => HttpHeader::BEARER.' '.self::$token,\n\t\t);\n\n\t\t// HTTP client\n\t\t$client = static::createClient();\n\t\t$client->request(\n\t\t\t Request::METHOD_GET,\n\t\t\t '/api/v1/employees?departmentId='.$departmentId,\n\t\t\t array(),\n\t\t\t array(),\n\t\t\t $headers\n\t\t);\n\n\t\t/** @var Response $response */\n\t\t$response = $client->getResponse();\n\n\t\t// Test if response is OK\n\t\t$this->assertSame(Response::HTTP_OK, $response->getStatusCode());\n\n\t\t// Test that response is not empty\n\t\t$this->assertNotEmpty($response->getContent());\n\n\t\t// Test if Content-Type is valid application/json\n\t\t$this->assertSame(HttpHeader::APPLICATION_JSON, $response->headers->get(HttpHeader::CONTENT_TYPE));\n\n\t\t//Deserialize response\n\t\t$employees = json_decode($response->getContent(), true);\n\n\t\t//Test that the association array is not empty\n\t\t$this->assertTrue(sizeof($employees) > 0);\n\n\t\t//Test if exactly x employees are returned\n\t\t$this->assertTrue(11 === count($employees['data']));\n\n\t\t//Test that each person has at minimum the below values\n\t\tforeach ($employees['data'] as $employee) {\n\t\t\t$this->assertArrayHasKey('id', $employee);\n\t\t\t$this->assertArrayHasKey('firstname', $employee);\n\t\t\t$this->assertArrayHasKey('assignments', $employee);\n\t\t\t$this->assertArrayHasKey('registers', $employee);\n\t\t}\n\n\t\t// manually set phonelistRestrict off if its on;\n\t\t$dorPhonelistRestrict = $systemConfigRepo->findOneByKey(SystemConfigKey::DOR_PHONELIST_RESTRICT);\n\t\t$dorPhonelistRestrict->setValue('no');\n\t\tself::$em->flush();\n\t\tself::$em->refresh($dorPhonelistRestrict);\n\t\t$currentPhonelistRestrictState = $systemConfigRepo->findOneByKey(SystemConfigKey::DOR_PHONELIST_RESTRICT)->getNormalizedValue();\n\n\t\t// HTTP client\n\t\t$client = static::createClient();\n\t\t$client->request(\n\t\t\tRequest::METHOD_GET,\n\t\t\t'/api/v1/employees?departmentId='.$departmentId,\n\t\t\tarray(),\n\t\t\tarray(),\n\t\t\t$headers\n\t\t);\n\n\t\t/** @var Response $response */\n\t\t$response = $client->getResponse();\n\n\t\t// Test if response is OK\n\t\t$this->assertSame(Response::HTTP_OK, $response->getStatusCode());\n\n\t\t// Test that response is not empty\n\t\t$this->assertNotEmpty($response->getContent());\n\n\t\t// Test if Content-Type is valid application/json\n\t\t$this->assertSame(HttpHeader::APPLICATION_JSON, $response->headers->get(HttpHeader::CONTENT_TYPE));\n\n\t\t//Deserialize response\n\t\t$employees = json_decode($response->getContent(), true);\n\n\t\t//Test that the association array is not empty\n\t\t$this->assertTrue(sizeof($employees) > 0);\n\n\t\t//Test if exactly x employees are returned\n\t\t$this->assertTrue(13 === count($employees['data']));\n\n\t\t//Test that each person has at minimum the below values\n\t\tforeach ($employees['data'] as $employee) {\n\t\t\t$this->assertArrayHasKey('id', $employee);\n\t\t\t$this->assertArrayHasKey('firstname', $employee);\n\t\t\t$this->assertArrayHasKey('assignments', $employee);\n\t\t\t$this->assertArrayHasKey('registers', $employee);\n\t\t}\n\n\t\t// return phonelist restrict to original state\n\t\tif ($currentPhonelistRestrictState !== self::$originalPhonelistRestrictState) {\n\t\t\t$dorPhonelistRestrict = $systemConfigRepo->findOneByKey(SystemConfigKey::DOR_PHONELIST_RESTRICT);\n\t\t\t$dorPhonelistRestrict->setValue('yes');\n\t\t\tself::$em->flush();\n\t\t\tself::$em->refresh($dorPhonelistRestrict);\n\t\t}\n\t}",
"public function test_get_evaluations_from_company()\n {\n\n $company = Str::uuid();\n\n Evaluation::factory()->count(6)->create([\n 'company' => $company,\n ]);\n\n $response = $this->getJson(\"/evaluations/{$company}\");\n\n // $response->dump();\n\n $response->assertStatus(200)\n ->assertJsonCount(6, 'data');\n }",
"public function test_show_all()\n {\n $response = $this->get('/office/all');\n\n $response->assertStatus(200);\n }",
"public function testEmployeeIndexActionResponse()\n {\n $authclient = $this->createAuthenticatedClient('johndoe', 'password123');\n\n $authclient->request('GET', '/api/shifts');\n\n $response = $authclient->getResponse();\n\n $this->assertResponse($response, 'employee_shift', 200);\n }",
"public function testAddEmployee()\n {\n //422\n $response = $this->post(\"employees/add\", []);\n $response->assertResponseStatus(422);\n $response->seeJsonStructure([\n \"last_name\",\n \"first_name\",\n \"middle_name\",\n \"nick_name\",\n \"department\",\n \"position\",\n \"birth_date\",\n \"hired_date\",\n \"email_address\",\n \"status\"\n ]);\n\n //Create employee factory\n $employee = factory(\\App\\Models\\Employee::class)->make();\n\n //200\n $response = $this->post(\"employees/add\", [\n \"last_name\" => $employee->last_name,\n \"first_name\" => $employee->first_name,\n \"middle_name\" => $employee->middle_name,\n \"nick_name\" => $employee->nick_name,\n \"department\" => $employee->department,\n \"position\" => $employee->position,\n \"birth_date\" => $employee->birth_date,\n \"hired_date\" => $employee->hired_date,\n \"email_address\" => $employee->email_address,\n \"status\" => $employee->status\n ]);\n $response->assertResponseStatus(200);\n $response->seeJsonStructure([\n 'message',\n 'model'\n ]);\n }",
"public function actionGetEmployees() {\r\n $objects = [];\r\n $itemPerPage = \\Yii::$app->request->get('limit');\r\n $currentPage = \\Yii::$app->request->get('page');\r\n $searchName = \\Yii::$app->request->get('searchName');\r\n $statusName = Yii::$app->request->get('statusName', []);\r\n $employees = Employee::getEmployeesByStatusName($statusName, $searchName, $itemPerPage, $currentPage);\r\n\r\n if ($employees['employee']) {\r\n foreach ($employees['employee'] as $employee) {\r\n $objects['employees'][] = [\r\n 'id' => $employee->id,\r\n 'fullname' => $employee->fullname,\r\n 'email' => $employee->email,\r\n 'image' => $employee->image,\r\n 'is_admin' => $employee->is_admin,\r\n 'department' => !empty($employee->department->name) ? $employee->department->name : '',\r\n 'status' => $employee->status->name,\r\n ];\r\n }\r\n }\r\n\r\n $objects['totalItems'] = (int) $employees['totalCount'];\r\n return $this->sendResponse(false, \"\", $objects);\r\n }",
"public function test_people_api()\n {\n $response = $this->get('/api/people');\n\n $response->assertStatus(200);\n }",
"public function testScheduleAPICallsSingleEmployee() {\n $scheduler = new SchedulerController();\n\n // get a test employee\n $emp = Employee::all()->first();\n\n // clear the schedule\n $scheduler->deleteSchedule('2018-05-08');\n\n // successful first schedule\n $response = $this->get(sprintf('/api/schedule_employee/2018-05-08/1/%s',$emp->id));\n $response->assertJson([ 'status' => \"ok\"]);\n $response->assertStatus(200);\n\n //failure on retry shift already taken\n $response = $this->get(sprintf('/api/schedule_employee/2018-05-08/1/%s',$emp->id));\n $response->assertJson([ 'status' => \"error\"]);\n $response->assertSeeText('Shift already taken');\n $response->assertStatus(200);\n\n //failure on retry, already scheduled for that day, different shift\n $response = $this->get(sprintf('/api/schedule_employee/2018-05-08/2/%s',$emp->id));\n $response->assertJson([ 'status' => \"error\"]);\n $response->assertSeeText('already scheduled');\n $response->assertStatus(200);\n\n //failure on booking for previous day\n $response = $this->get(sprintf('/api/schedule_employee/2018-05-07/1/%s',$emp->id));\n $response->assertJson([ 'status' => \"error\"]);\n $response->assertSeeText('consecutive');\n $response->assertStatus(200);\n\n //failure on booking for next day\n $response = $this->get(sprintf('/api/schedule_employee/2018-05-09/1/%s',$emp->id));\n $response->assertJson([ 'status' => \"error\"]);\n $response->assertSeeText('consecutive');\n $response->assertStatus(200);\n\n //success on booking second shift\n $response = $this->get(sprintf('/api/schedule_employee/2018-05-10/2/%s',$emp->id));\n $response->assertJson([ 'status' => \"ok\"]);\n $response->assertStatus(200);\n\n //failure for overbooking (max shift allowed reached\n $response = $this->get(sprintf('/api/schedule_employee/2018-05-14/2/%s',$emp->id));\n $response->assertJson([ 'status' => \"error\"]);\n $response->assertSeeText('Max bookings reached');\n $response->assertStatus(200);\n\n //successfully remove\n $response = $this->get(sprintf('/api/un_schedule_employee/2018-05-10/2/%s',$emp->id));\n $response->assertJson([ 'status' => \"ok\"]);\n $response->assertStatus(200);\n\n //failure\n $response = $this->get(sprintf('/api/un_schedule_employee/2018-05-10/2/%s',$emp->id));\n $response->assertJson([ 'status' => \"error\"]);\n $response->assertSeeText('schedule not found');\n $response->assertStatus(200);\n }",
"public function testCreateAndDeleteEmployee() : void\n {\n //create new employee\n $newEmployee = array('firstName' => 'new',\n 'lastName' => 'guy',\n 'middleName' => '',\n 'userName' => 'newguy123', );\n\n self::$client->post(array('a' => 'employee/new'), $newEmployee);\n\n //initial value\n $fromclient = self::$client->get(array('a' => 'employee/2'));\n $employee = !empty($fromclient) ? $fromclient : $newEmployee;\n $this->assertNotNull($employee);\n $this->assertNotEmpty($employee);\n\n\n //disable employee\n self::$client->delete(array('a' => 'employee/2'));\n\n //new value, when deleted, value is the time of deletion\n //$employee = self::$client->get(array('a' => 'employee/2'));\n $fromclient = self::$client->get(array('a' => 'employee/2'));\n $employee = !empty($fromclient) ? $fromclient : $newEmployee;\n $this->assertNotNull($employee);\n $this->assertNotEmpty($employee);\n\n\n //reactivates employee\n self::$client->post(array('a' => 'employee/2/activate'), array());\n\n //checks to see if change was successful\n $fromclient = self::$client->get(array('a' => 'employee/2'));\n $employee = !empty($fromclient) ? $fromclient : $newEmployee;\n $this->assertNotNull($employee);\n $this->assertNotEmpty($employee);\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the order cancel or failure by online then delete the wallet amount and history | function after_order_update_wallet_remove($orderid = null, $customerid = null) {
$cithis = & get_instance();
$cithis->load->database();
$cithis->load->model('common');
if ((!empty($orderid)) && (!empty($customerid))) {
// Wallet functionality
$wallet_amount = $cithis->common->getRow('orders', 'wallet_amount', array('order_id' => $orderid, 'customer_id' => $customerid));
if ($wallet_amount->wallet_amount > 0) {
$walletaMount = $wallet_amount->wallet_amount;
$wallet = $cithis->common->getRow('wallet', 'id,amount', array('customer_id' => $customerid));
if (!empty($wallet)) {
$new_amount = $wallet->amount + $wallet_amount->wallet_amount;
$yes = $cithis->common->update('wallet', array('amount' => $new_amount), array('customer_id' => $customerid));
if ($yes) {
$cithis->common->delbyrefrence('wallet_history', $orderid, 'order_id');
return $new_amount;
}
return $new_amount;
}
} else {
return FALSE;
}
} else {
return FALSE;
}
} | [
"function cleanUpPendingOrders() ;",
"public function clearorderhistory()\n {\n\n\n //#first : get all the order id related to the customer\n $orders=Order::where('customer_id',$this->isAuthenticated(\"id\"))->get();\n\n //#second : store cancel order ids\n $order_id_for_cancel=array();\n foreach($orders as $order)\n {\n if($order->order_status_id==6||$order->order_status_id==8)//6 means deliverd and 8 means buyer cancel\n array_push($order_id_for_cancel,$order->id);\n }\n\n //update order deleted_at column(dont forget to add soft delete in order model otherwise it will delete data permanently)\n Order::whereIn('id', $order_id_for_cancel)->delete();\n\n session()->flash('success', 'Cleared cancel history successfully');\n return redirect()->back();\n }",
"public function cancelOrder(){\n\t}",
"public function cancelTransferOrder() {\r\n $data = $this->apicaller->domain()->cancelTransferOrder(array(\r\n 'order-id' => '54761757',\r\n ));\r\n print_r($data);\r\n }",
"public function paymentCancel(){\n\t\t//1.\tdelete orders (temp)\n\t\t$orderId = CheckoutExt::getSession('orderId');\n\t\tOrdersExt::deleteOrders($orderId);\n\t\t\n\t\t//2.\tupdate checkout_done\n\t\tCheckoutExt::setSession('checkout_done', 0);\n\t}",
"public function timeframeCancelOrder() {\n Mage::getModel('clxfunding/CronOrderStatusUpdate')->cancelOrderAfterTimeExpire(); // loan offer mail link expire\n Mage::getModel('clxfunding/CronOrderStatusUpdate')->aPILoanApplcationStatus(); // update loan application status & notify user & merchant accordingly\n }",
"function tep_change_to_service_call($order_id, $charge_amount = '20')\n{\n global $database;\n\n $order = new orders('fetch', $order_id);\n $user_id = $order->user_id;\n\n $data = $order->return_result();\n $data['order_type_id'] = ORDER_TYPE_SERVICE;\n $data['order_status_id'] = ORDER_STATUS_COMPLETED;\n $data['sc_reason'] = '7';\n\n $order = new orders('update', $order_id, $data, $user_id);\n\n $removal_query = $database->query(\"select order_id from \" . TABLE_ORDERS . \" where address_id = '\" . $order->fetch_data_item('address_id') . \"' and order_type_id = '3' limit 1\");\n $removal_result = $database->fetch_array($removal_query);\n\n $database->query(\"delete from \" . TABLE_ORDERS . \" where order_id = '\" . $removal_result['order_id'] . \"' limit 1\");\n $database->query(\"delete from \" . TABLE_ORDERS_DESCRIPTION . \" where order_id = '\" . $removal_result['order_id'] . \"' limit 1\");\n $database->query(\"delete from \" . TABLE_ORDERS_HISTORY . \" where order_id = '\" . $removal_result['order_id'] . \"' limit 1\");\n $database->query(\"delete from \" . TABLE_ORDERS_TO_INSTALLER_SHOW_ORDER . \" where order_id = '\" . $removal_result['order_id'] . \"' limit 1\");\n $database->query(\"delete from \" . TABLE_INSTALLERS_TO_ORDERS . \" where order_id = '\" . $removal_result['order_id'] . \"' limit 1\");\n\n tep_release_equipment($removal_result['order_id'], true);\n tep_release_equipment($order_id, false);\n tep_create_order_history($order_id, '3', 'This order was converted to a Service Call.', true);\n}",
"public function deletePayPalOrder()\n {\n }",
"function abort() {\n\t\t$q = sprintf(\"UPDATE gc_service_order SET `status` = 'abort' WHERE id = %d;\",\n\t\t\t$this->id);\n\t\t$r = GCConfig::$db->query($q);\n\t\t$this->data['status'] = 'abort';\n\t}",
"function order_validate($odr_customer_id)\n{\n\t$sql_order = \"Select * FROM pbmart_order WHERE order_customer_id='$odr_customer_id' AND ePaymentStatus='1'\";\n\t$rs_order = @mysql_query($sql_order);\n\twhile($rw_order = @mysql_fetch_array($rs_order))\n\t{\n\t\t$order_nums = $rw_order['order_number'];\n\t\t$query2 =\"DELETE FROM pbmart_order WHERE order_number='$order_nums' AND order_customer_id='$odr_customer_id' AND ePaymentStatus='1'\";\n\t\t$result_delete = @mysql_query($query2);\n\n\t\tif(!$result_delete)\n\t\t{\n\t\t\techo (\"Failed to delete table. DEBUG: .$query2\");\n\t\t}\n\t\t\n\t\t$query3 = \"DELETE FROM pbmart_order_list WHERE order_number='$order_nums'\";\n\t\t$result_delete2 = @mysql_query($query3);\n\t\t\n\t\tif(!$result_delete2)\n\t\t{\n\t\t\techo (\"Failed to delete table. DEBUG: .$query3\");\n\t\t}\n\t}\n}",
"public function cancel_order_put()\n {\n /*check session & jwt*/\n $account_id = $this->session->userdata('ACCOUNT_ID');\n if (empty($account_id)) {\n $this->response(RestForbidden(NOT_LOGIN_MSG), FORBIDDEN_CODE);\n }\n $jwt = $this->input->request_headers()['Authorization'];\n if (!$this->checkVerifyJWT($jwt, $account_id)) {\n $this->response(RestForbidden(INVALID_TOKEN_MSG), FORBIDDEN_CODE);\n }\n /*end check session & jwt*/\n\n $last = $this->uri->total_segments();\n $order_id = $this->uri->segment($last);\n\n $check_verify_params = checkVerifyParams(array(\n $order_id,\n ));\n if (!empty($check_verify_params)) {\n $this->response(RestBadRequest(MISMATCH_PARAMS_MSG), BAD_REQUEST_CODE);\n }\n\n $this->order_model->update_by_condition(array(\n '_id' => $order_id,\n 'is_delete' => false,\n ), array(\n 'status' => ORDER_STATUS_CANCEL\n ));\n\n $select = array(\n 'order._id',\n 'order.status',\n );\n $where = array(\n '_id' => $order_id\n );\n $order = $this->order_model->findOne($where, $select);\n\n $res = !empty($order) ? removeNullOfObject($order) : '';\n $this->response(RestSuccess($res), SUCCESS_CODE);\n\n }",
"public function cancelAction() {\n $lastRealOrderId = $this->_lastRealOrderId;\n if ($lastRealOrderId) {\n $order = Mage::getModel('sales/order')->loadByIncrementId($lastRealOrderId);\n if($order->getId()) {\n // Flag the order as 'cancelled' and save it\n $order->cancel()->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true, 'Gateway has declined the payment.')->save();\n }\n }\n\t}",
"function cancel_order_after_accept(){\n\t\tAImporter::table('orders');\n\t\t$app = JFactory::getApplication();\n\t\t$order_id = $app->input->getInt('order_id');\t\t\n\t\t$timeout = $app->input->getInt('timeout');\n\t\t$table = $this->getOrder($order_id);\n\t\tif(!(!$table->id || $table->is_cancelled || $table->is_paid)){\t\t\t\n\t\t\tif($timeout > 25){\n\t\t\t\tsleep(25);\n\t\t\t\t$timeout -= 25;\n\t\t\t\tBookProHelper::pingUrl(JUri::root().'index.php?option=com_bookpro&task=callback.cancel_order_after_accept&order_id='.$order_id.'&timeout='.$timeout);\t\t\t\n\t\t\t}else{\t\t\t\n\t\t\t\tsleep($timeout);\n\t\t\t\tAImporter::helper('android');\n\t\t\t\t$table = $this->getOrder($order_id);\n\t\t\t\t//echo '<pre>';\n\t\t\t\t//var_dump($table);die;\n\t\t\t\tif(!$table->id || $table->is_cancelled || $table->is_paid){\t\t\t\n\t\t\t\t\t$app->close();\t\n\t\t\t\t}\n\t\t\t\t$params = json_decode($table->params);\n\t\t\t\tif($params->is_paying){\n\t\t\t\t\t//order is paying, wait 10s\n\t\t\t\t\tBookProHelper::pingUrl(JUri::root().'index.php?option=com_bookpro&task=callback.cancel_order_after_accept&order_id='.$order_id.'&timeout=10');\t\t\t\n\t\t\t\t\t$app->close();\t\n\t\t\t\t}\n\t\t\t\t$table->is_cancelled = 1;\n\t\t\t\t//set free for driver\n\t\t\t\t$check = $table->store();\t\n\t\t\t\tAImporter::classes('session');\n\t\t\t\t$session = new BookproSession();\n\t\t\t\t$session->userid = $table->driver_id;\n\t\t\t\t$session->loadSessionByUserId();\n\t\t\t\t//check if it is driver\n\t\t\t\tif($session->data->vehicle){\n\t\t\t\t\t$session->free = 1;\n\t\t\t\t\t$session->saveSession();\n\t\t\t\t\tAndroidHelper::write_log('order.txt', 'Order '.$order_id.' cancelled after accepted set driver '.$session->userid.' free = 1');\n\t\t\t\t}else{\n\t\t\t\t\tAndroidHelper::write_log('order.txt', 'Order '.$order_id.' cancelled after accepted. driver '.$session->userid);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t$table = null;\n\t\tunset($table);\n\t\t$app->close();\t\n\t\t\n\t}",
"public static function checkOrders() {\n\t\t$db = \\DB::i();\n\t\t$list = $db['Money_Bitcoin_Order']->search(array('Status' => 'pending'));\n\t\t$clients = array();\n\n\t\tforeach($list as $bean) {\n\t\t\tif (!isset($clients[$bean->Money_Bitcoin_Host__])) $clients[$bean->Money_Bitcoin_Host__] = \\Controller::Driver('Bitcoin', $bean->Money_Bitcoin_Host__);\n\t\t\t$client = $clients[$bean->Money_Bitcoin_Host__];\n\t\t\t$total = (int)round($client->getReceivedByAddress($bean->Address, 3) * 100000000); // 3 confirmations\n\n\t\t\tif ($bean->Coins == $total) { // nothing moved\n\t\t\t\tif ($db->dateRead($bean->Expires) < time()) {\n\t\t\t\t\t$bean->Status = 'expired';\n\t\t\t\t\t$bean->commit();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$bean->Coins = $total;\n\t\t\t$total += $bean->Coins_Extra;\n\t\t\tif ($bean->Total <= $total) {\n\t\t\t\t// payment complete!\n\t\t\t\t$bean->Status = 'ok';\n\t\t\t\t$bean->commit();\n\n\t\t\t\t// mark order paid\n\t\t\t\t$order = \\Order::byId($bean->Order__);\n\t\t\t\tif ($order->isPaid()) continue; // ?!\n\t\t\t\t$info = array(\n\t\t\t\t\t'method' => 'BITCOIN',\n\t\t\t\t\t'class' => 'Bitcoin',\n\t\t\t\t\t'stamp' => time(),\n\t\t\t\t);\n\t\t\t\t$order->paid($info);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$total_nc = (int)round($client->getReceivedByAddress($bean->Address, 0) * 100000000);\n\t\t\t$bean->Coins_NC = $total_nc;\n\t\t\t$bean->commit();\n\t\t}\n\t}",
"private function removeOrder(): void\n {\n $orderId = (int)$_GET['id'];\n\n if (isset($_GET['confirm']) && sanitize_text_field($_GET['confirm']) === 'true') {\n $order = wc_get_order($orderId);\n\n $service = new DiscardOrder($order);\n $service->run();\n $service->saveLog();\n\n add_settings_error(\n 'moloni',\n 'moloni-order-remove-success',\n sprintf(__('A encomenda foi descartada (%s)'), $orderId),\n 'updated'\n );\n } else {\n add_settings_error(\n 'moloni',\n 'moloni-order-remove',\n __('Confirma que pretende marcar a encomenda ' . $orderId . \" como paga? <a href='\" . admin_url('admin.php?page=moloni&action=remInvoice&confirm=true&id=' . $orderId) . \"'>Sim confirmo!</a>\")\n );\n }\n }",
"public function cancel($order);",
"function delete_transaction($payment_id){\n \tif(ENABLE_FINANCE_MODULE == 1){\n\t \t$user_id = $this->session->userdata(SESSION_CONST_PRE.'userId');\n\t \t$date = date('Y-m-d H:m');\n\t \t$this->db->where('payment_id', $payment_id);\n\t \t$this->db->update('student_payments', array('mark_delete'=>\"9\", 'updated_by'=>$user_id ,'updated_at'=>$date));\n \t}\n \t\n\t if(ENABLE_FINANCE_MODULE == 1){\t\n\t \t$result = $this->get_voucher_detail($payment_id);\n\t \tforeach ($result as $row){\n\t \t\t$acc_type = substr($row->account_id, 0, 1);\n\t \t\t$bal = $this->get_account_balance($row->account_id, $acc_type);\n\t \t\t \n\t \t\t$sub_id = substr($row->account_id, 0, 4);\n\t \t\t$id = substr($row->account_id, 4, 5);\n\t \t\t\n\t \t\t$str = \"\"; $amount = 0;\n\t \t\tif(isset($row->credit_amount) && $row->credit_amount>0) {\n\t \t\t\t$amount = $row->credit_amount;\n\t \t\t\t$str = \"credit_balance=credit_balance-\".$row->credit_amount;\n\t \t\t\t$running_balance = 'credit_amount=credit_amount-'.$row->credit_amount.', running_balance=running_balance-'.$row->credit_amount.', ';\n\t \t\t}\n\t \t\telseif(isset($row->debit_amount) && $row->debit_amount>0) {\n\t \t\t\t$amount = $row->debit_amount;\n\t \t\t\t$str = \"debit_balance=debit_balance-\".$row->debit_amount;\n\t \t\t\t$running_balance = 'debit_amount=debit_amount-'.$row->debit_amount.', running_balance=running_balance-'.$row->debit_amount.', ';\n\t \t\t}\n\t \t\n\t \t \tif($str != ''){\n\t\t \t\t$query = \"update accounts set \".$str. \" WHERE account_id=\".$id.\" AND sub_account_id=\".$sub_id;\n\t\t \t\t//echo $query.'<br/>';\n\t\t \t\t$this->db->query($query);\n\t\t \t\t \n\t\t \t\t$this->db->query(\"update accounts set \".$str. \" WHERE posting=0 AND account_id IS NULL AND sub_account_id IS NULL AND parent_account_id=\".substr($sub_id, 0, 2));\n\t\t \t\t$this->db->query(\"update accounts set \".$str. \" WHERE posting=0 AND account_id IS NULL AND sub_account_id=\".$sub_id);\n\t\t \t}\n\t\t \t \n\t\t \t$this->db->query( \"update voucher_details set \".$running_balance.\" posting='Y', narration=CONCAT(narration, '<br/>Hold Entry Deleted & amount was ', $amount) WHERE voucher_detail_id=\".$row->voucher_detail_id );\n\t \t}\n \t}\n }",
"public function refundOrder($observer)\n {\n $order = $observer->getOrder();\n $storeCode = $this->_storeFactory->create()->load($order->getStoreId())->getCode();\n $now = date(\"Y-m-d H:i:s\", (new \\DateTime())->getTimestamp());\n $transactions = $this->_historyFactory->create()->getCollection()\n ->addFieldToFilter('transaction_detail', ['like' => '%'.$order->getIncrementId().'%'])\n ->addFieldToFilter('status', ['eq' => Status::COMPLETE]);\n\n if (sizeof($transactions) > 0) {\n foreach ($transactions as $transaction) {\n $customer = $transaction->getCustomer();\n $subtractRewardPoints = $this->_dataHelper->getSubtractPointWhenRefundConfigStore($storeCode);\n $restoreSpentPoints = $this->_dataHelper->getRestoreSpentPointsWhenRefundConfigStore($storeCode);\n\n switch ($transaction->getTypeOfTransaction()) {\n // Points for product\n case Type::PURCHASE_PRODUCT:\n if ($transaction->getStatus() == Status::COMPLETE) {\n $customer->addRewardPoint(-$transaction->getAmount());\n\n $historyData = [\n 'type_of_transaction' => Type::REFUND_ORDER_SUBTRACT_PRODUCT_POINTS,\n 'amount' => (int)$transaction->getAmount(),\n 'balance' => $customer->getMwRewardPoint(),\n 'transaction_detail' => $transaction->getTransactionDetail(),\n 'transaction_time' => $now,\n 'status' => Status::COMPLETE,\n 'status_check' => Status::REFUNDED\n ];\n\n $customer->saveTransactionHistory($historyData);\n\n // Send mail when points changed\n $this->_dataHelper->sendEmailCustomerPointChanged(\n $customer->getId(),\n $historyData,\n $storeCode\n );\n }\n break;\n\n // Use points to check out\n case Type::USE_TO_CHECKOUT:\n if ($transaction->getTransactionDetail() != $order->getIncrementId()) {\n break;\n }\n\n $refundedTransactions = $this->_historyFactory->create()->getCollection()\n ->addFieldToFilter('type_of_transaction', Type::REFUND_ORDER_ADD_POINTS)\n ->addFieldToFilter('transaction_detail', $order->getIncrementId());\n\n if (sizeof($refundedTransactions) > 0) {\n break;\n }\n\n if ($restoreSpentPoints) {\n $customer->addRewardPoint($transaction->getAmount());\n $expiredDay = $transaction->getExpiredDay();\n $results = $this->_dataHelper->getTransactionByExpiredDayAndPoints(\n (int)$transaction->getAmount(),\n $expiredDay\n );\n $expiredTime = $results[0];\n $remainingPoints = $results[1];\n $historyData = [\n 'type_of_transaction' => Type::REFUND_ORDER_ADD_POINTS,\n 'amount' => (int) $transaction->getAmount(),\n 'balance' => $customer->getMwRewardPoint(),\n 'transaction_detail' => $order->getIncrementId(),\n 'transaction_time' => $now,\n 'expired_day' => $expiredDay,\n 'expired_time' => $expiredTime,\n 'point_remaining' => $remainingPoints,\n 'status' => Status::COMPLETE,\n 'status_check' => Status::REFUNDED\n ];\n $customer->saveTransactionHistory($historyData);\n\n // Send mail when points changed\n $this->_dataHelper->sendEmailCustomerPointChanged(\n $customer->getId(),\n $historyData,\n $storeCode\n );\n }\n break;\n\n // Reward points for order\n case Type::CHECKOUT_ORDER:\n if ($transaction->getTransactionDetail() != $order->getIncrementId()) {\n break;\n }\n\n $refundedTransactions = $this->_historyFactory->create()->getCollection()\n ->addFieldToFilter('type_of_transaction', Type::REFUND_ORDER_SUBTRACT_POINTS)\n ->addFieldToFilter('transaction_detail', $order->getIncrementId());\n\n if (sizeof($refundedTransactions) > 0) {\n break;\n }\n\n if ($transaction->getStatus() == Status::COMPLETE && $subtractRewardPoints) {\n $customer->addRewardPoint(-$transaction->getAmount());\n $historyData = [\n 'type_of_transaction' => Type::REFUND_ORDER_SUBTRACT_POINTS,\n 'amount' => (int) $transaction->getAmount(),\n 'balance' => $customer->getMwRewardPoint(),\n 'transaction_detail' => $order->getIncrementId(),\n 'transaction_time' => $now,\n 'status' => Status::COMPLETE,\n 'status_check' => Status::REFUNDED\n ];\n $customer->saveTransactionHistory($historyData);\n\n // Send mail when points changed\n $this->_dataHelper->sendEmailCustomerPointChanged(\n $customer->getId(),\n $historyData,\n $storeCode\n );\n }\n break;\n\n // Reward points for order\n case Type::CHECKOUT_ORDER_NEW:\n $detail = explode(\"||\", $transaction->getTransactionDetail());\n if ($detail[0] != $order->getIncrementId()) {\n break;\n }\n\n $refundedTransactions = $this->_historyFactory->create()->getCollection()\n ->addFieldToFilter('type_of_transaction', Type::REFUND_ORDER_SUBTRACT_POINTS)\n ->addFieldToFilter('transaction_detail', $order->getIncrementId());\n\n if (sizeof($refundedTransactions) > 0) {\n break;\n }\n\n if ($transaction->getStatus() == Status::COMPLETE && $subtractRewardPoints) {\n $customer->addRewardPoint(-$transaction->getAmount());\n $historyData = [\n 'type_of_transaction' => Type::REFUND_ORDER_SUBTRACT_POINTS,\n 'amount' => (int) $transaction->getAmount(),\n 'balance' => $customer->getMwRewardPoint(),\n 'transaction_detail' => $order->getIncrementId(),\n 'transaction_time' => $now,\n 'status' => Status::COMPLETE,\n 'status_check' => Status::REFUNDED\n ];\n $customer->saveTransactionHistory($historyData);\n\n // Process expired points when spent point\n $this->_dataHelper->processExpiredPointsWhenSpentPoints(\n $customer->getId(),\n $transaction->getAmount()\n );\n\n // Send mail when points changed\n $this->_dataHelper->sendEmailCustomerPointChanged(\n $customer->getId(),\n $historyData,\n $storeCode\n );\n }\n break;\n }\n }\n }\n\n $customerId = $order->getCustomerId();\n $friendId = $this->_memberFactory->create()->load($customerId)->getMwFriendId();\n if ($friendId) {\n $friend = $this->_memberFactory->create()->load($friendId);\n\n // Update transaction status for friend\n $transactions = $this->_historyFactory->create()->getCollection()\n ->addFieldToFilter('customer_id', $friendId)\n ->addFieldToFilter('status', Status::COMPLETE)\n ->addFieldToFilter('type_of_transaction', [\n 'in' => [\n Type::FRIEND_FIRST_PURCHASE,\n Type::FRIEND_NEXT_PURCHASE\n ]\n ])\n ->addOrder('transaction_time', 'ASC')\n ->addOrder('history_id', 'ASC');\n\n foreach ($transactions as $transaction) {\n $subtractRewardPoints = $this->_dataHelper->getSubtractPointWhenRefundConfigStore($storeCode);\n\n $detail = explode(\"|\", $transaction->getTransactionDetail());\n if ($detail[1] != $order->getId()) {\n continue;\n }\n\n $refundedTransactions = $this->_historyFactory->create()->getCollection()\n ->addFieldToFilter('type_of_transaction', Type::REFUND_ORDER_FREND_PURCHASE)\n ->addFieldToFilter('transaction_detail', $transaction->getTransactionDetail());\n\n if (sizeof($refundedTransactions) > 0) {\n continue;\n }\n\n if ($subtractRewardPoints) {\n $friend->addRewardPoint(-$transaction->getAmount());\n $historyData = [\n 'type_of_transaction' => Type::REFUND_ORDER_FREND_PURCHASE,\n 'amount' => (int) $transaction->getAmount(),\n 'balance' => $friend->getMwRewardPoint(),\n 'transaction_detail' => $transaction->getTransactionDetail(),\n 'transaction_time' => $now,\n 'status' => Status::COMPLETE,\n 'status_check' => Status::REFUNDED\n ];\n $friend->saveTransactionHistory($historyData);\n\n // Process expired points when spent point\n $this->_dataHelper->processExpiredPointsWhenSpentPoints(\n $friendId,\n $transaction->getAmount()\n );\n\n // Send mail when points changed\n $this->_dataHelper->sendEmailCustomerPointChanged(\n $friendId,\n $historyData,\n $storeCode\n );\n }\n }\n }\n }",
"function search_and_send_abandon_order_canceled() {\n\t$abandoned_orders_canceled_ids = get_abandoned_orders_canceled_ids();\n\tif ( ! empty( $abandoned_orders_canceled_ids ) ) {\n\t\tforeach ( $abandoned_orders_canceled_ids as $order_id ) {\n\t\t\t$order = wc_get_order( $order_id );\n\t\t\t$order->update_status( 'cancelled', __( 'Unpaid order cancelled - time limit reached.', 'woocommerce' ) );\n\t\t\tif ( class_exists( 'WP_CLI' ) ) { // debug in WP CLI.\n\t\t\t\tWP_CLI::log( 'Order #' . $order_id . ' canceled - time limit reached.' );\n\t\t\t}\n\t\t}\n\t}\n}",
"function purge_history($account_id)\n\t{\n\t\tif(mysql_query(\"delete from receipt_order where receipt_id in (select receipt_id from receipt where user_id = '$account_id')\"))\n\t\t{\n\t\t\tmysql_query(\"delete from receipt where user_id = '$account_id'\");\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create subdomain Returns true on success or false on failure. | function addSubdomain($subdomain)
{
$data['domain'] = $subdomain;
$data['rootdomain'] = $this->domain;
$response = $this->HTTP->getData('subdomain/doadddomain.html', $data);
if(strpos($response, 'added') && !strpos($response, 'Error'))
{
return true;
}
return false;
} | [
"public function create_subdomain($subDomain,$cPanelUser,$cPanelPass,$rootDomain) {\n \n $buildRequest = \"/frontend/x3/subdomain/doadddomain.html?rootdomain=\" . $rootDomain . \"&domain=\" . $subDomain . \"&dir=public_html/clientdev/production/site2/public/\" . $subDomain;\n \n $openSocket = fsockopen('localhost',2082);\n if(!$openSocket) {\n return \"Socket error\";\n exit();\n }\n \n $authString = $cPanelUser . \":\" . $cPanelPass;\n $authPass = base64_encode($authString);\n $buildHeaders = \"GET \" . $buildRequest .\"\\r\\n\";\n $buildHeaders .= \"HTTP/1.0\\r\\n\";\n $buildHeaders .= \"Host:localhost\\r\\n\";\n $buildHeaders .= \"Authorization: Basic \" . $authPass . \"\\r\\n\";\n $buildHeaders .= \"\\r\\n\";\n \n fputs($openSocket, $buildHeaders);\n while(!feof($openSocket)) {\n fgets($openSocket,128);\n }\n fclose($openSocket);\n \n $newDomain = \"http://\" . $subDomain . \".\" . $rootDomain . \"/\";\n \n \n return \"ok\"; \n \n }",
"public function checkSubDomain()\n {\n $subdomain = Input::get('subdomain');\n if($this->_isValidSubDomain($subdomain))\n echo 'valid';\n else\n echo 'invalid';\n\n exit;\n }",
"function isValidSubDomain()\n {\n // check for register tenant\n $tenant = $this->getTenantinfo();\n if (empty($tenant)) {\n die('Not Valid');\n //show_404();\n }\n //check tenant is allow to access app\n //$tenant->actionWithStatus();\n\n return true;\n }",
"public function add_subdomain($domain, $rootdomain, $dir='', $disallowdot=''){\n $input=array(\n 'module' => 'SubDomain',\n 'function' => 'addsubdomain',\n 'domain' => $domain,\n 'rootdomain' => $rootdomain\n );\n !empty($dir) && array_push($input, array('dir' => $dir));\n !empty($disallowdot) && array_push($input, array('disallowdot' => $disallowdot));\n $query=$this->build_query($input);\n $raw=$this->query($query);\n $ob=json_decode($raw, false);\n $status=$ob->cpanelresult->data[0]->result;\n \n if ($status==1) { \n return TRUE;\n } else {\n return FALSE;\n }\n }",
"private function register_subdomain() {\n\t$host = $_SERVER['HTTP_HOST'];\n\tif ($this->config->base_domain) $this->subdomain = preg_replace('/\\.'.$this->config->base_domain.'$/i', '', $host);\n\telse {\n\t\t$parts = explode('.', $host);\n\t\t// we're going to assume a single level tld, like .com, rather than a multi level tld, like .co.uk\n\t\tarray_pop($parts);\n\t\tarray_pop($parts);\n\t\t$this->subdomain = implode('.', $parts);\n\t}\n\tif (self::$force_www && !$this->subdomain) $this->subdomain = 'www';\n}",
"function is_subdomain_install() {\n\t\t\tif ( ( defined( 'VHOST' ) && 'yes' == VHOST ) || ( defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ) )\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}",
"public function amOnSubdomain($subdomain);",
"private function hasSubdomain()\n\t{\n\t\t$domainParts = explode('.',$_SERVER['HTTP_HOST']);\n\t\tif(count($domainParts)>2){\n\t\t\treturn $domainParts[0];\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function delete_subdomains() {\r\n\t\r\n\t\t$aVars = array();\r\n\t\r\n\t\tif ( !$this->preActionBasicValidate( $aVars, 'to delete Sub Domains' ) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n\t\tif ( !isset( $this->m_aData['subdomains_to_delete_names'] ) || !is_array( $this->m_aData['subdomains_to_delete_names'] ) ) {\r\n\t\t\t$this->m_aMessages[] = \"No Sub Domains were selected.\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n\t\t$aSubDomains = $this->m_aData['subdomains_to_delete_names'];\r\n\t\r\n\t\t$fSuccess = true;\r\n\t\tforeach( $aSubDomains as $sSubDomain ) {\r\n\t\r\n\t\t\t$aArgs = array ( 'domain' => $sSubDomain );\r\n\t\r\n\t\t\t$this->m_oCpanel_Api->doApiFunction( \"SubDomain\", \"delsubdomain\", $aArgs );\r\n\t\t\t$this->m_oLastApiResponse = $this->m_oCpanel_Api->getLastResponse();\r\n\t\r\n\t\t\tif ( Worpit_CPanelTransformer::GetLastSuccess( $this->m_oLastApiResponse ) ) {\r\n\t\t\t\t$fSuccess = true;\r\n\t\t\t\t$this->m_aMessages[] = \"Deleting Sub Domain ($sSubDomain) from cPanel account succeeded.\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$fSuccess = false;\r\n\t\t\t\t$this->m_aMessages[] = \"Deleting Sub Domain ($sSubDomain) from cPanel account FAILED: \". Worpit_CPanelTransformer::GetLastError( $this->m_oLastApiResponse );\r\n\t\t\t\t$this->m_aMessages[] = \"Stopping further processing due to previous failure.\";\r\n\t\t\t}\r\n\t\r\n\t\t\tif ( !$fSuccess ) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\treturn $fSuccess;\r\n\t}",
"private function ifSubdomainExist(){\n\t\tif($url = Conf::getParsedUrl()){\n\t\t\tif(!empty($url['subdomain']) && $url['domain']!='zogs'){\n\t\t\t\tif(method_exists($this,'handleSubdomain')){\n\t\t\t\t\t$this->handleSubdomain($url['subdomain']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function hasSubDomain(): bool\n {\n\n return ! $this->isIPAddress() && ! empty( $this->subDomainName );\n\n }",
"public function testSubdomain() {\n // Starting URL\n $url = 'http://www.studio98.com/';\n\n // Get the domain\n $subdomain = url::subdomain( $url );\n\n // Make sure they're equal\n\t\t$this->assertEquals( 'www', $subdomain );\n\t}",
"public function create($name): bool {\n /*return $this->user->associateDomain($domain);*/\n $domain = new Domain();\n $domain->name = $name;\n $domain->status_id = 1;\n\n return $this->user->associateDomain($domain);\n }",
"public function checkSubdomain()\n {\n\n $timer = Profile::timer()->stopwatch(__METHOD__)->start();\n\n // Get Subdomain\n $subdomain = Http_Host::getSubdomain();\n\n // Redirection\n $redirect = false;\n\n // CMS Database\n $db = $this->dbFactory->get('cms');\n\n // Agent Subdomains Enabled\n if (!empty($this->settings['MODULES']['REW_AGENT_CMS']) || !empty($this->settings['MODULES']['REW_TEAM_CMS'])) {\n // Check Sub-Domain\n if (!in_array($subdomain, array((Http_Host::getDev() ? '' : 'www')))) {\n\n // Strip www. from Agent Sites\n if (preg_match('/^www\\./', $subdomain)) {\n $subdomain = preg_replace('/^www\\./', '', $subdomain);\n\n // Check Agent Subdomain\n if (!empty($this->settings['MODULES']['REW_AGENT_CMS'])) {\n // Locate Agent\n $agent = $db->prepare(\"SELECT `cms_link` FROM `agents` WHERE `cms` = 'true' AND `cms_link` = :cms_link;\");\n $agent->execute(array('cms_link' => $subdomain));\n $agent = $agent->fetch();\n\n // Agent Found, Re-Direct to Agent Site\n if (!empty($agent)) {\n $redirect = sprintf(Settings::getInstance()->SETTINGS['URL_AGENT_SITE_RAW'], $agent['cms_link']) . $_SERVER['REQUEST_URI'];\n }\n }\n\n // Check Team Subdomain\n if (!empty($this->settings->MODULES['REW_TEAM_CMS'])) {\n // Locate Team\n $team = $db->prepare(\"SELECT `subdomain_link` FROM `teams` WHERE `subdomain` = 'true' AND `subdomain_link` = :subdomain_link;\");\n $team->execute(array('subdomain_link' => $subdomain));\n $team = $team->fetch();\n\n\n // Team Found, Re-Direct to Team Site\n if (!empty($team)) {\n $redirect = sprintf(Settings::getInstance()->SETTINGS['URL_AGENT_SITE_RAW'], $team['subdomain_link']) . $_SERVER['REQUEST_URI'];\n }\n }\n\n // Neither Team nor Agent were Found, Re-Direct to Main Site\n if (empty($redirect)) {\n $redirect = Settings::getInstance()->SETTINGS['URL_RAW'] . $_SERVER['REQUEST_URI'];\n }\n\n // Backend only accessible from main subdomain\n } else if (strpos($_SERVER['REQUEST_URI'], '/backend/') === 0) {\n $redirect = Settings::getInstance()->SETTINGS['URL_RAW'] . $_SERVER['REQUEST_URI'];\n } else {\n //Has a subdomain been found\n $subdomain_found = false;\n\n // Check for Agent\n if (!empty($this->settings['MODULES']['REW_AGENT_CMS'])) {\n $agent = $db->prepare(\"SELECT * FROM `agents` WHERE `cms` = 'true' AND `cms_link` = :cms_link;\");\n $agent->execute(array('cms_link' => $subdomain));\n $agent = $agent->fetch();\n\n // Agent Site Found\n if (!empty($agent)) {\n $subdomain_found = true;\n $this->settings['SETTINGS']['agent'] = $agent['id'];\n $this->settings['SETTINGS']['agent_idxs'] = !empty($agent['cms_idxs']) ? explode(\",\", $agent['cms_idxs']) : array();\n }\n }\n\n // Check for Team\n if (!empty($this->settings['MODULES']['REW_TEAM_CMS']) && !$subdomain_found) {\n $team = $db->prepare(\"SELECT * FROM `teams` WHERE `subdomain` = 'true' AND `subdomain_link` = :subdomain_link;\");\n $team->execute(array('subdomain_link' => $subdomain));\n $team = $team->fetch();\n\n // Team Site Found\n if (!empty($team)) {\n $subdomain_found = true;\n unset($this->settings['SETTINGS']['agent']);\n $this->settings['SETTINGS']['team'] = $team['id'];\n $this->settings['SETTINGS']['team_idxs'] = !empty($team['subdomain_idxs']) ? explode(\",\", $team['subdomain_idxs']) : array();\n }\n }\n\n if (!$subdomain_found) {\n // Redirect Address\n $redirect = Settings::getInstance()->SETTINGS['URL_RAW'] . $_SERVER['REQUEST_URI'];\n }\n }\n }\n\n // Only Allow www. (Unless on dev server)\n } elseif (!in_array($subdomain, array((Http_Host::getDev() ? '' : 'www')))) {\n $redirect = Settings::getInstance()->SETTINGS['URL_RAW'] . $_SERVER['REQUEST_URI'];\n }\n\n // Toggle primary config based on specific subdomain config (module addons)\n if (!empty($this->settings['SETTINGS']['team'])) {\n $config = $db->fetch(\"SELECT `subdomain_addons` FROM `teams` WHERE `id` = :id\", ['id' => $this->settings['SETTINGS']['team']]);\n $addons = explode(',', $config['subdomain_addons']);\n } else {\n $config = $db->fetch(\"SELECT `cms_addons` FROM `agents` WHERE `id` = :id\", ['id' => $this->settings['SETTINGS']['agent']]);\n $addons = explode(',', $config['cms_addons']);\n }\n $this->settings['ADDONS'] = [];\n foreach (self::SUBDOMAIN_MODULE_CONFIG_KEYS as $config) {\n if (in_array($config['db_val'], $addons)) {\n $this->settings['ADDONS'][] = $config['db_val'];\n }\n }\n\n // 301 Redirection\n if (!empty($redirect)) {\n $currentHost = sprintf(\n '%s://%s%s',\n $_SERVER['REQUEST_SCHEME'],\n $_SERVER['SERVER_NAME'],\n $_SERVER['REQUEST_URI']\n );\n // Prevent infinite redirect for non-existent subdomains\n if ($redirect === $currentHost) {\n $redirect = $this->settings['urls']['URL_DOMAIN'] . ltrim($_SERVER['REQUEST_URI'], '/');\n header('HTTP/1.1 301 Moved Permanently');\n header('Location: ' . $redirect);\n exit;\n }\n }\n\n $this->hooks->hook(Hooks::HOOK_AGENT_INFO_LOADED)->run();\n\n $timer->stop();\n }",
"function associateSubdomain($sd=false) {\n if(!$sd) $sd = SUBDOMAIN;\n if($sd) {\n global $DB;\n return $DB->subdomains->getCell(array('subdomain' => $sd), 'assoc');\n } else {\n return 'frontpage';\n }\n}",
"function DeleteSubDomain()\r\n\t\t{\r\n\t\t\tglobal $CFG,$objSmarty;\r\n if($_POST['domain_id'] != '')\r\n {\r\n $UpQuery = \"DELETE FROM \".$CFG['table']['domaindetails'].\" WHERE domain_id ='\".$this->filterInput($_POST['domain_id']).\"'\";\r\n \t\t\t$UpResult = mysql_query($UpQuery) or die($this->mysql_error($UpQuery));\r\n $UpQuery = \"DELETE FROM \".$CFG['table']['temp_domaindetails'].\" WHERE domain_id ='\".$this->filterInput($_POST['domain_id']).\"'\";\r\n \t$UpResult = mysql_query($UpQuery) or die($this->mysql_error($UpQuery));\r\n \t\t\treturn true;\r\n }\t\t\t\r\n\t\t}",
"function add_domain_post() {\r\n\t\tif( isset( $_POST['add_domain'] ) && !empty( $_POST['domain_name'] ) && isset( $_POST['domain_status'] ) ) {\r\n\t\t\tunset( $_POST['add_domain'] );\r\n\t\t\t$result = $this->add_domain( $_POST );\r\n\t\t\tif ( is_wp_error( $result ) ) {\r\n\t\t\t\treturn $result->get_error_message();\r\n\t\t\t} else {\r\n\t\t\t\t$this->update_domains_option();\r\n\t\t\t\treturn sprintf( __( 'The domain %s has been successfully added.', $this->textdomain ), $_POST['domain_name'] );\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function libvirt_domain_create($res) : bool\n{\n}",
"function register_domain()\n\t{\n\t\t\n\t\t/**\n\t\t * Contact data in $this->input uses the prefixes: admin_, billing_, owner_, technical_ ...\n\t\t * \n\t\t * fname - First Name\n\t\t * lname - Last Name\n\t\t * company - Company Name\n\t\t * address1 - Address Line 1\n\t\t * address2 - Address Line 2\n\t\t * city - City\n\t\t * state - State\n\t\t * zip - Zip\n\t\t * country - Country\n\t\t * phone - Phone\n\t\t * fax - Fax\n\t\t * email - Email Address\n\t\t * \n\t\t * Example:\n\t\t * \n\t\t * $this->input['admin_fname']\n\t\t * $this->input['admin_lname']\n\t\t * $this->input['admin_company']\n\t\t * $this->input['admin_address1']\n\t\t * $this->input['admin_address2']\n\t\t * etc.\n\t\t * \n\t\t * Other values included are:\n\t\t * \n\t\t * username - Client's Reseller Username\n\t\t * password - Client's Reseller Password\n\t\t * autorenew - Auto Renew (0 or 1)\n\t\t * name - Domain SLD\n\t\t * tld - Domain TLD\n\t\t * privacy - Domain Privacy (0 or 1)\n\t\t * lockdomain - Lock Domain (0 or 1)\n\t\t * years - Registration in Years\n\t\t * \n\t\t * Configuration data in $this->config is as follows:\n\t\t * \n\t\t * ns_type - Name Server Type (0 or 1)\n\t\t * primary_ns - Primary Nameserver\n\t\t * secondary_ns - Secondary Nameserver\n\t\t * \n\t\t */\n\n\t\t$request = array(\n\t\t\t// Build array of data to be submitted to domain reseller\n\t\t);\n\t\t\n\t\t$result = $this->registrar_post($request);\n\t\t\n\t\tif (PEAR::isError($result)) {\n\t\t\treturn $result;\n\t\t}\n\t\t\n\t\t/**\n\t\t * If something unexpected happens, return a PEAR Error object:\n\t\t */\n\t\tif ($failure) {\n\t\t\treturn PEAR::raiseError('Domain registration failed.',1);\n\t\t}\n\t\t\n\t\t/**\n\t\t * Set $this->order_id to order ID or other unique value returned from registrar\n\t\t */\n\t\t$this->order_id = $result['order_id'];\n\t\t\n\t\treturn true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enqueue backbone.js library, required by the Attach to Post display tab | function enqueue_display_tab_js()
{
wp_enqueue_script('backbone');
// provided by WP
$this->object->mark_script('backbone');
// Enqueue the backbone app for the display tab
// Get all entities used by the display tab
$context = 'attach_to_post';
$gallery_mapper = $this->get_registry()->get_utility('I_Gallery_Mapper', $context);
$album_mapper = $this->get_registry()->get_utility('I_Album_Mapper', $context);
$image_mapper = $this->get_registry()->get_utility('I_Image_Mapper', $context);
$display_type_mapper = $this->get_registry()->get_utility('I_Display_Type_Mapper', $context);
$sources = C_Displayed_Gallery_Source_Manager::get_instance();
$settings = C_NextGen_Settings::get_instance();
// Get the nextgen tags
global $wpdb;
$tags = $wpdb->get_results("SELECT DISTINCT name AS 'id', name FROM {$wpdb->terms}\n WHERE term_id IN (\n SELECT term_id FROM {$wpdb->term_taxonomy}\n WHERE taxonomy = 'ngg_tag'\n )");
$all_tags = new stdClass();
$all_tags->name = "All";
$all_tags->id = "All";
array_unshift($tags, $all_tags);
$display_types = array();
$registry = C_Component_Registry::get_instance();
$display_type_mapper->flush_query_cache();
foreach ($display_type_mapper->find_all() as $display_type) {
if (isset($display_type->hidden_from_igw) && $display_type->hidden_from_igw || isset($display_type->hidden_from_ui) && $display_type->hidden_from_ui) {
continue;
}
$available = $registry->is_module_loaded($display_type->name);
if (!apply_filters('ngg_atp_show_display_type', $available, $display_type)) {
continue;
}
// Some display types were saved with values like "nextgen-gallery-pro/modules/nextgen_pro_imagebrowser/static/preview.jpg"
// as the preview_image_relpath property
if (strpos($display_type->preview_image_relpath, '#') === FALSE) {
$static_path = preg_replace("#^.*static/#", "", $display_type->preview_image_relpath);
$module_id = isset($display_type->module_id) ? $display_type->module_id : $display_type->name;
if ($module_id == 'photocrati-nextgen_basic_slideshow') {
$display_type->module_id = $module_id = 'photocrati-nextgen_basic_gallery';
}
$display_type->preview_image_relpath = "{$module_id}#{$static_path}";
$display_type_mapper->save($display_type);
$display_type_mapper->flush_query_cache();
}
$display_type->preview_image_url = M_Static_Assets::get_static_url($display_type->preview_image_relpath);
$display_types[] = $display_type;
}
usort($display_types, array($this->object, '_display_type_list_sort'));
wp_enqueue_script('ngg_display_tab', $this->get_static_url('photocrati-attach_to_post#display_tab.js'), array('jquery', 'backbone', 'photocrati_ajax'), NGG_SCRIPT_VERSION);
$this->object->mark_script('ngg_display_tab');
wp_localize_script('ngg_display_tab', 'igw_data', array('displayed_gallery_preview_url' => $settings->gallery_preview_url, 'displayed_gallery' => $this->object->_displayed_gallery->get_entity(), 'sources' => $sources->get_all(), 'gallery_primary_key' => $gallery_mapper->get_primary_key_column(), 'galleries' => $gallery_mapper->find_all(), 'albums' => $album_mapper->find_all(), 'tags' => $tags, 'display_types' => $display_types, 'nonce' => M_Security::create_nonce('nextgen_edit_displayed_gallery'), 'image_primary_key' => $image_mapper->get_primary_key_column(), 'display_type_priority_base' => NGG_DISPLAY_PRIORITY_BASE, 'display_type_priority_step' => NGG_DISPLAY_PRIORITY_STEP, 'shortcode_ref' => isset($_REQUEST['ref']) ? floatval($_REQUEST['ref']) : null, 'shortcode_defaults' => array('order_by' => $settings->galSort, 'order_direction' => $settings->galSortDir, 'returns' => 'included', 'maximum_entity_count' => $settings->maximum_entity_count), 'shortcode_attr_replacements' => array('source' => 'src', 'container_ids' => 'ids', 'display_type' => 'display'), 'i18n' => array('sources' => __('Are you inserting a Gallery (default), an Album, or images based on Tags?', 'nggallery'), 'optional' => __('(optional)', 'nggallery'), 'slug_tooltip' => __('Sets an SEO-friendly name to this gallery for URLs. Currently only in use by the Pro Lightbox', 'nggallery'), 'slug_label' => __('Slug', 'nggallery'), 'no_entities' => __('No entities to display for this source', 'nggallery'), 'exclude_question' => __('Exclude?', 'nggallery'), 'select_gallery' => __('Select a Gallery', 'nggallery'), 'galleries' => __('Select one or more galleries (click in box to see available galleries).', 'nggallery'), 'albums' => __('Select one album (click in box to see available albums).', 'nggallery'))));
} | [
"public function register_backbone_javascript() {\n\t\t\t\n\t\t/* backbone js extension */\n\t\twp_enqueue_script( 'belT', plugins_url( '/belt.js' , BB_WP_API_FILE ) , array( 'jquery', 'backbone') );\t\t \t\n\t\twp_localize_script( 'backbone', 'belTExternalVars_' . $this->name , $this->get_js_vars()); \t\t\n\t}",
"public function alm_single_post_enqueue_scripts() {\n \t$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';\n \t\twp_register_script( 'alm-single-posts', plugins_url( '/dist/js/alm-single-posts' . $suffix . '.js', __FILE__ ), array('ajax-load-more'), ALM_PREV_POST_VERSION, true );\n \t}",
"function totoNews_add_ajax_library() {\n}",
"public function init()\n {\n parent::init();\n // I would advice to put these in a combined file, but it works this way too.\n Requirements::javascript('newsmodule/javascript/jquery.tagcloud.js');\n Requirements::javascript('newsmodule/javascript/newsmodule.js');\n }",
"function init() {\r\n wp_enqueue_script('jquery');\r\n wp_enqueue_script('facebox', WP_PLUGIN_URL . '/hoverable/assets/facebox.js');\r\n wp_deregister_script('autosave');\r\n }",
"protected function registerLibraries()\r\n {\r\n $url = File::getResourceUri() . '';\r\n wp_register_script('jquery-mobile-events', $url . '/js/jquery-mobile-events.min.js', array('jquery'), LbwpCore::REVISION, true);\r\n wp_register_script('jquery-multisort', $url . '/js/jquery.multisort.js', array('jquery'), LbwpCore::REVISION, true);\r\n wp_register_script('jquery-cookie', $url . '/js/jquery.cookie.js', array('jquery'), LbwpCore::REVISION, true);\r\n wp_register_script('lbwp-gallery-inline-fix', $url . '/js/lbwp-gallery-inline-fix.js', array('jquery'), LbwpCore::REVISION, true);\r\n wp_register_script('lbwp-gallery-inline-fix-v2', $url . '/js/lbwp-gallery-inline-fix-v2.js', array('jquery'), LbwpCore::REVISION, true);\r\n wp_register_style('jquery-ui-theme-lbwp', $url . '/css/jquery.ui.theme.min.css', array(), LbwpCore::REVISION);\r\n wp_register_script('chosen-js', $url . '/js/chosen/chosen.jquery.min.js', array('jquery'), LbwpCore::REVISION);\r\n wp_register_script('chosen-sortable-js', $url . '/js/chosen/chosen.sortable.jquery.js', array('chosen-js'), LbwpCore::REVISION);\r\n wp_register_style('chosen-css', $url . '/js/chosen/chosen.min.css', array(), LbwpCore::REVISION);\r\n }",
"protected function addMediaLibraryScripts(): void\n {\n $screen = get_current_screen();\n if ($screen->base === 'upload' && $screen->post_type === 'attachment') {\n $mode = $_GET['mode'] ?? 'grid'; // grid view is the default view\n \n // the JS we want to add is different for our two views. then, if it's\n // grid view, we also need to make sure that it has access to the list of\n // aspect ratios that this plugin maintains in the database.\n \n $jsFile = 'media-library-' . $mode . '-view-mods.js';\n $handle = $this->enqueue('assets/scripts/' . $jsFile);\n \n if ($mode === 'grid') {\n $ratios = json_encode($this->getRatios());\n $jsObject = 'const mbarAspectRatios = ' . $ratios;\n \n // we tell the WP Core script queue to add our inline script before\n // it includes the above media library modifications. this ensures\n // that those modifications will have access to the mbarAspectRatios\n // object.\n \n wp_add_inline_script($handle, $jsObject , 'before');\n }\n }\n }",
"public static function inject_dependences() {\n if(is_singular(self::$post_type)) {\n $version = '3.2.6';\n $include = get_template_directory_uri() . '/assets';\n\n // Enqueue swiper js to bottom\n wp_enqueue_script('glide', $include . '/vendor/glide.min.js', [], $version, true);\n }\n }",
"function include_required_scripts() {\r\n\t\t\tif ( FOOGALLERY_CPT_GALLERY == foo_current_screen_post_type() ) {\r\n\r\n\t\t\t\t//zeroclipboard needed for copy to clipboard functionality\r\n\t\t\t\t$url = FOOGALLERY_URL . 'lib/zeroclipboard/ZeroClipboard.min.js';\r\n\t\t\t\twp_enqueue_script( 'foogallery-zeroclipboard', $url, array('jquery'));\r\n\r\n\t\t\t\t//include any admin js required for the templates\r\n\t\t\t\tforeach ( foogallery_gallery_templates() as $template ) {\r\n\t\t\t\t\t$admin_js = foo_safe_get( $template, 'admin_js' );\r\n\t\t\t\t\tif ( $admin_js ) {\r\n\t\t\t\t\t\twp_enqueue_script( 'foogallery-gallery-admin-' . $template['slug'], $admin_js, array('jquery'));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"public function post_enqueue_script() {\n\t\tglobal $post;\n\n\t\tif ($post->post_type == self::POST_TYPE) {\n\t\t\twp_enqueue_script($this->module_name . '-js', plugin_dir_url(__FILE__) . \"js/mtssb-article-admin.js\", array('jquery'));\n\t\t}\n\t}",
"public function init_libraries() {\n\t\trequire_once $this->plugin_path . 'src/functions/utils.php';\n\t\trequire_once $this->plugin_path . 'src/functions/template-tags/general.php';\n\t\trequire_once $this->plugin_path . 'src/functions/template-tags/date.php';\n\n\t\tTribe__Debug::instance();\n\t\ttribe( 'assets' );\n\t\ttribe( 'assets.pipeline' );\n\t\ttribe( 'settings.manager' );\n\t\ttribe( 'tracker' );\n\t\ttribe( 'plugins.api' );\n\t\ttribe( 'pue.notices' );\n\t\ttribe( 'ajax.dropdown' );\n\t\ttribe( 'logger' );\n\t}",
"public function enqueue_scripts() {\n\t\tif ( $this->settings && 'video' === $this->settings->photoVideo ) {\n\t\t\twp_enqueue_script( 'vimeo-helper', '//f.vimeocdn.com/js/froogaloop2.min.js', array(), '3', true );\n\t\t}\n\t}",
"abstract protected function enqueueViewScripts();",
"function _load_bp_attachments_plugin() {\n\tadd_filter( 'bp_rest_api_is_available', '__return_false' );\n\n\t// Make sure BP is installed and loaded first.\n\trequire BP_TESTS_DIR . '/includes/loader.php';\n\n\t// Load our plugin.\n\trequire_once dirname( __FILE__ ) . '/../../class-bp-attachments.php';\n\n\t// Set version.\n\tbp_update_option( '_bp_attachments_version', BP_ATTACHMENTS_VERSION );\n}",
"function load_libs()\n {\n wp_enqueue_script('jquery');\n if (isset($_GET['page']) && $_GET['page'] == 'puawp_options') {\n /* some ajax/jquery script enqueues etc */\n wp_enqueue_script('jquery-ui-core');\n wp_enqueue_script('jquery-ui-widget');\n wp_enqueue_script('jquery-ui-position');\n wp_enqueue_script('jquery-ui-dialog');\n\n /* media upload stuff for later */\n wp_enqueue_script('media-upload');\n wp_enqueue_script('thickbox');\n wp_enqueue_style('thickbox'); //style sheet for thickbox\n }\n }",
"public function load_js_for_builder() {\n wp_enqueue_script( 'buddyforms_camera_admin', BF_WEBCAM_ELEM_JS_PATH.'camera_admin.js', array( 'jquery' ) );\n\n }",
"function turolinks_init() {\n\t// TURBOLINKS 5 doenst like the Adminbar so we will have a peek if it exists\n\tif(!is_admin() && !is_admin_bar_showing()) {\n\t\twp_register_script('turbolinks', WPTURBOLINKS5_LIB_URL);\n\t\twp_enqueue_script( 'turbolinks', WPTURBOLINKS5_LIB_URL , array(), WPTURBOLINKS5_VERSION, true );\t\n\t}\n}",
"function loadLibsGlobally()\n{\n\te107::library('load', 'moment.js', 'minified');\n\te107::library('load', 'livestamp.js', 'minified');\n}",
"public function enqueue()\n {\n wp_register_script( 'wpc_post_select', get_stylesheet_directory_uri() . '/custom_controls/post_select.js', ['jquery'], '1.0.0', true );\n wp_enqueue_script( 'wpc_post_select' );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the API Merchant Token | public static function setMerchantToken($merchantToken)
{
self::$merchantToken = $merchantToken;
} | [
"public static function setMerchantToken($merchantToken)\r\n {\r\n self::$merchantToken = $merchantToken;\r\n }",
"public function setMerchantToken($merchantId) {\n $this->merchantId = $merchantId;\n }",
"public function setMerchantIdentifier();",
"private function setToken()\n {\n $response = $this->getCurlResponse();\n if (isset($response['TOKEN']) && !empty($response['TOKEN'])) {\n $this->_token = $response['TOKEN'];\n } else {\n $this->_token = null;\n }\n }",
"protected function setToken()\n {\n if (Storage::exists('bca-token.json')) {\n $file = Storage::get('bca-token.json');\n $jsonData = json_decode($file, true);\n $now = time();\n if (!empty($jsonData['expires_in'])) {\n if ($now > $jsonData['expires_in']) {\n $this->auth();\n } else {\n $this->accessToken = $jsonData['access_token'];\n $this->tokenType = $jsonData['token_type'];\n }\n } else {\n $this->auth();\n }\n } else {\n $this->auth();\n }\n }",
"private function setToken()\n {\n $this->token = $this->generateToken();\n }",
"public function set_token() {\n\t\tcheck_ajax_referer( 'marketify-add-token', 'security' );\n\n\t\t$token = isset( $_POST[ 'token' ] ) ? esc_attr( $_POST[ 'token' ] ) : false;\n\n\t\tif ( ! $token ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\tupdate_option( $this->option, $token );\n\n\t\t// hotswap the token\n\t\t$this->api->token = $token;\n\n\t\twp_send_json_success( array(\n\t\t\t'token' => $token,\n\t\t\t'can_request' => $this->api->can_make_request_with_token(),\n\t\t\t'request_label' => $this->api->connection_status_label()\n\t\t) );\n\n\t\texit();\n\t}",
"private function setMerchantKey()\n {\n $this->key = config('gladepay.key');\n }",
"public function set_token() {\n $get_request_method = isset( $_SERVER['REQUEST_METHOD'] ) ? filter_var( $_SERVER['REQUEST_METHOD'], FILTER_SANITIZE_STRING ) : ''; // phpcs:ignore\n $request_method = $get_request_method ? $get_request_method : '';\n $request = new LaterPay_Core_Request();\n\n /**\n * Skip lptoken verification if `_lpc_ad` param is found in the request.\n * This is done to avoid conflict with LaterPay Connector Integration.\n */\n if ( ! $request->get_param( '_lpc_ad' ) ) {\n $client_options = LaterPay_Helper_Config::get_php_client_options();\n $laterpay_client = new LaterPay_Client(\n $client_options['cp_key'],\n $client_options['api_key'],\n $client_options['api_root'],\n $client_options['web_root'],\n $client_options['token_name']\n );\n\n // check token and set if necessary\n $lptoken = $request->get_param( 'lptoken' );\n if ( $lptoken ) {\n if ( LaterPay_Client_Signing::verify( $request->get_param( 'hmac' ), $laterpay_client->get_api_key(), $request->get_data( 'get' ), get_permalink(), $request_method ) ) {\n // set token\n $laterpay_client->set_token( $lptoken );\n }\n\n wp_safe_redirect( get_permalink( $request->get_param( 'post_id' ) ) );\n // exit script after redirect was set\n exit;\n }\n }\n }",
"private function _setAccessToken()\n\t{\n\t\t$this->_accessToken = '12345';\n\t}",
"function set_access_token($access_token){\n\n\t\t$this->access_token = $access_token;\n\t\t$this->api->access_token = $access_token;\n \n\t}",
"public function SetDeveloperToken($developerToken) {\n $this->SetHeaderValue('developerToken', $developerToken);\n }",
"public function setGatewayToken($token);",
"protected function _update_token() {\n $this->request_params['method'] = 'POST';\n $this->request_params['path'] = \"{$this->api_version}{$this->token_endpoint}\";\n $data = $this->do_request() ? $this->get_data() : null;\n $data = json_decode($data, true);\n $access_token = isset($data['access_token']) ? $data['access_token'] : null;\n $expiration = isset($data['expires_in']) ? $data['expires_in'] : null;\n $refresh_token = isset($data['refresh_token']) ? $data['refresh_token'] : null;\n $this->access_token = $access_token;\n $this->expiration = $expiration;\n $this->refresh_token = $refresh_token;\n $this->request_params['header_params'] = array('Authorization: OAuth ' . $this->access_token);\n }",
"public function setDeviceTokenAction(){\n $data = $this->getRequestData();\n $this->getDeviceSession()->getUserId();\n if($data['device_token']){\n $session = Workapp_Session::getBySessionUid($data['session_uid']);\n if ($session) {\n $session->addDeviceToken($data['device_token']);\n } else {\n $this->setErrorResponse('This device has no running session which is required by service');\n }\n } else {\n $this->setErrorResponse('device_token is mandatory field for this request!');\n }\n $this->_helper->json(array('added' => true));\n }",
"public function setMerchantKey($key) {\n $this->merchant_key = $key;\n }",
"public function updateApiToken()\n {\n $this->setApiToken();\n }",
"public function setMerchantOrderId(){\n $this->merchant_oid = $this->randomKeyGenerate();\n }",
"function setAuthenticationToken()\r\n\t{\r\n\t\t$token = new Token();\r\n\t\t$this->authToken = $token->generateAuthToken($this->params);\r\n\r\n\t\t$this->isTokenSet = $this->authToken ? True : False;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attaches a log writer, and optionally limits the levels of messages that will be written by the writer. | public function attach(Log\Writer $writer, $levels = [], int $min_level = 0): self
{
if (!is_array($levels)) {
$levels = range($min_level, $levels);
}
$this->_writers[(string)$writer] = [
'object' => $writer,
'levels' => $levels
];
return $this;
} | [
"public function addWriter(\\Naked\\Log\\Writer $writer)\n {}",
"public function test_attach_attaches_log_writer_min_max_and_returns_this()\n\t{\n\t\t$logger = new Log;\n\t\t$writer = $this->getMockForAbstractClass('Log_Writer');\n\n\t\t$this->assertSame($logger, $logger->attach($writer, Log::NOTICE, Log::CRITICAL));\n\n\t\t$this->assertAttributeSame(\n\t\t\t[spl_object_hash($writer) => ['object' => $writer, 'levels' => [Log::CRITICAL, Log::ERROR, Log::WARNING, Log::NOTICE]]],\n\t\t\t'_writers',\n\t\t\t$logger\n\t\t);\n\t}",
"public function attach(Kohana_Log_Writer $writer, array $types = NULL)\n\t{\n\t\t$this->_writers[\"{$writer}\"] = array\n\t\t(\n\t\t\t'object' => $writer,\n\t\t\t'types' => $types\n\t\t);\n\n\t\treturn $this;\n\t}",
"public function addWriter(int $minimalLogLevel, SimpleLoggerWriterInterface $loggerWriter)\n {\n $this->loggerWriters[] = [$minimalLogLevel, $loggerWriter];\n }",
"public function attachWriter(Writer $writer) {\n if (isset($writer)) {\n $this->writers[] = $writer;\n }\n }",
"public function test_attach_attaches_log_writer_and_returns_this()\n\t{\n\t\t$logger = new Kohana_Log;\n\t\t$writer = $this->getMockForAbstractClass('Kohana_Log_Writer');\n\n\t\t$this->assertSame($logger, $logger->attach($writer));\n\n\t\t$this->assertAttributeSame(\n\t\t\tarray(spl_object_hash($writer) => array('object' => $writer, 'types' => NULL)),\n\t\t\t'_writers',\n\t\t\t$logger\n\t\t);\n\t}",
"public function addLogWriter($logWriter)\r\n {\r\n $this->_logWriters[] = $logWriter;\r\n }",
"public function setLogger(Writer $logger)\n\t{\n\t\t$this->logger = $logger;\n\t}",
"public function add_writer($name) {\n $this->writers[] = $name;\n }",
"public function withLog(WriterInterface $writter): WritersInterface;",
"private static function LogToAppenders(array $appenders, $message, $level) {\n foreach ($appenders as $handle) {\n self::WriteMessage($handle, $message, $level);\n }\n }",
"function addLoggers($logger);",
"private function mockAppender() {\n $appender= new class() extends Appender {\n public $messages= [];\n public function append(LoggingEvent $event) {\n $this->messages[]= [\n strtolower(LogLevel::nameOf($event->getLevel())), \n $this->layout->format($event)\n ];\n }\n };\n return $appender->withLayout(new PatternLayout('%m'));\n }",
"protected function mockAppender() {\n $appender= newinstance('util.log.Appender', array(), '{\n public $messages= array();\n \n public function append(LoggingEvent $event) {\n $this->messages[]= array(\n strtolower(LogLevel::nameOf($event->getLevel())), \n $this->layout->format($event)\n );\n }\n }');\n return $appender->withLayout(new PatternLayout('%m'));\n }",
"private function writeLogs(): void\n {\n // Write logs\n $fileName = $this->getApp()->getConfig()->getDirectory(ConfigInterface::DIR_VAR_LOGS) . '/Berlioz.log';\n\n if (is_resource($this->fp) || is_resource($this->fp = @fopen($fileName, 'a'))) {\n if (count($this->logs) > 0) {\n foreach ($this->logs as $key => $log) {\n if (!$log['written']) {\n $line = sprintf(\"%-26s %-11s %s\\n\",\n \\DateTime::createFromFormat('U.u', number_format($log['time'], 6, '.', ''))\n ->format('Y-m-d H:i:s.u'),\n '[' . $log['level'] . ']',\n $log['message']);\n\n if (@fwrite($this->fp, $line) !== false) {\n $this->logs[$key]['written'] = true;\n }\n }\n }\n }\n unset($log);\n }\n }",
"public function testWriterManagement()\n {\n $logger = new Logger('PHPUnit', [\n 'filters' => [],\n 'writers' => []\n ]);\n\n $writer = new NoWriter(['filters' => []]);\n $logger->addWriter($writer);\n\n // After adding one writer we're at one\n $this->assertCount(1, $logger->getWriters());\n\n // After removing it, it's back to zero\n $logger->removeWriter($writer);\n $this->assertCount(0, $logger->getWriters());\n }",
"public function setLevels($levels)\n\t{\n\t\tif (\\is_array($levels)) {\n\t\t\tforeach ($levels as $level) {\n\t\t\t\tif (isset(self::$levelMap[$level])) {\n\t\t\t\t\t$this->logToLevels |= self::$levelMap[$level];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Exceptions\\AppException(\"Unrecognized level: $level\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$bitmapValues = array_reduce(self::$levelMap, function ($carry, $item) {\n\t\t\t\treturn $carry | $item;\n\t\t\t});\n\t\t\tif (!($bitmapValues & $levels) && 0 !== $levels) {\n\t\t\t\tthrow new Exceptions\\AppException(\"Incorrect $levels value\");\n\t\t\t}\n\t\t\t$this->logToLevels = $levels;\n\t\t}\n\t}",
"public function addWriteFilter(WriteFilterInterface $filter);",
"public function attach(LoggerIface $observer);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets up the views data in the container. | protected function setupViewsData(ViewsData $views_data) {
$container = \Drupal::hasContainer() ? \Drupal::getContainer() : new ContainerBuilder();
$container->set('views.views_data', $views_data);
\Drupal::setContainer($container);
} | [
"protected function prepareView()\n {\n $this->view->setData( $this->data );\n }",
"public function setupContainer() {\n $this->accessPluginManager = $this->getMockBuilder('\\Drupal\\views\\Plugin\\ViewsPluginManager')\n ->disableOriginalConstructor()\n ->getMock();\n $container = new ContainerBuilder();\n $container->set('plugin.manager.views.access', $this->accessPluginManager);\n\n $config = [\n 'views.settings' => [\n 'skip_cache' => TRUE,\n 'display_extenders' => [],\n ],\n ];\n\n $container->set('config.factory', $this->getConfigFactoryStub($config));\n\n \\Drupal::setContainer($container);\n }",
"private function initView() {\r\n\r\n\t\t$this->view->idprog = $this->idprog;\r\n\t\t$this->view->idview = $this->idview;\r\n\t\t$this->view->locale = $this->locale;\r\n\t\t$this->view->lang = $this->lang;\r\n\t\t$this->view->viewcode = $this->viewcode;\r\n\t\t$this->view->publicationKey = $this->publicationkey;\r\n\t}",
"public function initializeView()\r\n {\r\n $this->view->assign('extConf', ObjectAccess::getGettableProperties($this->extConf));\r\n $this->view->assign('id', $GLOBALS['TSFE']->id);\r\n $this->view->assign('data', $this->configurationManager->getContentObject()->data);\r\n }",
"protected function initializeView() {\r\n\t}",
"protected function initView()\n {\n \n }",
"protected function _initView()\n {\n \n }",
"abstract protected function doSetupViewWithArguments();",
"private function setup()\n {\n # base url\n F::set('flight.base_url', F::get('root'));\n\n # Smarty init\n F::register('view', 'Smarty', array(), function($smarty)\n {\n if (env == 'dev') {\n $smarty->caching = 0;\n $smarty->force_compile = true;\n }\n\n $smarty->setTemplateDir('src/');\n $smarty->setCompileDir('src/_smarty/templates_c/');\n $smarty->setConfigDir('src/_smarty/config/');\n $smarty->setCacheDir('src/_smarty/cache/');\n $smarty->addPluginsDir('src/_smarty/plugins/');\n });\n\n # render templates\n F::map('render', function($template, $data = array())\n {\n F::view()->assign(array(\n 'root' => F::get('root'),\n 'app' => array(\n \"name\" => \"fastdoc\",\n \"version\" => \"1.0\",\n \"homepage\" => \"http://github.com/ray0be/fastdoc\"\n ),\n 'config' => F::get('config'),\n 'edit' => F::get('edit'),\n 'data' => $data\n ));\n\n # flashbags messages\n if (isset($_SESSION['flashbag'])) {\n F::view()->assign(array('flashbag' => $_SESSION['flashbag']));\n $_SESSION['flashbag'] = null;\n }\n\n F::view()->display($template);\n });\n }",
"public function createViews() {\n\t\tforeach (array_unique($this->viewFixtures) as $fixture) {\n\t\t\t$this->loadSqlViewFixture($fixture);\n\t\t}\n\t}",
"protected function initializeView( )\r\n {\r\n if ( isset( $this->view ) ) return;\r\n\r\n $this->view = View::getInstance( $this->multitonKey );\r\n }",
"abstract protected function doSetupViewWithFilters();",
"public function setup()\n {\n $this->service->loadPanels();\n }",
"protected function _initContainer()\n {\n /**\n * Initializing View state Data\n */\n $this->_viewStatesDefinitions = PHP2_UI_TemplateParser::parseBlockTemplate($this->_controlDefinition->content, 'state');\n\n if (!isset( $this->_viewStatesDefinitions['blocks'])) return;\n\n foreach ($this->_viewStatesDefinitions['blocks'] as $stateIndex => &$stateDetails)\n {\n $stateDetails['attributes'] = PHP2_UI_ControlDefinition::parseAttributesString($stateDetails['attributesString']);\n\n /**\n * Initializing display object\n */\n $displayObjectContainer = new PHP2_UI_DisplayObjectContainer();\n $displayObjectContainer->container = &$this;\n\n /**\n * Initializing container owner\n */\n if ($this->_containerType && ($this->_containerType == self::CONTAINER_TYPE_ISOLATED))\n {\n $displayObjectContainer->owner = &$this;\n }\n else\n {\n $displayObjectContainer->owner = &$this->owner;\n }\n\n /**\n * Loading content to the display objects container\n */\n if (isset($stateDetails['attributes']['template']))\n {\n $displayObjectContainer->loadTemplate(BASE_PATH.'ui/'.$stateDetails['attributes']['template']);\n }\n else\n {\n $displayObjectContainer->setTemplateString($stateDetails['content']);\n }\n\n $displayObjectContainer->sessionData['__CONTROLS'] = &$this->sessionData['__CONTROLS'][$stateDetails['blockName']];\n $displayObjectContainer->parseTemplate();\n\n /**\n * Creating link to the current state\n */\n $this->_viewStates[$stateDetails['blockName']] = $displayObjectContainer;\n $this->{$stateDetails['blockName']} = $displayObjectContainer;\n\n /**\n * Initializing default state\n */\n if (isset($stateDetails['attributes']['default']) && (strtolower($stateDetails['attributes']['default']) == 'true')) $this->_defaultState = $stateDetails['blockName'];\n if (!$this->_defaultState) $this->_defaultState = $stateDetails['blockName'];\n }\n\n /**\n * Dispatching creation complete event\n */\n $this->dispatchEvent(new PHP2_UI_UIEvent(PHP2_UI_UIEvent::CREATION_COMPLETE));\n }",
"protected function initView()\n {\n /** @var \\Phalcon\\Registry $registry */\n $registry = $this->diContainer->getShared('registry');\n $options = [\n 'compiledPath' => APP_PATH . '/storage/cache/volt/',\n 'compiledSeparator' => '_',\n 'compiledExtension' => '.php',\n 'compileAlways' => boolval('development' === $registry->mode),\n 'stat' => true,\n ];\n\n $view = new View();\n $view->setViewsDir(APP_PATH . '/app/views/');\n $view->registerEngines(\n [\n '.phtml' => function ($view) use ($options) {\n $volt = new PhVolt($view, $this->diContainer);\n $volt->setOptions($options);\n\n /**\n * Register the PHP extension, to be able to use PHP\n * functions in Volt\n */\n\n $volt->getCompiler()->addExtension(new Php());\n\n return $volt;\n },\n ]\n );\n\n $this->diContainer->setShared('view', $view);\n }",
"protected function initView()\n {\n $di = $this->di;\n $config = $di->get('config');\n\n $di->setShared('view', function () use ($config, $di) {\n $view = new View();\n\n $view->setViewsDir(PROJECT_PATH . $config->volt->viewDir);\n $view->setLayoutsDir($config->volt->layoutDir);\n\n $view->setLayout($config->application->defaultLayoutName);\n\n $view->registerEngines(array(\n '.phtml' => '\\Phalcon\\Mvc\\View\\Engine\\Php',\n '.volt' => function ($view, $di) use ($config) {\n $volt = new Volt($view, $di);\n\n $volt->setOptions(\n array(\n 'compiledPath' => PROJECT_PATH . $config->volt->cacheDir,\n 'compiledSeparator' => '_',\n 'stat' => true,\n 'compileAlways' => true\n )\n );\n\n $compiler = $volt->getCompiler();\n\n // View functions\n $functions = array();\n\n foreach ($functions as $function) {\n $compiler->addFunction(\n $function['name'],\n $function['method']\n );\n }\n\n return $volt;\n }\n ));\n\n return $view;\n });\n }",
"function assignCustomViewData() {}",
"private function _populateView() {\n\t\t$this->setToView('attributesForLayout');\n\t\t$this->setToView('descriptionForLayout');\n\t\t$this->setToView('keywordsForLayout');\n\t\t$this->setToView('menusForLayout');\n\t\tif ($this->controller->params['url']['url'] != '/') {\n\t\t\t$this->controller->attributesForLayout[] = array(\n\t\t\t\t'id' => false,\n\t\t\t\t'class' => $this->controller->params['controller'] . ' ' . $this->controller->action,\n\t\t\t);\n\t\t}\n\t}",
"protected function setupView()\n\t{\n\t\tif (empty($this->view)) {\n\t\t\t$this->view = LSF_Config::get('view_mode') == 'basic' ? new LSF_View_Basic() : new LSF_View_Node();\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appends to the filter its child filters. | public function append_child_filters(array &$appended = array()) {
if (!$this->filters) {
return;
}
$fm = \mod_dataform_filter_manager::instance($this->dataid);
$appended[$this->id] = $this->id;
foreach ($this->filters as $fid) {
if (array_key_exists($fid, $appended)) {
continue;
}
// Get the filter.
$filter = $fm->get_filter_by_id($fid);
// Append its child filters.
$appended[$fid] = $fid;
$filter->append_child_filters($appended);
// Append to this filter.
$this->append(array($filter));
}
} | [
"public function addFilter($filter) {\r\n\t\t$this->chain[] = $filter;\r\n\t}",
"function _populateSubFilters(&$parentFilter) {\n\t\tif (!is_a($parentFilter, 'CompositeFilter')) {\n\t\t\t// Nothing to do. Only composite filters\n\t\t\t// can have sub-filters.\n\t\t\treturn;\n\t\t}\n\n\t\t// Retrieve the sub-filters from the database.\n\t\t$parentFilterId = $parentFilter->getId();\n\t\t$result =& $this->retrieve(\n\t\t\t\t'SELECT * FROM filters WHERE parent_filter_id = ? ORDER BY seq', $parentFilterId);\n\t\t$daoResultFactory = new DAOResultFactory($result, $this, '_fromRow', array('filter_id'));\n\n\t\t// Add sub-filters.\n\t\twhile (!$daoResultFactory->eof()) {\n\t\t\t// Retrieve the sub filter.\n\t\t\t// NB: This recursively loads sub-filters\n\t\t\t// of this filter via _fromRow().\n\t\t\t$subFilter =& $daoResultFactory->next();\n\n\t\t\t// Add the sub-filter to the filter list\n\t\t\t// of its parent filter.\n\t\t\t$parentFilter->addFilter($subFilter);\n\t\t\tunset($subFilter);\n\t\t}\n\t}",
"abstract public function addFilter($newFilter);",
"public function addFilter($filter){ }",
"function addFilter($newFilter)\r\n {\r\n $this->filters[] = $newFilter;\r\n $this->headFilter = $this->filters[0];\r\n $this->tailFilter = end($this->filters);\r\n reset($this->filters);\r\n }",
"protected function addFilter()\n {\n add_filter($this->event_slug, $this->event_callback, $this->event_priority, $this->event_num_args);\n }",
"public function addPostFilter(FW_Interface_Filter $filter);",
"public function applyFilters()\r\n\t{\r\n\t\tforeach($this->filters as $filter)\r\n\t\t\t$this->applyFilter($filter);\r\n\t}",
"function addFilter(Filter $filter);",
"static function add_filters(): void {\r\n\r\n\t\t// The group\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_group']);\r\n\r\n\t\t// The fields\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_advertise']);\r\n\t\tadd_action('acf/init', [__CLASS__, 'add_no_issue_cats']);\r\n\t}",
"public function get_filter_sub_filters() {\n\t\treturn array();\n\t}",
"public function buildFilters()\n {\n if ($this->auth->isGranted('ROLE_SUPER_ADMIN')) {\n $this->addFilter('user', new ORM\\StringFilterType('username', 'u'), 'User');\n }\n $this->addFilter('product', new ORM\\StringFilterType('name', 'p'), 'Product');\n $this->addFilter('extraInfo', new ORM\\StringFilterType('extraInfo'), 'Extra info');\n }",
"public function addFilter()\n\t{\n\t\treturn $this->addTextFilter();\n\t}",
"protected function collect_filters()\n {\n }",
"public function buildFilters()\n {\n $this->addFilter('name', new ORM\\StringFilterType('name'), 'media.adminlist.configurator.filter.name');\n $this->addFilter('contentType', new ORM\\StringFilterType('contentType'), 'media.adminlist.configurator.filter.type');\n $this->addFilter('updatedAt', new ORM\\NumberFilterType('updatedAt'), 'media.adminlist.configurator.filter.updated_at');\n $this->addFilter('filesize', new ORM\\NumberFilterType('filesize'), 'media.adminlist.configurator.filter.filesize');\n }",
"public function addFilter(QueryFilter $filter): void\n {\n $this->filters->push($filter);\n }",
"public function buildFilters()\n {\n $this->addFilter('name', new ORM\\StringFilterType('name'), 'hgabka_kuma_email.labels.name');\n $this->addFilter('email', new ORM\\StringFilterType('email'), 'hgabka_kuma_email.labels.email');\n }",
"public function AddFilter(CriteriaFilter $filter)\r\n\t{\r\n\t\tif (!$this->Filters) $this->Filters = array();\r\n\t\t$this->Filters[] = $filter;\r\n\t}",
"public function add(Dynamics_AssetFilter $filter)\n {\n $this->chain[] = $filter;\n }",
"protected function addFilters()\n { \n $filters = [\n 'hash_encode' => function($value) { return \\hashEncode($value); },\n 'hash_decode' => function($value) { return \\hashDecode($value); },\n ];\n foreach ($filters as $name => $filter)\n $this->environment->addFilter(new \\Twig\\TwigFilter($name, $filter));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the given key and cipher combination is valid. | public static function supported( $key, $cipher )
{
$length = mb_strlen( $key, '8bit' );
return ( $cipher === 'AES-128-CBC' && $length === 16 ) || ( $cipher === 'AES-256-CBC' && $length === 32 );
} | [
"public static function supported($key, $cipher)\n {\n $length = mb_strlen($key, '8bit');\n \n return (static::isAesCbc128($cipher) && $length === 16) ||\n (static::isAesCbc256($cipher) && $length === 32);\n }",
"public function validKey($key)\n {\n $length = mb_strlen($key, '8bit');\n\n if (strpos($this->cipher, '128') !== false) {\n return $length == 128/8;\n } else if (strpos($this->cipher, '192') !== false) {\n return $length == 192/8;\n } else if (strpos($this->cipher, '256') !== false) {\n return $length == 256/8;\n } else {\n throw new RuntimeException('The keylength does not match the cipher.');\n }\n }",
"public static function supported($key, $cipher)\n {\n $length = mb_strlen($key, '8bit');\n\n return ($cipher === 'AES-128-CBC' && $length === 16) ||\n ($cipher === 'AES-256-CBC' && $length === 32);\n }",
"public static function supported($key, $cipher)\n {\n $length = mb_strlen($key, '8bit');\n\n return ($cipher === 'AES-128-CBC' && ($length === 16)) || ($cipher === 'AES-256-CBC' && $length === 32);\n }",
"public function isKeyValid()\n\t\t{\n\t\t\t$key = strtoupper( md5(\n\t\t\t\t$this->_secretWord . $this->_accountId .\n\t\t\t\t$this->getRequest()->getParam( 'order_number' ) .\n\t\t\t\t$this->getRequest()->getParam( 'total' )\n\t\t\t) );\n\t\t\treturn ( $key == $this->getRequest()->getParam( 'key' ) );\n\t\t}",
"public function supported($key, $cipher)\n {\n $length = mb_strlen($key, '8bit');\n\n return ($cipher === 'AES-128-CBC' && $length === 16) || ($cipher === 'AES-256-CBC' && $length === 32);\n }",
"public function isValid(string $key) : bool;",
"private function isValidKey ($key)\n {\n // Check $key has been given or not\n if (empty($key)) {\n trigger_error(\"AbTestConfig key has not been given.\");\n return false;\n }\n // Check valid key has been given or not\n if (is_null($this->testCases[$key])) {\n trigger_error(\"'$key' is not found in AbTestConfig.\");\n return false;\n }\n return true;\n }",
"private function isLegalKeyFormat($key)\n {\n $len = strlen($key);\n return ($len > 0) &&\n ($len <= 64) &&\n (preg_match('/[a-zA-Z0-9\\.\\_]+/', $key) === 1);\n }",
"function is_encryption_details_valid() {\n\treturn CompSocEncryption::ENCRYPTION_KEY !== '';\n}",
"function key_check($key)\n\t{\n\t\tif ($key != $this->config->item('license_key'))\n\t\t{\n\t\t\t$this->form_validation->set_message('key_check', 'The license key you entered is not correct.');\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}",
"public function VerifyCBC(string $plainText, string $cipherText, string $key): bool {\n $decrypted = $this->DecryptCBC($cipherText, $key);\n if(is_null($decrypted)) {\n return FALSE;\n }\n if($plainText === $decrypted) {\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"public function check_encryption_key() {\n\t\t$codeword = openssl_decrypt( get_option( 'wpssmtp_echk' ), 'AES-128-ECB', $this->encryption_key() );\n\n\t\tif ( $this->test_value === $codeword ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function verify_key ($key) {\n \treturn $key == $this->get_key();\n }",
"function isDecryptionKey();",
"function verifyKey() \n\t{\n\t\t// make sure a key is set\n\t\tif (!isset($_GET['key'])) { return false; }\n\t\t$key = $_GET['key'];\n\t\t// Decode the hex\n\t\t$key = preg_replace(\"/(.{2})/\",\"%$1\",$key);\n\t\t$key = rawurldecode($key);\n\t\t// Reverse the key\n\t\t$key = strrev($key);\n\t\t// Strip the random characters\n\t\t$key = preg_replace(\"/([a-z])/i\",'',$key);\n\t\t\n\t\t// If this key is from the past 10 seconds we consider it valid\n\t\t// might need to increase depending on bandwidth conditions...\n\t\treturn ((time()-$key) < 10)?true:false;\n\t}",
"function matchesKey($key)\n {\n return RequestUtil::secureStringEquals($key, $this->key);\n }",
"static function supported(string $cipher)\n {\n return ($cipher == 'AES-256-CBC' || $cipher == 'AES-128-CBC');\n }",
"function isValidEngine($engine)\n {\n switch ($engine) {\n case CRYPT_ENGINE_OPENSSL:\n if ($this->block_size != 16) {\n return false;\n }\n $this->cipher_name_openssl_ecb = 'aes-' . ($this->key_length << 3) . '-ecb';\n $this->cipher_name_openssl = 'aes-' . ($this->key_length << 3) . '-' . $this->_openssl_translate_mode();\n break;\n case CRYPT_ENGINE_MCRYPT:\n $this->cipher_name_mcrypt = 'rijndael-' . ($this->block_size << 3);\n if ($this->key_length % 8) { // is it a 160/224-bit key?\n // mcrypt is not usable for them, only for 128/192/256-bit keys\n return false;\n }\n }\n\n return parent::isValidEngine($engine);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the default post processor instance. | protected function getDefaultPostProcessor()
{
return new Processor;
} | [
"protected function getDefaultPostProcessor()\n \t{\n \t\treturn new Processor;\n \t}",
"protected function getDefaultPostProcessor()\n {\n return new Query\\Processors\\Processor;\n }",
"protected function getDefaultPostProcessor()\n {\n return new IfxProcessor;\n }",
"protected function getDefaultPostProcessor()\n {\n return new \\DieZeeL\\Database\\SphinxConnection\\Query\\SphinxProcessor;\n }",
"protected function getDefaultPostProcessor()\n {\n //TODO = Do magic on the returned results for points, ranges, etc.\n return new BasePostgresProcessor;\n }",
"public function getProcessor()\n {\n if (empty($this->processor)) {\n $class = 'Phergie_Process_Standard';\n\n $type = $this->getConfig('processor');\n if (!empty($type)) {\n $class = 'Phergie_Process_' . ucfirst($type);\n }\n\n $this->processor = new $class(\n $this,\n $this->getConfig('processor.options', array())\n );\n }\n return $this->processor;\n }",
"function get_post_instance()\r\n {\r\n if (!isset($this->post_instance)) {\r\n $this->post_instance = new IWP_MMB_Post();\r\n }\r\n \r\n return $this->post_instance;\r\n }",
"public static function getProcessor()\n {\n $instance = new Processor();\n $instance->addUnserializerHandler(new Handler\\Address());\n $instance->addUnserializerHandler(new Handler\\Amount());\n $instance->addUnserializerHandler(new Handler\\ArrayPaymentInstruments());\n $instance->addUnserializerHandler(new Handler\\Company());\n $instance->addUnserializerHandler(new Handler\\PaymentInstruments());\n $instance->addUnserializerHandler(new Handler\\Person());\n\n return $instance;\n }",
"public static function theProcessor() {\n if (!isset(self::$theProcessor)) {\n self::$theProcessor = new self(Samurai::$processorToken);\n }\n return self::$theProcessor;\n }",
"public function getItemPostProcessor()\n {\n return $this->itemPostProcessor;\n }",
"public function getProcessor() {\n if (is_null($this->_processor)) {\n if ($this->_useCache &&\n class_exists('XsltCache', FALSE)) {\n $this->_processor = new XsltCache();\n } else {\n $this->_processor = new XsltProcessor();\n }\n }\n return $this->_processor;\n }",
"private function getShippingAssignmentProcessor()\n {\n if (!$this->shippingAssignmentProcessor) {\n $this->shippingAssignmentProcessor = ObjectManager::getInstance()\n ->get(\\Magento\\Quote\\Model\\Quote\\ShippingAssignment\\ShippingAssignmentProcessor::class);\n }\n return $this->shippingAssignmentProcessor;\n }",
"function getProcessor() {\n\t\treturn $this->processor;\n\t}",
"public function getProcessor()\n {\n return $this->_processor;\n }",
"public static function useDefaultPostProcessor()\n {\n //Method inherited from \\Illuminate\\Database\\Connection \n /** @var \\Illuminate\\Database\\MySqlConnection $instance */\n $instance->useDefaultPostProcessor();\n }",
"protected function getProcessor() {\n return app('image-processor');\n }",
"function getDefaultDispatcher()\n\t{\n\t\treturn $this->defaultDispatcher;\n\t}",
"protected function getDataObjectProcessor()\n {\n if ($this->dataProcessor === null) {\n $this->dataProcessor = ObjectManager::getInstance()->get(\\Magento\\Framework\\Reflection\\DataObjectProcessor::class);\n }\n return $this->dataProcessor;\n }",
"public static function current()\n {\n $post = offbeat('post')->get();\n return ($post instanceof static) ? $post : null;\n }",
"public static function instance()\n {\n\n if (!isset(self::$instance) && !(self::$instance instanceof Unik_Post_Layout)) {\n\n self::$instance = new Unik_Post_Layout;\n\n self::$instance->setup_constants();\n\n self::$instance->hooks();\n\n self::$instance->on_plugins_loaded();\n\n self::$instance->unikpostlayout_includes();\n\n }\n return self::$instance;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parsing the webservices and return the results | public function getResults()
{
$all_results = $this->parseWebservices();
$all_results = $this->refactorResults($all_results);
$this->saveResults($all_results);
return $all_results;
} | [
"private function parseWebservices()\n {\n // The Shop Webservice\n $shop_service = new ShopService($this->query);\n $shop_service_products = $shop_service->parseShopService();\n \n // The FlipKart webservice\n $flip_service = new FlipkartService($this->query);\n $flip_service_products = $flip_service->parseFlipService();\n \n // Sorting the results\n $all_results = array_merge($shop_service_products, $flip_service_products);\n usort($all_results, \"sort_by_price\");\n\n return $all_results;\n }",
"private function parse()\n\t{\n\t\t$xml = $this->page;\n\t\trequire_once('search/SwoogleSearchXML.php');\n\t\t$parser = xml_parser_create();\n\t\t$callback = new SwoogleSearchXML();\n\t\txml_set_object($parser,$callback);\n\t\txml_set_element_handler($parser,'start_element','end_element');\n\t\txml_set_character_data_handler($parser,'character_data');\n\t\txml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,false);\n\t\t\n\t\t// $xml is the whole document ,true says 'last chunk' ( because there is just one here )\n\t\txml_parse($parser,$xml,true);\n\t\t\n\t\treturn $callback->getResults();\n\t}",
"protected function parse_soap($results, $model){\n\t\t//check model name mapping\n\t\tWaxLog::log('error', '[SOAP RES]'.print_r($results, 1));\t\n\t\tif($model->soap_mappings[$this->cm_api_method]['return']) $return = $model->soap_mappings[$this->cm_api_method]['return'];\n\t\telse $return = $this->cm_api_method.\"Response\";\n\t\t$class = get_class($model);\n\t\t//name mappings for when they aren't consistant!\n\t\tif(is_array($mappings)) $mappings= array_flip($model->rename_mappings);\n\t\t$res = array();\n\t\tif($results->$return->enc_value->$class){\t\n\t\t\t$results = $results->$return->enc_value->$class; //get the results\n\t\t\t//make sure its an array\n\t\t\tif(!is_array($results)) $loop_over = array(0=>$results); \n\t\t\telse $loop_over = $results;\n\t\t\t$columns = array_merge($model->columns, $model->rename_mappings);\n\t\t\t//loop round all return objects\n\t\t\tforeach($loop_over as $k=>$info){\t\n\t\t\t\t$objdata = array(); //tmp var for records\t\t\t\t\n\t\t\t\tforeach($columns as $col=>$spec){ //go over the columns\n\t\t\t\t\tif($info->$col && $model->rename_mappings[$col]) $objdata[$model->rename_mappings[$col]] = $info->$col;\n\t\t\t\t\t//if the val is set, copy over\n\t\t\t\t\telseif($val = $info->$col) $objdata[$col]=$val;\n\t\t\t\t\t//if the name is mapped then copy the mapped named value over to the correct name with the value\n\t\t\t\t\telseif($mappings[$col] && $info->{$mappings[$col]}) $objdata[$col]=$info->{$mappings[$col]};\n\t\t\t\t\t//convert custom fields\n\t\t\t\t\tif($col == \"CustomFields\" && $info->$col){\n\t\t\t\t\t\t$values = array(); //array to store the result\n\t\t\t\t\t\t$field = get_class($model).\"CustomField\"; //the model element to fetch\n\t\t\t\t\t\t$data = $info->$col->$field; //the custom field data\n\t\t\t\t\t\tif(is_array($data)){ //if its an array\n\t\t\t\t\t\t\tforeach($data as $count => $custom_info){\t//loop over and get the key value pairs\n\t\t\t\t\t\t\t\t$key = $custom_info->Key;\n\t\t\t\t\t\t\t\t$val = $custom_info->Value;\n\t\t\t\t\t\t\t\tif($val) $values[$key] = $val; //if the value is set then assign it to val array\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}elseif($data->Value) $values[$data->Key] = $data->Value; //copy val over \n\t\t\t\t\t\tif(count($values)) $objdata[$col] = $values; //if some data has been set then copy it back\n\t\t\t\t\t\telse $objdata[$col] = false; //or set it to false\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t\tif(count($objdata)) $res[] = $objdata;\n\t\t\t}\n\t\t}elseif(is_string($results->$return)) $res[$model->primary_key] = $results->$return; \n\t\t\n\t\t$this->total_without_limits = count($res);\n\t\treturn $res;\n\t}",
"private function search_webservice($cep) {\n\t\t\n\t\t$handler = curl_init('http://republicavirtual.com.br/web_cep.php?cep='.urlencode($cep).'&formato=json');\r\n\t\tcurl_setopt($handler, CURLOPT_RETURNTRANSFER, true);\r\n\t\tcurl_setopt($handler, CURLOPT_FOLLOWLOCATION, true);\r\n\t\t//Pega dados do CEP\r\n\t\t$data = curl_exec($handler);\r\n\t\t//Pega código http\r\n\t\t$http_code = curl_getinfo($handler, CURLINFO_HTTP_CODE);\r\n\t\t//\r\n\t\tcurl_close($handler);\r\n\n\t\tif($http_code == 200) {\r\n\t\t\t$data = json_decode($data);\n\t\t\tif($data->resultado == 1) {\r\n\t\t\t\t$result['response'] = 1;\n\t\t\t\t$result['state'] = $data->uf;\r\n\t\t\t\t$result['address'] = $data->tipo_logradouro.' '.$data->logradouro;\r\n\t\t\t\t$result['district'] = $data->bairro;\r\n\t\t\t\t$result['city'] = $data->cidade;\r\n\t\t\t}else if($data->resultado == 2) {\n\t\t\t\t$result['response'] = 2;\r\n\t\t\t\t$result['state'] = $data->uf;\n\t\t\t\t$result['city'] = $data->cidade;\n\t\t\t\t$result['district'] = 'Centro';\n\t\t\t}else {\n\t\t\t\t$result['response'] = 0;\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t$result['response'] = 0;\r\n\t\t}\r\n\t\t\t\r\n\t\treturn $result;\t\t\n\t}",
"protected function getAllWebservices() {\n return $this->storage->loadMultiple();\n }",
"function _parseResult()\n {\n // MAINTAINERS:\n //\n // If you're in this class fixing or extending the parser\n // please add another file in the 'tests/test_parser_data/'\n // directory which exemplafies the problem. And of course\n // you'll want to run the 'tests/test_parser.php' (which\n // contains easy how-to instructions) to make sure you haven't\n // broken any existing behaviour.\n\n // operate on a copy of the raw output since we're going to modify it\n $data = $this->_raw_data;\n\n // remove leading and trailing blank lines from output\n $this->_parseResultTrimLines($data);\n\n // separate the output into upper and lower portions,\n // and trim those portions\n $this->_parseResultSeparateParts($data, $upper, $lower);\n $this->_parseResultTrimLines($upper);\n $this->_parseResultTrimLines($lower);\n\n // extract various things from the ping output . . .\n\n $this->_target_ip = $this->_parseResultDetailTargetIp($upper);\n $this->_bytes_per_request = $this->_parseResultDetailBytesPerRequest($upper);\n $this->_ttl = $this->_parseResultDetailTtl($upper);\n $this->_icmp_sequence = $this->_parseResultDetailIcmpSequence($upper);\n $this->_round_trip = $this->_parseResultDetailRoundTrip($lower);\n\n $this->_parseResultDetailTransmitted($lower);\n $this->_parseResultDetailReceived($lower);\n $this->_parseResultDetailLoss($lower);\n\n if ( isset($this->_transmitted) ) {\n $this->_bytes_total = $this->_transmitted * $this->_bytes_per_request;\n }\n\n }",
"public function getXML(){\n\t\t$helpers = $this->helpers;\n\t\t$xml = new \\SimpleXMLElement ( \"<results />\" );\n\t\t$serviceEndpoints = $this->serviceEndpoints;\n\t\t\n\t\tforeach ( $serviceEndpoints as $se ) {\n // maybe rename SERVICE_ENDPOINT to SERVICE \n\t\t\t$xmlSe = $xml->addChild ( 'SERVICE_ENDPOINT' );\n\t\t\t$xmlSe->addAttribute ( \"PRIMARY_KEY\", $se->getId () . \"G0\" );\n\t\t\t$helpers->addIfNotEmpty ( $xmlSe, 'PRIMARY_KEY', $se->getId () . \"G0\" );\n\t\t\t$helpers->addIfNotEmpty ( $xmlSe, 'HOSTNAME', $se->getHostName () );\n\t\t\t$portalUrl = htmlspecialchars('#GOCDB_BASE_PORTAL_URL#/index.php?Page_Type=Service&id=' . $se->getId ());\n\t\t\t$helpers->addIfNotEmpty ( $xmlSe, 'GOCDB_PORTAL_URL', $portalUrl );\n\t\t\t$helpers->addIfNotEmpty ( $xmlSe, 'HOSTDN', $se->getDn () );\n\t\t\t$helpers->addIfNotEmpty ( $xmlSe, 'HOST_OS', $se->getOperatingSystem () );\n\t\t\t$helpers->addIfNotEmpty ( $xmlSe, 'HOST_ARCH', $se->getArchitecture () );\n\t\t\t\t\n\t\t\tif ($se->getBeta ()) {\n\t\t\t\t$beta = \"Y\";\n\t\t\t} else {\n\t\t\t\t$beta = \"N\";\n\t\t\t}\n\t\t\t$xmlSe->addChild ( 'BETA', $beta );\n\t\t\t\t\n\t\t\t$helpers->addIfNotEmpty ( $xmlSe, 'SERVICE_TYPE', $se->getServiceType ()->getName () );\n\t\t\t$helpers->addIfNotEmpty ( $xmlSe, 'HOST_IP', $se->getIpAddress () );\n\t\t\t$helpers->addIfNotEmpty ( $xmlSe, 'HOST_IPV6', $se->getIpV6Address () );\n\t\t\t$xmlSe->addChild ( \"CORE\", \"\" );\n\t\t\t\t\n\t\t\tif ($se->getProduction ()) {\n\t\t\t\t$prod = \"Y\";\n\t\t\t} else {\n\t\t\t\t$prod = \"N\";\n\t\t\t}\n\t\t\t$xmlSe->addChild ( 'IN_PRODUCTION', $prod );\n\t\t\t\t\n\t\t\tif ($se->getMonitored ()) {\n\t\t\t\t$mon = \"Y\";\n\t\t\t} else {\n\t\t\t\t$mon = \"N\";\n\t\t\t}\n\t\t\t$xmlSe->addChild ( 'NODE_MONITORED', $mon );\n\t\t\t$site = $se->getParentSite ();\n\t\t\t$helpers->addIfNotEmpty ( $xmlSe, \"SITENAME\", $site->getShortName () );\n\t\t\t$helpers->addIfNotEmpty ( $xmlSe, \"COUNTRY_NAME\", $site->getCountry ()->getName () );\n\t\t\t$helpers->addIfNotEmpty ( $xmlSe, \"COUNTRY_CODE\", $site->getCountry ()->getCode () );\n\t\t\t$helpers->addIfNotEmpty ( $xmlSe, \"ROC_NAME\", $site->getNGI ()->getName () );\n\t\t\t$xmlSe->addChild ( \"URL\", xssafe( $se->getUrl()) );\n\n if($this->renderMultipleEndpoints){\n $xmlEndpoints = $xmlSe->addChild ( 'ENDPOINTS' );\n foreach($se->getEndpointLocations() as $endpoint){\n $xmlEndpoint = $xmlEndpoints->addChild ( 'ENDPOINT' );\n $xmlEndpoint->addChild ( 'ID', $endpoint->getId()); \n $xmlEndpoint->addChild ( 'NAME', xssafe($endpoint->getName()));\n // Endpoint Extensions \n $xmlExtensions = $xmlEndpoint->addChild('EXTENSIONS'); \n foreach($endpoint->getEndpointProperties() as $prop){\n $xmlProperty = $xmlExtensions->addChild ( 'EXTENSION' );\n $xmlProperty->addChild ( 'LOCAL_ID', $prop->getId () );\n $xmlProperty->addChild ( 'KEY', $prop->getKeyName () );\n $xmlProperty->addChild ( 'VALUE', $prop->getKeyValue () );\n } \n $xmlEndpoint->addChild ( 'URL', xssafe($endpoint->getUrl()));\n $xmlEndpoint->addChild ( 'INTERFACENAME', $endpoint->getInterfaceName());\n }\n }\n\t\t\t\n // Service Extensions \n\t\t\t$xmlExtensions = $xmlSe->addChild ( 'EXTENSIONS' );\n\t\t\tforeach ( $se->getServiceProperties () as $prop ) {\n\t\t\t $xmlProperty = $xmlExtensions->addChild ( 'EXTENSION' );\n\t\t\t $xmlProperty->addChild ( 'LOCAL_ID', $prop->getId () );\n\t\t\t $xmlProperty->addChild ( 'KEY', xssafe($prop->getKeyName ()) );\n\t\t\t $xmlProperty->addChild ( 'VALUE', xssafe($prop->getKeyValue ()) );\n\t\t\t}\t\t\n\t\t}\n\t\n\t\t$dom_sxe = dom_import_simplexml ( $xml );\n\t\t$dom = new \\DOMDocument ( '1.0' );\n\t\t$dom->encoding = 'UTF-8';\n\t\t$dom_sxe = $dom->importNode ( $dom_sxe, true );\n\t\t$dom_sxe = $dom->appendChild ( $dom_sxe );\n\t\t$dom->formatOutput = true;\n\t\t$xmlString = $dom->saveXML ();\n\t\treturn $xmlString;\n\t}",
"function blog_search()\r\n\t{\r\n\r\n\t\t$SERVICE_URL = \"http://search.live.com/feeds/results.aspx?format=xml&q=\";\r\n\t\t\r\n\t\t//elaborar el url adecuado para este servicio\r\n\t\t\r\n\t\t$peticion_url = $this->elaborar_url($SERVICE_URL);\r\n\t\t\r\n\t\t//conectarse y obtener la respuesta en formato nativo\r\n\t\t\r\n\t\t$this->respuesta_raw = $this->buscar($peticion_url);\t\t//TODO: validar una respuesta exitosa\r\n\t\t\r\n\t\t//transformar la respuesta raw a finjira\r\n\t\t\r\n\t\t$this->respuesta_findjira = $this->blog_parse();\t\t\t\t//web_parse utiliza respuesta_raw para transformarla\r\n\t}",
"function getAllUserSoap(){\r\n\t\t//we create a html table of all the users\r\n\t\techo'<table class =\"table\">';\r\n\t\techo'<tr>';\r\n\t\techo'<td>';\r\n\t\techo'User id';\r\n\t\techo'</td>';\r\n\t\techo'<td>';\r\n\t\techo'User name';\r\n\t\techo'</td>';\r\n\t\techo'<td>';\r\n\t\techo'preference';\r\n\t\techo'</td>';\r\n\t\techo'</tr>';\t\r\n\t\t$soap_client = new SoapClient(\"http://localhost:8080/JMoviesWebSoap/services/UserServiceImplPort?wsdl\");\r\n\t\t$query = array('arg0');\r\n\t\t$result = $soap_client->getAllUser($query);\r\n\t\tif(!isset ($result->return)){\r\n\t\t\techo '<p class =\"not_found_message\">There is no user.</p>';\r\n\t\t}\r\n\t\tif(!(is_array($result->return)&&!empty($result->return[0]))){\r\n\t\t\techo'<tr><td>';\r\n\t\t\techo $result->return->user_id;\r\n\t\t\techo'</td><td>';\r\n\t\t\techo $result->return->userName;\r\n\t\t\techo'</td><td>';\r\n\t\t\techo $result->return->preference;\r\n\t\t\techo'</td></tr>';\r\n\t\t}\r\n\t\telse if(isset ($result->return)){\r\n\t\t\t$NbUsers = sizeof ($result->return);\r\n\t\t\tif(is_array($result->return)&&!empty($result->return[0])){\r\n\t\t\t\tfor($i = 0;$i < $NbUsers ;$i++){\r\n\t\t\t\t\techo'<tr><td>';\r\n\t\t\t\t\techo $result->return[$i]->user_id;\r\n\t\t\t\t\techo'</td><td>';\r\n\t\t\t\t\techo $result->return[$i]->userName;\r\n\t\t\t\t\techo'</td><td>';\r\n\t\t\t\t\techo $result->return[$i]->preference;\r\n\t\t\t\t\techo'</td></tr>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if($NbUsers == 0){\r\n\t\t\t\techo '<p class =\"not_found_message\">There is no user.</p>'; \r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\techo '<p class =\"not_found_message\">There is no user.</p>';\r\n\t\t}\r\n\t\techo'</table>';\r\n\t}",
"public function _parseResult($xml) {\n if($xml = simplexml_load_string($xml)) {\n $this->clearRates();\n if($xml->Package->Postage){\n foreach($xml->Package->Postage as $service) {\n $name = (string)$service->MailService;\n $rate = (float)$service->Rate;\n $name = str_replace('<sup>®</sup>', '', $name);\n $name = str_replace('<sup>™</sup>', '', $name);\n $this->addRate($name, $rate);\n }\n }\n else{\n Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . \"] Unknown Failure: \".print_r($xml,true));\n } \n }\n else {\n Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . \"] USPS domestic xml parsing failure. Unable to load XML string: $xml\");\n }\n }",
"public function processResult($result) {\n \t\ttry {\n\t\t\t\t$temp = $result['SearchResponse']['web:Web'];\n\t\t\t\t $this->totalhits = $temp['web:Total'];\n\t\t\t\t $this->start = $temp['web:Offset'];\n\n\t\t\t\t if($this->searchtype == 'web') {\n\t\t\t\t\t $this->search_results = $temp['web:Results'];\n\t\t\t\t\t \t$this->processResultsWeb();\n\t\t\t\t\t\t//print_r($result,true); //no idea why it dosent work when this is removed.\n\t\t\t\t }\n\t\t\t\t elseif($this->searchtype == 'images') {\n\t\t\t\t\t $this->search_results = $temp->resultset_images;\n\t\t\t\t }\n\t\t\t\t elseif($this->searchtype == 'news') {\n\t\t\t\t\t $this->search_results = $temp->resultset_news;\n\t\t\t\t }\n\t\t\t}\n\t\t\tcatch(Exception $e) {\n\t\t\t throw new Exception(\"Could not retreive result:\",$e->getMessage(), \"\\n\");\n\t\t }\n\t\t}",
"function parseXML()\n {\n // suppress errors because this will fail sometimes\n $xml = @simplexml_load_file($this->url);\n if(!$xml)\n {\n //try a second time in case just server busy\n $xml = @simplexml_load_file($this->url);\n if(!$xml)\n {\n return false; \n }\n \n }\n $this->totalResults = (integer)$xml->TotalResults;\n foreach($xml->Details as $productXML)\n {\n $this->products[] = new Product($productXML);\n }\n }",
"abstract public function scrape();",
"protected function doParse()\n {\n $results = unserialize($this->content);\n \n if (!count($results) || !isset($results['ResultSet']['Result']))\n {\n throw new sfYahooGeocoderException('No result found on the Yahoo! Geocoder service');\n }\n\n $results = $results['ResultSet']['Result'];\n\n if (!isset($results[0]))\n {\n return new sfYahooGeocoderResponseCollection(array($this->createGeocodedResult($results)));\n }\n\n $objects = array();\n foreach ($results as $result)\n {\n $objects[] = $this->createGeocodedResult($result);\n }\n\n return new sfYahooGeocoderResponseCollection($objects);\n }",
"function blog_search()\r\n\t{\t\r\n\t\t$SERVICE_URL = \"http://www.searchmash.com/results/blogs:\";\r\n\t\t\r\n\t\t//elaborar el url adecuado para este servicio\r\n\t\t\r\n\t\t$peticion_url = $this->elaborar_url($SERVICE_URL);\r\n\t\t\r\n\t\t//conectarse y obtener la respuesta en formato nativo\r\n\t\t\r\n\t\t$this->respuesta_raw = $this->buscar($peticion_url);\t\t//TODO: validar una respuesta exitosa\r\n\t\t\r\n\t\t//transformar la respuesta raw a finjira\r\n\t\t\r\n\t\t$this->respuesta_findjira = $this->web_parse();\t\t\t\t//web_parse utiliza respuesta_raw para transformarla\r\n\t\t\r\n\t}",
"public function getParse() {\n\n // Parse page data from html\n $news = $this->htmlParse();\n\n // Get title,content,data data\n $titleRaw = $this->getTitle($news);\n $contentRaw = $this->getContent($news);\n $dateRaw = $this->getDate($news);\n\n // Parse\n $title = $this->formatTitle($titleRaw);\n $content = $this->formatContent($contentRaw);\n $date = $this->formatDate($dateRaw);\n\n // Create a result array from the data and return it\n $result = array(\n 'title' => $title,\n 'content' => $content,\n 'date' => $date\n );\n return $result;\n\n }",
"private function doListRequest()\n {\n $source = parent::doRequest();\n\n /* Uncomment if you want to display the XML content */\n // echo '<textarea>'.$source.'</textarea>';\n\n /* We make sure there is an XML answer and try to parse it */\n if ($source !== false) {\n parent::parseResponse($source);\n if (count($this->resp_errors_list) == 0) {\n /* The XML file is loaded, we now gather the datas */\n $carriers = $this->xpath->query('/carriers/carrier');\n foreach ($carriers as $carrier_index => $carrier) {\n $this->list_points[$carrier_index]['operator'] =\n $this->xpath->query('./operator', $carrier)->item(0)->nodeValue;\n $this->list_points[$carrier_index]['service'] =\n $this->xpath->query('./service', $carrier)->item(0)->nodeValue;\n $points = $this->xpath->query('./points/point', $carrier);\n foreach ($points as $point_index => $point) {\n $point_info = array(\n 'code' => $this->xpath->query('./code', $point)->item(0)->nodeValue,\n 'name' => $this->xpath->query('./name', $point)->item(0)->nodeValue,\n 'address' => $this->xpath->query('./address', $point)->item(0)->nodeValue,\n 'city' => $this->xpath->query('./city', $point)->item(0)->nodeValue,\n 'zipcode' => $this->xpath->query('./zipcode', $point)->item(0)->nodeValue,\n 'country' => $this->xpath->query('./country', $point)->item(0)->nodeValue,\n 'latitude' => $this->xpath->query('./latitude', $point)->item(0)->nodeValue,\n 'longitude' => $this->xpath->query('./longitude', $point)->item(0)->nodeValue,\n 'phone' => $this->xpath->query('./phone', $point)->item(0)->nodeValue,\n 'description' => $this->xpath->query('./description', $point)->item(0)->nodeValue,\n 'schedule' => array()\n );\n $days = $this->xpath->query('./schedule/day', $point);\n foreach ($days as $day_index => $day) {\n $point_info['schedule'][$day_index] = array(\n 'weekday' => $this->xpath->query('./weekday', $day)->item(0)->nodeValue,\n 'open_am' => $this->xpath->query('./open_am', $day)->item(0)->nodeValue,\n 'close_am' => $this->xpath->query('./close_am', $day)->item(0)->nodeValue,\n 'open_pm' => $this->xpath->query('./open_pm', $day)->item(0)->nodeValue,\n 'close_pm' => $this->xpath->query('./close_pm', $day)->item(0)->nodeValue\n );\n }\n $this->list_points[$carrier_index]['points'][$point_index] = $point_info;\n }\n }\n }\n }\n }",
"public static function get_json_searchresults4webservice($sid, $fromResult, $rm, $internalresults, $externalresults)\n\t{\n\t\t$DEBUG=0;\n\t\t$ok_to_retrieve=true;\n\t\tif (!$fromResult) $fromResult=0;\n\t\tif (!$sid)\n\t\t{\n\t\t\t$errortxt='get_json_searchresults4webservice() - fatal - no sid provided!';\n\t\t\t$ok_to_retrieve=false;\n\t\t} \n\t\telse if($rm==0)\n\t\t{\n\t\t\t$errortxt='get_json_searchresults4webservice() - fatal - no m provided!';\n\t\t\t$ok_to_retrieve=false;\n\t\t}\n\t\tif ($DEBUG)\n\t\t\tprint \"\\n<br> get_json_searchresults4webservice($sid, $fromResult, $rm, $internalresults, $externalresults)\";\n\t\t\n\t\tif ($ok_to_retrieve)\n\t\t{\n\t\t\tglobal $m; $m=$rm; //use in global mode for the following method:\n\t\t\tif ($DEBUG) print \"<br><b>RodinResultManager::getRodinResultsForASearch($sid,null,$internalresults, $externalresults)</b><br>\";\n\t\t\t\n\t\t\t$allResults = RodinResultManager::getRodinResultsForASearch($sid,null,$internalresults, $externalresults); \n\t\t\t$resultCount = count($allResults);\n\t\t\t\n\t\t\t// Both a maximum size and a maximum number of results are set\n\t\t\t$uptoResult = min($resultCount, $fromResult + $m);\n\t\t\n\t\t\tif ($DEBUG) {\n\t\t\t\tprint \"<br>\\n$resultCount results read using sid=$sid ...\"\n\t\t\t\t\t\t\t\t\t\t\t\t.\"<br>Showing $m results from $fromResult upto $uptoResult\"\n\t\t\t\t\t\t\t\t\t\t\t\t.\"<br>DUMPING THE RESULT OBJECT: <hr>\"; \n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tvar_dump($allResults);\n\t\t\t\t\t\t\t\t\t\t\t\tprint \"<hr>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t$i = $fromResult;\n\t\t\twhile ($i < $uptoResult) \n\t\t\t{\n\t\t\t\tif ($DEBUG) print \"<br>reading result ($i) ...\";\n\t\t\t\t\n\t\t\t\t$result = $allResults[$i];\n\t\t\t\tif ($result==null)\n\t\t\t\t{\n\t\t\t\t\tif($DEBUG) fontprint(\"<br>RESULT $resultCounter ($i) is NULL\",'red');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$resultCounter = $i + 1;\n\t\t\t\t\n\t\t\t\t\tif ($DEBUG)\n\t\t\t\t\t{\n\t\t\t\t\t\tprint \"<hr>\\n\\nRESULT $resultCounter ($i): <br>\\n\"; var_dump($result);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t$resultIdentifier = 'aggregatedResult-' . $resultCounter . ($suffix != '' ? '_' . $suffix : '');\n\t\t\t\t\n\t\t\t\t\t$singleResult = array();\n\t\t\t\t\n\t\t\t\t\t$singleResult['count'] = $resultCounter;\n\t\t\t\t\t$singleResult['rid'] = $result->getId() .\"\"; if ($DEBUG) print \"<br>SOLR ID: \".$singleResult['rid'];\n\t\t\t\t\t$singleResult['url'] = $result->getUrlPage();\n\t\t\t\t\t$singleResult['resultIdentifier'] = $resultIdentifier;\n\t\t\t\t\t$singleResult['resultIdentifier'] = $resultIdentifier;\n\t\t\t\t\t$singleResult['rank'] = $result->getRank();\n\t\t\t\t\t$singleResult['toDetails'] = json_encode($result->__toDetails());\n\t\t\t\t\n\t\t\t\t\t// Check the size of the response if this result was added\n\t\t\t\t\t//$tmpAllResults = $jsonAllResults;\n\t\t\t\t\t\n\t\t\t\t\t$jsonAllResults[] = $singleResult;\n\t\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t} // $ok_to_retrieve\n\t\tif ($DEBUG) print \"<hr>\";\n\t\treturn json_encode(array( 'sid' => $sid, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'count' => count($jsonAllResults), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'from'=>$fromResult, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'upto' => $uptoResult - 1, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'all'=>$resultCount, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'results' => $jsonAllResults, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'error'=>$errortxt ) );\n\t}",
"private function _prepareWebServiceSearch() {\n\t\t$link = \"http://ws.geonames.org/search?\";\n\n\t\tif (! is_null ( $this->_city )) {\n\t\t\t$link .= \"q=\" . $this->_city;\n\t\t\tif (! is_null ( $this->_country ))\n\t\t\t\t$link .= \",%20\" . $this->_country;\n\t\t}\n\n\t\tif (! is_null ( $this->_limit ))\n\t\t\t$link .= \"&maxRows=\" . $this->_limit;\n\n\t\t$link .= \"&startRow=\" . $this->_start;\n\t\t$link .= \"&fcode=\" . $this->_fcode;\n\t\t$link .= \"&lang=\" . $this->_lang;\n\t\treturn ($link);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the email address for the specified member id. | function _get_member_email_address($member)
{
return $this->get_member_row_field($member,'email');
} | [
"protected function _get_member_email_address($member)\n {\n return $this->get_member_row_field($member, 'm_email_address');\n }",
"function _get_member_email_address($member)\n\t{\n\t\treturn $this->get_member_row_field($member,'m_email_address');\n\t}",
"protected function _get_member_email_address($member)\n {\n return $this->get_member_row_field($member, 'user_email');\n }",
"public function getEmailAddress($id) {\n\n $sql = \" SELECT \" .\n \" US.EMAIL as EMAIL \" .\n \" FROM \" .\n \" property PROP,users US \" .\n \" WHERE PROP.ID= :id AND PROP.USER_ID=US.ID\";\n\n $query = $this->db->prepare($sql);\n $parameters = array(':id' => $id);\n $query->execute($parameters);\n\n $result = $query->fetchAll(PDO::FETCH_ASSOC);\n\n return $result[0]['EMAIL'];\n }",
"public function MemberEmail() {\r\n\t\t$member = $this->Member();\r\n\t\treturn $member->Email;\r\n\t}",
"public static function getMembersEmail($listid){\n \treturn self::getData('/lists/'.$listid.'/members');\n }",
"public static function getEmail($id) {\n $volunteer = Profile::where('id', '=', $id)->first();\n\n if($volunteer == null) {\n return null;\n }\n\n return $volunteer->email;\n }",
"public function get_email($id) {\n $query = \"SELECT EMAIL FROM USER WHERE ID = '$id';\";\n $data = parent::select($query);\n $data = $data[\"EMAIL\"];\n return $data;\n }",
"public function getEmailForMember($memberData) {\n\t\tif (!isset($memberData)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (is_array($memberData)) {\n\t\t\t$email = Hash::get($memberData, 'Member.email');\n\t\t\tif (isset($email)) {\n\t\t\t\treturn $email;\n\t\t\t} else {\n\t\t\t\t$memberData = Hash::get($memberData, 'Member.member_id');\n\t\t\t}\n\t\t}\n\n\t\t$memberInfo = $this->find('first', array('fields' => array('Member.email'), 'conditions' => array('Member.member_id' => $memberData) ));\n\t\tif (is_array($memberInfo)) {\n\t\t\t$email = Hash::get($memberInfo, 'Member.email');\n\t\t\tif (isset($email)) {\n\t\t\t\treturn $email;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"public function getMailFromUserId($id) {\n try {\n $this->init();\n } catch (SqlException $e) {\n return \"\";\n }\n try {\n $stmt = self::$_conn->prepare(\"SELECT email FROM users WHERE id = ?\");\n $stmt->execute([$id]);\n $match = $stmt->fetch();\n } catch (PDOException $e) {\n return \"\";\n }\n if (!isset($match) || empty($match)) {\n return \"\";\n }\n return $match['email'];\n }",
"public function getEmail($participant_id) {\n\t\t$columns = array ('participant_id');\n\t\t$records = array ($participant_id);\n\t\t$email_ = $this->query_from_participant ( $columns, $records );\n\t\treturn sizeof($email_)>0 ? $email_ [0] ['email'] : null;\n\t}",
"protected function get_membership_user_email( $membership_id ) {\n\t\t$user_id = get_post_meta( $membership_id, 'sumomemberships_userid', true );\n\t\t$user = get_userdata( $user_id );\n\n\t\tif ( ! $user ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $user->user_email;\n\t}",
"function GetEmail($id)\n\t\t{\n\t\t\t$query = \"SELECT * FROM tbl_emails where email_id=$id\";\n\t\t\t$rs\t\t=\t$this->Execute($query);\n\t\t\treturn $this->_getPageArray($rs, 'Email');\n\t\t}",
"function ldap_email( $p_user_id ) {\n\tglobal $g_cache_ldap_email;\n\n\tif( isset( $g_cache_ldap_email[ (int)$p_user_id ] ) ) {\n\t\treturn $g_cache_ldap_email[ (int)$p_user_id ];\n\t}\n\n\t$t_username = user_get_field( $p_user_id, 'username' );\n\t$t_email = ldap_email_from_username( $t_username );\n\n\t$g_cache_ldap_email[ (int)$p_user_id ] = $t_email;\n\treturn $t_email;\n}",
"public function get_member_ip($id)\n {\n return $this->get_member_row_field($id, 'm_ip_address');\n }",
"function get_user_email($id = '',$username = '') {\n\t\tif (! empty($id)) {\n\t\t\t$q = \"SELECT `email` FROM `\" . TABLE_PREFIX . \"users` WHERE `id`='\" . $this->mysql_clean($id) . \"' LIMIT 1\";\n\t\t} else {\n\t\t\t$q = \"SELECT `email` FROM `\" . TABLE_PREFIX . \"users` WHERE `username`='\" . $this->mysql_clean($username) . \"' LIMIT 1\";\n\t\t}\n\t\t$email = $this->get_array($q);\n\t\treturn $email['email'];\n\t}",
"function GetEmailForSubscriber($subscriberid=0)\n\t{\n\t\t$query = \"SELECT emailaddress FROM \" . SENDSTUDIO_TABLEPREFIX . \"list_subscribers WHERE subscriberid='\" . (int)$subscriberid .\"'\";\n\t\t$result = $this->Db->Query($query);\n\t\t$row = $this->Db->Fetch($result);\n\t\tif (empty($row) || !isset($row['emailaddress'])) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $row['emailaddress'];\n\t}",
"public function getMemberById($id)\n {\n return $this->getById($id, 'member_id');\n }",
"public function getMailAddress();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation teamBuilderConfigsIdProductSizesNkProductsDeleteWithHttpInfo Deletes all products of this model. | public function teamBuilderConfigsIdProductSizesNkProductsDeleteWithHttpInfo($id, $nk)
{
// verify the required parameter 'id' is set
if ($id === null) {
throw new \InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductSizesNkProductsDelete');
}
// verify the required parameter 'nk' is set
if ($nk === null) {
throw new \InvalidArgumentException('Missing the required parameter $nk when calling teamBuilderConfigsIdProductSizesNkProductsDelete');
}
// parse inputs
$resourcePath = "/TeamBuilderConfigs/{id}/productSizes/{nk}/products";
$httpBody = '';
$queryParams = array();
$headerParams = array();
$formParams = array();
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));
if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept;
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));
// path params
if ($id !== null) {
$resourcePath = str_replace(
"{" . "id" . "}",
$this->apiClient->getSerializer()->toPathValue($id),
$resourcePath
);
}
// path params
if ($nk !== null) {
$resourcePath = str_replace(
"{" . "nk" . "}",
$this->apiClient->getSerializer()->toPathValue($nk),
$resourcePath
);
}
// default format to json
$resourcePath = str_replace("{format}", "json", $resourcePath);
// for model (json/xml)
if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
} elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form)
}
// this endpoint requires API key authentication
$apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');
if (strlen($apiKey) !== 0) {
$queryParams['access_token'] = $apiKey;
}
// make the API Call
try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath,
'DELETE',
$queryParams,
$httpBody,
$headerParams,
null,
'/TeamBuilderConfigs/{id}/productSizes/{nk}/products'
);
return array(null, $statusCode, $httpHeader);
} catch (ApiException $e) {
switch ($e->getCode()) {
}
throw $e;
}
} | [
"public function teamBuilderConfigsIdProductSizesNkProductsFkDeleteWithHttpInfo($id, $nk, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductSizesNkProductsFkDelete');\n }\n // verify the required parameter 'nk' is set\n if ($nk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $nk when calling teamBuilderConfigsIdProductSizesNkProductsFkDelete');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling teamBuilderConfigsIdProductSizesNkProductsFkDelete');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/productSizes/{nk}/products/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($nk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"nk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($nk),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\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 API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/TeamBuilderConfigs/{id}/productSizes/{nk}/products/{fk}'\n );\n\n return array(null, $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n }",
"public function teamBuilderConfigsIdProductSizesNkProductsFkDelete($id, $nk, $fk)\n {\n list($response) = $this->teamBuilderConfigsIdProductSizesNkProductsFkDeleteWithHttpInfo($id, $nk, $fk);\n return $response;\n }",
"public function productSizesIdProductsDelete($id)\n {\n list($response) = $this->productSizesIdProductsDeleteWithHttpInfo($id);\n return $response;\n }",
"public function teamBuilderConfigsIdProductSizesNkProductsGetWithHttpInfo($id, $nk, $filter = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductSizesNkProductsGet');\n }\n // verify the required parameter 'nk' is set\n if ($nk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $nk when calling teamBuilderConfigsIdProductSizesNkProductsGet');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/productSizes/{nk}/products\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // query params\n if ($filter !== null) {\n $queryParams['filter'] = $this->apiClient->getSerializer()->toQueryValue($filter);\n }\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($nk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"nk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($nk),\n $resourcePath\n );\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 API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\Product[]',\n '/TeamBuilderConfigs/{id}/productSizes/{nk}/products'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\Product[]', $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\\Product[]', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function restPropertiesMultipleOptionsDeleteWithHttpInfo()\n {\n $request = $this->restPropertiesMultipleOptionsDeleteRequest();\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() ? (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 $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function teamBuilderConfigsIdProductSizesNkProductsFkPutWithHttpInfo($id, $nk, $fk, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductSizesNkProductsFkPut');\n }\n // verify the required parameter 'nk' is set\n if ($nk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $nk when calling teamBuilderConfigsIdProductSizesNkProductsFkPut');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling teamBuilderConfigsIdProductSizesNkProductsFkPut');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/productSizes/{nk}/products/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($nk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"nk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($nk),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'PUT',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\Product',\n '/TeamBuilderConfigs/{id}/productSizes/{nk}/products/{fk}'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\Product', $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\\Product', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function teamBuilderConfigsIdProductSizesNkMaterialsFkDeleteWithHttpInfo($id, $nk, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductSizesNkMaterialsFkDelete');\n }\n // verify the required parameter 'nk' is set\n if ($nk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $nk when calling teamBuilderConfigsIdProductSizesNkMaterialsFkDelete');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling teamBuilderConfigsIdProductSizesNkMaterialsFkDelete');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/productSizes/{nk}/materials/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($nk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"nk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($nk),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\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 API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/TeamBuilderConfigs/{id}/productSizes/{nk}/materials/{fk}'\n );\n\n return array(null, $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n }",
"private function delete_products() {\n\t\t$posts = get_posts( [\n\t\t\t'post_type' => 'product',\n\t\t\t'numberposts' => - 1,\n\t\t\t'meta_query' => [ // phpcs:ignore\n\t\t\t\t[\n\t\t\t\t\t'key' => '_edgenet_id',\n\t\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t],\n\t\t\t],\n\t\t] );\n\t\tforeach ( $posts as $post ) {\n\t\t\t$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );\n\t\t\t$f = wp_delete_attachment( $thumbnail_id, true );\n\n\t\t\t$gallery_ids = explode( ',', get_post_meta( $post->ID, '_product_image_gallery', true ) );\n\t\t\tforeach ( $gallery_ids as $id ) {\n\n\t\t\t\t$f = wp_delete_attachment( $id, true );\n\t\t\t}\n\t\t\t// Delete's each post.\n\t\t\t$r = wp_delete_post( $post->ID, true );\n\t\t}\n\t}",
"protected function deleteProducts(array $data) {\n $total = count($data);\n\n $response = Mage::getModel('klevu_search/api_action_deleterecords')->execute(array(\n 'sessionId' => $this->getSessionId(),\n 'records' => array_map(function ($v) {\n return array('id' => Mage::helper('klevu_search')->getKlevuProductId($v['product_id'], $v['parent_id']));\n }, $data)\n ));\n\n if ($response->isSuccessful()) {\n $connection = $this->getConnection();\n\n $select = $connection\n ->select()\n ->from(array('k' => $this->getTableName(\"klevu_search/product_sync\")))\n ->where(\"k.store_id = ?\", $this->getStore()->getId())\n ->where(\"k.test_mode = ?\", $this->isTestModeEnabled());\n\n $skipped_record_ids = array();\n if ($skipped_records = $response->getSkippedRecords()) {\n $skipped_record_ids = array_flip($skipped_records[\"index\"]);\n }\n\n $or_where = array();\n for ($i = 0; $i < count($data); $i++) {\n if (isset($skipped_record_ids[$i])) {\n continue;\n }\n $or_where[] = sprintf(\"(%s AND %s)\",\n $connection->quoteInto(\"k.product_id = ?\", $data[$i]['product_id']),\n $connection->quoteInto(\"k.parent_id = ?\", $data[$i]['parent_id'])\n );\n }\n $select->where(implode(\" OR \", $or_where));\n\n $connection->query($select->deleteFromSelect(\"k\"));\n\n $skipped_count = count($skipped_record_ids);\n if ($skipped_count > 0) {\n return sprintf(\"%d product%s failed (%s)\",\n $skipped_count,\n ($skipped_count > 1) ? \"s\" : \"\",\n implode(\", \", $skipped_records[\"messages\"])\n );\n } else {\n return true;\n }\n } else {\n return sprintf(\"%d product%s failed (%s)\",\n $total,\n ($total > 1) ? \"s\" : \"\",\n $response->getMessage()\n );\n }\n }",
"public function productSizesIdProductsFkDelete($id, $fk)\n {\n list($response) = $this->productSizesIdProductsFkDeleteWithHttpInfo($id, $fk);\n return $response;\n }",
"public function deleted(Products $products);",
"public function teamBuilderConfigsIdProductGroupsFkDeleteWithHttpInfo($id, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductGroupsFkDelete');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling teamBuilderConfigsIdProductGroupsFkDelete');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/productGroups/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\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 API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/TeamBuilderConfigs/{id}/productGroups/{fk}'\n );\n\n return array(null, $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n }",
"public function teamBuilderConfigProductSizesPostWithHttpInfo($data = null)\n {\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigProductSizes\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\TeamBuilderConfigProductSize',\n '/TeamBuilderConfigProductSizes'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\TeamBuilderConfigProductSize', $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\\TeamBuilderConfigProductSize', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function productSizesIdProductsPost($id, $data = null)\n {\n list($response) = $this->productSizesIdProductsPostWithHttpInfo($id, $data);\n return $response;\n }",
"public function teamMembersIdTeamProductSizeMaterialsFkDeleteWithHttpInfo($id, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamMembersIdTeamProductSizeMaterialsFkDelete');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling teamMembersIdTeamProductSizeMaterialsFkDelete');\n }\n // parse inputs\n $resourcePath = \"/TeamMembers/{id}/team/productSizeMaterials/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\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 API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/TeamMembers/{id}/team/productSizeMaterials/{fk}'\n );\n\n return array(null, $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n }",
"public function restPropertiesMultipleOptionsDelete()\n {\n $this->restPropertiesMultipleOptionsDeleteWithHttpInfo();\n }",
"public function tagsIdProductsFkDeleteWithHttpInfo($id, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling tagsIdProductsFkDelete');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling tagsIdProductsFkDelete');\n }\n // parse inputs\n $resourcePath = \"/Tags/{id}/products/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\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 API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/Tags/{id}/products/{fk}'\n );\n\n return array(null, $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n }",
"public function deletePreconfiguredproductsWithHttpInfo($version, $source, $sku = null)\n {\n \n // verify the required parameter 'version' is set\n if ($version === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $version when calling deletePreconfiguredproducts');\n }\n // verify the required parameter 'source' is set\n if ($source === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $source when calling deletePreconfiguredproducts');\n }\n \n // parse inputs\n $resourcePath = \"/v/{version}/source/{source}/preconfiguredproducts/\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n // query params\n \n if ($sku !== null) {\n $queryParams['sku'] = $this->apiClient->getSerializer()->toQueryValue($sku);\n }\n \n // path params\n \n if ($version !== null) {\n $resourcePath = str_replace(\n \"{\" . \"version\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($version),\n $resourcePath\n );\n }// path params\n \n if ($source !== null) {\n $resourcePath = str_replace(\n \"{\" . \"source\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($source),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \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 \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'DELETE',\n $queryParams, $httpBody,\n $headerParams, '\\gooten.api.model\\PreconfiguredProductsInsertResponse'\n );\n \n if (!$response) {\n return array(null, $statusCode, $httpHeader);\n }\n\n return array(\\gooten.api.client\\ObjectSerializer::deserialize($response, '\\gooten.api.model\\PreconfiguredProductsInsertResponse', $httpHeader), $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 200:\n $data = \\gooten.api.client\\ObjectSerializer::deserialize($e->getResponseBody(), '\\gooten.api.model\\PreconfiguredProductsInsertResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n }",
"public function deleted(Products $products)\n {\n //\n }",
"public function deleted(Products $products)\n {\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns tracker hosts array | public function getHosts(){
return $this->trackers;
} | [
"protected function getHosts() : array {}",
"public function hosts() {\n\t\t$res = $this->zap->request($this->zap->base . 'core/view/hosts/');\n\t\treturn reset($res);\n\t}",
"public function hosts() : array {\n }",
"public function getHostnames(): array;",
"public function findHosts(): array;",
"protected function _getHosts()\n {\n return $_SESSION[self::HOST_KEY] ?? [];\n }",
"public function getHosts()\n {\n return $this->repository->findAll();\n }",
"private function getHosts()\n {\n foreach ($this->events as $event) {\n $this->hosts = array_unique(array_merge($this->hosts, array_map(function ($host) { return $host->host_name; }, $event->hosts)));\n }\n }",
"function getAllhosts() {}",
"public function getHosts()\n\t\t{\n\t\t\tglobal $conn;\n\t\t\t\n\t\t\t$get = $conn->prepare(\"SELECT id FROM ITSM_Host WHERE asset = ?\");\n\t\t\t$get->bindParam(1, $this->id);\n\t\t\t$get->execute();\n\t\t\t\n\t\t\t$hosts = [];\n\t\t\t\n\t\t\tforeach($get->fetchAll(\\PDO::FETCH_COLUMN, 0) as $hostId)\n\t\t\t{\n\t\t\t\t$host = new Host($hostId);\n\t\t\t\tif($host->load())\n\t\t\t\t\t$hosts[] = $host;\n\t\t\t}\n\t\t\t\n\t\t\treturn $hosts;\n\t\t}",
"public function getHostnames(): array\n\t{\n\t\treturn $this->hostnames;\n\t}",
"public function getHosts()\n {\n return isset($this->Hosts) ? $this->Hosts : null;\n }",
"public function getHosts() {\n\t\tif (!$this->isValid) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn array_unique(zbx_objectValues($this->expressions, 'host'));\n\t}",
"function getHosts() {\n\t\t$this->error_num = NULL;\n\t\treturn $this->dbInstance->selectQuery(\"SELECT * FROM Host ORDER BY HostName ASC\");\n\t}",
"function ish_get_host_list() {\n\t\tglobal $conf;\n\t\t$host_list = array();\n\t\tif ($conf['db_central_host']) {\n\t\t\treturn ish_get_central_host_list();\n\t\t}\n\t\tforeach (array_keys($conf['hosts']) as $host) {\n\t\t\t$host_config = ish_get_host_config($host);\n\t\t\t$host_list[$host] = $host_config['title'];\n\t\t}\n\t\treturn $host_list;\n\t}",
"public function all_hostnames() {\n\t\treturn $this->hostnames;\n\t}",
"public function getSupportedHosts(): array;",
"public function getHostList()\n {\n $siteaccess = $this->Name;\n $result = array();\n $ini = eZINI::instance();\n $list = $ini->variable( 'SiteAccessSettings', 'HostMatchMapItems' );\n foreach ( $list as $item )\n {\n $e = explode( ';', $item );\n if ( !isset( $e[1] ) or $e[1] != $siteaccess )\n {\n continue;\n }\n\n $result[] = $e[0];\n }\n\n return $result;\n }",
"private function getAllHosts($indicesArr){\n $result = array();\n // echo\"<pre>\";print_r($indicesArr);die;\n foreach($indicesArr as $key=>$value){\n $result[] = $value->es_host;\n }\n return $result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get redactor buttons from system config. | protected function getRedactorButtons($config)
{
$defaultSettings = [
['name' => 'Standard', 'settings' => ['buttons' => ['formatting', 'bold', 'italic', 'link', 'unorderedlist', 'orderedlist', 'html']]],
['name' => 'Basic', 'settings' => ['buttons' => ['bold', 'italic']]],
];
$buttons = collect($this->getSourceYaml('settings/system.yaml')['redactor'] ?? $defaultSettings)
->keyBy('name')
->map(function ($preset) {
return $preset['settings']['buttons'];
})
->get($config['settings'] ?? 'Standard');
return collect($buttons)->keyBy(function ($value) {
return $value;
});
} | [
"public function getEnabledButtons()\n {\n return $this->em->getRepository('Entity:Config')->findConfig()->getEnabledButtons();\n }",
"public static function getMenuButtons()\n {\n return Context::getByKey('menu_buttons');\n }",
"static public function getGlobalButtonsByName()\n {\n if (aTools::$globalButtons === false)\n {\n aTools::$globalButtons = array();\n // We could pass parameters here but it's a simple static thing in this case\n // so the recipients just call back to addGlobalButtons\n sfContext::getInstance()->getEventDispatcher()->notify(new sfEvent(null, 'a.getGlobalButtons', array()));\n }\n $labelOverrides = sfConfig::get('app_a_global_button_labels', null);\n if (is_array($labelOverrides))\n {\n foreach ($labelOverrides as $key => $label)\n {\n if (isset(aTools::$globalButtons[$key]))\n {\n if (is_array($label))\n {\n // i18n\n aTools::$globalButtons[$key]->setLabel($label[aTools::getUserCulture()]);\n }\n else\n {\n aTools::$globalButtons[$key]->setLabel($label);\n }\n }\n }\n }\n return aTools::$globalButtons;\n }",
"public function getPluginButtons() {}",
"public abstract function get_option_buttons();",
"function getButtons() {\n\t\treturn $this->buttons;\n\t}",
"public function getButtons()\n\t{\n\t\t$res = array();\n\t\tif ($this->hasTable() && array_key_exists('Buttons', $this->_tables)) {\n\t\t\t$res = $this->_tables['Buttons'];\n\t\t}\n\t\treturn $res;\n\t}",
"public function getAllButtons()\r\n {\r\n return $this->getStringArray(\"getAllButtons\", array());\r\n }",
"protected function evalToolbarButtons(): array\n {\n $buttons = $this->getConfig('view[toolbarButtons]');\n\n if ($buttons === false) {\n return [];\n }\n elseif (is_string($buttons)) {\n return array_map('trim', explode('|', $buttons));\n }\n elseif (is_array($buttons)) {\n return $buttons;\n }\n\n if ($this->manageMode === 'pivot') {\n return ['add', 'remove'];\n }\n\n switch ($this->relationType) {\n case 'hasMany':\n case 'morphMany':\n return ['create', 'delete'];\n\n case 'morphToMany':\n case 'morphedByMany':\n case 'belongsToMany':\n return ['create', 'add', 'delete', 'remove'];\n\n case 'hasOne':\n case 'morphOne':\n case 'belongsTo':\n return ['create', 'update', 'link', 'delete', 'unlink'];\n\n case 'hasManyThrough':\n return [];\n }\n }",
"public function getSettingButtonDefinitions();",
"function createPreconfiguredButtons(){\n\t\t$buttons = array();\n\t\t\n\t\tif( file_exists( MAB_LIB_DIR . 'preconfigured-buttons.php' ) ){\n\t\t\tinclude_once( MAB_LIB_DIR . 'preconfigured-buttons.php' );\n\t\t}\n\t\t\n\t\tforeach( $buttons as $button ){\n\t\t\t$this->updateSettings( $button, '' );\n\t\t}\n\t}",
"function _rb_get_default_config() {\n\treturn array(\n\t'rb_home'\t\t=> true,\t/* show button on home page */\n\t'rb_single'\t\t=> true,\t/* show button on a single post's page */\n\t'rb_page'\t\t=> true,\t/* show button on a single page */\n\t'rb_category'\t\t=> true,\t/* show button on a category page */\n\t'rb_author'\t\t=> true,\t/* show button on an author's page */\n\t'rb_date'\t\t=> true,\t/* show button on a date-based archive page */\n\t'rb_search'\t\t=> true,\t/* show button on a search result page */\n\t'rb_feed'\t\t=> false,\t/* show button in posts gathered via feeds */\n\n\t'rb_buttonstyle'\t=> '3',\t\t/* reddit button style */\n\t'rb_behaviour'\t\t=> \"auto\",\t/* reddit button post inclusion behaviour */\n\t'rb_vpos'\t\t=> \"top\",\t/* show the button at the top of the post */\n\t'rb_hpos'\t\t=> \"left\",\t/* show the button on the right side */\n\t'rb_postcontrols'\t=> true,\t/* show reddit button controls with posts */\n\t'rb_debug'\t\t=> false,\t/* add debug comments to the output html */\n\t);\n}",
"public function getButtons()\n {\n $registered = $this->safeReadServices('profile_buttons');\n\n return array_map(function ($service) {\n return $this->generateButtonWidget($service);\n }, $registered);\n }",
"public function getButtonConfigInJson()\n {\n $config = array(\n 'buttons' => array(\n 'open' => Mage::helper('abandonment')->__('Select Promotion Rule'),\n 'close' => Mage::helper('abandonment')->__('Close'),\n )\n );\n return Mage::helper('core')->jsonEncode($config);\n }",
"public function reloadButtonArray()\n {\n return $this->module->reloadButtons;\n }",
"public function getFeatureButtons()\n {\n $res = array();\n if ($this->hasTable() && array_key_exists('FeatureButtons', $this->tables)) {\n $res = $this->tables['FeatureButtons']['Entries'];\n }\n return $res;\n }",
"function getButtonStyle();",
"public function getButtonColor()\n {\n return $this->_scopeConfig->getValue('whatsapp/whats_display/button', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }",
"public function get_default_button_labels() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the encryption key to use. | public function setEncryptionKey(Key $key); | [
"public function setKey ($key = '')\n {\n $this->_encryption_key = $key;\n }",
"function set_key($key = '') {\n\t\t$this->encryption_key = $key;\n\t}",
"public function setEncryptionKey(): void\n {\n $encryptionKey = config('multipayment-gateways.flutterwave.encryption_key');\n\n if (! $encryptionKey) {\n return;\n }\n\n $this->encryptionKey = $encryptionKey;\n }",
"public function set_key($key = '')\n {\n $this->encryption_key = $key;\n return $this;\n }",
"public function useEncryption($key)\n {\n $this->encryptor = new \\sb\\Encryption\\ForTransmission($key);\n $this->encryption_key = $key;\n }",
"public function use_encryption($key) {\n\t\t$this->encryptor = new sb_Encryption_ForTransmission($key);\n\t\t$this->encryption_key = $key;\n\t}",
"public function setCryptKey($key) { $this->cryptkey = $key; }",
"public function setKey($key)\n\t{\t\n\t\t$this->aes->setKey($key);\n\t}",
"public function setEncryptionKeyAttribute($value)\n {\n $this->attributes['encryption_key'] = encrypt($value);\n }",
"function setKey($key) {\r\n $this->_key = $key;\r\n }",
"function setKey($key)\n {\n parent::setKey($key);\n\n if (!$this->explicit_key_length) {\n $length = strlen($key);\n switch (true) {\n case $length <= 16:\n $this->key_length = 16;\n break;\n case $length <= 24:\n $this->key_length = 24;\n break;\n default:\n $this->key_length = 32;\n }\n $this->_setEngine();\n }\n }",
"public function setKey($key)\n {\n parent::setKey($key);\n\n if (!$this->explicitKeyLength) {\n $length = strlen($key);\n switch (true) {\n case $length <= 16:\n $this->keySize = 16;\n break;\n case $length <= 24:\n $this->keySize = 24;\n break;\n default:\n $this->keySize = 32;\n }\n $this->setupEngine();\n }\n }",
"function setKey() {\n\t\t$this->key = md5($this->location);\n\t}",
"private function setEncrypter(): void\n {\n $this->encrypter = new Encrypter($this->hashKey, self::CIPHER);\n }",
"function setKey($key)\n {\n $length = $this->explicit_key_length ? $this->key_length : strlen($key);\n if ($length > 8) {\n $key = str_pad(substr($key, 0, 24), 24, chr(0));\n // if $key is between 64 and 128-bits, use the first 64-bits as the last, per this:\n // http://php.net/function.mcrypt-encrypt#47973\n $key = $length <= 16 ? substr_replace($key, substr($key, 0, 8), 16) : substr($key, 0, 24);\n } else {\n $key = str_pad($key, 8, chr(0));\n }\n parent::setKey($key);\n\n // And in case of CRYPT_DES_MODE_3CBC:\n // if key <= 64bits we not need the 3 $des to work,\n // because we will then act as regular DES-CBC with just a <= 64bit key.\n // So only if the key > 64bits (> 8 bytes) we will call setKey() for the 3 $des.\n if ($this->mode_3cbc && $length > 8) {\n $this->des[0]->setKey(substr($key, 0, 8));\n $this->des[1]->setKey(substr($key, 8, 8));\n $this->des[2]->setKey(substr($key, 16, 8));\n }\n }",
"function setKey($key)\n\t{\n\t\tparent::setKey($key);\n\n\t\tif (!$this->explicit_key_length) {\n\t\t\t$length = strlen($key);\n\t\t\tswitch (true) {\n\t\t\t\tcase $length <= 16:\n\t\t\t\t\t$this->key_size = 16;\n\t\t\t\t\tbreak;\n\t\t\t\tcase $length <= 20:\n\t\t\t\t\t$this->key_size = 20;\n\t\t\t\t\tbreak;\n\t\t\t\tcase $length <= 24:\n\t\t\t\t\t$this->key_size = 24;\n\t\t\t\t\tbreak;\n\t\t\t\tcase $length <= 28:\n\t\t\t\t\t$this->key_size = 28;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->key_size = 32;\n\t\t\t}\n\t\t\t$this->_setupEngine();\n\t\t}\n\t}",
"public function keyset()\n {\n if (!$this->_Host->isValid()) {\n return;\n }\n $this->_Host->set('productKey', self::encryptpw($_REQUEST['key']));\n if (!$this->_Host->save()) {\n return;\n }\n $Send['keychangesuccess'] = array(\n 'echo Successfully changed key',\n 'sleep 3',\n );\n $this->_parseMe($Send);\n $this->_chainBoot();\n }",
"public static function setKey($key)\n {\n if (strlen($key) > self::MAX_KEY_LENGTH) {\n $key = substr($key, 0, self::MAX_KEY_LENGTH);\n }\n self::$cryptoKey = $key;\n self::$encryptedStrings = array();\n }",
"function set_key ($key)\n {\n $this->_key = $key;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts a widget ID into its id_base and number components. | function wp_parse_widget_id($id)
{
} | [
"function bm_widgetId ($widget) {\n\t\n\tif (!isset ($widget['id'])) {\n\t\t$widget['id'] = $widget['name'];\n\t}\n\n\t$idName = $widget['id'];\n\t$idName = strtolower ($idName);\n\t$idName = str_replace (' ', '-', $idName);\n\n\treturn $idName;\n\t\n}",
"function bb_widgetId ($widget) {\n\tif (!isset($widget['id'])) {\n\t\t$widget['id'] = $widget['name'];\n\t}\n\t$idName = $widget['id'];\n\t$idName = strtolower ($idName);\n\t$idName = str_replace (' ', '-', $idName);\n\treturn $idName;\n}",
"function gutenberg_get_widget_key( $id_base ) {\n\t\tglobal $wp_widget_factory;\n\n\t\tforeach ( $wp_widget_factory->widgets as $key => $widget_object ) {\n\t\t\tif ( $widget_object->id_base === $id_base ) {\n\t\t\t\treturn $key;\n\t\t\t}\n\t\t}\n\n\t\treturn '';\n\t}",
"public static function get_widget_instance_key( $widget_id ) {\n\t\t// Grab all numbers from the end of the id.\n\t\tpreg_match('/(\\d+)$/', $widget_id, $matches );\n\n\t\treturn intval( $matches[0] );\n\t}",
"private function get_widget_id(): string {\n\t\t/**\n\t\t * Widget ID.\n\t\t *\n\t\t * @var string\n\t\t */\n\t\treturn $this->settings->get_setting( $this->settings::SETTING_NAME_MGID_WIDGET_ID );\n\t}",
"public function widgetId()\n {\n $type = $this->outputType();\n switch ($type) {\n case static::PROPERTY_DISPLAY:\n return $this->display()->displayId();\n\n case static::PROPERTY_CONTROL:\n return $this->input()->inputId();\n }\n\n if (!$this->widgetId) {\n $this->widgetId = 'widget_'.uniqid();\n }\n\n return $this->widgetId;\n }",
"function et_next_widget_number ( $id_base) {\n\tglobal $wp_registered_widgets;\n\n\t$number\t=\t1;\n\n\n\tforeach ( $wp_registered_widgets as $widget_id => $widget ) {\n\tif ( preg_match( '/' . $id_base . '-([0-9]+)$/', $widget_id, $matches ) )\n\t\t$number = max($number, $matches[1]);\n\t}\n\t$number++;\n\treturn $number;\n}",
"private function initializeWidgetIdentifier() {\n\t\t$widgetIdentifier = ($this->hasArgument('widgetId') ? $this->arguments['widgetId'] : strtolower(str_replace('\\\\', '-', get_class($this))));\n\t\t$this->widgetContext->setWidgetIdentifier($widgetIdentifier);\n\t}",
"private function get_widget_id_base() {\n\t\tif ( isset( $this->item['data']['widget'] ) ) {\n\t\t\treturn $this->item['data']['widget'];\n\t\t}\n\n\t\treturn false;\n\t}",
"public function getNormalizedId()\n\t{\t\t\n\t\t$id = $this->id;\n\t\t\n\t\tif($id < 10)\n\t\t{\n\t\t\treturn 'PKG-000'.$id;\t\t\n\t\t}\n\t\telse if($id >= 10 && $id < 100)\n\t\t{\n\t\t\treturn 'PKG-00'.$id;\n\t\t}\n\t\telse if($id >= 1000 && $id < 1000)\n\t\t{\n\t\t\treturn 'PKG-0'.$id;\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn 'PKG-'.$id;\n\t\t}\n\t}",
"public static function get_last_widget_instance_key_with_id_base( $id_base ) {\n\t\t$similar_widgets = self::get_widgets_with_id_base( $id_base );\n\n\t\tif ( ! empty( $similar_widgets ) ) {\n\t\t\t// If the last widget with the same name is `text-3`, we want `text-4`\n\t\t\tusort( $similar_widgets, __CLASS__ . '::sort_widgets' );\n\n\t\t\t$last_widget = array_pop( $similar_widgets );\n\t\t\t$last_val = intval( self::get_widget_instance_key( $last_widget['id'] ) );\n\n\t\t\treturn $last_val;\n\t\t}\n\n\t\treturn 0;\n\t}",
"protected function get_widget_id_for_cache($widget_id, $scheme = '')\n {\n }",
"public function widgetId()\n {\n return $this->widgetId;\n }",
"static function getUniqueWidgetId() {\n return uniqid(\"id_\");\n }",
"protected function get_control_id( $control_base_id ) {\n\t\t$skin_id = str_replace( '-', '_', $this->get_id() );\n\t\treturn $skin_id . '_' . $control_base_id;\n\t}",
"private function _getWidgetInstanceID($widgetPath) {\n $widgetID = $_POST['w_id'];\n if (!$widgetID && $widgetID !== '0') {\n exit(\"There's no widget instance id (w_id) specified for $widgetPath!\");\n }\n if (Text::stringContains($widgetID, '_')) {\n $widgetID = (int) Text::getSubstringAfter($widgetID, '_');\n }\n return $widgetID;\n }",
"public function prepare_input_id( $id ) {\n\t\treturn \\str_replace( '_', '-', $id );\n\t}",
"public abstract function formatId ($id);",
"public static function get_widget( $id_base ) {\n global $wp_registered_widgets;\n\n foreach ( (array) $wp_registered_widgets as $id => $widget ) {\n if ( isset( $widget['callback'][0] ) && $widget['callback'][0] instanceof WP_Widget ) {\n $widget_instance = $widget['callback'][0];\n\n if ( $widget_instance->id_base === $id_base ) {\n $widget['name'] = $widget_instance->name;\n $widget['id_base'] = $widget_instance->id_base;\n $widget['option_name'] = $widget_instance->option_name;\n $widget['instances'] = 0;\n $widget['sidebars'] = [];\n\n // list the sidebars this widget has instances in, and the instance id's\n foreach ( (array) wp_get_sidebars_widgets() as $sidebar_id => $sidebar_widgets ) {\n foreach ( $sidebar_widgets as $widget_id ) {\n if ( preg_match( \"/({$widget['id_base']}-\\d)/\", $widget_id, $match ) ) {\n if ( ! isset( $widget['sidebars'][ $sidebar_id ] ) ) {\n $widget['sidebars'][ $sidebar_id ] = [];\n }\n\n ++$widget['instances'];\n $widget['sidebars'][ $sidebar_id ][] = $widget_id;\n }\n }\n }\n\n unset( $widget['id'] );\n unset( $widget['params'] );\n unset( $widget['callback'] );\n\n return $widget;\n }\n }\n }\n\n return null;\n }",
"public function getId(){\n\t\t$widget = get_class($this);\n\t\treturn self::getWidgetId($widget, $this->model, $this->type);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns TRUE if an edit form is shown on the page. Used from RequestHandler where a TRUE returnvalue will result in classes etc. being included. | public function isEditFormShown() {} | [
"protected function isEdit()\n {\n\n if ($this->formRequest->is('*/edit')) {\n return true;\n }\n\n return false;\n\n }",
"protected function is_edit_page() {\r\n return false;\r\n }",
"public function is_edit_page() {\n\t\treturn ( ! empty( $_GET[ Plugin::instance()->code_query_var ] ) );\n\t}",
"public function isEditMode()\n {\n // if not bound to some content, return false\n if (!$this->getSiteManager()->getCurrentContent())\n {\n return false;\n }\n\n return $this->userCanEditPages();\n }",
"protected function isPageEdit(): bool\n {\n return in_array($this->display, ['add', 'edit'], true);\n }",
"public function isVisibleInEditView()\n {\n return $this->visible === true\n ||\n (\n is_object($this->visible)\n &&\n optional($this->visible)->edit === true\n );\n }",
"public function is_edit_page() {\n //global $pagenow;\n return true;\n //return in_array( $pagenow, array( 'post.php', 'post-new.php' ) );\n }",
"public function is_edit_page() {\n global $pagenow;\n return ( $pagenow == 'edit-tags.php' );\n }",
"public function is_edit_page() {\n global $pagenow;\n return in_array( $pagenow, array( 'post.php', 'post-new.php' ) );\n }",
"public function isEditButtonVisible()\n {\n return $this->_rootElement->find($this->edit)->isVisible();\n }",
"public function isEditing()\n {\n return $this->getPostvar('atkgridedit', false);\n }",
"function webt_is_edit_mode()\n{\n\t$action_edit = strpos($_SERVER['REQUEST_URI'], 'action=edit');\n\t$post_post = strpos($_SERVER['REQUEST_URI'], 'post.php?post=');\n\t$action_elementor = strpos($_SERVER['REQUEST_URI'], 'action=elementor');\n\n\tif ((($action_elementor !== false) && ($post_post !== false)) || (($action_edit !== false) && ($post_post !== false))) {\n\t\treturn true;\n\t}\n\treturn false;\n}",
"protected function isEditing(): bool\n {\n if (!isset($this->isEditing)) {\n $editing = $this->getRequest()->input('editing');\n\n $this->isEditing = in_array($editing, ['true', true]);\n }\n\n return $this->isEditing;\n }",
"protected function shouldShow()\n {\n return $this->configProvider->isFormEnabled(static::FORM_ID);\n }",
"function woodmart_elementor_is_edit_mode() {\n\t\tif ( ! woodmart_is_elementor_installed() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn Plugin::$instance->editor->is_edit_mode();\n\t}",
"public function hasVisibleFieldsInEditView()\n {\n foreach ($this->fields as $field) {\n if ($field->isEditable()) {\n return true;\n }\n }\n\n return false;\n }",
"function inspiry_is_edit_property() {\n\t\tif ( isset( $_GET[ 'edit_property' ] ) && ! empty( $_GET[ 'edit_property' ] ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isEditAction()\n {\n if (is_array($this->TSFE_EDIT)) {\n if ($this->TSFE_EDIT['cancel']) {\n unset($this->TSFE_EDIT['cmd']);\n } else {\n $cmd = (string)$this->TSFE_EDIT['cmd'];\n if (($cmd !== 'edit' || is_array($this->TSFE_EDIT['data']) && ($this->TSFE_EDIT['doSave'] || $this->TSFE_EDIT['update'] || $this->TSFE_EDIT['update_close'])) && $cmd !== 'new') {\n // $cmd can be a command like \"hide\" or \"move\". If $cmd is \"edit\" or \"new\" it's an indication to show the formfields. But if data is sent with update-flag then $cmd = edit is accepted because edit may be sent because of .keepGoing flag.\n return true;\n }\n }\n }\n return false;\n }",
"public function chkIsEditMode()\n\t\t\t{\n\t\t\t\tif($this->fields_arr['profile_block_id'])\n\t\t\t\t\treturn true;\n\t\t\t\treturn false;\n\t\t\t}",
"public function is_edit_profile_field_definition_screen() {\n\n\t\treturn self::SCREEN_ACTION_EDIT === $this->get_admin_screen_action() && null !== $this->get_admin_screen_profile_field_definition();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all available search servers. | function drush_search_api_server_list() {
/** @var \Drupal\search_api\ServerInterface[] $servers */
$servers = Server::loadMultiple();
if (empty($servers)) {
drush_print(dt('There are no servers present.'));
return;
}
$rows[] = [
dt('ID'),
dt('Name'),
dt('Status'),
];
foreach ($servers as $server) {
$rows[] = [
$server->id(),
$server->label(),
$server->status() ? dt('enabled') : dt('disabled'),
];
}
drush_print_table($rows);
} | [
"public function list_servers() {\n\t\t\treturn $this->run( 'servers' );\n\t\t}",
"public function search()\n {\n switch ($this->server->game->Name) {\n case 'BFHL':\n $game = 'bfh';\n break;\n\n default:\n $game = strtolower($this->server->game->Name);\n }\n\n $this->options['q'] = $this->server->ServerName;\n\n $query = http_build_query($this->options);\n\n $uri = sprintf($this->uris['generic']['servers']['server_browser'], $game, $query);\n\n $response = $this->sendRequest($uri);\n\n if (array_key_exists('servers', $response['globalContext'])) {\n return $response['globalContext']['servers'];\n }\n\n return;\n }",
"public function get_all_l2tp_server_server(){\n return $this->query('/interface/l2tp-server/server/getall');\n }",
"public function getAll() {\n\t\t$servers = $this->db->get('servers')->result_array();\n\t\treturn array_map(array($this, \"addAvailability\"), $servers);\n\t}",
"public function listServers()\r\n {\r\n return $this->transformCollection(\r\n $this->get('user')['data'],\r\n Server::class\r\n );\r\n }",
"public function getServersList() {\r\n\t\treturn $this->mInterface->sm_getServers();\r\n\t}",
"public function listSearchEngines()\n {\n try {\n return $this->searchEnginesResource->listSearchEngines();\n } catch (ApiException $e) {\n throw ErrorHandler::create($e->getCode(), $e->getMessage(), $e);\n }\n }",
"function drush_search_api_list() {\n $indexes = search_api_drush_get_indexes();\n if (!$indexes) {\n return;\n }\n\n $rows[] = [\n dt('ID'),\n dt('Name'),\n dt('Server'),\n dt('Type'),\n dt('Status'),\n dt('Limit'),\n ];\n $none = '(' . dt('none') . ')';\n $enabled = dt('enabled');\n $disabled = dt('disabled');\n\n foreach ($indexes as $index) {\n $types = [];\n foreach ($index->getDatasources() as $datasource) {\n $types[] = $datasource->label();\n }\n $rows[] = [\n $index->id(),\n $index->label(),\n $index->getServerId() ? $index->getServerInstance()->label() : $none,\n $types ? implode(', ', $types) : $none,\n $index->status() ? $enabled : $disabled,\n (int) $index->getOption('cron_limit'),\n ];\n }\n\n drush_print_table($rows);\n}",
"public function getAllServerTypes()\n {\n return $this->action('GET', 'server_types');\n }",
"public function getServers()\n {\n }",
"protected function getServers() {\n\t\t$content = ''; $pidCondition = '1=1';\n\t\tif (($key = array_search('-p', $GLOBALS['argv']))) {\n\t\t\tif (t3lib_div::testInt($GLOBALS['argv'][$key + 1])) {\n\t\t\t\t$pidCondition = 'pid=' . $GLOBALS['argv'][$key + 1];\n\t\t\t}\n\t\t}\n\t\t$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_mnogosearch_indexconfig',\n\t\t\t\t\t$pidCondition . t3lib_BEfunc::deleteClause('tx_mnogosearch_indexconfig') /*.\n\t\t\t\t\t\tt3lib_BEfunc::BEenableFields('tx_mnogosearch_indexconfig')*/,\n\t\t\t\t\t'', 'sorting');\n\n\t\t$hasPeriod = false;\n\t\tforeach ($rows as $row) {\n\t\t\t$content .= '# uid=' . $row['uid'] . chr(10);\n\t\t\tif ($row['tx_mnogosearch_period'] != '0' && $row['tx_mnogosearch_period'] != '') {\n\t\t\t\t$content .= 'Period ' .\n\t\t\t\t\t(t3lib_div::testInt($row['tx_mnogosearch_period']) ?\n\t\t\t\t\t\t$row['tx_mnogosearch_period'] . 'h' :\n\t\t\t\t\t\t$row['tx_mnogosearch_period']) . chr(10);\n\t\t\t\t$hasPeriod = true;\n\t\t\t}\n\t\t\telseif (!$hasPeriod) {\n\t\t\t\t$content .= 'Period 10y' . chr(10);\n\t\t\t\t$hasPeriod = true;\n\t\t\t}\n\n\t\t\t// Add any extra config. This must go *before* servers!\n\t\t\tif (trim($row['tx_mnogosearch_additional_config'])) {\n\t\t\t\t$content .= $row['tx_mnogosearch_additional_config'] . chr(10);\n\t\t\t}\n\n\t\t\t// Add servers\n\t\t\tswitch ($row['tx_mnogosearch_type']) {\n\t\t\t\tcase 0:\n\t\t\t\t\t// Server\n\t\t\t\t\t$content .= $this->getServersGetServer($row);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t// Realm\n\t\t\t\t\t$content .= $this->getServersGetRealm($row);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\t// Database table\n\t\t\t\t\t$content .= $this->getServersGetRecords($row);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t@unlink($this->configFileName);\n\t\t\t\t\tdie(sprintf('Unknown configuration type %d for configuration entry with id %d' . chr(10), $row['tx_mnogosearch_type'], $row['uid']));\n\t\t\t}\n\t\t}\n\t\tif ($content == '') {\n\t\t\t@unlink($this->configFileName);\n\t\t\tdie('There is nothing to index. Aborting.');\n\t\t}\n\t\treturn $content;\n\t}",
"public function indexServerTypes()\n {\n return $this->serverService->getServerTypes();\n }",
"public function listSites()\n {\n $list_sites_params = new stdClass();\n $list_sites_params->authentication = $this->auth;\n \n $this->reply = $this->soapClient->listSites( $list_sites_params );\n $this->storeResults( $this->reply->listSitesReturn );\n }",
"public function servers ()\n\t{\n\t\tstatic $loaded = false;\n\t\tif ( $loaded == false )\n\t\t{\n\t\t\t$result = database(DB)->cache ('servers', 'id', '\n\t\t\t\tSELECT\n\t\t\t\t\t`s`.*\n\n\t\t\t\tFROM\n\t\t\t\t\t`servers` `s`\n\n\t\t\t\tINNER JOIN\n\t\t\t\t\t`reports_servers` `rs_1`\n\t\t\t\tON\n\t\t\t\t\t`s`.`id` = `rs_1`.`server_id`\n\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t`reports_servers` `rs_2`\n\t\t\t\tON\n\t\t\t\t\t`rs_1`.`server_id` = `rs_2`.`server_id`\n\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t`reports` `r`\n\t\t\t\tON\n\t\t\t\t\t`r`.`id` = `rs_2`.`report_id`\n\t\t\t\t\tAND\n\t\t\t\t\t`r`.`customer` = ?\n\n\t\t\t\tWHERE\n\t\t\t\t\t`rs_1`.`report_id` = ?\n\n\t\t\t\tGROUP BY\n\t\t\t\t\t`s`.`id`\n\n\t\t\t\tORDER BY\n\t\t\t\t\tCOUNT(`r`.`id`) DESC\n\t\t\t', [ $this->get ('customer'), $this->id () ] );\n\n\t\t\t$servers =& $this->__servers;\n\t\t\t$result->each ( function ( $row ) use ( &$servers )\n\t\t\t{\n\t\t\t\t$servers [] = server::byId ( $row ['id'] );\n\t\t\t});\n\t\t}\n\t}",
"public function list(Request $request)\n {\n /** @var \\Pterodactyl\\Models\\Node $node */\n $node = $request->attributes->get('node');\n\n // Avoid run-away N+1 SQL queries by pre-loading the relationships that are used\n // within each of the services called below.\n $servers = Server::query()->with('allocations', 'egg', 'mounts', 'variables', 'location')\n ->where('node_id', $node->id)\n // If you don't cast this to a string you'll end up with a stringified per_page returned in\n // the metadata, and then Wings will panic crash as a result.\n ->paginate((int) $request->input('per_page', 50));\n\n return new ServerConfigurationCollection($servers);\n }",
"public function servers(): Collection;",
"function eh_info_all_servers()\n\t{\n\t\t$url\t\t= eh_get_api_url().\"servers/info\";\n\t\t$result\t\t= eh_fetch_data($url);\n\t\tif(!$result)\n\t\t\treturn null;\n\t\t$servers\t\t= nl2br(trim($result));\n\t\t$servers\t\t= explode('<br />', str_replace(\"\\n\",\"\",$servers));\n\t\t$results\t\t= array();\n\t\t$data\t\t\t= '';\n\t\tfor($i=0; $i<count($servers); $i++)\n\t\t{\n\t\t\tif($servers[$i] == '' || $i == count($servers)-1)\n\t\t\t{\n\t\t\t\tarray_push($results, $data);\n\t\t\t\t$data = '';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$data\t.= $servers[$i].'|-|';\n\t\t}\n\t\t$return\t= array();\n\t\tfor($i=0; $i<count($results); $i++)\n\t\t{\n\t\t\t$info\t= explode('|-|', $results[$i]);\n\t\t\t$result\t= array();\n\t\t\tfor($j=0; $j<count($info); $j++)\n\t\t\t{\n\t\t\t\tif($info[$j] != '')\n\t\t\t\t{\n\t\t\t\t\t$data\t\t\t\t= explode(' ', $info[$j]);\n\t\t\t\t\t$result[$data[0]]\t= substr($info[$j], strpos($info[$j], ' ')+1);\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t$return[ $result['server'] ]\t= $result;\n\t\t}\n\t\t//var_dump($return);\n\t\treturn $return;\n\t}",
"public function searchServer()\n\t{\n\t\t$server = Input::all();\n\n\t\ttry\n\t\t{\n\t\t\t$server['ip'] = gethostbyname($server['ip']);\n\n\t\t\t$s = new Server($server['ip'], $server['port']);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\treturn $this->jsonResponse(400, false, 'Unable to find server on ' . $server['ip'] . ':' . $server['port'] .' - Error: ' . $e->getMessage());\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$s->validateRconPass($server['rcon']);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\treturn $this->jsonResponse(400, false, 'Invalid RCON password or server is blocking your IP address.');\n\t\t}\n\n\t\t$payload = [\n\t\t\t'server' => $s->info(),\n\t\t\t'options' => $this->options->companionScript(),\n\t\t];\n\n\t\treturn $this->jsonResponse(200, true, 'Server has been found!', $payload);\n\t}",
"public function getConnectedServers();",
"public function getServerList() {\n\n $list = $this->runQueryMysql(\"SELECT * FROM `webinterface_servers`\");\n\n print \"<table style=\\\"width:100%\\\">\n <thead>\n <tr>\n <td><b>Name</b></td>\n <td><b>Total report</b></td>\n <td><b>Complete</b></td>\n <td><b>Waiting</b></td>\n </tr>\n </thead>\";\n\n $num = $list->num_rows;\n\n if($num == 0)\n print \"<tr class=\\\"list-server-table\\\" data-href=\\\"add-server.php\\\">\n <td >No server present, add one?</td>\n <td></td>\n <td></td>\n <td></td>\n </tr>\";\n\n while($row = $list->fetch_array()) {\n\n // Process each row\n // Valori presi dalla tabella `reporter` utilizzando le funzioni pubbliche\n print \"<tr class=\\\"list-server-table\\\" data-href=\\\"view-report.php?server={$row['name']}\\\">\n <td>{$row['name']}</td>\n <td>{$this->getTotalReport($row['name'])}</td>\n <td>{$this->getCompleteReport($row['name'])}</td>\n <td>{$this->getWaitingReport($row['name'])}</td>\n </tr>\";\n\n }\n\n print \"</table>\";\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$terms_arr = explode(' ',$terms); case insensitive in array | function case_in_array($string,$array){
foreach($array as $val){
if(strcasecmp($string, $val) == 0) return true;
}
return false;
} | [
"protected function parseSearchTerms(array $terms)\n {\n $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower';\n $checked = [];\n\n $stopwords = $this->getSearchStopwords();\n\n foreach ($terms as $term) {\n // Keep before/after spaces when term is for exact match.\n if (preg_match('/^\".+\"$/', $term)) {\n $term = trim($term, \"\\\"'\");\n } else {\n $term = trim($term, \"\\\"' \");\n }\n\n // Avoid single A-Z and single dashes.\n if (!$term || (1 === strlen($term) && preg_match('/^[a-z\\-]$/i', $term))) {\n continue;\n }\n\n if (in_array(call_user_func($strtolower, $term), $stopwords, true)) {\n continue;\n }\n\n $checked[] = $term;\n }\n\n return $checked;\n }",
"protected function splitTerms($terms)\n\t{\n\t\t# TODO: NEEDS MORE WORK (add more characters ie tilde n, accented e, a, o, etc)\n\n\t\t# Explicitly make $terms an array.\n\t\t$terms=(array)$terms;\n\n\t\t# Create new array for our output.\n\t\t$out=array();\n\t\t# Create a new array for our alternate terms.\n\t\t$alt_terms=array();\n\t\t# Create a new array for our interim output.\n\t\t$interim_out=array();\n\n\t\t# Define excluded words.\n\t\t$exclude=' the if it to a I but no so of are and';\n\n\t\t# Create a variable to hold the reg ex pattern that finds all pair of double quotes (\").\n\t\t$pattern='/\\\"(.*?)\\\"/';\n\t\t# Create a variable to hold the method call that replaces any whitespaces or commas with a holder token.\n\t\t//$replacement=\"Search::change2Token('\\$1')\";\n\t\t# Find all pair of double quotes (\") and pass their contents to the change2Token() method for processing.\n\t\t$terms=preg_replace_callback(\n\t\t\t$pattern,\n\t\t\tfunction($matches)\n\t\t\t{\n\t\t\t\tforeach($matches as $match)\n\t\t\t\t{\n\t\t\t\t\treturn Search::change2Token($match);\n\t\t\t\t}\n\t\t\t},\n\t\t\t$terms\n\t\t);\n\t\t# Take out parentheses\n\t\t$terms=preg_replace('/\\)|\\(/', '', $terms);\n\n\t\t# Loop through the terms\n\t\tforeach($terms as $term)\n\t\t{\n\t\t\tif(!empty($term))\n\t\t\t{\n\t\t\t\t# Split searchable terms on whitespace and commas and put into an array.\n\t\t\t\t$term=preg_split(\"/\\s+|,/\", $term);\n\t\t\t\tforeach($term as $split)\n\t\t\t\t{\n\t\t\t\t\t# If the term is not in the excluded list add it to the $interim_out array.\n\t\t\t\t\tif(!empty($split) && (strpos($exclude, $split)===FALSE))\n\t\t\t\t\t{\n\t\t\t\t\t\t$interim_out[]=$split;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t# Rename $interim_out as $terms.\n\t\t$terms=$interim_out;\n\n\t\t# Loop through the array.\n\t\tforeach($terms as $term)\n\t\t{\n\t\t\t# For each searchable term, replace the holding tokens with their original contents (whitespace or comma).\n\t\t\t$term=preg_replace_callback(\n\t\t\t\t\"/\\{WHITESPACE-([\\d]+)\\}/\",\n\t\t\t\tfunction($matches)\n\t\t\t\t{\n\t\t\t\t\tforeach($matches as $match)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn chr($match);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t$term\n\t\t\t);\n\t\t\t$term=preg_replace(\"/\\{COMMA\\}/\", \",\", $term);\n\n\t\t\t# If the term is not in the excluded list add it to the $out array.\n\t\t\tif(!empty($term) && (strpos($exclude, $term)===FALSE))\n\t\t\t{\n\t\t\t\t$out[]=$term;\n\t\t\t}\n\t\t}\n\t\t# Loop through the array again.\n\t\tforeach($out as $term)\n\t\t{\n\t\t\t# First, replace HTML entities\n\t\t\t$alt_term=Utility::htmlToText($term, FALSE);\n\n\t\t\tif(!in_array($alt_term, $alt_terms))\n\t\t\t{\n\t\t\t\t$alt_terms[]=$alt_term;\n\t\t\t}\n\n\t\t\t# Reset the search and replace arrays.\n\t\t\t$search=array();\n\t\t\t$replace=array();\n\n\t\t\t# Second, replace with HTML entities\n\t\t\t$dblquote_search=chr(34);\n\t\t\t$search[]='/('.$dblquote_search.')/';\n\t\t\t$snglquote_search=\"'\";\n\t\t\t$search[]='/('.$snglquote_search.')/';\n\t\t\t$dash_search=chr(45);\n\t\t\t$search[]='/('.$dash_search.')/';\n\t\t\t$ampersand_search=chr(38);\n\t\t\t$search[]='/('.$ampersand_search.')/';\n\t\t\t$lessthan_search=chr(60);\n\t\t\t$search[]='/('.$lessthan_search.')/';\n\t\t\t$greaterthan_search=chr(62);\n\t\t\t$search[]='/('.$greaterthan_search.')/';\n\t\t\t$space_search=' ';\n\t\t\t$search[]='/('.$space_search.')/';\n\t\t\t$inverted_exclamation_mark_search='¡';\n\t\t\t$search[]='/('.$inverted_exclamation_mark_search.')/';\n\t\t\t$inverted_question_mark_search='¿';\n\t\t\t$search[]='/('.$inverted_question_mark_search.')/';\n\t\t\t$cent_search='¢';\n\t\t\t$search[]='/('.$cent_search.')/';\n\t\t\t$pound_search='£';\n\t\t\t$search[]='/('.$pound_search.')/';\n\t\t\t$copyright_search='©';\n\t\t\t$search[]='/('.$copyright_search.')/';\n\t\t\t$registered_search='®';\n\t\t\t$search[]='/('.$registered_search.')/';\n\t\t\t$degrees_search='°';\n\t\t\t$search[]='/('.$degrees_search.')/';\n\t\t\t$apostrophe_search=chr(39);\n\t\t\t$search[]='/('.$apostrophe_search.')/';\n\t\t\t$euro_search='€';\n\t\t\t$search[]='/('.$euro_search.')/';\n\t\t\t$umlaut_a_search='ä|a(^(&a(uml|UML)))';\n\t\t\t$search[]='/('.$umlaut_a_search.')/';\n\t\t\t$umlaut_o_search='ö|o(^(&o(uml|UML)))';\n\t\t\t$search[]='/('.$umlaut_o_search.')/';\n\t\t\t$umlaut_u_search='ü|u(^(&u(uml|UML)))';\n\t\t\t$search[]='/('.$umlaut_u_search.')/';\n\t\t\t$umlaut_y_search='ÿ|y(^(&y(uml|UML)))';\n\t\t\t$search[]='/('.$umlaut_y_search.')/';\n\t\t\t$umlaut_A_search='Ä|A(^(&A(uml|UML)))';\n\t\t\t$search[]='/('.$umlaut_A_search.')/';\n\t\t\t$umlaut_O_search='Ö|O(^(&O(uml|UML)))';\n\t\t\t$search[]='/('.$umlaut_O_search.')/';\n\t\t\t$umlaut_U_search='Ü|U(^(&U(uml|UML)))';\n\t\t\t$search[]='/('.$umlaut_U_search.')/';\n\t\t\t$umlaut_Y_search='Ÿ|Y(^(&Y(uml|UML)))';\n\t\t\t$search[]='/('.$umlaut_Y_search.')/';\n\t\t\t$latin_small_letter_sharp_s_search='ß';\n\t\t\t$search[]='/('.$latin_small_letter_sharp_s_search.')/';\n\n\t\t\t$dblquote_replace='“';\n\t\t\t$replace[]=$dblquote_replace;\n\t\t\t$snglquote_replace='‘';\n\t\t\t$replace[]=$snglquote_replace;\n\t\t\t$dash_replace='–';\n\t\t\t$replace[]=$dash_replace;\n\t\t\t$ampersand_replace='&';\n\t\t\t$replace[]=$ampersand_replace;\n\t\t\t$lessthan_replace='<';\n\t\t\t$replace[]=$lessthan_replace;\n\t\t\t$greaterthan_replace='>';\n\t\t\t$replace[]=$greaterthan_replace;\n\t\t\t$space_replace=' ';\n\t\t\t$replace[]=$space_replace;\n\t\t\t$inverted_exclamation_mark_replace='¡';\n\t\t\t$replace[]=$inverted_exclamation_mark_replace;\n\t\t\t$inverted_question_mark_replace='¿';\n\t\t\t$replace[]=$inverted_question_mark_replace;\n\t\t\t$cent_replace='¢';\n\t\t\t$replace[]=$cent_replace;\n\t\t\t$pound_replace='£';\n\t\t\t$replace[]=$pound_replace;\n\t\t\t$copyright_replace='©';\n\t\t\t$replace[]=$copyright_replace;\n\t\t\t$registered_replace='®';\n\t\t\t$replace[]=$registered_replace;\n\t\t\t$degrees_replace='°';\n\t\t\t$replace[]=$degrees_replace;\n\t\t\t$apostrophe_replace=''';\n\t\t\t$replace[]=$apostrophe_replace;\n\t\t\t$euro_replace='€';\n\t\t\t$replace[]=$euro_replace;\n\t\t\t$umlaut_a_replace='ä';\n\t\t\t$replace[]=$umlaut_a_replace;\n\t\t\t$umlaut_o_replace='ö';\n\t\t\t$replace[]=$umlaut_o_replace;\n\t\t\t$umlaut_u_replace='ü';\n\t\t\t$replace[]=$umlaut_u_replace;\n\t\t\t$umlaut_y_replace='ÿ';\n\t\t\t$replace[]=$umlaut_y_replace;\n\t\t\t$umlaut_A_replace='Ä';\n\t\t\t$replace[]=$umlaut_A_replace;\n\t\t\t$umlaut_O_replace='Ö';\n\t\t\t$replace[]=$umlaut_O_replace;\n\t\t\t$umlaut_U_replace='Ü';\n\t\t\t$replace[]=$umlaut_U_replace;\n\t\t\t$umlaut_Y_replace='Ÿ';\n\t\t\t$replace[]=$umlaut_Y_replace;\n\t\t\t$latin_small_letter_sharp_s_replace='ß';\n\t\t\t$replace[]=$latin_small_letter_sharp_s_replace;\n\n\t\t\t$alt_term=preg_replace($search, $replace, $term);\n\t\t\tif(!in_array($alt_term, $alt_terms))\n\t\t\t{\n\t\t\t\t$alt_terms[]=$alt_term;\n\t\t\t}\n\n\t\t\t# Reset the search array.\n\t\t\t$replace=array();\n\n\t\t\t# Third with alternate HTML entities\n\t\t\t$dblquote_replace='“';\n\t\t\t$replace[]=$dblquote_replace;\n\t\t\t$snglquote_replace='‘';\n\t\t\t$replace[]=$snglquote_replace;\n\t\t\t$dash_replace='–';\n\t\t\t$replace[]=$dash_replace;\n\t\t\t$ampersand_replace='&';\n\t\t\t$replace[]=$ampersand_replace;\n\t\t\t$lessthan_replace='<';\n\t\t\t$replace[]=$lessthan_replace;\n\t\t\t$greaterthan_replace='>';\n\t\t\t$replace[]=$greaterthan_replace;\n\t\t\t$space_replace=' ';\n\t\t\t$replace[]=$space_replace;\n\t\t\t$inverted_exclamation_mark_replace='¡';\n\t\t\t$replace[]=$inverted_exclamation_mark_replace;\n\t\t\t$inverted_question_mark_replace='¿';\n\t\t\t$replace[]=$inverted_question_mark_replace;\n\t\t\t$cent_replace='¢';\n\t\t\t$replace[]=$cent_replace;\n\t\t\t$pound_replace='£';\n\t\t\t$replace[]=$pound_replace;\n\t\t\t$copyright_replace='©';\n\t\t\t$replace[]=$copyright_replace;\n\t\t\t$registered_replace='®';\n\t\t\t$replace[]=$registered_replace;\n\t\t\t$degrees_replace='°';\n\t\t\t$replace[]=$degrees_replace;\n\t\t\t$apostrophe_replace=''';\n\t\t\t$replace[]=$apostrophe_replace;\n\t\t\t$euro_replace='€';\n\t\t\t$replace[]=$euro_replace;\n\t\t\t$umlaut_a_replace='&aUML;';\n\t\t\t$replace[]=$umlaut_a_replace;\n\t\t\t$umlaut_o_replace='&oUML;';\n\t\t\t$replace[]=$umlaut_o_replace;\n\t\t\t$umlaut_u_replace='&uUML;';\n\t\t\t$replace[]=$umlaut_u_replace;\n\t\t\t$umlaut_y_replace='&yUML;';\n\t\t\t$replace[]=$umlaut_y_replace;\n\t\t\t$umlaut_A_replace='&AUML;';\n\t\t\t$replace[]=$umlaut_A_replace;\n\t\t\t$umlaut_O_replace='&OUML;';\n\t\t\t$replace[]=$umlaut_O_replace;\n\t\t\t$umlaut_U_replace='&UUML;';\n\t\t\t$replace[]=$umlaut_U_replace;\n\t\t\t$umlaut_Y_replace='&YUML;';\n\t\t\t$replace[]=$umlaut_Y_replace;\n\t\t\t$latin_small_letter_sharp_s_replace='ß';\n\t\t\t$replace[]=$latin_small_letter_sharp_s_replace;\n\n\t\t\t$alt_term=preg_replace($search, $replace, $term);\n\t\t\tif(!in_array($alt_term, $alt_terms))\n\t\t\t{\n\t\t\t\t$alt_terms[]=$alt_term;\n\t\t\t}\n\n\t\t\t# Reset the search and replace arrays.\n\t\t\t$search=array();\n\t\t\t$replace=array();\n\n\t\t\t# Fourth, we do it again\n\t\t\t$dblquote_search=chr(34);\n\t\t\t$search[]='/('.$dblquote_search.')/';\n\t\t\t$snglquote_search=\"'\";\n\t\t\t$search[]='/('.$snglquote_search.')/';\n\t\t\t$dash_search=chr(45);\n\t\t\t$search[]='/('.$dash_search.')/';\n\t\t\t$ampersand_search=chr(38);\n\t\t\t$search[]='/('.$ampersand_search.')/';\n\t\t\t$lessthan_search=chr(60);\n\t\t\t$search[]='/('.$lessthan_search.')/';\n\t\t\t$greaterthan_search=chr(62);\n\t\t\t$search[]='/('.$greaterthan_search.')/';\n\t\t\t$space_search=' ';\n\t\t\t$search[]='/('.$space_search.')/';\n\t\t\t$apostrophe_search=chr(39);\n\t\t\t$search[]='/('.$apostrophe_search.')/';\n\t\t\t$latin_small_letter_sharp_s_search='ß';\n\t\t\t$search[]='/('.$latin_small_letter_sharp_s_search.')/';\n\n\t\t\t$dblquote_replace='”';\n\t\t\t$replace[]=$dblquote_replace;\n\t\t\t$snglquote_replace='’';\n\t\t\t$replace[]=$snglquote_replace;\n\t\t\t$dash_replace='–';\n\t\t\t$replace[]=$dash_replace;\n\t\t\t$ampersand_replace='&';\n\t\t\t$replace[]=$ampersand_replace;\n\t\t\t$lessthan_replace='<';\n\t\t\t$replace[]=$lessthan_replace;\n\t\t\t$greaterthan_replace='>';\n\t\t\t$replace[]=$greaterthan_replace;\n\t\t\t$space_replace=' ';\n\t\t\t$replace[]=$space_replace;\n\t\t\t$apostrophe_replace=''';\n\t\t\t$replace[]=$apostrophe_replace;\n\t\t\t$latin_small_letter_sharp_s_replace='ß';\n\t\t\t$replace[]=$latin_small_letter_sharp_s_replace;\n\n\t\t\t$alt_term=preg_replace($search, $replace, $term);\n\t\t\tif(!in_array($alt_term, $alt_terms))\n\t\t\t{\n\t\t\t\t$alt_terms[]=$alt_term;\n\t\t\t}\n\n\t\t\t# Reset the search and replace arrays.\n\t\t\t$search=array();\n\t\t\t$replace=array();\n\n\t\t\t# Fifth, again.\n\t\t\t$dblquote_search=chr(34);\n\t\t\t$search[]='/('.$dblquote_search.')/';\n\t\t\t$snglquote_search=\"'\";\n\t\t\t$search[]='/('.$snglquote_search.')/';\n\t\t\t$dash_search=chr(45);\n\t\t\t$search[]='/('.$dash_search.')/';\n\t\t\t$ampersand_search=chr(38);\n\t\t\t$search[]='/('.$ampersand_search.')/';\n\t\t\t$lessthan_search=chr(60);\n\t\t\t$search[]='/('.$lessthan_search.')/';\n\t\t\t$greaterthan_search=chr(62);\n\t\t\t$search[]='/('.$greaterthan_search.')/';\n\t\t\t$apostrophe_search=chr(39);\n\t\t\t$search[]='/('.$apostrophe_search.')/';\n\n\t\t\t$dblquote_replace='”';\n\t\t\t$replace[]=$dblquote_replace;\n\t\t\t$snglquote_replace='’';\n\t\t\t$replace[]=$snglquote_replace;\n\t\t\t$dash_replace='—';\n\t\t\t$replace[]=$dash_replace;\n\t\t\t$ampersand_replace='&';\n\t\t\t$replace[]=$ampersand_replace;\n\t\t\t$lessthan_replace='<';\n\t\t\t$replace[]=$lessthan_replace;\n\t\t\t$greaterthan_replace='>';\n\t\t\t$replace[]=$greaterthan_replace;\n\t\t\t$apostrophe_replace=''';\n\t\t\t$replace[]=$apostrophe_replace;\n\n\t\t\t$alt_term=preg_replace($search, $replace, $term);\n\t\t\tif(!in_array($alt_term, $alt_terms))\n\t\t\t{\n\t\t\t\t$alt_terms[]=$alt_term;\n\t\t\t}\n\n\t\t\t# Reset the search and replace arrays.\n\t\t\t$search=array();\n\t\t\t$replace=array();\n\n\t\t\t# Sixth, again\n\t\t\t$dblquote_search=chr(34);\n\t\t\t$search[]='/('.$dblquote_search.')/';\n\t\t\t$dash_search=chr(45);\n\t\t\t$search[]='/('.$dash_search.')/';\n\n\t\t\t$dblquote_replace='"';\n\t\t\t$replace[]=$dblquote_replace;\n\t\t\t$dash_replace='—';\n\t\t\t$replace[]=$dash_replace;\n\n\t\t\t$alt_term=preg_replace($search, $replace, $term);\n\t\t\tif(!in_array($alt_term, $alt_terms))\n\t\t\t{\n\t\t\t\t$alt_terms[]=$alt_term;\n\t\t\t}\n\n\t\t\t# Reset the search and replace arrays.\n\t\t\t$search=array();\n\t\t\t$replace=array();\n\n\t\t\t# Seventh, again\n\t\t\t$dblquote_search=chr(34);\n\t\t\t$search[]='/('.$dblquote_search.')/';\n\t\t\t$dash_search=chr(45);\n\t\t\t$search[]='/('.$dash_search.')/';\n\n\t\t\t$dblquote_replace='"';\n\t\t\t$replace[]=$dblquote_replace;\n\t\t\t$dash_replace='—';\n\t\t\t$replace[]=$dash_replace;\n\n\t\t\t$alt_term=preg_replace($search, $replace, $term);\n\t\t\tif(!in_array($alt_term, $alt_terms))\n\t\t\t{\n\t\t\t\t$alt_terms[]=$alt_term;\n\t\t\t}\n\n\t\t\t# Reset the search and replace arrays.\n\t\t\t$search=array();\n\t\t\t$replace=array();\n\n\t\t\t# Eighth, once again\n\t\t\t$dblquote_search=chr(34);\n\t\t\t$search[]='/('.$dblquote_search.')/';\n\t\t\t$dash_search=chr(45);\n\t\t\t$search[]='/('.$dash_search.')/';\n\n\t\t\t$dblquote_replace='"';\n\t\t\t$replace[]=$dblquote_replace;\n\t\t\t$dash_replace='–';\n\t\t\t$replace[]=$dash_replace;\n\n\t\t\t$alt_term=preg_replace($search, $replace, $term);\n\t\t\tif(!in_array($alt_term, $alt_terms))\n\t\t\t{\n\t\t\t\t$alt_terms[]=$alt_term;\n\t\t\t}\n\n\t\t\t# Reset the search and replace arrays.\n\t\t\t$search=array();\n\t\t\t$replace=array();\n\n\t\t\t# Ninth, again\n\t\t\t$alt_term=preg_replace('/('.chr(34).')/', '"', $term);\n\t\t\tif(!in_array($alt_term, $alt_terms))\n\t\t\t{\n\t\t\t\t$alt_terms[]=$alt_term;\n\t\t\t}\n\n\t\t\t# Tenth, again\n\t\t\t$umlaut_a_search='/a&(^(&a(uml|UML)))/';\n\t\t\t$search[]=$umlaut_a_search;\n\t\t\t$umlaut_o_search='/o&(^(&o(uml|UML)))/';\n\t\t\t$search[]=$umlaut_o_search;\n\t\t\t$umlaut_u_search='/u&(^(&u(uml|UML)))/';\n\t\t\t$search[]=$umlaut_u_search;\n\t\t\t$umlaut_y_search='/y&(^(&y(uml|UML)))/';\n\t\t\t$search[]=$umlaut_y_search;\n\t\t\t$umlaut_A_search='/A&(^(&A(uml|UML)))/';\n\t\t\t$search[]=$umlaut_A_search;\n\t\t\t$umlaut_O_search='/O&(^(&O(uml|UML)))/';\n\t\t\t$search[]=$umlaut_O_search;\n\t\t\t$umlaut_U_search='/U&(^(&U(uml|UML)))/';\n\t\t\t$search[]=$umlaut_U_search;\n\t\t\t$umlaut_Y_search='/Y&(^(&Y(uml|UML)))/';\n\t\t\t$search[]=$umlaut_Y_search;\n\n\t\t\t$umlaut_a_replace='ä';\n\t\t\t$replace[]=$umlaut_a_replace;\n\t\t\t$umlaut_o_replace=\"ö\";\n\t\t\t$replace[]=$umlaut_o_replace;\n\t\t\t$umlaut_u_replace=\"ü\";\n\t\t\t$replace[]=$umlaut_u_replace;\n\t\t\t$umlaut_y_replace=\"ÿ\";\n\t\t\t$replace[]=$umlaut_y_replace;\n\t\t\t$umlaut_A_replace=\"Ä\";\n\t\t\t$replace[]=$umlaut_A_replace;\n\t\t\t$umlaut_O_replace=\"Ö\";\n\t\t\t$replace[]=$umlaut_O_replace;\n\t\t\t$umlaut_U_replace=\"Ü\";\n\t\t\t$replace[]=$umlaut_U_replace;\n\t\t\t$umlaut_Y_replace=\"Ÿ\";\n\t\t\t$replace[]=$umlaut_Y_replace;\n\t\t\t$alt_term=preg_replace($search, $replace, $term);\n\t\t\tif(!in_array($alt_term, $alt_terms))\n\t\t\t{\n\t\t\t\t$alt_terms[]=$alt_term;\n\t\t\t}\n\n\t\t\t# Reset the search and replace arrays.\n\t\t\t$search=array();\n\t\t\t$replace=array();\n\n\t\t\t# Eleventh, again\n\t\t\t$umlaut_a_search='/ä/';\n\t\t\t$search[]=$umlaut_a_search;\n\t\t\t$umlaut_o_search='/ö/';\n\t\t\t$search[]=$umlaut_o_search;\n\t\t\t$umlaut_u_search='/ü/';\n\t\t\t$search[]=$umlaut_u_search;\n\t\t\t$umlaut_y_search='/ÿ/';\n\t\t\t$search[]=$umlaut_y_search;\n\t\t\t$umlaut_A_search='/Ä/';\n\t\t\t$search[]=$umlaut_A_search;\n\t\t\t$umlaut_O_search='/O/';\n\t\t\t$search[]=$umlaut_O_search;\n\t\t\t$umlaut_U_search='/Ü/';\n\t\t\t$search[]=$umlaut_U_search;\n\t\t\t$umlaut_Y_search='/Ÿ/';\n\t\t\t$search[]=$umlaut_Y_search;\n\n\t\t\t$umlaut_a_replace='a';\n\t\t\t$replace[]=$umlaut_a_replace;\n\t\t\t$umlaut_o_replace=\"o\";\n\t\t\t$replace[]=$umlaut_o_replace;\n\t\t\t$umlaut_u_replace=\"u\";\n\t\t\t$replace[]=$umlaut_u_replace;\n\t\t\t$umlaut_y_replace=\"y\";\n\t\t\t$replace[]=$umlaut_y_replace;\n\t\t\t$umlaut_A_replace=\"A\";\n\t\t\t$replace[]=$umlaut_A_replace;\n\t\t\t$umlaut_O_replace=\"Ö\";\n\t\t\t$replace[]=$umlaut_O_replace;\n\t\t\t$umlaut_U_replace=\"U\";\n\t\t\t$replace[]=$umlaut_U_replace;\n\t\t\t$umlaut_Y_replace=\"Y\";\n\t\t\t$replace[]=$umlaut_Y_replace;\n\n\t\t\t$alt_term=preg_replace($search, $replace, $term);\n\t\t\tif(!in_array($alt_term, $alt_terms))\n\t\t\t{\n\t\t\t\t$alt_terms[]=$alt_term;\n\t\t\t}\n\n\t\t\t# Reset the search and replace arrays.\n\t\t\t$search=array();\n\t\t\t$replace=array();\n\n\t\t\t# Twelfth, again\n\t\t\t$umlaut_a_search='/&a(uml|UML);/';\n\t\t\t$search[]=$umlaut_a_search;\n\t\t\t$umlaut_o_search='/&o(uml|UML);/';\n\t\t\t$search[]=$umlaut_o_search;\n\t\t\t$umlaut_u_search='/&u(uml|UML);/';\n\t\t\t$search[]=$umlaut_u_search;\n\t\t\t$umlaut_y_search='/&y(uml|UML);/';\n\t\t\t$search[]=$umlaut_y_search;\n\t\t\t$umlaut_A_search='/&A(uml|UML);/';\n\t\t\t$search[]=$umlaut_A_search;\n\t\t\t$umlaut_O_search='/&O(uml|UML);/';\n\t\t\t$search[]=$umlaut_O_search;\n\t\t\t$umlaut_U_search='/&U(uml|UML);/';\n\t\t\t$search[]=$umlaut_U_search;\n\t\t\t$umlaut_Y_search='/&Y(uml|UML);/';\n\t\t\t$search[]=$umlaut_Y_search;\n\n\t\t\t$umlaut_a_replace='a';\n\t\t\t$replace[]=$umlaut_a_replace;\n\t\t\t$umlaut_o_replace=\"o\";\n\t\t\t$replace[]=$umlaut_o_replace;\n\t\t\t$umlaut_u_replace=\"u\";\n\t\t\t$replace[]=$umlaut_u_replace;\n\t\t\t$umlaut_y_replace=\"y\";\n\t\t\t$replace[]=$umlaut_y_replace;\n\t\t\t$umlaut_A_replace=\"A\";\n\t\t\t$replace[]=$umlaut_A_replace;\n\t\t\t$umlaut_O_replace=\"O\";\n\t\t\t$replace[]=$umlaut_O_replace;\n\t\t\t$umlaut_U_replace=\"U\";\n\t\t\t$replace[]=$umlaut_U_replace;\n\t\t\t$umlaut_Y_replace=\"Y\";\n\t\t\t$replace[]=$umlaut_Y_replace;\n\n\t\t\t$alt_term=preg_replace($search, $replace, $term);\n\t\t\tif(!in_array($alt_term, $alt_terms))\n\t\t\t{\n\t\t\t\t$alt_terms[]=$alt_term;\n\t\t\t}\n\n\t\t\t# Reset the search and replace arrays.\n\t\t\t$search=array();\n\t\t\t$replace=array();\n\n\t\t\t# Thirteenth, again\n\t\t\t$a_search='/a/';\n\t\t\t$search[]=$a_search;\n\t\t\t$o_search='/o/';\n\t\t\t$search[]=$o_search;\n\t\t\t$u_search='/u/';\n\t\t\t$search[]=$u_search;\n\t\t\t$y_search='/y/';\n\t\t\t$search[]=$y_search;\n\t\t\t$A_search='/A/';\n\t\t\t$search[]=$A_search;\n\t\t\t$O_search='/O/';\n\t\t\t$search[]=$O_search;\n\t\t\t$U_search='/U/';\n\t\t\t$search[]=$U_search;\n\t\t\t$Y_search='/Y/';\n\t\t\t$search[]=$Y_search;\n\n\t\t\t$a_replace='ä';\n\t\t\t$replace[]=$a_replace;\n\t\t\t$o_replace=\"ö\";\n\t\t\t$replace[]=$o_replace;\n\t\t\t$u_replace=\"ü\";\n\t\t\t$replace[]=$u_replace;\n\t\t\t$y_replace=\"ÿ\";\n\t\t\t$replace[]=$y_replace;\n\t\t\t$A_replace=\"Ä\";\n\t\t\t$replace[]=$A_replace;\n\t\t\t$O_replace=\"Ö\";\n\t\t\t$replace[]=$O_replace;\n\t\t\t$U_replace=\"Ü\";\n\t\t\t$replace[]=$U_replace;\n\t\t\t$Y_replace=\"Ÿ\";\n\t\t\t$replace[]=$Y_replace;\n\n\t\t\t$alt_term=preg_replace($search, $replace, $term);\n\t\t\tif(!in_array($alt_term, $alt_terms))\n\t\t\t{\n\t\t\t\t$alt_terms[]=$alt_term;\n\t\t\t}\n\t\t}\n\t\t# Loop through the alternate terms.\n\t\tforeach($alt_terms as $alt_term)\n\t\t{\n\t\t\tif(!empty($alt_term) && (strpos($exclude, $alt_term)===FALSE))\n\t\t\t{\n\t\t\t\t# Add the term to the output array ($out).\n\t\t\t\tif(!in_array($alt_term, $out))\n\t\t\t\t{\n\t\t\t\t\t$out[]=$alt_term;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $out;\n\t}",
"protected function splitTerms($terms)\n {\n # TODO: NEEDS MORE WORK (add more characters ie tilde n, accented e, a, o, etc)\n\n # Explicitly make $terms an array.\n $terms = (array)$terms;\n\n # Create new array for our output.\n $out = array();\n # Create a new array for our alternate terms.\n $alt_terms = array();\n # Create a new array for our interim output.\n $interim_out = array();\n\n # Define excluded words.\n $exclude = ' the if it to a I but no so of are and';\n\n # Create a variable to hold the reg ex pattern that finds all pair of double quotes (\").\n $pattern = '/\\\"(.*?)\\\"/';\n # Create a variable to hold the method call that replaces any whitespaces or commas with a holder token.\n //$replacement=\"Search::change2Token('\\$1')\";\n # Find all pair of double quotes (\") and pass their contents to the change2Token() method for processing.\n $terms = preg_replace_callback(\n $pattern,\n function ($matches) {\n foreach ($matches as $match) {\n return Search::change2Token($match);\n }\n },\n $terms\n );\n # Take out parentheses\n $terms = preg_replace('/\\)|\\(/', '', $terms);\n\n # Loop through the terms\n foreach ($terms as $term) {\n if (!empty($term)) {\n # Split searchable terms on whitespace and commas and put into an array.\n $term = preg_split(\"/\\s+|,/\", $term);\n foreach ($term as $split) {\n # If the term is not in the excluded list add it to the $interim_out array.\n if (!empty($split) && (strpos($exclude, $split) === false)) {\n $interim_out[] = $split;\n }\n }\n }\n }\n # Rename $interim_out as $terms.\n $terms = $interim_out;\n\n # Loop through the array.\n foreach ($terms as $term) {\n # For each searchable term, replace the holding tokens with their original contents (whitespace or comma).\n $term = preg_replace_callback(\n \"/\\{WHITESPACE-([\\d]+)\\}/\",\n function ($matches) {\n foreach ($matches as $match) {\n return chr($match);\n }\n },\n $term\n );\n $term = preg_replace(\"/\\{COMMA\\}/\", \",\", $term);\n\n # If the term is not in the excluded list add it to the $out array.\n if (!empty($term) && (strpos($exclude, $term) === false)) {\n $out[] = $term;\n }\n }\n # Loop through the array again.\n foreach ($out as $term) {\n # First, replace HTML entities\n $alt_term = Utility::htmlToText($term, false);\n\n if (!in_array($alt_term, $alt_terms)) {\n $alt_terms[] = $alt_term;\n }\n\n # Reset the search and replace arrays.\n $search = array();\n $replace = array();\n\n # Second, replace with HTML entities\n $dblquote_search = chr(34);\n $search[] = '/(' . $dblquote_search . ')/';\n $snglquote_search = \"'\";\n $search[] = '/(' . $snglquote_search . ')/';\n $dash_search = chr(45);\n $search[] = '/(' . $dash_search . ')/';\n $ampersand_search = chr(38);\n $search[] = '/(' . $ampersand_search . ')/';\n $lessthan_search = chr(60);\n $search[] = '/(' . $lessthan_search . ')/';\n $greaterthan_search = chr(62);\n $search[] = '/(' . $greaterthan_search . ')/';\n $space_search = ' ';\n $search[] = '/(' . $space_search . ')/';\n $inverted_exclamation_mark_search = '¡';\n $search[] = '/(' . $inverted_exclamation_mark_search . ')/';\n $inverted_question_mark_search = '¿';\n $search[] = '/(' . $inverted_question_mark_search . ')/';\n $cent_search = '¢';\n $search[] = '/(' . $cent_search . ')/';\n $pound_search = '£';\n $search[] = '/(' . $pound_search . ')/';\n $copyright_search = '©';\n $search[] = '/(' . $copyright_search . ')/';\n $registered_search = '®';\n $search[] = '/(' . $registered_search . ')/';\n $degrees_search = '°';\n $search[] = '/(' . $degrees_search . ')/';\n $apostrophe_search = chr(39);\n $search[] = '/(' . $apostrophe_search . ')/';\n $euro_search = '€';\n $search[] = '/(' . $euro_search . ')/';\n $umlaut_a_search = 'ä|a(^(&a(uml|UML)))';\n $search[] = '/(' . $umlaut_a_search . ')/';\n $umlaut_o_search = 'ö|o(^(&o(uml|UML)))';\n $search[] = '/(' . $umlaut_o_search . ')/';\n $umlaut_u_search = 'ü|u(^(&u(uml|UML)))';\n $search[] = '/(' . $umlaut_u_search . ')/';\n $umlaut_y_search = 'ÿ|y(^(&y(uml|UML)))';\n $search[] = '/(' . $umlaut_y_search . ')/';\n $umlaut_A_search = 'Ä|A(^(&A(uml|UML)))';\n $search[] = '/(' . $umlaut_A_search . ')/';\n $umlaut_O_search = 'Ö|O(^(&O(uml|UML)))';\n $search[] = '/(' . $umlaut_O_search . ')/';\n $umlaut_U_search = 'Ü|U(^(&U(uml|UML)))';\n $search[] = '/(' . $umlaut_U_search . ')/';\n $umlaut_Y_search = 'Ÿ|Y(^(&Y(uml|UML)))';\n $search[] = '/(' . $umlaut_Y_search . ')/';\n $latin_small_letter_sharp_s_search = 'ß';\n $search[] = '/(' . $latin_small_letter_sharp_s_search . ')/';\n\n $dblquote_replace = '“';\n $replace[] = $dblquote_replace;\n $snglquote_replace = '‘';\n $replace[] = $snglquote_replace;\n $dash_replace = '–';\n $replace[] = $dash_replace;\n $ampersand_replace = '&';\n $replace[] = $ampersand_replace;\n $lessthan_replace = '<';\n $replace[] = $lessthan_replace;\n $greaterthan_replace = '>';\n $replace[] = $greaterthan_replace;\n $space_replace = ' ';\n $replace[] = $space_replace;\n $inverted_exclamation_mark_replace = '¡';\n $replace[] = $inverted_exclamation_mark_replace;\n $inverted_question_mark_replace = '¿';\n $replace[] = $inverted_question_mark_replace;\n $cent_replace = '¢';\n $replace[] = $cent_replace;\n $pound_replace = '£';\n $replace[] = $pound_replace;\n $copyright_replace = '©';\n $replace[] = $copyright_replace;\n $registered_replace = '®';\n $replace[] = $registered_replace;\n $degrees_replace = '°';\n $replace[] = $degrees_replace;\n $apostrophe_replace = ''';\n $replace[] = $apostrophe_replace;\n $euro_replace = '€';\n $replace[] = $euro_replace;\n $umlaut_a_replace = 'ä';\n $replace[] = $umlaut_a_replace;\n $umlaut_o_replace = 'ö';\n $replace[] = $umlaut_o_replace;\n $umlaut_u_replace = 'ü';\n $replace[] = $umlaut_u_replace;\n $umlaut_y_replace = 'ÿ';\n $replace[] = $umlaut_y_replace;\n $umlaut_A_replace = 'Ä';\n $replace[] = $umlaut_A_replace;\n $umlaut_O_replace = 'Ö';\n $replace[] = $umlaut_O_replace;\n $umlaut_U_replace = 'Ü';\n $replace[] = $umlaut_U_replace;\n $umlaut_Y_replace = 'Ÿ';\n $replace[] = $umlaut_Y_replace;\n $latin_small_letter_sharp_s_replace = 'ß';\n $replace[] = $latin_small_letter_sharp_s_replace;\n\n $alt_term = preg_replace($search, $replace, $term);\n if (!in_array($alt_term, $alt_terms)) {\n $alt_terms[] = $alt_term;\n }\n\n # Reset the search array.\n $replace = array();\n\n # Third with alternate HTML entities\n $dblquote_replace = '“';\n $replace[] = $dblquote_replace;\n $snglquote_replace = '‘';\n $replace[] = $snglquote_replace;\n $dash_replace = '–';\n $replace[] = $dash_replace;\n $ampersand_replace = '&';\n $replace[] = $ampersand_replace;\n $lessthan_replace = '<';\n $replace[] = $lessthan_replace;\n $greaterthan_replace = '>';\n $replace[] = $greaterthan_replace;\n $space_replace = ' ';\n $replace[] = $space_replace;\n $inverted_exclamation_mark_replace = '¡';\n $replace[] = $inverted_exclamation_mark_replace;\n $inverted_question_mark_replace = '¿';\n $replace[] = $inverted_question_mark_replace;\n $cent_replace = '¢';\n $replace[] = $cent_replace;\n $pound_replace = '£';\n $replace[] = $pound_replace;\n $copyright_replace = '©';\n $replace[] = $copyright_replace;\n $registered_replace = '®';\n $replace[] = $registered_replace;\n $degrees_replace = '°';\n $replace[] = $degrees_replace;\n $apostrophe_replace = ''';\n $replace[] = $apostrophe_replace;\n $euro_replace = '€';\n $replace[] = $euro_replace;\n $umlaut_a_replace = '&aUML;';\n $replace[] = $umlaut_a_replace;\n $umlaut_o_replace = '&oUML;';\n $replace[] = $umlaut_o_replace;\n $umlaut_u_replace = '&uUML;';\n $replace[] = $umlaut_u_replace;\n $umlaut_y_replace = '&yUML;';\n $replace[] = $umlaut_y_replace;\n $umlaut_A_replace = '&AUML;';\n $replace[] = $umlaut_A_replace;\n $umlaut_O_replace = '&OUML;';\n $replace[] = $umlaut_O_replace;\n $umlaut_U_replace = '&UUML;';\n $replace[] = $umlaut_U_replace;\n $umlaut_Y_replace = '&YUML;';\n $replace[] = $umlaut_Y_replace;\n $latin_small_letter_sharp_s_replace = 'ß';\n $replace[] = $latin_small_letter_sharp_s_replace;\n\n $alt_term = preg_replace($search, $replace, $term);\n if (!in_array($alt_term, $alt_terms)) {\n $alt_terms[] = $alt_term;\n }\n\n # Reset the search and replace arrays.\n $search = array();\n $replace = array();\n\n # Fourth, we do it again\n $dblquote_search = chr(34);\n $search[] = '/(' . $dblquote_search . ')/';\n $snglquote_search = \"'\";\n $search[] = '/(' . $snglquote_search . ')/';\n $dash_search = chr(45);\n $search[] = '/(' . $dash_search . ')/';\n $ampersand_search = chr(38);\n $search[] = '/(' . $ampersand_search . ')/';\n $lessthan_search = chr(60);\n $search[] = '/(' . $lessthan_search . ')/';\n $greaterthan_search = chr(62);\n $search[] = '/(' . $greaterthan_search . ')/';\n $space_search = ' ';\n $search[] = '/(' . $space_search . ')/';\n $apostrophe_search = chr(39);\n $search[] = '/(' . $apostrophe_search . ')/';\n $latin_small_letter_sharp_s_search = 'ß';\n $search[] = '/(' . $latin_small_letter_sharp_s_search . ')/';\n\n $dblquote_replace = '”';\n $replace[] = $dblquote_replace;\n $snglquote_replace = '’';\n $replace[] = $snglquote_replace;\n $dash_replace = '–';\n $replace[] = $dash_replace;\n $ampersand_replace = '&';\n $replace[] = $ampersand_replace;\n $lessthan_replace = '<';\n $replace[] = $lessthan_replace;\n $greaterthan_replace = '>';\n $replace[] = $greaterthan_replace;\n $space_replace = ' ';\n $replace[] = $space_replace;\n $apostrophe_replace = ''';\n $replace[] = $apostrophe_replace;\n $latin_small_letter_sharp_s_replace = 'ß';\n $replace[] = $latin_small_letter_sharp_s_replace;\n\n $alt_term = preg_replace($search, $replace, $term);\n if (!in_array($alt_term, $alt_terms)) {\n $alt_terms[] = $alt_term;\n }\n\n # Reset the search and replace arrays.\n $search = array();\n $replace = array();\n\n # Fifth, again.\n $dblquote_search = chr(34);\n $search[] = '/(' . $dblquote_search . ')/';\n $snglquote_search = \"'\";\n $search[] = '/(' . $snglquote_search . ')/';\n $dash_search = chr(45);\n $search[] = '/(' . $dash_search . ')/';\n $ampersand_search = chr(38);\n $search[] = '/(' . $ampersand_search . ')/';\n $lessthan_search = chr(60);\n $search[] = '/(' . $lessthan_search . ')/';\n $greaterthan_search = chr(62);\n $search[] = '/(' . $greaterthan_search . ')/';\n $apostrophe_search = chr(39);\n $search[] = '/(' . $apostrophe_search . ')/';\n\n $dblquote_replace = '”';\n $replace[] = $dblquote_replace;\n $snglquote_replace = '’';\n $replace[] = $snglquote_replace;\n $dash_replace = '—';\n $replace[] = $dash_replace;\n $ampersand_replace = '&';\n $replace[] = $ampersand_replace;\n $lessthan_replace = '<';\n $replace[] = $lessthan_replace;\n $greaterthan_replace = '>';\n $replace[] = $greaterthan_replace;\n $apostrophe_replace = ''';\n $replace[] = $apostrophe_replace;\n\n $alt_term = preg_replace($search, $replace, $term);\n if (!in_array($alt_term, $alt_terms)) {\n $alt_terms[] = $alt_term;\n }\n\n # Reset the search and replace arrays.\n $search = array();\n $replace = array();\n\n # Sixth, again\n $dblquote_search = chr(34);\n $search[] = '/(' . $dblquote_search . ')/';\n $dash_search = chr(45);\n $search[] = '/(' . $dash_search . ')/';\n\n $dblquote_replace = '"';\n $replace[] = $dblquote_replace;\n $dash_replace = '—';\n $replace[] = $dash_replace;\n\n $alt_term = preg_replace($search, $replace, $term);\n if (!in_array($alt_term, $alt_terms)) {\n $alt_terms[] = $alt_term;\n }\n\n # Reset the search and replace arrays.\n $search = array();\n $replace = array();\n\n # Seventh, again\n $dblquote_search = chr(34);\n $search[] = '/(' . $dblquote_search . ')/';\n $dash_search = chr(45);\n $search[] = '/(' . $dash_search . ')/';\n\n $dblquote_replace = '"';\n $replace[] = $dblquote_replace;\n $dash_replace = '—';\n $replace[] = $dash_replace;\n\n $alt_term = preg_replace($search, $replace, $term);\n if (!in_array($alt_term, $alt_terms)) {\n $alt_terms[] = $alt_term;\n }\n\n # Reset the search and replace arrays.\n $search = array();\n $replace = array();\n\n # Eighth, once again\n $dblquote_search = chr(34);\n $search[] = '/(' . $dblquote_search . ')/';\n $dash_search = chr(45);\n $search[] = '/(' . $dash_search . ')/';\n\n $dblquote_replace = '"';\n $replace[] = $dblquote_replace;\n $dash_replace = '–';\n $replace[] = $dash_replace;\n\n $alt_term = preg_replace($search, $replace, $term);\n if (!in_array($alt_term, $alt_terms)) {\n $alt_terms[] = $alt_term;\n }\n\n # Reset the search and replace arrays.\n $search = array();\n $replace = array();\n\n # Ninth, again\n $alt_term = preg_replace('/(' . chr(34) . ')/', '"', $term);\n if (!in_array($alt_term, $alt_terms)) {\n $alt_terms[] = $alt_term;\n }\n\n # Tenth, again\n $umlaut_a_search = '/a&(^(&a(uml|UML)))/';\n $search[] = $umlaut_a_search;\n $umlaut_o_search = '/o&(^(&o(uml|UML)))/';\n $search[] = $umlaut_o_search;\n $umlaut_u_search = '/u&(^(&u(uml|UML)))/';\n $search[] = $umlaut_u_search;\n $umlaut_y_search = '/y&(^(&y(uml|UML)))/';\n $search[] = $umlaut_y_search;\n $umlaut_A_search = '/A&(^(&A(uml|UML)))/';\n $search[] = $umlaut_A_search;\n $umlaut_O_search = '/O&(^(&O(uml|UML)))/';\n $search[] = $umlaut_O_search;\n $umlaut_U_search = '/U&(^(&U(uml|UML)))/';\n $search[] = $umlaut_U_search;\n $umlaut_Y_search = '/Y&(^(&Y(uml|UML)))/';\n $search[] = $umlaut_Y_search;\n\n $umlaut_a_replace = 'ä';\n $replace[] = $umlaut_a_replace;\n $umlaut_o_replace = \"ö\";\n $replace[] = $umlaut_o_replace;\n $umlaut_u_replace = \"ü\";\n $replace[] = $umlaut_u_replace;\n $umlaut_y_replace = \"ÿ\";\n $replace[] = $umlaut_y_replace;\n $umlaut_A_replace = \"Ä\";\n $replace[] = $umlaut_A_replace;\n $umlaut_O_replace = \"Ö\";\n $replace[] = $umlaut_O_replace;\n $umlaut_U_replace = \"Ü\";\n $replace[] = $umlaut_U_replace;\n $umlaut_Y_replace = \"Ÿ\";\n $replace[] = $umlaut_Y_replace;\n $alt_term = preg_replace($search, $replace, $term);\n if (!in_array($alt_term, $alt_terms)) {\n $alt_terms[] = $alt_term;\n }\n\n # Reset the search and replace arrays.\n $search = array();\n $replace = array();\n\n # Eleventh, again\n $umlaut_a_search = '/ä/';\n $search[] = $umlaut_a_search;\n $umlaut_o_search = '/ö/';\n $search[] = $umlaut_o_search;\n $umlaut_u_search = '/ü/';\n $search[] = $umlaut_u_search;\n $umlaut_y_search = '/ÿ/';\n $search[] = $umlaut_y_search;\n $umlaut_A_search = '/Ä/';\n $search[] = $umlaut_A_search;\n $umlaut_O_search = '/O/';\n $search[] = $umlaut_O_search;\n $umlaut_U_search = '/Ü/';\n $search[] = $umlaut_U_search;\n $umlaut_Y_search = '/Ÿ/';\n $search[] = $umlaut_Y_search;\n\n $umlaut_a_replace = 'a';\n $replace[] = $umlaut_a_replace;\n $umlaut_o_replace = \"o\";\n $replace[] = $umlaut_o_replace;\n $umlaut_u_replace = \"u\";\n $replace[] = $umlaut_u_replace;\n $umlaut_y_replace = \"y\";\n $replace[] = $umlaut_y_replace;\n $umlaut_A_replace = \"A\";\n $replace[] = $umlaut_A_replace;\n $umlaut_O_replace = \"Ö\";\n $replace[] = $umlaut_O_replace;\n $umlaut_U_replace = \"U\";\n $replace[] = $umlaut_U_replace;\n $umlaut_Y_replace = \"Y\";\n $replace[] = $umlaut_Y_replace;\n\n $alt_term = preg_replace($search, $replace, $term);\n if (!in_array($alt_term, $alt_terms)) {\n $alt_terms[] = $alt_term;\n }\n\n # Reset the search and replace arrays.\n $search = array();\n $replace = array();\n\n # Twelfth, again\n $umlaut_a_search = '/&a(uml|UML);/';\n $search[] = $umlaut_a_search;\n $umlaut_o_search = '/&o(uml|UML);/';\n $search[] = $umlaut_o_search;\n $umlaut_u_search = '/&u(uml|UML);/';\n $search[] = $umlaut_u_search;\n $umlaut_y_search = '/&y(uml|UML);/';\n $search[] = $umlaut_y_search;\n $umlaut_A_search = '/&A(uml|UML);/';\n $search[] = $umlaut_A_search;\n $umlaut_O_search = '/&O(uml|UML);/';\n $search[] = $umlaut_O_search;\n $umlaut_U_search = '/&U(uml|UML);/';\n $search[] = $umlaut_U_search;\n $umlaut_Y_search = '/&Y(uml|UML);/';\n $search[] = $umlaut_Y_search;\n\n $umlaut_a_replace = 'a';\n $replace[] = $umlaut_a_replace;\n $umlaut_o_replace = \"o\";\n $replace[] = $umlaut_o_replace;\n $umlaut_u_replace = \"u\";\n $replace[] = $umlaut_u_replace;\n $umlaut_y_replace = \"y\";\n $replace[] = $umlaut_y_replace;\n $umlaut_A_replace = \"A\";\n $replace[] = $umlaut_A_replace;\n $umlaut_O_replace = \"O\";\n $replace[] = $umlaut_O_replace;\n $umlaut_U_replace = \"U\";\n $replace[] = $umlaut_U_replace;\n $umlaut_Y_replace = \"Y\";\n $replace[] = $umlaut_Y_replace;\n\n $alt_term = preg_replace($search, $replace, $term);\n if (!in_array($alt_term, $alt_terms)) {\n $alt_terms[] = $alt_term;\n }\n\n # Reset the search and replace arrays.\n $search = array();\n $replace = array();\n\n # Thirteenth, again\n $a_search = '/a/';\n $search[] = $a_search;\n $o_search = '/o/';\n $search[] = $o_search;\n $u_search = '/u/';\n $search[] = $u_search;\n $y_search = '/y/';\n $search[] = $y_search;\n $A_search = '/A/';\n $search[] = $A_search;\n $O_search = '/O/';\n $search[] = $O_search;\n $U_search = '/U/';\n $search[] = $U_search;\n $Y_search = '/Y/';\n $search[] = $Y_search;\n\n $a_replace = 'ä';\n $replace[] = $a_replace;\n $o_replace = \"ö\";\n $replace[] = $o_replace;\n $u_replace = \"ü\";\n $replace[] = $u_replace;\n $y_replace = \"ÿ\";\n $replace[] = $y_replace;\n $A_replace = \"Ä\";\n $replace[] = $A_replace;\n $O_replace = \"Ö\";\n $replace[] = $O_replace;\n $U_replace = \"Ü\";\n $replace[] = $U_replace;\n $Y_replace = \"Ÿ\";\n $replace[] = $Y_replace;\n\n $alt_term = preg_replace($search, $replace, $term);\n if (!in_array($alt_term, $alt_terms)) {\n $alt_terms[] = $alt_term;\n }\n }\n # Loop through the alternate terms.\n foreach ($alt_terms as $alt_term) {\n if (!empty($alt_term) && (strpos($exclude, $alt_term) === false)) {\n # Add the term to the output array ($out).\n if (!in_array($alt_term, $out)) {\n $out[] = $alt_term;\n }\n }\n }\n\n return $out;\n }",
"function prepareSearchTerms($terms) {\n $terms = ucwords($terms); // Capitalise each word.\n return $terms;\n}",
"function filter_stops($words)\n{\n global $stopwords;\n $f = array();\n $wds = explode(\" \", $words); //convert string to array\n foreach ($wds as $wrd)\n {\n $wrd_lower = strtolower($wrd);\n if (!isset($stopwords[$wrd_lower]))\n {\n if (!in_array($wrd_lower, $f))\n {\n array_push($f, $wrd_lower);\n }\n }\n }\n return ($f);\n}",
"function split_keywords(&$keywords, $terms)\n\t{\n\t\tglobal $config, $user;\n\n\t\tif ($terms == 'all')\n\t\t{\n\t\t\t$match\t\t= array('#\\sand\\s#iu', '#\\sor\\s#iu', '#\\snot\\s#iu', '#\\+#', '#-#', '#\\|#');\n\t\t\t$replace\t= array(' +', ' |', ' -', ' +', ' -', ' |');\n\n\t\t\t$keywords = preg_replace($match, $replace, $keywords);\n\t\t}\n\n\t\t// Filter out as above\n\t\t$split_keywords = preg_replace(\"#[\\n\\r\\t]+#\", ' ', trim(htmlspecialchars_decode($keywords)));\n\n\t\t// Split words\n\t\tif ($this->pcre_properties)\n\t\t{\n\t\t\t$split_keywords = preg_replace('#([^\\p{L}\\p{N}\\'*\"()])#u', '$1$1', str_replace('\\'\\'', '\\' \\'', trim($split_keywords)));\n\t\t}\n\t\telse if ($this->mbstring_regex)\n\t\t{\n\t\t\t$split_keywords = mb_ereg_replace('([^\\w\\'*\"()])', '\\\\1\\\\1', str_replace('\\'\\'', '\\' \\'', trim($split_keywords)));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$split_keywords = preg_replace('#([^\\w\\'*\"()])#u', '$1$1', str_replace('\\'\\'', '\\' \\'', trim($split_keywords)));\n\t\t}\n\n\t\tif ($this->pcre_properties)\n\t\t{\n\t\t\t$matches = array();\n\t\t\tpreg_match_all('#(?:[^\\p{L}\\p{N}*\"()]|^)([+\\-|]?(?:[\\p{L}\\p{N}*\"()]+\\'?)*[\\p{L}\\p{N}*\"()])(?:[^\\p{L}\\p{N}*\"()]|$)#u', $split_keywords, $matches);\n\t\t\t$this->split_words = $matches[1];\n\t\t}\n\t\telse if ($this->mbstring_regex)\n\t\t{\n\t\t\tmb_ereg_search_init($split_keywords, '(?:[^\\w*\"()]|^)([+\\-|]?(?:[\\w*\"()]+\\'?)*[\\w*\"()])(?:[^\\w*\"()]|$)');\n\n\t\t\twhile (($word = mb_ereg_search_regs()))\n\t\t\t{\n\t\t\t\t$this->split_words[] = $word[1];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$matches = array();\n\t\t\tpreg_match_all('#(?:[^\\w*\"()]|^)([+\\-|]?(?:[\\w*\"()]+\\'?)*[\\w*\"()])(?:[^\\w*\"()]|$)#u', $split_keywords, $matches);\n\t\t\t$this->split_words = $matches[1];\n\t\t}\n\n\t\t// We limit the number of allowed keywords to minimize load on the database\n\t\tif ($config['max_num_search_keywords'] && sizeof($this->split_words) > $config['max_num_search_keywords'])\n\t\t{\n\t\t\ttrigger_error($user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', $config['max_num_search_keywords'], sizeof($this->split_words)));\n\t\t}\n\n\t\t// to allow phrase search, we need to concatenate quoted words\n\t\t$tmp_split_words = array();\n\t\t$phrase = '';\n\t\tforeach ($this->split_words as $word)\n\t\t{\n\t\t\tif ($phrase)\n\t\t\t{\n\t\t\t\t$phrase .= ' ' . $word;\n\t\t\t\tif (strpos($word, '\"') !== false && substr_count($word, '\"') % 2 == 1)\n\t\t\t\t{\n\t\t\t\t\t$tmp_split_words[] = $phrase;\n\t\t\t\t\t$phrase = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (strpos($word, '\"') !== false && substr_count($word, '\"') % 2 == 1)\n\t\t\t{\n\t\t\t\t$phrase = $word;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tmp_split_words[] = $word . ' ';\n\t\t\t}\n\t\t}\n\t\tif ($phrase)\n\t\t{\n\t\t\t$tmp_split_words[] = $phrase;\n\t\t}\n\n\t\t$this->split_words = $tmp_split_words;\n\n\t\tunset($tmp_split_words);\n\t\tunset($phrase);\n\n\t\tforeach ($this->split_words as $i => $word)\n\t\t{\n\t\t\t$clean_word = preg_replace('#^[+\\-|\"]#', '', $word);\n\n\t\t\t// check word length\n\t\t\t$clean_len = utf8_strlen(str_replace('*', '', $clean_word));\n\t\t\tif (($clean_len < $config['fulltext_mysql_min_word_len']) || ($clean_len > $config['fulltext_mysql_max_word_len']))\n\t\t\t{\n\t\t\t\t$this->common_words[] = $word;\n\t\t\t\tunset($this->split_words[$i]);\n\t\t\t}\n\t\t}\n\n\t\tif ($terms == 'any')\n\t\t{\n\t\t\t$this->search_query = '';\n\t\t\tforeach ($this->split_words as $word)\n\t\t\t{\n\t\t\t\tif ((strpos($word, '+') === 0) || (strpos($word, '-') === 0) || (strpos($word, '|') === 0))\n\t\t\t\t{\n\t\t\t\t\t$word = substr($word, 1);\n\t\t\t\t}\n\t\t\t\t$this->search_query .= $word . ' ';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->search_query = '';\n\t\t\tforeach ($this->split_words as $word)\n\t\t\t{\n\t\t\t\tif ((strpos($word, '+') === 0) || (strpos($word, '-') === 0))\n\t\t\t\t{\n\t\t\t\t\t$this->search_query .= $word . ' ';\n\t\t\t\t}\n\t\t\t\telse if (strpos($word, '|') === 0)\n\t\t\t\t{\n\t\t\t\t\t$this->search_query .= substr($word, 1) . ' ';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->search_query .= '+' . $word . ' ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->search_query = utf8_htmlspecialchars($this->search_query);\n\n\t\tif ($this->search_query)\n\t\t{\n\t\t\t$this->split_words = array_values($this->split_words);\n\t\t\tsort($this->split_words);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function build_highlight_array($terms)\n{\n\tglobal $mybb;\n\n\tif($mybb->settings['minsearchword'] < 1)\n\t{\n\t\t$mybb->settings['minsearchword'] = 3;\n\t}\n\n\tif(is_array($terms))\n\t{\n\t\t$terms = implode(' ', $terms);\n\t}\n\n\t// Strip out any characters that shouldn't be included\n\t$bad_characters = array(\n\t\t\"(\",\n\t\t\")\",\n\t\t\"+\",\n\t\t\"-\",\n\t\t\"~\"\n\t);\n\t$terms = str_replace($bad_characters, '', $terms);\n\n\t// Check if this is a \"series of words\" - should be treated as an EXACT match\n\tif(my_strpos($terms, \"\\\"\") !== false)\n\t{\n\t\t$inquote = false;\n\t\t$terms = explode(\"\\\"\", $terms);\n\t\t$words = array();\n\t\tforeach($terms as $phrase)\n\t\t{\n\t\t\t$phrase = htmlspecialchars_uni($phrase);\n\t\t\tif($phrase != \"\")\n\t\t\t{\n\t\t\t\tif($inquote)\n\t\t\t\t{\n\t\t\t\t\t$words[] = trim($phrase);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$split_words = preg_split(\"#\\s{1,}#\", $phrase, -1);\n\t\t\t\t\tif(!is_array($split_words))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tforeach($split_words as $word)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!$word || strlen($word) < $mybb->settings['minsearchword'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$words[] = trim($word);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$inquote = !$inquote;\n\t\t}\n\t}\n\t// Otherwise just a simple search query with no phrases\n\telse\n\t{\n\t\t$terms = htmlspecialchars_uni($terms);\n\t\t$split_words = preg_split(\"#\\s{1,}#\", $terms, -1);\n\t\tif(is_array($split_words))\n\t\t{\n\t\t\tforeach($split_words as $word)\n\t\t\t{\n\t\t\t\tif(!$word || strlen($word) < $mybb->settings['minsearchword'])\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$words[] = trim($word);\n\t\t\t}\n\t\t}\n\t}\n\n\tif(!is_array($words))\n\t{\n\t\treturn false;\n\t}\n\n\t// Sort the word array by length. Largest terms go first and work their way down to the smallest term.\n\t// This resolves problems like \"test tes\" where \"tes\" will be highlighted first, then \"test\" can't be highlighted because of the changed html\n\tusort($words, 'build_highlight_array_sort');\n\n\t// Loop through our words to build the PREG compatible strings\n\tforeach($words as $word)\n\t{\n\t\t$word = trim($word);\n\n\t\t$word = my_strtolower($word);\n\n\t\t// Special boolean operators should be stripped\n\t\tif($word == \"\" || $word == \"or\" || $word == \"not\" || $word == \"and\")\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Now make PREG compatible\n\t\t$find = \"#(?!<.*?)(\".preg_quote($word, \"#\").\")(?![^<>]*?>)#ui\";\n\t\t$replacement = \"<span class=\\\"highlight\\\" style=\\\"padding-left: 0px; padding-right: 0px;\\\">$1</span>\";\n\t\t$highlight_cache[$find] = $replacement;\n\t}\n\n\treturn $highlight_cache;\n}",
"private static function normalizeSearchTerms(array $searchTerms): array\n {\n // Normalize user input, note that this support array and string formats on value\n array_walk($searchTerms, static fn (array $terms): array => array_unique(array_values(array_filter($terms))));\n\n return $searchTerms;\n }",
"function get_capitalized_words($text){\n//this is a preliminary step to try and reduce the load on the abbreviator\n//who gets hints about abbreviations from capitalization\n//The first pass considers capitalized words ending with spaces\n//return and the like to avoid numerals such II I and short words such as\n//A PROGRAM TO CAPTURE THEM\n//I is treated as a special case\n$pattern='/\\b([[:upper:]-\\&\\d]{3,})[\\s\\(\\)\\,\\.]/sx';\npreg_match_all($pattern,$text,$upper);\n//$values=array_unique($values);\necho_array($upper);\nreturn $upper[1];\n}",
"public function search(array $terms = array());",
"function getTermVector($term)\n{\n\tif (strstr($term,','))\n\t{\n\t\t$tmp_vector=explode($term,',');\n\t} \n\telse \tif (strstr($term,' or '))\n\t{\n\t\t$tmp_vector=explode($term,' or ');\n\t} \n\telse \tif (strstr($term,' and '))\n\t{\n\t\t$tmp_vector=explode($term,' and ');\n\t} \n\telse $tmp_vector=array($term);\n\t\n\tforeach($tmp_vector as $t)\n\t\t$vector[]=trim($t); // clean it a bit\n\t\n\treturn $vector; \n}",
"function highlight_terms($text, $terms) {\n $search = $terms;\n $replace = array();\n\n foreach ($search as $key => $value) {\n $replace[$key] = \"<span class=\\\"highlight\\\">\".$value.\"</span>\";\n }\n if (substr(phpversion(), 0, 1) > 4) { // PHP 4.x doesn't support str_ireplace\n return str_ireplace($search, $replace, $text);\n } else {\n return str_replace($search, $replace, $text);\n }\n}",
"protected function convertTerms2RegEx($terms)\n\t{\n\t\t# Make certain that the passed variable is an array.\n\t\t$terms=(array)$terms;\n\t\t# Create a new array for our output.\n\t\t$out=array();\n\t\t# Loop through the search terms.\n\t\tforeach($terms as $term)\n\t\t{\n\t\t\t# Using the escapeMetaChars method, escape the search term and add it to our output array ($out).\n\t\t\t$out[]=addslashes($this->escapeMetaChars($term));\n\t\t\t//$out[]='[[:<:]]'.addslashes($this->escapeMetaChars($term)).'[[:>:]]';\n\t\t\t//$out[]='%'.addslashes($this->escapeMetaChars($term)).'%';\n\t\t}\n\n\t\treturn $out;\n\t}",
"protected function extractKeywordTerms($src) {\n\n\t\tif (is_array($src)) {\n\t\t\t$terms = array_values($src);\n\t\t}\n\t\telse {\n\t\t\t$terms = array_unique(explode(',', $src));\n\t\t}\n\t\t$terms = array_filter($terms, function($term) { return(strlen($term) > 0);});\n\t\tarray_walk($terms, function(&$term) {\n\t\t\t$term = trim(filter_var($term, FILTER_SANITIZE_STRING));\n\t\t});\n\t\treturn ($terms);\n\t}",
"abstract protected function searchForWords();",
"function ParseKeywords($keywords)\n{\n $keywordList = array();\n $words = preg_split(\"/[^\\w]+/\", $keywords);\n\n foreach($words as $word)\n {\n $checkWord = strtolower($word);\n $first = substr($checkWord, 0, 1);\n if(strlen($checkWord) > 2 && !ctype_digit($first) && !in_array($checkWord, $keywordList))\n {\n array_push($keywordList, $checkWord);\n }\n }\n\n return $keywordList;\n}",
"private function _in_array_insensitive( $str = '', $array = array() )\n\t{\n\t\treturn in_array( strtolower( $str ), array_map( 'strtolower', $array ) );\n\t}",
"function ccl_searchwp_common_words( $terms ) {\n $words_to_keep = array( 'web', 'full' );\n \n $terms = array_diff( $terms, $words_to_keep );\n \n return $terms;\n}",
"private function filter_stopwords($terms)\n\t{\n\t\treturn preg_replace('/\\b('.implode('|',$this->stopwords).')\\b/','',$terms);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the connected property table name. | public function GetPropertyTableNameFrontend()
{
$sTableName = $this->oDefinition->GetFieldtypeConfigKey('connectedTableName');
if (empty($sTableName)) {
if (!empty($this->oDefinition->sqlData['field_default_value'])) {
$sTableName = $this->oDefinition->sqlData['field_default_value'];
}
}
if (empty($sTableName)) {
$sTableName = $this->name;
}
return $sTableName;
} | [
"public function GetConnectedTableName()\n {\n if (!is_null($this->oTableRow) && array_key_exists($this->getTableFieldName(), $this->oTableRow->sqlData)) {\n $sTableName = $this->oTableRow->sqlData[$this->getTableFieldName()];\n } else {\n $sTableName = '';\n }\n if (is_null($sTableName) || empty($sTableName)) {\n $aTables = $this->GetAllowedTables();\n if (count($aTables) > 0) {\n reset($aTables);\n $sTableName = current($aTables);\n } else {\n $sTableName = parent::GetConnectedTableName();\n }\n }\n\n return $sTableName;\n }",
"public function get_table_name();",
"protected function getTableName() {\n\t\treturn '@@' . $this->entity->getEntityTable();\n\t}",
"public static function tableInheritanceTable()\n {\n return static::buildTableName('_properties');\n }",
"public function getAssociationTableName()\n {\n return $this->_associationTableName;\n }",
"public function getTableFullName()\r\n\t{\r\n\t\treturn $this->getTablePrefix() . $this->getTableName();\r\n\t}",
"public function table_name ()\n {\n return $this->app->table_names->entries;\n }",
"public function getTable()\n {\n if($this->entity_name){\n $ret=\"e_\".$this->entity_name;\n return $ret;\n }else{\n return parent::getTable();\n\n }\n }",
"public function getSQLTableName()\n {\n return \"{$this->options['table_prefix']}{$this->name}\";\n }",
"protected function getDestinationTable() {\n return parent::getDestinationTable() . '_' . $this->getBundle();\n }",
"public static function getNameTable() {\r\n \r\n }",
"public static function getNameTable() {\r\n \r\n }",
"public function getTableForDeepRelationship(): string\n {\n return $this->related->getExpressionName();\n }",
"private function getTableName() {\n if ($this->resource) {\n return \"dkan_datastore_{$this->resource->getId()}\";\n }\n else {\n return \"\";\n }\n }",
"function getDBTableName() \n {\n return $this->getValueByFieldName( 'daobj_dbTableName' );\n }",
"private function getTableName(): string\n {\n if (is_null($this->database)) {\n return $this->name;\n }\n return \"$this->database.$this->name\";\n }",
"public function GetSQLNameWithTablePrefix();",
"protected function getJunctionTable(): string\n\t{\n\t\tif($this->junctionTable === null)\n\t\t{\n\t\t\t$tables = [$this->origin->getTable(), $this->model->getTable()];\n\n\t\t\tsort($tables);\n\n\t\t\tif(strpos($tables[1], '.') !== false)\n\t\t\t{\n\t\t\t\t$table = explode('.', $tables[1]);\n\n\t\t\t\t$tables[1] = end($table);\n\t\t\t}\n\n\t\t\t$this->junctionTable = \"{$tables[0]}_{$tables[1]}\";\n\t\t}\n\n\t\treturn $this->junctionTable;\n\t}",
"public function getTablePrefix()\n {\n return $this->tbl_prefix;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Capture PDO error information | private function getPDOError()
{
if ($this->dbh->errorCode() != '00000') {
$arrayError = $this->dbh->errorInfo();
$this->outputError($arrayError[2]);
}
} | [
"public function testPDOErrorInfo()\n {\n $this->assertException(PDOException::class, function () {\n Connection::create('foo:bar');\n }, function (PDOException $exception) {\n $this->assertEquals('', $exception->getQuery());\n $this->assertEquals([], $exception->getValues());\n });\n\n $db = Connection::create('sqlite::memory:');\n $this->assertException(PDOException::class, function () use ($db) {\n $db->select('INCORRECT SQL FOR ERROR', [\n true,\n false,\n null,\n 1234,\n 'short string',\n \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.\",\n new PDOException(),\n fopen('php://temp', 'r'),\n [1, 2, 3]\n ]);\n }, function (PDOException $exception) {\n $this->assertStringEndsWith(\n '; SQL query: (INCORRECT SQL FOR ERROR); bound values: [true, false, null, 1234, \"short string\"'\n . ', \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been'\n . ' t...\", a Finesse\\\\MicroDB\\\\Exceptions\\\\PDOException instance, a resource, [1, 2, 3]]',\n $exception->getMessage()\n );\n $this->assertEquals('INCORRECT SQL FOR ERROR', $exception->getQuery());\n $this->assertCount(9, $exception->getValues());\n $this->assertInstanceOf(\\PDOException::class, $exception->getPrevious());\n });\n }",
"public function pdo()\n\t{\n\t\t$this->error();\n\t}",
"function preparePdo(PDO $pdo)\n{\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n}",
"private function parsePDOError($conn = null) {\n $db = (isset($conn) && !empty($conn) && is_object($conn)) ? $conn : $this->conn;\n $error = $db->errorInfo();\n return \"$error[0][$error[1]]: $error[2]\";\n }",
"function checkForDbError($preparedStatement) {\n\t\t\t$error = $preparedStatement->errorInfo();\n\t\t\tif ($error != null && count($error) > 0 && $error[0] > 0)\n\t\t\t\tdie(\"Insert failed on: $error[2]\");\n\t}",
"protected function throwPDOException() {\n $error_info = $this->dbh->errorInfo();\n // We rebuild a message formatted in the same way as PDO.\n $exception = new PDOException(\"SQLSTATE[\" . $error_info[0] . \"]: General error \" . $error_info[1] . \": \" . $error_info[2]);\n $exception->errorInfo = $error_info;\n throw $exception;\n }",
"function db_message($dbh)\n{\n $e = $dbh->errorInfo();\n return $e[2];\n \n}",
"function pdo_error($report, $action = '', $fetch = 0, $original = null) {\n\tif( bintest($fetch, PDOERROR_MINOR) ) {\n\t\treturn;\n\t}\n\tsql_error($report, $action, true);\n\tthrow new SqlException($report, $action, $original);\n}",
"private function handlePDOException(string $message): void\n {\n echo '<span style=\"color: red\">' . $message . ' </span>';\n }",
"public function testErrorModeException()\n {\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $this->db->exec(\"INSERT INTO testuser (ID, NAME, ADDRESS, COMPANY) VALUES ('BOGUS_PK', 'a', 'b', 'c')\");\n }",
"function databaseConsoleErrorHandler($message, $info){\n if (!error_reporting()) return;\n console::writeLine(\"SQL Error: {$message}\");\n console::writeLine(print_r($info));\n exit;\n}",
"abstract public function sql_error();",
"function log_pdo_db_error ( $php_self = '', $call_id = 0, $db = null, $sql = '' , $params = '' , $method_name = '', $call_style = '', $error = '' ) {\n\t\tif ( !$db ) {\n\t\t\t$db_connect_result = pdo_db_connect ();\n\t\t\tif ( $db_connect_result['rc'] == '1' ) {\n\t\t\t\t$db = $db_connect_result['db'];\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} //!$db\n\t\t\n\t\t$params = serialize( $params );\n\t\t$error_sql = \"INSERT INTO tbl_db_errors ( php_self, call_id, sql_query, params, method_name, call_style, member_id, error ) VALUES ( ?,?,?,?,?,?,?,? )\";\n\t\t$error_params = array( $php_self, $call_id, $sql, $params, $method_name, $call_style, NULL, $error );\n\t\t$stmt = $db->prepare( $error_sql );\n\t\t$stmt->execute( $error_params );\n\t\t$result = $stmt-> rowCount();\n\t\treturn true;\n\t}",
"public function testErrorModeSilent()\n {\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);\n $this->db->exec(\"INSERT INTO testuser (ID, NAME, ADDRESS, COMPANY) VALUES ('BOGUS_PK', 'a', 'b', 'c')\");\n $this->assertTrue(count($this->db->errorInfo()) > 0);\n }",
"protected function verifyPDO() {\n if (!($this->pdo instanceof \\PDO))\n throw new DatabaseInterfaceException(\"PDO object is invalid.\");\n }",
"public function errorInfo()\n {\n return $this->conn->errorInfo();\n }",
"public function log(\\PDOStatement $statement)\n {\n $this->pdoLogger->err($statement);\n }",
"public function testPDOException(): void\n {\n $exception = new MyPDOException('There was an error in the SQL query');\n $exception->queryString = 'SELECT * from poo_query < 5 and :seven';\n $exception->params = ['seven' => 7];\n $ExceptionRenderer = new WebExceptionRenderer($exception);\n $response = $ExceptionRenderer->render();\n\n $this->assertSame(500, $response->getStatusCode());\n $result = (string)$response->getBody();\n $this->assertStringContainsString('Database Error', $result);\n $this->assertStringContainsString('There was an error in the SQL query', $result);\n $this->assertStringContainsString(h('SELECT * from poo_query < 5 and :seven'), $result);\n $this->assertStringContainsString(\"'seven' => (int) 7\", $result);\n }",
"function mail_PDO_error($error_message) {\n // Capture the stack trace to a variable\n ob_start();\n var_dump(debug_backtrace());\n $stack_trace = ob_get_clean();\n\n // Craft and send the email\n $body = $error_message . \"\\r\\n\\r\\n\" . $stack_trace;\n if (array_key_exists('questionUrl', $_REQUEST)) {\n $body = \"Url: \" . $_REQUEST['questionUrl'] . \"\\r\\n\" . $body;\n }\n\n mail($GLOBALS[\"qm_email\"],\n \"[Quest] Database Error!\",\n $body,\n $GLOBALS[\"headers\"]);\n\n // Send the user back to the main page with a message that asks him to contact the Questmaster\n unknown_error();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ this function will follow specific user given params: | public function follow() {
} | [
"function followUser($connection, $user_to_follow) {\n\t$follow = $connection->post(\"friendships/create\", [\"user_id\" => $user_to_follow]);\n}",
"public function follow($user) {\n\t\t$this->redis()->sAdd(\"graph:user:{$this->id}:following\", $user);\n\t\t$this->redis()->sAdd(\"graph:user:$user:followed_by\", $this->id);\n\t}",
"public function doUserFlagging() {\n // User A follows user C.\n $this->drupalLogin($this->userA);\n $this->drupalGet('user/' . $this->userC->id());\n $this->clickLink(t('Follow this user'));\n\n // User B follows user A.\n $this->drupalLogin($this->userB);\n $this->drupalGet('user/' . $this->userA->id());\n $this->clickLink(t('Follow this user'));\n\n // User B also follows user C.\n $this->drupalGet('user/' . $this->userC->id());\n $this->clickLink(t('Follow this user'));\n\n // User C follows no one.\n }",
"function followUser( $id=\"\", $notifications = false,$screenname=\"\" )\r\r\n\t{\r\r\n\r\r\n\t\tif( !in_array( $this->type, array( 'xml','json' ) ) ){\r\r\n\t\t\treturn false;\r\r\n\t\t}\r\r\n\t\tif($id!=\"\"){\r\r\n\r\r\n\t\t\t$request = 'http://twitter.com/friendships/create/' . (int) $id . '.' . $this->type;\r\r\n\t\t}else{\r\r\n\r\r\n\t\t\t$request = 'http://twitter.com/friendships/create/' . $screenname . '.' . $this->type;\r\r\n\t\t}\r\r\n\t\tif( $notifications ){\r\r\n\t\t\t$request .= '?follow=true';\r\r\n\t\t}\r\r\n\t\treturn $this->objectify( $this->process1($request) );\r\r\n\t}",
"public function follow($name) {\n\t\t$this->load->model('Users_model');\n\t\t$this->Users_model->follow($name);\n\t\tredirect('user/view/'.$name, 'refresh'); // Redirect\n\t}",
"function getUserFollowing($params){\n $request_uri = 'users/'.$params['username'].'/following'.$this->format;\n $result = $this->doRequest($this->service_url.$request_uri, $params);\n\n return $result;\n }",
"public function followPost()\n {\n ignore_user_abort(true);\n $user = wp_get_current_user();\n\n if (empty($_POST['postId']) || !$user) {\n wp_die();\n }\n\n $postId = (int)$_POST['postId'];\n $followers = get_post_meta($postId, 'post_followers', true);\n\n if (is_array($followers)) {\n if (array_key_exists($user->ID, $followers)) {\n $followers[$user->ID] = $followers[$user->ID] ? 0 : 1;\n } else {\n $followers[$user->ID] = 1;\n }\n } else {\n $followers = array($user->ID => 1);\n }\n\n update_post_meta($postId, 'post_followers', $followers);\n\n echo('Done');\n wp_die();\n }",
"public function searchUsers($args) {\n try {\n // $social_group = new social_group(7);\n // $args = $social_group->access_token->where('type','twitter')->get()->all_to_array()[0];\n // $args['profile_id'] = 7; \n $user_id = (int)$args['user_id'];\n $user = new User($user_id);\n $access_token_id = $args['id'];\n if (!$user->ifUserHasConfigValue('smart_engage', $access_token_id)) {\n return;\n }\n\n log_message('TASK_DEBUG', __FUNCTION__ . 'Twitter: start search users to follow.'.$this->getDebugInfo($user, $access_token_id));\n\n $date = new DateTime('UTC 00:00:00');\n\n $user_timezone = new DateTimeZone(User_timezone::get_user_timezone($user_id));\n $timezone_offset = $user_timezone->getOffset($date) / 3600;\n\n $twitter = $this->inicializeTwitterSocializer($user_id, $args);\n\n $user_search_keywords = $user->getUserSearchKeywords($args['profile_id']);\n $number_of_added_users = $user->getDateToAddUserTwitter($access_token_id);\n //$max_daily_auto_follow_users_by_search = (int)$user->ifUserHasConfigValue('max_daily_auto_follow_users_by_search', $access_token_id);\n $max_daily_auto_follow_users_by_search = 5;\n $old_date = DateTime::createFromFormat('!Y-m-d', $number_of_added_users->date);\n if (!$number_of_added_users->id) {\n $number_of_added_users->date = $date->format('Y-m-d');\n $number_of_added_users->setUserId($user_id);\n $number_of_added_users->token_id = $access_token_id;\n $number_of_added_users->count = 0;\n } elseif ($old_date < $date) {\n $number_of_added_users = new Number_of_added_users_twitter();\n $number_of_added_users->date = $date->format('Y-m-d');\n $number_of_added_users->setUserId($user_id);\n $number_of_added_users->count = 0;\n $number_of_added_users->token_id = $access_token_id;\n $number_of_added_users->save();\n } elseif($old_date > $date) {\\\n log_message('TASK_SUCCESS', __FUNCTION__ . 'Twitter: '\n . 'Twitter followers already added.'.\"\\n\"\n .$this->getDebugInfo($user, $access_token_id)\n );\n return;\n }\n unset($old_date);\n\n $age_of_account = $user->ifUserHasConfigValue('age_of_account', $access_token_id);\n if(!$age_of_account) {\n $age_of_account = 0;\n } else {\n $age_of_account_splited = preg_split('/,/', $age_of_account);\n if(count($age_of_account_splited)) {\n if(count($age_of_account_splited) > 1) {\n $age_of_account = $age_of_account_splited;\n }\n }\n }\n\n $tweets_count = $user->ifUserHasConfigValue('number_of_tweets', $access_token_id);\n if(!$tweets_count) {\n $tweets_count = 0;\n } else {\n $tweets_count_splited = preg_split('/,/', $tweets_count);\n if(count($tweets_count_splited)) {\n if(count($tweets_count_splited) > 1) {\n $tweets_count = $tweets_count_splited;\n }\n }\n }\n\n foreach($user_search_keywords as $user_search_keyword) {\n $other_field = $user_search_keyword->get_other_fields();\n $query = $twitter->create_query(\n $user_search_keyword->keyword,\n $other_field['include'],\n $other_field['exclude'],\n $user_search_keyword->exact\n );\n $queryArgs = [\n 'min_followers' => $user_search_keyword->min_followers,\n 'max_followers' => $user_search_keyword->max_followers,\n 'max_id' => $user_search_keyword->max_id,\n 'age_of_account' => $age_of_account,\n 'tweets_count' => $tweets_count,\n 'lang' => $other_field['lang']\n ];\n $users = $twitter->search_users($query, $queryArgs);\n $count = 0;\n foreach($users['users'] as $twitter_user_id) {\n if (!$user->isUserHasTwitterFollower($twitter_user_id, $access_token_id)) {\n if (($max_daily_auto_follow_users_by_search\n && $max_daily_auto_follow_users_by_search > $number_of_added_users->count) ||\n !$max_daily_auto_follow_users_by_search) {\n $date = DateTime::createFromFormat('!Y-m-d', $number_of_added_users->date);\n $number_of_added_users->count += 1;\n $number_of_added_users->save();\n $count++;\n } else {\n $date = DateTime::createFromFormat('!Y-m-d', $number_of_added_users->date);\n $date->modify('+1 days');\n $number_of_added_users = new Number_of_added_users_twitter();\n $number_of_added_users->date = $date->format('Y-m-d');\n $number_of_added_users->setUserId($user_id);\n $number_of_added_users->token_id = $access_token_id;\n $number_of_added_users->count = 1;\n $number_of_added_users->save();\n }\n $twitter_follower = new Twitter_follower();\n $twitter_follower->setFollowerId($twitter_user_id);\n $twitter_follower->setUserId($user_id);\n $twitter_follower->setAccessTokenId($access_token_id);\n\n $start_date = clone $date;\n\n $start_date = $start_date->getTimestamp();\n $start_date = $start_date + mt_rand(0,82800);\n $start_date = new DateTime('@'.$start_date);\n\n $end_date = clone $start_date;\n $end_date = $end_date->modify('+1 days');\n //$start_date->modify(($timezone_offset*-1).' hours');\n\n //$end_date = clone $date;\n //$end_date->modify(($timezone_offset*-1).' hours');\n\n // if ($end_date <= $start_date) {\n // $end_date->modify('1 days');\n // }\n\n $twitter_follower->setStartFollowTime(\n $user_search_keyword\n ->getStartDateTime($start_date)\n ->getTimestamp()\n );\n $twitter_follower->setEndFollowTime(\n $user_search_keyword\n ->getEndDateTime($end_date)\n ->getTimestamp()\n );\n unset($start_date);\n unset($end_date);\n $twitter_follower->setNeedFollow(true);\n $twitter_follower->save();\n if($count > 5){\n break;\n }\n }\n }\n log_message('TASK_SUCCESS', __FUNCTION__ . 'Twitter: '\n .'By keywords '.$query.' add '.count($users['users']).' users.'.\"\\n\"\n .$this->getDebugInfo($user, $access_token_id)\n );\n if($user_search_keyword->max_id != $users['max_id']) {\n $user_search_keyword->max_id = $users['max_id'];\n } else {\n $user_search_keyword->max_id = null;\n }\n $user_search_keyword->save();\n }\n } catch (Exception $e) {\n log_message('TASK_ERROR', __FUNCTION__ . $e->getMessage());\n } \n }",
"public function getUserFollowers($userId);",
"function forUser($params = array()) {\n \n if(!isset($params['user_id'])){\n echo \"User ID required\";\n die();\n }\n \n $request = 'shops' . '/' . $params['user_id'] . '/favorers';\n $request .= parent::createURL($params, array('user_id'));\n \n $result = parent::makeRequest($request);\n \n return $result;\n \n }",
"public function followsUser(Request $request, $name)\n { \n // Find user with ID 1\n $user1 = Auth::user();\n\n // Find user with ID 2\n $user2 = User::find($request->userId);\n\n if ($user1 && $user2) {\n $user1->following()->save($user2);\n }\n }",
"public function follow($userId)\n{\n $exist = $this->is_following($userId);\n // confirming that it is not you\n $its_me = $this->id == $userId;\n\n if ($exist || $its_me) {\n // do nothing if already following\n return false;\n } else {\n // follow if not following\n $this->followings()->attach($userId);\n return true;\n }\n}",
"public function followRedirect(): void {\n $this->getScenario()->runStep(new \\Codeception\\Step\\Action('followRedirect', func_get_args()));\n }",
"function findSourcesFollowedByUser($user);",
"public function followNewFollowers($args) {\n $user_id = (int)$args['user_id'];\n $user = new User($user_id);\n $access_token_id = $args['id'];\n if (!$user->ifUserHasConfigValue('auto_follow', $access_token_id)) {\n return;\n }\n\n log_message('TASK_DEBUG', __FUNCTION__ . 'Twitter: start follow new followers.'.$this->getDebugInfo($user, $access_token_id));\n $twitter = $this->inicializeTwitterSocializer($user_id, $args);\n \n /* @var Twitter_follower[] $followers */\n $followers = $user\n ->twitter_follower\n ->where('still_follow', true)\n ->where('need_follow', true)\n ->where('start_follow_time', null)\n ->where('end_follow_time', null)\n ->where('access_token_id', $access_token_id)\n ->get();\n $new_followers_count = 0;\n foreach($followers as $follower) {\n $answer = $twitter->follow($follower->follower_id);\n if ($answer->errors) {\n foreach($answer->errors as $err) {\n log_message('TASK_ERROR', __FUNCTION__ . 'Twitter error: code: '.$err->code.'. Message: ' . $err->message);\n }\n } else {\n $new_followers_count++;\n $follower->setNeedFollow(false);\n $follower->save();\n }\n }\n Social_analytics::updateAnalytics(\n $access_token_id,\n Social_analytics::NEW_FOLLOWING_ANALYTICS_TYPE,\n $new_followers_count\n );\n log_message('TASK_SUCCESS', __FUNCTION__ . 'Twitter: finish follow new followers. Added '\n .$new_followers_count.' users.'.\"\\n\"\n .$this->getDebugInfo($user, $access_token_id)\n );\n\n $data = new DateTime('UTC');\n if (!$user->ifUserHasConfigValue('auto_follow_users_by_search', $access_token_id)) {\n $user->twitter_follower\n ->where('need_follow', true)\n ->where('start_follow_time IS NOT NULL')\n ->where('end_follow_time IS NOT NULL')\n ->where('access_token_id', $access_token_id)\n ->delete();\n $user->number_of_added_users_twitter\n ->where('date >= \\''.$data->format('Y-m-d').'\\'')\n ->delete();\n }\n /* @var Twitter_follower[] $followers */\n $time = $data->getTimestamp();\n $query = $user\n ->twitter_follower\n ->where([\n 'need_follow' => true,\n 'access_token_id' => $access_token_id\n ])\n ->where(\"((start_follow_time <= '{$time}' AND end_follow_time >= '{$time}') OR (start_follow_time = end_follow_time AND end_follow_time < '{$time}'))\");\n $followers = $query->get();\n $new_followers_count = 0;\n foreach($followers as $follower) {\n sleep(1);\n $answer = $twitter->follow($follower->follower_id);\n if ($answer->errors) {\n foreach($answer->errors as $err) {\n log_message('TASK_ERROR', __FUNCTION__ . 'Twitter error: code: '.$err->code.'. Message: ' . $err->message);\n }\n } else {\n $follower->setNeedFollow(false);\n $follower->setUnfollowTime($data->getTimestamp());\n $follower->setStillFollow(false);\n $follower->save();\n\n $new_followers_count++;\n }\n }\n Social_analytics::updateAnalytics(\n $access_token_id,\n Social_analytics::NEW_FOLLOWING_BY_SEARCH_ANALYTICS_TYPE,\n $new_followers_count\n );\n log_message('TASK_SUCCESS', __FUNCTION__ . 'Twitter: finish follow new followers by search. Added '\n .$new_followers_count.' users.'.\"\\n\"\n .$this->getDebugInfo($user, $access_token_id)\n );\n }",
"public function follow($targetUser)\n {\n Argument::i()->test(1, 'string');\n \n // search and replace\n $link = StringType::i($this->link['FOLLOW_USER'])\n ->str_replace(':user', $targetUser)\n ->get();\n \n return $this->putResponse($link);\n }",
"function follow($show_id, $user_id) {\n // Sanitize to be safe\n $show_id = Sanitize::clean($show_id);\n $user_id = Sanitize::clean($user_id);\n\n // Increment the two counts\n $this->id = $show_id;\n $follow_count = $this->read('user_count', $show_id);\n $this->saveField('user_count', $follow_count['Show']['user_count'] + 1);\n\n $shows_count = $this->User->read('show_count', $user_id);\n $this->User->saveField('show_count', $shows_count['User']['show_count'] + 1);\n\n // Mark as followed\n $this->habtmAdd('User', $show_id, $user_id);\n }",
"function neo4j_getFollowers($userID, $skip, $n, $direction = \"\"){\n // Built the Cypher query with named parameters\n //// Differentiate, if people following the user should be matched or otherwise arounf\n if($direction == \"followed_by_user\"){\n // Create a matching clause for people followed by the user\n $query = \"MATCH (u1:User {user_id: {user_id}} )-[:FOLLOWS]->(u:User) \";\n } else {\n $query = \"MATCH (u1:User {user_id: {user_id}} )<-[:FOLLOWS]-(u:User) \";\n }\n $query .= \"WITH u1, u \";\n $query .= \"OPTIONAL MATCH (u1)-[:LIKED]->(w:Workout)<-[:LIKED]-(u) \";\n $query .= \"RETURN u.name, u.user_id, u.confirmed, u.contact, u.visible, u.picPath, u.shortBio, u.gender, count(w) as commonLikes \";\n $query .= \"ORDER BY commonLikes SKIP {pagination} LIMIT {maximum}\";\n\n // Define the named parameters array\n $params = array(\"user_id\" => $userID, \"pagination\" => $skip, \"maximum\" => $n);\n\n // Sending the Cypher query and retrieving the result set\n $resultSet = neo4j_commitQuery($query, $params);\n\n $returnArr = neo4j_mkObj_uProfile($resultSet);\n\n return $returnArr;\n }",
"function follow($leader_id, $follower_id = -1)\n{\n\tglobal $userdata;\n\t\n\tif ($follower_id == -1)\n\t{\n\t\t$follower_id = $userdata['id'];\n\t}\n\t\n\tif ($leader_id == $follower_id)\n\t{\n\t\treturn false;\n\t}\n\t\n\t// check if relationship has already been created \n\tif (is_follow_relationship($leader_id, $follower_id))\n\t{\n\t\treturn false;\n\t}\n\t\n\t$sql = \"INSERT INTO pm_users_follow \n\t\t\t\t\t(user_id, follower_id, date) \n\t\t\tVALUES ('\". $leader_id .\"', '\". $follower_id .\"', '\". time() .\"')\";\n\tif ( ! mysql_query($sql))\n\t{\n\t\treturn false;\n\t}\n\t\n\t// update respective counts for leader and follower \n\t$sql = \"UPDATE pm_users \n\t\t\tSET following_count = following_count + 1 \n\t\t\tWHERE id = '\". $follower_id .\"'\";\n\tmysql_query($sql);\n\t\n\t$sql = \"UPDATE pm_users \n\t\t\tSET followers_count = followers_count + 1 \n\t\t\tWHERE id = '\". $leader_id .\"'\";\n\tmysql_query($sql);\n\t\n\t$activity_id = get_activity_id(array('user_id' => $follower_id, \n\t\t\t\t\t\t\t\t\t\t 'activity_type' => ACT_TYPE_FOLLOW, \n\t\t\t\t\t\t\t\t\t\t 'object_id' => $leader_id, \n\t\t\t\t\t\t\t\t\t\t 'object_type' => ACT_OBJ_USER\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t );\n\t\n\t\n\tif ($activity_id)\n\t{\n\t\tdelete_activity($activity_id);\n\t}\n\t\n\t// notify leader one time only\n\tif ( ! $activity_id)\n\t{\n\t\tfollow_notify_user($leader_id, $follower_id);\n\t}\n\t\n\t// log activity\n\tlog_activity(array(\n\t\t\t\t\t'user_id' => $follower_id,\n\t\t\t\t\t'activity_type' => ACT_TYPE_FOLLOW,\n\t\t\t\t\t'object_id' => $leader_id,\n\t\t\t\t\t'object_type' => ACT_OBJ_USER,\n\t\t\t\t\t'object_data' => fetch_user_advanced($leader_id)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\n\treturn true;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Topic original cluster. Generated from protobuf field string cluster = 2; | public function getCluster()
{
return $this->cluster;
} | [
"public function getAnthosCluster()\n {\n return $this->readOneof(17);\n }",
"public function getCluster();",
"public function getClusterId()\n {\n return isset($this->cluster_id) ? $this->cluster_id : '';\n }",
"public function getOnPremCluster()\n {\n return $this->readOneof(7);\n }",
"public function getClusterID() {\n return $this->_clusterID;\n }",
"public function setCluster($val)\n {\n $this->_propDict[\"cluster\"] = $val;\n return $this;\n }",
"public function getClusterLabel() {\n return $this->_label;\n }",
"public function getDeleteCluster()\n {\n return $this->delete_cluster;\n }",
"public function getClusterName()\n {\n return $this->requestGet('cluster-name');\n }",
"public function setMirrorToCluster($var)\n {\n GPBUtil::checkString($var, True);\n $this->writeOneof(2, $var);\n\n return $this;\n }",
"public function getCluster() {\n $cluster_id = $this->getOption('elasticsearch_cluster', '');\n return empty($cluster_id) ? Cluster::getDefaultCluster() : $cluster_id;\n }",
"public function setCluster($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\ApigeeConnect\\V1\\Cluster::class);\n $this->cluster = $var;\n\n return $this;\n }",
"public function setGkeCluster($var)\n {\n GPBUtil::checkString($var, True);\n $this->gke_cluster = $var;\n\n return $this;\n }",
"public function getCluster(){\n $level = count($this->levels)-1;\n return $this->levels[$level]['clusters'];\n }",
"public function getPrintMarkerClusterUrl() {\r\n\t\tself::$markerClusterNotLoaded = FALSE;\r\n\t\treturn $this->markerClusterUrl;\r\n\t}",
"public function getCluster() : ?ClusterInfo\n {\n return $this->cluster;\n }",
"private function _getClusterId()\n {\n $oConfig = oxRegistry::getConfig();\n $sBaseShop = $oConfig->getBaseShopId();\n $sClusterId = $oConfig->getShopConfVar('sClusterId', $sBaseShop);\n if (!$sClusterId) {\n $oUUIDGenerator = oxNew('oxUniversallyUniqueIdGenerator');\n $sClusterId = $oUUIDGenerator->generate();\n $oConfig->saveShopConfVar(\"str\", 'sClusterId', $sClusterId, $sBaseShop);\n }\n\n return $sClusterId;\n }",
"public function setRequestCluster($cluster) {\n\t\tif (strlen($cluster) > 0) {\n\t\t\t$this->setRequestHeader('X-Cem-Cluster', $cluster);\n\t\t} else {\n\t\t\t$this->removeRequestHeader('X-Cem-Cluster');\n\t\t}\n\t}",
"public function cluster()\n {\n \treturn $this->belongsTo('App\\Model\\Core\\Cluster', 'cluster_id', 'id');\n }",
"public function AssignCluster(){\n\t\t//Euclidean Distance\n\t\t$nearestdistance = array();\n\t\tfor ($i=0; $i < $this->totalObjects; $i++)\n\t\t{\n\t\t\tfor ($k=0; $k < $this->K; $k++)\n\t\t\t{\n\t\t\t\t$distance = 0;\n\t\t\t\tfor ($j=0; $j < $this->totalFeatures; $j++){\n\t\t\t\t\t $dist = $this->objects[$j][$i] - $this->centroids[$k][$j];\n\t\t\t\t\t $distance += ($dist * $dist);\n\t\t\t\t}\n\t\t\t\t$distance = sqrt($distance);\n\t\t\t\tif ($k==0) {\n\t\t\t\t\t$lowest = $distance;\n\t\t\t\t\t$cluster = $k;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif ($distance < $lowest){\n\t\t\t\t\t\t$cluster = $k;\n\t\t\t\t\t\t$lowest = $distance;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$nearestdistance[$i] = $lowest;\n\t\t\t$this->nearestdistance = $nearestdistance;\n\t\t\t$this->clusters[$i] = $cluster;\n\t\t}\n\t\treturn $this->clusters;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The status of the campaign. When a new campaign is added, the status defaults to ENABLED. Generated from protobuf field .google.ads.googleads.v14.enums.CampaignStatusEnum.CampaignStatus status = 5; | public function setStatus($var)
{
GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V14\Enums\CampaignStatusEnum\CampaignStatus::class);
$this->status = $var;
return $this;
} | [
"public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Eolymp\\Judge\\Activity_Status::class);\n $this->status = $var;\n\n return $this;\n }",
"function getCampaignStatus() {\r\n $status = '';\r\n if ($this->campaign_id != null) {\r\n $campaign = ListQuery::quick_fetch_row('Campaign', $this->campaign_id, array('status'));\r\n if (! empty($campaign['status']))\r\n $status = $campaign['status'];\r\n }\r\n\r\n return $status;\r\n }",
"public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\Build\\V1\\Build\\Status::class);\n $this->status = $var;\n\n return $this;\n }",
"public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V14\\Enums\\AdGroupCriterionStatusEnum\\AdGroupCriterionStatus::class);\n $this->status = $var;\n\n return $this;\n }",
"public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Chromeos\\Moblab\\V1beta1\\Build\\BuildStatus::class);\n $this->status = $var;\n\n return $this;\n }",
"public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\ForwardMessageStatusResponse_Status::class);\n $this->status = $var;\n\n return $this;\n }",
"public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V13\\Enums\\CampaignSharedSetStatusEnum\\CampaignSharedSetStatus::class);\n $this->status = $var;\n\n return $this;\n }",
"public function setStatus($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dataproc\\V1\\JobStatus::class);\n $this->status = $var;\n\n return $this;\n }",
"public function updateCampaignStatus()\n\t{\n\t\t$campaign_id = intval($_REQUEST['update_status']['id']);\n\t\t$update_data = array(\n\t\t\t'status' => sanitize_text_field($_REQUEST['update_status']['status'])\n\t\t);\n\t\t$update_data = apply_filters('nst_update_campaign_status_data', $update_data, $campaign_id );\n\t\t\n\t\tNstQueries::update(\n\t\t\tHelper::getDbTableName('campaigns'),\n\t\t\t$update_data,\n\t\t\t$campaign_id\n\t\t);\n\t\t\n\t\tdo_action('nst_updated_campaign_status', $campaign_id, $update_data);\n\t\t\n\t\twp_send_json_success(array(\n\t\t\t'message' => __('Status changed successfully', 'ninja-split-testing')), \n\t\t200);\n\t}",
"public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V13\\Enums\\CustomAudienceStatusEnum\\CustomAudienceStatus::class);\n $this->status = $var;\n\n return $this;\n }",
"public function changeCampaignStatus(AdWordsUser $user, $campaignId, $status) {\n $campaignService = $user->GetService('CampaignService', ADWORDS_VERSION);\n \n $campaign = new Campaign();\n $campaign->id = $campaignId;\n $campaign->status = $status;\n \n $operations = array();\n // Create operation.\n $operation = new CampaignOperation();\n $operation->operand = $campaign;\n $operation->operator = 'SET';\n $operations[] = $operation;\n \n $result = $campaignService->mutate($operations);\n\t\t$dbHelper = new DbHelper;\n\t\t$change_campaign = $dbHelper->activateCampaign($campaignId);\n return $result;\n }",
"public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Storagetransfer\\V1\\TransferJob_Status::class);\n $this->status = $var;\n }",
"public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V13\\Enums\\CustomConversionGoalStatusEnum\\CustomConversionGoalStatus::class);\n $this->status = $var;\n\n return $this;\n }",
"public static function getCampaignStatuses()\n {\n return [\n Campaign::STATUS_ACTIVE => 'ACTIVE',\n Campaign::STATUS_PAUSED => 'PAUSED',\n Campaign::STATUS_DELETED => 'DELETED',\n Campaign::STATUS_ARCHIVED => 'ARCHIVED'\n ];\n }",
"public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Zaly\\Proto\\Core\\MessageStatus::class);\n $this->status = $var;\n\n return $this;\n }",
"public function AdminUpdateCampaignStatus()\n\t{\n\t\t$nr = new \\Comet\\AdminUpdateCampaignStatusRequest();\n\t\t$response = $this->client->send($this->AsPSR7($nr));\n\t\treturn \\Comet\\AdminUpdateCampaignStatusRequest::ProcessResponse($response->getStatusCode(), (string)$response->getBody());\n\t}",
"public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Io\\Token\\Proto\\Common\\Notification\\Notification_Status::class);\n $this->status = $var;\n\n return $this;\n }",
"public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V10\\Enums\\AssetSetStatusEnum\\AssetSetStatus::class);\n $this->status = $var;\n\n return $this;\n }",
"public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\Container\\V1\\Operation\\Status::class);\n $this->status = $var;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if current user is an editor | public function is_editor() {
return current_user_can('editor') || current_user_can('administrator');
} | [
"public function userIsEditor()\n {\n return $this->userHasRole('editor');\n }",
"public function isEditor(){\n\t\tif($_SESSION['waf_user']['editor']==1)return true;\n\t\telse return false;\n\t}",
"function auth_isEditor(){\n\treturn auth_role('editor');\n}",
"function isEditor() {\n\treturn loggedIn () && in_array ( $_SESSION ['UserType'], unserialize ( EDITORS ) );\n}",
"public function isEditor() {\n\n return $this->getClaimSafe(self::CLAIM_USER_ROLE) === self::USER_ROLE_EDITOR;\n }",
"public function isEditor()\n {\n return $this->role >= self::ROLE_EDITOR;\n }",
"public function isEditor()\n {\n return in_array(self::ROL_EDITOR, self::getRoles());\n }",
"public function isEditor()\n {\n return in_array(self::ROL_EDITOR, $this->getRoles());\n }",
"public function isEditor($user)\n {\n\n // he is an admin,\n if ($user->role === 'ADMIN')\n return true;\n\n // he is the profile creator,\n if ($this->creator_id === $user->id)\n return true;\n\n // he is a collaborator\n if ($this->collaborators->contains($user->id))\n return true;\n\n // otherwise not an editor\n return false;\n }",
"function is_editor($shared) {\n\n return $shared->permission === 'editor';\n}",
"public static function checkIfUserIsEditor($user) {\n // User has correct role.\n if (clientxSomeOffersTools::userHasRole(clientxSomeOffers::ROLE_clientx_EDITOR, $user)) {\n return TRUE;\n }\n return FALSE;\n }",
"public function isAdminEditor() {\n return ($this->admin_role == self::ADMIN_ROLE_EDITOR);\n }",
"public function isEditorMode()\n {\n return $this->isContent() && \\Illuminate\\Support\\Facades\\Session::get('editmode', false);\n }",
"private function is_editor_screen() {\n\t\tif ( ! empty( $_GET['action'] ) && $_GET['action'] === 'wppb_editor' ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function CheckEditorAccess () {\n global $zOLDAPPLE, $zLOCALUSER; \n\n // Check if user has ownership access to this page.\n if ($this->userAuth_uID != $zLOCALUSER->uID) {\n // Error out if user does not have access privileges.\n if ($zLOCALUSER->userAccess->e == FALSE) {\n return (FALSE);\n } // if\n } // if\n\n return (TRUE);\n }",
"public function isEditorsChoice(): bool\n {\n return $this->editorsChoice;\n }",
"public static function is_elementor_editor() {\n\t\treturn 'elementor' === Param::get( 'action' );\n\t}",
"function isEditor($wpUser){\n for($i = 0; $i < count($wpUser->roles); $i++){\n if(strpos($wpUser->roles[$i], SARON_ROLE_PREFIX . SARON_ROLE_EDITOR) !== FALSE){ // CHECK IF THE USER IS A MEMBER OF THE GROUP (test)saron_edit\n return true;\n }\n } \n return false;\n }",
"public static function isEditor(Tree $tree, User $user = null) {\n\t\tif ($user === null) {\n\t\t\t$user = self::user();\n\t\t}\n\n\t\treturn self::isModerator($tree, $user) || $user && $tree->getUserPreference($user, 'canedit') === 'edit';\n\t}",
"function isEventEditor(){\n\t\tstatic $isEventEditor;\n\t\tif (!isset($isEventEditor)){\n\t\t\t$isEventEditor = false;\n\n\t\t\t$user =& JEVHelper::getAuthorisedUser();\n\t\t\tif (is_null($user)){\n\t\t\t\t$params = JComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t\t\t$authorisedonly = $params->get(\"authorisedonly\",0);\n\t\t\t\tif (!$authorisedonly){\n\t\t\t\t\t$publishlevel = $params->get(\"jeveditor_level\",20);\n\t\t\t\t\t$juser =& JFactory::getUser();\n\t\t\t\t\tif ($juser->gid>=$publishlevel){\n\t\t\t\t\t\t$isEventEditor = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t/*\n\t\t\t$user =& JEVHelper::getAuthorisedUser();\n\t\t\tif (is_null($user)){\n\t\t\t$params =& JComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t\t$editorLevel= $params->get(\"jeveditor_level\",20);\n\t\t\t$juser =& JFactory::getUser();\n\t\t\tif ($juser->gid>=$editorLevel){\n\t\t\t$isEventEditor = true;\n\t\t\t}\n\t\t\t}\n\t\t\t*/\n\t\t\telse if ($user->canedit){\n\t\t\t\t$isEventEditor = true;\n\t\t\t}\n\t\t}\n\t\treturn $isEventEditor;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search movies on movie title. | public function searchTitleMovies($searchTitle)
{
$this->db->connect();
$sql = "SELECT * FROM movie WHERE title LIKE ?;";
return $this->db->executeFetchAll($sql, [$searchTitle]);
} | [
"public function searchMovie($title): void;",
"public function searchByTitle($title)\n {\n $searchUrl = $this->apiUrl.$this->apiKey.\"/search/movie/title/\".$title.\"/fuzzy\";\n $searchResponse = file_get_contents($searchUrl);\n $searchObj = json_decode($searchResponse, true);\n\n return $searchObj[\"results\"];\n }",
"public function searchTitleAction()\n {\n $db = $this->app->db;\n $response = $this->app->response;\n\n $_SESSION[\"year1\"] = null;\n $_SESSION[\"year2\"] = null;\n $_SESSION[\"resSearchYear\"] = null;\n $_SESSION[\"searchTitle\"] = null;\n $_SESSION[\"resSearchTitle\"] = null;\n\n $searchTitle = $this->getGet(\"searchTitle\");\n $searchTitle = $this->esc($searchTitle);\n\n if ($searchTitle) {\n $sql = \"SELECT * FROM movie WHERE title LIKE ?;\";\n $resultset = $db->executeFetchAll($sql, [$searchTitle]);\n }\n\n $_SESSION[\"searchTitle\"] = $searchTitle;\n $_SESSION[\"resSearchTitle\"] = $resultset;\n\n return $response->redirect(\"movie/show-movies\");\n }",
"function searchByTitle($movie) {\n\t$results = [];\n\ttry{\t\n\t\t$sql = \"select imdbID, title from movies where title like '%\".$movie.\"%' order by title\";\n\t\t$stmt = DB::getInstance()->getPDO()->prepare($sql); \n\t\t$stmt->execute();\n\t\twhile ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\t \t$results[] = $row;\n\t\t}\n\t}catch(PDOException $e) {\n\t\techo \"Something is wrong!\";\n\t}\n\treturn $results;\t\n}",
"public function searchByTitle($title)\n\t{\n\t\t$this->searchByTitle = $title;\n\t}",
"public function search_movie($terms) {\n $terms = explode(\" \", $terms); //explode multiple terms into an array\n //select statement for AND serach\n $sql = \"SELECT * FROM \" . $this->tblMovie . \",\" . $this->tblMovieRating .\n \" WHERE \" . $this->tblMovie . \".rating=\" . $this->tblMovieRating . \".rating_id AND (1\";\n\n foreach ($terms as $term) {\n $sql .= \" AND title LIKE '%\" . $term . \"%'\";\n }\n\n $sql .= \")\";\n\n //execute the query\n $query = $this->dbConnection->query($sql);\n\n // the search failed, return false. \n if (!$query)\n return false;\n\n //search succeeded, but no movie was found.\n if ($query->num_rows == 0)\n return 0;\n\n //search succeeded, and found at least 1 movie found.\n //create an array to store all the returned movies\n $movies = array();\n\n //loop through all rows in the returned recordsets\n while ($obj = $query->fetch_object()) {\n $movie = new Movie($obj->title, $obj->rating, $obj->release_date, $obj->director, $obj->image, $obj->description);\n\n //set the id for the movie\n $movie->setId($obj->id);\n\n //add the movie into the array\n $movies[] = $movie;\n }\n return $movies;\n }",
"public function searchMovies() {\n\t\tif($this->request->is('ajax')) {\n\t\t\t$this->layout = 'ajax';\n\t\t\tif(isset($_GET['search'])) {\n\t\t\t\t$searchResult = $this->get_json($this->searchURL .'?api_key=' . $this->apikey . '&query=' . urlencode($_GET['search']));\n\t\t\t\tprint($searchResult);\n\t\t\t}\n\t\t}\n\t}",
"public function search($title, $year = false)\n {\n $url = $this->adapter->getMovieSearchUrl($title, $year);\n $crawler = $this->client->request('GET', $url);\n\n return $this->adapter->getMovieSearchResult($crawler);\n }",
"function searchByTitle($title){\n $name = $title['search'];\n return db()->QUERY(\"SELECT * FROM posts WHERE title LIKE '%$name%' ORDER BY title\");\n }",
"public function search_movie($terms) {\n\t\t$terms = explode(\" \", $terms); //explode multiple terms into an array\n //select statement for an AND search\n $sql = \"SELECT * FROM \" . $this->tblMovie . \",\" . $this->tblMovieRating .\n \" WHERE \" . $this->tblMovie . \".rating=\" . $this->tblMovieRating . \".rating_id AND (1\";\n\n foreach ($terms as $term) {\n $sql .= \" AND title LIKE '%\" . $term . \"%'\";\n }\n $sql .= \")\";\n\n //Below I'm executing the query\n $query = $this->dbConnection->query($sql);\n\n //Below error handling with if statements. If fail will return false and if no results will return 0.\n if (!$query) {\n return false;\n }\n if ($query->num_rows == 0) {\n return 0;\n }\n\n //Below I have created a variable that contains an array to store all returned movies\n $movies = array();\n\n //Below a while() that will help to loop through all rows in the returned records\n while ($obj = $query->fetch_object()) {\n $movie = new Movie(stripslashes($obj->title), stripslashes($obj->rating), stripslashes($obj->release_date),\n stripslashes($obj->director), stripslashes($obj->image), stripslashes($obj->description));\n\n //Below I set the id for the movie\n $movie->setId($obj->id);\n\n //Below I added that movie into the array\n $movies[] = $movie;\n }\n return $movies;\n\n\t}",
"public function search($title)\n {\n $result = $this->model()::where('name_vote', 'like', '%' . $title . '%')->get();\n return $result;\n }",
"public function search($title)\n {\n return Confession::where('title', 'like', '%'.$title.'%')->get();\n }",
"public function searchTitle($title) {\n try {\n // escape quotes\n $checkTitle = str_replace(\"'\", \"''\", $title);\n // search the database, using wildcards\n $sql = \"SELECT * FROM books WHERE title LIKE '%$checkTitle%' ORDER BY author\";\n $stmt = $this->conn->query($sql);\n \n // fetch results as numeric array\n $result = $stmt->setFetchMode(PDO::FETCH_NUM);\n // show results in a list of update forms\n echo \"<br /><div id='searchResult'><h3>Title: -$title-</h3><ul>\";\n while ($row = $stmt->fetch()) {\n // call result form function\n $this->echoResultForm($row);\n }\n echo \"</ul></div>\";\n }\n catch(PDOException $e) {\n echo $e->getMessage();\n }\n }",
"public static function advancedSearch($title, $year, $genreid) {\n\t\t// Add $start and $limit to implement pages later\n\t\t\n\t\t// The starting query, this is modified based on the search input\n\t\t$query = \"SELECT m.movieID, m.title, m.summary, m.releaseDate, m.ratingID, m.runTime, m.score FROM Movie as m\";\n\t\t\n\t\t\n\t\tif($genreid != null) {\n\t\t\t$query = $query . \" INNER JOIN MovieGenre as mg on mg.movieid = m.movieid INNER JOIN Genre as g on g.genreid = mg.genreid\";\n\t\t}\n\t\t\n\t\t$or = false;\n\t\t\n\t\tif($title != null) {\n\t\t\t$query = $query . \" WHERE m.title LIKE '%\" . $title . \"%'\";\n\t\t\t$or = true;\n\t\t}\n\t\t\n\t\tif($year != null) {\n\t\t\tif($or) {\n\t\t\t\t$query = $query . \" AND WHERE m.title LIKE '%\" . $title . \"%'\";\n\t\t\t} else {\n\t\t\t\t$query = $query . \" WHERE m.title LIKE '%\" . $title . \"%'\";\n\t\t\t}\n\t\t\t$or = true;\n\t\t}\n\t\t\n\t\tif($genreid != null) {\n\t\t\tif($or) {\n\t\t\t\t$query = $query . \" AND g.genreID LIKE \" . $genreid;\n\t\t\t} else {\n\t\t\t\t$query = $query . \" WHERE g.genreID LIKE \" . $genreid;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$result = Database::executeQuery($query);\n\t\t$movies = array();\n\t\t\n\t\tif($result == null or $result == false) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif($result->num_rows > 0) {\n\t\t\tfor($i = 0; $i < $result->num_rows; $i++) {\n\t\t\t\t$row = mysqli_fetch_array($result);\n\t\t\t\t\n\t\t\t\t$movie = new Movie($row[0], $row[1], $row[2], $row[3], $row[4], $row[5], $row[6]);\n\t\t\t\t$movies[] = $movie;\n\t\t\t}\n\t\t\t\n\t\t\treturn $movies;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function search_movies( $search_term, $search_for = array(), $genres = array() ) {\n\n\t$sql = \"SELECT \";\n\n\treturn $sql;\n}",
"public function searchMovies($params) {\n $query = $params['query'];\n $this->db->bind([\"query\" => \"$query*\"]);\n $result = $this->db->fetch(\"SELECT * FROM movies WHERE movies MATCH :query\");\n\n return $result;\n }",
"function get_films_by_title_and_director($title, $director_name){\n str_replace(' ','+',$title);\n $data = json_decode(tmdbget(\"search/movie/\",['query' => $title]), TRUE);\n $films_data = array();\n foreach ($data['results'] as $film) {\n if(strcmp(get_film_director($film[\"id\"])['name'],$director_name)==0){\n array_push($films_data, $film['id']);\n }\n }\n return $films_data;\n}",
"public function searchByName($m_name) {\n $result=[];\n $db = DB::getInstance();\n $req = $db->query(\"SELECT * FROM movie WHERE movie_name LIKE '%$m_name%'\");\n //$req->execute(array('m_name' => $m_name));\n foreach ($req->fetchAll() as $item){\n $result[] = new Movie($item['movie_id'], $item['movie_name'],\n $item['movie_length'], $item['movie_kind'], $item['movie_trailer'],$item['movie_picture']);\n }\n return $result;\n }",
"public function searchByTitle($text)\n {\n return $this->query(\"SELECT * FROM mangas WHERE title LIKE '%$text%'\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getCurrentImage return the currently loaded image for the image element at index | public function getCurrentImage($index = 0)
{
$img = $this->webdriver->executeJS("var img=document.querySelectorAll('img')[" . $index . '];return getImageDimensions(img)');
return $img;
} | [
"private function currentImage()\n {\n return $this->wrapper->path . $this->current_image;\n }",
"public function getimageindex(){}",
"public function current(): ImageCandidateInterface\n {\n return $this->imageCandidates[$this->pointer];\n }",
"public function getMainImage()\n {\n return $this->getImage(0);\n }",
"function getCurrentPhoto($currentPhotoCounter){\n \t\t\t\tglobal $photos;\n \t\t\t\t$currentPhoto = $photos[$currentPhotoCounter]; //get the photo.\n \t\t\t\treturn $currentPhoto;\n \t\t\t}",
"public function getNextImageIndex(){\r\n\t}",
"function nextImage(){}",
"function previousImage(){}",
"public function firstImageInContent(){\n if(isset($this->imageFirstInContent)){\n return $this->imageFirstInContent;\n }\n $this->fetchFirstImageInContent();\n return $this->imageFirstInContent;\n }",
"function get_current_image($mac_addr) {\n\t\t#$mac_addr = $this->get_mac_addr_from_hostname ($node);\n\t\t$query = \"select image_name from \";\n\t\t$query .= \"imageinfo i, imagemap j \";\n\t\t$query .= \"where i.image_id = j.image_id \";\n\t\t$query .= \"and j.mac_addr = '$mac_addr'\";\n\t\t$val = $this->query($query, 1);\n\t\treturn $val[0]['image_name'];\n\t}",
"public function current()\n {\n return $this->tiles[$this->currentY];\n }",
"public function getActive() {\n if (Phpfox::getParam('bettermobile.is_background_random')) {\n $this->database()->order('rand()');\n } else {\n $this->database()->order('time_stamp desc');\n }\n $aImage = $this->database()\n ->select('*')\n ->from($this->_sTable)\n ->where('active = 1 AND image <> \\'\\'')\n ->limit(1)\n ->execute('getRow');\n $this->_processImage($aImage);\n return $aImage;\n }",
"public function getImage() {\t\n\t\t$data = $this->data[$this->name];\n\t\treturn $this->getImagePath($data, $this->name, IMAGES, Configure::read('Folders.img.scenarios').DS.$data['id'], 'id');\n\t}",
"public function getPhoto(){\n return $this->current_photo;\n }",
"private function set_current_image_url()\r\n {\r\n if(isset($this->data['image_id']))\r\n {\r\n // User has selected image - load model\r\n $this->load->model('image_model');\r\n\r\n // Get image data\r\n $current_image_data = $this->image_model->get_by_id($this->data['image_id']);\r\n\r\n if(isset($current_image_data))\r\n { \r\n // Build URL for image path\r\n $str = base_url() . 'uploads/' . $current_image_data['image_filename'];\r\n $this->data['image_url'] = $str;\r\n }\r\n }\r\n }",
"public function photo()\n {\n if ($this->photosNumber == 0) {\n \n // get default image\n return index('application/storage/app/uploads/default/classifieds/no-image.jpg');\n\n }else{\n\n // get first image\n return index('application/storage/app/uploads/classifieds/'.$this->unique_id.'/preview_0.jpg');\n\n }\n }",
"public function current(): ImageSize\n\t{\n\t\treturn $this->sizes[$this->key()];\n\t}",
"public function getCurrentImageActionData()\n {\n return $this->_currentImageActionData;\n }",
"private function selectedImage()\n\t{\n\t\t$session_designer = new Dlayer_Session_Designer();\n\n\t\t$image = FALSE;\n\t\t$from_session = FALSE;\n\n\t\tif($this->tool['content_id'] !== FALSE)\n\t\t{\n\t\t\tif($session_designer->imagePickerCategoryId() !== NULL &&\n\t\t\t\t$session_designer->imagePickerSubCategoryId() !== NULL &&\n\t\t\t\t$session_designer->imagePickerImageId() !== NULL &&\n\t\t\t\t$session_designer->imagePickerCategoryId() !== NULL)\n\t\t\t{\n\t\t\t\t$from_session = TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Set in session\n\t\t\t\t$model_image = new Dlayer_DesignerTool_ContentManager_Image_Model();\n\t\t\t\t$libraryProperties = $model_image->imageLibraryParams($this->tool['site_id'], $this->tool['page_id'],\n\t\t\t\t\t$this->tool['content_id']);\n\n\t\t\t\tif($libraryProperties !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$session_designer->setImagePickerCategoryId($libraryProperties['category_id']);\n\t\t\t\t\t$session_designer->setImagePickerSubCategoryId($libraryProperties['sub_category_id']);\n\t\t\t\t\t$session_designer->setImagePickerImageId($libraryProperties['image_id']);\n\t\t\t\t\t$session_designer->setImagePickerVersionId($libraryProperties['version_id']);\n\n\t\t\t\t\t$from_session = TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($from_session === TRUE)\n\t\t{\n\t\t\t$model_image = new Dlayer_DesignerTool_ContentManager_Image_Model();\n\t\t\t$preview = $model_image->previewImage($this->tool['site_id'], $session_designer->imagePickerImageId(),\n\t\t\t\t$session_designer->imagePickerVersionId());\n\n\t\t\tif($preview !== FALSE) {\n\t\t\t\t$image = array(\n\t\t\t\t\t'image_id' => $session_designer->imagePickerImageId(),\n\t\t\t\t\t'version_id' => $session_designer->imagePickerVersionId(),\n\t\t\t\t\t'name' => $preview['name'],\n\t\t\t\t\t'dimensions' => $preview['dimensions'],\n\t\t\t\t\t'size' => $preview['size'],\n\t\t\t\t\t'extension' => $preview['extension']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $image;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The compression types supported by the client. Generated from protobuf field repeated .google.cloud.webrisk.v1beta1.CompressionType supported_compressions = 3; | public function getSupportedCompressions()
{
return $this->supported_compressions;
} | [
"final public static function getSupportedCompression () {}",
"protected function getCompressionType()\n {\n return $this->compression_type;\n }",
"public static function getSupportedCompressionAlgorithms(): array\n {\n $algos = ['none']; // REQUIRED no compression\n if (function_exists('deflate_init')) {\n $algos[] = 'zlib@openssh.com'; // https://datatracker.ietf.org/doc/html/draft-miller-secsh-compression-delayed\n $algos[] = 'zlib';\n }\n return $algos;\n }",
"public function getCompressionMethod()\n {\n return $this->compressionMethod;\n }",
"public static function get_compression_type(){\r\n\t\t\t$compression = '';\r\n\t\t\tif(Config::read('Template.enable_gzip_compression') && Template::$enable_compression){\r\n\t\t\t\tif(extension_loaded('zlib')){\r\n\t\t\t\t\tif(isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false){\r\n\t\t\t\t\t\t$compression = 'ob_gzhandler';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $compression;\r\n\t\t}",
"public function _backup_migrate_get_compression_form_item_options() {\n $compression_options = array(\"none\" => t(\"No Compression\"));\n if (@function_exists(\"gzencode\")) {\n $compression_options['gzip'] = t(\"GZip\");\n }\n if (@function_exists(\"bzcompress\")) {\n $compression_options['bzip'] = t(\"BZip\");\n }\n if (class_exists('ZipArchive')) {\n $compression_options['zip'] = t(\"Zip\", array(), array('context' => 'compression format'));\n }\n return $compression_options;\n }",
"public function getCompression()\n {\n return $this->compression;\n }",
"public static function getEncodeType(){\r\n\t\t$gzip = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');\r\n\t\t$deflate = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate');\r\n\r\n\t\t// Determine used compression method\r\n\t\treturn $gzip ? 'gzip' : ($deflate ? 'deflate' : 'none');\r\n\t}",
"public function provider_accepts_encoding_at_quality()\n\t{\n\t\treturn [\n\t\t\t[\n\t\t\t\t[\n\t\t\t\t\t'accept-encoding' => 'compress, gzip, blowfish; q=.7, *; q=.5'\n\t\t\t\t],\n\t\t\t\t'gzip',\n\t\t\t\tFALSE,\n\t\t\t\t1.0\n\t\t\t],\n\t\t\t[\n\t\t\t\t[\n\t\t\t\t\t'accept-encoding' => 'compress, gzip, blowfish; q=.7, *; q=.5'\n\t\t\t\t],\n\t\t\t\t'gzip',\n\t\t\t\tTRUE,\n\t\t\t\t1.0\n\t\t\t],\n\t\t\t[\n\t\t\t\t[\n\t\t\t\t\t'accept-encoding' => 'compress, gzip, blowfish; q=.7, *; q=.5'\n\t\t\t\t],\n\t\t\t\t'blowfish',\n\t\t\t\tFALSE,\n\t\t\t\t0.7\n\t\t\t],\n\t\t\t[\n\t\t\t\t[\n\t\t\t\t\t'accept-encoding' => 'compress, gzip, blowfish; q=.7, *; q=.5'\n\t\t\t\t],\n\t\t\t\t'bzip',\n\t\t\t\tFALSE,\n\t\t\t\t0.5\n\t\t\t],\n\t\t\t[\n\t\t\t\t[\n\t\t\t\t\t'accept-encoding' => 'compress, gzip, blowfish; q=.7, *; q=.5'\n\t\t\t\t],\n\t\t\t\t'bzip',\n\t\t\t\tTRUE,\n\t\t\t\t(float) 0\n\t\t\t]\n\t\t];\n\t}",
"public function getCompression() {\n\t}",
"public function compression() {\n\t\treturn $this->compression;\n\t}",
"public function setCompression($compress);",
"public function setCompressionType($type) {\n if(!in_array($type, self::$_allowedCompressionTypes)) {\n $this->setError(\"That compression type is not accepted. Only types \" . implode(\", \", self::$_allowedCompressionTypes) . \" are permitted\");\n }\n $this->compressionType = $type;\n }",
"public function getSupportedContentTypes() {\n return array_map(function ($encoder) {\n return $encoder->getMediaType();\n }, $this->encoders);\n }",
"protected static function checkCompress()\n\t{\n\t\t// Reading the headlines\n\t\tif (isset($_SERVER['HTTP_ACCEPT_ENCODING']))\n\t\t\t$encoding = $_SERVER['HTTP_ACCEPT_ENCODING'];\n\t\telseif (isset($_SERVER['HTTP_TE']))\n\t\t\t$encoding = $_SERVER['HTTP_TE'];\n\t\telse\n\t\t\t$encoding = false;\n\n\t\t// Search support compression titles\n\t\tif (strpos($encoding, 'gzip') !== false)\n\t\t\t$support = 'gzip';\n\t\telseif (strpos($encoding, 'x-gzip') !== false)\n\t\t\t$support = 'x-gzip';\n\t\telseif (strpos($encoding, 'deflate') !== false)\n\t\t\t$support = 'deflate';\n\t\telse\n\t\t\t$support = false;\n\n\t\treturn $support;\n\t}",
"protected function determineCompression() : void {\n\t\t\t$headers = headers_list();\n\n\t\t\t// Checks headers to see if someone is already doing compression\n\t\t\t// or sending files or sending incompressible data\n\t\t\tforeach ($headers as $header) {\n\t\t\t\tif(stripos($header, 'Content-Type:') === 0) {\n\t\t\t\t\t$compressible = false;\n\t\t\t\t\tforeach (self::$compressibleMime as $mime) {\n\t\t\t\t\t\tif(strpos($header, $mime, 14) !== false) {\n\t\t\t\t\t\t\t$compressible = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!$compressible) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(stripos($header, 'Content-Length:') === 0 || stripos($header, 'X-Sendfile:')) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if(preg_match('/^Content-Encoding: +(.+)$/i', $header, $matches)) {\n\t\t\t\t\tif($matches[1] !== 'identity') {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Compression negotiation\n\t\t\tif($this->compressor === null && isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {\n\t\t\t\tif(stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) {\n\t\t\t\t\theader('Content-Encoding: gzip', true);\n\t\t\t\t\t$this->compressor = deflate_init(ZLIB_ENCODING_GZIP);\n\t\t\t\t}\n\t\t\t\telse if(stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') !== false) {\n\t\t\t\t\theader('Content-Encoding: deflate', true);\n\t\t\t\t\t$this->compressor = deflate_init(ZLIB_ENCODING_DEFLATE);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!isset($_SERVER['HTTP_USER_AGENT']) || strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') === false || isset($this->compressor)) {\n\t\t\t\theader('Vary: Accept-Encoding');\n\t\t\t}\n\t\t}",
"public function getCompressTypeHint()\n {\n return $this->compress_type_hint;\n }",
"public function setImageCompression($compression);",
"public function setCompression($var)\n {\n GPBUtil::checkEnum($var, \\Ydb\\Table\\ColumnFamily\\Compression::class);\n $this->compression = $var;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the intervient indem preca. | public function getIntervientIndemPreca(): ?bool {
return $this->intervientIndemPreca;
} | [
"public function getIndemCpIntervientBrutAl() {\n return $this->indemCpIntervientBrutAl;\n }",
"public function getPrenomIntervenant() {return $this->prenomIntervenant;}",
"public function getInterconsulta_a()\r\n\t{\r\n\t\treturn($this->interconsulta_a);\r\n\t}",
"public function imc(){\n\t\treturn $this->peso / ($this->altura * $this->altura);\n\n\t}",
"public function getInteressiId()\n {\n return $this->interessiId;\n }",
"public function getPartitaIVAClinica() {\r\n return $this->_partitaIVA;\r\n }",
"public function getInnovacion()\n {\n\n return $this->innovacion;\n }",
"public function getinscEstadual()\n {\n return $this->inscEstadual;\n }",
"public function porte_sin_iva(){\r\n\t\t\treturn $this->importe;\r\n\t\t}",
"public function imc(){\n return $this->peso/($this->altura*$this->altura);\n }",
"public function getEstciv(){\n\t\treturn $this->estciv;\n\t}",
"public function getCaisseIndemcp() {\n return $this->caisseIndemcp;\n }",
"public function getSinIva()\r\n {\r\n return self::$sinIva;\r\n }",
"public function getIdmetricaConversionEnergetica(){\n return $this->idmetricaConversionEnergetica;\n }",
"public function imc(){\n\t\t\treturn $this->peso/($this->altura * $this->altura);\n\t\t}",
"public function getCierre_menor_inversion()\n {\n return $this->cierre_menor_inversion;\n }",
"public function getContaPadraoIr()\n {\n return $this->conta_padrao_ir;\n }",
"public function getIusiSemestral()\n {\n return $this->iusi_semestral;\n }",
"public function getIntereses(): float\n {\n return $this->intereses;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a product to the cart and reduce stock level of product without affecting versions of product | function testAddProductToCartReduceStock() {
$productA = $this->objFromFixture('Product', 'productA');
$this->assertEquals(4, $productA->StockLevel()->Level); //Stock starts one down because of orderOneItemOne
$this->logInAs('admin');
$productA->doPublish();
$this->logOut();
$versions = DB::query('SELECT * FROM "Product_versions" WHERE "RecordID" = ' . $productA->ID);
$versionsAfterPublished = array();
foreach ($versions as $versionRow) $versionsAfterPublished[] = $versionRow;
$variations = $productA->Variations();
$this->assertEquals(false, $variations->exists());
$this->get(Director::makeRelative($productA->Link()));
$this->submitForm('AddToCartForm_AddToCartForm', null, array(
'Quantity' => 1
));
$productA = $this->objFromFixture('Product', 'productA');
$this->assertEquals(3, $productA->StockLevel()->Level);
$this->get(Director::makeRelative($productA->Link()));
$this->submitForm('AddToCartForm_AddToCartForm', null, array(
'Quantity' => 2
));
$productA = $this->objFromFixture('Product', 'productA');
$this->assertEquals(1, $productA->StockLevel()->Level);
//Make sure a new version of the product was NOT created
$versions = DB::query('SELECT * FROM "Product_versions" WHERE "RecordID" = ' . $productA->ID);
$versionsAfterStockChanges = array();
foreach ($versions as $versionRow) $versionsAfterStockChanges[] = $versionRow;
$this->assertTrue($versionsAfterPublished == $versionsAfterStockChanges);
} | [
"public function addAction()\n {\n $cart = $this->_getCart();\n $params = $this->getRequest()->getParams();\n\n if($params['isAjax'] == 1){\n $response = array();\n try {\n if (isset($params['qty'])) {\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $params['qty'] = $filter->filter($params['qty']);\n }\n\n $product = $this->_initProduct();\n $related = $this->getRequest()->getParam('related_product');\n $assurant = $this->getRequest()->getParam('assurant_product');\n $addCoverage = $this->getRequest()->getParam('add_coverage');\n\n /**\n * Check product availability\n */\n if (!$product) {\n $response['status'] = 'error';\n $response['message'] = $this->__('Unable to find Product ID');\n }\n\n if ($addCoverage) {\n if(!Mage::getSingleton('checkout/session')->getQuote()->getItemByProduct($product)) {\n $cart->addProduct($product, $params);\n }\n }\n else {\n $cart->addProduct($product, $params);\n }\n\n if (!empty($related)) {\n $cart->addProductsByIds(explode(',', $related));\n } \n\n $cart->save();\n $this->_getSession()->setCartWasUpdated(true);\n\n /**\n * @todo remove wishlist observer processAddToCart\n */\n Mage::dispatchEvent('checkout_cart_add_product_complete',\n array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n \n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError()){\n $mainQuoteItem = $cart->getQuote()->getItemByProduct($product);\n \n $message = $this->__('You\\'ve just added this product to the cart:');\n $response['message'] = $message;\n $response['status'] = 'success';\n $response['redirect'] = Mage::getUrl('checkout/cart');\n if (!empty($assurant) || ($mainQuoteItem && $mainQuoteItem->getAssurantItemId())) {\n $response['assurant'] = 'true';\n }else{\n $response['assurant'] = 'false';\n } \n }\n }\n }\n catch (Mage_Core_Exception $e) {\n $msg = \"\";\n if ($this->_getSession()->getUseNotice(true)) {\n $msg = $e->getMessage();\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $msg .= $message.'<br/>';\n }\n }\n \n $response['status'] = 'error';\n $response['message'] = $msg;\n $response['assurant'] = 'false';\n }\n catch (Exception $e) {\n $response['status'] = 'error';\n $response['assurant'] = 'false';\n $response['message'] = $this->__('Cannot add the item to shopping cart.');\n Mage::logException($e);\n\n }\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n }\n\n }",
"function addToProductStock($productId, $qty) {\n\tglobal $log, $adb;\n\t$log->debug('> addToProductStock '.$productId.','.$qty);\n\t$qtyInStck=getProductQtyInStock($productId);\n\t$updQty=$qtyInStck + $qty;\n\t$adb->pquery('UPDATE vtiger_products set qtyinstock=? where productid=?', array($updQty, $productId));\n\t$log->debug('< addToProductStock');\n}",
"public function addAction()\r\n {\r\n $cart = $this->_getCart();\r\n $params = $this->getRequest()->getParams();\r\n \r\n try {\r\n if (isset($params['qty'])) {\r\n $filter = new Zend_Filter_LocalizedToNormalized(\r\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\r\n );\r\n $params['qty'] = $filter->filter($params['qty']);\r\n }\r\n\r\n $product = $this->_initProduct();\r\n $related = $this->getRequest()->getParam('related_product');\r\n\r\n /**\r\n * Check product availability\r\n */\r\n if (!$product) {\r\n Mage::throwException(Mage::helper('paypal_checkout')->__('Product is not available'));\r\n }\r\n\r\n $cart->addProduct($product, $params);\r\n if (!empty($related)) {\r\n $cart->addProductsByIds(explode(',', $related));\r\n }\r\n\r\n $cart->save();\r\n\r\n $this->_getSession()->setCartWasUpdated(true);\r\n\r\n /**\r\n * @todo remove wishlist observer processAddToCart\r\n */\r\n Mage::dispatchEvent('checkout_cart_add_product_complete',\r\n array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\r\n );\r\n\r\n if (!$this->_getSession()->getNoCartRedirect(true)) {\r\n if (!$cart->getQuote()->getHasError()){\r\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));\r\n $this->_getSession()->addSuccess($message);\r\n }\r\n }\r\n } catch (Mage_Core_Exception $e) {\r\n if ($this->_getSession()->getUseNotice(true)) {\r\n $this->_getSession()->addNotice(Mage::helper('core')->escapeHtml($e->getMessage()));\r\n } else {\r\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\r\n foreach ($messages as $message) {\r\n $this->_getSession()->addError(Mage::helper('core')->escapeHtml($message));\r\n }\r\n }\r\n } catch (Exception $e) {\r\n $this->_getSession()->addError($e, $this->__('Cannot add the item to shopping cart.'));\r\n Mage::logException($e);\r\n }\r\n\r\n $this->loadLayout();\r\n $this->_initLayoutMessages('checkout/session');\r\n $this->renderJsonLayout();\r\n }",
"public function add_item_to_cart() {\n\n\t\t\tWC()->cart->add_to_cart( $product_id = $_POST['cart_product_id'], $quantity = 1, $variation_id = 0, $variation = array(), $cart_item_data = array() );\n\n\t\t\tlahb_mini_cart();\n\n\t\t\twp_die(); // this is required to terminate immediately and return a proper response\n\n\t\t}",
"private function addSampleProductToCart($product,$qty){\n if($this->_quote->addProduct($product, $qty))\n $this->_quote->addProduct($product, $qty);\n }",
"public function addProductToCart()\n {\n $frontController = Mage::app()->getFrontController();\n $request = $frontController->getRequest();\n /* @var $cart Mage_Checkout_Model_Cart */\n $cart = Mage::getSingleton('checkout/cart')->setStore(Mage::app()->getStore());\n /* @var $helper Symmetrics_Buyerprotect_Helper_Data */\n $helper = Mage::helper('buyerprotect');\n $tsProductsInCart = $helper->getTsProductsInCart();\n\n if ($request->getParam('trusted_shops')) {\n\n // cart is empty\n if (!($cartProductIds = $cart->getProductIds())) {\n return;\n }\n\n $requestedProductId = $request->getParam('trusted_shops-product');\n\n /**\n * cart is not empty but the only item is a type of\n * Symmetrics_Buyerprotect_Model_Type_Buyerprotect::TYPE_BUYERPROTECT\n * and is identical to $requestedProductId.\n */\n if ((count($cartProductIds) < 2) && in_array($requestedProductId, $cartProductIds)) {\n return;\n }\n\n /**\n * Get rid off all previous added products of\n * Symmetrics_Buyerprotect_Model_Type_Buyerprotect::TYPE_BUYERPROTECT.\n * This way it get sure that only one item of this product type is in cart.\n */\n if ($tsProductsInCart) {\n foreach ($tsProductsInCart as $cartItemId => $tsProductId) {\n $cart->removeItem($cartItemId);\n }\n }\n\n // add Buyerprotection Product to cart\n $cart->addProductsByIds(array($requestedProductId));\n $this->_saveCart($cart);\n } else {\n if ($tsProductsInCart) {\n foreach ($tsProductsInCart as $cartItemId => $tsProductId) {\n $cart->removeItem($cartItemId);\n }\n }\n }\n\n return;\n }",
"public function add($product,$qty){\n if (!array_key_exists($product->id, $this->quantity_product_map)){\n parent::add($product);\n } \n if (isset($this->quantity_product_map[$product->id])){\n $qty = $this->quantity_product_map[$product->id] + $qty; \n }\n $this->quantity_product_map[$product->id] = $qty; \n }",
"public function testUpdateToCartWithOrderQtyIncreasedBeUnavailableStock()\n {\n $product = Product::active()->available()->first();\n if($product) {\n $cart = Cart::create([\n 'uid' => Str::uuid(),\n 'product_id' => $product->id,\n 'price' => $product->price,\n 'qty' => $product->stock - 1,\n ]);\n \n $response = $this->putJson('api/transaction/cart/'.$cart->uid, [\n 'product_uid' => $product->uid,\n 'price' => $product->price,\n 'qty' => $product->stock + 2,\n ]);\n \n $response->assertStatus(400)\n ->assertJson([\n 'success' => false,\n ]);\n } else $this->assertTrue(true);\n }",
"public function addProduct($productId, $quantity = 1) {\n if (!$this->_basketChecked == true) {\n $this->checkBasket();\n }\n // checks if products exists\n $queryStr = \"SELECT b.book_id AS bookId, b.title AS bookTitle, b.image, b.edition, b.price, b.stock, DATE_FORMAT(b.date_published, '%M %e, %Y') AS datepublished, \"\n . \"p.name AS publisherName, f.format, GROUP_CONCAT(DISTINCT a.first_name, ' ', a.last_name SEPARATOR ', ') AS authorName FROM books b \"\n . \"JOIN book_authors ba ON b.book_id = ba.book_id \"\n . \"JOIN authors a ON a.author_id = ba.author_id \"\n . \"JOIN publisher p ON b.publisher_id = p.publisher_id \"\n . \"JOIN formats f ON b.format_id = f.format_id \"\n . \"WHERE b.book_id = ? GROUP BY ba.book_id\";\n $this->_registry->getObject('db')->execute($queryStr, $productId);\n if ($this->_registry->getObject('db')->affectedRows() == 1) {\n $data = $this->_registry->getObject('db')->getRows();\n // checking if product is already in the basket\n if (array_key_exists($data['bookId'], $this->_contents) == true) {\n // check stock\n if ($data['stock'] == -1 || $data['stock'] >= ($this->_contents[$data['bookId']]['quantity'] + $quantity)) {\n // increment the quantitiy\n $this->_contents[$data['bookId']]['quantity'] = $this->_contents[$data['bookId']]['quantity'] + $quantity;\n // update the database\n $this->_registry->getObject('db')->update('carts', ['quantity' => $this->_contents[$data['bookId']]['quantity']], $this->_contents[$data['bookId']]['basket'], 'id');\n return 'success';\n } else {\n // error message\n return 'stock';\n }\n } else {\n if ($data['stock'] == -1 || $data['stock'] >= $quantity) {\n // add product, insert the new listing into the basket\n $sessionId = session_id();\n $user = ($this->_session->exists('authSessionUid')) ? $this->_session->get('authSessionUid') : 0;\n $ip = $_SERVER['REMOTE_ADDR'];\n $item = array('user_id' => $user, \n 'user_session_id' => $sessionId, \n 'book_id' => $data['bookId'], \n 'quantity' => $quantity, \n 'ip_address' => $ip);\n $this->_registry->getObject('db')->insert('carts', $item, $this->_contents[$data['bookId']]['basket'], 'id');\n $basketId = $this->_registry->getObject('db')->lastInsertId();\n // add the product to the contents array\n $this->_contents[$data['bookId']] = array('unitcost' => $data['price'], \n 'subtotal' => ($data['price'] * $quantity), \n 'quantity' => $quantity, \n 'product' => $data['bookId'], \n 'basket' => $basketId, \n 'name' => $data['bookTitle']);\n return 'success';\n } else {\n return 'stock';\n } \n }\n } else {\n // product dont exists\n return 'noproduct';\n }\n }",
"public function addProductAction()\n {\n try {\n $this->loadServices();\n\n Shopware()->Plugins()->Controller()->ViewRenderer()->setNoRender();\n\n // we start by creating a snapshot\n // of our cart\n $this->basketSnapshot->createSnapshot($this->basket);\n\n // delete the cart,\n // to make sure that only the selected product is transferred to Apple Pay\n $this->basket->sDeleteBasket();\n\n $productNumber = $this->Request()->getParam('number');\n $productQuantity = $this->Request()->getParam('quantity');\n\n $this->basket->sAddArticle($productNumber, $productQuantity);\n\n // add potential discounts or surcharges to prevent an amount mismatch\n // on patching the new amount after the confirmation.\n // only necessary if the customer directly checks out from product detail page\n $countries = $this->admin->sGetCountryList();\n $this->admin->sGetPremiumShippingcosts(reset($countries));\n\n echo \"\";\n die();\n } catch (\\Exception $ex) {\n $this->logger->error(\n 'Error when adding product to apple pay cart',\n [\n 'error' => $ex->getMessage()\n ]\n );\n\n http_response_code(500);\n die();\n }\n }",
"public function add(){ \n\t\tif(!$this->addQuantity()){\n\t\t\t$obj = new \\stdClass();\n\t\t\t$obj->id_product = $this->id_product;\n\t\t\t$obj->quantity = 1;\n\t\t\t$this->_cart[] = $obj;\n\t\t\t$this->_session->set(self::SESSION_VAR, $this->_cart);\n\t\t}\n\t\treturn true;\n\t}",
"public function testStoreToCartWithMoreThanStock()\n {\n $product = Product::active()->available()->first();\n if($product) {\n $response = $this->postJson('api/transaction/cart', [\n 'uid' => Str::uuid(),\n 'product_uid' => $product->uid,\n 'price' => $product->price,\n 'qty' => $product->stock + 1,\n ]);\n\n $response->assertStatus(400)\n ->assertJson([\n 'success' => false,\n ]);\n } else $this->assertTrue(true); \n }",
"public function testUpdateToCartWithOrderQtyIncreasedStillAvailableStock()\n {\n $product = Product::active()->available()->first();\n if($product) {\n $cart = Cart::create([\n 'uid' => Str::uuid(),\n 'product_id' => $product->id,\n 'price' => $product->price,\n 'qty' => 1,\n ]);\n \n $response = $this->putJson('api/transaction/cart/'.$cart->uid, [\n 'product_uid' => $product->uid,\n 'price' => $product->price,\n 'qty' => $product->stock,\n ]);\n \n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n ]);\n } else $this->assertTrue(true);\n }",
"private function process_add_to_cart(){\n\t\t\n\t\tif( !$this->check_quantity( $_POST['product_id'], $_POST['product_quantity'] ) ){\n\t\t\theader( \"location: \" . $this->store_page . $this->permalink_divider . \"model_number=\" . $_POST['model_number'] . \"&ec_store_error=minquantity\" );\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\t//add_to_cart_replace Hook\n\t\t\tif( isset( $GLOBALS['ec_hooks']['add_to_cart_replace'] ) ){\n\t\t\t\t$class_args = array( \"cart_page\" => $this->cart_page, \"permalink_divider\" => $this->permalink_divider );\n\t\t\t\tfor( $i=0; $i<count( $GLOBALS['ec_hooks']['add_to_cart_replace'] ); $i++ ){\n\t\t\t\t\tec_call_hook( $GLOBALS['ec_hooks']['add_to_cart_replace'][$i], $class_args );\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t//Product Info\n\t\t\t\t$session_id = $_SESSION['ec_cart_id'];\n\t\t\t\t$product_id = $_POST['product_id'];\n\t\t\t\tif( isset( $_POST['product_quantity'] ) )\n\t\t\t\t\t$quantity = $_POST['product_quantity'];\n\t\t\t\telse\n\t\t\t\t\t$quantity = 1;\n\t\t\t\t\n\t\t\t\t$model_number = stripslashes( $_POST['model_number'] );\n\t\t\t\t\n\t\t\t\t//Optional Gift Card Info\n\t\t\t\t$gift_card_message = \"\";\n\t\t\t\tif( isset( $_POST['ec_gift_card_message'] ) )\n\t\t\t\t\t$gift_card_message = stripslashes( $_POST['ec_gift_card_message'] );\n\t\t\t\t\n\t\t\t\t$gift_card_to_name = \"\";\n\t\t\t\tif( isset( $_POST['ec_gift_card_to_name'] ) )\n\t\t\t\t\t$gift_card_to_name = stripslashes( $_POST['ec_gift_card_to_name'] );\n\t\t\t\t\n\t\t\t\t$gift_card_from_name = \"\";\n\t\t\t\tif( isset( $_POST['ec_gift_card_from_name'] ) )\n\t\t\t\t\t$gift_card_from_name = stripslashes( $_POST['ec_gift_card_from_name'] );\n\t\t\t\t\n\t\t\t\t// Optional Donation Price\n\t\t\t\t$donation_price = 0.000;\n\t\t\t\tif( isset( $_POST['ec_product_input_price'] ) )\n\t\t\t\t\t$donation_price = $_POST['ec_product_input_price'];\n\t\t\t\t\n\t\t\t\t$use_advanced_optionset = false;\n\t\t\t\t//Product Options\n\t\t\t\tif( isset( $_POST['ec_use_advanced_optionset'] ) && $_POST['ec_use_advanced_optionset'] ){\n\t\t\t\t\t$option1 = \"\";\n\t\t\t\t\t$option2 = \"\";\n\t\t\t\t\t$option3 = \"\";\n\t\t\t\t\t$option4 = \"\";\n\t\t\t\t\t$option5 = \"\";\n\t\t\t\t\t$use_advanced_optionset = true;\n\t\t\t\t}else{\n\t\t\t\t\t$option1 = \"\";\n\t\t\t\t\tif( isset( $_POST['ec_option1'] ) )\n\t\t\t\t\t\t$option1 = $_POST['ec_option1'];\n\t\t\t\t\t\n\t\t\t\t\t$option2 = \"\";\n\t\t\t\t\tif( isset( $_POST['ec_option2'] ) )\n\t\t\t\t\t\t$option2 = $_POST['ec_option2'];\n\t\t\t\t\t\n\t\t\t\t\t$option3 = \"\";\n\t\t\t\t\tif( isset( $_POST['ec_option3'] ) )\n\t\t\t\t\t\t$option3 = $_POST['ec_option3'];\n\t\t\t\t\t\n\t\t\t\t\t$option4 = \"\";\n\t\t\t\t\tif( isset( $_POST['ec_option4'] ) )\n\t\t\t\t\t\t$option4 = $_POST['ec_option4'];\n\t\t\t\t\t\n\t\t\t\t\t$option5 = \"\";\n\t\t\t\t\tif( isset( $_POST['ec_option5'] ) )\n\t\t\t\t\t\t$option5 = $_POST['ec_option5'];\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tempcart_id = $this->mysqli->add_to_cart( $product_id, $session_id, $quantity, $option1, $option2, $option3, $option4, $option5, $gift_card_message, $gift_card_to_name, $gift_card_from_name, $donation_price, $use_advanced_optionset, false );\n\t\t\t\t\n\t\t\t\t$option_vals = array( );\n\t\t\t\t// Now insert the advanced option set tempcart table if needed\n\t\t\t\tif( $use_advanced_optionset ){\n\t\t\t\t\t\n\t\t\t\t\t$optionsets = $this->mysqli->get_advanced_optionsets( $product_id );\n\t\t\t\t\t$grid_quantity = 0;\n\t\t\t\t\t\n\t\t\t\t\tforeach( $optionsets as $optionset ){\n\t\t\t\t\t\tif( $optionset->option_type == \"checkbox\" ){\n\t\t\t\t\t\t\t$optionitems = $this->mysqli->get_advanced_optionitems( $optionset->option_id );\n\t\t\t\t\t\t\tforeach( $optionitems as $optionitem ){\n\t\t\t\t\t\t\t\tif( isset( $_POST['ec_option_' . $optionset->option_id . \"_\" . $optionitem->optionitem_id] ) ){\n\t\t\t\t\t\t\t\t\t$option_vals[] = array( \"option_id\" => $optionset->option_id, \"optionitem_id\" => $optionitem->optionitem_id, \"option_name\" => $optionitem->option_name, \"optionitem_name\" => $optionitem->optionitem_name, \"option_type\" => $optionitem->option_type, \"optionitem_value\" => stripslashes( $_POST['ec_option_' . $optionset->option_id . \"_\" . $optionitem->optionitem_id] ), \"optionitem_model_number\" => $optionitem->optionitem_model_number );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if( $optionset->option_type == \"grid\" ){\n\t\t\t\t\t\t\t$optionitems = $this->mysqli->get_advanced_optionitems( $optionset->option_id );\n\t\t\t\t\t\t\tforeach( $optionitems as $optionitem ){\n\t\t\t\t\t\t\t\tif( isset( $_POST['ec_option_' . $optionset->option_id . \"_\" . $optionitem->optionitem_id] ) && $_POST['ec_option_' . $optionset->option_id . \"_\" . $optionitem->optionitem_id] > 0 ){\n\t\t\t\t\t\t\t\t\t$grid_quantity = $grid_quantity + $_POST['ec_option_' . $optionset->option_id . \"_\" . $optionitem->optionitem_id];\n\t\t\t\t\t\t\t\t\t$option_vals[] = array( \"option_id\" => $optionset->option_id, \"optionitem_id\" => $optionitem->optionitem_id, \"option_name\" => $optionitem->option_name, \"optionitem_name\" => $optionitem->optionitem_name, \"option_type\" => $optionitem->option_type, \"optionitem_value\" => $_POST['ec_option_' . $optionset->option_id . \"_\" . $optionitem->optionitem_id], \"optionitem_model_number\" => $optionitem->optionitem_model_number );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if( $optionset->option_type == \"combo\" || $optionset->option_type == \"swatch\" || $optionset->option_type == \"radio\" ){\n\t\t\t\t\t\t\t$optionitems = $this->mysqli->get_advanced_optionitems( $optionset->option_id );\n\t\t\t\t\t\t\tforeach( $optionitems as $optionitem ){\n\t\t\t\t\t\t\t\tif( $optionitem->optionitem_id == $_POST['ec_option_' . $optionset->option_id] ){\n\t\t\t\t\t\t\t\t\t$option_vals[] = array( \"option_id\" => $optionset->option_id, \"optionitem_id\" => $optionitem->optionitem_id, \"option_name\" => $optionitem->option_name, \"optionitem_name\" => $optionitem->optionitem_name, \"option_type\" => $optionitem->option_type, \"optionitem_value\" => $optionitem->optionitem_name, \"optionitem_model_number\" => $optionitem->optionitem_model_number );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if( $optionset->option_type == \"file\" ){\n\t\t\t\t\t\t\t$optionitems = $this->mysqli->get_advanced_optionitems( $optionset->option_id );\n\t\t\t\t\t\t\tforeach( $optionitems as $optionitem ){\n\t\t\t\t\t\t\t\t$option_vals[] = array( \"option_id\" => $optionset->option_id, \"optionitem_id\" => $optionitem->optionitem_id, \"option_name\" => $optionitem->option_name, \"optionitem_name\" => $optionitem->optionitem_name, \"option_type\" => $optionitem->option_type, \"optionitem_value\" => $_FILES['ec_option_' . $optionset->option_id]['name'], \"optionitem_model_number\" => $optionitem->optionitem_model_number );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$optionitems = $this->mysqli->get_advanced_optionitems( $optionset->option_id );\n\t\t\t\t\t\t\tforeach( $optionitems as $optionitem ){\n\t\t\t\t\t\t\t\t$option_vals[] = array( \"option_id\" => $optionset->option_id, \"optionitem_id\" => $optionitem->optionitem_id, \"option_name\" => $optionitem->option_name, \"optionitem_name\" => $optionitem->optionitem_name, \"option_type\" => $optionitem->option_type, \"optionitem_value\" => stripslashes( $_POST['ec_option_' . $optionset->option_id] ), \"optionitem_model_number\" => $optionitem->optionitem_model_number );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( $optionset->option_type == \"file\" ){\n\t\t\t\t\t\t\t//upload the file\n\t\t\t\t\t\t\t$this->upload_customer_file( $tempcart_id, 'ec_option_' . $optionset->option_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor( $i=0; $i<count( $option_vals ); $i++ ){\n\t\t\t\t\t$this->mysqli->add_option_to_cart( $tempcart_id, $_SESSION['ec_cart_id'], $option_vals[$i] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $grid_quantity > 0 ){\n\t\t\t\t\t$this->mysqli->update_tempcart_grid_quantity( $tempcart_id, $grid_quantity );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( get_option( 'ec_option_addtocart_return_to_product' ) ){\n\t\t\t\t\t$return_url = $_SERVER['HTTP_REFERER'];\n\t\t\t\t\t$return_url = str_replace( \"ec_store_success=addtocart\", \"\", $return_url );\n\t\t\t\t\t$divider = \"?\";\n\t\t\t\t\tif( substr_count( $return_url, '?' ) )\n\t\t\t\t\t\t$divider = \"&\";\n\t\t\t\t\t\n\t\t\t\t\tdo_action( 'wpeasycart_cart_updated' );\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\theader( \"location: \" . $return_url . $divider . \"ec_store_success=addtocart&model=\" . $_POST['model_number'] );\n\t\t\t\t}else{\n\t\t\t\t\theader( \"location: \" . $this->cart_page );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static function addProduct1ToCart(): void\n {\n static::addToCart(self::PRODUCT_1);\n }",
"public function add() {\n\t\t$mainframe = JFactory::getApplication();\n\t\tif (VmConfig::get('use_as_catalog', 0)) {\n\t\t\t$msg = vmText::_('COM_VIRTUEMART_PRODUCT_NOT_ADDED_SUCCESSFULLY');\n\t\t\t$type = 'error';\n\t\t\t$mainframe->redirect('index.php', $msg, $type);\n\t\t}\n\t\t$cart = VirtueMartCart::getCart();\n\t\tif ($cart) {\n\t\t\t$virtuemart_product_ids = vRequest::getInt('virtuemart_product_id');\n\n\t\t\t$error = false;\n\t\t\t$cart->add($virtuemart_product_ids,$error);\n\t\t\tif (!$error) {\n\t\t\t\t$msg = vmText::_('COM_VIRTUEMART_PRODUCT_ADDED_SUCCESSFULLY');\n\t\t\t\t$type = '';\n\t\t\t} else {\n\t\t\t\t$msg = vmText::_('COM_VIRTUEMART_PRODUCT_NOT_ADDED_SUCCESSFULLY');\n\t\t\t\t$type = 'error';\n\t\t\t}\n\n\t\t\t$mainframe->enqueueMessage($msg, $type);\n\t\t\t$mainframe->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart', FALSE));\n\n\t\t} else {\n\t\t\t$mainframe->enqueueMessage('Cart does not exist?', 'error');\n\t\t}\n\t}",
"public function add(){\n\t\t// disable layout and view\n\t\t$this->autoRender = false;\n\n\t\t// gather submitted cart data\n\t\t$userCart = $this->request->data('cart');\n\n\t\t// load existing cart to add/edit products\n\t\t$curCart = $this->Session->read('User.Cart');\n\n\t\t// initialize cart if empty\n\t\tif($curCart == NULL){\n\t\t\t$curCart = array();\n\t\t}\n\n\t\t// walk through cart objects and update cart as needed\n\t\tforeach($userCart as $idx => $item){\n\t\t\t// remove from cart when quantity is zero\n\t\t\tif($item['qty'] <= 0){\n\t\t\t\tif(isset($curCart[$idx])){\n\t\t\t\t\tunset($curCart[$idx]);\n\t\t\t\t}\n\t\t\t// remove item from cart if minimum purchase price is set and not yet met\n\t\t\t} else if($item['minPurchasePrice'] > 0 && $item['total'] < $item['minPurchasePrice']){\n\t\t\t\tif(isset($curCart[$idx])){\n\t\t\t\t\tunset($curCart[$idx]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$curCart[$idx] = $item;\n\t\t\t}\n\t\t}\n\n\t\t// store updated cart values\n\t\t$this->Session->write('User.Cart', $curCart);\n\t}",
"public function addProduct($product)\n\t{\n\t\t$this->basket[] = $product;\n\t}",
"function updateProduct() {\n\n $params = [\n 'name' => $this->product\n ];\n \n $response = getResponse(getConfigVar(\"api_url\"), \"products\", $params, [],'body');\n \n $this->qty = $response[\"results\"][0][\"qty\"];\n $this->price = $response[\"results\"][0][\"price\"];\n \n $product = get_page_by_title( $this->product, OBJECT, 'product' );\n \n $productID = $product->ID;\n \n update_post_meta( $productID, \"_stock\", $this->qty );\n update_post_meta( $productID, \"_price\", $this->price );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method called to associate a LyricTopPopularity object to this object through the LyricTopPopularity foreign key attribute. | public function addLyricTopPopularity(LyricTopPopularity $l)
{
if ($this->collLyricTopPopularities === null) {
$this->initLyricTopPopularities();
$this->collLyricTopPopularitiesPartial = true;
}
if (!$this->collLyricTopPopularities->contains($l)) {
$this->doAddLyricTopPopularity($l);
if ($this->lyricTopPopularitiesScheduledForDeletion and $this->lyricTopPopularitiesScheduledForDeletion->contains($l)) {
$this->lyricTopPopularitiesScheduledForDeletion->remove($this->lyricTopPopularitiesScheduledForDeletion->search($l));
}
}
return $this;
} | [
"public function setPopularity($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->popularity !== $v) {\n $this->popularity = $v;\n $this->modifiedColumns[LyricTableMap::COL_POPULARITY] = true;\n }\n\n return $this;\n }",
"public function calculateNewPopularity()\n\t{\n\t\t$this->attributes['popularity'] = $this->getPopularityAttribute() - ( \n\t\t\t( 10 + floor( log( $this->getRoundAttribute() ) ) * ( \n\t\t\t\t1 - $this->getQualityAttribute() / $this->getRoundAttribute() / 100)\n\t\t\t\t) \n\t\t\t);\n\t}",
"public function setPopularity($popularity)\n {\n $this->popularity = $popularity;\n\n return $this;\n }",
"public function sortByPopularity();",
"public function action_popularity() \n\t{\n\t\t$bigger_team = ORM::factory('Team')->get_biggest()->find();\n\t\t$teams = ORM::factory('Team')->get_biggest($bigger_team->counter)\n\t\t\t\t->limit(15)->find_all();\n\t\t\n\t\t$view = View::factory('Container/Statistics/Main');\n\t\t$view->teams = $teams;\r\n\t\t$this->view_container = $view;\n\t}",
"protected function handlePopularity(): void\n {\n $this->setHarvest();\n $this->setLastRunAt();\n\n /**\n * Get all the categories and then loop through them creating an\n * UpdatePerformerPopularityJob for each one.\n */\n try {\n $categories = Category::orderBy('id')->get();\n } catch (Exception) {\n exit('There are no categories yet. Please ensure you have run the Active Categories job.');\n }\n\n $message = 'Updating the popularity_score for the 100 most popular Performers in each Category.';\n $this->info($message);\n Log::info($message);\n\n\n $progressBar = $this->output->createProgressBar($categories->count());\n $progressBar->setFormat(' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%'.PHP_EOL);\n $progressBar->start();\n foreach ($categories as $category) {\n foreach ($this->getPopularPerformersFromApiByCategory($category) as $result) {\n call_user_func($this->harvest->model_class.'::storeFromApi', $result);\n }\n /** @noinspection DisconnectedForeachInstructionInspection */\n $progressBar->advance();\n }\n $progressBar->finish();\n\n\n $this->completed();\n }",
"public function getPopularity () {\n return $this->popularity;\n }",
"public function getPopularity() {\n return $this->popularity;\n }",
"public function a_question_has_popularity_attribute()\n {\n $question = create(Question::class);\n $this->assertEquals(0, $question->refresh()->popularity);\n\n create(Answer::class, ['question_id' => $question->id]);\n\n $this->assertEquals(1, $question->refresh()->popularity);\n }",
"public function rankAdd()\n {\n if (!$this->owner->isNewRecord) {\n return;\n }\n if (!is_numeric($this->owner->getAttribute($this->attribute))) {\n $this->owner->setAttribute($this->attribute, $this->getSiblings()->count());\n }\n }",
"public function getMaxPopularity()\n {\n $qb = $this->gm->createQueryBuilder();\n\n $qb->match('(link:Link)')\n ->where('link.popularity = 1')\n ->with('link')\n ->limit(1)\n ->optionalMatch('(link)<-[likes:LIKES]-()')\n ->returns(\n ' id(link) AS id',\n 'link.popularity AS popularity',\n 'link.unpopularity AS unpopularity',\n 'link.popularity_timestamp AS timestamp',\n 'count(likes) AS amount',\n 'false AS new'\n );\n $result = $qb->getQuery()->getResultSet();\n $popularities = $this->build($result);\n\n if (!empty($popularities)) {\n return $popularities[0];\n }\n\n $qb = $this->gm->createQueryBuilder();\n $qb->match('(popularity:Popularity)')\n ->where('popularity.popularity = 1')\n ->with('popularity')\n ->optionalMatch('(popularity)<-[:HAS_POPULARITY]-(:Link)<-[:LIKES]-(likes)')\n ->returns(\n ' id(popularity) AS id,\n popularity.popularity AS popularity,\n popularity.unpopularity AS unpopularity,\n popularity.timestamp AS timestamp,\n count(likes) AS amount,\n true AS new'\n )\n ->limit(1);\n $result = $qb->getQuery()->getResultSet();\n $popularities = $this->build($result);\n\n if (!empty($popularities)) {\n return $popularities[0];\n }\n\n// $maxPopularities = $this->calculateNewMaxPopularity();\n// if (!empty($maxPopularities)) {\n// return $maxPopularities[0];\n// }\n\n return null;\n }",
"function top_rated()\n\t\t{\n\t\t\t$allow_cats = ( $allow_cats ) ? $allow_cats : $this->glib->get_allowed_cats( 1, $this->category->data );\n\t\t\t$allow_albums = ( $allow_albums ) ? $allow_albums : $this->glib->get_allowed_albums();\n\t\t\t\n\t\t\t$this->ipsclass->lang['top10'] = str_replace( \"<#NUM#>\", $this->num, $this->ipsclass->lang['top10']);\t\t\t\n \t\t\t\t\t\t\t\t\n\t\t\t$this->img_list->get_listing_data( array(\n 'st' => 0,\n 'show' => $this->num,\n 'approve' => 1,\n 'sort_key' => '(ratings_total/ratings_count)',\n\t\t\t\t 'sort_order' => 'DESC',\n 'allow_cats' => $allow_cats,\n 'allow_albums' => $allow_albums,\n ) );\n\t\t\t$this->output .= $this->html->index_list_top( $this->ipsclass->lang['top10'] ); \n\t\t\t$this->output .= $this->img_list->get_html_listing( array( 'imgs_per_col' => $this->cols, 'imgs_per_row' => $this->row ) ); \n\t\t\t$this->output .= $this->html->index_list_end();\n\t\t\t\n\t\t\t$this->output .= $this->html->cat_page_end();\n\t\t\t\n\t\t $this->nav[] = \"<a href='\".$this->ipsclass->base_url.\"act=module&module=gallery'>\".$this->ipsclass->lang['gallery'].\"</a>\";\n\t\t\t$this->nav[] = $this->ipsclass->lang['top10'];\n\t\t}",
"public function decreasePopularity($populartiy)\n\t{\n\t\t$this->attributes['popularity'] -= $popularity;\n\t}",
"public function itemPopularityDensity() {\n if (!$this->connected()) {\n exit(\"Database Connection Error.\");\n } //Kill method if no access to database\n $occuranceCountArray = array(); //declare empty array for top 10 items list\n $popularItems = getPopularItems(); //retrieve master popular items list \n echo \"<div><h2>Here are your top 10 most purchases items:</h2></div>\";\n for ($i = 0; $i < 10; $i++) { //loop through master items array selecting only the top 10\n array_push($occuranceCountArray, $popularItems[$i][1]);\n }\n //Create output table structure\n echo \"<br />\";\n echo \"<table style=width:25% border='1'>\"\n . \"<tr><th>Popularity Rank</th>\"\n . \"<th>Item</th>\"\n . \"</tr>\";\n //Loop and print out table rows for each of the top ten items\n foreach ($occuranceCountArray as $key => $value) {\n echo \"<tr><td>\" . ($key + 1) . \"</td><td>\" . $value . \"</td></tr>\";\n }\n echo \"</table>\";\n }",
"public function GetTopScores();",
"public function AddPopularityColumn($columns)\r\n {\r\n $columns['Popularity'] = __('Popularity', 'ms');\r\n return $columns;\r\n }",
"public function bowClassPopularity()\n {\n // Prepare the query\n $query = \\DB::table('scores')->select([\n 'bow_class',\n \\DB::raw('count(*) as count')\n ]);\n\n // Run the prepared query and order the results\n $results = $query->groupBy('bow_class')\n ->orderBy('bow_class', 'asc')\n ->get();\n\n // Map BowClass objects on the result set\n return $results->map(function($result){\n $result->bow_class = BowClass::find($result->bow_class);\n return $result;\n });\n }",
"public function initFavlikesRelatedByUserId()\n\t{\n\t\t$this->collFavlikesRelatedByUserId = array();\n\t}",
"public function getMyFeedByPopularity_post()\r\n {\r\n $user_id = $this->input->post('user_id');\r\n $user_type = $this->input->post('user_type');\r\n $loginuser_id = $this->input->post('loginuser_id');\r\n if (empty($user_id && $user_type && $loginuser_id)) {\r\n $this->response([\r\n 'status' => false,\r\n \"message\" => \"Please fill all the fields.\",\r\n ], REST_Controller::HTTP_NOT_FOUND);\r\n } else {\r\n $sort = $this->Feed_model->getMyFeedByPopularity($user_id, $user_type, $loginuser_id);\r\n $final = array();\r\n foreach ($sort as $value) {\r\n $author = explode(',', $value->author_id);\r\n $booker = explode(',', $value->booker_id);\r\n $tagger = explode(',', $value->tagger_id);\r\n $value->author = $this->Feed_model->UserNameId($author);\r\n $value->booker = $this->Feed_model->UserNameId($booker);\r\n $value->Tagger = $this->Feed_model->UserNameId($tagger);\r\n $final[] = $value;\r\n }\r\n if ($final) {\r\n $this->response([\r\n 'status' => true,\r\n 'Message' => 'Feed by popularity.',\r\n 'data' => $final,\r\n ], REST_Controller::HTTP_OK);\r\n } else {\r\n $this->response([\r\n 'status' => false,\r\n 'Message' => 'No feed found.',\r\n 'data' => $final,\r\n ], REST_Controller::HTTP_NOT_FOUND);\r\n }\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Publish Files for AvoRed Brand Modules. | public function publishFiles() {
$this->publishes([
__DIR__ . '/../resources/views' => base_path('themes/avored/default/views/vendor')
],'avored-module-views');
$this->publishes([
__DIR__ . '/../database/migrations' => database_path('avored-migrations'),
]);
} | [
"public function publishFiles() {\n\n $this->publishes([\n __DIR__ . '/../resources/views' => base_path('themes/avored/default/views/vendor')\n ],'avored-module-views');\n\n $this->publishes([\n __DIR__ . '/../database/migrations' => database_path('avored-migrations'),\n ]);\n }",
"public function defineAssetPublishing()\n {\n $this->publishes([\n CORE_PATH.'/public' => public_path('vendor/' . static::getModuleId()),\n ], static::getModuleId().'-assets');\n }",
"public function publishFiles()\n {\n $this->publishes([\n __DIR__ . '/../resources/views' => base_path('themes/avored/default/views/vendor')\n ], 'avored-banner-views');\n $this->publishes([\n __DIR__ . '/../database/migrations' => database_path('migrations'),\n ]);\n $this->publishes([\n __DIR__ . '/../dist/js' => public_path('avored-admin/js'),\n ]);\n }",
"private function publishFiles()\n {\n $publishTag = $this->_packageTag;\n\n $this->publishes([\n __DIR__.'/config/roles.php' => config_path('roles.php'),\n ], $publishTag.'-config');\n\n $this->publishes([\n __DIR__.'/Database/Migrations' => database_path('migrations'),\n ], $publishTag.'-migrations');\n\n $this->publishes([\n __DIR__.'/Database/Seeders/publish' => database_path('seeds'),\n ], $publishTag.'-seeds');\n\n $this->publishes([\n __DIR__.'/config/roles.php' => config_path('roles.php'),\n __DIR__.'/Database/Migrations' => database_path('migrations'),\n __DIR__.'/Database/Seeders/publish' => database_path('seeds'),\n ], $publishTag);\n\n $this->publishes([\n __DIR__.'/resources/views' => base_path('resources/views/vendor/'.$publishTag),\n ], $publishTag.'-views');\n\n $this->publishes([\n __DIR__.'/resources/lang' => base_path('resources/lang/vendor/'.$publishTag),\n ], $publishTag.'-lang');\n }",
"private function publish () {\n\n // Publish Translations\n $this->publishes([\n $this->packagePath('resources/lang') => resource_path('lang/vendor/redprint'),\n ], 'redprint-translations');\n\n // Publish views\n $this->publishes([\n $this->packagePath('resources/views') => resource_path('views/vendor'),\n ], 'redprint-views');\n \n // Publish assets\n $this->publishes([\n $this->packagePath('resources/assets') => public_path('vendor/redprint'),\n ], 'redprint-assets');\n\n // Publish Menu Config\n $this->publishes([\n $this->packagePath('config/menu.php') => config_path('menu.php'),\n ], 'redprint-menu');\n\n // Publish Redprint Config\n $this->publishes([\n $this->packagePath('config/redprint.php') => config_path('redprint.php'),\n ], 'redprint-config');\n\n }",
"public function publishAssetsVersion()\n {\n $directory = self::getAssetsVersionPath();\n\n //Create directory if not exists\n AdminFile::makeDirs($directory);\n\n $this->files->put($directory.'version.txt', self::getResourcesVersion());\n\n $htaccess = $directory.'.htaccess';\n\n if (! file_exists($htaccess)) {\n $this->files->put($htaccess, 'deny from all');\n }\n\n $this->addGitignoreFiles();\n }",
"public function defineAssetPublishing()\n {\n $this->publishes([\n __DIR__.'/../public' => public_path('vendor/cogroup/cms'),\n ], 'cogroupcms-assets');\n }",
"public function publishFiles()\n {\n $this->publishes([\n __DIR__ . '/../dist/js' => public_path('avored-admin/js'),\n ]);\n }",
"protected function defineAssetPublishing()\n {\n $sourceViewsPath = __DIR__ . '/../../resources/views';\n\n $this->publishes([\n $sourceViewsPath => resource_path('views/vendor/invoices'),\n ], 'views');\n\n // Publish a config file\n $this->publishes([\n __DIR__ . '/../../config/soap.invoices.php' => config_path('soap.invoices.php'),\n ], 'config');\n\n // Publish migrations\n $this->publishes([\n __DIR__ . '/../../database/migrations/2020_02_10_163005_create_invoices_tables.php'\n => database_path('migrations/2020_02_10_163005_create_invoices_tables.php'),\n ], 'migrations');\n }",
"private function publishPackage(): void\n {\n if ($this->app->runningInConsole()) {\n if (function_exists('config_path')) {\n $this->publishes([\n __DIR__ . '/../config/config.php' => config_path('hascrudactions.php'),\n ], 'config');\n }\n\n // Publishing the views.\n $this->publishes([\n __DIR__ . '/../resources/views' => resource_path('views/vendor/hascrudactions'),\n ], 'views');\n\n // Publishing the translation files.\n $this->publishes([\n __DIR__ . '/../resources/lang' => resource_path('lang/vendor/hascrudactions'),\n ], 'lang');\n\n // Publishing the assets files.\n $this->publishes([\n __DIR__ . '/../resources/assets' => public_path('vendor/hascrudactions'),\n ], 'assets');\n\n // Registering package commands.\n if (function_exists('config_path')) {\n $this->commands([\n CreateRepositoryCommand::class,\n CreateHascruActionCommand::class,\n InstallCommand::class,\n CreateViewCommand::class,\n CreateLatableCommand::class,\n CreateControllerCommand::class\n ]);\n } else {\n $this->commands([\n CreateHascruActionCommand::class,\n CreateRepositoryCommand::class,\n InstallCommand::class,\n ]);\n }\n }\n }",
"private function publishFiles(): void\n {\n $this->publishes([\n __DIR__.'/../config/utils.php' => config_path('utils.php'),\n ], 'utils-config');\n\n $this->publishes([\n __DIR__.'/Console/Commands/stubs' => base_path('stubs'),\n ], 'utils-stubs');\n }",
"private function publishAssets()\n {\n $assets = [\n 'public' => 'public/vendor/flare',\n ];\n\n foreach ($assets as $location => $asset) {\n $assets[$this->basePath($location)] = base_path($asset);\n }\n\n $this->publishes($assets, 'public');\n }",
"private function publishFiles(): void\n {\n $this->progress->setMessage('Publishing files');\n\n $this->callSilent('vendor:publish', ['--tag' => 'directus']);\n }",
"public function setupPublishFiles()\n {\n $this->publishes([\n __DIR__ . '/../config/avored.php' => config_path('avored.php'),\n ], 'avored-config');\n\n $this->publishes([\n __DIR__ . '/../dist' => public_path(),\n ], 'avored-public');\n }",
"public function _publishModuleAssets()\n\t{\n\t\tif (is_null($this->_cs))\n\t\t\t$this->_cs = Yii::app()->getClientScript();\n\n\t\tif (!is_string($this->baseScriptUrl)) {\n\t\t\t// Republish if in development mode\n\t\t\t$this->baseScriptUrl = ($this->development ?\n\t\t\t\tYii::app()->getAssetManager()->publish(Yii::getPathOfAlias('zags_wedding.assets'), false, -1, true) :\n\t\t\t\tYii::app()->getAssetManager()->publish(Yii::getPathOfAlias('zags_wedding.assets'))\n\t\t\t);\n\t\t}\n\t\t$this->_cs->registerCssFile('/elfinder2/css/elfinder.min.css');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/elFinder.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/i18n/elfinder.ru.js');\n\t\t$this->_cs->registerScriptFile($this->baseScriptUrl.'/js/authorIndex.js');\n\t\t$this->_cs->registerScriptFile($this->baseScriptUrl.'/js/jquery_masked_input.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/elFinder.version.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/jquery.elfinder.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/elFinder.resources.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/elFinder.options.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/elFinder.history.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/elFinder.command.js');\n\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/proxy/elFinderSupportVer1.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/jquery.dialogelfinder.js');\n\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/overlay.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/workzone.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/navbar.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/dialog.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/tree.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/cwd.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/toolbar.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/button.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/uploadButton.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/viewbutton.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/searchbutton.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/sortbutton.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/panel.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/contextmenu.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/path.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/stat.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/ui/places.js');\n\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/back.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/forward.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/reload.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/up.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/home.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/copy.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/cut.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/paste.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/open.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/rm.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/info.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/duplicate.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/rename.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/help.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/getfile.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/mkdir.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/mkfile.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/upload.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/download.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/edit.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/quicklook.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/quicklook.plugins.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/extract.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/archive.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/view.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/commands/search.js');\n\t\t$this->_cs->registerScriptFile('/elfinder2/js/jquery.smoothZoom.js');\n\t\t\n\t\tif($this->cssFile!==false) {\n\t\t\tif($this->cssFile===null)\n\t\t\t\t$this->cssFile= $this->baseScriptUrl.'/css/styles.css';\n\t\t\t$this->_cs->registerCssFile($this->cssFile);\n\t\t\t$this->_cs->registerScriptFile('/elfinder2/js/elFinder.js');\n\t\t}\n\t}",
"public function publishFiles()\n {\n $this->publishes([\n $this->getTranslationsDirectory() => $this->getPublishedTranslationsDirectory(),\n ]);\n }",
"protected function registerPublishableFiles()\n {\n $this->publishes([\n __DIR__.\"/../config/{$this->name}.php\" => config_path(\"{$this->name}.php\"),\n ], 'config');\n\n $this->publishes([\n __DIR__.\"/../resources/views\" => resource_path(\"views/vendor/{$this->name}\"),\n ], 'views');\n\n $this->publishes([\n __DIR__.\"/../resources/lang\" => resource_path(\"lang/vendor/{$this->name}\"),\n ], 'lang');\n }",
"public function defineAssetPublishing()\n {\n $this->publishes([\n SPARK_PATH.'/resources/assets/js' => resource_path('assets/js/spark'),\n ], 'spark-js');\n\n $this->publishes([\n SPARK_PATH.'/resources/assets/sass' => resource_path('assets/sass/spark'),\n ], 'spark-sass');\n }",
"private function deploy_assets() {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public Static Member Functions Name: get_current_workshops() Desc: Returns the current workshops. | public static function get_current_workshops()
{
if ( !self::$current_workshops )
{
// Get the current workshops.
self::$current_workshops = Legato_Resource::order_by( 'time', 'asc' )->
fetch( 'Workshop', array( 'advisor_id' => $GLOBALS['advisor']->get( 'id' ),
'time >' => time() ) );
}
// Return the current workshops.
return self::$current_workshops;
} | [
"protected function getShops()\n {\n $shops = Shop::getShops();\n\n if (Shop::isFeatureActive()) {\n if (0 < $this->shopId) {\n if (isset($shops[$this->shopId])) {\n RetailcrmLogger::writeDebug(\n __METHOD__,\n sprintf(\n 'Running job for shop %s (%s).',\n $shops[$this->shopId]['name'],\n $this->shopId\n )\n );\n\n return [$shops[$this->shopId]];\n } else {\n RetailcrmLogger::writeDebug(\n __METHOD__,\n sprintf(\n 'Shop with id=%s not found.',\n $this->shopId\n )\n );\n\n return [];\n }\n }\n\n return $shops;\n } else {\n return [$shops[Shop::getContextShopID()]];\n }\n }",
"public function getWorkshops() {\r\n $sql = \"SELECT workshop.name, workshop.id FROM workshop ORDER BY id DESC\";\r\n $query=$this->db->prepare($sql);\r\n $query->execute();\r\n return $query->fetchAll(PDO::FETCH_OBJ);\r\n }",
"public function workshops( $params ) \n { \n $this->_setModels([ 'workshops/ModelQuestions' ]);\n \n $modelQuestions = $this->_models[ 'ModelQuestions' ];\n\n $orm = new Orm( 'workshops', $this->_dbTables['workshops'] );\n \n $workshops = $this ->_baseWorkshopsQuery( $orm, $params )\n ->_exeWorkshopsQuery( $orm );\n\n \n if( isset( $workshops ) )\n {\n foreach( $workshops as $workshop )\n { \n $workshop->users = $this->workshopUsersInfo([ 'workshop_user.IdWorkshop' => $workshop->IdWorkshop ]);\n \n if( isset( $workshop->users ) )\n {\n foreach( $workshop->users as $user )\n {\n $user->loginUrl = Login::tokenizerLoginUrl( 'workshops', $user->EmailUser, $user->IdUserWorkshop );\n /*\n $user->infos = new stdClass;\n \n $user->infos->questionsGen = $modelQuestions->questions( [ 'IdWorkshop' => 0 ], true );\n \n $this->infos->questionsSpec = $modelQuestions->questions( [ 'IdWorkshop' => $user->IdWorkshop ], true );\n */\n }\n }\n \n } \n }\n \n return $workshops;\n }",
"function get_all_workshops()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('workshops')->result_array();\n }",
"public function getWorksHistory()\n\t{\n\t\t$ci =& get_instance();\n\n\t\t$ci->load->library('crew/work_history');\n\n return $ci->work_history->getModel()->get_by_crew($this->crew_id, 1000);\n\t}",
"public function getWorkloads()\n {\n return $this->workloads;\n }",
"public function getWorkItems()\n {\n return $this->hasMany(WorkItem::className(), ['construction_site_id' => 'id']);\n }",
"public function getAllActiveWorkshops()\n {\n $em = $this->getEntityManager();\n $qb = $em->createQueryBuilder();\n $oDate = new \\DateTime('now');\n\n $q = $qb->select(array('workshop'))\n ->from('CoreEntityBundle:Workshop', 'workshop')\n ->where(\n $qb->expr()->gt('workshop.start_at', ':now')\n )\n ->orderBy('workshop.start_at', 'ASC');\n $q->setParameter('now', $oDate);\n $result = $q->getQuery()->getResult(\\Doctrine\\ORM\\Query::HYDRATE_ARRAY);\n if (!$result) {\n return false;\n } else {\n foreach ($result as $key => $workshop) {\n $result[$key]['numParticipants'] = $this->getParticipants($workshop['id']);\n }\n return $result;\n }\n }",
"public function actionIndex()\n {\n $searchModel = new WorkshopsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getWorkWiseConnection() {\n return $this->workWiseConnection;\n }",
"public function getWorkshopList(){\n \n $query=\"SELECT w.workshop_name,w.workshop_id,u.sub_user_type_role,s.sub_role_name,count(u.sub_user_type_role) as num_workshop_attended \"\n . \" FROM `d_workshop_facilitator` w INNER JOIN h_workshop_facilitator_user u on u.workshop_id = w.workshop_id \"\n . \" INNER JOIN d_user_sub_role s on s.sub_role_id = u.sub_user_type_role WHERE u.user_id=47 GROUP by u.sub_user_type_role \";\n \n return $this->db->get_results($query);\n }",
"public function getActiveShops()\n\t{\n\t\treturn $this->shopRepository->findBy(['deleted' => false], ['name' => 'ASC']);\n\t}",
"public static function getContextShops()\n {\n if (_PS_VERSION_ >= '1.5' && Shop::isFeatureActive() && Shop::getContext() !== Shop::CONTEXT_SHOP) {\n if (Shop::getContext() === Shop::CONTEXT_GROUP) {\n return Shop::getShops(true, Shop::getContextShopGroupID()) ;\n } else {\n return Shop::getShops(true) ;\n }\n } else {\n return array(1 => array(\n 'id_shop' => 1,\n 'id_shop_group' => 1,\n ),\n ) ;\n }\n }",
"public function get_workouts()\n {\n }",
"public function getAllWorkshops()\n {\n $em = $this->getEntityManager();\n $qb = $em->createQueryBuilder();\n\n $q = $qb->select(array('workshop'))\n ->from('CoreEntityBundle:Workshop', 'workshop')\n ->orderBy('workshop.start_at', 'ASC');\n $result = $q->getQuery()->getResult(\\Doctrine\\ORM\\Query::HYDRATE_ARRAY);\n if (!$result) {\n return false;\n } else {\n foreach ($result as $key => $workshop) {\n $result[$key]['numParticipants'] = $this->getParticipants($workshop['id']);\n }\n return $result;\n }\n }",
"public function getWorkshop()\n {\n return $this->hasOne(Workshops::className(), ['Id_workshop' => 'Id_workshop']);\n }",
"public function getCurrentWishlist()\n {\n if (!$this->_current) {\n $wishlistId = $this->getRequest()->getParam('wishlist_id');\n if ($wishlistId) {\n $this->_current = $this->getWishlists()->getItemById($wishlistId);\n } else {\n $this->_current = $this->getDefaultWishlist();\n }\n }\n return $this->_current;\n }",
"public function getCurrentWorkspace() {}",
"function &GetWorkgroups()\n {\n return $this->workgroups;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an empty closure. | public static function getClosure()
{
return function() {};
} | [
"public function getClosure(): \\Closure;",
"function lempty(): Closure {\n return fn($x) => empty($x);\n}",
"public function getClosure()\n {\n }",
"public final function getClosure() : \\Closure {\r\n return $this->_closure;\r\n }",
"public function getClosure()\n {\n return function () {\n return $this->val;\n };\n }",
"public function getClosure() : Closure\n {\n return $this->closure;\n }",
"public function toClosure(): \\Closure;",
"public function getClosure()\n {\n return $this->_closure;\n }",
"protected function cleanMemoryClosureFactory(): Closure\n {\n return function () {\n $this->clearMemory();\n };\n }",
"protected function makeNullLogCallback(): callable\n {\n return function (string $type, MessageInterface $message, Builder $builder) {\n // N/A...\n };\n }",
"function identity ()\n{\n return function ($a) { return $a; };\n}",
"public function getDefaultFlagHandler(): ?\\Closure\n {\n return $this->default_flag_handler;\n }",
"public function getIterationClosure();",
"protected function makeNullDebugCallback(): callable\n {\n return function (string $type, MessageInterface $message, Builder $builder) {\n // N/A...\n };\n }",
"function noop(){ }",
"public function testEmptyStrategies()\n {\n $closure = mappings\\select([]);\n $this->assertEquals([], $closure(null, 0));\n $this->assertEquals([], $closure([], 0));\n $this->assertEquals([], $closure('foo', 0));\n $this->assertEquals([], $closure(['foo'], 0));\n }",
"public static function forEmptyExpression(): self\n {\n return new self(self::EMPTY_EXPRESSION_MESSAGE);\n }",
"public function whenEmpty(callable $callback, callable $default = null);",
"public function getClosureThis()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the root element. Simple accessor to $rootElement | public function getRootElement() {
return $this->rootElement;
} | [
"public function getRootElement()\n {\n return $this->rootElement;\n }",
"public function getRootElement()\n {\n return $this->document->documentElement;\n }",
"function root()\n {\n return new Horde_DOM_Element($this->node->documentElement, $this);\n }",
"public function getRootElement()\r\n\t{\r\n\t\tif($this->root_element instanceof DOMElement){\r\n\t\t\treturn $this->root_element;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthrow new OutputerException( 'Could not return DOMElement. DOMDocument is not initialized.', 112 );\r\n\t\t}\r\n\t}",
"public function getRootElement();",
"public function root(): Root\n {\n return $this->root;\n }",
"function get_root() {\n return $this->root;\n }",
"public function getRootWidget()\n {\n return $this->rootWidgetNode;\n }",
"private static function getXMLRoot()\n {\n if (self::$xml === null) {\n self::init();\n }\n\n return self::$xml;\n }",
"function document_element()\n {\n return $this->root();\n }",
"function getRoot(){\n\t\t return $this->root; \n\t\t}",
"public function & getRoot()\n\t{\n\t\t$r = null;\n\t\tforeach($this->m_document->childNodes as $c)\n\t\t{\n\t\t\tif($c->nodeType == XML_ELEMENT_NODE)\n\t\t\t{\n\t\t\t\t$r = new ZXmlTag($c);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(!$r)\n\t\t\t$r = new ZXmlTag($this->m_document);\n\n\t\treturn $r;\n\t}",
"private function add_root ()\n {\n if ($this->root_element) {\n // create a root element\n $root = $this->createElement($this->root_element);\n // append it to the document itself\n $root = $this->appendChild($root);\n return $root;\n }\n return $this;\n }",
"public function getTreeRoot();",
"public function getRootElementName()\n {\n return $this->rootElementName;\n }",
"public static function root()\n {\n return static::resolve(static::accessor());\n }",
"public function getRoot(){\n\t\treturn $this->fakeRoot;\n\t}",
"public function getRootPane() {\n return $this->rootPane;\n }",
"public function getRootNode(){\n\t\tif(!$this->root_node) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $this->root_node;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the post thumbnail for the specified post Id by getting a thumbnail of the specified asset. | function hewa_admin_set_post_thumbnail( $asset_id, $post_id ) {
// Get the post title.
$post = get_post( $post_id );
$post_title = $post->post_title;
// Get the image from the remote server, then save it locally.
$response = hewa_admin_request_still_image( $asset_id, HEWA_STILL_IMAGE_WIDTH, HEWA_STILL_IMAGE_TIMECODE_SECONDS );
$image_name = 'a' . $asset_id . '-w' . HEWA_STILL_IMAGE_WIDTH . '-s' . HEWA_STILL_IMAGE_TIMECODE_SECONDS . '.png';
$image = hewa_admin_save_response_body( $response['body'], $image_name );
// Create an attachment.
$attachment = array(
'guid' => $image['guid'],
// post_title, post_content (the value for this key should be the empty string), post_status and post_mime_type
'post_title' => $post_title, // Set the title to the post title.
'post_content' => '',
'post_status' => 'inherit',
'post_mime_type' => HEWA_STILL_IMAGE_CONTENT_TYPE
);
// Create the attachment in WordPress and generate the related metadata.
$attachment_id = wp_insert_attachment( $attachment, $image['path'], $post_id );
$attachment_data = wp_generate_attachment_metadata( $attachment_id, $image['path'] );
wp_update_attachment_metadata( $attachment_id, $attachment_data );
// Set it as the featured image.
set_post_thumbnail( $post_id, $attachment_id );
} | [
"public function action_set_thumbnail_id(){\n $attachment_id = (int) services\\Request::req( 'attachment_id', false );\n $post_id = (int) services\\Request::req( 'post_id', false );\n if ($attachment_id != false || $post_id != false) :\n if (!is_int( $post_id )) return false;\n $this->Services->setThumbnail($attachment_id, $post_id);\n endif;\n }",
"function set_post_thumbnail($post, $thumbnail_id)\n{\n}",
"function set_thumbnail() {\n\tglobal $post_ID; // have to do this so get_upload_iframe_src() can grab it\n\t$post_ID = intval($_POST['post_id']);\n\tif ( !current_user_can('edit_post', $post_ID))\n\t\tdie('-1');\n\t$thumbnail_id = intval($_POST['thumbnail_id']);\n\n\tcheck_ajax_referer(\"set_post_sliderindex-post-sliderindex-{$post_ID}\");\n\n\tif ($thumbnail_id == '-1') {\n\t\tdelete_post_meta($post_ID, \"post_sliderindex_thumbnail_id\");\n\t\tdie(post_thumbnail_html(null));\n\t}\n\n\tif ($thumbnail_id && get_post($thumbnail_id)) {\n\t\t$thumbnail_html = wp_get_attachment_image($thumbnail_id, 'thumbnail');\n\t\tif (!empty($thumbnail_html)) {\n\t\t\tupdate_post_meta($post_ID, \"post_sliderindex_thumbnail_id\", $thumbnail_id);\n\t\t\tdie(post_thumbnail_html($thumbnail_id));\n\t\t}\n\t}\n\n\tdie('0');\n}",
"public function menu_set_thumbnail() {\n $json = ! empty( $_REQUEST[ 'json' ] );\n $post_ID = intval( $_POST[ 'post_id' ] );\n\n if ( ! current_user_can( 'edit_post', $post_ID ) ) {\n wp_die( - 1 );\n }\n\n $thumbnail_id = intval( $_POST[ 'thumbnail_id' ] );\n\n check_ajax_referer( 'update-menu-item' );\n\n if ( $thumbnail_id == '-1' ) {\n $success = delete_post_thumbnail( $post_ID );\n } else {\n $success = set_post_thumbnail( $post_ID, $thumbnail_id );\n }\n\n if ( $success ) {\n $return = $this->wp_post_get_html( $post_ID );\n $json ? wp_send_json_success( $return ) : wp_die( $return );\n }\n\n wp_die( 0 );\n }",
"function set_featured_image( $postID, $post ) {\n\tif ( class_exists( 'WPRM_Recipe' ) ) {\n\t\t$content = \\parse_blocks( $post->post_content );\n\t\tif ( isset( $content[0], $content[0]['attrs'], $content[0]['attrs']['id'] ) ) {\n\t\t\t$recipe_id = $content[0]['attrs']['id'];\n\t\t\t$recipe = get_post( $recipe_id );\n\t\t\t$thumbnail_id = ( new \\WPRM_Recipe( $recipe ) )->image_id();\n\t\t\tset_post_thumbnail( $post, $thumbnail_id );\n\t\t}\n\t}\n}",
"function ooyala_set() {\n\t\tglobal $post_ID;\n\n\t\t$nonce = isset( $_POST ['_wpnonce'] ) ? $_POST['_wpnonce'] : '';\n\n\t\tif (! wp_verify_nonce($nonce, 'ooyala') )\n\t\t \tdie('Security check');\n\n\t\t$_post_id = absint( $_POST['postid'] );\n\n\t\t// Make sure the global is set, otherwise the nonce check in set_post_thumbnail() will fail\n\t\t$post_ID = (int) $_post_id;\n\n\t\t//Let's set the thumbnails size\n\t\tif ( isset($_wp_additional_image_sizes['post-thumbnail']) ) {\n\t\t\t$thumbnail_width = $_wp_additional_image_sizes['post-thumbnail']['width'];\n\t\t\t$thumbnail_height = $_wp_additional_image_sizes['post-thumbnail']['height'];\n\t\t}\n\t\telse {\n\t\t\t$thumbnail_width = 640;\n\t\t\t$thumbnail_height = 640;\n\t\t}\n\n\t\t$url = isset( $_POST['img'] ) ? esc_attr( $_POST['img'] ) : '';\n\t\t$thumbnail_id = $this->set_thumbnail( $url, $_post_id );\n\n\t\tif ( false !== $thumbnail_id ) {\n\t\t\tset_post_thumbnail( $_post_id, $thumbnail_id );\n\t\t\tdie( _wp_post_thumbnail_html( $thumbnail_id ) );\n\t\t}\n\n\t}",
"function wp_ajax_set_post_thumbnail() {}",
"public static function from_post_thumbnail( $post = 0 ): Image {\n\t\t$post = get_post( $post );\n\t\t$id = isset( $post->ID ) ? $post->ID : 0;\n\t\t$attachment_id = get_post_thumbnail_id( $id );\n\n\t\treturn self::from_acf( acf_get_attachment( $attachment_id ) );\n\t}",
"private function applyThumbnailChanges($post_id) {\n foreach($this->changes as $change) {\n if ($change['type'] != 'thumbnail') {\n continue;\n }\n\n if (isset($change['set'])) {\n set_post_thumbnail($post_id, $change['set']);\n } else if (isset($change['clear'])) {\n delete_post_thumbnail($post_id);\n }\n }\n }",
"public function wp_ajax_set_post_thumbnail() {\n\n\t\t$this->load_images();\n\n\t\tif ( $this->images_loaded ) {\n\t\t\tadd_filter( 'admin_post_thumbnail_html', array( $this, 'admin_post_thumbnail_html' ) );\n\t\t}\n\t}",
"function set_revista_thumbnail( $post_id ) {\n\tglobal $post;\n\n\t$current_data = get_post_meta( $post_id, '_issu_documentid', true );\n\tif(!is_object($post)) {\n\t\t$post = get_post($post_id);\n\t}\n\t$content = $post->post_content;\n\tif( isset($_POST) && array_key_exists('content', $_POST)) {\n\t\t$content = $_POST['content'];\n\t}\n\t\n\t// Procura o id da revista\n\tif( preg_match('/documentid=([\\w|-]*)/i', $content, $matches ) && count($matches) > 1 ) {\n $new_data = $matches[1];\n \tif ( $current_data )\n \t{\n \t\tif ( is_null( $new_data ) )\n \t\t\tdelete_post_meta( $post_id, '_issu_documentid' );\n \t\telse\n \t\t\tupdate_post_meta( $post_id, '_issu_documentid', $new_data );\n \t}\n \telseif ( ! is_null( $new_data ) )\n \t{\n \t\tadd_post_meta( $post_id, '_issu_documentid', $new_data, true);\n \t}\n\t}\n\telse\n\t{\n\t\tif( preg_match('/src=\\\"([\\S]*)\\\"|src=\\\\\\\"([\\S]*)\\\\\\\"/i', $content, $matches) )\n\t {\n\t $url = '';\n\t if( !empty($matches[1]) )\n\t {\n\t $url = $matches[1];\n\t }\n\t elseif( count($matches) > 2 && !empty($matches[2]) )\n\t {\n\t $url = $matches[2];\n\t }\n\t else\n\t {\n\t return false;\n\t }\n\t \n\t if(substr($url, 0, 5) != 'http:')\n\t {\n\t $url = 'http:'.$url;\n\t }\n\t \n\t $embed_id = substr($url, strripos($url, '/') + 1);\n\t try\n\t {\n\t $file = file_get_contents(\"https://e.issuu.com/config/{$embed_id}.json\");\n\t }\n\t catch (Exception $e)\n\t {\n\t return false;\n\t }\n\t \n\t $embed_json = gzdecode($file);\n\t if($embed_json !== false)\n\t {\n \t $embed_doc = json_decode($embed_json, true);\n \t if($embed_doc)\n \t {\n \t try\n \t {\n \t $file = file_get_contents(\"https://reader3.isu.pub/{$embed_doc['ownerUsername']}/{$embed_doc['documentURI']}/reader3_4.json\");\n \t }\n \t catch (Exception $e)\n \t {\n \t return false;\n \t }\n \t \n \t \n \t $json = gzdecode($file);\n \t if($json !== false)\n \t {\n \t $doc_info = json_decode($json);\n \t if($doc_info)\n \t {\n \t $documentId = \"{$doc_info->document->revisionId}-{$doc_info->document->publicationId}\";\n \t if ( $current_data )\n \t {\n \t if ( is_null( $documentId ) )\n \t delete_post_meta( $post_id, '_issu_documentid' );\n \t else\n \t update_post_meta( $post_id, '_issu_documentid', $documentId );\n \t }\n \t elseif ( ! is_null( $documentId ) )\n \t {\n \t add_post_meta( $post_id, '_issu_documentid', $documentId, true);\n \t }\n \t }\n \t }\n \t }\n\t }\n\t }\n\t}\n}",
"function wpra_set_featured_image_from_url($post_id, $url)\n{\n // Download image if needed\n if (!wpra_is_url_local($url)) {\n wpra_media_sideload_image($url, $post_id, true);\n\n return;\n }\n\n // Otherwise, get the attachment ID for the URL from the database\n set_post_thumbnail( $post_id, wpra_get_attachment_id_from_url($url) );\n}",
"private function _SetPostHasntImage($post_id)\n {\n \t$this->db->update($this->c_table, array('image'=>''), array($this->id_column=>$post_id));\n }",
"static function on_save_post_get_video_thumb($post_id) {\n\n\t\t//verify post is not a revision\n\t\tif ( !wp_is_post_revision( $post_id ) ) {\n\t\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$td_post_video = get_post_meta($post_id, 'td_post_video', true);\n\n\t\t\t//check to see if the url is valid\n\t\t\tif (empty($td_post_video['td_video']) or self::validate_video_url($td_post_video['td_video']) === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!empty($td_post_video['td_last_video']) and $td_post_video['td_last_video'] == $td_post_video['td_video']) {\n\t\t\t\t//we did not update the url\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$videoThumbUrl = self::get_thumb_url($td_post_video['td_video']);\n\n\t\t\tif (!empty($videoThumbUrl)) {\n\t\t\t\tself::$on_save_post_post_id = $post_id;\n\n\t\t\t\t// add the function above to catch the attachments creation\n\t\t\t\tadd_action('add_attachment', array(__CLASS__, 'on_add_attachment_set_featured_image'));\n\n\t\t\t\t// load the attachment from the URL\n\t\t\t\tmedia_sideload_image($videoThumbUrl, $post_id, $post_id);\n\n\t\t\t\t// we have the Image now, and the function above will have fired too setting the thumbnail ID in the process, so lets remove the hook so we don't cause any more trouble\n\t\t\t\tremove_action('add_attachment', array(__CLASS__, 'on_add_attachment_set_featured_image'));\n\t\t\t}\n\t\t}\n\t}",
"function p75_saveThumb( $postID )\n{\n\tglobal $wpdb;\n\n\t// Get the correct post ID if revision.\n\tif ( $wpdb->get_var(\"SELECT post_type FROM $wpdb->posts WHERE ID=$postID\")=='revision')\n\t\t$postID = $wpdb->get_var(\"SELECT post_parent FROM $wpdb->posts WHERE ID=$postID\");\n\n\tif ( $_POST['p75-thumb-delete'] )\n\t{\n\t\t@unlink(P75_THUMB_DIR . get_post_meta($postID, '_p75_thumbnail', true));\n\t\tdelete_post_meta($postID, '_p75_thumbnail');\n\t}\n\telseif ( $_POST['p75-thumb-url-upload'] || !empty($_FILES['p75-thumbnail']['tmp_name']) )\n\t{\n\t\tif ( !empty($_FILES['p75-thumbnail']['name']) )\n\t\t\tpreg_match(\"/(\\.(?:jpg|jpeg|png|gif))$/i\", $_FILES['p75-thumbnail']['name'], $matches);\n\t\telse\n\t\t\tpreg_match(\"/(\\.(?:jpg|jpeg|png|gif))$/i\", $_POST['p75-thumb-url-upload'], $matches);\n\t\t\n\t\t$thumbFileName = $postID . strtolower($matches[0]);\n \n\t\t// Location of thumbnail on server.\n\t\t$loc = P75_THUMB_DIR . $thumbFileName;\n\t\t\n\t\t$thumbUploaded = false;\n \n\t\tif ( $_POST['p75-thumb-url-upload'] )\n\t\t{\n\t\t\t// Try just using fopen to download the image.\n\t\t\tif( ini_get('allow_url_fopen') )\n\t\t\t{\n\t\t\t\tcopy($_POST['p75-thumb-url-upload'], $loc);\n\t\t\t\t$thumbUploaded = true;\n\t\t\t}\n\t\t\telse\n\t\t\t\n\t\t\t// If fopen doesn't work, try cURL.\n\t\t\tif( function_exists('curl_init') )\n\t\t\t{\n\t\t\t\t$ch = curl_init($_POST['p75-thumb-url-upload']);\n\t\t\t\t$fp = fopen($loc, \"wb\");\n \n\t\t\t\t$options = array(CURLOPT_FILE => $fp,\n\t\t\t\t\tCURLOPT_HEADER => 0,\n\t\t\t\t\tCURLOPT_FOLLOWLOCATION => 1,\n\t\t\t\t\tCURLOPT_TIMEOUT => 60);\n\t\t\t\tcurl_setopt_array($ch, $options);\n\t\t\t\t\n\t\t\t\tcurl_exec($ch);\n\t\t\t\tcurl_close($ch);\n \n\t\t\t\tfclose($fp);\n\t\t\t\t$thumbUploaded = true;\n\t\t\t}\n\t\t}\n\t\telse\n \n\t\t// Attempt to move the uploaded thumbnail to the thumbnail directory.\n\t\tif ( !empty($_FILES['p75-thumbnail']['tmp_name']) && move_uploaded_file($_FILES['p75-thumbnail']['tmp_name'], $loc) )\n\t\t\t$thumbUploaded = true;\n\t\t\n\t\tif ( $thumbUploaded )\n\t\t{\n\t\t\tif ( !update_post_meta($postID, '_p75_thumbnail', $thumbFileName) )\n\t\t\t\tadd_post_meta($postID, '_p75_thumbnail', $thumbFileName);\n\t\t}\n\n\t}\n}",
"function pm_get_post_thumbnail( $size=null, $post_id=null ) {\n \tif( $post_id ) {\n \t\t$post = get_post( $post_id );\n \t}\t\n\telse {\n \t\tglobal $post;\n\t}\n \n \tif ( has_post_thumbnail( $post->ID ) ) {\n\t \t$thumb = new stdClass();\n\t \n\t \t// get/set thumbnail id\n\t \t$thumb->id = get_post_thumbnail_id( $post->ID );\n\t\t\n\t\t// get thumb src based on provided size\n\t\t$thumb_src = ( $size ) ? wp_get_attachment_image_src( $thumb->id , $size ) : null;\t\n\t\t\n\t\t// get thumbnail post data\n\t\t$post_data = get_post( $thumb->id );\n\t\t$post_meta = get_post_meta( $thumb->id );\n\n\t\t// load more meta\n\t\t$post_attachment_meta = ( isset( $post_meta['_wp_attachment_metadata'][0] ) ) ? unserialize( $post_meta['_wp_attachment_metadata'][0] ) : null;\n\t\t\n\t\t// load credit from custom field\n\t\t$thumb->credit = ( isset( $post_meta['_pm_attachment_credit'][0] ) ) ? $post_meta['_pm_attachment_credit'][0] : null;\n\n\t\t// set thumb properties\n\t\t$thumb->title = $post_data->post_title;\n\t\t$thumb->description = $post_data->post_content;\n\t\t//$thumb->caption = $post_data->post_excerpt;\n\t\t$thumb->caption = ( !empty( $post_data->post_excerpt ) ) ? $post_data->post_excerpt : $thumb->description; // fall back to description as this was normally populated\n\t\t$thumb->url = ( $thumb_src ) ? $thumb_src[0] : $post_data->guid;\n\t\t$thumb->width = ( $thumb_src ) ? $thumb_src[1] : ( ( $post_attachment_meta ) ? $post_attachment_meta['width'] : '' );\n\t\t$thumb->height = ( $thumb_src ) ? $thumb_src[2] : ( ( $post_attachment_meta ) ? $post_attachment_meta['height'] : '' );\n\t \t$thumb->alt = $post->post_title; // title of post\n\t \t\n\t\t// ALT: check if alt then excerpt available to replace title\n\t\tif ( isset( $post_meta['_wp_attachment_image_alt'][0] ) && strlen( trim( $post_meta['_wp_attachment_image_alt'][0] ) ) > 0 )\n\t\t\t$thumb->alt = $post_meta['_wp_attachment_image_alt'][0]; // alt of image\n\t\telse if ( !empty( $post_data->post_excerpt ) )\n\t\t\t$thumb->alt = $post_data->post_excerpt; // caption of image\n\t\telse if ( !empty( $post_data->post_title ) )\n\t\t\t$thumb->alt = $post_data->post_title; // title of image\n\t\t\n\t\t// description not wanted as an alt fallback\n\t\t//else if ( !empty( $post_data->post_content ) )\n\t\t//\t$thumb->alt = strip_tags( $post_data->post_content );\n\t\t\n\t\treturn $thumb;\n\t}\n\t\n\treturn null; \n}",
"function get_thumb ( $post_ID, $size = 'thumb-small' ){\n if ( function_exists( 'has_post_thumbnail' ) && has_post_thumbnail( $post_ID ) ) {\n return get_the_post_thumbnail( $post_ID, $size );\n } else {\n $thumbargs = array(\n 'post_type' => 'attachment',\n 'numberposts' => 1,\n 'post_status' => null,\n 'post_parent' => $post_ID,\n );\n $thumb = get_posts( $thumbargs );\n if ($thumb)\n return wp_get_attachment_image( $thumb[0]->ID, $size );\n }\n}",
"function hype_reset_thumb_transient( $post_id ) {\n delete_transient( 'featured_image_' . $post_id );\n\n if ( has_post_thumbnail( $post_id ) ) {\n hype_set_thumb_transient( $post_id );\n }\n}",
"public static function getPostThumbID($postID){\n\t\t\t$thumbID = get_post_thumbnail_id( $postID );\n\t\t\treturn($thumbID);\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies version to the supplied path. | protected function applyVersion($path, $version = null)
{
$file = $path;
// apply the base path
if ('/' !== substr($path, 0, 1)) {
$file = '/'.$path;
}
$reved = $this->getRevedFilename($file);
$fullpath = $this->rootDir . $file;
$fullreved = $this->rootDir . $reved;
// $reved or unversioned
if (file_exists($fullreved)) {
return $reved;
// fallback
} else {
$pattern = preg_replace('/\.([^\.]+$)/', '.*.$1', $fullpath);
$regex = preg_replace('/\.([^\.]+$)/', '\.[\d\w]{8}\.$1', $fullpath);
$base = str_replace($path, '', $fullpath);
foreach (glob($pattern) as $filepath) {
if (preg_match('#' . $regex . '#', $filepath)) {
$result = str_replace($base, '', $filepath);
$this->summary->set($file, $result);
return $result;
}
};
}
return $path;
} | [
"public function applyVersion($path);",
"public function applyVersion($path)\n {\n $reved = $this->getRevedFilename($path);\n\n $absPath = implode(DIRECTORY_SEPARATOR, [$this->rootDir,$path]);\n $absReved = implode(DIRECTORY_SEPARATOR, [$this->rootDir,$reved]);\n\n // $reved or unversioned\n if (file_exists($absReved)) {\n return $reved;\n\n // look in filesystem\n } else {\n $pattern = preg_replace('/\\.([^\\.]+$)/', $this->separator.'*.$1', $absPath);\n $regex = preg_replace('/\\.([^\\.]+$)/', '\\\\'.$this->separator.'[\\d\\w]{'.$this->hashLength.'}\\.$1', $absPath);\n $base = str_replace($path, '', $absPath);\n foreach (glob($pattern) as $filepath) {\n if (preg_match('#'.$regex.'#', $filepath, $match)) {\n $result = str_replace($base, '', $filepath);\n $this->summary->set($path, $result);\n\n return $result;\n }\n };\n\n }\n\n return $path;\n }",
"protected function getVersionFromPath($path)\n {\n $parts = explode(DIRECTORY_SEPARATOR, $path);\n $f = array_pop($parts);\n $v = array_pop($parts);\n return $v.$f;\n }",
"protected function appendVersionToPath(string $path) : string\n {\n if (!$this->autoversioning) {\n return ($this->version) ? ($path . '?v=' . $this->version) : ($path);\n }\n\n $path_url = parse_url($path);\n $version = $this->getFileVersion($path, $path_url);\n\n if ($version) {\n if (!isset($path_url['query']) || empty($path_url['query'])) {\n $path = sprintf('%s?v=%s', $path_url['path'], $version);\n } else {\n $path = sprintf('%s?%s&v=%s', $path_url['path'], $path_url['query'], $version);\n }\n }\n\n return $path;\n }",
"protected function appendVersionToPath(string $path) : string\n {\n return ($this->version) ? ($path . '?v=' . $this->version) : ($path);\n }",
"public function upgrade($path, $options = []);",
"protected function callComposerUpdate($path)\n {\n chdir($path);\n\n // passthru('composer install --dev');\n passthru('composer dump-autoload');\n }",
"public function update($path = null)\n {\n $this->executeNpm(array('update'), $path);\n }",
"public function setVersion($path, $version, View $view) {\n\t\t$fileInfo= $view->getFileInfo($path);\n\n\t\tif($fileInfo !== false) {\n\t\t\t$cache = $fileInfo->getStorage()->getCache();\n\t\t\t$cache->update($fileInfo->getId(), ['encrypted' => $version, 'encryptedVersion' => $version]);\n\t\t}\n\t}",
"protected function updateFile($path)\n {\n $contents = file_get_contents($path);\n\n $contents = preg_replace('/(^Route::.*\\;)/ms', '', $contents);\n\n file_put_contents($path, $contents);\n }",
"protected function patchPath($path)\n {\n foreach ($this->patch as $param => $map) {\n foreach ($map as $search => $replace) {\n if ($search == $replace) {\n continue;\n }\n\n $search = $param . '/' . $search;\n if ($replace) {\n // if replacement is not empty, try to replace the value\n $patched = str_replace($search, $param . '/' . $replace, $path, $count);\n if ($count > 0) {\n if (isValidCopyPath($patched)) {\n return $patched;\n }\n return null;\n }\n } else {\n // if replacement is empty, it means that the file should be excluded from the package\n if (strpos($path, $search) !== false) {\n return null;\n }\n }\n }\n }\n\n return $path;\n }",
"public function touch($path){\n return $this->getResource($path)->touch();\n }",
"public static function AddVersionParameterToPath(\n\t\t\tstring $path,\n\t\t\tstring $websiteRoot,\n\t\t\tstring $version=\"\"\n\t\t) {\n\t\t\treturn self::GenerateFullUrl($path, \"\", [], [\n\t\t\t\t\"v\" => $version\n\t\t\t], $websiteRoot);\n\t\t}",
"public function setAcl($path, $version, $acl){}",
"private function updateCacheVersion()\n {\n $version = md5($this->app['bolt_version'].$this->app['bolt_name']);\n file_put_contents($this->getDirectory() . '/.version', $version);\n }",
"public function appendPath($path);",
"function setrev($path, $rev)\n {\n if ($rev)\n {\n if (!isset($this->distindex[$path]) || $this->distindex[$path] !== $rev)\n {\n JobControl::print_line_for($path, \"latest version updated to $rev\");\n $this->distindex[$path] = $rev;\n }\n $this->localindex['revs'][$this->dist[$path]['path']] = $rev;\n }\n }",
"private function add_version($match) {\n\t\t\n\t\t// Strip off any hash or query vars.\n\t\t// TODO: reappend the hash and query vars.\n\t\t$originalPath = preg_replace('|([\\?#].*)$|', '', trim($match[1],\"' \"));\n\t\t$path = $this->originaldir . '/' . $originalPath;\n\n\t\tif(file_exists($path)){\n\t\t\t$attribute = preg_replace(\"|url\\(([\\'\\\"]*)([^\\)\\'\\\"]+)([\\'\\\"]*)\\)|\", 'url($1' . $originalPath . '?ver=' . filectime($path) . '$3)' , $match[0]);\n\t\t\t$this->log($attribute);\n\n\t\t\treturn $attribute;\n\t\t} else {\n\t\t\tthrow new BuildException(\"Resource not found: \" . $path, 1);\n\t\t}\n\n \treturn $match[0];\n }",
"function pl_cache_version( $path, $version = PL_CORE_VERSION ){\n\t$date_modified = filemtime( $path );\n\t$cache_ver = str_replace('.', '', $version) . '-' . date('mdGis', $date_modified);\n\n\treturn $cache_ver;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Players at duplicate ips. | public static function dupedIps()
{
$host= gethostname();
$server_ip = gethostbyname($host);
// Get name, id, and ip from players, grouped by ip matches
return query(
'select uname, player_id, days, last_ip from players left join account_players on player_id = _player_id
left join accounts on _account_id = account_id where uname is not null and active = 1
and last_ip in
(SELECT last_ip FROM accounts
WHERE (operational = true and confirmed = 1)
and (last_ip != \'\' and last_ip != \'127.0.0.1\' and last_ip != :server_ip)
GROUP BY last_ip HAVING count(*) > 1 ORDER BY count(*) DESC limit 30)
order by last_ip, days ASC limit 300',
[':server_ip'=>$server_ip]
);
} | [
"public static function dupedIps(){\n $host= gethostname();\n $server_ip = gethostbyname($host);\n // Get name, id, and ip from players, grouped by ip matches\n return query(\n 'select uname, player_id, days, last_ip from players left join account_players on player_id = _player_id\n left join accounts on _account_id = account_id where uname is not null \n and last_ip in \n (SELECT last_ip FROM accounts \n WHERE (operational = true and confirmed = 1) \n and (last_ip != \\'\\' and last_ip != \\'127.0.0.1\\' and last_ip != :server_ip) \n GROUP BY last_ip HAVING count(*) > 1 ORDER BY count(*) DESC limit 30)\n order by last_ip, days ASC limit 300',\n [':server_ip'=>$server_ip]\n );\n }",
"public function checkDuplicateIpAddress() {\n $dbCheck = file_get_contents($this->voterIpAddressDb);\n if (preg_match(\"/$this->voterIpAddress/\", $dbCheck)) {\n $this->addError('duplicateIpAddress', 'Your IP Address has already voted in this poll.');\n // render errors view\n }\n }",
"public function insert_ip_history() { \n\n\t\tif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])){\n\t\t\t$sip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\tdebug_event('User Ip', 'Login from ip adress: ' . $sip,'3');\n\t\t} \n\t\telse {\n\t\t\t$sip = $_SERVER['REMOTE_ADDR'];\n\t\t\tdebug_event('User Ip', 'Login from ip adress: ' . $sip,'3');\n\t\t}\n\n\t\t$ip = Dba::escape(inet_pton($sip)); \n\t\t$date = time(); \n\t\t$user = $this->id;\n\t\t$agent = Dba::escape($_SERVER['HTTP_USER_AGENT']); \n\n\t\t$sql = \"INSERT INTO `ip_history` (`ip`,`user`,`date`,`agent`) VALUES ('$ip','$user','$date','$agent')\";\n\t\t$db_results = Dba::query($sql);\n\n\t\t/* Clean up old records... sometimes */\n\t\tif (rand(1,100) > 60) { \n\t\t\t$date = time() - (86400*Config::get('user_ip_cardinality'));\n\t\t\t$sql = \"DELETE FROM `ip_history` WHERE `date` < $date\";\n\t\t\t$db_results = Dba::query($sql);\n\t\t} \n\n\t\treturn true;\n\n\t}",
"private function _filter_duplicated_src()\n\t{\n\t\tglobal $wpdb;\n\n\t\t$srcpath_list = array();\n\n\t\t$list = $wpdb->get_results( \"SELECT src FROM $this->_table_img_optming\" );\n\t\tforeach ( $list as $v ) {\n\t\t\t$srcpath_list[] = $v->src;\n\t\t}\n\n\t\t$img_in_queue_duplicated = array();\n\t\tforeach ( $this->_img_in_queue as $k => $v ) {\n\t\t\tif ( in_array( $v[ 'src' ], $srcpath_list ) ) {\n\t\t\t\t$img_in_queue_duplicated[] = $v[ 'id' ];\n\t\t\t\tunset( $this->_img_in_queue[ $k ] );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$srcpath_list[] = $v[ 'src' ];\n\t\t}\n\n\t\tif ( ! $img_in_queue_duplicated ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$count = count( $img_in_queue_duplicated );\n\t\t$msg = sprintf( __( 'Bypassed %1$s duplicated images.', 'litespeed-cache' ), $count );\n\t\tAdmin_Display::succeed( $msg );\n\n\t\tDebug2::debug( '[Img_Optm] Found duplicated src [total_img_duplicated] ' . $count );\n\n\t\t// Update img table\n\t\t$ids = implode( ',', $img_in_queue_duplicated );\n\t\t$q = \"UPDATE `$this->_table_img_optm` SET optm_status = '\" . self::STATUS_DUPLICATED . \"' WHERE id IN ( $ids )\";\n\t\t$wpdb->query( $q );\n\t}",
"public function checkDuplicate($ip, $port) {\n\t\t$sql = \"SELECT * FROM proxies WHERE IP = '{$ip}' AND PORT = {$port}\";\n\t\t$result = mysql_query($sql);\n\t\treturn (mysql_num_rows($result) > 0);\n\t}",
"public function testIps()\n {\n $ip1 = new Ip();\n $ip2 = new Ip();\n $this->network->addIp($ip1);\n self::assertCount(1, $this->network->getIps());\n self::assertTrue($this->network->getIps()->contains($ip1));\n self::assertFalse($this->network->getIps()->contains($ip2));\n $this->network->addIp($ip2);\n self::assertCount(2, $this->network->getIps());\n self::assertTrue($this->network->getIps()->contains($ip1));\n self::assertTrue($this->network->getIps()->contains($ip2));\n $this->network->removeIp($ip1);\n self::assertCount(1, $this->network->getIps());\n self::assertFalse($this->network->getIps()->contains($ip1));\n self::assertTrue($this->network->getIps()->contains($ip2));\n $this->network->removeIp($ip2);\n self::assertCount(0, $this->network->getIps());\n self::assertFalse($this->network->getIps()->contains($ip1));\n self::assertFalse($this->network->getIps()->contains($ip2));\n }",
"private function processExistingIps(): bool\n {\n /**\n * We fill a temporary array with current IP addresses\n */\n if (!$aBannedIps = file(self::BANNED_IP_FILE_PATH)) {\n return false;\n }\n\n $aIps = preg_grep($this->sIpRegExp, $aBannedIps);\n\n if (is_array($aIps)) {\n /**\n * Use a foreach loop in case we have more than one IP per line\n */\n foreach ($aIps as $sIp) {\n $this->aOldIps[] = $sIp;\n }\n return true;\n }\n\n return false;\n }",
"function validatePoster()\n{\n global $DB, $ip;\n\n $sql = \"SELECT IP FROM Comments WHERE 1 ORDER BY TimeStamp DESC LIMIT 10\";\n $DB->query($sql);\n\n if ($DB->rs === false) return false;\n $result = $DB->rsArray;\n\n if (!empty($result) && count($result) == LIMIT_REPEAT_POSTS) {\n foreach ($result as $row) {\n if ($ip != $row[\"IP\"]) return true;\n }\n return false;\n }\n // must be an empty db\n return true;\n}",
"function hit_count() {\n\t$ip_address = $_SERVER['REMOTE_ADDR']; // Gets user ip address.\n\t//echo $ip_address;\n\n\t$found = false;\n\n\t$ip_file = file('ip93.txt');\n\tforeach($ip_file as $ip) {\n\t\tif (trim($ip) == $ip_address) {\n\t\t\t$found = true;\n\t\t\tbreak;\n\t\t} \n\t}\n\n\t/* The ip is not in the list ==> new user => increment count*/\n\tif ($found == false) {\n\t\t$filename = 'count93.txt';\n\t\t$file = fopen($filename, 'r');\n\t\t$counter = fread($file, filesize($filename));\n\t\t$counter += 1;\n\t\tfclose($file);\n\n\n\t\t$file = fopen($filename, 'w');\n\t\tfwrite($file, $counter);\n\t\tfclose($file);\n\n\t\t// Add to the list of existing IP.\n\t\t$file = fopen('ip93.txt', 'a');\n\t\tfwrite($file, $ip_address.\"\\n\");\n\t\tfclose($file);\n\t} \n}",
"public function logIp() {\n\t\tif ($this->ip !== $this->getBrowserIp()) {\n\n\t\t\t/* See if this new IP has been used before on this account */\n\t\t\t$sth = $this->db->prepare('SELECT COUNT(*) FROM iplog WHERE ip = ? AND userid = ?');\n\t\t\t$sth->execute(array($this->getBrowserIp(), $this->getId()));\n\t\t\t$res = $sth->fetch();\n\t\t\t$count = $res[0];\n\n\t\t\tif ($count == 0) {\n\t\t\t\t$warningSignals = 0;\n\n\t\t\t\t/* Log the new IP */\n\t\t\t\t$host = gethostbyaddr($this->getBrowserIp());\n\t\t\t\t$sth = $this->db->prepare(\"INSERT INTO iplog(userid, ip, lastseen, host) VALUES (?, ?, NOW(), ?)\");\n\t\t\t\t$sth->execute(array($this->getId(), $this->getBrowserIp(), $host));\n\n\t\t\t\t/* Check if domain has changed to a \"strange\" country-code eg. hacked or sold account */\n\t\t\t\t$currentHost = gethostbyaddr($this->getIp());\n\t\t\t\tif (substr($host, -2) != substr($currentHost, -2)) {\n\t\t\t\t\t$bannedCountryCodes = \"za au ch fr ie ar mx hu tr it pl il jp ro nz sk fo sg cn ru uk rs de gr es vn pt hr\";\n\t\t\t\t\t$bannedCountryCodesArray = explode(\" \", $bannedCountryCodes);\n\t\t\t\t\tif (array_search(substr($currentHost, -2), $bannedCountryCodesArray) !== false) {\n\t\t\t\t\t\t$warningSignals++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Check if IP has been used to try to access a banned user account */\n\t\t\t\t$sth = $this->db->prepare(\"SELECT COUNT(*) FROM inlogg JOIN users ON inlogg.uid = users.id WHERE inlogg.ip = ? AND enabled = 'no'\");\n\t\t\t\t$sth->execute(array($this->getBrowserIp()));\n\t\t\t\t$res = $sth->fetch();\n\t\t\t\tif ($res[0]) {\n\t\t\t\t\t$warningSignals++;\n\t\t\t\t}\n\n\t\t\t\t/* Check if IP has been used on a banned user account */\n\t\t\t\t$sth = $this->db->prepare(\"SELECT COUNT(*) FROM iplog JOIN users ON iplog.userid = users.id WHERE iplog.ip = ? AND enabled = 'no'\");\n\t\t\t\t$sth->execute(array($this->getBrowserIp()));\n\t\t\t\t$res = $sth->fetch();\n\t\t\t\tif ($res[0]) {\n\t\t\t\t\t$warningSignals++;\n\t\t\t\t}\n\n\t\t\t\t/* Log to Staff if enough warning signals */\n\t\t\t\tif ($warningSignals > 0) {\n\t\t\t\t\t$sth = $this->db->prepare(\"INSERT INTO ipchanges(userid, datum, ip, hostname, level) VALUES(?, NOW(), ?, ?, ?)\");\n\t\t\t\t\t$sth->bindValue(1, $this->getId(), PDO::PARAM_INT);\n\t\t\t\t\t$sth->bindValue(2, $this->getBrowserIp(), PDO::PARAM_INT);\n\t\t\t\t\t$sth->bindParam(3, $host, PDO::PARAM_INT);\n\t\t\t\t\t$sth->bindParam(4, $warningSignals, PDO::PARAM_INT);\n\t\t\t\t\t$sth->execute();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function POLLS_ipAlreadyVoted($pid, $ip = '' )\n{\n global $_TABLES;\n\n $retval = false;\n\n if(empty($ip )) {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n\n if(DB_count($_TABLES['pollvoters'],\n array('ipaddress', 'pid'),\n array($ip, $pid)) > 0) {\n $retval = true;\n }\n\n return $retval;\n}",
"function IpInConnections($ip)\n\t{\n\t\t$sql = sprintf(\"SELECT COUNT(*) FROM Connections WHERE IpKey ='%s'\" , $ip);\n\t\t$result = RunSql($sql);\n\t\t$COUNT_NUMBER = $result->fetch_array(); \n\t\t$count = $COUNT_NUMBER[0]; \n\t\t/*if count == 0 then ip is in table*/\n\t\tif($count == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\t\n\t}",
"public function allow_duplicate_connections() {\n\t\treturn (bool) $this->options['duplicate_connections'];\n\t}",
"function ip_discoverd_already($vmware_vsphere_discovery_ip) {\n\n\t\t$db=htvcenter_get_db_connection();\n\n\t\t$rs = $db->Execute(\"select vmw_vsphere_ad_id from $this->_db_table where vmw_vsphere_ad_ip='$vmware_vsphere_discovery_ip'\");\n\t\tif (!$rs)\n\t\t\t$this->event->log(\"ip_discoverd_already\", $_SERVER['REQUEST_TIME'], 2, \"vmware-vsphere-discovery.class.php\", $db->ErrorMsg(), \"\", \"\", 0, 0, 0);\n\t\telse\n\t\tif ($rs->EOF) {\n\t\t\t$resource = new resource();\n\t\t\t$resource->get_instance_by_ip($vmware_vsphere_discovery_ip);\n\t\t\tif ($resource->id > 0) {\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 false;\n\t\t}\n\t}",
"protected function _incrementClientLoginAttempts()\n {\n $ip = App_Util::getIP();\n if ($ip == '0.0.0.0') {\n return;\n }\n $key = 'ss_flood_control_' . $ip;\n $cache = new SolarLite_Cache_Memcache(600);\n if ($cache->fetch($key) === false) {\n $cache->add($key, 1);\n } else {\n $cache->increment($key, 1);\n }\n }",
"function oaipmh_harvester_expose_duplicates()\n{\n $id = item('id');\n $items = get_db()->getTable('Item')->findBy(\n array(\n 'oaipmh_harvester_duplicate_items' => $id,\n )\n );\n if (!count($items)) {\n return;\n }\n\n echo __v()->partial('index/_duplicates.php', array('items' => $items));\n}",
"function duplicateOutreach($OID)\n{\n $newOID = dbDuplicateOutreach($OID);\n if($newOID != false){\n $worked = dbDuplicateOutreachTimes($OID, $newOID);\n if($worked){\n drupal_set_message('Outreach duplicated!');\n if(isset($_SERVER['HTTP_REFERER'])){\n\tdrupal_goto($_SERVER['HTTP_REFERER']);\n } else {\n\tdrupal_goto('viewOutreach', array('query'=>array('OID'=>$newOID)));\n }\n }\n }\n drupal_set_message('There was an error.', 'error');\n}",
"function update_iplog()\n {\n if ($this->_iplog[$this->_ip]) {\n $this->_iplog[$this->_ip]++;\n } else {\n $this->_iplog[$this->_ip] = 1;\n }\n }",
"function round_create_matches($tournament, &$players) {\n\tglobal $matchset ;\n\t$my_players = array_merge($players) ; // Clone players, in order to pop them from clone\n\t$new_players = array() ; // Will replace $players\n\twhile ( count($my_players) > 0 ) {\n\t\t$creator = array_shift($my_players) ;\n\t\t$joiner = null ;\n\t\tif ( count($my_players) == 0 ) { // 1 Player left : bye\n\t\t\t$new_players[] = $creator ;\n\t\t\t$players = $new_players ; // Override players list with new one in right order\n\t\t\treturn true ;\n\t\t}\n\t\tforeach ( $my_players as $i => $player )\n\t\t\tif ( ! game_same_previous($creator, $player, $tournament->data->results) ) {\n\t\t\t\t$spl = array_splice($my_players, $i, 1) ;\n\t\t\t\t$joiner = $spl[0] ;\n\t\t\t\t$new_players[] = $creator ;\n\t\t\t\t$new_players[] = $joiner ;\n\t\t\t\t$matchset .= ' - '.$creator->nick.\" Vs \".$joiner->nick.\"\\n\" ;\n\t\t\t\tbreak ; // Joiner found, stop browsing players left\n\t\t\t} else\n\t\t\t\t$matchset .= ' - '.$creator->nick.\" Already encountered \".$player->nick.\"\\n\" ;\n\t\tif ( $joiner == null ) {\n\t\t\t$matchset .= $creator->nick.\" can't find an opponent\\n\" ;\n\t\t\treturn false ; // It fails to find \n\t\t}\n\t}\n\t$players = $new_players ; // Override players list with new one in right order\n\treturn true ;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for postTransaction Submit Tx. | public function testPostTransaction()
{
} | [
"public function test_postTransaction() {\n\n }",
"public function testProjectTransactionPost()\n {\n }",
"public function testJournalTransactionPost()\n {\n }",
"public function testCreateFundingTransactionUsingPost()\n {\n }",
"public function testTransactionPostUnspent()\n {\n }",
"public function testSubmitRtpTransferUsingPost()\n {\n }",
"public static function executePostCommit(): void\n {\n $failCount = 0;\n //====================================================================//\n // Walk on Waiting Events\n foreach (self::getWaitingEvents() as $commitEvent) {\n //====================================================================//\n // Check if Event is to be Send\n if (!$commitEvent->isReady()) {\n continue;\n }\n //====================================================================//\n // Execute Commit\n if (self::executeCommit($commitEvent)) {\n self::setCommitEventSuccess($commitEvent);\n\n continue;\n }\n self::setCommitEventFail($commitEvent);\n //====================================================================//\n // Limit number of Failures\n if ($failCount++ >= 10) {\n return;\n }\n }\n }",
"public function testTrxsPost()\n {\n }",
"public function commit_transaction(): void\n {\n }",
"public function testInsertNewTransaction() {\n\t\t// verify mySQL connected Ok\n\t\t$this->assertNotNull($this->mysqli);\n\n\t\t// now, create a transaction to post to mySQL\n\t\t$this->transaction = new Transaction(null, $this->profile->getProfileId(), $this->ticket->getTicketId(), $this->amount, $this->dateApproved);\n\n\t\t// insert the transaction to mySQL\n\t\t$this->transaction->insert($this->mysqli);\n\n\t\t$testAmount = floatval($this->amount);\n\t\t$testDate = DateTime::createFromFormat('Y-m-d H:i:s',$this->dateApproved);\n\n\t\t// and now, compare the fields\n\t\t$this->assertNotNull($this->transaction->getTransactionId());\n\t\t$this->assertTrue($this->transaction->getTransactionId() > 0);\n\t\t$this->assertIdentical($this->transaction->getProfileId(),\t\t\t$this->profile->getProfileId());\n\t\t$this->assertIdentical($this->transaction->getTicketId(), $this->ticket->getTicketId());\n\t\t$this->assertIdentical($this->transaction->getAmount(),\t\t\t\t$testAmount);\n\t\t$this->assertIdentical($this->transaction->getDateApproved(),\t $testDate);\n\n\t }",
"public function testEmailsTransactionidCancelPost()\n {\n }",
"public abstract function transactionCommit();",
"public function testSubmitRequest()\n {\n }",
"public function testCommitTransaction()\r\n {\r\n $table = 'test_table';\r\n\r\n $this->_createTable( $table );\r\n\r\n self::$db->startTransaction();\r\n\r\n $query = \"INSERT INTO $table ( test_name, test_value ) VALUES ( ?, ? )\";\r\n\r\n $this->assertEquals( 1, self::$db->execute( $query, [ 'name1', 'value1' ] ) );\r\n $this->assertEquals( 1, self::$db->execute( $query, [ 'name2', 'value2' ] ) );\r\n\r\n self::$db->commitTransaction();\r\n\r\n $query = \"SELECT * FROM $table\";\r\n\r\n $results = self::$db->query( $query );\r\n\r\n $this->assertEquals( 2, count( $results ) );\r\n }",
"public function testWarehouseTransferInPOSTRequestPost()\n {\n }",
"public function testTransactions()\n {\n $typeId = Transaction::TYPE_CREDIT;\n $amount = random_int(10, 1000);\n\n $transactionCreateQuery = sprintf(\n 'mutation{create(type_id: %d,amount: %d){type_id,amount,user_id}}',\n $typeId,\n $amount\n );\n\n $createQuery = $this->base . $transactionCreateQuery;\n\n //Without logged user\n $response = $this->post($createQuery);\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n\n //With logged user\n $user = factory(User::class)->create();\n $this->be($user);\n\n $response = $this->post($createQuery);\n $response->assertStatus(Response::HTTP_OK);\n $response->assertJsonStructure([\n 'data' => [\n 'create' => [\n 'type_id',\n 'amount',\n 'user_id',\n ]\n ]\n ]);\n $response->assertJson([\n 'data' => [\n 'create' => [\n 'user_id' => $user->id\n ]\n ]\n ]);\n }",
"public function testPostCheck()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testPostCustomerPaymentInstrument()\n {\n }",
"public function testCommit()\n {\n $this->_object->beginTransaction();\n\n $this->assertTrue($this->_object->commit());\n $this->assertFalse($this->_object->isTransaction());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle an exception in a way that results to an error page. | public function showErrorPage(Exception $exception); | [
"protected abstract function renderErrorPage(Request $request, Response $response, HttpException $e);",
"public function errorAction()\n\t{\n\t\t// sets the 404 header\n\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\n\t\t// sets the error to be rendered in the view\n\t\t$this->view->error = $this->_exception->getMessage();\n\t\t\n\t\t// logs the error to the log\n\t\terror_log($this->view->error);\n\t\terror_log($this->_exception->getTraceAsString());\n\t}",
"public static function exception_handler($exception) { \n ResponseFactory::send($exception->getMessage()); //Send exception message as response.\n }",
"function exception_handler($exception) {\n $this->logger->error(\"Uncaught exception: \".$exception->getMessage());\n header('Location: '.$this->fallback);\n exit;\n }",
"public function errorAction()\n {\n $error = $this->Request()->getParam('error_handler');\n if (empty($error)) {\n return;\n }\n\n $code = $error->exception->getCode();\n switch ($code) {\n case Enlight_Controller_Exception::Controller_Dispatcher_Controller_Not_Found:\n case Enlight_Controller_Exception::Controller_Dispatcher_Controller_No_Route:\n case Enlight_Controller_Exception::PROPERTY_NOT_FOUND:\n case Enlight_Controller_Exception::ActionNotFound:\n case 404:\n $this->forward('pageNotFoundError');\n break;\n case 400:\n case 401:\n case 413:\n $this->forward('genericError', null, null, ['code' => $code]);\n break;\n default:\n $this->forward('genericError', null, null, ['code' => 503]);\n break;\n }\n }",
"public function handle_error();",
"function exceptionHandler($exception) {\n\n\t\t$this->inExceptionHandler = true;\n\n\t\theader('HTTP/1.1 500 Internal Server Error');\n\n\t\t$this->dispatch(new \\Slipstream\\Common\\Log\\Event\\OutputEventArgs($exception));\n\t\t//$this->fb($Exception);\n\n\t\t$this->inExceptionHandler = false;\n\t}",
"protected function handleViewException($e)\n\t{\n\t\tob_get_clean(); throw $e;\n\t}",
"private function handle_exception() {\n\n // handle local exceptions\n switch($this->exception_type) {\n case \"local\": $this->handle_local_exception(); break;\n case \"global\": $this->handle_global_exception(); break;\n default: $this->handle_unknown_exception(); break;\n }\n\n }",
"public function render(Exception $e, Request $request);",
"public function exceptionHandler($exception)\n {\n // set error\n $this->error = $exception->getMessage();\n }",
"public function actionHandleError()\n {\n $exception = Yii::$app->errorHandler->exception;\n\n //Transaction\n if (Yii::$app->db->transaction !== null) {\n Yii::$app->db->transaction->rollBack();\n }\n\n $category = Logger::LEVEL_ERROR;\n\n \n if ($exception instanceof \\yii\\web\\UnauthorizedHttpException) {\n http_response_code(401);\n $this->_errors[] = [\n 'code' => get_class($exception),\n 'message' => $exception->getMessage(),\n 'file' => $exception->getFile(),\n 'line' => $exception->getLine(),\n ];\n } else if ($exception instanceof ErrorException) {\n switch ($exception->getCode()) {\n case E_WARNING:\n $type = 'PHP warning';\n $category = Logger::LEVEL_WARNING;\n break;\n case E_NOTICE:\n $type = 'PHP notice';\n $category = Logger::LEVEL_WARNING;\n break;\n case E_USER_ERROR:\n $type = 'User error';\n break;\n case E_USER_WARNING:\n $type = 'User warning';\n $category = Logger::LEVEL_WARNING;\n break;\n case E_USER_NOTICE:\n $type = 'User notice';\n $category = Logger::LEVEL_WARNING;\n break;\n case E_RECOVERABLE_ERROR:\n $type = 'Recoverable error';\n break;\n default:\n $type = 'PHP error';\n }\n $this->_errors[] = [\n 'code' => $type,\n 'message' => $exception->getMessage(),\n 'file' => $exception->getFile(),\n 'line' => $exception->getLine(),\n ];\n } else {\n $this->_errors[] = [\n 'code' => get_class($exception),\n 'message' => $exception->getMessage(),\n 'file' => $exception->getFile(),\n 'line' => $exception->getLine(),\n ];\n }\n\n Yii::getLogger()->log($this->_errors, $category, 'api.' . $this->uniqueId);\n $this->renderResponse();\n }",
"public function error_page() {\n\t\t\tglobal $config;\n\t\t\theader(\"Location: \".config::$url->error);\n\t\t\texit();\n\t\t}",
"abstract function exceptionHandlerAction();",
"public final static function show($exception)\n {\n $page = new ErrorPage($exception);\n $page->render();\n }",
"public function handle_exception(Exception $e){}",
"function CSF_html_exception_handler($e)\n{\n echo \"<p>\"\n . \"<strong>Fatal error:</strong> Uncaught exception '\".get_class($e).\"'\"\n . \"</p>\\n\"\n . \"<dl>\\n\"\n . \"<dd></dd>\\n\"\n . \"<dt>Message:</dt>\\n\"\n . \"<dd>\".($e->getMessage() ? $e->getMessage() : '(none)').\"</dd>\\n\"\n . \"<dt>Location:</dt>\\n\"\n . \"<dd>\".$e->getFile().\", Line \".$e->getLine().\"</dd>\\n\"\n . \"<dt>Stack trace:</dt>\\n\"\n . \"<dd><pre>\".$e->getTraceAsString().\"</pre></dd>\\n\"\n . \"</dl>\\n\";\n}",
"function HandleException(\\Exception $exception);",
"public function render(Exception $ex): void;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns with the URL to edit the Quote | public function generate_editurl(Order $quote) {
$url = $this->generate_quotesredirurl();
$url->query->setData(array('action' => 'edit-quote', 'qnbr' => $quote->quotnbr));
return $url->getUrl();
} | [
"public function generate_editURL(Order $quote) {\n\t\t\t$url = new URL(parent::generate_editURL($quote));\n\t\t\t$url->query->set('custID', $this->custID);\n\t\t\treturn $url->getUrl();\n\t\t}",
"public function generate_editurl(Order $order);",
"public function getEditUrl();",
"public function editURL() {\n return SITE_URL.'/car_services/'.$this->id.'/edit';\n }",
"public function get_edit_url() {\n\t\treturn $this->edit_link();\n\t}",
"public function getEditUrl()\n {\n return $this->getUrl('*/*/edit', array('creditmemo_id'=>$this->getCreditmemo()->getId()));\n }",
"public function getViewQuoteUrl()\n {\n return $this->getUrl('negotiable_quote/quote/view/', [\n 'quote_id' => $this->getQuote()->getId(),\n '_scope' => $this->getQuoteStore()->getCode(),\n '_scope_to_url' => true,\n '_nosid' => true\n ]);\n }",
"public function get_edit_url(){\n\t\treturn get_edit_post_link($this->get_id());\n\t}",
"public function getEditUrl()\n {\n return $this->_urlBuilder->getUrl('*/*/edit', ['id' => $this->getSubscription()->getId()]);\n }",
"public function generate_editURL(Order $order) {\n\t\t\t$url = new URL(parent::generate_editURL($order));\n\t\t\t$url->query->set('custID', $this->custID);\n\t\t\treturn $url->getUrl();\n\t\t}",
"public function editUrl()\n {\n return cp_route('globals.edit', $this->slug());\n }",
"public function editUrl() {\n\t\tif(!$this->page || !$this->page->id) return '';\n\t\tif(!$this->field) return '';\n\t\treturn $this->page->editUrl() . \"?field={$this->field->name}#CommentsAdminItem$this->id\";\n\t}",
"public function getEditLink()\n {\n $unique_id = $this->getUniqueId();\n\n $host = $_SERVER['HTTP_HOST'];\n $extra = $_SERVER['PHP_SELF'].'?module=nomination&view=NominationForm&unique_id='.$unique_id;\n\n $link = 'http://'.$host.$extra;\n\n return $link;\n }",
"protected function get_url_this_edit(){ return $this->input ['edit_url'] ;}",
"public function getEditLink()\n {\n $unique_id = $this->getUniqueId();\n\n $host = $_SERVER['HTTP_HOST'];\n $extra = $_SERVER['PHP_SELF'] . '?module=nomination&view=NominationForm&unique_id=' . $unique_id;\n\n $link = 'http://' . $host . $extra;\n\n return $link;\n }",
"public function getUrlEdit() {\r\n if ($this->urlEdit === NULL) {\r\n $this->urlEdit = $_SERVER['SCRIPT_NAME'] . '/editItem/' . $this->id;\r\n }\r\n return $this->urlEdit;\r\n }",
"public function generate_editURL(Order $order) {\n\t\t\t$url = $this->generate_ordersredirURL();\n\t\t\t$url->query->setData(array('action' => 'get-order-edit','ordn' => $order->ordernumber));\n\t\t\t$url->query->set('orderorigin', $this->pageurl->getURL());\n\t\t\treturn $url->getUrl();\n\t\t}",
"public function getCpEditUrl()\n {\n return UrlHelper::getCpUrl('charge/detail/'.$this->id);\n }",
"public function getOrderEditUrl(): string\n {\n if ($this->orderId) {\n return UrlHelper::cpUrl('commerce/orders/' . $this->orderId);\n }\n\n return '';\n }",
"public function generate_editurl(Order $order) {\n\t\t\t$url = $this->generate_ordersredirurl();\n\t\t\t$url->query->setData(array('action' => 'get-order-edit','ordn' => $order->ordernumber));\n\t\t\treturn $url->getUrl();\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation createCatalogCategoryAsyncWithHttpInfo Create Catalog Category | public function createCatalogCategoryAsyncWithHttpInfo($catalog_category_create_query, $apiKey = null)
{
$returnType = 'array<string,mixed>';
$request = $this->createCatalogCategoryRequest($catalog_category_create_query, $apiKey);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
$parsed_content = json_decode(json_encode($content), TRUE);
if (json_last_error() != JSON_ERROR_NONE) {
$parsed_content = $content;
}
return [
$parsed_content,
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
);
} | [
"public function createCategoryAsyncWithHttpInfo($body = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\Category';\n $request = $this->createCategoryRequest($body);\n\n return $this->client\n ->sendRequestAsync($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 createCategoryAsyncWithHttpInfo($category = null)\n {\n $returnType = '\\KnetikCloud\\Model\\CategoryResource';\n $request = $this->createCategoryRequest($category);\n\n return $this->client->sendAsync($request)->then(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 }, function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n \"[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})\",\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n });\n }",
"public function createCategoryAsyncWithHttpInfo($category = null)\n {\n $returnType = '\\Vouchery\\Model\\Category';\n $request = $this->createCategoryRequest($category);\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 = (string) $responseBody;\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 createCategoryWithHttpInfo($body = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\Category';\n $request = $this->createCategoryRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->sendRequest($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 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Category',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ErrorMessage',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\BadCredentialsError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ErrorMessage',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ErrorMessage',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 422:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ErrorMessage',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ErrorMessage',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function createCategoryWithHttpInfo($category = null)\n {\n $returnType = '\\KnetikCloud\\Model\\CategoryResource';\n $request = $this->createCategoryRequest($category);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n \"[$statusCode] Error connecting to the API ({$request->getUri()})\",\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 201:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\KnetikCloud\\Model\\CategoryResource', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\KnetikCloud\\Model\\Result', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function createCategoryWithHttpInfo($location_id, $body)\n {\n // verify the required parameter 'location_id' is set\n if ($location_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $location_id when calling createCategory'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createCategory'\n );\n }\n\n // parse inputs\n $resourcePath = \"/v1/{location_id}/categories\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = ApiClient::selectHeaderAccept(['application/json']);\n if ($_header_accept !== null) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(['application/json']);\n\n // path params\n if ($location_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"location_id\" . \"}\",\n $this->apiClient->getSerializer()\n ->toPathValue($location_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (!empty($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->apiClient->getConfig()->getAccessToken() !== \"\") {\n $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()\n ->getAccessToken();\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n \\SquareConnect\\Model\\V1Category::class\n );\n if (!$response) {\n return [null, $statusCode, $httpHeader];\n }\n\n return [\n \\SquareConnect\\ObjectSerializer::deserialize(\n $response,\n \\SquareConnect\\Model\\V1Category::class,\n $httpHeader\n ),\n $statusCode,\n $httpHeader\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = \\SquareConnect\\ObjectSerializer::deserialize(\n $e->getResponseBody(),\n \\SquareConnect\\Model\\V1Category::class,\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function create_category() {\n\n // Creates a category\n (new MidrubBaseUserAppsCollectionChatbotHelpers\\Categories)->create_category();\n\n }",
"public function restCategoriesPostAsyncWithHttpInfo($_rest_categories = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Category[]';\n $request = $this->restCategoriesPostRequest($_rest_categories);\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 = (string) $responseBody;\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 create_category() {\n \n // Create category\n (new MidrubBaseAdminCollectionSupportHelpers\\Categories)->create_category();\n \n }",
"public function restCategoriesPostWithHttpInfo($_rest_categories = null)\n {\n $request = $this->restCategoriesPostRequest($_rest_categories);\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() ? (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 $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 ('\\OpenAPI\\Client\\Model\\Category[]' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Category[]', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Category[]';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\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 '\\OpenAPI\\Client\\Model\\Category[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function createAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $createAttribute)\n {\n $returnType = '';\n $request = $this->createAttributeRequest($attributeCategory, $attributeName, $createAttribute);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\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 addressBookCategoryPostAsyncWithHttpInfo($category)\n {\n $returnType = '';\n $request = $this->addressBookCategoryPostRequest($category);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\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 getCatalogCategoryAsyncWithHttpInfo($id, $fields_catalog_category = null, $apiKey = null)\n {\n $returnType = 'array<string,mixed>';\n $request = $this->getCatalogCategoryRequest($id, $fields_catalog_category, $apiKey);\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 $parsed_content = json_decode(json_encode($content), TRUE);\n if (json_last_error() != JSON_ERROR_NONE) {\n $parsed_content = $content;\n }\n\n return [\n $parsed_content,\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 getTagCategoriesWithHttpInfo()\n {\n // parse inputs\n $resourcePath = \"/tags/categories\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]);\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 '\\ArtikCloud\\ArtikCloud\\Model\\TagsEnvelope',\n '/tags/categories'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\ArtikCloud\\ArtikCloud\\Model\\TagsEnvelope', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 0:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\ArtikCloud\\ArtikCloud\\Model\\TagsEnvelope', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function inventoryCategoryPOSTRequestCategoriesPostAsyncWithHttpInfo($accept, $jiwa_stateful = null, $category_no = null, $description = null, $is_default = null, $picture = null, $custom_field_values = null, $body = null)\n {\n $returnType = '\\Jiwa\\Model\\InventoryCategory';\n $request = $this->inventoryCategoryPOSTRequestCategoriesPostRequest($accept, $jiwa_stateful, $category_no, $description, $is_default, $picture, $custom_field_values, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function findCategoryWithHttpInfo()\n {\n $returnType = '\\Softonic\\CatalogApiSdk\\Client\\Model\\Category[]';\n $request = $this->findCategoryRequest();\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 '\\Softonic\\CatalogApiSdk\\Client\\Model\\Category[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function inventoryCategoryPOSTRequestCategoriesPostAsync($accept, $jiwa_stateful = null, $category_no = null, $description = null, $is_default = null, $picture = null, $custom_field_values = null, $body = null)\n {\n return $this->inventoryCategoryPOSTRequestCategoriesPostAsyncWithHttpInfo($accept, $jiwa_stateful, $category_no, $description, $is_default, $picture, $custom_field_values, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function createProductCategory();",
"public function indexProductCategoryAsyncWithHttpInfo()\n {\n $returnType = '\\RackbeatApp\\Client\\Model\\ProductCategoryList';\n $request = $this->indexProductCategoryRequest();\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 }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets as paymentAlternativeCurrencyCode BBIE Invoice. Payment Alternative_ Currency Code. Code A code signifying the alternative currency used for payment in the Invoice. 0..1 Invoice Payment Alternative Currency Code Code Currency Currency_ Code. Type | public function getPaymentAlternativeCurrencyCode()
{
return $this->paymentAlternativeCurrencyCode;
} | [
"public function getPaymentCurrencyCode()\n {\n return (string) $this->getDataUtils()->invokeGet($this, 'getOrderPayment', 'getCurrency');\n }",
"public function getCurrencyCodeType($currency);",
"public function getCurrencyCode() { return $this->currencyCode; }",
"public function getCurrencyCode()\n {\n return isset($this->currency_code) ? $this->currency_code : '';\n }",
"public function getSourceCurrencyCode();",
"public function getBaseCurrencyCode(){\n return $this->_get(self::BASE_CURRENCY_CODE);\n }",
"public function getNetCurrency()\n {\n return isset($this->NetCurrency) ? $this->NetCurrency : null;\n }",
"function acadp_get_payment_currency() {\n\n\t$currency_settings = acadp_get_payment_currency_settings();\n\t$currency = ! empty( $currency_settings[ 'currency' ] ) ? $currency_settings[ 'currency' ] : 'USD';\n\n\treturn strtoupper( $currency );\n\n}",
"protected function getCurrencyCode()\n {\n return Mage::app()\n ->getStore()\n ->getCurrentCurrencyCode()\n ;\n }",
"public function charge_currency()\n {\n if (in_array(self::global_currency(), $this->supported_currency_list())){\n return self::global_currency();\n }\n return \"INR\";\n }",
"public function getLedgerCurrency(): ?string\n {\n return $this->ledgerCurrency;\n }",
"public function getPayCoderep()\n {\n return $this->payCoderep;\n }",
"public function getCurrency() {\n return $this->DsMerchantCurrency;\n }",
"public function getPaymentAlternativeExchangeRate()\n {\n return $this->paymentAlternativeExchangeRate;\n }",
"public function getCurrencyCode(): float|string\n {\n $_order = $this->getOrder();\n return $_order->getOrderCurrencyCode();\n }",
"public function getPaymentCode()\n {\n }",
"private function getBaseCurrencyCode()\n {\n return $this->scopeConfig->getValue($this->xmlPathBaseCurrency, $this->defaultCurrencyCodeValue);\n }",
"public function getBaseCurrencyCode() {\r\n\t\treturn $this->_storeManager->getStore()->getBaseCurrencyCode();\r\n\t}",
"public function currency()\n\t{\n\t\treturn $this->invoiceItem['currency'];\n\t}",
"function getPaymentType()\n\t{\n\t\treturn $this->payment_type;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shooting power for the ranger. | public function shoot_power()
{
return 3;
} | [
"public function PowerOn()\n\t\t{\n\t\t\t$LW12 = $this->init();\n\t\t\t$LW12->PowerOn();\n\n\t\t\tSetValue($this->GetIDForIdent(\"power\"), $LW12->power);\n\t\t}",
"public function turnTurretRight()\n {\n }",
"public function set_power()\n {\n $this->battery_power = 100;\n }",
"public function getWeaponPower()\n {\n return $this->weaponPower;\n }",
"public function attack_power()\n {\n return 0;\n }",
"private function magic_shield() {\n //magic shield defense skill\n if(rand(1,100) <= $this->shieldChance) {\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"public function turnTurretLeft()\n {\n }",
"public function setTargetGamerPower($value)\n {\n return $this->set(self::TARGET_GAMER_POWER, $value);\n }",
"public function powerWire(Block $block) : void{\n //todo figure out how long lifetime stuff is\n $particle = new RedstoneParticle($block->asVector3(), 10);\n $block->getLevel()->addParticle($particle);\n }",
"function getPower() {\r\n return $this->power;\r\n }",
"public function setPower($power)\n {\n $this->power = $power;\n }",
"public function get_shower()\n {\n return $this->_shower;\n }",
"protected function getpower_self ()\n\t{\n\t\treturn $this->self->e_trpwiz * $this->self->getModifier('magic') / max($this->self->e_bldwiz, 1);\n\t}",
"function pvRebel_setPower($address,$fnPower) {\n\t\t$powerTo = 'F';\n\t\tif ($fnPower)\n\t\t\t$powerTo = 'O';\n\t\tpvRebel_SEND_CMD($address,'P'.$powerTo);\n\t}",
"public function equipRandomArmour() : void {\n\t}",
"private function modifyLeather()\n {\n $this->randomizeLucky();\n if ($this->isLucky) {\n $this->baseName = sprintf('%s %s', 'Hard', $this->baseName);\n $this->baseShield = $this->baseShield*3;\n }\n }",
"public function heroAttack(){\n $chance = $this->rapidStrike->skillChance;\n $multi = $this->rapidStrike->skillValue;\n $rand = rand(0,100);\n\n if($rand<=$chance){\n echo \"double attack\" . PHP_EOL;\n return ($this->attack() * $this->rapidStrike->skillValue);\n \n }else{\n return ($this->attack());\n }\n }",
"public function getAttackerTotalFire()\n {\n return $this->power;\n }",
"private function attack()\n {\n $this->damage = $this->currentAttacker->attack($this->currentDefender->getDefence());\n\n }",
"public function doDamage() {\r\n\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of parameters to attach to the checkbox tag. Includes whether the checkbox should appear as checked. Will try the callback first, and if not present, will try overridden functions. | public function getCheckboxParams($item)
{
$aParams = array();
if ($strId = $this->getCheckboxId($item)) {
$aParams['id'] = $strId;
}
if ($this->isChecked($item)) {
$aParams['checked'] = 'checked';
}
if ($strName = $this->getCheckboxName($item)) {
$aParams['name'] = $strName; // name is not used by QCubed
}
$aParams['value'] = $this->getCheckboxValue($item); // note that value is required for html checkboxes, but is not used by QCubed
if ($this->checkParamCallback) {
$a = call_user_func($this->checkParamCallback, $item);
$aParams = array_merge($aParams, $a);
}
return $aParams;
} | [
"function acf_get_checkbox_input($attrs = array()) {}",
"function acf_get_checkbox_input($attrs = array())\n{\n}",
"function checkbox( $args = '', $checked = false ) {\n\t\t\t$defaults = array( \n\t\t\t\t'name' => '', \n\t\t\t\t'id' => false,\n\t\t\t\t'class' => false, \n\t\t\t\t'group' => false,\n\t\t\t\t'special' => '', \n\t\t\t\t'value' => 'true', \n\t\t\t\t'label' => false, \n\t\t\t\t'maxlength' => false\n\t\t\t);\n\t\t\textract( wp_parse_args( $args, $defaults ), EXTR_SKIP );\n\t\t\t\n\t\t\t// Get rid of all brackets\n\t\t\tif ( strpos( $name, '[' ) || strpos( $name , ']' ) ) {\n\t\t\t\t$replace_variables = array( '][', ']', '[' );\n\t\t\t\t$class_from_name = $name;\n\t\t\t\t$class_from_name = UD_PREFIX . str_replace($replace_variables, '_', $class_from_name);\n\t\t\t} else {\n\t\t\t\t$class_from_name = UD_PREFIX . $name;\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// Setup Group\n\t\t\tif ( $group ) {\n\t\t\t\tif ( strpos( $group, '|' ) ) {\n\t\t\t\t\t$group_array = explode( '|', $group );\n\t\t\t\t\t$count = 0;\n\t\t\t\t\tforeach ( $group_array as $group_member ) {\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t\tif ( $count == 1 ) {\n\t\t\t\t\t\t\t$group_string .= $group_member;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$group_string .= '[' . $group_member . ']';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$group_string = $group;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\n\t\t\t// Use $checked to determine if we should check the box\n\t\t\tif ( $checked || strtolower( $checked ) == 'yes' ) {\n\t\t\t\t$checked = true; \n\t\t\t} else {\n\t\t\t\t$checked = false;\n\t\t\t}\n\t\t\t$id\t\t\t\t\t= \t( $id ? $id : $class_from_name );\n\t\t\t$insert_id \t\t\t= \t' id=\"' . ( $id ? $id : $class_from_name ) . '\"';\n\t\t\t$insert_name\t\t= \t' name=\"' . ( $group_string ? $group_string . '[' . $name . ']' : $name ) . '\"';\n\t\t\t$insert_checked\t\t= \t( $checked ? ' checked=\"checked\" ' : '');\n\t\t\t$insert_value\t\t= \t' value=\"' . $value . '\"';\n\t\t\t$insert_class \t\t= \t' class=\"' . $class_from_name . ' ' . $class . UD_PREFIX . 'checkbox ' . ( $group ? UD_PREFIX . $group . '_checkbox' : '' ) . '\"';\n\t\t\t$insert_maxlength\t= \t( $maxlength ? ' maxlength=\"' . $maxlength . '\"' : '');\n\t\n\t\t\t// Determine oppositve value\n\t\t\tswitch ( $value ) {\n\t\t\t\tcase 'yes':\n\t\t\t\t\t$opposite_value = 'no';\n\t\t\t\tbreak;\n\t\t\t\tcase 'true':\n\t\t\t\t\t$opposite_value = 'false';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Print label if one is set\n\t\t\tif ( $label ) {\n\t\t\t\t$return .= '<label for=\"' . $id. '\">';\n\t\t\t}\n\t\t\t\n\t\t\t// Print hidden checkbox\n\t\t\t$return .= '<input type=\"hidden\" value=\"' . $opposite_value . '\" ' . $insert_name . ' />';\n\t\t\t\n\t\t\t// Print checkbox\n\t\t\t$return .= '<input type=\"checkbox\" ' . $insert_name . $insert_id . $insert_class . $insert_checked . $insert_maxlength . $insert_value . $special . ' />';\n\t\n\t\t\tif ( $label ) {\n\t\t\t\t $return .= ' ' . $label . '</label>';\t\n\t\t\t}\n\t\t\treturn $return;\n\t\t}",
"function checked_extras($arg) {\n\tglobal $extras_arr;\n\tif (!empty($extras_arr)) {\n\t\tforeach ($extras_arr as $extra) {\n\t\t\tif ($arg == $extra) {\n\t\t\t\treturn \"checked\";\n\t\t\t}\n\t\t}\n\t}\n}",
"protected static function _checkbox( $args ) {\n\t\t$args = wp_parse_args( $args, array(\n\t\t\t'value' => true,\n\t\t\t'desc' => null,\n\t\t\t'checked' => false,\n\t\t\t'extra' => array(),\n\t\t) );\n\n\t\t$args['extra']['checked'] = $args['checked'];\n\n\t\tif ( is_null( $args['desc'] ) && ! is_bool( $args['value'] ) ) {\n\t\t\t$args['desc'] = str_replace( '[]', '', $args['value'] );\n\t\t}\n\n\t\treturn self::_input_gen( $args );\n\t}",
"public function cap_wpgm_input_checkbox_callback( array $args ) {\n\t\t\t$this->options = get_option( $args['option_name'] );\n\t\t\t$checked = ( isset( $this->options[ $args['label_for'] ] ) && $this->options[ $args['label_for'] ] == 1 ) ? 1 : 0;\n\n\t\t\t// Render the output\n\t\t\t?>\n <div class=\"field-wrapper\">\n <div class=\"field\">\n <input type=\"checkbox\"\n id=\"<?php echo esc_attr( $args['label_for'] ); ?>\"\n name=\"<?php echo $args['option_name']; ?>[<?php echo esc_attr( $args['label_for'] ); ?>]\"\n value=\"1\"\n <?php echo checked( 1, $checked, false ); ?>\n />\n </div>\n <div class=\"description\">\n <label for=\"<?php echo esc_attr( $args['label_for'] ); ?>\"><?php echo $args['description']; ?></label>\n </div>\n </div>\n <?php\n\t\t}",
"function ivp_theme_checkbox_callback( $args ) {\n global $ivp_theme_options;\n\n $checked = isset($ivp_theme_options[$args['id']]) ? checked(1, $ivp_theme_options[$args['id']], false) : '';\n \n $html = '<input type=\"checkbox\" id=\"ivp_theme_settings[' . $args['id'] . ']\" name=\"ivp_theme_settings[' . $args['id'] . ']\" value=\"1\" ' . $checked . '/>';\n $html .= '<label for=\"ivp_theme_settings[' . $args['id'] . ']\"> ' . $args['desc'] . '</label>';\n\n echo $html;\n}",
"function fval_checkbox($param_name) {\n global $view;\n\n if (!isset($view['form_values'])) {\n return '';\n }\n\n if (getattr($view['form_values'], $param_name)) {\n return ' checked=\"checked\"';\n }\n else {\n return '';\n }\n}",
"function callback_multicheck( $args ) {\n\t\t\t$value = $args['value'];\n\t\t\tif ( empty( $value ) ) {\n\t\t\t\t$value = $args['default'];\n\t\t\t}\n\n\t\t\t$html = '<fieldset>';\n\t\t\tforeach ( $args['options'] as $key => $label ) {\n\t\t\t\t$checked = isset( $value[ $key ] ) ? $value[ $key ] : '0';\n\t\t\t\t$html .= sprintf( '<label for=\"%1$s[%2$s][%3$s]\">', $args['section'], $args['id'], $key );\n\t\t\t\t$html .= sprintf( '<input type=\"checkbox\" class=\"checkbox\" id=\"%1$s[%2$s][%3$s]\" name=\"%5$s[%3$s]\" value=\"%3$s\" %4$s />', $args['section'], $args['id'], $key, checked( $checked, $key, false ), $args['name'] );\n\t\t\t\t$html .= sprintf( '%1$s</label><br>', $label );\n\t\t\t}\n\n\t\t\t$html .= $this->get_field_description( $args );\n\t\t\t$html .= '</fieldset>';\n\t\t\techo $html;\n\t\t\tunset( $value, $html );\n\t\t}",
"public function getChecked(): array\n {\n return $this->checked;\n }",
"public static function checkbox(string $name, string $value, bool $isChecked = false){}",
"public function get_selected_checkbox_hooks() {\n\t\t$checkbox_plugins = $this->get_checkbox_compatible_plugins();\n\t\t$selected_checkbox_hooks = array();\n\t\t$checkbox_opts = mc4wp_get_options( 'checkbox' );\n\n\t\t// check which checkbox hooks are selected\n\t\tforeach ( $checkbox_plugins as $code => $name ) {\n\n\t\t\tif ( isset( $checkbox_opts['show_at_'.$code] ) && $checkbox_opts['show_at_'.$code] ) { \n\t\t\t\t$selected_checkbox_hooks[$code] = $name; \n\t\t\t}\n\t\t}\n\n\t\treturn $selected_checkbox_hooks;\n\t}",
"function checkbox($args) {\r\n\t\t$args = $this->apply_default_args($args) ;\r\n\t\techo \"<input name='$this->options_name[\" . $args['id'] . \"]' type='checkbox' value='1' \";\r\n\t\tchecked('1', $this->options[$args['id']]); \r\n\t\techo \" /> <span class='description'>\" . $args['description'] . \"</span>\" ;\r\n\t\t\r\n\t}",
"function smarty_function_checkBoxValue($params,&$smarty)\n{\n if(isInRequest($params[\"name\"]))\n return \"checked\";\n else if (isset($params[\"always_in_form\"]) and isset($params[\"default_checked\"]))\n if(!isInRequest($params[\"always_in_form\"]) and $params[\"default_checked\"]==\"TRUE\")\n return \"checked\";\n return \"\";\n}",
"function cb($value)\n{\n if ($value == 1 || $value === true) {\n echo ' checked ';\n }\n}",
"public function renderSetsCheckedAttributeIfCheckboxIsBoundToAPropertyOfTypeBoolean() {}",
"function cah_ajax_field_new_paginated_cb( $args ) {\n ?>\n <input\n type=\"checkbox\"\n id=\"<?= esc_attr( $args['label_for'] ); ?>\"\n name=\"<?= $args['option_name'] . '[' . $args['label_for'] . ']' ?>\"\n value=\"true\"\n checked>\n <span class=\"tooltip\"> Decide whether or not to paginate the results.</span>\n <?\n}",
"public function multicheck_callback( $args ) {\n\n\t\tif ( empty( $args['options'] ) ) {\n\t\t\tprintf( __( 'Options for <strong>%s</strong> multicheck is missing.', $this->plugin_name ), $args['id'] );\n\t\t\treturn;\n\t\t}\n\n\t\t$old_values = Plugin_Name_Option::get_option( $args['id'], array() );\n\n\t\t$html ='';\n\n\t\tforeach( $args['options'] as $field_key => $option ) {\n\n\t\t\tif( isset( $old_values[$field_key] ) ) {\n\t\t\t\t$enabled = $option;\n\t\t\t} else {\n\t\t\t\t$enabled = NULL;\n\t\t\t}\n\n\t\t\t$checked = checked( $option, $enabled, false );\n\n\t\t\t$html .= '<input type=\"checkbox\" ';\n\t\t\t$html .= $this->get_id_and_name_attrubutes( $args['id'] . '][' . $field_key );\n\t\t\t$html .= ' value=\"' . $option . '\" ' . $checked . '/> ';\n\n\t\t\t$html .= $this->get_label_for( $args['id'] . '][' . $field_key, $option );\n\t\t\t$html .= '<br/>';\n\t\t}\n\n\t\t$html .= '<p class=\"description\">' . $args['desc'] . '</p>';\n\n\t\techo $html;\n\t}",
"public function getCheckboxDisplays()\n {\n return array(\n 'default' => array('Yes', 'No')\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
testeSelectPorMaisDeUmParametro ..:: Teste do metodo 'selectFilme' de selecao de um (ou mais) registro(s) na tabela tFilme.xml ::.. Comportamento esperado: Selecao de um ou mais registros que satisfazem as condicoes nos parametros; A selecao por um ou mais parametros (metodo 'selectFilme') retorna um array do tipo SimpleXMLElement. | function testeSelectPorMaisDeUmParametro(){
$oFilme = new lFilme();
$oFilme->createTableFilme();
$oFilme->insertFilmeCompleto("Teste, o Filme parte 1", "Teste de Inserção por Parâmetro.","Ação", "1993", "5", "Armando Barracas", "Antonio Banderas e Gessica Alba");
$oFilme->insertFilmeCompleto("Teste, o Filme parte 2", "Teste de Inserção por Parâmetro.","Suspense", "1994", "5","Armando Barracas", null);
/* ..:: Selecao utilizando multiplos campos ::.. */
print_r($oFilme->selectFilme(null,null, "Teste de Inserção por Parâmetro.",null,null, "5", "5", "Armando Barracas"));
} | [
"function testeSelectPorUmParametro(){\n $oFilmeSubscriber = new lFilmeSubscriber();\n $oFilmeSubscriber->createTableFilmeSubscriber();\n print_r($oFilmeSubscriber->insertFilmeSubscriberCompleto(\"Template, o Filme\", \"teste.1@email.com\"));\n print_r($oFilmeSubscriber->insertFilmeSubscriberCompleto(\"Template, o Filme\", \"teste.2@email.com\"));\n \n /* ..:: Consulta utilizando os metodos 'get' ::.. */\n /* Retornam um array de lFilmeSubscriber */\n\n print_r($oFilmeSubscriber->getFilmeSubscriberByCodigo(\"X0001\"));\n // print_r($oFilmeSubscriber->getFilmeSubscriberByTitulo(\"Template, o Filme\"));\n // print_r($oFilmeSubscriber->getFilmeSubscriberByEmail(\"teste.1@email.com\"));\n\n /* ..:: Consultas equivalentes às acima mas utilizando o metodo 'selectFilmeSubscriber' ::.. */ \n /* Retonam um array de SimpleXMLElement */\n\n print_r($oFilmeSubscriber->selectFilmeSubscriber(\"X0001\")); // Busca pelo Código\n // print_r($oFilmeSubscriber->selectFilmeSubscriber(null, \"Template, o Filme\")); // Busca pelo Titulo do Filme\n // print_r($oFilmeSubscriber->selectFilmeSubscriber(null,null,\"teste.1@email.com\")); // Busca somente pelo Email do Subscriber\n}",
"function testeSelectPorMaisDeUmParametro(){\n $oFilmeSubscriber = new lFilmeSubscriber();\n $oFilmeSubscriber->createTableFilmeSubscriber();\n $oFilmeSubscriber->insertFilmeSubscriberCompleto(\"Template, o Filme\", \"teste.1@email.com\");\n $oFilmeSubscriber->insertFilmeSubscriberCompleto(\"Template, o Filme\", \"teste.2@email.com\");\n \n /* ..:: Selecao utilizando multiplos campos ::.. */\n print_r($oFilmeSubscriber->selectFilmeSubscriber(null, \"Template, o Filme\", \"teste.2@email.com\"));\n}",
"function testeSelectPorUmParametro(){\n $oConsulta = new lConsulta();\n $oConsulta->createTableConsulta();\n print_r($oConsulta->insertConsultaCompleto(\"A0000\", \"M0000\",\"P0000\", \"2018-07-01\", \"11:30:00\", \"Teste Select por UM Parametro\", \"Teste Select por UM Parametro\"));\n print_r(\"\\n\");\n print_r($oConsulta->insertConsultaCompleto(\"A0000\", \"M0000\",\"P0001\", \"2018-07-01\", \"12:30:00\", \"Teste Select por UM Parametro\", null));\n print_r(\"\\n\\n\");\n /* ..:: Consulta utilizando os metodos 'get' ::.. */\n /* Retornam um array de lConsulta */\n\n // print_r($oConsulta->getConsultaByCodigo(\"C0001\"));\n // print_r($oConsulta->getConsultaByCodAtendente(\"A0000\"));\n // print_r($oConsulta->getConsultaByCodMedico(\"M0000\"));\n // print_r($oConsulta->getConsultaByCodPaciente(\"P0000\"));\n // print_r($oConsulta->getConsultaByData(\"2018-07-01\"));\n // print_r($oConsulta->getConsultaByHora(\"11:30:00\"));\n // print_r($oConsulta->getConsultaByObservacao(\"Teste Select por UM Parametro\"));\n // print_r($oConsulta->getConsultaByReceita(\"Teste Select por UM Parametro\"));\n\n \n /* ..:: Consultas equivalentes às acima mas utilizando o metodo 'selectConsulta' ::.. */ \n /* Retonam um array de SimpleXMLElement */\n\n // print_r($oConsulta->selectConsulta(\"C0001\")); // Busca somente pelo codigo\n // print_r($oConsulta->selectConsulta(null,\"A0000\")); // Busca somente pelo codAtendente\n // print_r($oConsulta->selectConsulta(null,null,\"M0000\")); // Busca somente pelo codMedico\n // print_r($oConsulta->selectConsulta(null,null,null,\"P0000\")); // Busca somente pelo codPaciente\n // print_r($oConsulta->selectConsulta(null,null,null,null, \"2018-07-01\")); // Busca somente pela data\n // print_r($oConsulta->selectConsulta(null,null,null,null,null, \"11:30:00\")); // Busca somente pela hora\n // print_r($oConsulta->selectConsulta(null,null,null,null,null,null, \"Teste Select por UM Parametro\")); // Busca somente pela observacao\n // print_r($oConsulta->selectConsulta(null,null,null,null,null,null,null, \"Teste Select por UM Parametro\")); // Busca somente pela receita\n \n}",
"function testeSelectPorUmParametro(){\n $oAtendente = new lAtendente();\n $oAtendente->createTableAtendente();\n $oAtendente->insertAtendenteCompleto(\"Teste1\", \"1234567\",\"364.964.588-00\", \"1993-05-31\", \"Rua 7\", \"539879878888\", \"teste@email.com\");\n $oAtendente->insertAtendenteCompleto(\"Teste2\", \"1234567\",\"364.964.588-77\", null, null, null, \"teste@email.com\");\n \n /* ..:: Consulta utilizando os metodos 'get' ::.. */\n /* Retornam um array de lAtendente */\n\n print_r($oAtendente->getAtendenteByCodigo(\"A0001\"));\n // print_r($oAtendente->getAtendenteByNome(\"Teste1\"));\n // print_r($oAtendente->getAtendenteByCPF(\"364.964.588-00\"));\n // print_r($oAtendente->getAtendenteByDtNascimento(\"1993-05-31\"));\n // print_r($oAtendente->getAtendenteByEndereco(\"Rua 7\"));\n // print_r($oAtendente->getAtendenteByTelefone(\"539879878888\"));\n // print_r($oAtendente->getAtendenteByEmail(\"teste@email.com\"));\n\n\n /* ..:: Consultas equivalentes às acima mas utilizando o metodo 'selectAtendente' ::.. */ \n /* Retonam um array de SimpleXMLElement */\n\n print_r($oAtendente->selectAtendente(\"A0001\")); // Busca pelo Codigo\n // print_r($oAtendente->selectAtendente(null,\"Teste1\")); // Busca pelo Nome\n // print_r($oAtendente->selectAtendente(null,null,\"1234567\")); // Busca somente pela senha\n // print_r($oAtendente->selectAtendente(null,null,null, \"364.964.588-00\")); // Busca somente pelo CPF \n // print_r($oAtendente->selectAtendente(null,null,null,null, \"1993-05-31\")); // Busca somente pela Data de Nascimento\n // print_r($oAtendente->selectAtendente(null,null,null,null,null, \"Rua 7\")); // Busca somente pelo Endereco\n // print_r($oAtendente->selectAtendente(null,null,null,null,null,null, \"539879878888\")); // Busca somente pelo Telefone\n // print_r($oAtendente->selectAtendente(null,null,null,null,null,null,null, \"teste@email.com\")); // Busca somente pelo E-mail\n}",
"function testeSelectPorMaisDeUmParametro(){\n $oMedico = new lMedico();\n $oMedico->createTableMedico();\n print_r($oMedico->insertMedicoCompleto(\"Teste1\", \"1234567\",\"364.964.588-00\", \"Pediatria\", \"Unimed\", \"1993-05-31\", \"Rua 7\", \"539879878888\", \"teste@email.com\"));\n print_r(\"\\n\");\n print_r($oMedico->insertMedicoCompleto(\"Teste2\", \"1234567\",\"364.964.588-77\", \"Pediatria\", \"Plano B\", null, null, null, \"teste@email.com\"));\n print_r(\"\\n\\n\");\n\n /* ..:: Selecao utilizando multiplos campos ::.. */\n print_r($oMedico->selectMedico(null, \"Teste1\", \"1234567\",\"364.964.588-00\", \"Pediatria\", \"Unimed\", \"1993-05-31\", \"Rua 7\", \"539879878888\", \"teste@email.com\"));\n}",
"public function selectConsulta(string $codigo = null, string $codAtendente = null, string $codMedico = null, string $codPaciente = null, string $data = null, string $hora = null, string $observacao=null, string $receita=null, string $reg_date = null) {\n\t\t$tablePath = $this->tablePathConsulta;\n\t\t$xml=simplexml_load_file($tablePath) or die(\"Error: Cannot create object\");\n\t\t$maisDeUmParametro = false;\n\t\tif (($codigo == null) && \n\t\t\t($codAtendente == null) &&\n\t\t\t($codMedico == null) &&\n\t\t\t($codPaciente == null) &&\n\t\t\t($data == null) &&\n\t\t\t($hora == null) &&\n\t\t\t($observacao == null) &&\n\t\t\t($receita == null) &&\n\t\t\t($reg_date == null)\n\t\t)\n\t\t{\n\t\t\t$xPathQuery = \"consulta\";\n\t\t\treturn $xml->xpath($xPathQuery); // Retorna um Array de SimpleXML Object, contendo os resultados \n\t\t}\n\t\t$xPathQuery = \"consulta[\";\n\t\tif ($codigo != null) {\n\t\t\t$xPathQuery = $xPathQuery.\"codigo/text()='\".$codigo.\"'\";\n\t\t\t$maisDeUmParametro = true;\n\t\t} \n\t\tif ($codAtendente != null) {\n\t\t\tif ($maisDeUmParametro) $xPathQuery = $xPathQuery.\" and \";\n\t\t\t$xPathQuery = $xPathQuery.\"codAtendente/text()='\".$codAtendente.\"'\";\n\t\t\t$maisDeUmParametro = true;\n\t\t}\n\t\tif ($codMedico != null) {\n\t\t\tif ($maisDeUmParametro) $xPathQuery = $xPathQuery.\" and \";\n\t\t\t$xPathQuery = $xPathQuery.\"codMedico/text()='\".$codMedico.\"'\";\n\t\t\t$maisDeUmParametro = true;\n\t\t}\n\t\tif ($codPaciente != null) {\n\t\t\tif ($maisDeUmParametro) $xPathQuery = $xPathQuery.\" and \";\n\t\t\t$xPathQuery = $xPathQuery.\"codPaciente/text()='\".$codPaciente.\"'\";\n\t\t\t$maisDeUmParametro = true;\n\t\t}\n\t\tif ($data != null) {\n\t\t\tif ($maisDeUmParametro) $xPathQuery = $xPathQuery.\" and \";\n\t\t\t$xPathQuery = $xPathQuery.\"data/text()='\".$data.\"'\";\n\t\t\t$maisDeUmParametro = true;\n\t\t}\n\t\tif ($hora != null) {\n\t\t\tif ($maisDeUmParametro) $xPathQuery = $xPathQuery.\" and \";\n\t\t\t$xPathQuery = $xPathQuery.\"hora/text()='\".$hora.\"'\";\n\t\t\t$maisDeUmParametro = true;\n\t\t}\n\t\tif ($observacao != null) {\n\t\t\tif ($maisDeUmParametro) $xPathQuery = $xPathQuery.\" and \";\n\t\t\t$xPathQuery = $xPathQuery.\"observacao/text()='\".$observacao.\"'\";\n\t\t\t$maisDeUmParametro = true;\n\t\t}\n\t\tif ($receita != null) {\n\t\t\tif ($maisDeUmParametro) $xPathQuery = $xPathQuery.\" and \";\n\t\t\t$xPathQuery = $xPathQuery.\"receita/text()='\".$receita.\"'\";\n\t\t\t$maisDeUmParametro = true;\n\t\t}\n\t\tif ($reg_date != null) {\n\t\t\tif ($maisDeUmParametro) $xPathQuery = $xPathQuery.\" and \";\n\t\t\t$xPathQuery = $xPathQuery.\"reg_date/text()='\".$reg_date.\"'\";\n\t\t\t$maisDeUmParametro = true;\n\t\t}\n\t\t$xPathQuery = $xPathQuery.\"]\";\n\t\t$xml = $xml->xpath($xPathQuery);\n\t\treturn $xml; // Retorna um Array de SimpleXML Object, contendo os resultados\n\t}",
"function testeSelectPorMaisDeUmParametro(){\n $oAtendente = new lAtendente();\n $oAtendente->createTableAtendente();\n $oAtendente->insertAtendenteCompleto(\"Teste1\", \"1234567\",\"364.964.588-00\", \"1993-05-31\", \"Rua 7\", \"539879878888\", \"teste@email.com\");\n $oAtendente->insertAtendenteCompleto(\"Teste2\", \"1234567\",\"364.964.588-77\", null, null, null, \"teste@email.com\");\n \n /* ..:: Selecao utilizando multiplos campos ::.. */\n print_r($oAtendente->selectAtendente(null, \"Teste1\", \"1234567\",\"364.964.588-00\", \"1993-05-31\", \"Rua 7\", \"539879878888\", \"teste@email.com\"));\n}",
"function testeSelectPorUmParametro(){\n $oSubscriber = new lSubscriber();\n $oSubscriber->createTableSubscriber();\n print_r($oSubscriber->insertSubscriberCompleto(\"Teste I\", \"111.111.111-11\",\"teste.1@email.com\", \"+55 53 97777-7777\", \"Rua I, 1\", \"Downtown\", \"22222-222\"));\n print_r($oSubscriber->insertSubscriberCompleto(\"Teste II\", \"222.222.222-22\",\"teste.2@email.com\", \"+55 53 97777-7777\", \"Rua II, 2\",\"Uptown\", \"22222-222\"));\n \n /* ..:: Consulta utilizando os metodos 'get' ::.. */\n /* Retornam um array de lSubscriber */\n\n print_r($oSubscriber->getSubscriberByCodigo(\"S0001\"));\n // print_r($oSubscriber->getSubscriberByNome(\"Teste I\"));\n // print_r($oSubscriber->getSubscriberByCPF(\"111.111.111-11\"));\n // print_r($oSubscriber->getSubscriberByEmail(\"teste.1@email.com\"));\n // print_r($oSubscriber->getSubscriberByTelefone(\"+55 53 97777-7777\"));\n // print_r($oSubscriber->getSubscriberByEndereco(\"Rua I, 1\"));\n // print_r($oSubscriber->getSubscriberByBairro(\"Downtown\"));\n // print_r($oSubscriber->getSubscriberByCEP(\"22222-222\"));\n\n\n /* ..:: Consultas equivalentes às acima mas utilizando o metodo 'selectSubscriber' ::.. */ \n /* Retonam um array de SimpleXMLElement */\n\n print_r($oSubscriber->selectSubscriber(\"S0001\")); // Busca pelo Código\n // print_r($oSubscriber->selectSubscriber(null,\"Teste I\")); // Busca pelo Nome\n // print_r($oSubscriber->selectSubscriber(null,null,\"111.111.111-11\")); // Busca somente pelo CPF\n // print_r($oSubscriber->selectSubscriber(null,null,null, \"teste.1@email.com\")); // Busca somente pelo Email \n // print_r($oSubscriber->selectSubscriber(null,null,null,null, \"+55 53 97777-7777\")); // Busca somente pelo Telefone\n // print_r($oSubscriber->selectSubscriber(null,null,null,null,null, \"Rua I, 1\")); // Busca somente pela Endereço\n // print_r($oSubscriber->selectSubscriber(null,null,null,null,null,null, \"Downtown\")); // Busca somente pelo Bairro\n // print_r($oSubscriber->selectSubscriber(null,null,null,null,null,null,null, \"22222-222\")); // Busca somente pelo CEP\n}",
"function filter_products($filtru)\n{\n $objResponse = new xajaxResponse();\n //dc s-a scris in input text-ul de cautare\n if ($filtru)\n {\n $produse = new Produse(\"where denumire like '$filtru%' order by denumire asc\");\n }\n //input text-ul este gol, incarc toata lista\n else\n {\n $produse = new Produse(\"where 1 order by denumire asc\");\n }\n \n $objResponse->assign(\"div_select_produse\", \"innerHTML\", $produse->select());\n return $objResponse;\n}",
"public function listarFiltroNome(/*parametro*/) {\n\n\n $conn = DataBase::getInstance()->getDb();\n\n\n //criacao do sql\n //TAREFA criar um sql que recebe todos os dados dos Empregados que tem parte do nome ou sobrenome igual o filtro de entrada\n $sql = \"\";\n $stmt = $conn->prepare($sql);\n\n $stmt->execute();\n $resultados = $stmt->fetchAll();\n\n //php imprime codigo html dinamicamente junto com as informacoes recebidas do banco\n foreach ($resultados as $linha) {\n echo \"<tr class = 'alert-warning'>\"\n . \"<td><a href='alterar.php?id=\" . $linha[\"id\"]. \"'>\" . $linha[\"nome\"] . \" \" . $linha[\"sobrenome\"] . \"</td>\"\n . \"<td> \" . $linha[\"\"] . \"</td>\" //acho que nao preciso nem falar neah\n . \"<td>\" . $linha[\"\"] . \" \" . \"</td>\" //acho que nao preciso nem falar neah\n . \"<td>\" . $linha[\"\"] . \" \" . \"</td>\" //acho que nao preciso nem falar neah\n . \"</tr>\";\n }\n }",
"function testeSelectPorMaisDeUmParametro(){\n $oSubscriber = new lSubscriber();\n $oSubscriber->createTableSubscriber();\n $oSubscriber->insertSubscriberCompleto(\"Teste I\", \"111.111.111-11\",\"teste.1@email.com\", \"+55 53 97777-7777\", \"Rua I, 1\", \"Downtown\", \"22222-222\");\n $oSubscriber->insertSubscriberCompleto(\"Teste II\", \"222.222.222-22\",\"teste.2@email.com\", \"+55 53 97777-7777\", \"Rua II, 2\",\"Uptown\", \"22222-222\");\n \n /* ..:: Selecao utilizando multiplos campos ::.. */\n print_r($oSubscriber->selectSubscriber(null, null, null, null, \"+55 53 97777-7777\", null, null, \"22222-222\"));\n}",
"function testeSelectPorMaisDeUmParametro(){\n $oPaciente = new lPaciente();\n $oPaciente->createTablePaciente();\n print_r($oPaciente->insertPacienteCompleto(\"Teste1\", \"1234567\",\"364.964.588-00\", \"Unimed\", \"M\", \"A-\", \"1993-05-31\", \"Rua 7\", \"539879878888\", \"teste@email.com\"));\n print_r(\"\\n\");\n print_r($oPaciente->insertPacienteCompleto(\"Teste2\", \"1234567\",\"364.964.588-77\", \"Plano B\", \"F\", \"A+\", null, null, null, \"teste@email.com\"));\n print_r(\"\\n\\n\");\n\n /* ..:: Selecao utilizando multiplos campos ::.. */\n print_r($oPaciente->selectPaciente(null, \"Teste2\", \"1234567\",\"364.964.588-77\", \"Plano B\", \"F\", \"A+\", null, null, null, \"teste@email.com\"));\n}",
"public function select($bodega_has_producto);",
"public function consultarFacturadoresSelect(){\n\t\t\n\t\t\t$resultado = array();\n\t\t\n\t\t\t$query = \" SELECT F.idFacturador, F.identificacion, F.nombre, F.apellido\n\t\t\t\n\t\t\t\t\t\tFROM tb_facturadores as F\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tWHERE F.estado = 'A' ORDER BY nombre ASC\";\n\t\t\t\t\t\t\n\t\t\t$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado[] = $filas;\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado;\n\t\t\n\t}",
"public function getElementsByFolio(){\n $folio = new Folio();\n return $folio->selectbyId($this->folio_id);\n }",
"public function listarFiltroSalario(/*parametros*/) {\n\n\n $conn = DataBase::getInstance()->getDb();\n\n //criacao do sql\n // TAREFA criar um sql que retorne todas as informacoes dos Empregados que tem salario entre min e max ================\n $sql = \" \";\n $stmt = $conn->prepare($sql);\n\n $stmt->execute();\n $resultados = $stmt->fetchAll();\n\n //php imprime codigo html dinamicamente junto com as informacoes recebidas do banco\n foreach ($resultados as $empregado) {\n echo \"<tr class = 'alert-warning'>\"\n . \"<td><a href='alterar.php?id=\" . $empregado[\"id\"]. \"'>\" . $empregado[\"nome\"] . \" \" . $empregado[\"sobrenome\"] . \"</td>\"\n . \"<td> \" . $empregado[\"\"] . \"</td>\" // colocar o email\n . \"<td>\" . $empregado[\"\"] . \" \" . \"</td>\" //colocar o cargo\n . \"<td>\" . $empregado[\"\"] . \" \" . \"</td>\" //colocar o salario\n . \"</tr>\";\n }\n }",
"public function obtProspectosSMSSegunFiltro(){\n jimport('joomla.filesystem.file');\n require_once(JPATH_COMPONENT.'/helpers/sasfehp.php' ); \n $idAsesor = ($_POST['idAsesor']!='') ?($_POST['idAsesor']==0)?'':$_POST['idAsesor'] :'';\n $idEstatus = ($_POST['idEstatus']!='') ?$_POST['idEstatus'] :'';\n $fechaDel = ($_POST['fechaDel']!='') ?SasfehpHelper::conversionFecha($_POST['fechaDel']) :''; \n $fechaAl = ($_POST['fechaAl']!='') ?SasfehpHelper::conversionFecha($_POST['fechaAl']) :'';\n $idFracc = ($_POST['idFracc']!='') ?$_POST['idFracc'] :'';\n\n $tipoProceso = 1; //referido\n $datos = SasfehpHelper::obtUsuariosSMSPorFiltro($idAsesor, $idEstatus, $fechaDel, $fechaAl, $tipoProceso, $idFracc);\n // $datos = SasfehpHelper::obtUsuariosSMSPorFiltro(\"40\", \"87\", \"2015-03-09\", \"2015-04-10\");\n\n $result = array(\"success\"=>true, \"datos\"=>$datos);\n $this->retornaJson($result);\n }",
"function filtres($vs_genre1,$vs_genre2,$vs_search)\n{\n if($vs_genre1 === \"\" && $vs_genre2 !== \"\")\n {\n $reponse=selectFilmGenre2($vs_genre2);\n }\n //recupere les films correspondant au genre 1 si il est selectionne\n else if($vs_genre1 !== \"\" && $vs_genre2 === \"\")\n {\n $reponse=selectFilmGenre1($vs_genre1);\n }\n //recupere les films correspondant au genre 1 et du genre2\n else if($vs_genre1 !== \"\" && $vs_genre2 !== \"\")\n {\n $reponse=selectFilmGenres($vs_genre1,$vs_genre2);\n }\n //si aucun genre n'est selectionne verifie si une expression est recherchee\n else if(trim($vs_search) !== \"\")\n {\n $reponse=research($vs_search);\n }\n //renvoie les infos de tous les films\n else\n {\n $bdd = new PDO('mysql:host=localhost;dbname=toseelist;charset=utf8', 'root', '');\n $reponse = $bdd->query('SELECT film.idfilm,titre, affiche,resume,date,isEnfant FROM film;');\n }\n return $reponse;\n}",
"Private function select()\n {\n\n /*je regarde de quel type de select j'ai affaire*/\n $multiple = (empty($this->var_enf['multiple']) ||$this->var_enf['multiple'] == \"Non\" )?\"\":\"multiple='multiple'\";\n\n /*je recupere Les champ option du xml*/\n foreach($this->var_enf->children() as $k)\n {\n if(empty($k['table']))\n {\n \n if($this->recup() == $k['value'])\n {\n $selected = \"selected='selected'\";\n $option .= \"<option value='\".$k['value'].\"' $selected>\".$this->verif_constant($k).\"</option>\";\n }\n else\n {\n $option .= \"<option value='\".$k['value'].\"'>\".$this->verif_constant($k).\"</option>\";\n\n }\n \n }\n else\n {\n $database = new DB;\n $database->var_base = \"\";\n $database->table = $k['table'];\n $requete = $database->lire_db();\n\n $table = $database->convtableaux($requete,'option');\n\n\n\n foreach($table as $clee => $val)\n {\n if(is_array($val))\n {\n $value .= $k['value'];\n $titre .= $k['titre'];\n \n if($k['ajout'] == 'true')\n {\n /** je recupere le texte a afficher avec la variable et je remplace Le {quelquechose} par la variable*/\n $chaine = $this->verif_constant($k);\n $final = str_replace(\"{\".$titre.\"}\", $val[$titre], $chaine);\n }\n else\n {\n $final = $val[$titre];\n }\n\n if($this->recup() == $val[$value])\n {\n $selected = \"selected='selected'\";\n \n }\n \n $option .=\"<option value='\".$val[$value].\"' $selected $multiple>\".$final.\"</option>\";\n unset($value);\n unset($titre);\n unset($selected);\n unset($final);\n }\n\n\n }\n }\n }\n\n if(!empty($this->var_enf['label']))\n {\n $label = \"<div class='label'>\".$this->verif_constant($this->var_enf['label']).\"</div>\";\n }\n\n $html .= \"$label\n\n\n\n\n <div class='formx'>\n <select name='$this->var_clee_array[\".$this->var_enf['valeur'].\"]' $multiple>\n $option\n </select>\n </div>\";\n \n return $html;\n\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wrapper method for the permission object's own checkRightLevel method. | function checkRightLevel($rights, $owner_user_id, $owner_group_id)
{
$level = $this->checkRight($rights);
if (is_a($this->_perm, 'LiveUser_Perm_Complex')) {
$level = $this->_perm->checkLevel($level, $owner_user_id, $owner_group_id);
}
return (bool)$level;
} | [
"function permissionCheck($priv)\n {\n $authlevels = array('post-only', 'normal', 'tech', 'admin');\n\n // First, get to the requested level in the level stack\n for ($i = 0; $i < count($authlevels); $i++)\n {\n if ($authlevels[$i] == $priv)\n {\n break;\n }\n }\n \n // Whoops, out the top means that the calling function didn't\n // give us a level we know about\n if ($i >= count($authlevels))\n {\n trigger_error(sprintf(_(\"Auth level %s not found\"), $authtype), E_USER_ERROR);\n die(__FILE__.\":\".__LINE__.\": dying with fatal error\\n\");\n exit;\n }\n \n // Now look for the user's auth level in the levels still\n // remaining in the stack above the requested level.\n for (; $i < count($authlevels); $i++)\n {\n if ($authlevels[$i] == $this->udata['Type'])\n {\n return true;\n }\n }\n \n return false;\n }",
"function checkRights()\n { \n if(\\GO::modules()->dokuwiki->checkPermissionLevel(\\GO\\Base\\Model\\Acl::MANAGE_PERMISSION))\n $this->canDo('UserMod');\n else\n $this->canDo('Profile');\n }",
"function readRights()\n {\n $query = '\n SELECT\n R.right_id AS rightid, '.LIVEUSER_MAX_LEVEL.'\n FROM\n '.$this->prefix.'userrights UR\n INNER JOIN\n '.$this->prefix.'rights R\n ON\n UR.right_id=R.right_id\n WHERE\n UR.perm_user_id='.$this->dbc->quote($this->permUserId, 'integer') . '\n AND\n UR.right_level > 0';\n $types = array('integer', 'integer');\n $result = $this->dbc->queryAll($query, $types, MDB2_FETCHMODE_ORDERED, true);\n\n if (MDB2::isError($result)) {\n return $result;\n } // if\n\n $this->rights = $result;\n }",
"function checkPermissions($accountLevel, $neededLevel){\n\n\tif($accountLevel >= $neededLevel)\n\t\treturn true;\n\n\telse\n\t\treturn false;\n}",
"function hasRight($right) {\n if (array_key_exists('rights', $_SESSION) && array_key_exists($right, $_SESSION['rights'])) {\n return $_SESSION['rights'][$right];\n } elseif ($_SESSION['access'] == 99) {\n // grant super-admin role all rights\n return true;\n } else {\n return false;\n }\n}",
"function checkAccess() {\r\n $ret = false;\r\n global $zariliaUser, $zariliaOption;\r\n $groupperm_handler = &zarilia_gethandler( 'groupperm' );\r\n $groups = $zariliaUser ? $zariliaUser->getGroups() : ZAR_GROUP_ANONYMOUS;\r\n if ( file_exists( './zarilia_version.php' ) ) {\r\n $right = 'addon_read';\r\n } elseif ( file_exists( '../zarilia_version.php' ) ) {\r\n $zariliaOption['pagetype'] = \"admin\";\r\n $right = 'addon_admin';\r\n } else {\r\n return $ret;\r\n }\r\n return $groupperm_handler->checkRight( $right, $this->getVar( 'mid' ), $groups );\r\n }",
"function has_system_level_access($permission_data)\n{\n return array_get($permission_data, 'system_level_access');\n}",
"function permission_check ($permisi_id, $auto_die = true)\n{\n\tglobal $current_user_info, $config, $lang, $in_admin_cp;\n\t$allowed = false;\n\n\tif (is_numeric ($permisi_id))\n\t{\n\t\tif ($in_admin_cp)\n\t\t{\n\t\t\tif (($current_user_info['admin_level'] < $permisi_id))\n\t\t\t{\n\t\t\t\t// admin && ajax -> simply show a message to re-login\n\t\t\t\tif (strpos (cur_url (false), '/admin_ajax.php'))\n\t\t\t\t\tdie ('Please re-login');\n\t\t\t\telse\n\t\t\t\t\tadmin_die ($lang['msg']['no_level']);\n\t\t\t}\n\t\t\t$allowed = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (($current_user_info['admin_level'] >= $permisi_id)) $allowed = true;\n\t\t}\n\t}\n\telse\n\t{\n\t\t$permisi = unserialize ($config['permisi'][$permisi_id]);\n\n\t\tif ($in_admin_cp)\n\t\t{\n\t\t\tif (!$permisi[$current_user_info['admin_level']])\n\t\t\t\tadmin_die ($lang['msg']['no_level']);\n\t\t\telse\n\t\t\t\t$allowed = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($permisi[$current_user_info['user_level']]) $allowed = true;\n\t\t}\n\t}\n\n\t// return\n\tif ($auto_die && !$allowed) msg_die ($lang['msg']['no_level']);\n\tif (!$auto_die && !$allowed) return false;\n\tif ($in_admin_cp)\n\t\treturn ($current_user_info['admin_level']);\n\telse\n\t\treturn ($current_user_info['user_level']);\n}",
"function getUserAccessRight($user_id, $module)\n{\n\treturn 1;\n\t\n\t$mycon = databaseConnect();\n require_once(\"inc_dbfunctions.php\");\n $dataRead = New DataRead();\n\n $groupdetails = $dataRead->admins_groups_getbyuserid($mycon,$user_id);\n\n if($groupdetails == false) return false;\n \n if($groupdetails['username'] == \"administrator\") return 1;\n \n\t$rights = $groupdetails['rights'];\n \n\t\n\t//check if the right exists for the specified module\n\tif(strpos($rights,$module) === false) return 0;\n\t\n\t//at this point everuthing is fine\n\treturn 1;\n}",
"public static function check_ruri_level_access()\n\t\t{\n\t\t\tdo_action('ws_plugin__s2member_before_check_ruri_level_access', get_defined_vars());\n\n\t\t\t$ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';\n\t\t\t$excluded = apply_filters('ws_plugin__s2member_check_ruri_level_access_excluded', FALSE, get_defined_vars());\n\n\t\t\tif(!$excluded && $GLOBALS['WS_PLUGIN__']['s2member']['o']['membership_options_page']) // Has it been excluded?\n\t\t\t{\n\t\t\t\tif(!c_ws_plugin__s2member_systematics::is_wp_systematic_use_page()) // Do NOT touch WordPress Systematics. This excludes all WordPress Systematics.\n\t\t\t\t{\n\t\t\t\t\t$user = (is_user_logged_in() && is_object($user = wp_get_current_user()) && !empty($user->ID)) ? $user : FALSE; // Current User's object.\n\n\t\t\t\t\tif($GLOBALS['WS_PLUGIN__']['s2member']['o']['login_redirection_override'] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri($user, 'root-returns-false')) && preg_match('/^'.preg_quote($login_redirection_uri, '/').'$/'.$ci, $_SERVER['REQUEST_URI']) && c_ws_plugin__s2member_no_cache::no_cache_constants('restricted') && (!$user || !$user->has_cap('access_s2member_level0')))\n\t\t\t\t\t\tc_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars('ruri', $_SERVER['REQUEST_URI'], 'level', 0, $_SERVER['REQUEST_URI'], 'sys').exit ();\n\n\t\t\t\t\telse if(!c_ws_plugin__s2member_systematics::is_systematic_use_page()) // Do NOT protect Systematics. However, there is 1 exception above ^.\n\t\t\t\t\t{\n\t\t\t\t\t\tfor($n = $GLOBALS['WS_PLUGIN__']['s2member']['c']['levels']; $n >= 0; $n--) // URIs. Go through each Level.\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($GLOBALS['WS_PLUGIN__']['s2member']['o']['level'.$n.'_ruris']) // URIs configured at this Level?\n\t\t\t\t\t\t\t\tforeach(preg_split('/['.\"\\r\\n\\t\".']+/', c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars($GLOBALS['WS_PLUGIN__']['s2member']['o']['level'.$n.'_ruris'], $user)) as $str)\n\t\t\t\t\t\t\t\t\tif($str && preg_match('/'.preg_quote($str, '/').'/'.$ci, $_SERVER['REQUEST_URI']) && c_ws_plugin__s2member_no_cache::no_cache_constants('restricted') && (!$user || !$user->has_cap('access_s2member_level'.$n)))\n\t\t\t\t\t\t\t\t\t\tc_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars('ruri', $_SERVER['REQUEST_URI'], 'level', $n, $_SERVER['REQUEST_URI']).exit ();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdo_action('ws_plugin__s2member_during_check_ruri_level_access', get_defined_vars());\n\t\t\t\t}\n\t\t\t}\n\t\t\tdo_action('ws_plugin__s2member_after_check_ruri_level_access', get_defined_vars());\n\t\t}",
"public function checkOldPermissionLevel($level) {\n\n\t\t$arr = explode('.', $this->aclField());\n\t\t$relation = array_shift($arr);\n\t\t$r = $this->getRelation($relation);\n\t\t$aclFKfield = $r['field'];\n\n\t\t$oldValue = $this->getOldAttributeValue($aclFKfield);\n\t\tif(empty($oldValue))\n\t\t\treturn true;\n\t\t//TODO: check if above code is needed (test by moving contact to differend addresbook)\n\n\t\t$acl_id = $this->_getOldParentAclId();\n\t\t$result = \\GO\\Base\\Model\\Acl::getUserPermissionLevel($acl_id)>=$level;\n\n\t\treturn $result;\n\t}",
"public function hasAccessToLevel( $levelId );",
"public function hasUsageRights() {}",
"function has_rights(&$db,$roleQuestion,$tprojectID = null,$tplanID = null)\r\n{\r\n return $_SESSION['currentUser']->hasRight($db,$roleQuestion,$tprojectID,$tplanID);\r\n}",
"function user_hasright( $right_name = \"default\" , $right_user = \"\" )\n{\n\tif( $_SESSION['loggedin'] )\n\t{\n\t\tforeach( $_SESSION['permissions'] as $permission )\n\t\t{\n\t\t\tif( $permission == $right_name || $permission == 'do_everything' )\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\t\n\n}",
"function checkPermission(TargetSpec $target = null, array $right = []);",
"function getAccessLevelRounded($level) {\n\t\t$found=NULL;\n\t\t$match=NULL;\n\t\t$arr = $this->getAccessArray();\n\t\tforeach ($arr as $key=>$value) {\n\t\t\tif (!($level > $value) && !$match) {\n\t\t\t\t$found=$value;\n\t\t\t\t$match=1;\n\t\t\t}\n\t\t}\n\t\t// we made it to the top, must be an admin\n\t\tif (!$match) {\n\t\t\t$found=$value;\n\t\t}\n\t\treturn $found; // return the match\n\t}",
"private function checkRight($item) {\n return $this->user_right[$item];\n }",
"function checkLevel($level, $owner_user_id, $owner_group_id)\n {\n // level above 0\n if ($level <= 0) {\n return false;\n }\n // highest level (that is level 3) or no owner id's passed\n if ($level == LIVEUSER_MAX_LEVEL\n || (is_null($owner_user_id) && is_null($owner_group_id))\n ) {\n return $level;\n }\n // level 1 or higher\n if ((!is_array($owner_user_id) && $this->perm_user_id == $owner_user_id)\n || is_array($owner_user_id) && in_array($this->perm_user_id, $owner_user_id)\n ) {\n return $level;\n // level 2 or higher\n }\n if ($level >= 2) {\n // check if the ressource is owned by a (sub)group\n // that the user is part of\n if (is_array($owner_group_id)) {\n if (count(array_intersect($owner_group_id, $this->group_ids))) {\n return $level;\n }\n } elseif (in_array($owner_group_id, $this->group_ids)) {\n return $level;\n }\n }\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Plugin Name: Supersimple Pinterest Widget Plugin URI: Description: This is a lightweight Wordpress plugin to display your recent Pinterest pins. Version: 0.1 Installation: 1. Copy pinterest_widget.php to your plugins folder, /wpcontent/plugins/ 2. Activate it through the plugin management screen. 3. Go to Themes>Sidebar Widgets and drag and drop the widget to wherever you want to show it. This plugin is heavilyinspired by the Flickr Widget by Donncha O Caoimh | function widget_pinterest($args) {
if( file_exists( ABSPATH . WPINC . '/rss.php') ) {
require_once(ABSPATH . WPINC . '/rss.php');
} else {
require_once(ABSPATH . WPINC . '/rss-functions.php');
}
extract($args);
$options = get_option('widget_pinterest');
if( $options == false ) {
$options[ 'title' ] = 'Pinterest Pins';
$options[ 'items' ] = 3;
}
$title = empty($options['title']) ? __('My Pinterest Pins') : $options['title'];
$items = $options[ 'items' ];
$pinterest_rss_url = empty($options['pinterest_rss_url']) ? __('http://pinterest.com/paulsciarra/feed.rss') : $options['pinterest_rss_url'];
if ( empty($items) || $items < 1 || $items > 15 ) $items = 3;
$rss = fetch_rss( $pinterest_rss_url );
if( is_array( $rss->items ) ) {
$out = '';
$items = array_slice( $rss->items, 0, $items );
while( list( $key, $pin ) = each( $items ) ) {
preg_match_all("/<IMG.+?SRC=[\"']([^\"']+)/si",$pin[ 'description' ],$sub,PREG_SET_ORDER);
$pin_url = str_replace( "_m.jpg", "_t.jpg", $sub[0][1] );
$out .= "<li><a href='{$pin['link']}'><img alt='".wp_specialchars( $pin[ 'title' ], true )."' title='".wp_specialchars( $pin[ 'title' ], true )."' src='$pin_url' border='0'><h4>".wp_specialchars( $pin[ 'title' ], true )."</h4></a></li>";
}
$pinterest_home = $rss->channel[ 'link' ];
$pinterest_more_title = $rss->channel[ 'title' ];
}
?>
<?php echo $before_widget; ?>
<!-- Start of Pinterest Badge -->
<!-- Start Custom CSS for Pinterest Widget -->
<style media="screen" type="text/css">
/* Pinterest Plugin */
#pint_badge_uber_wrapper {
background-color: #f6f6f6;
/* border-top: 2px solid #ececec;
border-bottom: 2px solid #ececec;*/
-moz-box-shadow: inset 0px 0px 10px rgba(0,0,0,0.1);
-webkit-box-shadow: inset 0px 0px 10px rgba(0,0,0,0.1);
box-shadow: inset 0px 0px 10px rgba(0,0,0,0.1);
margin-right: -20px;
margin-left: -24px;
border-right: 4px solid #d89994;
overflow: auto;
}
#pint_badge_uber_wrapper ul, #pint_badge_uber_wrapper ul li{
list-style: none;
overflow: auto;
margin: 0;
padding: 0;
}
#pint_badge_uber_wrapper ul {
clear: both;
padding: 7px 5px 7px 20px;
position: relative;
top: -5px;
}
#pint_badge_uber_wrapper ul li a h4 {
font-size: 11px;
margin: 9px 4px 4px;
color: #bdbdbd;
font-weight: normal;
font-style: normal;
}
#pint_badge_uber_wrapper ul li {
float: left;
background-color: #ffffff;
-moz-box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
-webkit-box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
text-align: center;
padding: 15px 10px 10px;
margin-right: 18px;
margin-bottom: 15px;
width: 20%;
height: 210px;
overflow: hidden;
}
#pint_badge_uber_wrapper ul li a img {
max-height: 150px;
max-width: 150px;
border: 1px solid #f2f2f2;
}
#more-pins {
display: block;
float: left;
padding: 10px 7px 10px 19px;
color: #a5a5a5;
font-size: 15px;
}
a#more-pins:hover {
color: #77afb5;
}
#more-pins img {
margin-bottom: -3px;
margin-right: 4px;
}
#fork {
float: right;
padding: 4px 9px 4px 21px;
background: url(images/fork.png) no-repeat 6px 5px;
font-size: 13px;
margin-top: 8px;
margin-right: 21px;
opacity: 0.2;
color: #4a4a4a;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
a#fork:hover{
float: right;
padding: 4px 9px 4px 21px;
background: url(images/fork.png) no-repeat 6px -20px #979797;
font-size: 13px;
margin-top: 8px;
margin-right: 21px;
opacity: 1;
color: #ffffff;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
</style>
<!-- End Custom CSS for Pinterest Widget -->
<div id="pint_badge_uber_wrapper" cellpadding="0" cellspacing="10" border="0">
<a href="https://github.com/Ethanhackett/Beautiful-super-simple-Pinterest-widget" target="_blank" id="fork" title="fork this modified wordpress plugin">Fork</a>
<a href="<?php echo strip_tags( $pinterest_home ) ?>" id="more-pins"><img src="<?php bloginfo( 'url' ); ?>/wp-content/plugins/super-simple-pinterest-plugin/pinterest.png" width="78px" height="20px"> View Pins</a>
<ul>
<?php echo $out ?>
</ul>
</div>
<!-- End of Pinterest Badge -->
<?php echo $after_widget; ?>
<?php
} | [
"function register_MD_Widget_Pinterest() {\n register_widget( 'MD_Widget_Pinterest' );\n}",
"public function FPG_widget(){\n //widget setting\n if(is_admin()){\n add_action('admin_print_styles',array($this,'widgetEnqueueAdminStuff'));\n }else{\n add_action('init',array($this,'widgetEnqueueStuff'));\n }\n include_once dirname(__FILE__).'/include/phpFlickr.php';\n $widget_ops = array('classname'=>'fpg_widget', \n 'description' => __('This widget shows the last <em>n</em> photos from a Flickr account','FlickrPhotogallery'));\n //widget-control settings\n $control_ops = array('width'=> 500, 'height'=> 350, 'id_base'=>'fpg_widget');\n $this->WP_Widget('fpg_widget', __('FlickrPhotogallery Widget','FlickrPhotogallery'), $widget_ops, $control_ops);\n }",
"function rp_load_widget() {\n register_widget( 'recent_posts_widget' );\n}",
"function giving_theme_widgets(){\n register_sidebar( array(\n 'id' => 'widget-portfolio',\n 'name' => __('widget portfolio'),\n 'description' => __('this widget allows to show the grid portfolio of custom post items in givning theme '),\n 'before_widget'=> '<div class=\"container my-5\">',\n 'after_widget'=> '</div>',\n 'before_title'=> '<h1>',\n 'after_title'=> '</h1><hr>'\n ) );\n}",
"function wrpbc_load_widget() {\n register_widget( 'recent_postbox_widget' );\n}",
"function colabs_shortcode_pinterest_javascript () {\r\n\techo '<script type=\"text/javascript\" src=\"http://assets.pinterest.com/js/pinit.js\"></script>' . \"\\n\";\r\n}",
"function wpb_load_widget() {\n register_widget( 'postbox_widget' );\n}",
"function recent_posts_load_widget()\n{\n register_widget('recent_posts_widget');\n}",
"function ilike_social_media_optimization(){\n\t\t$widget_ops = array('classname' => 'widget_ilike_social_media_optimization', 'description' => __( \"With iLike Social Media Optimization (SMO) for Wordpress, you can turn on and customize many social network profile buttons which power by AddThis.com but with slight enhanced iLikeiPlus feature (which can be enabled and disabled as well) to let your earn more traffic for your social profile. The standard buttons will show Facebook, Google+, Pinterest, and Twitter button. If you need to customize the buttons you can register free account at AddThis.com to customise and fill up your AddThis profile in this plugin setting.\") );\n\t\t$control_ops = array('width' => 310, 'height' => 220);\n\t\t$this->WP_Widget('ilike_social_media_optimization', __('iLike Social Media Optimization'), $widget_ops, $control_ops);\n\t}",
"function twitterWidget()\n{\n\t$number = 5;\n\t$title = \"Twitter\";\n\t$settings = get_option(\"widget_twitterwidget\");\n\tif ($settings['number']) $number = $settings['number'];\n\tif ($settings['title']) $title = $settings['title'];\n\tif ($settings['username']) $username = $settings['username'];\n\n?>\n<div class=\"block widget widget_twitter\">\n\t<h3 class=\"hl\"><?php echo $title; ?></h3>\n\t<ul id=\"twitter_update_list\"><li></li></ul>\t\t\n <p class=\"follow\"><a href=\"http://www.twitter.com/<?php echo $username; ?>\"><?php _e('Follow us on Twitter',woothemes); ?></a></p>\n</div><?php\n$GLOBALS[twitter_widget] = true;\n}",
"function bp_zoneideas_widget_cool_widget($args) {\n global $current_blog, $bp;\n \n extract($args);\n\n /***\n * This is where you'll want to fetch the widget settings and use them to modify the\n * widget's output.\n */\n $options = get_blog_option( $current_blog->blog_id, 'bp_zoneideas_widget_cool_widget' );\n?>\n <?php echo $before_widget; ?>\n <?php echo $before_title\n . $widget_name \n . $after_title; ?>\n \n <?php\n \n /***\n * This is where you add your HTML and render what you want your widget to display.\n */\n \n ?>\n \n <?php echo $after_widget; ?>\n<?php\n}",
"function widget_Twidget_init() {\n\n\tif ( !function_exists('register_sidebar_widget') )\n\t\treturn;\n\n\tfunction widget_Twidget($args) {\n\n\t\t// \"$args is an array of strings that help widgets to conform to\n\t\t// the active theme: before_widget, before_title, after_widget,\n\t\t// and after_title are the array keys.\" - These are set up by the theme\n\t\textract($args);\n\n\t\t// These are our own options\n\t\t$options = get_option('widget_Twidget');\n\t\t$account = $options['account']; // Your Twitter account name\n\t\t$title = $options['title']; // Title in sidebar for widget\n\t\t$show = $options['show']; // # of Updates to show\n\t\t$follow = $options['follow']; // # of Updates to show\n\n // Output\n\t\techo $before_widget ;\n\n\t\t// start\n\t\techo '<div class=\"twitter clearfix\"><h3><a href=\"http://www.twitter.com/'.$account.'/\" title=\"'.$follow.'\">'.$title.' </a></h3>'; \n\t\techo '<div class=\"twitter_post\"><div id=\"twitter\">';\n\t\techo '<ul id=\"twitter_update_list\"><li></li></ul>\n\t\t <script type=\"text/javascript\" src=\"http://twitter.com/javascripts/blogger.js\"></script>';\n\t\techo '<script type=\"text/javascript\" src=\"http://twitter.com/statuses/user_timeline/'.$account.'.json?callback=twitterCallback2&count='.$show.'\"></script>';\n\t\techo '</div></div></div>';\n\t\t\t\n\t\t\t\t\n\t\t// echo widget closing tag\n\t\techo $after_widget;\n\t}\n\n\t// Settings form\n\tfunction widget_Twidget_control() {\n\n\t\t// Get options\n\t\t$options = get_option('widget_Twidget');\n\t\t// options exist? if not set defaults\n\t\tif ( !is_array($options) )\n\t\t\t$options = array('account'=>'rbhavesh', 'title'=>'Twitter Updates', 'show'=>'3');\n\n // form posted?\n\t\tif ( $_POST['Twitter-submit'] ) {\n\n\t\t\t// Remember to sanitize and format use input appropriately.\n\t\t\t$options['account'] = strip_tags(stripslashes($_POST['Twitter-account']));\n\t\t\t$options['title'] = strip_tags(stripslashes($_POST['Twitter-title']));\n\t\t\t$options['show'] = strip_tags(stripslashes($_POST['Twitter-show']));\n\t\t\t$options['follow'] = strip_tags(stripslashes($_POST['Twitter-follow']));\n\t\t\t$options['linkedin'] = strip_tags(stripslashes($_POST['Twitter-linkedin']));\n\t\t\t$options['facebook'] = strip_tags(stripslashes($_POST['Twitter-facebook']));\n\t\t\tupdate_option('widget_Twidget', $options);\n\t\t}\n\n\t\t// Get options for form fields to show\n\t\t$account = htmlspecialchars($options['account'], ENT_QUOTES);\n\t\t$title = htmlspecialchars($options['title'], ENT_QUOTES);\n\t\t$show = htmlspecialchars($options['show'], ENT_QUOTES);\n\t\t$follow = htmlspecialchars($options['follow'], ENT_QUOTES);\n\n\t\t// The form fields\n\t\techo '<p style=\"text-align:left;\">\n\t\t\t\t<label for=\"Twitter-account\">' . __('Twitter Account ID:') . '\n\t\t\t\t<input style=\"width: 280px;\" id=\"Twitter-account\" name=\"Twitter-account\" type=\"text\" value=\"'.$account.'\" />\n\t\t\t\t</label></p>';\n\t\techo '<p style=\"text-align:left;\">\n\t\t\t\t<label for=\"Twitter-title\">' . __('Title:') . '\n\t\t\t\t<input style=\"width: 280px;\" id=\"Twitter-title\" name=\"Twitter-title\" type=\"text\" value=\"'.$title.'\" />\n\t\t\t\t</label></p>';\n\t\techo '<p style=\"text-align:left;\">\n\t\t\t\t<label for=\"Twitter-show\">' . __('Show Twitter Posts:') . '\n\t\t\t\t<input style=\"width: 280px;\" id=\"Twitter-show\" name=\"Twitter-show\" type=\"text\" value=\"'.$show.'\" />\n\t\t\t\t</label></p>';\n\t\techo '<input type=\"hidden\" id=\"Twitter-submit\" name=\"Twitter-submit\" value=\"1\" />';\n\t}\n\n\n\t// Register widget for use\n\tregister_sidebar_widget(array('PT → Twitter', 'widgets'), 'Widget_Twidget');\n\n\t// Register settings for use, 300x200 pixel form\n\tregister_widget_control(array('PT → Twitter', 'widgets'), 'Widget_Twidget_control', 300, 200);\n\t\n}",
"function register_Posts_Widget() {\n register_widget( 'Posts_Widget' );\n}",
"function widget_sidebar_init() {\nif ( !function_exists('register_sidebar_widget') )\nreturn;\nfunction widget_sidebar() {\n// eiger Code Start\n\techo '<li class=\"widget widget-autorenwidget\"><h3 class=\"widgettitle style-head\">Contributing People</h3><hr class=\"widget-hr\" /><ul>';\n\twp_list_authors('exclude_admin=0&show_fullname=true');\n\techo '</ul></li>';\n// eiger Code Ende\n}\nregister_sidebar_widget('AutorenWidget', 'widget_sidebar');\n}",
"function plugin_shortcode() {\r\n \r\n ?>\r\n\r\n\t<h2><?php _e('Add wpPlugin', 'wpscripts'); ?></h2>\r\n\t\r\n\t<div style=\"width: 600px;\">\r\n\t\t<p>\r\n\t\t\tUse the Macro code below to display the wpPlugin in your website.\r\n\t\t</p>\r\n\t\t<p>\r\n\t\t\tYou must create a dedicated page for this feed. After you create the page, copy and paste the Macro Code into the page. You must use HTML view when you add the Macro Code.\r\n\t\t</p>\r\n\t\t<p>\r\n\t\t\tMacro Code:\r\n\t\t\t<br />\r\n\t\t\t<h3>[plugins]</h3>\r\n\t\t</p>\r\n\t</div>\r\n\t\r\n\t<?php\t\t\r\n\t\r\n }",
"function pb_load_widget() {\n\tregister_widget( 'pb_widget' );\n}",
"function socialmediahub_init()\n{\n\tregister_widget(\"socialmediahub\");\n\n}",
"function sidebar_widget()\n{\n\t register_sidebar(array(\n\t 'name' => 'Sidebar Widget',\n\t 'class' => '',\n\t 'description' => '',\n\t 'before_title' => '',\n\t 'after_title' => '',\n\t 'before_widget' => '',\n\t 'after_widget' => '',\n\t ));\n }",
"function followus_widget(){\n\n register_widget( 'Followus' );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test adding filters to all subitems | public function testAddFilter()
{
$filter = new Formagic_Filter_Mock_MockFilter();
$container = $this->_getContainerWithItems();
$container->addFilter($filter);
foreach ($container as $item) {
$this->assertTrue($item->hasFilter('Mock_MockFilter'));
}
} | [
"public function test_add_filters() {\n\n\t\t// Check for Divi.\n\t\tLLMS_Blocks_Page_Builders::add_filters();\n\t\t$this->assertFalse( has_filter( 'llms_blocks_is_post_migrated', array( 'LLMS_Blocks_Page_Builders', 'check_for_divi' ) ) );\n\n\t\tdefine( 'ET_BUILDER_VERSION', 1 );\n\t\tLLMS_Blocks_Page_Builders::add_filters();\n\t\t$this->assertEquals( 15, has_filter( 'llms_blocks_is_post_migrated', array( 'LLMS_Blocks_Page_Builders', 'check_for_divi' ) ) );\n\n\t\t// Check for Elementor.\n\t\tLLMS_Blocks_Page_Builders::add_filters();\n\t\t$this->assertFalse( has_filter( 'llms_blocks_is_post_migrated', array( 'LLMS_Blocks_Page_Builders', 'check_for_elementor' ) ) );\n\n\t\tdefine( 'ELEMENTOR_VERSION', 1 );\n\t\tLLMS_Blocks_Page_Builders::add_filters();\n\t\t$this->assertEquals( 15, has_filter( 'llms_blocks_is_post_migrated', array( 'LLMS_Blocks_Page_Builders', 'check_for_elementor' ) ) );\n\n\t\t// Check for BB.\n\t\tLLMS_Blocks_Page_Builders::add_filters();\n\t\t$this->assertFalse( has_filter( 'llms_blocks_is_post_migrated', array( 'LLMS_Blocks_Page_Builders', 'check_for_beaver' ) ) );\n\n\t\tdefine( 'FL_BUILDER_VERSION', 1 );\n\t\tLLMS_Blocks_Page_Builders::add_filters();\n\t\t$this->assertEquals( 15, has_filter( 'llms_blocks_is_post_migrated', array( 'LLMS_Blocks_Page_Builders', 'check_for_beaver' ) ) );\n\n\t}",
"public function test_getItemSubCategoryByFilter() {\n\n }",
"public function testItemThenWildcard() {\n \n $cltObj = new ChaperoneContextFilter();\n $cltObj->addItem('foo');\n $this->assertEquals($cltObj->isWildcard(), FALSE);\n $cltObj->addWildcard();\n $this->assertEquals($cltObj->isWildcard(), TRUE);\n $this->assertEquals($cltObj->isEmpty(), FALSE);\n $this->assertEquals($cltObj->getItems(), NULL);\n }",
"public function test_getItemByFilter() {\n\n }",
"public function testMultipleFiltersCanBeApplied() \n {\n $this->app()->getRequest()->setQuery(array('price' => '0-49', 'cat' => '23'));\n $this->mockAndDispatchSearchResults();\n\n $this->assertCount(2, $this->getAppliedFilters()); // We expect 2 applied filters.\n }",
"public function testFilters() {\n $this->object->resetFilters();\n\n // Empty\n $this->assertTrue(count($this->object->getFilters()) == 1);\n\n try {\n $this->object->getFilter('Test');\n $this->assertTrue(false);\n\n } catch (Exception $e) {\n $this->assertTrue(true);\n }\n\n try {\n $this->object->getFilterByTag('example');\n $this->assertTrue(false);\n\n } catch (Exception $e) {\n $this->assertTrue(true);\n }\n\n $this->object->addFilter(new TestFilter());\n\n // Empty, Test\n $this->assertTrue(count($this->object->getFilters()) == 2);\n\n $this->assertInstanceOf('\\Decoda\\Filter', $this->object->getFilter('Test'));\n $this->assertInstanceOf('\\Decoda\\Filter', $this->object->getFilterByTag('example'));\n\n // Test removal\n $this->assertFalse($this->object->hasFilter('Default'));\n\n $this->object->addFilter(new DefaultFilter());\n\n $this->assertTrue($this->object->hasFilter('Default'));\n\n $this->object->removeFilter('Default');\n\n $this->assertFalse($this->object->hasFilter('Default'));\n\n // Empty\n $this->object->resetFilters();\n\n $this->assertTrue(count($this->object->getFilters()) == 1);\n }",
"public function testGetItemBuyerByFilter()\n {\n }",
"public function checkForSubProjectFilters(): void\n {\n $filter_on_labels = false;\n $filters = $this->flattenFilters();\n foreach ($filters as $filter) {\n if ($filter['field'] === 'subprojects') {\n if ($filter['compare'] == 92) {\n $this->excludedSubProjects[] = $filter['value'];\n } elseif ($filter['compare'] == 93) {\n $this->includedSubProjects[] = $filter['value'];\n }\n } elseif ($filter['field'] === 'label') {\n $filter_on_labels = true;\n }\n }\n unset($filters);\n if ($filter_on_labels && $this->project->ShareLabelFilters) {\n $this->shareLabelFilters = true;\n $this->labelIds = get_label_ids_from_filterdata($this->filterdata);\n }\n\n // Include takes precedence over exclude.\n if (!empty($this->includedSubProjects)) {\n $this->numSelectedSubProjects = count($this->includedSubProjects);\n $this->selectedSubProjects = $this->includedSubProjects;\n $this->includeSubProjects = true;\n } elseif (!empty($this->excludedSubProjects)) {\n $this->numSelectedSubProjects = count($this->excludedSubProjects);\n $this->selectedSubProjects = $this->excludedSubProjects;\n $this->excludeSubProjects = true;\n }\n\n if (!$this->childView) {\n // Determine subproject filters to pass to viewTest.php.\n $subproject_test_filters = [];\n $selected_subprojects = [];\n $compare = '';\n if ($this->includeSubProjects) {\n $selected_subprojects = $this->includedSubProjects;\n $compare = '61'; // string is equal\n $combine = 'or';\n } elseif ($this->excludeSubProjects) {\n $selected_subprojects = $this->excludedSubProjects;\n $compare = '62'; // string is not equal\n $combine = 'and';\n }\n if (count($selected_subprojects) > 0) {\n foreach ($selected_subprojects as $i => $subproject) {\n $idx = $i + 1;\n $subproject_test_filters[] = \"field{$idx}=subproject\";\n $subproject_test_filters[] = \"compare{$idx}=$compare\";\n $subproject_test_filters[] = \"value{$idx}=$subproject\";\n }\n $this->subProjectTestFilters = '&';\n $this->subProjectTestFilters .= implode('&', $subproject_test_filters);\n $this->subProjectTestFilters .= \"&filtercount={$this->numSelectedSubProjects}\";\n $this->subProjectTestFilters .= \"&filtercombine=$combine\";\n $this->subProjectTestFilters .= '&showfilters=1';\n }\n }\n }",
"public function testAddFilters()\n {\n $query = new BoolQuery();\n $query->addMust(new TermQuery('field1', 'value1'));\n $query->addFilter(new TermQuery('field2', 'value2'));\n\n $query->addFilters([\n (new TermsQuery())->setField('field3')->setValues(['value3']),\n (new TermsQuery())->setField('field4')->setValues(['value4']),\n ]);\n\n $expectedArray = [\n 'bool' => [\n 'must' => [\n [\n 'term' => ['field1' => 'value1'],\n ],\n ],\n 'filter' => [\n [\n 'term' => ['field2' => 'value2'],\n ],\n [\n 'terms' => [\n 'field3' => ['value3']\n ],\n ],\n [\n 'terms' => [\n 'field4' => ['value4']\n ],\n ]\n ],\n ],\n ];\n\n $this->assertEquals($expectedArray, $query->toArray());\n }",
"public function testGetItemSerialSchemeByFilter()\n {\n }",
"#[@test]\n public function filtered() {\n $this->assertEquals(\n new ArrayList(2, 4), \n create(new ArrayList(1, 2, 3, 4))->filtered(newinstance('util.Filter', array(), '{\n public function accept($v) { return $v % 2 == 0; }\n }'))\n );\n }",
"public function testFilter(): void\n {\n $this->assertCount(2, $this->metadata->getSubjects());\n $this->metadata->filterSubjectNames(['subjectOne']);\n $this->assertCount(1, $this->metadata->getSubjects());\n $this->metadata->filterSubjectNames(['subjectSeventySeven']);\n $this->assertCount(0, $this->metadata->getSubjects());\n }",
"public function testFilter()\n {\n // filter all elements with lastname\n CollectionUtils::filter($this->list, new TestPredicate(\"Albert\"));\n $this->assertEquals(1, $this->list->size());\n }",
"public function testGetFilters() {\n\n $obj = new RendererTwigExtension($this->twigEnvironment);\n $res = $obj->getFilters();\n $this->assertCount(0, $res);\n }",
"public function testFilterLn(): void\n {\n $query = <<<QUERY\n{\n products (\n filter: {\n sku: {\n in:[\"simple1\", \"simple2\"]\n }\n }\n pageSize: 4\n currentPage: 1\n sort: {\n name: DESC\n }\n )\n {\n items {\n sku\n }\n filters {\n name\n filter_items_count\n request_var\n filter_items {\n label\n value_string\n items_count\n ... on SwatchLayerFilterItemInterface {\n swatch_data {\n type\n value\n }\n }\n }\n }\n }\n}\nQUERY;\n $response = $this->graphQlQuery($query);\n\n $this->assertArrayHasKey(\n 'filters',\n $response['products'],\n 'Filters are missing in product query result.'\n );\n\n $expectedFilters = $this->getExpectedFiltersDataSet();\n $actualFilters = $response['products']['filters'];\n // presort expected and actual results as different search engines have different orders\n usort($expectedFilters, [$this, 'compareFilterNames']);\n usort($actualFilters, [$this, 'compareFilterNames']);\n\n $this->assertFilters(\n ['products' => ['filters' => $actualFilters]],\n $expectedFilters,\n 'Returned filters data set does not match the expected value'\n );\n }",
"public function testGetItemSummaryCodeByFilter()\n {\n }",
"public function testfilterFormItemsSession()\n {\n $data = $this->getBranches();\n vd($data);\n }",
"public function testGetInventorySnapshotByFilter()\n {\n }",
"protected function loadItemObjects()\n\t{\n\t\tforeach ($this->getJson()->filters as $json)\n\t\t{\n\t\t\t$item = new \\Yetti\\API\\Item_Filter();\n\t\t\t$item->setJson($json);\n\t\t\t$this->addItem($item);\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display admin notice for incompatible WP version. | function yks_debug_wp_version_notice(): void {
printf(
'<div class="error"><p>%s</p></div>',
sprintf(
/* translators: %1$s is the required WP version, %2$s is the current version */
esc_html__( 'YIKES Debug Matrix requires WordPress version %1$s or above. Your site is using WordPress version %2$s.', 'yikes-debug-matrix' ),
esc_html( YIKES_MATRIX_WP ),
esc_html( $GLOBALS['wp_version'] )
)
);
} | [
"function version_warning()\r\n\t{\r\n\t\techo '<div class=\"updated fade\"><p><strong>'.__('LiveAdmin requires WordPress version 2.7 or later!', 'liveadmin').'</strong></p></div>';\r\n\t}",
"static function notice_min_wp_version() {\n echo '<div class=\"error\"><p>' . sprintf(__('UnderConstruction plugin <b>requires WordPress version 4.6</b> or higher to function properly. You are using WordPress version %s. Please <a href=\"%s\">update it</a>.', 'under-construction-page'), get_bloginfo('version'), admin_url('update-core.php')) . '</p></div>';\n }",
"function styles_wp_version_notice() {\n\t\techo sprintf(\n\t\t\t'<div class=\"error\"><p>%s<a href=\"http://codex.wordpress.org/Upgrading_WordPress\">%s</a></p></div>',\n\t\t\t__( 'Styles requires WordPress 3.4 or newer.', 'styles' ),\n\t\t\t__( 'Please update.', 'styles' )\n\t\t);\n\t}",
"function hop_admin_notices() {\n\tinclude ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version\n\tif ( version_compare( $wp_version, HOP_PREDICTED_OBSOLESENCE_VERSION, '<=' ) )\n\t\treturn;\n\tprintf( '<div class=\"error\"><p>Now you’ve upgraded to WordPress %s, please try deactivating the \"HTTPS oEmbed Providers\" plugin and see if your embedded media still work with <var>https</var> URLs.</p></div>', HOP_PREDICTED_OBSOLESENCE_VERSION );\n}",
"public function upgrade_notice() {\n\t\t\t$message = sprintf( AMELY_THEME_NAME . esc_html__( ' requires at least WordPress version 4.3. You are running version %s. Please upgrade and try again.', 'amely' ), $GLOBALS['wp_version'] );\n\t\t\tprintf( '<div class=\"error\"><p>%s</p></div>', $message );\n\t\t}",
"public static function display_admin_notices() {\n\t\t// Don't display notices as we're upgrading\n\t\t$action = isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : '';\n\t\tif ( $action == 'upgrade-plugin' && ! isset( $_GET['activate'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Show message if Formidable is not compatible\n\t\tif ( ! FrmSigAppHelper::is_formidable_compatible() ) {\n\t\t\tinclude( FrmSigAppHelper::plugin_path() . '/views/update_formidable.php' );\n\t\t}\n\t}",
"public function wp_version_notice() {\n\t\tglobal $wp_version;\n\n\t\tload_plugin_textdomain( 'polylang' ); // Plugin i18n.\n\n\t\tprintf(\n\t\t\t'<div class=\"error\"><p>%s</p></div>',\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: Plugin name 2: Current WordPress version 3: Required WordPress version */\n\t\t\t\tesc_html__( '%1$s has deactivated itself because you are using an old version of WordPress. You are using using WordPress %2$s. %1$s requires at least WordPress %3$s.', 'polylang' ),\n\t\t\t\tesc_html( POLYLANG ),\n\t\t\t\tesc_html( $wp_version ),\n\t\t\t\tesc_html( PLL_MIN_WP_VERSION )\n\t\t\t)\n\t\t);\n\t}",
"public function error_upgrade_wp() {\n\t\techo '<div class=\"error\"><p>' . __( 'Please upgrade WordPress to the latest version to allow WordPress and the News SEO module to work properly.', 'wordpress-seo-news' ) . '</p></div>';\n\t}",
"function version_warning() {\r\n\t\techo '<div class=\"updated fade\"><p><strong>'.__('GTPayment Donations requires WordPress version 2.7 or later!', 'GTPayment-donations').'</strong></p></div>';\r\n\t}",
"function upgrade_notice() {\n\t$message = sprintf( __( 'PD Theme requires at least WordPress version 4.9.3. You are running version %s. Please upgrade and try again.', 'pd-theme' ), $GLOBALS['wp_version'] );\n\tprintf( '<div class=\"error\"><p>%s</p></div>', $message );\n}",
"public function show_notice_for_old_version() {\n\t\techo '<div class=\"error\"><p>' . sprintf( wp_kses( __( 'This version of <strong>WP Hotelier Multilingual</strong> requires at least <strong>WP Hotelier 2.0.0</strong> to work correctly. Please <a href=\"%s\">update WP Hotelier</a> before to continue. An old version of WP Hotelier may cause some issues.', 'wp-hotelier-wpml' ), array( 'strong' => array(), 'a' => array( 'href' => array() ) ) ), admin_url( 'plugins.php?plugin_status=upgrade' ) ) . '</p></div>';\n\t}",
"public static function admin_notices() {\n\t\t\tif ( !get_option( 'permalink_structure' ) ) {\n\t\t\t\t?>\n\t\t\t\t<div class=\"error\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t_e( 'WP AppKit requires WordPress permalinks to be activated: '\n\t\t\t\t\t\t\t\t. 'see the <a href=\"http://codex.wordpress.org/Using_Permalinks#Choosing_your_permalink_structure\">\"Using permalink\" Codex section</a> '\n\t\t\t\t\t\t\t\t. 'for more info about how to activate permalinks.',\n\t\t\t\t\t\t\t\tWpAppKit::i18n_domain\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}",
"function WarningIfPluginNotCompatible() {\r\n\t\tglobal $wp_version;\r\n\t\tif( is_admin() && ($this->g_info['MinWP'] != '' ) ) {\r\n\t\t\t\tif ( ! version_compare($wp_version, $this->g_info['MinWP'], '>=' ) ) {\r\n\t\t\t\t\tadd_action('admin_notices', array(&$this, 'add_action_admin_notices_DisplayWarningThatPluginNotCompatible'));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t}",
"public static function admin_warnings() {\n if ( !self::is_gravityforms_installed() ) {\n $message = __('requires Gravity Forms to be installed.', self::$slug);\n } else if ( !self::is_gravityforms_supported() ) {\n $message = __('requires a minimum Gravity Forms version of ', self::$slug) . self::$min_gravityforms_version;\n }\n\n if (empty($message)) {\n return;\n }\n ?>\n <div class=\"error\">\n <p>\n <?php _e('The plugin ', self::$slug); ?><strong><?php echo self::$name; ?></strong> <?php echo $message; ?><br />\n <?php _e('Please ',self::$slug); ?><a href=\"http://bit.ly/getgravityforms\"><?php _e(' download the latest version ',self::$slug); ?></a><?php _e(' of Gravity Forms and try again.',self::$slug) ?>\n </p>\n </div>\n <?php\n }",
"function LCWarn(){\n\t\t\tglobal $wp_version;\n\t\t\techo \"<div id='version-warning' class='updated fade-ff0000'><p><strong>\".__('LogoCandy is tested with WordPress v2.7 and up. You are currently using WordPress ', 'regplus').$wp_version.\"</strong></p></div>\";\n\t\t}",
"public function wpapp_upgrades_admin_notice() {\n\n\t\t// Only show messages to admins.\n\t\tif ( ! wpcd_is_admin() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $this->wpapp_upgrade_must_run_check() > 0 ) {\n\t\t\t$class = 'notice notice-error';\n\t\t\t$message = __( '<b>WPCD: Required upgrades are needed on some or all of your servers.</b> Please click on the UPGRADE tab in each of your servers in your server list. If you see an upgrade button or notice please click it to start the upgrade for that server.', 'wpcd' );\n\t\t\t$message .= '<br />';\n\t\t\t$message .= __( 'Please do not attempt to perform any actions on your servers until you have completed all upgrades and this message disappears.', 'wpcd' );\n\t\t\t$message .= '<br />';\n\t\t\t$message .= __( 'For more information or additional help please contact our technical support team using our contact form or by opening up a support ticket in our support portal.', 'wpcd' );\n\t\t\t$message .= '<br />';\n\t\t\t$message .= __( 'Note that it is possible that multiple upgrades need to be run sequentially. So this messsage might still appear even though you might have completed some upgrades.', 'wpcd' );\n\n\t\t\tprintf( '<div class=\"%1$s\"><p>%2$s</p></div>', $class, $message );\n\t\t}\n\n\t}",
"function child_themer_dynamik_incompatible_admin_notice() {\n\t\n ?>\n <div class=\"notice notice-error\" style=\"clear:both;\">\n <p><?php _e( 'Dynamik Website Builder is not compatible with the Child Themer Plugin. To use Child Themer you must activate a different Genesis Child Theme.', 'child-themer' ); ?></p>\n </div>\n <?php\n \n}",
"function lockdown_wp_fail_wp_version() {\n\t/* translators: %s: WordPress version */\n\t$message = sprintf( esc_html__( 'Lockdown WP requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT ACTIVE.', 'lockdown-wp' ), '4.6' );\n\t$html_message = sprintf( '<div class=\"error\">%s</div>', wpautop( $message ) );\n\techo wp_kses_post( $html_message );\n}",
"function tcsn_wp_upgrade_notice() {\n\t$message = sprintf( __( 'Theme requires at least WordPress version 3.6. You have version %s. Please upgrade and try again.', 'tcsn_theme' ), $GLOBALS['wp_version'] );\n\tprintf( '<div class=\"error\"><p>%s</p></div>', $message );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Autoloader class instance with initialized to autoload. | function autoloader()
{
return Autoloader::instance()->initialize(new Autoload());
} | [
"private function getAutoloader()\n\t{\n\t\tif ($this->autoloader === null) {\n\t\t\t$this->autoloader = new Autoloader;\n\t\t}\n\n\t\treturn $this->autoloader;\n\t}",
"public static function getLoader()\n {\n if (!self::$autoLoader) {\n self::$autoLoader = include __DIR__ . \"/../vendor/autoload.php\";\n }\n\n return self::$autoLoader;\n }",
"public static function getInstance()\n {\n static $class;\n if ($class == null) {\n $class = new Bridge_Loader();\n }\n\n return $class;\n }",
"public function getResourceLoader()\r\n {\r\n if (null === $this->_resourceLoader) {\r\n $r = new ReflectionClass($this);\r\n $path = $r->getFileName();\r\n $this->setResourceLoader(new Oxy_Application_Module_Autoloader(array(\r\n 'namespace' => $this->getDomainName() . '_' . $this->getModuleName(),\r\n 'basePath' => dirname($path)\r\n )));\r\n }\r\n return $this->_resourceLoader;\r\n }",
"public static function getClassLoader()\n {\n if (static::$loader === null) {\n\n spl_autoload_register(array('NamespaceClassLoader', 'loadClassLoader'), true, true);\n static::$loader = $loader = new \\Composer\\Autoload\\ClassLoader();\n spl_autoload_unregister(array('NamespaceClassLoader', 'loadClassLoader'));\n static::$loader->register();\n }\n\n return static::$loader;\n }",
"protected function _initAutoLoader(){\n\t\trequire_once 'Doctrine.php';\n\t\tspl_autoload_register(array('Doctrine', 'autoload'));\n\t\t$autoLoader = $this->getApplication()->getAutoLoader();\n\t\t$this->bootstrap('configs');\n\t\t$this->registerPluginResource('autoloader', $autoLoader);\n\t\treturn $autoLoader;\n\t}",
"static function getAutoload() {\n\t\treturn systemAutoload::getInstance();\n\t}",
"public function getDefaultAutoloader() {\n\t\treturn $this->_defaultAutoloader;\n\t}",
"public static function singleton() {\n if (!self::$instance) {\n self::$instance = new Jm_Autoloader();\n }\n return self::$instance;\n }",
"public function getDefaultAutoloader()\r\r\n {\r\r\n return $this->_defaultAutoloader;\r\r\n }",
"protected static function getLoader()/*# : LoaderInterface */\n {\n return self::$loaders[get_called_class()];\n }",
"public static function loader()\r\n {\r\n if(is_null(self::$instance))\r\n self::$instance = new self();\r\n return self::$instance;\r\n }",
"private function setAutoLoader() {\n \n spl_autoload_register(array('self', 'autoLoader'));\n \n }",
"public static function useAutoloader()\n {\n spl_autoload_register(__NAMESPACE__ . '\\Autoloader::autoload');\n }",
"public static function get_instance()\n {\n if (self::$instance === false) {\n self::$instance = new AcfLoader;\n }\n\n return self::$instance;\n }",
"public static function register_autoloader()\n {\n }",
"public function getLoader()\n\t{\n\t if (!$this->loader) {\n\t $this->loader = new ServiceLoader();\n\t }\n\n\t\treturn $this->loader;\n\t}",
"protected function _initAutoload()\n {\n $autoloader = new Zend_Application_Module_Autoloader(array(\n 'namespace' => 'Default',\n 'basePath' => dirname(__FILE__),\n ));\n \n $autoloader->addResourceType('dao', 'models/Daos/', 'Dao')\n \t->addResourceType('dto', 'models/Dtos/', 'Dto')\n \t->addResourceType('helper', 'helpers/', 'Helper');\n \n return $autoloader;\n }",
"public function _initAutoloader()\n\t{\n\t\t$autoloader = new Zend_Loader_Autoloader_Resource(array(\n 'basePath' => APPLICATION_PATH,\n 'namespace' => 'My'\n ));\n\n // Add some resources types\n $autoloader->addResourceTypes(array(\n 'models' => array(\n 'path' => 'models',\n 'namespace' => '' \n ),\n ));\n\n // Return to bootstrap resource registry\n return $autoloader;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a new hasChangeSensitivity Whether change threshold can be specified for updates. Default is true. | public function setHasChangeSensitivity($hasChangeSensitivity)
{
$this->hasChangeSensitivity = $hasChangeSensitivity;
return $this;
} | [
"public function getHasChangeSensitivity()\n {\n return $this->hasChangeSensitivity;\n }",
"public function setSensitivity($sensitivity)\n {\n $this->sensitivity = $sensitivity;\n return $this;\n }",
"public function setSensitivity($val)\n {\n $this->_propDict[\"sensitivity\"] = intval($val);\n return $this;\n }",
"public function addVoteWeight($change)\n {\n if (!config('vote.allow_weight_changes')) {\n return false;\n }\n\n $weight = max(0, $this->weight + $change); // set a minimum of zero\n $this->update(['weight' => $weight]);\n event(new VoterWeightChanged($this));\n return true;\n }",
"public function setChangeValueTest(bool $changeValueTest);",
"public function setVolatility($volatility)\n {\n $this->volatility = $volatility;\n }",
"public function setTrue()\n\t{\n\t\t$trace = debug_backtrace();\n\n\t\t$this->qualityControl();\n\n\t\t$call = sprintf(\"%s->%s called at %s in %s\",\n\t\t\t$trace[1]['class'],\n\t\t\t$trace[1]['function'], \n\t\t\t$trace[1]['line'], \n\t\t\t$trace[1]['file']\n\t\t);\n\t\t$this->add(\n\t\t\tarray('call' => $call, 'value' => TRUE)\n\t\t);\n\t}",
"protected function optionsAffectPrice() {\n $options = $this->getItem()->getProduct()->getOptions();\n\n foreach ($options as $option) {\n if ($option->hasPrice() && ((float) $option->getPrice() > 0)) {\n return true;\n }\n }\n\n return false;\n }",
"public function getSensitivity()\n\t{\n\t\treturn $this->iSensitivity;\n\t}",
"public function setApplicableTo(?SensitivityLabelTarget $value): void {\n $this->getBackingStore()->set('applicableTo', $value);\n }",
"public function setMaxPriceThreshold($value);",
"public function photoSensitivity($photoSensitivity)\n {\n $this->value->setSimpleNamedValue('photosensitivity', $photoSensitivity);\n\n return $this;\n }",
"public function setIsServicingAttribute($value)\n {\n $this->isServicing = $value;\n }",
"public function getPriceIncludesTaxAttribute()\n\t{\n\t\treturn $this->tax_rate > 0;\n\t}",
"public function setMicrosoftUpdateServiceAllowed(?bool $value): void {\n $this->getBackingStore()->set('microsoftUpdateServiceAllowed', $value);\n }",
"public function setIsMajorChange(?bool $value): void {\n $this->getBackingStore()->set('isMajorChange', $value);\n }",
"public function setDowngradeSensitivityRequiresJustification(?bool $value): void {\n $this->getBackingStore()->set('downgradeSensitivityRequiresJustification', $value);\n }",
"public function setPriceIncludesTax(?bool $value): void {\n $this->getBackingStore()->set('priceIncludesTax', $value);\n }",
"public function setSpoofConfidence($var)\n {\n @trigger_error('spoof_confidence is deprecated.', E_USER_DEPRECATED);\n GPBUtil::checkFloat($var);\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
End time in which this feed item is no longer effective and will stop serving. The time is in the customer's time zone. The format is "YYYYMMDD HH:MM:SS". Examples: "20180305 09:15:00" or "20180201 14:34:30" Generated from protobuf field optional string end_date_time = 27; | public function getEndDateTime()
{
return isset($this->end_date_time) ? $this->end_date_time : '';
} | [
"function end_time($end_time=null)\n {\n if (isset($end_time)) $this->end_time = $end_time;\n return $this->end_time;\n }",
"public function getEndTime()\n {\n $time = $this->eventdatetime->endtime;\n\n if (empty($time)) {\n return $time;\n }\n\n if ($this->eventdatetime->isRecurring() &&\n isset($this->recurringdate) &&\n $this->recurringdate instanceof \\UNL\\UCBCN\\Event\\RecurringDate\n ) {\n $diff = strtotime($this->eventdatetime->endtime) - strtotime($this->eventdatetime->starttime);\n\n $time = date('Y-m-d H:i:s', strtotime($this->getStartTime()) + $diff);\n }\n\n return $time;\n }",
"public function getEndDateTime()\n {\n return $this->readOneof(17);\n }",
"public function getEndDateTime()\n {\n return $this->readOneof(5);\n }",
"private function endtime(){\n\t\t// [REST] Update appointment end_time\n\t\t$update = $this->postPhysician('appointment', array(\n\t\t\t'id' => $this->input->post('id'),\n\t\t\t'end_time' => $this->input->post('end_time'),\n\t\t));\n\t\t\n\t\t// Alert results to front-end\n\t\tif($update['status']=='TRUE'){\n\t\t\t$this->notify(1, 'Appointment end time was set.');\n\t\t}else{\n\t\t\t$this->notify(0, $update['message']);\n\t\t}\n\t}",
"function getEndDateTimeRaw() {\n\t\t$strTime=\"00:00:00\";\n\t\tif ($this->_mainProduct!=null && $this->endTimeslot>0 && array_key_exists($this->endTimeslot, $this->_mainProduct->_timeslotsObj->list)) \n\t\t\t$strTime=$this->_mainProduct->_timeslotsObj->list[$this->endTimeslot]->endTime;\n\t\t\t\n\t\t//what is this fucking confition for ??\n\t\tif ($this->_mainProduct==null && $this->endDate==$this->startDate) return strtotime(\"+1 day\",strtotime($this->endDate.' '.$strTime));\n\t\telse return strtotime($this->endDate.' '.$strTime);\n\t}",
"public function getEndTime()\r\n {\r\n return $this->end_time;\r\n }",
"public function getEndTime()\n {\n return $this->end_time;\n }",
"public function getEndTimeAttribute(): string\n {\n // Check if startTime has value\n if ($this->delivery_time) {\n // Delivery target in hours\n $target = $this->transporter->target;\n \n // Get target time\n $endTime = Carbon::parse($this->delivery_time)->addHours($target);\n // return time in correct format\n return $endTime->format('H:i');\n }\n // Return empty string if failed to make an end time\n return '';\n }",
"function set_end_time($end_time) {\n $this->end_time = $end_time;\n }",
"public function getProposedEndDateTime()\n {\n return $this->readOneof(19);\n }",
"public function setUsageEndDateTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Type\\DateTime::class);\n $this->usage_end_date_time = $var;\n\n return $this;\n }",
"public function get_finish_time() {\n return $this->end_date_time;\n }",
"public function getEndDate_Str() {\n\t\tif( !isset( $this->end_date ) ) return null;\n\t\telse return $this->end_date->format( self::$datetimeformat );\n\t}",
"public function end_date() {\n\t\treturn $this->data['end_date'];\n\t}",
"public function getEndDate()\n {\n return isset($this->end_date) ? $this->end_date : '';\n }",
"public function getEventEndTime()\n {\n if (array_key_exists(\"eventEndTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"eventEndTime\"], \"\\Microsoft\\Graph\\Model\\DateTimeTimeZone\") || is_null($this->_propDict[\"eventEndTime\"])) {\n return $this->_propDict[\"eventEndTime\"];\n } else {\n $this->_propDict[\"eventEndTime\"] = new DateTimeTimeZone($this->_propDict[\"eventEndTime\"]);\n return $this->_propDict[\"eventEndTime\"];\n }\n }\n return null;\n }",
"public function getEndDate()\n\t{\n\t\t$end_at = $this->getValue('end_at');\n\n\t\treturn $end_at && isset($end_at) ? strtotime($end_at) : null;\n\t}",
"public function getEnd_date()\n {\n return isset($this->end_date) ? $this->end_date : null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Testing of ResponseParser interceptor | public function testResponseParserOnPreParse()
{
$client = new Client('http://localhost');
$client->setTransport(new Transport());
$client->setIdGenerator(new IdGenerator());
$client->getResponseParser()->onPreParse()
->add(Interceptor::createWith(function (ParserContainer $container) {
$response = $container->getValue();
$result = $response['result'];
$userMap = ['id', 'email', 'name'];
// result is user map
if (is_array($result) && 0 === count(array_diff($userMap, array_keys($result)))) {
$response['result'] = new User($result['id'], $result['email'], $result['name']);
}
return new ParserContainer($container->getParser(), $response);
}));
$user = $client->call('User.getOne', [8]);
/** @var User $user */
$this->assertInstanceOf(User::class, $user);
$this->assertEquals(8, $user->id);
$this->assertEquals('vader@angry.mil', $user->email);
$this->assertEquals('vader', $user->name);
} | [
"public function test_parseresponse_returns_response_object_on_valid_response(): void\n {\n $tag = TagFactory::createTag('LSUB \"\" \"*\"');\n $actual = ResponseFactory::parseResponse($tag->getPrefix(), sprintf(\"%s OK Lsub completed (0.001 + 0.000 + 0.001 secs).\", $tag->getPrefix()));\n\n $this->assertInstanceOf(Response::class, $actual);\n }",
"public function testProcessResponseHeader()\n {\n // init\n $oHttpClient = new \\HTTPClient();\n\n // the test\n $result = $this->invokeMethod(\n $oHttpClient,\n 'processResponseHeader',\n [\"HTTP/1.1 200 OK\\nServer: nginx/1.10.3\\nContent-Type: text/html\"]\n );\n\n // asserts\n $this->assertInternalType(IsType::TYPE_ARRAY, $result);\n $this->assertEquals('HTTP/1.1 200 OK', $result[0]);\n $this->assertArrayHasKey('Server', $result);\n $this->assertEquals('nginx/1.10.3', $result['Server']);\n $this->assertArrayHasKey('Content-Type', $result);\n $this->assertEquals('text/html', $result['Content-Type']);\n }",
"public function testResponseReturnedWithoutMiddlewares()\n {\n $response = $this->getMockBuilder(ResponseInterface::class)\n ->getMock();\n $stack = $this->getMockBuilder(MiddlewareStackInterface::class)\n ->getMock();\n $stack->expects($this->once())\n ->method('next')\n ->willReturn(null);\n $request = $this->getMockBuilder(ServerRequestInterface::class)\n ->getMock();\n $handler = new RequestHandler($response, $stack);\n $actual = $handler->handle($request);\n $this->assertEquals($response, $actual);\n }",
"public function testResponseModification() {\n\t\tMedia::type('my', 'text/x-my', ['view' => 'lithium\\tests\\mocks\\net\\http\\Template']);\n\t\t$response = new Response();\n\n\t\tMedia::render($response, null, ['type' => 'my']);\n\t\t$this->assertEqual('Value', $response->headers('Custom'));\n\t}",
"public function testParseResponse()\n {\n $stringResponse = '{\"ok\":true}';\n $mockAbstractResponsePayload = new MockPayloadResponse();\n $payloadResponseObject = MockPayloadResponse::createFromJson($stringResponse);\n $this->assertInstanceOf(MockPayloadResponse::class, $payloadResponseObject);\n $this->assertTrue($payloadResponseObject->getOk());\n }",
"public function testOutputForValidRequest()\n {\n $response = new Response();\n $response->setContent('Hello world!');\n\n ob_start();\n $response->output();\n $responseOutput = ob_get_contents();\n ob_end_clean();\n\n self::assertSame(['HTTP/1.1 200 OK'], FakeHeaders::get());\n self::assertSame('Hello world!', $responseOutput);\n }",
"public function testDebuggingResponses()\n {\n $respone = $this->get('/');\n\n// $respone->dumpHeaders();\n\n// $respone->dump();\n\n $this->assertTrue(true);\n }",
"public function testGetResponse() {\n\t\t$this->assertInstanceOf('lib\\\\core\\\\Response', \n\t\t\t\t$this->object->getResponse());\n\t}",
"public function getResponseParser(): ResponseParser\n {\n return new ResponseParser();\n }",
"public function mockResponse()\n {\n $this->restoreInstance = Response::getInstance();\n\n $mockResponse = $this->getMockBuilder('PhpMyAdmin\\Response')\n ->disableOriginalConstructor()\n ->setMethods(array(\n 'header', 'headersSent', 'disable', 'isAjax',\n 'setRequestStatus', 'addJSON', 'addHTML',\n 'getFooter', 'getHeader','httpResponseCode',\n ))\n ->getMock();\n\n $mockResponse->expects($this->any())\n ->method('headersSent')\n ->with()\n ->will($this->returnValue(false));\n\n $param = func_get_args();\n\n if (count($param) > 0) {\n if (is_array($param[0])) {\n if (is_array($param[0][0]) && count($param) == 1) {\n $param = $param[0];\n if(is_int(end($param))){\n $http_response_code_param = end($param);\n $param = array_slice($param, 0, -1);\n\n $header_method = $mockResponse->expects($this->once())\n ->method('httpResponseCode')->with($http_response_code_param);\n }\n }\n\n $header_method = $mockResponse->expects($this->exactly(count($param)))\n ->method('header');\n\n call_user_func_array(array($header_method, 'withConsecutive'), $param);\n\n } else {\n $mockResponse->expects($this->once())\n ->method('header')\n ->with($param[0]);\n }\n }\n\n $this->attrInstance = new ReflectionProperty('PhpMyAdmin\\Response', '_instance');\n $this->attrInstance->setAccessible(true);\n $this->attrInstance->setValue($mockResponse);\n\n return $mockResponse;\n }",
"public function process_response($request, $response);",
"public function testRenderResponse()\n {\n $this->proxy = $this->getMockBuilder('Mremi\\TemplatingExtraBundle\\Templating\\TemplatingProxy')\n ->setConstructorArgs(array($this->templating, $this->templateNameParser, $this->templateLocator, $this->stopwatch, $this->dataCollector))\n ->setMethods(array('startProfiling', 'stopProfiling'))\n ->getMock();\n\n $this->proxy\n ->expects($this->once())\n ->method('startProfiling')\n ->with($this->equalTo('DummyBundle:Controller:view.html.twig'), $this->equalTo(array('param1' => 'value1')))\n ->will($this->returnValue($this->event));\n\n $response = new Response('Test');\n\n $this->templating\n ->expects($this->once())\n ->method('renderResponse')\n ->with($this->equalTo('DummyBundle:Controller:view.html.twig'), $this->equalTo(array('param1' => 'value1')), $this->equalTo($response))\n ->will($this->returnValue($response));\n\n $this->proxy\n ->expects($this->once())\n ->method('stopProfiling')\n ->with($this->equalTo($this->event));\n\n $rendered = $this->proxy->renderResponse('DummyBundle:Controller:view.html.twig', array('param1' => 'value1'), $response);\n\n $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $rendered);\n $this->assertEquals($response->getContent(), $rendered->getContent());\n }",
"public function testResponse(): void\n {\n $response = new Response(['id' => '1'], 200, ['key' => 'value'], 'content');\n\n self::assertSame('content', $response->getContent());\n self::assertSame(200, $response->getStatusCode());\n self::assertTrue($response->isSuccessful());\n self::assertSame(['key' => 'value'], $response->getHeaders());\n self::assertSame('value', $response->getHeader('key'));\n }",
"public function testGetResponse()\n {\n $this->assertInstanceOf(ResponseInterface::class, $this->container['response']);\n }",
"public function testRequestDecodesValidResponseCorrectly()\n {\n $mockClient = new HttpMockClient;\n $mockClient->toReturn = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?><OAI-PMH xmlns=\"http://www.openarchives.org/OAI/2.0/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd\"><responseDate>2012-08-06T19:25:47Z</responseDate><request verb=\"Identify\">http://nsdl.org/oai</request><Identify><repositoryName>National Science Digital Library</repositoryName><baseURL>http://nsdl.org/oai</baseURL><protocolVersion>2.0</protocolVersion><adminEmail>jweather@ucar.edu</adminEmail><earliestDatestamp>1900-01-01T12:00:00Z</earliestDatestamp><deletedRecord>no</deletedRecord><granularity>YYYY-MM-DDThh:mm:ssZ</granularity> <compression>gzip</compression><description><oai-identifier xmlns=\"http://www.openarchives.org/OAI/2.0/oai-identifier\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/oai-identifier http://www.openarchives.org/OAI/2.0/oai-identifier.xsd\"> <scheme>oai</scheme> <repositoryIdentifier>nsdl.org</repositoryIdentifier> <delimiter>:</delimiter> <sampleIdentifier>oai:nsdl.org:1477460</sampleIdentifier></oai-identifier></description><description> <oai_dc:dc xmlns:oai_dc=\"http://www.openarchives.org/OAI/2.0/oai_dc/\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd\"> <dc:description>The National Science Digital Library (NSDL) is a national network of digital environments dedicated to advancing science, technology, engineering, and mathematics (STEM) teaching and learning for all learners, in both formal and informal settings.</dc:description> </oai_dc:dc></description></Identify></OAI-PMH>';\n $obj = new Client('http://nsdl.org/oai', $mockClient);\n $result = $obj->request('Identify');\n\n //Check correct object type and result\n $this->assertInstanceOf('SimpleXMLElement', $result);\n $this->assertTrue(isset($result->Identify));\n }",
"public function test_can_create_psr7_response(): void {\n\n\t\t$response = HTTP_Helper::response( array( 'key' => 'test_VALUE' ), 500 );\n\n\t\t$body = json_decode( (string) $response->getBody(), true );\n\n\t\t$this->assertInstanceOf( ResponseInterface::class, $response );\n\t\t$this->assertIsArray( $body );\n\t\t$this->assertArrayHasKey( 'key', $body );\n\t\t$this->assertEquals( 'test_VALUE', $body['key'] );\n\t\t$this->assertEquals( 500, $response->getStatusCode() );\n\t}",
"public function testHandlingWithMiddleware()\n {\n $kernel = $this->getKernel(RequestMethods::GET, false);\n $kernel->addMiddleware(HeaderSetter::class);\n $request = Request::createFromGlobals();\n $response = $kernel->handle($request);\n $this->assertEquals(\"bar\", $response->getHeaders()->get(\"foo\"));\n }",
"public function testHandleAuthResponseSuccess()\n {\n }",
"public function parseResponse()\n {\n $this->separateHeadersAndBody();\n\n $this->parseRawHeader();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cURL callback method, outputs data as soon as any is received | private function curl_callback($curl_handle, $data) {
echo $data;
flush();
return strlen($data);
} | [
"function callback()\n\t{\n\t\tif($_SERVER['REQUEST_METHOD'] == \"GET\")\n {\n\t\t\t\t$challenge = $_SERVER['QUERY_STRING'];\n\t\t\t\t$get_array = explode(\"&\", $challenge);\n\t\t\t\tfor($i=0;$i<count($get_array);$i++)\n\t\t\t\t{\n\t\t\t\t\t$check = $get_array[$i];\n\t\t\t\t\tif(strstr($check,\"hub.challenge\"))\n\t\t\t\t\t{\n\t\t\t\t\t\t$hub_array=explode(\"=\", $check);\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hub = $hub_array[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t if($hub)\n\t\t\t\t{\n\t\t\t\t\techo $hub;\n\t\t\t\t}\n\n\t\t}\n\t\tif($_SERVER['REQUEST_METHOD'] == \"POST\")\n\t\t{\n\t\t\t\n\t\t\t$data = json_decode(file_get_contents('php://input'));\t\t\n\t\n\t\t\tforeach($data as $obj)\n\t\t\t{\n\t\t\t\t$object_id = $obj->object_id;\n\t\t\t\t$time = $obj->time;\n\t\t\t\t\n\t\t\t\t$payload = array(\n\t\t\t\t\t'time' => $time,\n\t\t\t\t\t'object_id' => $object_id\n\t\t\t\t);\n\t\t\t\t//now send $payload somewhere else for processing...\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t}",
"private function single_curl() {\n $ch = curl_init();\n $request = array_shift($this->requests);\n //获取选项及header\n $options = $this->get_options($request);\n curl_setopt_array($ch, $options);\n $output = curl_exec($ch);\n $info = curl_getinfo($ch);\n //处理错误\n if (curl_error($ch))\n $info['error'] = curl_error($ch);\n\n // it's not neccesary to set a callback for one-off requests\n// if ($request->callback) {\n// $callback = $request->callback;\n// if (is_callable($callback)) {\n// call_user_func($callback, $output, $info, $request);\n// }\n// }\n// else\n// return $output;\n $this->callback($output, $info, $request);\n return $this->the_fails;\n }",
"private function fetch_data() {\n $url = $this->url;\n\t\t$ua = $this->ua;\n\t\t// Options for curl set in array\n\t\t$options = array(\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_URL => $url,\n CURLOPT_USERAGENT => $ua,\n CURLOPT_AUTOREFERER => true,\n CURLOPT_VERBOSE => 1\n );\n\t\t\n\t\t$ch = curl_init(); // curl init\n\t\tcurl_setopt_array($ch, $options);\n\t\t\n\t\t$content = curl_exec($ch); \n\t $err = curl_errno($ch); \n\t $errmsg = curl_error($ch) ; \n\t $header = curl_getinfo($ch); \n\t \n\t curl_close($ch); // close\n\n $data = array(\n\t\t\t'html' => $content,\n\t\t\t'header' => $header,\n 'error' => array(\n 'err' => $err,\n 'msg' => $errmsg\n )\n\t\t);\n\n // if curl error from $data['error']['err'];\n if ( $data['error']['err'] != '0' ) {\n // change success to false\n $this->success = false;\n } \n \n $this->fetchResult = $data;\n return;\n }",
"abstract public function getCallbackResponse();",
"public function executeCurl()\n {\n $this->response = curl_exec($this->ch);\n }",
"protected function tvp_response(){\n header(\"Content-type:application/json\");\n $callback = $this->requestParams['callback'];\n $data = json_encode($this->json);\n if ( strlen($callback) ) {\n $data = $callback.'('.$data.')';\n }\n echo $data;\n }",
"function send_data_by_curl($jsondata){\n\n var_dump($jsondata);\n die();\n $last='data='.$jsondata;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,\"http://34.251.204.49/custom\");\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS,$last);\n //$server_output = curl_exec ($ch); // if there is output\n curl_exec ($ch);\n curl_close ($ch);\n }",
"function open_data_protocol_request_callback() {\n\t$url = $_GET['url'];\n\n\theader( 'Content-type: application/json' );\n\n\t$html = file_get_contents_curl($url);\n\n\t$doc = new DOMDocument();\n\t@$doc->loadHTML($html);\n\n\t$metas = $doc->getElementsByTagName('meta');\n\n\t$title = \"\";\n\t$imageurl = \"\";\n\t$desc = \"\";\n\t$width = 0;\n\t$height = 0;\n\t$embedurl = '';\n\n\tfor ($i = 0; $i < $metas->length; $i++)\n\t{\n\t\t$meta = $metas->item($i);\n\t\tif($meta->getAttribute('property') == 'og:title')\n\t\t\t$title = $meta->getAttribute('content');\n\t\tif($meta->getAttribute('property') == 'og:image')\n\t\t\t$imageurl = $meta->getAttribute('content');\n\t\tif($meta->getAttribute('property') == 'og:description')\n\t\t\t$desc = $meta->getAttribute('content');\n\t\tif($meta->getAttribute('property') == 'og:video:width')\n\t\t\t$width = intval( $meta->getAttribute('content') );\n\t\tif($meta->getAttribute('property') == 'og:video:height')\n\t\t\t$height = intval( $meta->getAttribute('content') );\n\t\tif($meta->getAttribute('name') == 'twitter:player')\n\t\t\t$embedurl = $meta->getAttribute('content');\n\t}\n\n\techo sprintf('{\"title\": %s, \"desc\": %s, \"imageurl\": %s, \"width\": %d, \"height\": %d, \"embedurl\": %s}',\n\t\t\t\tjson_encode($title), json_encode($desc), json_encode($imageurl), $width, $height, json_encode($embedurl));\n\n\tdie();\n}",
"public function call() {\n // build request\n $this->buildRequest();\n // execute request\n $this->response = curl_exec($this->call_resource);\n // close handle\n curl_close($this->call_resource);\n // json decode response\n $this->response = json_decode($this->response);\n }",
"private function single_curl() {\n $ch = curl_init();\t\t\n $request = array_shift($this->requests);\n $options = $this->get_options($request);\n curl_setopt_array($ch,$options);\n $output = curl_exec($ch);\n $info = curl_getinfo($ch);\n \n // it's not neccesary to set a callback for one-off requests\n if ($this->callback) {\n $callback = $this->callback;\n if (is_callable($this->callback)){\n call_user_func($callback, $output, $info, $request);\n }\n }\n\t\telse\n return $output;\n\treturn true;\n }",
"public function curlExecute() {\n\t\t\t$this -> makeOptionArray() ;\n\t\t\t$ch = curl_init() ;\n\t\t\tcurl_setopt_array($ch, $this -> curlOption) ;\n\t\t\t$response = curl_exec($ch) ; \n\t\t\t$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE) ;\n\t\t\t$body = substr($response, curl_getinfo($ch, CURLINFO_HEADER_SIZE) ) ;\n\t\t\tcurl_close($ch) ;\n\t\t\tif($httpCode == 200) {\n\t\t\t\treturn $body;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn json_encode(Array(\"notOK\" => True) ) ;\n\t\t\t}\n\t\t}",
"public function process_req($url, $param_array, $callback) {\n if (!is_array($param_array) or count($param_array) == 0) {\n return false;\n }\n\n $param_hash = array();\n foreach($param_array as $k => $v) {\n $nurl = preg_replace('~([^:\\/\\.]+)~ei', \"rawurlencode('\\\\1')\", $url);\n $curl = curl_init($nurl);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_HEADER, 0);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); // seconds\n curl_setopt($curl, CURLOPT_TIMEOUT, 15); // each curl handler takes up to 15 seconds\n\n $data = array('product_url' => $v['url']);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n curl_multi_add_handle($this->handle, $curl);\n\n print \"curl resource id is: \" . intval($curl) . \"\\n\";\n // add this row keyed off to curl resource id, so when response comes back, we can identify\n // it belongs to which request and thus pass corresponding param to the callback function\n $param_hash[intval($curl)] = $v;\n }\n\n // I believe the first do while loop is sending out ALL http request\n $active = null;\n do {\n $mrc = curl_multi_exec($this->handle, $active);\n } while ($mrc == CURLM_CALL_MULTI_PERFORM);\n\n // This loop is checking is there response back; i.e., if active > 0 and mrc=CURLM_OK\n while ($active && $mrc == CURLM_OK) {\n if (curl_multi_select($this->handle) != -1) {\n do {\n // I believe this execution does NOT send out http request,\n // but just check / modify active and mrc value\n $mrc = curl_multi_exec($this->handle, $active);\n print \"in while, mrc:$mrc, active:$active, curlm_ok:\" . CURLM_OK . \"\\n\";\n\n // getting the incoming response and process it with callback\n if ($state = curl_multi_info_read($this->handle))\n {\n //print \"in if\\n\";\n print \"handle state is: \" . intval($state[\"handle\"]) . \"\\n\";\n if (curl_error($state['handle']) == \"\") {\n $callback(curl_multi_getcontent($state['handle']), $param_hash[intval($state['handle'])]);\n }\n curl_multi_remove_handle($this->handle, $state['handle']);\n curl_close($state['handle']);\n }\n\n } while ($mrc == CURLM_CALL_MULTI_PERFORM);\n }\n }\n }",
"public function onCurlWrite(Event $event)\n {\n // Stream the response body to the log if the body is not repeatable\n $request = $event['request'];\n if ($request->getParams()->get('response_wire')) {\n $request->getParams()->get('response_wire')->write($event['write']);\n }\n }",
"protected function execute()\n\t{\n\t\t$ch = curl_init();\n\t\t$url = $this->getURL();\n\n\t\tcurl_setopt( $ch, CURLOPT_URL, $url );\n\t\tcurl_setopt( $ch, CURLOPT_HEADER, FALSE );\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, TRUE );\n\t\t$this->setContent( curl_exec( $ch ) );\n\t\tcurl_close( $ch );\n\t}",
"public function exec()\n {\n $ch = $this->prepareCurlResourse();\n $data = $this->getResponse($ch);\n curl_close($ch);\n return $data;\n }",
"function outputResponse() {\n }",
"private function saveCompletedResponseData()\n {\n while ($done = curl_multi_info_read($this->curlMultiHandle)) {\n $curlHandle = $done['handle'];\n $key = $this->getKey($curlHandle);\n $this->responses[$key]['end'] = microtime(true);\n $this->responses[$key]['body'] = curl_multi_getcontent($curlHandle);\n }\n }",
"function output($response);",
"function jsonp_deliver($callback_result, $type = 'json')\n{\n\t$jscallback = $callback_result['callback'];\n\t$json = json_encode($callback_result['json']);\n\theader(\"Content-Type: application/json; charset=UTF-8\");\n\theader(\"Cache-Control: no-cache, must-revalidate\");\n\tob_start();\n\tprint $jscallback .\"(\" . $json . \")\";\n\t$length = ob_get_length();\n\theader('Content-Length: ' . $length);\n\tob_end_flush();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If centrallock_on is on, all other electronic devices have to be off | public function setCentrallock_on($loc_activate) {
if ($this->centrallock=="yes") {
if ($loc_activate=="on") {
$this->centrallock_on="on";
} else {
$this->centrallock_on="off";
}
} else {
$this->centrallock_on="not installed";
}
} | [
"public function off($sync = true)\n\t{\n\t\tif( $sync )\tsystem('echo standby 0 | /usr/local/bin/cec-client -s -d 1');\n\t\telse system('echo standby 0 | /usr/local/bin/cec-client -s -d 1 > /dev/null 2>&1');\n\t}",
"function eis_device_poweroff() {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status,$eis_mysqli;\n\t$eis_dev_status[\"glinestatus\"]=\"disconnected\"; \n\tfor ($p=1; $p<4;$p++) $eis_dev_status[\"gpower\".$p] = 0;\n\treturn true;\n}",
"function eis_device_poweroff() {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status,$eis_mysqli;\n\t$eis_dev_status[\"gridstatus\"]=\"disconnected\"; \n\treturn true;\n}",
"function eis_device_poweroff() {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status,$eis_mysqli;\n\t// set the powers to zero\n\tfor ($p=1; $p<4;$p++) $eis_dev_status[\"cpower\".$p] = 0;\n\treturn true;\n}",
"private function turnOff(): void {\n $this->is_on = false;\n }",
"private function turnOff() {\n\t\t$device = new PimaticDevice($this->name);\n\t\t$device->callDeviceAction(\"turnOff\");\n\t}",
"function eis_device_poweron() {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status,$eis_mysqli;\n\t// do nothing, power will be computed at the next step\n\treturn true;\n}",
"public function unsetOffable()\n {\n $this->offable = false;\n }",
"public function on($sync = true)\n\t{\n\t\tif( $sync )\tsystem('echo on 0 | /usr/local/bin/cec-client -s -d 1');\n\t\telse system('echo on 0 | /usr/local/bin/cec-client -s -d 1 > /dev/null 2>&1');\n\t}",
"private function _isLockSet() {\n\n\n\n }",
"function eis_device_poweron() {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status,$eis_mysqli;\n\t// set the powers to their defaults\n\tif ($eis_dev_status[\"fullpower\"]) $powerlevel=1; else $powerlevel=0.5; \n\tfor ($p=1; $p<4;$p++)\n\t\tif ($p==$eis_dev_status[\"connected\"]) \n\t\t\t$eis_dev_status[\"cpower\".$p] = $eis_dev_conf[\"cpower\".$p]*$powerlevel;\n\treturn true;\n}",
"protected function markAllAirOsDevicesUnsynchronized()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->update(ServiceDevice::class, 'sd')\n ->set('sd.qosSynchronized', ':qosSynchronized')\n ->andWhere('sd.qosEnabled = :qosThis')\n ->andWhere('sd.vendor = :vendorAirOs')\n ->setParameter('qosSynchronized', false)\n ->setParameter('qosThis', BaseDevice::QOS_THIS)\n ->setParameter('vendorAirOs', Vendor::AIR_OS)\n ->getQuery()->execute();\n }",
"public static function turnOff()\n {\n OS::execute('gpio mode 0 out');\n OS::execute('gpio write 0 0');\n }",
"public function resetAllLockedSections() {\n\n foreach($this->conveyor as $key => $conveyor_slot) {\n $this->conveyor[$key]['locked'] = false;\n }\n\n }",
"function turnOnLCD() {\n $this->gpio_manager->setOutput($this->port_mapping['LCD_POWER'],true);\n }",
"function pmc_lockdown_init() {\n $pmc_lockdown=get_option('pmc_lockdown', false);\n\tif ($pmc_lockdown) {\n\t\tdefine('PMC_LOCKDOWN', true);\n\t}\n}",
"public function lightOff()\n {\n }",
"function dhcpd_service_control(){\n global $settings;\n\n if( $settings['DHCPD_ENABLED1'] === 'no' && $settings['DHCPD_ENABLED2'] === 'no' ){\n //$this->dhcpd_service_disable();\n }else{\n //$this->dhcpd_service_enable();\n }\n }",
"function fratler_masters_disable() {\n // Grab the actives\n $mids = db_query('SELECT -m.mid FROM {fratler_masters} m')->fetchCol('mid');\n\n // Set the FMAcs active\n if ($mids) {\n $updated = db_query('UPDATE {fratler_accounts} b SET b.active = 0 WHERE b.aid IN (:mids)', array(':mids' => $mids))->rowCount();\n drupal_set_message(format_plural($updated, 'Deactivated one Master Account.', 'Deactivated @count Master Accounts.'), 'status');\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to get subject list based on program | public function fnListSubject($lintIdprogram){
$lobjDbAdpt = Zend_Db_Table::getDefaultAdapter();
$lstrSelect = $lobjDbAdpt->select()
->from(array('a'=>'tbl_landscapesubject'),array(""))
->joinLeft(array('b'=>'tbl_subjectmaster'), 'b.IdSubject = a.IdSubject' ,array("key"=>"b.IdSubject","value"=>"CONCAT_WS('-',IFNULL(b.SubjectName,''),IFNULL(b.SubCode,''))"))
->where('b.Active = 1')
->where('a.IdProgram = ?',$lintIdprogram )
->group("a.IdSubject")
->order("b.SubjectName");
$larrResult = $lobjDbAdpt->fetchAll($lstrSelect);
return $larrResult;
} | [
"function getSubjectList()\n{\n return array(\n 1 => \"MATH\",\n 2 => \"CHEMIST\",\n 3 => \"PHYSIC\",\n 4 => \"BIO\",\n );\n}",
"public function subjects($program=null)\n {\n $uri = $this->uri.'subjects';\n $response = $this->getRequest($uri)->getBody()->getContents();\n $decoded = json_decode($response);\n if($program!==null){\n return $decoded->subjects->$program;\n }\n return $decoded->subjects;\n }",
"public function subjects()\n\t{\n\t\t$subjects = array();\n\t\tif(isset($this->{RDF::rdf . 'about'}))\n\t\t{\n\t\t\tforeach($this->{RDF::rdf . 'about'} as $u)\n\t\t\t{\n\t\t\t\t$subjects[] = $u;\n\t\t\t}\n\t\t}\n\t\tif(isset($this->{RDF::rdf . 'ID'}))\n\t\t{\n\t\t\tforeach($this->{RDF::rdf . 'ID'} as $u)\n\t\t\t{\n\t\t\t\t$subjects[] = $u;\n\t\t\t}\n\t\t}\n\t\tif(isset($this->{RDF::rdf . 'nodeID'}))\n\t\t{\n\t\t\tforeach($this->{RDF::rdf . 'nodeID'} as $u)\n\t\t\t{\n\t\t\t\t$subjects[] = $u;\n\t\t\t}\n\t\t}\n\t\tif(!count($subjects))\n\t\t{\n\t\t\t$subjects[] = $this->localId;\n\t\t}\n\t\treturn $subjects;\n\t}",
"public function getSubjects(): array\n {\n return $this->curlHandler->getSubjects();\n }",
"private function getSubjectTopics () {\n \t$catalogWhere = $this->getCatalogWhereTerms();\n \tif (!isset(self::$getSubjectTopics_stmts[$catalogWhere])) {\n\t \t$query =\n\"SELECT \n STVSUBJ_CODE,\n\tSTVSUBJ_DESC\nFROM \n\tSCBCRSE\n\tINNER JOIN STVSUBJ ON SCBCRSE_SUBJ_CODE = STVSUBJ_CODE\nWHERE\n\tSTVSUBJ_DISP_WEB_IND = 'Y'\n\tAND SCBCRSE_COLL_CODE IN (\n\t\tSELECT\n\t\t\tcoll_code\n\t\tFROM\n\t\t\tcourse_catalog_college\n\t\tWHERE\n\t\t\t\".$this->getCatalogWhereTerms().\"\n\t)\n\nGROUP BY SCBCRSE_SUBJ_CODE\n\";\n\t\t\tself::$getSubjectTopics_stmts[$catalogWhere] = $this->manager->getDB()->prepare($query);\n\t\t}\n\t\t\n\t\t$parameters = $this->getCatalogParameters();\n\t\tself::$getSubjectTopics_stmts[$catalogWhere]->execute($parameters);\n\t\t\t\t\n\t\t$topics = array();\n\t\twhile ($row = self::$getSubjectTopics_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$topics[] = new banner_course_Topic(\n\t\t\t\t\t\t$this->getOsidIdFromString($row['STVSUBJ_CODE'], 'topic/subject/'),\n\t\t\t\t\t\ttrim($row['STVSUBJ_DESC']),\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tnew phpkit_type_URNInetType(\"urn:inet:middlebury.edu:genera:topic/subject\")\n\t\t\t\t);\n\t\t}\n\t\tself::$getSubjectTopics_stmts[$catalogWhere]->closeCursor();\n\t\treturn new phpkit_course_ArrayTopicList($topics);\n }",
"function getSubjects()\n {\n return $this->subjectlist;\n }",
"public function subjects()\n {\n /**\n * If user tries to access to course() directly without filtering through term,\n * then the default term will be current term.\n */\n if ($this->termId == NULL) {\n $this->termId = $this->currentTerm()->termId;\n }\n\n $query = 'Subjects?filter=(Courses/any(c: c/Classes/any(cc: cc/Term/TermId eq ' . $this->termId . ')))&$orderby=Abbreviation asc';\n\n $this->subjects = $this->requestAsGet($query);\n\n return $this->subjects;\n }",
"public static function GetAllSubjects()\n {\n return self::GetAllRecordsFromTable(\"subjects\"); \n }",
"public function subjects()\n\t{\n\t\treturn $this->exth_records(self::EXTH_RECORD_TYPE_SUBJECT);\n\t}",
"public function getSubjects()\n {\n $subjects = [];\n $nodes = $this->packageXPath->query('//opf:metadata/dc:subject');\n foreach ($nodes as $node) {\n $subjects[] = $node->nodeValueUnescaped;\n }\n\n return $subjects;\n }",
"public function getSubjects()\n {\n header('Cache-Control: no-cache, must-revalidate');\n header('Content-type: application/json');\n set_exception_handler('json_exception_handler');\n $result = array();\n foreach ($this->config->item('subjects') as $subject) {\n $slug = url_title($subject['display'], '-', true);\n foreach ($subject['codes'] as $code) {\n $result[$slug][] = 'http://purl.org/au-research/vocabulary/anzsrc-for/2008/' . $code;\n }\n }\n echo json_encode($result);\n }",
"public function get_subject_slug_list()\n {\n $query = $this->db->select('slug, subject')\n ->from('subjects')\n ->order_by('subject ASC')\n ->where('approved', 1)\n ->get();\n\n $data = [];\n\n foreach ($query->result() as $row) {\n $data[$row->slug] = $row->subject;\n }\n\n return $data;\n }",
"public function getSubjectList()\n {\n $subjects = $this->getModel()->getCollection();\n return $subjects;\n }",
"public function getTestSubjectsWithCode() {\n\t\t\t$results = CommonQueryManager::getInstance()->getTestSubjectsWithCode();\n\n\t\t\t$returnValues = '';\n\t\t\tif(isset($results) && is_array($results)) {\n\t\t\t\t$count = count($results);\n\t\t\t\tfor($i=0;$i<$count;$i++) {\n\t\t\t\t\t\t$returnValues .='<option value=\"'.$results[$i]['subjectId'].'\">'.strip_slashes($results[$i]['subjectName']).'</option>';\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $returnValues;\n\t\t}",
"public function getSubjects()\n\t{\n\t\t$sql = \"select * from subjects\";\n\t\t$q_res = mysqli_query($this->connrps, $sql);\n\t\treturn $q_res;\n\t}",
"public function readSubjectsForLecturer()\n {\n global $db;\n\n $sql = \"SELECT id, subject_name , subject_code, enroller , year , semester FROM subjects WHERE enroller = 'lecturer' ORDER BY id\";\n\n $result = $db->query($sql);\n\n if ($result->num_rows > 0) {\n $i = 0;\n $list = \"\";\n\n while ($row = $result->fetch_assoc()) {\n $list[$i] = $row;\n $i++;\n }\n return $list;\n } else {\n return false;\n }\n }",
"function bwp_get_subjects() {\n\n\t\t$taxonomies = array(\n\t\t\t'subject',\n\t\t);\n\n\t\t$args = array(\n\t\t\t'orderby' => 'name',\n\t\t\t'order' => 'ASC',\n\t\t\t'hide_empty' => false,\n\t\t);\n\n\n\t\t$subjects = get_terms( $taxonomies, $args );\n\n\n\t\tif ( empty ( $subjects ) || is_wp_error( $subjects ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn $subjects;\n\t}",
"function get_subject_list(){\n $q = $this->db->get('article_subject_table');\n\n $subject_list = $q->result();\n return $subject_list;\n }",
"public function getLaesekompasSubjects() {\n $fields = array('subjectsLaesekompas' => array('subjectHeader' => 'header', 'subject' => 'searchCode'));\n $elements = $this->_getDescription();\n $result = TingOpenformatMethods::parseFields($elements, $fields);\n return (is_array($result)) ? reset($result) : $result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if url exist | function diy_exist_url($url) {
$file_headers = @get_headers($url);
if(!$file_headers || $file_headers[0] == 'HTTP/1.1 404 Not Found') {
return false;
}
return true;
} | [
"function url_exists($url){ \r\n $url_data = parse_url($url); // scheme, host, port, path, query\r\n if(!fsockopen($url_data['host'], isset($url_data['port']) ? $url_data['port'] : 80)){\r\n $this->set_message('url_exists', 'The URL you entered is not accessible.');\r\n return FALSE;\r\n } \r\n \r\n return TRUE;\r\n }",
"function ajax_action_check_url() {\n\n\t\t$hadError = true;\n\n\t\t$url = isset( $_REQUEST['url'] ) ? $_REQUEST['url'] : '';\n\n\t\tif ( strlen( $url ) > 0 && function_exists( 'get_headers' ) ) {\n\t\t\t\t\n\t\t\t$file_headers = @get_headers( $url );\n\t\t\t$exists = $file_headers && $file_headers[0] != 'HTTP/1.1 404 Not Found';\n\t\t\t$hadError = false;\n\t\t}\n\n\t\techo '{ \"exists\": '. ($exists ? '1' : '0') . ($hadError ? ', \"error\" : 1 ' : '') . ' }';\n\n\t\tdie();\n\t}",
"function ajax_action_check_url() {\n\t\t\t$hadError = true;\n\n\t\t\t$url = isset( $_REQUEST['url'] ) ? $_REQUEST['url'] : '';\n\n\t\t\tif ( strlen( $url ) > 0 && function_exists( 'get_headers' ) ) {\n\t\t\t\t$url = esc_url( $url );\n\t\t\t\t$file_headers = @get_headers( $url );\n\t\t\t\t$exists = $file_headers && $file_headers[0] != 'HTTP/1.1 404 Not Found';\n\t\t\t\t$hadError = false;\n\t\t\t}\n\n\t\t\techo '{ \"exists\": '. ($exists ? '1' : '0') . ($hadError ? ', \"error\" : 1 ' : '') . ' }';\n\t\t\tdie();\n\t\t}",
"function url_exists($url) {\n if (!$fp = curl_init($url)) return false;\n return true;\n}",
"function url_exists($url){\n\tif(preg_match('#http\\:\\/\\/[aA-zZ0-9\\.]+\\.[aA-zZ\\.]+#',$url)) return true;\n else return false;\n}",
"public function has_url() {\n\t\treturn isset( $this->_url );\n\t}",
"function url_exists( $url = NULL ) {\n if( empty( $url ) ){\n return false;\n }\n $options['http'] = array(\n 'method' => \"HEAD\",\n 'ignore_errors' => 1,\n 'max_redirects' => 0\n );\n $body = @file_get_contents( $url, NULL, stream_context_create( $options ) );\n if( isset( $http_response_header ) ) {\n sscanf( $http_response_header[0], 'HTTP/%*d.%*d %d', $httpcode );\n // Aceptar solo respuesta 200 (Ok), 301 (redirección permanente) o 302 (redirección temporal)\n $accepted_response = array( 200, 301, 302 );\n if( in_array( $httpcode, $accepted_response ) ) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n}",
"function validarURL($url){\n\tif($url !== '#'){\n\t\t$file_headers = @get_headers($url);\n\t\tif(!$file_headers || $file_headers[0] == 'HTTP/1.1 404 Not Found') {\n\t\t\t$exists = false;\n\t\t}else {\n\t\t\t$exists = true;\n\t\t}\n\t}else{\n\t\t$exists = false;\n\t}\n\treturn $exists;\n}",
"public function if_exist_url($url) { // return boolean\r\n $this->reconnect();\r\n $sql = \"SELECT `id` FROM search_result WHERE path = '\" . $this->escape($url) . \"'\";\r\n $query = $this->select_bd($sql);\r\n return count($query) > 0 ? true : false;\r\n }",
"public function hasUrl()\n {\n return ! empty($this->url);\n }",
"public function hasUrl() {\n if (isset($this->_file->url) && strlen($this->_file->url)>0) {\n return true;\n }\n\n return false;\n }",
"public function hasUrl()\n {\n return $this->url !== null;\n }",
"public static function site_exists($url) {\r\n\t\t$ret = self::get_head($url);\r\n\t\treturn !empty($ret);\r\n\t}",
"function any_url_exists($url)\n{\n\t$a_url = parse_url($url);\n\tif (!isset($a_url['port']))\n\t{\n\t\t$a_url['port'] = 80;\n\t}\n\t$errno = 0;\n\t$errstr = '';\n\t$timeout = 30;\n\tif(isset($a_url['host']))\n\t{\n\t\tif(trim($a_url['host']) == gethostbyname(trim($a_url['host'])))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fid = fsockopen($a_url['host'], $a_url['port'], $errno, $errstr, $timeout);\n\t\t\tif (!$fid)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$page = isset($a_url['path']) ? $a_url['path'] : '';\n\t\t\t$page .= isset($a_url['query']) ? '?' . $a_url['query'] : '';\n\t\t\tfwrite($fid, 'HEAD ' . $page . ' HTTP/1.0' . \"\\r\\n\" . 'Host: ' . $a_url['host'] . \"\\r\\n\\r\\n\");\n\t\t\t$head = fread($fid, 4096);\n\t\t\tfclose($fid);\n\t\t\treturn preg_match('#^HTTP/.*\\s+[200|302]+\\s#i', $head);\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}",
"public static function site_exists($url) {\n\t\t$ret = self::get_head($url);\n\t\treturn !empty($ret);\n\t}",
"public function isUrl($url){\n\t\n\t if (method_exists($this->uri, 'getPath')) {\n return $this->uri->getPath()==$url;\n\t }\n\t\n\treturn null;\n\n }",
"public function testCheckurlexists()\n {\n $exists = $this->scrapper->checkUrlExists(\"http://www.sainsburys.co.uk/\");\n $this->assertTrue($exists);\n $not_exists = $this->scrapper->checkUrlExists(\"http://www.testme\");\n $this->assertFalse($not_exists);\n }",
"public function isExistingUrl()\n {\n $xpath = new DOMXPath($this->_dom);\n\n $result = $xpath->query('//articles/article[url=\"' . $this->_article->getUrl() . '\"]');\n\n return $result->length > 1;\n }",
"public function hasUrl()\n {\n return ! empty($this->href);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inserts or updates a Repository | public function upsertRepository(Repository $entity): void; | [
"public function updateOrInsert();",
"abstract function saveRepository($repositoryObject, $update = false);",
"public function updateOrInsert(){}",
"public function insertRepo($repo = [])\n\t{\n\t\t// Sets INSERT SQL statement with all repository values\n\t\t$sql = \"INSERT INTO {$this->config->table} VALUES(:repo_id, :name, :url, :created_date, :last_push_date, :description, :stars)\";\n\t\t$parms = [\n\t\t\t'repo_id' \t\t\t=> $repo['repo_id'],\n\t\t\t'name' \t\t\t\t=> $repo['name'],\n\t\t\t'url' \t\t\t\t=> $repo['url'],\n\t\t\t'created_date' \t\t=> $repo['created_date'],\n\t\t\t'last_push_date' \t=> $repo['last_push_date'],\n\t\t\t'description' \t\t=> preg_replace(\"/[^A-Za-z0-9 ]/\", '', $repo['description']),\n\t\t\t'stars' \t\t\t=> $repo['stars']\n\t\t];\n\n\t\treturn $this->executeSQL($sql, $parms, FALSE);\n\t}",
"protected function save()\n {\n $this->repository->save();\n }",
"public function insertToDB() {\n\t\t$inserted = 0;\n\t\t$updated = 0;\n\t\tfor ($count = 1; $count <= 10; $count++) { \n\t\t\t$url = \"https://api.github.com/search/repositories?q=language:php&page=$count&per_page=10\";\n \n\t\t\t$response = file_get_contents($url, false, $this->context);\n\t\t\tif($response){\n\t\t\t\t$res = json_decode($response,true);\n\t\t\t\t$data = $res['items'];\n\t\t\t\t\n\t\t\t\tfor($i = 0; $i < count($data); $i++) {\n\t\t\t\t\t$name = $data[$i]['name'];\n\t\t\t\t\t$id = $data[$i]['id'];\n\t\t\t\t\t$url = $data[$i]['html_url'];\n\t\t\t\t\t$description = $data[$i]['description'];\n\t\t\t\t\t$created_at = $data[$i]['created_at'];\n\t\t\t\t\t$updated_at = $data[$i]['updated_at'];\n\t\t\t\t\t$star = $data[$i]['watchers_count'];\n\t\t\t\t\t\n\t\t\t\t\t$sql = \"SELECT * FROM php_projects WHERE repository_id = :id\";\n\t\t\t\t\t$sth = $this->conn->prepare($sql);\n\t\t\t\t\t$sth->bindParam(':id', $id, PDO::PARAM_INT);\n\t\t\t\t\t$res = $sth->execute();\n\t\t\t\t\t$record = $sth->fetchAll();\n\n\t\t\t\n\t\t\t\t\tif (count($record) == 0) {\n\t\t\t\t\t\t// No data present so insert new row in DB\n\t\t\t\t\t\t$sql = \"INSERT INTO php_projects \n\t\t\t\t\t\t\t\t(repository_id, repository_name, repository_url, repository_created_date, repository_last_push_date, repository_description, number_of_stars) \n\t\t\t\t\t\t\t\tVALUES (?,?,?,?,?,?,?)\";\n\t\t\t\t\t\t$this->conn->prepare($sql)->execute([$id, $name, $url, $created_at, $updated_at, $description, $star]);\n\t\t\t\t\t\t$inserted++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// record already present so update row in DB\n\t\t\t\t\t\t$sql = \"UPDATE php_projects \n\t\t\t\t\t\t\t\tSET repository_name = ?, repository_url = ? , repository_created_date = ?, repository_last_push_date = ?, repository_description = ?, number_of_stars = ?\n\t\t\t\t\t\t\t\tWHERE repository_id = ?\";\n\t\t\t\t\t\t$this->conn->prepare($sql)->execute([$name, $url, $created_at, $updated_at, $description, $star, $id]);\n\t\t\t\t\t\t$updated++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ['no_of_rows_inserted' => $inserted, 'no_of_rows_updated' => $updated];\n\t}",
"public function addRepository($repository);",
"public function update(){\n Lore::app()->getPersistence()->getRepository($this->metadata()->getRepositoryName())->update($this);\n }",
"abstract protected function createRepository();",
"public function guardar(){\n if($this->id){\n $this->update();\n }else{\n $this->insert();\n }\n }",
"public abstract function insert(Entity $entity);",
"public function alwaysUpsert();",
"public function save ()\r\n {\r\n if ($this->isNew())\r\n $this->insert();\r\n else\r\n $this->update();\r\n }",
"public static function add($Data){\n global $pdo;\n $query = $pdo\n ->insert(array('repo_ownerid', 'repo_name','repo_description','repo_private'))\n ->into('repo')\n ->values($Data);\n $result = $query->execute();\n return $pdo->lastInsertId();\n }",
"private function insertGitRecord($projectId, $name, $repository)\n {\n $data = [\n 'project' => $projectId,\n 'name' => $name,\n 'git' => $repository\n ];\n\n $this->getLogger()->info('Inserted new git record', $data);\n return $this->getDatabase()->insertRecord('jacobine_git', $data);\n }",
"public function add_or_update()\n {\n $this->on_duplicate_key('foo = foo + 1');\n $this->insert('table', array('foo' => 'bar'));\n }",
"public function testStoreNewUserUsingRepository()\n {\n $account = (object) [\n 'id' => str_random(24),\n ];\n\n $repository = app(UserRepositoryContract::class);\n $user = $repository->create($account);\n\n $this->assertTrue($user instanceof User);\n\n $this->seeInDatabase('users', [\n 'northstar_id' => $account->id,\n 'role' => null,\n ]);\n }",
"public function asRepository();",
"private function loadRepo($repository)\n {\n if(gettype($repository) === \"integer\")\n $query = $this->db->query(\"SELECT * FROM repositories WHERE id = '\".$repository.\"'\");\n else\n $query = $this->db->query(\"SELECT * FROM repositories WHERE gitid = '\".$repository->id.\"'\");\n\n if($query->num_rows > 0 && $repo = $query->fetch_object())\n {\n $this->id = $repo->id;\n $this->name = $repo->name;\n $this->description = $repo->description;\n $this->gitid = $repo->gitid;\n $this->ownername = $repo->ownername;\n $this->owneremail = $repo->owneremail;\n $this->url = $repo->url;\n }\n else\n {\n $this->name = $repository->name;\n $this->description = $repository->description;\n $this->gitid = $repository->id;\n $this->ownername = $repository->owner->name;\n $this->owneremail = $repository->owner->email;\n $this->url = $repository->url;\n $this->saveRepo();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Too Short / Long | function isToo($v,$t='',$min=3,$max=50){
if(strlen($v)<=$min){return showIn($t,'page') . calglb_too_short;}
else if(strlen($v)>=$max){return showIn($t,'page') . calglb_too_long;}
else{return '';}
} | [
"function isToo($v,$t='',$min=3,$max=50){\n\n\tif(strlen($v)<=$min){return showIn($t,'page') . letheglobal_too_short;}\n\telse if(strlen($v)>=$max){return showIn($t,'page') . letheglobal_too_long;}\n\telse{return '';}\n}",
"function ssba_shorten($urlLong) {\n\t\n\t\t// get results from bitly and return short url\n\t\t$hmtlBitly = file_get_contents('http://api.bit.ly/v3/shorten?login=simplesharebuttons&apiKey=R_555eddf50da1370b8ab75670a3de2fe6&longUrl=' . $urlLong);\n\t\t$arrBitly = json_decode($hmtlBitly, true);\n\t\t$urlShort = $arrBitly['data'];\n\t\t$urlShort = $urlShort['url'];\n\t\t$hmtlBitly = str_replace('[\\]', '', $hmtlBitly);\n\t\t\n\t\tif ($urlShort != '') {\n\t\t\n\t\t\treturn $urlShort;\n\t\t} else {\n\t\t\n\t\t\treturn $urlLong;\n\t\t}; \n\t}",
"private function isShort()\n {\n $length = Utf8::strlen($this->word);\n return ( ($this->searchShortSyllabe(-3, 3) || $this->searchShortSyllabe(-2, 2)) && ($length == $this->r1Index) );\n }",
"function shortencenter ($var, $len = 30) {\n if (empty ($var)) {\n return \"\";\n }\n if (strlen ($var) < $len) {\n return $var;\n }\n $len = floor($len/2)-1;\n return substr($var,0,$len).\"...\".substr ($var,strlen($var)-$len,$len);\n}",
"public function testShort() {\n $buffer = new Buffer(self::ALPHABET);\n $buffer->appendShort(10);\n $int = $buffer->getShort(26);\n $this->assertEquals($int, 10);\n $this->complete();\n }",
"public function increaseShortLength()\n {\n return ++$this->urlLength;\n }",
"public function checkStrLen($full, $short)\n {\n if (strlen(htmlspecialchars($full)) > 140000) {\n echo 'Полное описание слишкомм длинное, сократите, пожалуста.';\n exit;\n }\n if (strlen(htmlspecialchars($short)) > 4000) {\n echo 'Краткое описание слишкомм длинное, сократите, пожалуста.';\n exit;\n }\n\n return true;\n }",
"function url_shorten($url, $length = 35)\n {\n }",
"function shorten($str,$len=17){\n if (mb_strlen($str)<$len) return $str;\n return mb_substr($str,0,$len).'..';\n}",
"function shortenURL ($var, $len = 3) {\nglobal $display;\n$len = 20+$display['stringLengthsFactor']*$len;\n// echo \"len is $len<br>\";\n$varS = shorten($var, $len);\nif ($varS != $var) {\n\t$varS = str_replace(\".\", \".​\", $varS);\n\t$varS = str_replace(\"?\", \"?​\", $varS);\n\t$varS = str_replace(\"&\", \"&​\", $varS);\n\t$varS .= \"...\"; \n} else {\n\t$varS = str_replace(\".\", \".​\", $varS);\n\t$varS = str_replace(\"?\", \"?​\", $varS);\n\t$varS = str_replace(\"&\", \"&​\", $varS);\n}\nreturn $varS;\n}",
"public function testAddressingPlaceTooLong()\r\n {\r\n $tooLong = str_pad('x', 36);\r\n (new Pakket)\r\n ->setGeadresseerdeWoonplaats($tooLong);\r\n }",
"function short_string($text = '', $length, $symbol = ' .....')\n{\n $length_text = mb_strlen($text);\n $length_symbol = mb_strlen($symbol);\n\t\n if ($length_text <= $length OR $length_text <= $length_symbol OR $length <= $length_symbol)\n {\n return($text);\n }\n else\n {\n if ((mb_strrpos(mb_substr($text, 0, $length - $length_symbol), \" \") > mb_strrpos(mb_substr($text, 0, $length - $length_symbol), \".\") + 25) && (mb_strrpos(mb_substr($text, 0, $length - $length_symbol), \" \") < mb_strrpos(mb_substr($text, 0, $length - $length_symbol), \",\") + 25))\n {\n return (mb_substr($text, 0, mb_strrpos(mb_substr($text, 0, $length - $length_symbol), \" \")) . $symbol);\n }\n else if (mb_strrpos(mb_substr($text, 0, $length - $length_symbol), \" \") < mb_strrpos(mb_substr($text, 0, $length - $length_symbol), \".\") + 25)\n {\n return (mb_substr($text, 0, mb_strrpos(mb_substr($text, 0, $length - $length_symbol), \".\")) . $symbol);\n }\n else if (mb_strrpos(mb_substr($text, 0, $length - $length_symbol), \" \") < mb_strrpos(mb_substr($text, 0, $length - $length_symbol), \",\") + 25)\n {\n return (mb_substr($text, 0, mb_strrpos(mb_substr($text, 0, $length - $length_symbol), \".\")) . $symbol);\n }\n else\n {\n return (mb_substr($text, 0, mb_strrpos(mb_substr($text, 0, $length - $length_symbol), \" \")) . $symbol);\n }\n }\n}",
"private function shorten_too_long_words($tmp)\n\t{\n\t\t\n\t\t# WARNING: can cause problems used with html-text!\n\t\t\n\t\t$max_middle = self::max_allowed_word_lenght - (self::short_lenght_left + self::short_lenght_right);\n\t\t\n\t\t$pattern = \"#([^ ]{\".self::short_lenght_left.\"})[^ ]{\".$max_middle.\",}([^ ]{\".self::short_lenght_left.\"})#\";\n\t\t\n\t\t$replace_pattern = \"\\\\1...\\\\2\";\n\t\t\n\t\t$tmp = preg_replace($pattern, $replace_pattern, $tmp);\n\t\t\n\t\treturn $tmp;\n\t}",
"function shortenstring($strng,$length) {\r\n\tif(strlen($strng) > $length) $longer = '...'; else $longer = '';\r\n\treturn substr($strng,0,$length).$longer;\r\n}",
"function shortenSimplePie($string, $length){\n\n\t$length = $length - 10 ;\n\n\t//$suffix = '…';\n\t$suffix = '…' . ' ' . '<a class=\"more-link\" href=\"\">Read More</a>';\n\n\n\t$short_desc = trim(str_replace(array(\"\\r\",\"\\n\",\"\\t\"), '', strip_tags($string)));\n\n\t$desc = trim(substr($short_desc,0,$length));\n\t$lastchar = substr($desc,-1,1);\n\n\tif($lastchar == '.' || $lastchar == '!' || $lastchar =='?') $suffix='';\n\n\t$desc .= $suffix;\n\n\treturn $desc;\n}",
"public function tooLongWithComments() {\n\t\t$foo = 'bar';\n\t\t$foo;\n\t\t$foo;\n\t\t$foo;\n\t\t$foo;\n\t\t$foo;\n\t\t$foo;\n\t\t$foo;\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo;\n\t\t$foo;\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo;\n\t\t$foo;\n\t\t$foo;\n\t\t$foo;\n\t\t$foo;\n\t\t$foo;\n\t\t$foo;\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo;\n\t\t$foo;\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t\t$foo; // Hello\n\t}",
"public function testTooLong()\n {\n $rule = new Rule;\n $result = $rule->validate('foo', ['foo' => 'bar'], ['min' => 1, 'max' => 2]);\n $this->assertFalse($result);\n }",
"public function testStringEqualOrShorterThanLength()\n {\n // Length is 11.\n $expect = 'Hello World';\n\n $result = String::ellipsisize('Hello World', 11);\n PHPUnit_Framework_Assert::assertEquals($expect, $result);\n\n $result = String::ellipsisize('Hello World', 12);\n PHPUnit_Framework_Assert::assertEquals($expect, $result);\n\n }",
"function shorter_excerpt_length($length){\r\n\t\treturn 10;\r\n\t}",
"function longitud_mensaje ($mensaje) {\r\n if (strlen($mensaje) > 500) {\r\n return false;\r\n }\r\n return true;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns current API URL | public function getApiUrl()
{
return $this->API_URL;
} | [
"private function getApiUrl()\n\t\t{\n\t\t\treturn $this->apiurl;\n\t\t}",
"public function getAPIURL() {\n\n\t\t$url = trailingslashit( $this->apiURL );\n\n\t\treturn $url;\n\t}",
"public function get_api_url() {\n\t\n\t\treturn apply_filters('keyy_get_api_url', 'https://'.self::API_SERVER.'/v1/');\n\t}",
"public function getUrlApi()\n {\n return $this->url_api;\n }",
"public function getAPIUrl(){\n return $this->getConfig('frog/general/api_url');\n }",
"public function getBaseApiUrl() \n {\n return $this->api;\n }",
"public function get_base_api_url()\r\n {\r\n return $this->isSandboxEnabled() ? self::SANDBOX_BASE_API_URL : self::BASE_API_URL;\r\n }",
"public function getBaseApiUrl()\n {\n return $this->baseApiUrl;\n }",
"abstract public function getApiUrl();",
"public function getBaseApiUrl()\n {\n return $this->isSandboxEnabled() ? self::SANDBOX_BASE_API_URL : self::BASE_API_URL;\n }",
"public function getBaseApiUrl()\n {\n return ($this->_getConfigFlag('is_account_live'))\n ? $this->_productionApiUrl\n : $this->_testApiUrl;\n }",
"static public function get_api_url() {\n $url = get_field('vf_api_url', 'option');\n return rtrim(trim($url), '/\\\\');\n }",
"function getApiUrl()\n { \n return ($this->test) ? $this->URL_TEST : $this->URL_PROD; \n }",
"protected function getApiUrlRoot()\n\t{\n\t\treturn static::API_URL_V1;\n\t}",
"protected static function getAPIUrl() {\n\tif (!isset(self::$apiUrl)) {\n\t $code = self::getContinent();\n\t self::$apiUrl = Data::$apiUrls[$code];\n\t //var_dump(Data::$apiUrls[$code]);\n\t}\n\n\treturn self::$apiUrl;\n }",
"public function getApiUrl()\n {\n switch ($this->getApiMode()) {\n case Convert_Porterbuddy_Model_Carrier::MODE_PRODUCTION:\n return Mage::getStoreConfig(self::XML_PATH_PRODUCTION_API_URL);\n case Convert_Porterbuddy_Model_Carrier::MODE_TESTING:\n return Mage::getStoreConfig(self::XML_PATH_TESTING_API_URL);\n default:\n return Mage::getStoreConfig(self::XML_PATH_DEVELOPMENT_API_URL);\n }\n }",
"protected function getCurrentUrl() {\n\t\t\n\t\t/** @var Page|null $page */\n\t\t$page = $this->wire('page');\n\t\t$input = $this->getWireInput();\n\t\t$http = isset($_SERVER['HTTP_HOST']) || isset($_SERVER['REQUEST_URI']); \n\t\t\n\t\tif($http) {\n\t\t\t// best case, everything available. getting httpUrl requires that $config API var is available...\n\t\t\t$url = $input->httpUrl(); \n\t\t} else if($page) {\n\t\t\t// this can occur for non-http request like command line\n\t\t\t$url = $page->url();\n\t\t} else {\n\t\t\t// unable to determine url\n\t\t\t$url = '/?/';\n\t\t}\n\t\t\n\t\treturn $url;\n\t}",
"protected function baseUri()\n {\n return $this->getApiEnvironment() == static::ENV_LIVE ? static::URL_LIVE : static::URL_PRACTICE;\n }",
"public function getCurrentUrl(){\n\t\treturn $this->_urlApp->getCurrentUrl();\n\t}",
"protected function _getApiUrl()\n {\n return Mage::getStoreConfig(self::XML_PATH_SCRAPINGHUB_API_URL);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the Altar credits to a custom value Original: and the master sword | public function setAltarCredits(string $string) {
$write_string = str_pad(substr($string, 0, 20), 20, ' ', STR_PAD_BOTH);
$offset = 0x76C81;
foreach ($this->convertCredits($write_string) as $byte) {
$this->write($offset++, pack('C', $byte));
}
return $this;
} | [
"private function modifyLeather()\n {\n $this->randomizeLucky();\n if ($this->isLucky) {\n $this->baseName = sprintf('%s %s', 'Hard', $this->baseName);\n $this->baseShield = $this->baseShield*3;\n }\n }",
"public function setAltarCredits(string $string) : self {\n\t\t$write_string = str_pad(substr($string, 0, 20), 20, ' ', STR_PAD_BOTH);\n\t\t$offset = 0x76C81;\n\t\tforeach ($this->convertCredits($write_string) as $byte) {\n\t\t\t$this->write($offset++, pack('C', $byte));\n\t\t}\n\n\t\treturn $this;\n\t}",
"private function updateLocalCredits($new)\n {\n $this->credits = $new;\n }",
"function my_customize_partial_additional_credit() {\n echo get_theme_mod(\"additional_credit\", \"Additional Credit\"); \n }",
"public function set_credit( $credit ) {\n\t\t$metadata = $this->get_metadata();\n\t\tif ( ! isset( $metadata['image_meta'] ) ) {\n\t\t\t$metadata['image_meta'] = array();\n\t\t}\n\t\t$metadata['image_meta']['credit'] = $credit;\n\t\twp_update_attachment_metadata( $this->get_id(), $metadata );\n\t}",
"public function setCreditInfo() {\n\t\t$this->creditInfo = $this->photo['title'] . \" by \" . $this->userName;\n\t}",
"function get_credits() {\n\t}",
"function UpdateAgentCredits($agentId, $credits) {\n global $DB;\n if ($credits) {\n if ($credits>0) $credits=\"+$credits\";\n $DB->StQuery(\"Update Agents Set Credits=Credits$credits Where Id=$agentId\");\n }\n}",
"function do_footer_credits( $creds_text ) {\n\t$new_creds = genesis_get_option( 'footer_credits' );\n\n\tif ( ! $new_creds ) {\n\t\treturn $creds_text;\n\t}\n\n\treturn apply_filters( 'meta_content', wp_kses_post( $new_creds ) );\n}",
"public function updateArtDesignCredits() \n {\n if(!$this->alias) return;\n \n // Find any art credited to this alias and update credit to this account.\n if(CharacterImageCreator::where('alias', $this->alias)->update(['alias' => null, 'user_id' => $this->id]));\n\n // Perform the same operation, plucking alias from url\n $urlCreators = CharacterImageCreator::whereNotNull('url')->pluck('url','id');\n if(count($urlCreators)) {\n $matches = null;\n // Find all deviantArt urls\n foreach($urlCreators as $key=>$creator) preg_match_all('/deviantart\\.com\\/([A-Za-z0-9_-]+)/', $creator, $matches[$key]);\n // Find all alias matches within those, and update the relevant CharacterImageCreator\n foreach($matches as $key=>$match) if($match[1] != [] && strtolower($match[1][0]) == strtolower($this->alias)) CharacterImageCreator::find($key)->update(['url' => null, 'user_id' => $this->id]);\n }\n }",
"function storefront_credit() {\n \t\t?>\n \t\t<div class=\"site-info\">\n \t\t\t<?php echo esc_html( apply_filters( 'storefront_copyright_text', $content = '© ' . get_bloginfo( 'name' ) . ' ' . date( 'Y' ) ) ); ?>\n \t\t</div><!-- .site-info -->\n \t\t<?php\n \t}",
"function add_plugin_credits() {\n //printf(\"\\n\" . '<meta name=\"generator\" content=\"Powered by ' . $this->plugin_name . ' (' . $this->plugin_home_page . ') \" />' . PHP_EOL);\n printf(PHP_EOL . '<!-- ' . PHP_EOL . 'Powered by ' . $this->plugin_name\n . ': ' . $this->app_title . PHP_EOL\n . 'URL: ' . $this->plugin_home_page . PHP_EOL\n . '-->' . PHP_EOL . PHP_EOL);\n }",
"public function updateCredit()\n\t{\n\t\t$query = \"update pkr_player set n_credit_update = 1, virtual_money = \".PKR_DEFAUL_GET_CREDIT;\n\t\tif (!self::$istance->dbi_execute ($query,null))\n\t\t\tDB::dbErrorHandler($query, self::$istance->dbi_error(),\"updateCredit()\");\n\t}",
"function box_credit( $args, $assoc_args ) {\n\t\tlist($args, $assoc_args) = $this->parse_args($args, $assoc_args);\n\n\t\tforeach ($args as $user_id) {\n\t\t\t$customer = new CBCustomer($user_id, $interactive = false);\n\t\t\tWP_CLI::debug(\"User $user_id\");\n\t\t\tif (false !== $this->options->credit) {\n\t\t\t\t$customer->set_meta('extra_box_credits', $this->options->credit);\n\t\t\t}\n\t\t\tif (false !== $this->options->adjustment) {\n\t\t\t\t$customer->set_meta('box_credit_adjustment', $this->options->adjustment);\n\t\t\t}\n\t\t}\n\t}",
"function storefront_credit() {\n\t\t?>\n\t\t<div class=\"site-info\">\n\t\t\t<?php echo esc_html( apply_filters( 'storefront_copyright_text', $content = '© ' . get_bloginfo( 'name' ) . ' ' . date( 'Y' ) ) ); ?>\t\t\n\t\t</div><!-- .site-info -->\n\t\t<?php\n\t}",
"private function _update_credit( $credit )\n\t{\n\t\t$summary = get_option( self::DB_IMG_OPTM_SUMMARY, array() ) ;\n\n\t\tif ( empty( $summary[ 'credit' ] ) ) {\n\t\t\t$summary[ 'credit' ] = 0 ;\n\t\t}\n\n\t\tif ( $credit === '++' ) {\n\t\t\t$credit = $summary[ 'credit' ] + 1 ;\n\t\t}\n\n\t\t$old = $summary[ 'credit' ] ?: '-' ;\n\t\tLiteSpeed_Cache_Log::debug( \"[Img_Optm] Credit updated \\t\\t[Old] $old \\t\\t[New] $credit\" ) ;\n\n\t\t// Mark credit recovered\n\t\tif ( $credit > $summary[ 'credit' ] ) {\n\t\t\tif ( empty( $summary[ 'credit_recovered' ] ) ) {\n\t\t\t\t$summary[ 'credit_recovered' ] = 0 ;\n\t\t\t}\n\t\t\t$summary[ 'credit_recovered' ] += $credit - $summary[ 'credit' ] ;\n\t\t}\n\n\t\t$summary[ 'credit' ] = $credit ;\n\n\t\tupdate_option( self::DB_IMG_OPTM_SUMMARY, $summary ) ;\n\t}",
"function set_armor ($new) {\n $query = \"UPDATE user SET armor_id = \" . $new . \" WHERE user_id=\" . $this->id;\n $this->db->query ($query);\n $this->armor_id = $new;\n \n // and retrieve our new armor stats\n $query = \"SELECT * FROM item WHERE item_id=\" . $this->armor_id;\n $result = $this->db->query($query);\n $record = $result->fetch_assoc();\n $this->armor = $record;\n }",
"public function set_credits_id( $value ) {\n\t\t$this->set_prop( 'credits_id', absint( $value ) ) ;\n\t}",
"public function testUpdateLoyaltyCard()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to get an image filter instance of a specified type. | protected function getFilterInstance($type)
{
// Sanitize the filter type.
$type = strtolower(preg_replace('#[^A-Z0-9_]#i', '', $type));
// Verify that the filter type exists.
$className = 'JImageFilter' . ucfirst($type);
if (!class_exists($className))
{
JLog::add('The ' . ucfirst($type) . ' image filter is not available.', JLog::ERROR);
throw new RuntimeException('The ' . ucfirst($type) . ' image filter is not available.');
}
// Instantiate the filter object.
$instance = new $className($this->handle);
// Verify that the filter type is valid.
if (!($instance instanceof JImageFilter))
{
// @codeCoverageIgnoreStart
JLog::add('The ' . ucfirst($type) . ' image filter is not valid.', JLog::ERROR);
throw new RuntimeException('The ' . ucfirst($type) . ' image filter is not valid.');
// @codeCoverageIgnoreEnd
}
return $instance;
} | [
"function getFilter ($type) {\n $filters = $this->getFilters();\n return $filters[$type];\n }",
"private function findFilter($type)\n {\n // Is this an attribute filter?\n if ($attribute = $this->getAttribute($type)) {\n $type = $attribute->type;\n }\n\n $name = ucfirst(camel_case(str_singular($type))).'Filter';\n $classname = \"GetCandy\\Api\\Core\\Search\\Providers\\Elastic\\Filters\\\\{$name}\";\n\n if (class_exists($classname)) {\n return app()->make($classname);\n } else {\n return app()->make(\"GetCandy\\Api\\Core\\Search\\Providers\\Elastic\\Filters\\TextFilter\");\n }\n }",
"public static function crateWebImagesFilter() {\n\t\treturn new FileTypeFilter(array(\n\t\t\tFileType::BMP,\n\t\t\tFileType::GIF,\n\t\t\tFileType::JPEG,\n\t\t\tFileType::PNG\n\t\t));\n\t}",
"public static function create()\n\t{\n\t\treturn new Dm_Image_Filter_Chain();\n\t}",
"public function getFilterClass($type)\r\n\t{\r\n\t\treturn '\\Engine\\Db\\Filter\\\\'.ucfirst($type);\r\n\t}",
"public function getFilterClass($type)\n {\n return '\\Engine\\Search\\Elasticsearch\\Filter\\\\'.ucfirst($type);\n }",
"public function getFilter(string $filter_name): Filter;",
"function get_filter_type_object(){\n $class_name = $this->get_filter_type();\n\n\t\tif( !class_exists( $class_name ) ){\n\t\t\treturn null;\n\t\t}\n\n $object_type = new $class_name();\n $object_type->set_options( $this->get_filter_type_options() );\n return $object_type;\n }",
"private function getFilter() {\n foreach ($this->filters as $filter) {\n if ($filter instanceof FilterInterface && $filter->supportsFilter($this->parameters)) {\n return $filter;\n }\n } \n }",
"function filter( $value, $type )\n {\n return Pgg_Filter::get( $value, $type );\n }",
"static function get_one($type, $src_image)\n {\n if (!is_object($src_image))\n {\n $src_image = new SrcImage($src_image);\n }\n\n $defined = ImageStdParams::get_defined_type_map();\n if (isset($defined[$type]))\n {\n return new DerivativeImage($defined[$type], $src_image);\n }\n\n $undefined = ImageStdParams::get_undefined_type_map();\n if (isset($undefined[$type]))\n {\n return new DerivativeImage($defined[ $undefined[$type] ], $src_image);\n }\n\n return null;\n }",
"public function getFilterInputType();",
"public static function LoadFilter( $filter_type ){\n\t\t$file_path = self::GetPathFilters() . 'in4mlFilter' . $filter_type . '.class.php';\n\n\t\tif( !class_exists( 'in4mlFilter' . $filter_type ) ) {\n\t\t\tif( file_exists( $file_path ) ){\n\t\t\t\trequire_once( $file_path );\n\t\t\t} else {\n\t\t\t\tthrow new Exception( 'Filter type ' . $filter_type . ' not found' );\n\t\t\t}\n\t\t}\n\t}",
"private function addFilter($image)\n {\n switch($this->filterType) {\n case 'grayscale':\n imagefilter($image, IMG_FILTER_GRAYSCALE);\n if($this->verbose) {\n $this->verbose(\"Added grayscale filter to image.\");\n }\n break;\n\n case 'sepia':\n imagefilter($image, IMG_FILTER_GRAYSCALE);\n imagefilter($image, IMG_FILTER_COLORIZE, 112, 66, 20, 60);\n if ($this->verbose) {\n $this->verbose(\"Added sepia filter to image.\");\n }\n break;\n\n default:\n $this->errorMessage('No support for this filter type.');\n }\n\n return $image;\n }",
"public function getFilterInstance($id);",
"public static function getInstance()\n\t{\n\t\tif (!self::$instance instanceof OLPBlackbox_Factory_Legacy_Filter)\n\t\t{\n\t\t\tself::$instance = new OLPBlackbox_Factory_Legacy_Filter();\n\t\t}\n\t\t\n\t\treturn self::$instance;\n\t}",
"public function setFilterImage()\n {\n $this->setArgument('-dFILTERIMAGE');\n\n return $this;\n }",
"public function getFilter($name)\n {\n if (!isset($this->filters[$name])) {\n $config = $this->app->getConfig()\n ->grab('asset.filter')\n ->set('class', $name);\n\n $filter = Filter::objectify($config);\n\n $this->filters[$name] = $filter;\n }\n\n return $this->filters[$name];\n }",
"public static function getFilter($type)\n\t{\n\t\t$filter = array();\n\n\t\t// in slider filter is not show\n\t\t$context = \\Bitrix\\Main\\Application::getInstance()->getContext();\n\t\t$request = $context->getRequest();\n\t\tif ($request->get('IFRAME') == 'Y')\n\t\t{\n\t\t\treturn $filter;\n\t\t}\n\n\t\tif (self::isTypeAllowed($type))\n\t\t{\n\t\t\t$grid = self::getGrid($type);\n\t\t\t$gridFilter = array();\n\t\t\t$search = $grid->GetFilter($gridFilter);\n\t\t\tif ($search['FILTER_APPLIED'])\n\t\t\t{\n\t\t\t\tif (isset($search['FIND']))\n\t\t\t\t{\n\t\t\t\t\t$filter[] = array(\n\t\t\t\t\t\t'LOGIC' => 'OR',\n\t\t\t\t\t\t'TITLE' => '%' . trim($search['FIND']) . '%',\n\t\t\t\t\t\t'DESCRIPTION' => '%' . trim($search['FIND']) . '%'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (isset($search['DELETED']))\n\t\t\t\t{\n\t\t\t\t\t$filter['=DELETED'] = $search['DELETED'];\n\t\t\t\t\tself::$isDeleted = $search['DELETED'] == 'Y';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $filter;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |