query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Alias: Sorts an array of objects by the specified property. | public static function sortObjects (&$array, $props, $order = 'ASC', $flags = '')
{
return self::sortArray($array, $props, $order, $flags);
} | [
"function sortArrayofObjectByProperty($array, $property, $order = \"ASC\")\n {\n $cur = 1;\n $stack[1]['l'] = 0;\n $stack[1]['r'] = count($array) - 1;\n\n do {\n $l = $stack[$cur]['l'];\n $r = $stack[$cur]['r'];\n $cur--;\n\n do {\n $i = $l;\n $j = $r;\n $tmp = $array[(int)(($l + $r) / 2)];\n\n // split the array in to parts\n // first: objects with \"smaller\" property $property\n // second: objects with \"bigger\" property $property\n do {\n while ($array[$i]->{$property} < $tmp->{$property}) $i++;\n while ($tmp->{$property} < $array[$j]->{$property}) $j--;\n\n // Swap elements of two parts if necesary\n if ($i <= $j) {\n $w = $array[$i];\n $array[$i] = $array[$j];\n $array[$j] = $w;\n\n $i++;\n $j--;\n }\n\n } while ($i <= $j);\n\n if ($i < $r) {\n $cur++;\n $stack[$cur]['l'] = $i;\n $stack[$cur]['r'] = $r;\n }\n $r = $j;\n\n } while ($l < $r);\n\n } while ($cur != 0);\n\n // Added ordering.\n if ($order == \"DESC\") {\n $array = array_reverse($array);\n }\n return $array;\n }",
"function sort_array_of_array (&$array, $subfield) {\n $sortarray = array();\n foreach ($array as $key => $row) {\n $sortarray[$key] = $row->$subfield;\n }\n array_multisort($sortarray, SORT_ASC, $array);\n}",
"protected function _sortByArray($array) {}",
"public function testSortArrayByTwoPropertiesWillReturnSortedArray()\n {\n $expected = array(\n array( 'fruit' => 'kiwi', 'color' => 'brown' ),\n array( 'fruit' => 'apple', 'color' => 'green' ),\n array( 'fruit' => 'melon', 'color' => 'green' ),\n array( 'fruit' => 'orange', 'color' => 'orange' ),\n array( 'fruit' => 'banana', 'color' => 'yellow' ),\n );\n\n $collection = array(\n array( 'fruit' => 'melon', 'color' => 'green' ),\n array( 'fruit' => 'apple', 'color' => 'green' ),\n array( 'fruit' => 'orange', 'color' => 'orange' ),\n array( 'fruit' => 'banana', 'color' => 'yellow' ),\n array( 'fruit' => 'kiwi', 'color' => 'brown' ),\n );\n\n $properties = array( 'color', 'fruit');\n\n $result = $this->sortCollection->sortCollection(\n $collection,\n $properties,\n SortCollection::SORT_DIR_ASC\n );\n\n $this->assertEquals($expected, $result);\n }",
"public static function psort(\n &$array,\n $property = null,\n $parentProperty = null,\n $caseSensitive = false,\n $reverse = false\n ) {\n return self::$driver->psort(\n $array,\n $property,\n $parentProperty,\n $caseSensitive,\n $reverse\n );\n }",
"public static function hsort(\n &$array,\n $property = null,\n $parentProperty = null,\n $caseSensitive = false,\n $reverse = false\n ) {\n return self::$driver->hsort(\n $array,\n $property,\n $parentProperty,\n $caseSensitive,\n $reverse\n );\n }",
"public function sortByAscending(string $property) {\n $this->sort['ASC'][] = $property;\n }",
"function testSortProperty()\n {\n $dataobject = new TestDataObject();\n $dataobject->fb_linkOrderFields = array('num');\n $this->datasource->bind($dataobject);\n $this->datasource->fetch();\n $this->assertEquals('ORDER BY num',\n trim($dataobject->lastQuery['order_by']));\n\n // Testing that sort() overrides sort property (see bug #12942)\n $dataobject = new TestDataObject();\n $dataobject->fb_linkOrderFields = array('the_str');\n $this->datasource->bind($dataobject);\n $this->datasource->sort('the_str');\n $this->datasource->fetch();\n // With bug #12942 the following equaled to 'ORDER BY \"the_str\", the_str'\n $this->assertEquals('ORDER BY \"the_str\"',\n trim($dataobject->lastQuery['order_by']));\n\n // Testing that sort() overrides sort property when passed an array\n $dataobject = new TestDataObject();\n $dataobject->fb_linkOrderFields = array('the_str');\n $this->datasource->bind($dataobject);\n $this->datasource->sort(array('the_str' => 'ASC'));\n $this->datasource->fetch();\n $this->assertEquals('ORDER BY \"the_str\" ASC',\n trim($dataobject->lastQuery['order_by']));\n }",
"function usort (array &$array, callable $cmp_function) {}",
"function papi_sort_order( $array, $key = 'sort_order' ) {\n\tif ( empty( $array ) || ! is_array( $array ) && ! is_object( $array ) ) {\n\t\treturn [];\n\t}\n\n\tif ( is_object( $array ) ) {\n\t\t$array = papi_to_array( $array );\n\t}\n\n\t$sorter = [];\n\n\tforeach ( $array as $k => $value ) {\n\t\t$value = is_array( $value ) ? (object) $value : $value;\n\t\tif ( is_object( $value ) && isset( $value->$key ) ) {\n\t\t\t$sorter[$k] = $value->$key;\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\t$i = 0;\n\t$default_sort = papi_filter_settings_sort_order();\n\n\tforeach ( $sorter as $k => $v ) {\n\t\tif ( $default_sort === $v ) {\n\t\t\t$sorter[$k] = $v - $i;\n\t\t\t$i++;\n\t\t}\n\t}\n\n\tasort( $sorter, SORT_NUMERIC );\n\n\t$result = [];\n\n\tforeach ( $sorter as $k => $v ) {\n\t\t$value = $array[$k];\n\t\t$value = is_array( $value ) ? (object) $value : $value;\n\n\t\tif ( is_object( $value ) && isset( $value->$key ) ) {\n\t\t\t$result[$k] = $array[$k];\n\t\t}\n\t}\n\n\treturn array_values( $result );\n}",
"public function asort () {}",
"function naturalSort(array $objects, string $getterMethod = 'getNumber')\n{\n $orderedResults = [];\n $numbers = [];\n foreach ($objects as $object) {\n $numbers[] = $object->{$getterMethod}();\n }\n natsort($numbers);\n $orderedKeys = array_keys($numbers);\n foreach ($orderedKeys as $index) {\n $orderedResults[] = $objects[$index];\n }\n return $orderedResults;\n}",
"public function sortByProperty($propName, $type='r')\n {\n $tempArray = array();\n $newObjects = array();\n\n while ($obj = $this->iterate()) {\n $tempArray[] = call_user_func(array($obj, 'get'.ucwords($propName)));\n }\n\n switch($type)\n {\n case 'r':\n asort($tempArray);\n break;\n case 'rr':\n arsort($tempArray);\n break;\n case 'n':\n asort($tempArray, SORT_NUMERIC);\n break;\n case 'nr':\n arsort($tempArray, SORT_NUMERIC);\n break;\n case 's':\n asort($tempArray, SORT_STRING);\n break;\n case 'sr':\n arsort($tempArray, SORT_STRING);\n break;\n default:\n throw new SofApiException(\n 'Collection->sortByProperty():\n illegal sort type \"'.$type.'\"'\n );\n }\n\n foreach ($tempArray as $key => $val) {\n $newObjects[] = $this->objects[$key];\n }\n $this->objects = $newObjects;\n }",
"function CmpArrayByProperty($a, $b, $property)\n{\n\treturn $a[$property] < $b[$property];\n}",
"public function sortDesc($propertyName);",
"public function sortByProperty($propName, $type='r')\n {\n $tempArray = array();\n $newObjects = array();\n\n while ($obj = $this->iterate()) {\n $tempArray[] = call_user_func(array($obj, 'get'.ucwords($propName)));\n }\n\n switch($type)\n {\n case 'r':\n asort($tempArray);\n break;\n case 'rr':\n arsort($tempArray);\n break;\n case 'n':\n asort($tempArray, SORT_NUMERIC);\n break;\n case 'nr':\n arsort($tempArray, SORT_NUMERIC);\n break;\n case 's':\n asort($tempArray, SORT_STRING);\n break;\n case 'sr':\n arsort($tempArray, SORT_STRING);\n break;\n default:\n throw new General_Exception(\n 'Collection->sortByProperty():\n illegal sort type \"'.$type.'\"'\n );\n }\n\n foreach ($tempArray as $key => $val) {\n $newObjects[] = $this->objects[$key];\n }\n $this->objects = $newObjects;\n }",
"public function asort(): void\n {\n $this->arrayObject->asort();\n }",
"function sortArray($array) {\r\n\t\tfor ($i = 0; $i < count($array); $i++) {\r\n\t\t\tfor ($j = $i; $j < count($array); $j++) {\r\n\t\t\t\tif ($array[$i]->ID > $array[$j]->ID) {\r\n\t\t\t\t\t$tmp = $array[$i];\r\n\t\t\t\t\t$array[$i] = $array[$j];\r\n\t\t\t\t\t$array[$j] = $tmp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function testMultisortObjectByMethod() {\n\t\t$Object1 = new _ArraySortObject(1);\n\t\t$Object2 = new _ArraySortObject(2);\n\t\t$array = array(\n\t\t\t$Object1,\n\t\t\t$Object2\n\t\t);\n\n\t\t$result = array(\n\t\t\t$Object2,\n\t\t\t$Object1\n\t\t);\n\n\t\t$this->assertSame($result, ArraySort::multisort($array, array('getWeight' => 'DESC')));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method: globalise ========================================================================= So basically instead of having to write ```Gears\AssetMini``` everywhere you can call this once and we will create a class alias to just Asset. For example this code might go in a bootstrap / front controller: Gears\AssetMini::globalise(); And then this code could go into your views: Asset::css(['bootstrap', 'custom', 'etc']); Parameters: n/a Returns: void | public static function globalise()
{
if (!class_exists('\Asset'))
{
if (!class_alias('\Gears\AssetMini', '\Asset'))
{
throw new \Exception('We failed to globalise!');
}
else
{
return;
}
}
throw new \Exception('The class `Asset` already exists globally!');
} | [
"abstract protected function registerAssets();",
"protected function registerStdAssets()\n {\n Facade::make('backend.css');\n Facade::make('backend.js');\n\n Facade::get('backend.css')\n ->add(asset('css/stellar.css'));\n\n Facade::get('backend.js')\n ->add('//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js')\n ->add(asset('js/stellar.js'));\n }",
"public function registerAssets()\n {\n }",
"protected function setupAssets()\n {\n $type='js';\n foreach ($this->js as $js) {\n $srcJsFiles[] = \"{$js}.{$type}\";\n $minJsFiles[] = \"{$js}.min.{$type}\";\n }\n\n $type='css';\n foreach ($this->css as $css) {\n $srcCssFiles[] = \"{$css}.{$type}\";\n $minCssFiles[] = \"{$css}.min.{$type}\";\n }\n\n $this->js = YII_DEBUG ? $srcJsFiles : $minJsFiles;\n $this->css = YII_DEBUG ? $srcCssFiles : $minCssFiles;\n }",
"protected function registerAssets()\n {\n $al = AssetList::getInstance();\n\n // Bootstrap Tabs\n $al->register(\n 'javascript',\n 'bootstrap/tab',\n 'assets/bootstrap.tab.js',\n array(\n 'version' => '3.3.1',\n 'position' => Asset::ASSET_POSITION_FOOTER,\n 'minify' => true,\n 'combine' => true\n ),\n $this\n );\n\n // Switchery\n $al->register(\n 'javascript',\n 'switchery/js',\n 'assets/switchery.js',\n array(\n 'version' => '0.7.0',\n 'position' => Asset::ASSET_POSITION_FOOTER,\n 'minify' => true,\n 'combine' => true\n ),\n $this\n );\n\n $al->register(\n 'css',\n 'switchery/css',\n 'assets/switchery.css',\n array(\n 'version' => '0.7.0',\n 'position' => Asset::ASSET_POSITION_HEADER,\n 'minify' => true,\n 'combine' => true\n ),\n $this\n );\n\n $al->registerGroup(\n 'switchery',\n array(\n array('css', 'switchery/css'),\n array('javascript', 'switchery/js')\n )\n );\n\n // Block Form Stuff\n $al->register(\n 'css',\n 'twitterfeed/form',\n 'blocks/tweet_feed/css/forms/form.css',\n array(\n 'version' => '0.9.5',\n 'position' => Asset::ASSET_POSITION_HEADER,\n 'minify' => true,\n 'combine' => true\n ),\n $this\n );\n }",
"public function register_assets() {\n\t}",
"public function registerAssets()\n {\n \t$view = $this->getView();\n \tIsLoadingAsset::register($view);\n \tIsLoadingAjaxStatusAsset::register($view);\n\n }",
"public function asset()\r\n {\r\n $this->fileJs('https://cdn.jsdelivr.net/npm/smartwizard@4.4.1/dist/js/jquery.smartWizard.js');\r\n $this->fileCss('https://cdn.jsdelivr.net/npm/smartwizard@4.4.1/dist/css/smart_wizard.css');\r\n $this->fileCss('https://cdn.jsdelivr.net/npm/smartwizard@4.4.1/dist/css/smart_wizard_theme_arrows.min.css');\r\n $this->fileCss('https://cdn.jsdelivr.net/npm/smartwizard@4.4.1/dist/css/smart_wizard_theme_circles.css');\r\n $this->fileCss('https://cdn.jsdelivr.net/npm/smartwizard@4.4.1/dist/css/smart_wizard_theme_dots.css');\r\n }",
"function initialiseAssetManager(){\n\n $this->assetManager = new \\Reportico\\Engine\\AssetManager($this);\n $this->assetManager->initialise();\n $this->assetManager->initialiseTheme();\n\n }",
"protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addYiiGemsCommonCss();\n $this->addFontAwesomeCss();\n $this->addAssetInfo(\n \"ribbon.css\",\n dirname(__FILE__) . \"/assets\"\n );\n $this->addGradientAssets($this->barGradient);\n }",
"public function adminAssets()\n {\n\n }",
"protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addYiiGemsCommonCss();\n $this->addAssetInfo(\n \"speechBubble.css\",\n dirname(__FILE__) . \"/assets\"\n );\n $this->addGradientAssets( array( $this->gradient ));\n }",
"protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addYiiGemsCommonCss();\n $this->addFontAwesomeCss();\n $this->addAssetInfo(\n array( \"$this->style.css\", \"faq.js\"),\n dirname(__FILE__) . \"/assets\"\n );\n $this->addGradientAssets($this->gradient);\n }",
"private function registerAssets()\n {\n if ($this->jsNotifier && Yii::$app instanceof \\yii\\web\\Application) {\n RavenAsset::register(Yii::$app->getView());\n Yii::$app->getView()->registerJs('Raven.config(' . Json::encode($this->publicDsn) . ', ' . Json::encode($this->jsOptions) . ').install();', View::POS_HEAD);\n }\n }",
"protected function setupAssetsInfo(){\n }",
"protected function _includeAssets()\n {\n if ($this->_included) {\n return;\n }\n $this->_included = true;\n $this->Html->script(\n 'SpectrumColorpicker.spectrum.js',\n ['block' => 'script-head']\n );\n $this->Html->css(\n 'SpectrumColorpicker.spectrum.css',\n ['block' => 'css']\n );\n }",
"public function enqueue_global_style() {\n\t\t$asset_manager = new WPSEO_Admin_Asset_Manager();\n\t\t$asset_manager->enqueue_style( 'admin-global' );\n\t}",
"public function setMedia()\n {\n $loadLibrary = false;\n\n if ($loadLibrary)\n {\n $activeTheme = $this->theme->active();\n $casset = \\Config::get('lb.theme.use_casset');\n $casset and \\Casset::add_path('theme', $activeTheme['asset_base']);\n \n \\Lb\\Backend::addAsset(array(\n 'jquery.min.js',\n 'jquery-ui.min.js',\n ), 'js', 'js_core', $this->theme, $casset);\n \n \\Lb\\Backend::addAsset(array(\n 'bootstrap/css/bootstrap.css',\n 'bootstrap/css/bootstrap-glyphicons.css',\n ), 'css', 'css_plugin', $this->theme, $casset);\n\n \\Lb\\Backend::addAsset(array(\n 'bootstrap.js',\n ), 'js', 'js_core', $this->theme, $casset);\n \n \\Lb\\Backend::addAsset(array(\n 'font-awesome/css/font-awesome.css',\n ), 'css', 'css_plugin', $this->theme, $casset);\n }\n }",
"protected static function _installAssets() {\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Boots (configures and registers) any packages found within this plugin's packages.load configuration value | public function bootPackages()
{
// Get the namespace of the current plugin to use in accessing the Config of the plugin
$pluginNamespace = str_replace('\\', '.', strtolower(__NAMESPACE__));
// Instantiate the AliasLoader for any aliases that will be loaded
$aliasLoader = AliasLoader::getInstance();
// Get the packages to boot
$packages = Config::get($pluginNamespace . '::packages');
// Boot each package
foreach ($packages as $name => $options) {
// Setup the configuration for the package, pulling from this plugin's config
if (!empty($options['config']) && !empty($options['config_namespace'])) {
Config::set($options['config_namespace'], $options['config']);
}
// Register any Service Providers for the package
if (!empty($options['providers'])) {
foreach ($options['providers'] as $provider) {
App::register($provider);
}
}
// Register any Aliases for the package
if (!empty($options['aliases'])) {
foreach ($options['aliases'] as $alias => $path) {
$aliasLoader->alias($alias, $path);
}
}
}
} | [
"private function loadPackages()\n {\n $this->packages = new PackageCollection();\n $this->packages->add(new RootPackage($this->rootPackageFile, $this->rootDir));\n\n foreach ($this->rootPackageFile->getInstallInfos() as $installInfo) {\n // Catch and log exceptions so that single packages cannot break\n // the whole repository\n $this->packages->add($this->loadPackage($installInfo));\n }\n }",
"public function bootAll()\n {\n if ($this->booted)\n return;\n\n foreach ($this->plugins as $plugin)\n $plugin->boot();\n\n $this->booted = true;\n }",
"protected function loadPackageInstallationPlugins() {\n\t\t$sql = \"SELECT\t\tpluginName, \n\t\t\t\t\tCASE WHEN pluginName = 'FilesPackageInstallationPlugin' THEN 2\n\t\t\t\t\tELSE \n\t\t\t\t\t\tCASE WHEN pluginName = 'SqlPackageInstallationPlugin' THEN 1\n\t\t\t\t\t\tELSE\t0\n\t\t\t\t\t\tEND\n\t\t\t\t\tEND AS priority2\n\t\t\tFROM \t\twcf\".WCF_N.\"_package_installation_plugin\n\t\t\tORDER BY\tpriority2 \".$this->pipSortOrder.\",\n\t\t\t\t\tpriority \".$this->pipSortOrder.\",\n\t\t\t\t\tpluginName\";\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\t$neededPlugins = array();\n\t\t$functionName = 'has'.ucfirst($this->action);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$plugin = $this->getPackageInstallationPlugin($row['pluginName']);\n\t\t\tif ($plugin->{$functionName}($this)) {\n\t\t\t\t$neededPlugins[] = $row['pluginName'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tWCF::getSession()->register('queueID'.$this->queueID.'PIPs', $neededPlugins);\n\t}",
"protected function initializePackages()\n {\n $repositoryManager = $this->getComposer()->getRepositoryManager();\n /** @var RepositoryInterface $repository */\n foreach ($repositoryManager->getRepositories() as $repository) {\n if ($repository instanceof ComposerRepository && $repository->hasProviders()) {\n continue;\n }\n foreach ($repository->getPackages() as $package) {\n $this->packages[$package->getName()] = $package->getRepository()->getPackages();\n }\n }\n }",
"public function packages() {\n\t\tif (!empty($this->_customPaths)) {\n\t\t\t$this->_paths = $this->_customPaths;\n\t\t} elseif (!empty($this->params['plugin'])) {\n\t\t\t$this->_paths = array(CakePlugin::path($this->params['plugin']));\n\t\t} else {\n\t\t\t$this->_paths = array(APP);\n\t\t}\n\n\t\t$patterns = array(\n\t\t\t# Lib\n\t\t\tarray(\n\t\t\t\t'App::import(\\'Lib\\', \\'Plugin.SomeLib\\')',\n\t\t\t\t'|App\\:\\:import\\(\\'(Lib)\\'\\,\\s*\\'(.*?)\\'\\)|'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'App::uses(\\'SomeLib\\', \\'Plugin.Package\\')',\n\t\t\t\t'|App\\:\\:uses\\(\\'(.*?)\\'\\,\\s*\\'(.*?\\.(.*?))\\'\\)|'\n\t\t\t),\n\t\t\t# Model\n\t\t\tarray(\n\t\t\t\t'App::import(\\'Model\\', \\'Plugin.SomeModel\\')',\n\t\t\t\t'|App\\:\\:import\\(\\'(Model)\\'\\,\\s*\\'(.*?)\\'\\)|'\n\t\t\t),\n\t\t\t//TODO: component, helper, behavior, ...\n\t\t);\n\n\t\t$this->_filesRegexpUpdate($patterns, 'libPackage');\n\n\t\t$patterns = array(\n\n\t\t);\n\n\t\t$this->_filesRegexpUpdate($patterns, 'libPackage');\n\t}",
"public function boot()\n {\n if (!$this->booted) {\n foreach ($this->providers as $provider) {\n $provider->boot($this->container);\n }\n $this->booted = true;\n }\n }",
"protected function initialize()\n {\n $this->packagesData = Tools::getPackagesData($this->packagesPath);\n\n $this->migrations = array();\n foreach ($this->packagesData as $packageKey => $packageData) {\n $this->registerMigrationFiles(Files::concatenatePaths(array($this->packagesPath, $packageData['category'], $packageKey)));\n }\n }",
"private function updatePackageNameAndAutoload()\n {\n $composerJson = $this->package_path . 'composer.json';\n $this->replace(\n [\n 'DummyPackageName',\n 'DummyAutoLoad',\n 'PackagerDummyServiceProvider',\n ],\n [\n $this->getQualifiedPackageName($this->vendor, $this->package),\n $this->getAutoLoadName($this->vendor, $this->package),\n $this->getQualifiedClassName($this->package) . 'ServiceProvider',\n ],\n $composerJson\n );\n }",
"public function loadInstaller() {\n\n $objManager = new class_module_packagemanager_manager();\n $arrModules = $objManager->getAvailablePackages();\n\n $this->arrMetadata = array();\n foreach($arrModules as $objOneModule)\n if($objOneModule->getBitProvidesInstaller())\n $this->arrMetadata[] = $objOneModule;\n\n $this->arrMetadata = $objManager->sortPackages($this->arrMetadata, true);\n\n }",
"protected function initAutoloader()\n {\n if ($this->loader) {\n $this->loader->unregister();\n }\n \n $package = $this->composer->getPackage();\n $generator = $this->composer->getAutoloadGenerator();\n $packages = $this->composer->getRepositoryManager()->getLocalRepository()->getCanonicalPackages();\n $packageMap = $generator->buildPackageMap($this->composer->getInstallationManager(), $package, $packages);\n $map = $generator->parseAutoloads($packageMap, $package);\n \n $this->loader = $generator->createLoader($map);\n $this->loader->register();\n }",
"private function boot()\n {\n // load service classes by the config and instantiate them\n $services_classes = config('app.services');\n if (is_array($services_classes))\n {\n foreach ($services_classes as $service_class)\n {\n $service = instantiate_if($service_class, '\\Pure\\Service');\n if($service) {\n array_push($this->m_services, $service);\n }\n }\n }\n\n // boot services\n foreach ($this->m_services as $service)\n {\n $service->boot();\n }\n }",
"public function init() {\n\n\t\tif (! empty($this->config['functions'])) {\n\n\t\t\tforeach ( $this->config['functions'] as $namespace => $packages ) {\n\n\t\t\t\t$this->initFunctions($namespace);\n\n\t\t\t\tforeach ( $packages as $package ) {\n\t\t\t\t\t$this->loadFunctions($namespace, $package);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (! empty($this->config['preload'])) {\n\t\t\t$this->addPackages($this->config['preload'], true);\n\t\t}\n\n\t\tif (! empty($this->config['ondemand'])) {\n\t\t\t$this->addPackages($this->config['ondemand'], false);\n\t\t}\n\n\t\tif (! empty($this->config['conditional'])) {\n\t\t\t$this->parseConditionalPackages($this->config['conditional']);\n\t\t}\n\n\t\treturn $this;\n\t}",
"protected function initRegistryVersions()\n {\n if (isset($this->repoConfig['registry-versions'])) {\n /** @var CompletePackageInterface $package */\n foreach ($this->repoConfig['registry-versions'] as $package) {\n $this->addPackage($package);\n }\n }\n }",
"public function loadComposer()\n {\n if ($ownVendor = $this->tryPath('vendor/', BootLoader::RELATIVE | BootLoader::VALIDATE)) {\n $this->autoLoader = require $ownVendor . 'autoload.php';\n } else {\n // when bootstrapping is inside a dependency of another project\n $this->autoLoader = require $this->getPath('../../', BootLoader::RELATIVE | BootLoader::VALIDATE) . 'autoload.php';\n }\n }",
"public function booted()\n {\n $this->configureSpark();\n $this->registerPlans();\n }",
"public function boot()\n {\n foreach ($this->registered as $provider) {\n $provider->boot();\n\n $this->booted[] = $provider;\n }\n }",
"public function bootPlugins()\n {\n foreach($this->activePlugins() as $plugin){\n $className = $plugin->parseNamespace().\"\\\\Plugin\";\n if(class_exists($className)) {\n $pluginInstance = new $className();\n if ($plugin->isActive() && method_exists($pluginInstance, 'boot')) {\n $pluginInstance->boot();\n $this->bootedPlugins[] = $plugin;\n }\n }\n }\n return;\n }",
"public function boot(): void\n\t{\n\t\t$this->loadModules();\n\t}",
"private function loadConfig(): void\n {\n $configPath = __DIR__.'/../config/package.php';\n\n $this->publishes([\n $configPath => config_path('package.php'),\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates the link to edit a student | function getStudentEditUrl($student) {
// get all pivars
$params = array();
foreach($this->piVars as $k => $v) {
$params[$this->prefixId.'['.$k.']'] = $v;
}
$params['type'] = 7645;
$params[$this->prefixId.'[action]'] = 'editStudent';
$params[$this->prefixId.'[editUid]'] = $student['uid'];
return $this->pi_getPageLink($GLOBALS['TSFE']->id,'',$params);
} | [
"public function edit(Student $student, Student $newStudent): Student;",
"public function editAction()\n {\n $instructordocId = $this->getRequest()->getParam('id');\n $instructordoc = $this->_initInstructordoc();\n if ($instructordocId && !$instructordoc->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_material')->__('This instructor doc no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getInstructordocData(true);\n if (!empty($data)) {\n $instructordoc->setData($data);\n }\n Mage::register('instructordoc_data', $instructordoc);\n $this->loadLayout();\n $this->_title(Mage::helper('bs_material')->__('Manage Materials'))\n ->_title(Mage::helper('bs_material')->__('Instructor Documents'));\n if ($instructordoc->getId()) {\n $this->_title($instructordoc->getIdocName());\n } else {\n $this->_title(Mage::helper('bs_material')->__('Add instructor doc'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }",
"public function editForm() {\n $data = $this->parent->getModel('grades')->select(\"SELECT studentid, studentname, studentpercent FROM studentgrades WHERE studentid = :id\", [':id'=>$_GET['id']]);\n $this->getView('editForm', $data);\n }",
"public function editUrl()\n {\n $parameters = [];\n // All records\n $elements = $this->elFromTable('');\n foreach ($elements as $tP => $value) {\n list($table, $uid) = explode('|', $tP);\n $parameters['edit[' . $table . '][' . $uid . ']'] = 'edit';\n }\n return BackendUtility::getModuleUrl('record_edit', $parameters);\n }",
"public function editAction()\n {\n View::renderTwigTemplate('/UserDetail/edit.html', [\n 'user' => Authenticate::getUser()\n ]);\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entity = $em->getRepository('BdxTutoratBundle:Student')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Student entity.');\n }\n\n $editForm = $this->createForm(new StudentType(), $entity);\n\n return $this->render('BdxTutoratBundle:Student:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n ));\n }",
"public function action_edit()\n {\n if(Helper_User::getUserRole($this->logget_user) == 'student' || Helper_User::getUserRole($this->logget_user) == 'teacher') {\n return $this->request->redirect('');\n }\n $data['student'] = ORM::factory('student', $this->request->param('student'));\n $data['year'] = $this->request->param('year');\n $data['record'] = ORM::factory('record_achievement', $this->request->param('id'));\n if ($this->request->post()) {\n try {\n $_POST['date'] = !empty($_POST['date']) ? strtotime($_POST['date']) : time();\n $_POST['year_id'] = $this->request->param('year');\n $_POST['student_id'] = $data['student']->student_id;\n if(Helper_User::getUserRole($this->logget_user) != 'sadmin') $_POST['notes'] = '';\n $data['record']->values($_POST, array('achievement', 'notes', 'date', 'year_id', 'student_id'))->update();\n $this->request->redirect('achievement-records/list/' . $data['student']->student_id . '/' . $_POST['year_id']);\n }\n catch (ORM_Validation_Exception $e) {\n $data['errors'] = Helper_Main::errors($e->errors('validation'));\n }\n }\n $data['user'] = $this->logget_user;\n Helper_Output::factory()->link_js('record/index');\n $this->setTitle('Edit Records')\n ->view('achievementrecords/editRecord', $data)\n ->render();\n }",
"function createEditLink() {\n $link = tx_div::makeInstance('tx_lib_link');\n $link->designator($this->getDesignator());\n $link->destination($this->getDestination()); \n $link->noHash();\n $link->parameters(array('namespace' => $this->get('namespace'),\n 'uid' => $this->get('uid'),\n 'action' => 'edit'));\n\n return '<script type=\"text/javascript\">\n function onButtonClick(){\n window.location.href = \"'.$link->makeUrl(false).'\";\n } \n var edit = new YAHOO.widget.Button({id:\"siwiki-menu-edit\", title:\"%%%edit%%%\", container:\"siwiki-menu-items\", onclick: { fn: onButtonClick } });\n </script>';\n }",
"public function getEditLink()\n {\n if (!$this->isManagedModule())\n {\n return '';\n }\n\n $moduleDefinition = $this->getModuleDefinition();\n\n return $moduleDefinition['admin_url'] . \"?routeName=$this->route_name&site=$this->site\";\n }",
"public function edit()\n {\n $educationId = Helper::getIdFromUrl('education');\n $education = EducationModel::load()->get($educationId);\n\n Helper::checkIdsFromSessionAndUrl($education->user_id);\n\n View::render('educations/edit.view', [\n 'method' => 'POST',\n 'action' => '/education/' . $educationId . '/update',\n 'education' => $education \n ]); \n }",
"private function getEditURL()\n {\n foreach ($this->_strCalendar->link as $strLink)\n {\n if ($strLink->attributes()->rel == 'edit')\n $this->_strCalendarEditURL = $strLink->attributes()->href;\n }\n }",
"public function edit(){\n\n\t\t\t$data = $this->detail_teacher();\n\n\t\t\tif(!isset($data[\"nidn\"])){\n\n\t\t\t\theader(\"location:\".HomeUrl().\"/profile\");\n\t\t\t\texit;\n\n\t\t\t}\n\n\t\t\tif(userData()[\"level\"] == 0) {\n\n\t\t \theader(\"location:\".HomeUrl().\"/profile\");\n\t\t \texit;\n\n\t \t}\n\n\t\t\t$this->view([\"header\", \"navbar\",\"teacher/edit\", \"footer\"], $data);\n\n\t\t}",
"public function generate_editlink(Order $order);",
"public function getEditLink()\n {\n return $this->get('EditLink');\n }",
"public function getEditLinkAttribute()\n {\n return route('comments.admin.index').'#!edit='.$this->id;\n }",
"public function editProductLink()\n {\n return base_url(\"product/edit/{$this->produceCode}\");\n }",
"public function editLink()\n {\n return URL::route('tricks.edit', [ $this->resource->slug ]);\n }",
"public function edit($controller,$id) {\n\treturn $this->Html->link(\n\t '<i class=\"fa fa-pencil-square-o\"></i> Modificar',\n\t array(\n\t\t'controller' => $controller,\n\t\t'action' => 'edit',\n\t\t$id,\n\t ),\n\t array(\n\t\t'class' => 'botond',\n\t\t'title' => 'Modificar',\n\t\t'escape' => false\n\t )\n\t);\n }",
"public function displayEditLink() {\r\n\t\tif (CONF_DB_SHOW_DIRECT_EDIT_LINK)\r\n\t\t\tif ($this->isSummaryMode() || FrontendShared::$IS_SHOWN)\r\n\t\t\t\techo HTML::emptyTD();\r\n\t\t\telse\r\n\t\t\t\techo HTML::td($this->TrainingObject->Linker()->smallEditLink()).NL;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set new Total for included Presentations | public function setTotalIncludedPresentations($int){
$this->totalIncludedPresentations = $int;
} | [
"private function setTotalAmounts()\n {\n $taxable\t= 0.00;\n $expenses = 0.00;\n $outlays\t= 0.00;\n\n foreach ($this->invoiceDetails as $invoiceDetail) {\n $amount = $invoiceDetail->getAmount();\n switch ($invoiceDetail->getType())\n {\n case 'incoming':\n $taxable += $amount;\n break;\n case 'expense':\n $taxable += $amount;\n $expenses += $amount;\n break;\n case 'outlay':\n $outlays += $amount;\n break;\n }\n }\n\n $this->setTotalTaxable($taxable);\n $this->setTotalExpenses($expenses);\n $this->setTotalOutlays($outlays);\n }",
"protected function _updateTotal() {\n\t\t$this->cart['GRAND_TOTAL'] = 0.00;\n\n\t\tif (!empty($this->cart['PRODUCTS'])) {\n\t\t\tforeach ($this->cart['PRODUCTS'] as $_product) {\n\t\t\t\t$this->cart['GRAND_TOTAL'] += $_product['PRICE'];\n\t\t\t}\n\t\t}\n\t}",
"protected function updateTotal()\n {\n $total = 0;\n\n foreach ($this->products as $product) {\n $total += $product->getUnitPrice();\n }\n\n $this->total = $total;\n }",
"private function setTotal()\n {\n if($this->taxIncluded){\n $this->total = $this->subtotal;\n }else{\n $this->total = $this->subtotal + $this->tax;\n } \n }",
"public function setSubTotal(){\r\n\t\t\tforeach($this->prodtotal as $pt) $this->subtotal+= $pt;\r\n\t\t}",
"public function updateTotal() {\n //get the scans for this user\n $scans = $this->scans();\n //create running total\n $newTotal = 0; \n //for each scan, add the total pups and virus to the total\n foreach ($scans as $scan) {\n $newTotal += $scan->pups + $scan->troj_mal;\n }\n //sets and saves the new total for this user\n $this->total = $newTotal;\n $this->save();\n }",
"function _update_total()\n\t\t{\n\t\t$this->itemcount = 0;\n\t\t$this->total = 0;\n\t\tif(sizeof($this->items > 0))\n\t\t\t{\n\t\t\tforeach($this->items as $item)\n\t\t\t\t{\n\t\t\t\t$this->total = $this->total + ($this->itemprices[$item] * $this->itemqtys[$item]);\n\n\t\t\t\t// TOTAL ITEMS IN CART (ORIGINAL wfCart COUNTED TOTAL NUMBER OF LINE ITEMS)\n\t\t\t\t$this->itemcount += $this->itemqtys[$item];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function updateTotal()\n {\n if ($this->conditionsMet() && $this->result instanceof ResultInterface) {\n $total = $this->result->process($this);\n } else {\n $total = $this->currencyService->getZeroMoney();\n }\n \n $this->total = $total;\n\n $this->saveState();\n\n $this->eventService->dispatch(\n Events::TOTAL_UPDATED,\n new TotalUpdatedEvent($this)\n );\n }",
"public function calculateAdjustmentsTotal();",
"private function calcTotals(){\n $this->GranTotal = 0;\n $this->TotalImpuestos =[];\n foreach ($this->Items as $item) {\n $this->GranTotal += $item->Precio;\n foreach ($item->Impuestos as $impuesto) {\n if(!isset($this->TotalImpuestos[$impuesto->NombreCorto])){\n $this->TotalImpuestos[$impuesto->NombreCorto] = 0;\n }\n //sumar tipo de impuesto\n $this->TotalImpuestos[$impuesto->NombreCorto] += $impuesto->MontoImpuesto;\n // $this->GranTotal += $impuesto->MontoImpuesto;\n }\n }\n $this->GranTotal = $this->GranTotal;\n }",
"public function recalculateTotal()\n\t{\t\t\n\t\t$summary = $this->summary();\t\t\n\t\t$this->total = $summary['total'];\n\t}",
"protected function setTotalPages()\n {\n $this->totalPages = (int) ceil($this->items / $this->itemsPerPage);\n }",
"public function addTotal(){\n $total = $this->Total;\n $this->gridAddRow();\n\n // Adicionando a Label do Total\n $this->gridAddCell($total->label, $total->labelAlign, $total->labelStyle, $total->labelColspan, $total->border, false);\n\n // Se o estilo para o total for igual ao da label\n if (!$total->valueStyle){\n $total->valueStyle = $total->labelStyle;\n }\n\n $this->gridAddCell($total->value, $total->valueAlign, $total->valueStyle, $total->valueColspan, $total->border, false);\n\n }",
"public function recalculateAdjustmentsTotal(): void;",
"public function update_total() {\n\t\t$this->load->model('pos/pos');\n\t\t$this->language->load('module/pos');\n\t\t$json = $this->recalculate_total($this->request->post);\n\t\t$this->response->setOutput(json_encode($json));\t\n\t}",
"private function updateTotal() : void\n {\n $this->playerScore += $this->player->score();\n $this->computerScore += $this->computer->score();\n $this->roundFinished = true;\n }",
"function _calcPnagTotal() {\n\t\t$this->total = 0;\n\t\tforeach($this->pnagArticles as $pnagArticle) {\n\t\t\t$this->total += $pnagArticle->unit_price * $pnagArticle->quantity;\n\t\t}\n\t\treturn $this;\n\t}",
"private function setup_total() {\n\t\t$amount = $this->get_meta( '_give_payment_total', true );\n\n\t\treturn round( floatval( $amount ), give_get_price_decimals( $this->ID ) );\n\t}",
"public function calculateInvoice() {\n foreach ($this->__get('items') as $item) {\n $this->__set('total', $this->__get('total') + $item->calculateItemTotal());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MESSAGE Add postype update message filter | public function update_message_filter() {
add_filter('post_updated_messages', array(&$this, 'updated_messages'));
} | [
"function filter_update_message( $messages = array() ) {\n\t\t\tif ( 'astra-portfolio' !== get_current_screen()->id ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$portfolio_type = get_post_meta( get_the_ID(), 'astra-portfolio-type', true );\n\t\t\tif ( 'page' === $portfolio_type ) {\n\t\t\t\treturn $messages;\n\t\t\t}\n\n\t\t\t$messages['post'][1] = __( 'Post updated.', 'astra-portfolio' );\n\t\t\t$messages['post'][6] = __( 'Post published.', 'astra-portfolio' );\n\t\t\t$messages['post'][8] = __( 'Post submitted.', 'astra-portfolio' );\n\t\t\t$messages['post'][9] = __( 'Post scheduled.', 'astra-portfolio' );\n\t\t\t$messages['post'][10] = __( 'Post draft updated.', 'astra-portfolio' );\n\n\t\t\treturn $messages;\n\t\t}",
"public function testUpdateMessageFlags()\n {\n $this->markTestIncomplete(\n 'Test of \"updateMessageFlags\" method has not been implemented yet.'\n );\n }",
"public function testUpdateNotificationType()\n {\n }",
"public function testUpdateMessageTemplate()\n {\n }",
"function wpbs_admin_notice_saved_init() {\n\tif ( isset($_REQUEST['message']) && $_REQUEST['message'] == 'wpbs_msg' )\n\t\tadd_action( 'admin_notices', 'wpbs_admin_notice_saved' );\n}",
"public function alm_filters_updated(){\n\t \tif( isset( $_GET[\"filter_updated\"] ) ) {\n\t\t \t$this->alm_filters_add_admin_notice('<i class=\"fa fa-check-square\" style=\"color: #46b450\";></i> '.__('Filter successfully updated.', 'ajax-load-more-filters'), 'success');\n\t\t }\n\t }",
"public function testUpdateReceivingProcessCustomFields()\n {\n }",
"public function changeMessage()\n\t{\n\t\t\n\t}",
"function post_editpost_gtcheck_submit_message(){\n global $pid, $message, $_G;\n $tid = intval($_REQUEST['tid']);\n if(!$tid) $tid = $_G['tid'];\n if(!($tid && $pid && trim($message)!=\"\") || !submitcheck('editsubmit') || !empty($_G['gp_delete'])){\n return array();\n } \n file_put_contents(\"/www/discuz/discuz_30_UTF8/upload/source/plugin/post.txt\", var_export($pid.\"|\".$tid, true).\"\\r\\n\", FILE_APPEND);\n $entry = & entry::singleton();\n $entry->appTypeKey = \"bbs\";\n $entry->textid = intval($pid);\n $entry->tid = intval($tid);\n $entry->type = \"edit\";\n $entry->run();\n return array();\n }",
"function modify_message(&$message) {\n//Add here whatever you need to recognize and modify this message:\n\n global $user;\n \n // Hide these messages:\n $message = preg_replace('/No posts in this group\\./', '', $message);\n $message = preg_replace('/Fetching data from GeoNames failed.*/', '', $message);\n $message = preg_replace('/The directory .*? has been created\\./', '', $message);\n \n //If the administrator has removed _himself_, the message should instead of\n //\"Username_ABC is no longer a group administrator.\" say:\n //\"You are no longer an administrator for this group. To regain administrator privileges, please contact an administrator for this group.\"\n $current_name = $user->name;\n preg_match('/(.*) is no longer a\\.*/', $message, $matches_A);\n //check if the current user is the same as the user in the message:\n if ($matches_A[1]) preg_match(\"/$current_name/\", $matches_A[1], $matches_B);\n if ($matches_B[0]) $message = \"You are no longer an administrator for this group. To regain administrator privileges, please contact an administrator for this group.\";\n}",
"function custom_updated_messages( $messages ) {\n $post = get_post();\n $post_type = get_post_type( $post );\n $post_type_object = get_post_type_object( $post_type );\n \n $messages[$this->post_type] = array(\n 0 => '', // Unused. Messages start at index 1.\n 1 => __( 'Equine updated.', EQUIPEER_ID ),\n 2 => __( 'Custom field updated.', EQUIPEER_ID ),\n 3 => __( 'Custom field deleted.', EQUIPEER_ID ),\n 4 => __( 'Equine updated.', EQUIPEER_ID ),\n /* translators: %s: date and time of the revision */\n 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Equine restored to revision from %s', EQUIPEER_ID ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,\n 6 => __( 'Equine published.', EQUIPEER_ID ),\n 7 => __( 'Equine saved.', EQUIPEER_ID ),\n 8 => __( 'Equine submitted.', EQUIPEER_ID ),\n 9 => sprintf(\n __( 'Equine scheduled for: <strong>%1$s</strong>.', EQUIPEER_ID ),\n // translators: Publish box date format, see http://php.net/date\n date_i18n( __( 'M j, Y @ G:i', EQUIPEER_ID ), strtotime( $post->post_date ) )\n ),\n 10 => __( 'Equine draft updated.', EQUIPEER_ID )\n );\n \n if ( $post_type_object->publicly_queryable && $this->post_type === $post_type ) {\n $permalink = get_permalink( $post->ID );\n \n $view_link = sprintf( ' <a href=\"%s\">%s</a>', esc_url( $permalink ), __( 'View equine', EQUIPEER_ID ) );\n $messages[ $post_type ][1] .= $view_link;\n $messages[ $post_type ][6] .= $view_link;\n $messages[ $post_type ][9] .= $view_link;\n \n $preview_permalink = add_query_arg( 'preview', 'true', $permalink );\n $preview_link = sprintf( ' <a target=\"_blank\" href=\"%s\">%s</a>', esc_url( $preview_permalink ), __( 'Preview equine', EQUIPEER_ID ) );\n $messages[ $post_type ][8] .= $preview_link;\n $messages[ $post_type ][10] .= $preview_link;\n }\n \n return $messages;\n }",
"static public function render_update_message() {\n\t\t\tif ( ! empty( $_POST ) && ! isset( $_POST['email'] ) ) {\n\t\t\t\techo '<div class=\"updated\"><p>' . esc_html__( 'Settings updated!', 'ibx-wpfomo' ) . '</p></div>';\n\t\t\t}\n\t\t}",
"public function testUpdateMessage()\n {\n $this->markTestIncomplete(\n 'Test of \"updateMessage\" method has not been implemented yet.'\n );\n }",
"function hook_mail_alter(&$message) {\n if ($message['id'] == 'modulename_messagekey') {\n $message['body'][] = \"--\\nMail sent out from \" . variable_get('sitename', t('Drupal'));\n }\n}",
"function Admin_Messages_adminapi_update($args)\r\n{\r\n $dom = ZLanguage::getModuleDomain('Admin_Messages');\r\n // Argument check\r\n if (!isset($args['mid']) ||\r\n !isset($args['title']) ||\r\n !isset($args['content']) ||\r\n !isset($args['language']) ||\r\n !isset($args['active']) ||\r\n !isset($args['expire']) ||\r\n !isset($args['oldtime']) ||\r\n !isset($args['changestartday']) ||\r\n !isset($args['view'])) {\r\n return LogUtil::registerArgsError();\r\n }\r\n\r\n // Get the existing admin message\r\n $item = ModUtil::apiFunc('Admin_Messages', 'user', 'get', array('mid' => $args['mid']));\r\n\r\n if ($item == false) {\r\n return LogUtil::registerError(__('Sorry! No such item found.', $dom));\r\n }\r\n\r\n // Security check\r\n if (!SecurityUtil::checkPermission('Admin_Messages::', \"$item[title]::$args[mid]\", ACCESS_EDIT)) {\r\n return LogUtil::registerPermissionError ();\r\n }\r\n\r\n // check value of change start day to today and set time\r\n if ($args['changestartday'] == 1) {\r\n $time = time();\r\n } else {\r\n $time = $args['oldtime'];\r\n }\r\n\r\n // check for an invalid expiry\r\n if ($args['expire'] < 0) {\r\n $expire = 0;\r\n }\r\n\r\n // create the item array\r\n $item = array('mid' => $args['mid'], 'title' => $args['title'], 'content' => $args['content'],\r\n 'language' => $args['language'], 'active' => $args['active'], 'view' => $args['view']);\r\n\r\n // add some additional modified values\r\n $args['expire'] = $args['expire'] * 86400; // turns days into seconds\r\n $args['date'] = $time;\r\n\r\n if (!DBUtil::updateObject($args, 'message', '', 'mid')) {\r\n return LogUtil::registerError(__('Error! Could not save your changes.'));\r\n }\r\n\r\n // New hook functions\r\n ModUtil::callHooks('item', 'update', $args['mid'], array('module' => 'Admin_Messages'));\r\n\r\n // The item has been modified, so we clear all cached pages of this item.\r\n $view = Zikula_View::getInstance('Admin_Messages');\r\n $view->clear_cache(null, UserUtil::getVar('uid'));\r\n\r\n // Let the calling process know that we have finished successfully\r\n return true;\r\n}",
"public function webhookTelegram() {\n \\Log::info('Chat id ' . json_encode($this->input));\n\n /*\n $keyboard = $parameters = array();\n $keyboard[] = [['category1' => 2, 'category2' => 4]];\n $keyboards[] = $keyboard;\n $parameters['chat_id'] = '283329263';\n $parameters['text'] = 'Cal';\n\n $parameters['reply_markup'] = new ReplyKeyboardMarkup([\n 'keyboard' => $keyboards[0],\n 'resize_keyboard' => true,\n 'one_time_keyboard' => true,\n 'selective' => false\n ]);\n return Request::sendMessage($parameters);\n */\n\n\n //Update array\n $update_array = array(\n 'organization_id' => 1,\n 'channel' => 'telegram',\n 'type' => 'incoming',\n 'update_id' => $this->input['update_id'],\n 'message' => json_encode($this->input['message']),\n 'status' => 1,\n 'created_by' => 1,\n 'updated_by' => 1\n );\n\n //Fields to select\n $fields = array('*');\n\n //Set where clause\n $where_clause = array(\n array(\n 'where' => 'where',\n 'column' => 'update_id',\n 'operator' => '=',\n 'operand' => $this->input['update_id']\n ),\n array(\n 'where' => 'where',\n 'column' => 'channel',\n 'operator' => '=',\n 'operand' => 'telegram'\n )\n );\n\n //Set scope\n $parameters['scope'] = array('statusOne');\n\n //Select update\n $update_model = $this->callController(\\Util::buildNamespace('surveys', 'update', 1), 'select', array($fields, $where_clause, 1, $parameters));\n\n if (!$update_model) {\n //Create update\n $update_model = $this->callController(\\Util::buildNamespace('surveys', 'update', 1), 'createIfValid', array($update_array, true));\n }//E# if statement\n\n if (array_key_exists('entities', $this->input['message']) && $this->input['message']['entities'][0]['type'] == 'bot_command') {\n $this->processCommands();\n } else {\n $this->processAnswer();\n }//E# if statement\n\n return array('chat_id' => $this->input['message']['chat']['id'], 'text' => 'What is your name?');\n }",
"function add_message() {\n\n }",
"function UpdateMessage($post)\n\t{\n\t\tglobal $db;\n\t\t$sql= \" UPDATE \".MESSAGE_BOARD_MASTER\n\t\t\t.\" SET \"\n\t\t\t.\" message_desc = '\".$post['dec'].\"' \"\n\t\t\t.\" WHERE message_id = '\".$post['message_id'].\"' AND project_id = '\".$post['project_id'].\"' \";\n\t\t$db->query($sql);\n\t}",
"public function updated(Message $message)\n {\n //\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves the invoice number | function save_invoice_number_field( $cart_item_data, $product_id ) {
if ( isset( $_REQUEST['invoice_number'] ) ) {
$cart_item_data['invoice_number'] = $_REQUEST['invoice_number'];
/* below statement make sure every add to cart action as unique line item */
$cart_item_data['unique_key'] = md5( microtime() . rand() );
}
return $cart_item_data;
} | [
"public function saveAction()\n {\n $data = $this->getRequest()->getPost('invoice');\n\n try {\n $invoice = $this->_initInvoice();\n if ($invoice) {\n\t\t\t\t$this->_changeInvoice($invoice);\n\n\t\t\t\t$transactionSave = Mage::getModel('core/resource_transaction');\n\n\t\t\t\tforeach ($invoice->getAllItems() as $item) {\n\t\t\t\t\tif ($item->getQty() == 0) {\n\t\t\t\t\t\t$item->delete();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$transactionSave->addObject($item);\n\t\t\t\t\t\t//$transactionSave->addObject($item->getOrderItem());\n\t\t\t\t\t}\n\t\t\t\t}\n\n $transactionSave->addObject($invoice);\n $transactionSave->addObject($invoice->getOrder());\n $transactionSave->save();\n\n $this->_getSession()->addSuccess($this->__('The invoice has been changed.'));\n\n $this->_redirect('*/sales_invoice/view', array('invoice_id' => $invoice->getId()));\n } else {\n $this->_redirect('*/*/index', array('invoice_id' => $invoice->getId()));\n }\n return;\n } catch (Mage_Core_Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n } catch (Exception $e) {\n $this->_getSession()->addError($this->__('Unable to save the invoice.'));\n Mage::helper('UnzerCw')->logException($e);\n }\n $this->_redirect('*/*/index', array('invoice_id' => $invoice->getId()));\n }",
"function saveInvDetails($invno){\n \t\n \t$invoice = TempInvoiceItem::where('invno',$invno)->get()->toArray();\n\n \tHIS_ARTRN::insert($invoice);\n }",
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"purchase_invoices\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $purchase_invoice = PurchaseInvoices::findFirstByid($id);\n\n if (!$purchase_invoice) {\n $this->flash->error(\"purchase_invoice does not exist \" . $id);\n\n $this->dispatcher->forward([\n 'controller' => \"purchase_invoices\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $purchase_invoice->producerId = $this->request->getPost(\"producer_id\");\n $purchase_invoice->nameSeller = $this->request->getPost(\"name_seller\");\n $purchase_invoice->comment = $this->request->getPost(\"comment\");\n if ($this->session->has('useId'))\n $purchase_invoice->userId = $this->session->get('useId');\n \n\n if (!$purchase_invoice->save()) {\n\n foreach ($purchase_invoice->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"purchase_invoices\",\n 'action' => 'edit',\n 'params' => [$purchase_invoice->id]\n ]);\n\n return;\n }\n\n $this->flash->success(\"purchase_invoice was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"purchase_invoices\",\n 'action' => 'index'\n ]);\n }",
"public function saveAction() {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"invoice\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $TxnID = $this->request->getPost(\"TxnID\");\n $invoice = Invoice::findFirstByTxnID($TxnID);\n\n if (!$invoice) {\n $this->flash->error(\"invoice does not exist \" . $TxnID);\n\n $this->dispatcher->forward([\n 'controller' => \"invoice\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $invoice->setTxnid($this->request->getPost(\"TxnID\"));\n $invoice->setTimecreated($this->request->getPost(\"TimeCreated\"));\n $invoice->setTimemodified($this->request->getPost(\"TimeModified\"));\n $invoice->setEditsequence($this->request->getPost(\"EditSequence\"));\n $invoice->setTxnnumber($this->request->getPost(\"TxnNumber\"));\n $invoice->setCustomerrefListid($this->request->getPost(\"CustomerRef_ListID\"));\n $invoice->setCustomerrefFullname($this->request->getPost(\"CustomerRef_FullName\"));\n $invoice->setClassrefListid($this->request->getPost(\"ClassRef_ListID\"));\n $invoice->setClassrefFullname($this->request->getPost(\"ClassRef_FullName\"));\n $invoice->setAraccountrefListid($this->request->getPost(\"ARAccountRef_ListID\"));\n $invoice->setAraccountrefFullname($this->request->getPost(\"ARAccountRef_FullName\"));\n $invoice->setTemplaterefListid($this->request->getPost(\"TemplateRef_ListID\"));\n $invoice->setTemplaterefFullname($this->request->getPost(\"TemplateRef_FullName\"));\n $invoice->setTxndate($this->request->getPost(\"TxnDate\"));\n $invoice->setRefnumber($this->request->getPost(\"RefNumber\"));\n $invoice->setBilladdressAddr1($this->request->getPost(\"BillAddress_Addr1\"));\n $invoice->setBilladdressAddr2($this->request->getPost(\"BillAddress_Addr2\"));\n $invoice->setBilladdressAddr3($this->request->getPost(\"BillAddress_Addr3\"));\n $invoice->setBilladdressAddr4($this->request->getPost(\"BillAddress_Addr4\"));\n $invoice->setBilladdressAddr5($this->request->getPost(\"BillAddress_Addr5\"));\n $invoice->setBilladdressCity($this->request->getPost(\"BillAddress_City\"));\n $invoice->setBilladdressState($this->request->getPost(\"BillAddress_State\"));\n $invoice->setBilladdressPostalcode($this->request->getPost(\"BillAddress_PostalCode\"));\n $invoice->setBilladdressCountry($this->request->getPost(\"BillAddress_Country\"));\n $invoice->setBilladdressNote($this->request->getPost(\"BillAddress_Note\"));\n $invoice->setShipaddressAddr1($this->request->getPost(\"ShipAddress_Addr1\"));\n $invoice->setShipaddressAddr2($this->request->getPost(\"ShipAddress_Addr2\"));\n $invoice->setShipaddressAddr3($this->request->getPost(\"ShipAddress_Addr3\"));\n $invoice->setShipaddressAddr4($this->request->getPost(\"ShipAddress_Addr4\"));\n $invoice->setShipaddressAddr5($this->request->getPost(\"ShipAddress_Addr5\"));\n $invoice->setShipaddressCity($this->request->getPost(\"ShipAddress_City\"));\n $invoice->setShipaddressState($this->request->getPost(\"ShipAddress_State\"));\n $invoice->setShipaddressPostalcode($this->request->getPost(\"ShipAddress_PostalCode\"));\n $invoice->setShipaddressCountry($this->request->getPost(\"ShipAddress_Country\"));\n $invoice->setShipaddressNote($this->request->getPost(\"ShipAddress_Note\"));\n $invoice->setIspending($this->request->getPost(\"IsPending\"));\n $invoice->setIsfinancecharge($this->request->getPost(\"IsFinanceCharge\"));\n $invoice->setPonumber($this->request->getPost(\"PONumber\"));\n $invoice->setTermsrefListid($this->request->getPost(\"TermsRef_ListID\"));\n $invoice->setTermsrefFullname($this->request->getPost(\"TermsRef_FullName\"));\n $invoice->setDuedate($this->request->getPost(\"DueDate\"));\n $invoice->setSalesreprefListid($this->request->getPost(\"SalesRepRef_ListID\"));\n $invoice->setSalesreprefFullname($this->request->getPost(\"SalesRepRef_FullName\"));\n $invoice->setFob($this->request->getPost(\"FOB\"));\n $invoice->setShipdate($this->request->getPost(\"ShipDate\"));\n $invoice->setShipmethodrefListid($this->request->getPost(\"ShipMethodRef_ListID\"));\n $invoice->setShipmethodrefFullname($this->request->getPost(\"ShipMethodRef_FullName\"));\n $invoice->setSubtotal($this->request->getPost(\"Subtotal\"));\n $invoice->setItemsalestaxrefListid($this->request->getPost(\"ItemSalesTaxRef_ListID\"));\n $invoice->setItemsalestaxrefFullname($this->request->getPost(\"ItemSalesTaxRef_FullName\"));\n $invoice->setSalestaxpercentage($this->request->getPost(\"SalesTaxPercentage\"));\n $invoice->setSalestaxtotal($this->request->getPost(\"SalesTaxTotal\"));\n $invoice->setAppliedamount($this->request->getPost(\"AppliedAmount\"));\n $invoice->setBalanceremaining($this->request->getPost(\"BalanceRemaining\"));\n $invoice->setCurrencyrefListid($this->request->getPost(\"CurrencyRef_ListID\"));\n $invoice->setCurrencyrefFullname($this->request->getPost(\"CurrencyRef_FullName\"));\n $invoice->setExchangerate($this->request->getPost(\"ExchangeRate\"));\n $invoice->setBalanceremaininginhomecurrency($this->request->getPost(\"BalanceRemainingInHomeCurrency\"));\n $invoice->setMemo($this->request->getPost(\"Memo\"));\n $invoice->setIspaid($this->request->getPost(\"IsPaID\"));\n $invoice->setCustomermsgrefListid($this->request->getPost(\"CustomerMsgRef_ListID\"));\n $invoice->setCustomermsgrefFullname($this->request->getPost(\"CustomerMsgRef_FullName\"));\n $invoice->setIstobeprinted($this->request->getPost(\"IsToBePrinted\"));\n $invoice->setIstobeemailed($this->request->getPost(\"IsToBeEmailed\"));\n $invoice->setIstaxincluded($this->request->getPost(\"IsTaxIncluded\"));\n $invoice->setCustomersalestaxcoderefListid($this->request->getPost(\"CustomerSalesTaxCodeRef_ListID\"));\n $invoice->setCustomersalestaxcoderefFullname($this->request->getPost(\"CustomerSalesTaxCodeRef_FullName\"));\n $invoice->setSuggesteddiscountamount($this->request->getPost(\"SuggestedDiscountAmount\"));\n $invoice->setSuggesteddiscountdate($this->request->getPost(\"SuggestedDiscountDate\"));\n $invoice->setOther($this->request->getPost(\"Other\"));\n $invoice->setCustomfield1($this->request->getPost(\"CustomField1\"));\n $invoice->setCustomfield2($this->request->getPost(\"CustomField2\"));\n $invoice->setCustomfield3($this->request->getPost(\"CustomField3\"));\n $invoice->setCustomfield4($this->request->getPost(\"CustomField4\"));\n $invoice->setCustomfield5($this->request->getPost(\"CustomField5\"));\n $invoice->setCustomfield6($this->request->getPost(\"CustomField6\"));\n $invoice->setCustomfield7($this->request->getPost(\"CustomField7\"));\n $invoice->setCustomfield8($this->request->getPost(\"CustomField8\"));\n $invoice->setCustomfield9($this->request->getPost(\"CustomField9\"));\n $invoice->setCustomfield10($this->request->getPost(\"CustomField10\"));\n $invoice->setCustomfield11($this->request->getPost(\"CustomField11\"));\n $invoice->setCustomfield12($this->request->getPost(\"CustomField12\"));\n $invoice->setCustomfield13($this->request->getPost(\"CustomField13\"));\n $invoice->setCustomfield14($this->request->getPost(\"CustomField14\"));\n $invoice->setCustomfield15($this->request->getPost(\"CustomField15\"));\n $invoice->setStatus($this->request->getPost(\"Status\"));\n\n\n if (!$invoice->save()) {\n\n foreach ($invoice->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"invoice\",\n 'action' => 'edit',\n 'params' => [$invoice->getTxnid()]\n ]);\n\n return;\n }\n\n $this->flash->success(\"invoice was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"invoice\",\n 'action' => 'index'\n ]);\n }",
"private function setInvoiceNumber()\n {\n if (isset($this->purchase->invoice_no)) {\n $this->invoiceNumber = $this->purchase->invoice_no;\n } else {\n $this->invoiceNumber = Purchase::count() ? Purchase::latest()->first()->invoice_no + 1 : 1; // take the last invoice number from database and increment by 1\n $this->invoiceNumber = str_pad($this->invoiceNumber, 4, '0', STR_PAD_LEFT); // add prefix if number is to sort\n }\n }",
"public function save(){\n\t\tif($this->_mStatus == PersistDocument::IN_PROGRESS){\n\t\t\t$this->_mVatPercentage = Vat::getInstance()->getPercentage();\n\t\t\t\n\t\t\tif($this->_mCorrelative->getFinalNumber()\n\t\t\t\t\t== $this->_mCorrelative->getCurrentNumber())\n\t\t\t\tthrow new Exception('Se alcanzo el final del correlativo, favor de cambiarlo.');\n\t\t\t\t\t\t\t\n\t\t\t$this->_mNumber = $this->_mCorrelative->getNextNumber();\n\t\t\t\n\t\t\t$this->_mDateTime = date('d/m/Y H:i:s');\n\t\t\t$this->insert();\n\t\t\t$this->_mStatus = PersistDocument::CREATED;\n\t\t\t// Watch out, if any error occurs the database has already been altered!\n\t\t\t$i = 1;\n\t\t\tforeach($this->_mDetails as &$detail)\n\t\t\t\t$detail->save($this, $i++);\n\t\t\tif(!is_null($this->_mDiscount))\n\t\t\t\t$this->_mDiscount->save();\n\t\t\t\t\n\t\t\tInvoiceTransactionLog::write($this->getCorrelative()->getSerialNumber(), $this->getNumber(),\n\t\t\t\t\t$this->getDateTime(), $this->getTotal(), InvoiceTransactionLog::CREATED);\n\t\t\t\t\n\t\t\treturn $this->_mId;\n\t\t}\n\t}",
"function set_invoice_number(){\n if (!isset($this->number)) {\n $this->set('number', $this->get_default_invoice_number());\n }\n }",
"public function saveAction() {\n $dispatcher = new Dispatcher;\n if (!$this->request->isPost()) {\n $dispatcher->forward(array(\n 'namespace' => '\\\\Modules\\\\Invoices\\\\Controllers',\n 'module' => 'invoices',\n 'controller' => 'invoices',\n 'action' => 'browse'\n ));\n\n return false;\n } else {\n $form = new \\Modules\\Invoices\\Forms\\InvoicesForm(null, array());\n //$form = new InvoicesForm;\n $id = $this->request->getPost(\"id\", \"int\");\n $invoice = \\Modules\\Invoices\\Models\\Invoices::findFirstById($id);\n //$invoice = new \\Modules\\Invoices\\Models\\Invoices();\n\n $data = $this->request->getPost();\n\n $form->bind($data, $invoice);\n\n //$form->setData($request->getPost());\n\n if (!$form->isValid($data, $invoice)) {\n foreach ($form->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->response->redirect('invoices/add');\n }\n\n if ($invoice->save() == false) {\n foreach ($invoice->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->response->redirect('invoices/add');\n }\n\n $form->clear();\n\n $this->flash->success(\"Invoice was Saved successfully\");\n\n return $this->response->redirect('/invoices');\n }\n }",
"public function saveInvoiceNumber($id, $jobNumber) {\n\t\t$this->layout = 'ajax';\n\t\t$this->Invoice->id = $id;\n\t\tif($this->Invoice->saveField('job_number', $jobNumber)){\n\t\t\t$jsonReturn = array('response' => TRUE);\n\t\t} else {\n\t\t\t$jsonReturn = array('response' => FALSE);\n\t\t}\n\t\t$this->set('jsonReturn', $jsonReturn);\n\t\t$this->render('/AppAjax/json_response');\n\t}",
"public function saveInvoiceReceipt() {\n\n if ( $this->invoiceIsNew($this->getRecordID()) ) \n {\n $invoice_receipt = $this->makeInvoiceReceiptString(); \n\n try\n {\n $conn = new PDO(\n 'mysql:host='.UtilDB::getDB_Host().';\n dbname='.UtilDB::getDB_Name().'',\n UtilDB::getDB_User(),\n UtilDB::getDB_Pass(), \n array(PDO::ATTR_PERSISTENT => true)\n );\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n \n $sql = \"INSERT INTO acc_invoice_receipt (\n record_id,\n invoice_receipt_id,\n type,\n contents,\n user\n )\n VALUES (\n :record_id,\n :invoice_receipt_id,\n :type,\n :contents,\n :cb_user_name\n );\n \";\n \n $statement = $conn->prepare($sql);\n $statement->bindValue(':record_id', $this->getRecordID(), PDO::PARAM_STR);\n $statement->bindValue(':invoice_receipt_id', $this->getInvoiceID(), PDO::PARAM_STR);\n $statement->bindValue(':type', 'invoice', PDO::PARAM_STR);\n $statement->bindValue(':contents', $invoice_receipt, PDO::PARAM_STR);\n $statement->bindValue(':cb_user_name', $this->getConferenceBuilderUserName(), PDO::PARAM_STR);\n \n $statement->execute();\n }\n catch(Exception $exc)\n {\n IMNLogger::LogError($_SERVER['REQUEST_URI']. ' ['.__CLASS__.'.'.__METHOD__.'('.implode(',', func_get_args()).') : '.__LINE__.']', 'Exception: ' . $exc->getMessage(), array('Stack Trace: ' => $exc->getTrace()) );\n return false;\n }\n } \n }",
"public function generateInvoiceNumber();",
"public function getInvoiceNumber()\n {\n return $this->invoice_number;\n }",
"public function invoiceId()\n {\n $value = '132456';\n $this->identification->setInvoiceid($value);\n\n $this->assertEquals($value, $this->identification->getInvoiceid());\n }",
"public function add_to_invoice() {\n $mockInvoiceId = $this->input->post( 'mockInvoiceId' );\n // Array storing entry id's to do a bulk update with the mock invoice details\n $entryArray = [];\n\n\n // If there is no invoice id then a new invoice needs to be created.\n if ( $mockInvoiceId == '' ) {\n // Store the jobId as an array to pass to the save function\n $data = array(\n 'jobId' => $this->input->post( 'jobId' )\n );\n // Create the new invoice\n $mockInvoiceId = $this->mockinvoice_model->save( $data );\n\n // Store the mockInvoiceId as an array to pass to the save function\n $data = array(\n 'mockInvoiceId' => $mockInvoiceId\n );\n // Create a blank invoice row ready for initial input\n $this->mockinvoice_row_model->save( $data );\n }\n\n // Update all the entries with the mock invoice details\n $this->timesheet_entry_model->set_mock_invoice_details( $mockInvoiceId, array( $this->input->post( 'entries' ) ) );\n\n\n // Return the data that was passed via $_POST, but with the invoice number if a new one was created\n $invoiceArray[] = array( 'mockInvoiceId' => $mockInvoiceId, 'entries' => $this->input->post( 'entries' ), 'jobId' => $this->input->post( 'jobId' ) );\n\n // Send back the POST details as JSON\n $this->json_library->print_array_json_unless_empty( $invoiceArray );\n\n }",
"public function setInvoiceNumber($invoiceNumber);",
"public function save_aparment_number($order_id)\n\t{\n\t\tif (!empty( $_POST['aparment_number'] ) ) {\n update_post_meta( $order_id, 'apartment_number', sanitize_text_field( $_POST['aparment_number'] ));\n \t}\n\t}",
"public function getInvoiceNo()\n {\n return $this->invoice_no;\n }",
"function set_invoice_number($number='')\n\t{\n\t\t$this->invoice_number = $number;\n\t\treturn true;\n\t}",
"public function save_invoice_settings() {\n \n // Save invoice's template\n (new MidrubBaseAdminCollectionAdminHelpers\\Invoices)->save_invoice_settings();\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display header of tester | protected function display_header () {
$title = $this->title;
/**
* HTML presentation
*/
if (!$this->cli) {
@ini_set('output_buffering', 'off');
@ini_set('zlib.output_compression', 'off');
ob_implicit_flush(true);
header('Content-Type: text/html; charset=utf-8');
echo "<!doctype html>\n".
"<title>$title: Test in progress 0%...</title>\n".
"<meta charset=\"utf-8\">\n".
"<style>html, body {font-size: 0; height: 100%; margin: 0; padding: 0; width: 100%;} body > p {background: #B9B9B9; display: inline-block; height: 10%; margin: 0; padding: 0; width: 10%;}</style>\n".
"<script>function update_title_percents(percent) {document.getElementsByTagName('title')[0].innerHTML = \"$title: Test in progress \" + percent + '%...'}</script>".
str_repeat(' ', 1024 * 64);
/**
* CLI presentation
*/
} else {
echo "\e[1m$title\e[21m\n".
str_repeat('-', strlen($title))."\n\n";
echo "\e[1ATest in progress 0%...\n";
}
} | [
"protected function renderHeader()\n {\n echo gdpr('view')->render('installer/header', ['activeSteps' => $this->activeSteps]);\n }",
"function display_header_text() {}",
"function displayHeader()\n\t{\n\t\t// output locator\n\t\t$this->displayLocator();\n\n\t\t// output message\n\t\tif($this->message)\n\t\t{\n\t\t\tilUtil::sendInfo($this->message);\n\t\t}\n\t\tilUtil::infoPanel();\n\n//\t\t$this->tpl->setTitleIcon(ilUtil::getImagePath(\"icon_pd_b.gif\"),\n//\t\t\t\"\");\n\t\t$this->tpl->setTitle($this->lng->txt(\"bookmarks\"));\n\t}",
"public function printHeader();",
"public function showHeader() {\n\t\t$this->_showHeader = true;\n }",
"public function print_header() {\n global $OUTPUT, $PAGE;\n $PAGE->set_heading(format_string($PAGE->course->fullname));\n $this->set_url();\n $this->set_session_url();\n\n $this->create_navbar();\n echo $OUTPUT->header();\n echo $this->wikioutput->content_area_begin();\n\n $this->print_help();\n $this->print_pagetitle();\n $this->setup_tabs();\n // Tabs are associated with pageid, so if page is empty, tabs should be disabled.\n if (!empty($this->page) && !empty($this->tabs)) {\n $tabthing = $this->wikioutput->tabs($this->page, $this->tabs, $this->taboptions); // Calls tabs function in renderer.\n echo $tabthing;\n }\n }",
"public function showheader()\r\n\t{\r\n\t\treturn $this->header;\r\n\t}",
"protected function renderPageHeader() {\n\t\techo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\"\n\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\" dir=\"ltr\">\n\t<head>\n\t\t<base href=\"' . $this->request->getBaseUri() . '\" />\n\t\t<title>TYPO3 Testrunner</title>\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\t\t<style type=\"text/css\">\n\t\t\tbody { font-family:sans-serif; font-size:90%; background-color:#fff; }\n\t\t\ta { color: #000000; }\n\t\t\t#logo { float:right; margin:2ex; }\n\t\t\t#packageselectorbox { clear:both; border-width:1px; border-style:solid none; padding: 1ex 0; }\n\t\t\th1.success { color:green; }\n\t\t\th1.failure { color:red; }\n\t\t\th2.testsuite { font-size:110%; margin:0.4ex; padding-top:0.5ex; }\n\t\t\tdiv.singletest { margin-left:5ex; }\n\t\t\tdiv.incomplete strong { color:grey; }\n\t\t\tdiv.skipped strong { color:grey; }\n\t\t\tdiv.failure strong { color:red; }\n\t\t\tdiv.error strong { color:red; }\n\t\t\tdiv.testsuite { margin-left:0.4em; margin-bottom:1ex; }\n\t\t\tdiv.testsuiteresults { font-size:90%;margin-left:0.4ex; margin-top:0.5ex }\n\t\t\tdiv.test img { cursor:pointer; }\n\t\t\tdiv.testdetail { font-size:90%; border:dashed 1px; padding:1ex; background-color:#eee; }\n\t\t\tdiv.skipped div.testdetail { display:none; }\n\t\t\tdiv.testoutput { font-family:monospace; margin-top:1ex; }\n\t\t</style>\n\t</head>\n\t<body>\n\t\t<img src=\"_Resources/Static/Packages/Testing/Media/f3_logo.gif\" id=\"logo\" />\n\t\t';\n\t}",
"protected function display_header() {\n\t\techo '<h1 class=\"wp-heading-inline\">' . esc_attr( $this->table_header ) . '</h1>';\n\t\tif ( $this->get_request_search_query() ) {\n\t\t\techo '<span class=\"subtitle\">' . esc_attr( $this->translate( sprintf( 'Search results for \"%s\"', $this->get_request_search_query() ) ) ) . '</span>';\n\t\t}\n\t\techo '<hr class=\"wp-header-end\">';\n\t}",
"public function printHeader()\r\n {\r\n foreach($this->headerElemsArray as $elem){\r\n echo(\"$elem\\n\\t\\t\");\r\n }\r\n }",
"private function header()\r\n {\r\n\t\t$todaysDate = $this->todaysDate();\r\n\t\t$actionAlert = $this->actionAlert();\r\n $header = '';\r\n if ($this->_showPersonalHeader) {\r\n\t\t\t$fullName = $this->personsName();\r\n $header = <<< EOT\r\n<div id=\"header\" class=\"personal\">\r\n\t<h1><a href=\"#\" title=\"Home\">A Memory Tree.co.nz - a lifetime of memories</a></h1>\r\n\t<h3>In Memory of</h3>\r\n\t<h2>$fullName</h2>\r\n\t<p class=\"status\">$todaysDate</p>\r\n$actionAlert\r\n</div>\r\n\r\nEOT;\r\n } else {\r\n\t\t\t$totalNames = $this->totalNames();\r\n $header = <<< EOT\r\n<div id=\"header\">\r\n <h1><a href=\"index.php\" title=\"Home\">A Memory Tree.co.nz - a lifetime of memories</a></h1>\r\n <p class=\"status\">$totalNames $todaysDate</p>\r\n$actionAlert\r\n</div>\r\n\r\nEOT;\r\n }\r\n return $header;\r\n }",
"public function print_control_header(){\n ?>\n <div class=\"control-header\">\n <?php $this->print_label(); ?>\n <?php $this->print_description(); ?>\n </div>\n <?php\n }",
"protected function display_question_bank_header() {\n global $OUTPUT;\n echo $OUTPUT->heading(get_string('questionbank', 'question'), 2);\n }",
"public function renderHeader() {\n\t\t$title = $this->pageTitle ? $this->pageTitle : Config::$appTitle;\n\t\tprint \"<title>$title</title>\\n\";\n\t\t$scripts = $this->getScripts();\n\t\tif (isset($scripts['js'])) {\n\t\t\tforeach ($scripts['js'] as $script) {\n\t\t\t\techo \"\\t<script type=\\\"text/javascript\\\" src=\\\"$script\\\"></script>\\n\";\n\t\t\t}\n\t\t}\n\t\tif (isset($scripts['css'])) {\n\t\t\tforeach ($scripts['css'] as $css) {\n\t\t\t\techo \"\\t<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"$css\\\" />\\n\";\n\t\t\t}\n\t\t}\n\t}",
"public function render_page_header() {\n\t\t?>\n\t\t<h2><?php esc_html_e( 'Import Block Lab Content Blocks', 'block-lab' ); ?></h2>\n\t\t<?php\n\t}",
"function paintHeader($test_name) {\n\t\t$this->sendNoCacheHeaders();\n\t\tprint \"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\">\\n\";\n\t\tprint \"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\">\\n\";\n\t\tprint \"<head>\\n\";\n\t\tprint \"<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=\" . $this->_character_set . \"\\\" />\\n\";\n\t\tprint \"<title>CakePHP Test Suite v 1.0.0.0 :: $test_name</title>\\n\";\n\t\tprint \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"/css/cake.default.css\\\" />\\n\";\n\t\tprint \"<style type=\\\"text/css\\\">\\n\";\n\t\tprint $this->_getCss() . \"\\n\";\n\t\tprint \"</style>\\n\";\n\t\tprint \"</head>\\n<body>\\n\";\n\t\tprint \"<div id=\\\"wrapper\\\">\\n\";\n\t\tprint \"<div id=\\\"header\\\">\\n\";\n\t\tprint \"<img src=\\\"/img/cake.logo.png\\\" alt=\\\"\\\" /></div>\\n\";\n\t\tprint \"<div id=\\\"content\\\">\\n\";\n\t\tprint \"<h1>CakePHP Test Suite v 1.0.0.0</h1>\\n\";\n\t\tprint \"<h2>$test_name</h2>\\n\";\n\t\tflush();\n\t}",
"public function showTestHeadline($title)\n {\n print \"*** \" . $title . \"\\n\";\n }",
"function _output_header()\n\t\t{\n\t\t $this->console->output(\"<h2>Debuging console</h2>\");\n\t\t}",
"function print_header() {\n parent::print_header();\n $this->print_pagetitle();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check_php_timelimit check_safe_mode Checks to make sure we aren't in safe mode | function check_safemode() {
if (ini_get('safe_mode')) {
return false;
}
return true;
} | [
"private static function _checkSafeMode() {\n\t\treturn (bool) ini_get('safe_mode');\n\t}",
"private function isSettimelimitAvailable() {\n\t\tif (function_exists('set_time_limit')\n\t\t\t&& strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"protected function checkMaxExecutionTime() {}",
"private static function q103()\n\t{\n\t\t$exectime = ini_get('max_execution_time');\n\t\t$safemode = ini_get('safe_mode');\n\t\tif(!$safemode) return false;\n\t\tif(!is_numeric($exectime)) return false;\n\t\tif($exectime <= 0) return false;\n\t\treturn $exectime < 10;\n\t}",
"function check_putenv() { \n\n\t/* Check memory */\n\t$current = ini_get('memory_limit');\n\t$current = substr($current_memory,0,strlen($current_memory)-1);\n\t$new_limit = ($current+16) . \"M\";\n\t\n\t/* Bump it by 16 megs (for getid3)*/\n\tif (!ini_set(memory_limit,$new_limit)) { \n\t\treturn false; \n\t}\n\n\t// Make sure it actually worked\n\t$current = ini_get('memory_limit'); \n\n\tif ($new_limit != $current) { \n\t\treturn false; \n\t} \n\t\n\t/* Check if safe mode is on */\n\tif (ini_get('safe_mode')) { \n\t\treturn false; \n\t}\n\n\t// See if we can override the set_time_limit(); \n\n\n\treturn true;\n\n}",
"protected static function check_safe_mode()\n\t{\n\t\tif (Input::get('safe_mode') == '0')\n\t\t{\n\t\t\tSession::forget('safe_mode');\n\t\t\treturn static::$safe_mode = false;\n\t\t}\n\n\t\t$session = Session::get('safe_mode', function ()\n\t\t{\n\t\t\tif (Input::get('safe_mode') != '1') return 'N';\n\t\t\t\n\t\t\tSession::put('safe_mode', 'Y');\n\t\t\treturn 'Y';\n\t\t});\n\n\t\treturn static::$safe_mode = ($session === 'Y');\n\t}",
"function isSafeMode()\n{\n\t$retval = true;\n\tif (function_exists('ini_get'))\n\t{\n\t\tif (ini_get('safe_mode')==true)\n\t\t{\n\t\t\t$retval = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$retval = false;\n\t\t}\n\t}\n\telse\n\t{\n\t\t$retval = true;\n\t}\n\n\treturn $retval;\n}",
"function increase_time_limit_to($timeLimit = null) {\n\tif(!ini_get('safe_mode')) {\n\t\tif(!$timeLimit) {\n\t\t\tset_time_limit(0);\n\t\t} else {\n\t\t\t$currTimeLimit = ini_get('max_execution_time');\n\t\t\tif($currTimeLimit && $currTimeLimit < $timeLimit) {\n\t\t\t\tset_time_limit($timeLimit);\n\t\t\t}\n\t\t}\n\t}\n}",
"protected function _checkIfTimeout():void\r\n\t\t{\r\n\t\t\tif(!count($this->_lockAcquisitionOrder))\r\n\t\t\t{\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t$processExecutionSeconds = max(0, time() - $_SERVER[\"REQUEST_TIME\"]);\r\n\r\n\t\t\t$maxWaitTimeout = $this->_MySQLMaxWaitTimeout + $this->_lockToAgeSeconds[$this->_lockAcquisitionOrder[0]];\r\n\r\n\t\t\tif(($processExecutionSeconds - $this->_lockToAgeSeconds[$this->_lockAcquisitionOrder[0]]) >= 172800) // 48 hours\r\n\t\t\t{\r\n\t\t\t\t$maxWaitTimeout -= 3600; // 1 hour\r\n\t\t\t}\r\n\r\n\t\t\tif(($maxWaitTimeout - $processExecutionSeconds) <= 0)\r\n\t\t\t{\r\n\t\t\t\texit($this->_lockAcquisitionOrder[0].\" was being held for longer than maximum wait_timeout.\".PHP_EOL);\r\n\t\t\t}\r\n\t\t}",
"function safeMode($check, $query = ''){\r\n\r\n\tif(!$check || !CONF_BACKEND_SAFEMODE)return false;\r\n\r\n\tMessage::raiseMessageRedirectSQ(MSG_ERROR, $query, translate(\"msg_safemode_warning\"));\r\n}",
"private function setScriptTimeLimit() :bool\n {\n $limit = $this->postAmount + $this->ratingsAmount * $this->ratingForOnePostLimit;\n\n // fix mistake when script time is too short\n return set_time_limit($limit < 10 ? 10 : $limit);\n }",
"function nearTimeLimit() {\n\t\t# returns TRUE if we are too near time's up\n\t\tif (scriptTime() > CONS_TIMEWARNING) {\n\t\t\t$this->errorControl->raise(167,$this->context_str.\"/\".$this->action,'',scriptTime());\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function check_override_exec_time() {\n\t$current = ini_get('max_execution_time');\n\tset_time_limit($current+60);\n\n\tif ($current == ini_get('max_execution_time')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"public function checkSafeMode(): bool\n {\n $safeMode = Config::get('cms.safe_mode', null);\n\n if ($safeMode === null) {\n $safeMode = !Config::get('app.debug', false);\n }\n\n return $safeMode;\n }",
"function check_timeout() {\n\tglobal $settings;\n\tglobal $cresults;\n\n\t$current = microtime(TRUE);\n\t$elapsed = $current - $cresults['last_write'];\n\n\tif ($elapsed > $settings['poll']) {\n\t\t$cresults['last_write'] = $current;\n if ($settings['use_collector']) {\n\t\t\treport_to_collector();\n\t\t}\n\t\treset_cresults();\n\t}\n\n\tif ($elapsed > $settings['reconnect'] && $settings['persistent'] == FALSE) {\n\t\tmc_disconnect();\n\t\tmc_connect();\n\t}\n\n\n\tif ($settings['runtime'] != NULL) {\n\t\t$current_time = microtime(TRUE) - $cresults['start_time'];\n\t\tif ($current_time >= $settings['runtime']) {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\n\tif ($settings['operations'] != NULL) {\n\t\tif ($cresults['total_operations'] >= $settings['operations']) {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}\n}",
"protected function requiresSafeModeHack()\n\t{\n\t\tinclude 'safe-mode-hack.php';\n\t\t$smh = new SafeModeHack;\n\n\t\tif ($smh->isEnabled()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$smh->canCreateFolder()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$smh->canCreateFile()) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function isSafeMode()\n {\n return (bool) $this->safeMode;\n }",
"function nearing_execution_limit() {\n\t\t// Max execution time is 0 or -1 (infinite) in server config\n\t\tif ( 0 === $this->max_execution_time || - 1 === $this->max_execution_time ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$built_in_delay = 2;\n\t\t$execution_time = ( microtime( true ) - $this->start_execution_timer + $built_in_delay );\n\n\t\tif ( $execution_time >= $this->max_execution_time ) {\n\t\t\treturn $execution_time;\n\t\t}\n\n\t\treturn false;\n\t}",
"function set_time_limit(int $seconds): void\n{\n error_clear_last();\n $safeResult = \\set_time_limit($seconds);\n if ($safeResult === false) {\n throw InfoException::createFromPhpError();\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function tells if the user is in Design mode with Drag and Drop support it was moved from the template library so it can be referenced by ajax calls | public function isInDnDMode()
{
$aUrl = Phpfox::getLib('url')->getParams();
$bIsCustomize = !isset($aUrl['req3']) || ($aUrl['req3'] != 'customize' && isset($aUrl['req2']) && $aUrl['req2'] == 'index-member');
$bIsMusic = !isset($aUrl['req3']) || $aUrl['req1'] == 'music';
if (Phpfox::getUserParam('core.can_design_dnd')
&& Phpfox::getCookie('doDnD') == 1
// && ($bIsCustomize || $bIsMusic)
&& (!isset($aUrl['req2']) || $aUrl['req2'] != 'designer'))
{
return true;
}
return false;
} | [
"public function isDropTarget() {}",
"function is_design_editor() {\r\n\t\t$page_id = lumise_get_page_id( 'editor' );\r\n\r\n\t\treturn ( $page_id && is_page( $page_id ) );\r\n\t}",
"public function isDraggable() {\n\t\treturn isset($this->attributes['draggable'])?$this->attributes['draggable']:null;\n\t}",
"public function isDeveloperMode()\n {\n return $this->helper->getIsDeveloperMode();\n }",
"public function use_popup_design() {\n\t\treturn isset($this->options['use_popup_design'])?(bool)$this->options['use_popup_design']: false;\n\t}",
"function tve_ult_is_preview_page() {\n\tglobal $design;\n\n\treturn tve_ult_is_editable( get_the_ID() ) && ! empty( $design );\n}",
"protected function isPreview() {\n return !$this->helper->isDelegating();\n }",
"public function isUseInPreview() {\r\n\t\treturn $this->getUseInPreview();\r\n\t}",
"public function isDevMode();",
"public function isDeveloperMode()\n {\n return $this->getData('developer_mode');\n }",
"public static function is_display() {\n\t\t\n\t\tif ( self::is_visual_editor() )\n\t\t\treturn false;\n\t\t\t\n\t\tif ( self::is_trigger() )\n\t\t\treturn false;\n\t\t\t\n\t\tif ( is_admin() )\n\t\t\treturn false;\n\t\t\t\n\t\treturn true;\n\t\t\n\t}",
"private function isViewMode()\n {\n return $this->currentValidationMode === Structure::FILE_TYPE_VIEW;\n }",
"public function isAutoSyncDesignsAndProductsEnabled()\n {\n return Mage::getStoreConfigFlag(self::SYNC_DESIGNS_AND_PRODUCTS_ENABLED_XML_PATH);\n }",
"public function isInDeveloperMode()\r\n\t{\r\n\t\treturn !(empty($this->settings->developer_mode) && !isset($_COOKIE['wpgmza-developer-mode']));\r\n\t}",
"function fusion_is_preview_frame() {\n\tif ( class_exists( 'Fusion_App' ) ) {\n\t\t$fusion_app = Fusion_App::get_instance();\n\t\treturn $fusion_app->get_preview_status();\n\t}\n\treturn false;\n}",
"public function popup_editor_needs_template_options()\n\t\t{\n\t\t\tif( ( isset( $_REQUEST['edit_element'] ) && ( 'true' === $_REQUEST['edit_element'] ) ) )\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif( isset( $_REQUEST['post_type'] ) && ( Avia_Element_Templates()->get_post_type() == $_REQUEST['post_type'] ) )\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}",
"function df_is_customizing() {\n \t$preview = new Dahz_Customizer_Options();\n \treturn $preview->isCustomizerPreview();\n }",
"public function isDebugMode();",
"public function getIsDeveloperMode()\n {\n return Mage::getIsDeveloperMode();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A convenience method for creating GRIP hold stream instructions for HTTP streaming. This method simply passes the specified parameters to the create_hold method with 'stream' as the hold mode. | public static function create_hold_stream($channels, $response = null)
{
return self::create_hold('stream', $channels, $response);
} | [
"protected function _createStream()\n {\n $this->stream = new Stream($this->_streamTarget, $this->_streamMode);\n }",
"public function placeHold($holdDetails)\n {\n $patron = $holdDetails['patron'];\n $type = $holdDetails['holdtype'];\n $pickUpLocation = !empty($holdDetails['pickUpLocation'])\n ? $holdDetails['pickUpLocation'] : $this->defaultPickUpLocation;\n $itemId = $holdDetails['item_id'];\n $comment = $holdDetails['comment'];\n $bibId = $holdDetails['id'];\n\n // Request was initiated before patron was logged in -\n // Let's determine Hold Type now\n if ($type == \"auto\") {\n $type = $this->determineHoldType($bibId, $itemId, $patron['id']);\n if (!$type || $type == \"block\") {\n return $this->holdError(\"hold_error_blocked\");\n }\n }\n\n // Convert last interest date from Display Format to Voyager required format\n $lastInterestDate = $this->dateFormat->convertFromDisplayDate(\n \"Y-m-d\", $holdDetails['requiredBy']\n );\n if (PEAR::isError($lastInterestDate)) {\n // Hold Date is invalid\n return $this->holdError(\"hold_date_invalid\");\n }\n\n $checkTime = $this->dateFormat->convertFromDisplayDate(\n \"U\", $holdDetails['requiredBy']\n );\n if (PEAR::isError($checkTime) || !is_numeric($checkTime)) {\n return $checkTime;\n }\n\n if (time() > $checkTime) {\n // Hold Date is in the past\n return $this->holdError(\"hold_date_past\");\n }\n\n // Make Sure Pick Up Library is Valid\n $pickUpValid = false;\n $pickUpLibs = $this->getPickUpLocations($patron, $holdDetails);\n foreach ($pickUpLibs as $location) {\n if ($location['locationID'] == $pickUpLocation) {\n $pickUpValid = true;\n }\n }\n if (!$pickUpValid) {\n // Invalid Pick Up Point\n return $this->holdError(\"hold_invalid_pickup\");\n }\n\n // Build Request Data\n $requestData = array(\n 'pickupLocation' => $pickUpLocation,\n 'lastInterestDate' => $lastInterestDate,\n 'comment' => $comment\n );\n\n if ($this->checkItemRequests($bibId, $patron['id'], $type, $itemId)) {\n // Attempt Request\n $result = $this->makeItemRequests(\n $bibId, $patron['id'], $type, $requestData, $itemId\n );\n if ($result) {\n return $result;\n }\n }\n return $this->holdError(\"hold_error_blocked\");\n }",
"public function CreateTagHold(\\Google\\Cloud\\ResourceManager\\V3\\CreateTagHoldRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagHolds/CreateTagHold',\n $argument,\n ['\\Google\\LongRunning\\Operation', 'decode'],\n $metadata, $options);\n }",
"abstract protected function createStream();",
"function http_send_stream($stream)\n {\n }",
"public function create(Stream $stream, string|null $profile = null, array $options = []): Lock;",
"function http_send_stream ($stream) {}",
"abstract protected function newStream(): \\Psr\\Http\\Message\\StreamInterface;",
"public function placeHold($holdDetails)\n {\n $patron = $holdDetails['patron'];\n $level = isset($holdDetails['level']) && !empty($holdDetails['level'])\n ? $holdDetails['level'] : 'copy';\n $pickUpLocation = !empty($holdDetails['pickUpLocation'])\n ? $holdDetails['pickUpLocation'] : $this->defaultPickUpLocation;\n $itemId = $holdDetails['item_id'] ?? false;\n $comment = $holdDetails['comment'] ?? '';\n $bibId = $holdDetails['id'];\n\t\t\n // Convert last interest date from Display Format to Sierra's required format\n try {\n $lastInterestDate = $this->dateConverter->convertFromDisplayDate(\n 'Y-m-d', $holdDetails['requiredBy']\n );\n } catch (DateException $e) {\n // Hold Date is invalid\n return $this->holdError('hold_date_invalid');\n }\n\n if ($level == 'copy' && empty($itemId)) {\n throw new ILSException(\"Hold level is 'copy', but item ID is empty\");\n }\n\n try {\n $checkTime = $this->dateConverter->convertFromDisplayDate(\n 'U', $holdDetails['requiredBy']\n );\n if (!is_numeric($checkTime)) {\n throw new DateException('Result should be numeric');\n }\n } catch (DateException $e) {\n throw new ILSException('Problem parsing required by date.');\n }\n\n if (time() > $checkTime) {\n // Hold Date is in the past\n return $this->holdError('hold_date_past');\n }\n\t\t\n // Make sure pickup location is valid\n if (!$this->pickUpLocationIsValid($pickUpLocation, $patron, $holdDetails)) {\n return $this->holdError('hold_invalid_pickup');\n }\n\n $request = [\n 'recordType' => $level == 'copy' ? 'i' : 'b',\n 'recordNumber' => (int)($level == 'copy' ? $itemId : $bibId),\n 'pickupLocation' => $pickUpLocation,\n 'neededBy' => $lastInterestDate\n ];\n if ($comment) {\n $request['note'] = $comment;\n }\n\n $result = $this->makeRequest(\n [$comment ? 'v4' : 'v3', 'patrons', $patron['id'], 'holds', 'requests'],\n json_encode($request),\n 'POST'\n );\n\n if (!empty($result['code'])) {\n return $this->holdError($result['description']);\n }\n return ['success' => true];\n }",
"function stream_context_create (array $options = null, array $params = null) {}",
"private function bindStream(): void {\n $this->bindResponse = $this->youtube->liveBroadcasts->bind(\n $this->response[\"id\"],\n \"id,contentDetails\",\n [\"streamId\" => $this->streamResponse[\"id\"]]\n );\n }",
"private function create_img_stream()\n {\n $this->img = imagecreate(L_IMG_WIDTH,L_IMG_HEIGHT);\n }",
"public function placeHold($holdDetails)\n {\n $item = $holdDetails['item_id'];\n $items = array();\n $items[] = array('item' => stripslashes($item));\n $patron = $holdDetails['patron'];\n $post_data = array(\"doc\" => $items);\n $array_response = $this->_postAsArray('/paia/core/'.$patron['cat_username'].'/request', $post_data);\n $details = array();\n\n if (array_key_exists('error', $array_response)) {\n $details = array('success' => false, 'sysMessage' => $array_response['error_description']);\n }\n else {\n $elements = $array_response['doc'];\n foreach ($elements as $element) {\n if (array_key_exists('error', $element)) {\n $details = array('success' => false, 'sysMessage' => $element['error']);\n }\n else {\n $details = array('success' => true, 'sysMessage' => 'Successfully requested');\n }\n }\n }\n $returnArray = $details;\n return $returnArray;\n }",
"public function setStream($var)\n {\n GPBUtil::checkBool($var);\n $this->stream = $var;\n\n return $this;\n }",
"public static function DROP_STREAM()\n {\n return new StreamConditionsMode(self::DROP_STREAM);\n }",
"public function microsoftGraphSecurityApplyHold(): MicrosoftGraphSecurityApplyHoldRequestBuilder {\n return new MicrosoftGraphSecurityApplyHoldRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function addWriteStream($stream, $task);",
"private function createStream(\n puzzle_message_RequestInterface $request,\n &$http_response_header\n ) {\n static $methods;\n if (!$methods) {\n $methods = array_flip(get_class_methods(__CLASS__));\n }\n\n $params = array();\n $options = $this->getDefaultOptions($request);\n foreach ($request->getConfig()->toArray() as $key => $value) {\n $method = \"add_{$key}\";\n if (isset($methods[$method])) {\n $this->{$method}($request, $options, $value, $params);\n }\n }\n\n $this->applyCustomOptions($request, $options);\n $context = $this->createStreamContext($request, $options, $params);\n\n return $this->createStreamResource(\n $request,\n $options,\n $context,\n $http_response_header\n );\n }",
"public function setStream($stream);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve information for a pet id | function petGet()
{
//Create URL string
$urlString = $this->_urlString();
$url = 'pet.get?'.$urlString;
$xmlResponse = $this->_curl($url);
//Create SimpleXML
$xml = $this->XMLParser->parse($xmlResponse);;
//Assign element to array
$data = array(
'code' => (string)$xml->header->status->code,
'id' => (string)$xml->pet->id,
'animal' => (string)$xml->pet->animal,
'breeds' => (string)$xml->pet->breeds->breed,
'mix' => (string)$xml->pet->mix,
'age' => (string)$xml->pet->age,
'name' => (string)$xml->pet->name,
'shelterId' => (string)$xml->pet->shelterId,
'size' => (string)$xml->pet->size,
'sex' => (string)$xml->pet->sex,
'description' => (string)$xml->pet->description,
'lastUpdate' => (string)$xml->pet->lastUpdate,
'status' => (string)$xml->pet->status,
);
$i=0;
if ( isset($xml->pet) ) {
foreach ( $xml->pet->media->photos->photo as $photo) {
$i = (string)$photo['id'];
switch((string)$photo['size'])
{
case 'x':
$data['photo'][$i]["x"] = (string)$photo;
break;
case 't':
$data['photo'][$i]['t'] = (string)$photo;
break;
case 'pn':
$data['photo'][$i]['pn'] = (string)$photo;
break;
case 'pnt':
$data['photo'][$i]['pnt'] = (string)$photo;
break;
case 'fpm':
$data['photo'][$i]['fpm'] = (string)$photo;
break;
}
$i++;
}
}
$data['xml'] = $xmlResponse;
return $data;
} | [
"public static function single($pet_id)\n\t{\n\t\tif (trim($pet_id) == '')\n\t\t{\n\t\t\tthrow new Kohana_Exception('Please specify a Petfinder ID');\n\t\t}\n\n\t\t$response = Petfinder::connect('pet.get', '&id='.$pet_id);\n\n\t\t$pet_details = Petfinder::pet_vars($response['pet']);\n\n\t\treturn $pet_details;\n\t}",
"public function showPetById($petId, &$responseCode, array &$responseHeaders);",
"public function getPetById($petId, &$responseCode, array &$responseHeaders);",
"public function get_id_pet()\n {\n return $this->_id_pet;\n }",
"public function getPetId()\r\n\t{\r\n\t\treturn $this->_PetId;\r\n\t}",
"public function showPetById($petId)\n {\n $input = Request::all();\n\n //path params validation\n\n\n //not path params validation\n\n return response('How about implementing showPetById as a get method ?');\n }",
"public function getPetInfoQuery($p_pet_id){\n $stmt = $this->adapter->conn->prepare(\n \"SELECT * \".\n \"FROM PET \".\n \"WHERE pet_id = ?;\");\n $stmt->bindParam(1,$p_pet_id);\n\n $result = null;\n try{\n $result = $this->adapter->executeFetchPrepared($stmt);\n }catch(PDOException $e){\n return null;\n }\n \n return $result;\n }",
"public function show($petID)\n\t{\n\t\t$pet = DB::table('pets')->where('petID', $petID)->first();\n\t\treturn Response::json($pet);\n\t}",
"public function getPetById($petId) {\n\n \t\t//parse inputs\n \t\t$resourcePath = \"/pet.{format}/{petId}\";\n \t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n \t\t$method = \"GET\";\n $queryParams = array();\n $headerParams = array();\n\n if($petId != null) {\n \t\t\t$resourcePath = str_replace(\"{\" . \"petId\" . \"}\",\n \t\t\t $petId, $resourcePath);\n \t\t}\n \t\t//make the API Call\n if (! isset($body)) {\n $body = null;\n }\n \t\t$response = $this->apiClient->callAPI($resourcePath, $method,\n \t\t $queryParams, $body,\n \t\t $headerParams);\n\n\n if(! $response){\n return null;\n }\n\n \t\t$responseObject = $this->apiClient->deserialize($response,\n \t\t 'Pet');\n \t\treturn $responseObject;\n\n }",
"public function testGetPetById()\n {\n $client = static::createClient();\n\n $path = '/pet/{petId}';\n $pattern = '{petId}';\n $data = $this->genTestData('\\d+');\n $path = str_replace($pattern, $data, $path);\n\n $crawler = $client->request('GET', $path);\n }",
"public function getPetById($pet_id)\n {\n if (!$pet_id) {\n return response()->json(new ApiResponse(['code' => 400, 'message' => 'invalid ID supplied', 'type' => '']));\n }\n\n if (!Pet::where('id', $pet_id)->exists()) {\n return response()->json(new ApiResponse(['code' => 404, 'message' => 'pet not found', 'type' => '']));\n }\n\n $pet = Pet::where('id', $pet_id)->first();\n\n\n return response()->json($pet);\n }",
"public function getAllInterestInfo($p_pet_id){\n $stmt = $this->adapter->conn->prepare(\n \"SELECT * \".\n \"FROM INTERESTS \".\n \"WHERE pet_id=?;\");\n $stmt->bindParam(1,$p_pet_id); \n $result = null;\n\n try{\n $result = $this->adapter->executeFetchPrepared($stmt);\n }catch(PDOException $e){\n return null;\n }\n \n return $result; \n }",
"public function getPet(): Pet\n {\n return $this->pet;\n }",
"public function getAllPictureInfo($p_pet_id){\n $stmt = $this->adapter->conn->prepare(\n \"SELECT * \".\n \"FROM PICTURES \".\n \"WHERE pet_id=?;\");\n $stmt->bindParam(1,$p_pet_id);\n $result = null;\n try{\n $result = $this->adapter->executeFetchPrepared($stmt);\n }catch(PDOException $e){\n return null;\n }\n \n return $result; \n }",
"public function getPetFeeding($id)\n {\n return $this->petFeedingRepository->find($id);\n }",
"public function getPetInfoPref()\n {\n return $this->petInfoPref;\n }",
"public function readAction() {\n $this->response\n ->setHeader('Access-Control-Allow-Origin', '*')\n ->setHeader('Access-Control-Allow-Headers', 'X-Requested-With') \n ->sendHeaders();\n $id = $this->request->get('id');\n try {\n $db = DbConnection::getConnection();\n $Pet = new Pet($db);\n $pet = $Pet->readOnePet($id);\n if (!$pet) {\n return $this->response->setStatusCode(404, 'Not Found');\n } \n $time = date('Y-m-d');\n //add pet ability per day\n if ($pet['last_grow'] !== $time) {\n $db->beginTransaction();\n $code = $Pet->updatePetAbility($id, $time, 'last_grow');\n $db->commit();\n switch ($code) {\n case 0:\n $pet['attack'] += 1;\n break;\n case 1:\n $pet['defend'] += 1;\n break;\n case 2:\n $pet['health'] += 1;\n break;\n case 3:\n $pet['swift'] += 1;\n break;\n case 4:\n $pet['lucky'] += 1;\n break;\n }\n }\n $Moment = new Moment($db);\n $moments = $Moment->readPetMoments($id, 0);\n $Watch = new Watch($db);\n $watchs = $Watch->readPetWatchs($id);\n $User = new User($db);\n if (isset($pet['relative_id'])) {\n //if pet has relative\n $family = $User->readPetFamily($pet['owner_id'], $pet['relative_id']);\n $friends = $Pet->readPetFriends($pet['owner_id'], $pet['relative_id'], $id);\n } else {\n //if pet do not have relative\n $family = $User->readUserName($pet['owner_id']);\n $friends = $Pet->readUserPets($pet['owner_id'], $id);\n $family = [$family];\n }\n return json_encode([$pet, $family, $friends, $moments, $watchs, Skills::$all]);\n } catch (Exception $e) {\n return $this->response->setStatusCode(500, 'Internal Server Error');\n }\n }",
"public function pet()\n {\n return $this->belongsTo(Pet::class, 'pet_id', 'id');\n }",
"public function getDrugWithId()\n {\n $id = $this->verifyDataRequest('id');\n $dal = new DrugModal();\n echo $dal->getDrugWithId($id);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Data provider for navigationArray | public function navigationArrayDataProvider() {
$oneMonthKeepOne = array(
'monthsBefore' => 0,
'monthsAfter' => 0,
'scrollMode' => -1,
'timeRestriction' => '2010-1-1',
'timeRestrictionHigh' => '2020-1-1');
$oneMonthScrollAll = array(
'monthsBefore' => 0,
'monthsAfter' => 0,
'scrollMode' => 0,
'timeRestriction' => '2010-1-1',
'timeRestrictionHigh' => '2020-1-1');
$oneMonthScrollOne = array(
'monthsBefore' => 0,
'monthsAfter' => 0,
'scrollMode' => 1,
'timeRestriction' => '2010-1-1',
'timeRestrictionHigh' => '2020-1-1');
$threeMonthsKeepOne = array(
'monthsBefore' => 1,
'monthsAfter' => 1,
'scrollMode' => -1,
'timeRestriction' => '2010-1-1',
'timeRestrictionHigh' => '2020-1-1');
$threeMonthsScrollAll = array(
'monthsBefore' => 1,
'monthsAfter' => 1,
'scrollMode' => 0,
'timeRestriction' => '2010-1-1',
'timeRestrictionHigh' => '2020-1-1');
$threeMonthsScrollOne = array(
'monthsBefore' => 1,
'monthsAfter' => 1,
'scrollMode' => 1,
'timeRestriction' => '2010-1-1',
'timeRestrictionHigh' => '2020-1-1');
return array(
'oneMonthKeepOneJan' => array(1, 2015, $oneMonthKeepOne, array(
'prev' => array('month' => 12, 'year' => 2014),
'next' => array('month' => 2, 'year' => 2015),
'numberOfMonths' => 1,
'uid' => 0)),
'oneMonthKeepOneDec' => array(12, 2015, $oneMonthKeepOne, array(
'prev' => array('month' => 11, 'year' => 2015),
'next' => array('month' => 1, 'year' => 2016),
'numberOfMonths' => 1,
'uid' => 0)),
'oneMonthKeepOneMar' => array(3, 2015, $oneMonthKeepOne, array(
'prev' => array('month' => 2, 'year' => 2015),
'next' => array('month' => 4, 'year' => 2015),
'numberOfMonths' => 1,
'uid' => 0)),
'oneMonthScrollAllJan' => array(1, 2015, $oneMonthScrollAll, array(
'prev' => array('month' => 12, 'year' => 2014),
'next' => array('month' => 2, 'year' => 2015),
'numberOfMonths' => 1,
'uid' => 0)),
'oneMonthScrollAllDec' => array(12, 2015, $oneMonthScrollAll, array(
'prev' => array('month' => 11, 'year' => 2015),
'next' => array('month' => 1, 'year' => 2016),
'numberOfMonths' => 1,
'uid' => 0)),
'oneMonthScrollAllMar' => array(3, 2015, $oneMonthScrollAll, array(
'prev' => array('month' => 2, 'year' => 2015),
'next' => array('month' => 4, 'year' => 2015),
'numberOfMonths' => 1,
'uid' => 0)),
'oneMonthScrollOneJan' => array(1, 2015, $oneMonthScrollOne, array(
'prev' => array('month' => 12, 'year' => 2014),
'next' => array('month' => 2, 'year' => 2015),
'numberOfMonths' => 1,
'uid' => 0)),
'oneMonthScrollOneDec' => array(12, 2015, $oneMonthScrollOne, array(
'prev' => array('month' => 11, 'year' => 2015),
'next' => array('month' => 1, 'year' => 2016),
'numberOfMonths' => 1,
'uid' => 0)),
'oneMonthScrollOneMar' => array(3, 2015, $oneMonthScrollOne, array(
'prev' => array('month' => 2, 'year' => 2015),
'next' => array('month' => 4, 'year' => 2015),
'numberOfMonths' => 1,
'uid' => 0)),
'threeMonthsKeepOneJan' => array(1, 2015, $threeMonthsKeepOne, array(
'prev' => array('month' => 11, 'year' => 2014),
'next' => array('month' => 3, 'year' => 2015),
'numberOfMonths' => 3,
'uid' => 0)),
'threeMonthsKeepOneDec' => array(12, 2015, $threeMonthsKeepOne, array(
'prev' => array('month' => 10, 'year' => 2015),
'next' => array('month' => 2, 'year' => 2016),
'numberOfMonths' => 3,
'uid' => 0)),
'threeMonthsKeepOneMar' => array(3, 2015, $threeMonthsKeepOne, array(
'prev' => array('month' => 1, 'year' => 2015),
'next' => array('month' => 5, 'year' => 2015),
'numberOfMonths' => 3,
'uid' => 0)),
'threeMonthsScrollAllJan' => array(1, 2015, $threeMonthsScrollAll, array(
'prev' => array('month' => 10, 'year' => 2014),
'next' => array('month' => 4, 'year' => 2015),
'numberOfMonths' => 3,
'uid' => 0)),
'threeMonthsScrollAllDec' => array(12, 2015, $threeMonthsScrollAll, array(
'prev' => array('month' => 9, 'year' => 2015),
'next' => array('month' => 3, 'year' => 2016),
'numberOfMonths' => 3,
'uid' => 0)),
'threeMonthsScrollAllMar' => array(3, 2015, $threeMonthsScrollAll, array(
'prev' => array('month' => 12, 'year' => 2014),
'next' => array('month' => 6, 'year' => 2015),
'numberOfMonths' => 3,
'uid' => 0)),
'threeMonthsScrollOneJan' => array(1, 2015, $threeMonthsScrollOne, array(
'prev' => array('month' => 12, 'year' => 2014),
'next' => array('month' => 2, 'year' => 2015),
'numberOfMonths' => 3,
'uid' => 0)),
'threeMonthsScrollOneDec' => array(12, 2015, $threeMonthsScrollOne, array(
'prev' => array('month' => 11, 'year' => 2015),
'next' => array('month' => 1, 'year' => 2016),
'numberOfMonths' => 3,
'uid' => 0)),
'threeMonthsScrollOneMar' => array(3, 2015, $threeMonthsScrollOne, array(
'prev' => array('month' => 2, 'year' => 2015),
'next' => array('month' => 4, 'year' => 2015),
'numberOfMonths' => 3,
'uid' => 0)),
'oneMonthNoPrev' => array(1, 2010, $oneMonthScrollOne, array(
'prev' => NULL,
'next' => array('month' => 2, 'year' => 2010),
'numberOfMonths' => 1,
'uid' => 0)),
'oneMonthNoNext' => array(1, 2020, $oneMonthScrollOne, array(
'prev' => array('month' => 12, 'year' => 2019),
'next' => NULL,
'numberOfMonths' => 1,
'uid' => 0)),
);
} | [
"public function getNavigationArray()\n {\n return $this->navigation;\n }",
"public function navigationProperties(): array;",
"function navigationArray () {\n \t\treturn\tfilterclass::$navigationArray;\n \t}",
"public function showNavigationDataProvider()\n {\n return [\n ['', false],\n ['foo', true],\n ['0', false],\n [0, false],\n ['1', true],\n [1, true]\n ];\n }",
"public function getNavigation();",
"public function injectNavigation()\n {\n return [];\n }",
"public function navigationItems()\n {\n $config = $this->app['config']->get('motor-backend-navigation', []);\n $this->app['config']->set('motor-backend-navigation', array_replace_recursive(require __DIR__.'/../../config/motor-backend-navigation.php', $config));\n }",
"public function getNavigation() {\n\t\treturn [\n\t\t\t'top' => [\n\t\t\t\tself::FILTER_FAVORITES => [\n\t\t\t\t\t'id' => self::FILTER_FAVORITES,\n\t\t\t\t\t'name' => (string) $this->l->t('Favorites'),\n\t\t\t\t\t'url' => $this->URLGenerator->linkToRoute('activity.Activities.showList', ['filter' => self::FILTER_FAVORITES]),\n\t\t\t\t],\n\t\t\t],\n\t\t\t'apps' => [\n\t\t\t\tself::FILTER_FILES => [\n\t\t\t\t\t'id' => self::FILTER_FILES,\n\t\t\t\t\t'name' => (string) $this->l->t('Files'),\n\t\t\t\t\t'url' => $this->URLGenerator->linkToRoute('activity.Activities.showList', ['filter' => self::FILTER_FILES]),\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\t}",
"public function dataProvider()\n {\n return [\n 'Default' => [\n [\n 'items' => [\n [\n 'name' => '1',\n 'label' => 'page-1',\n ],\n [\n 'name' => '2',\n 'label' => 'page-2',\n ]\n ],\n 'options' => [\n 'id' => 'menu'\n ]\n ],\n '<i-menu id=\"menu\">'\n . '<menu-item name=\"1\">page-1</menu-item>'\n . '<menu-item name=\"2\">page-2</menu-item>'\n . '</i-menu>'\n ],\n 'All options' => [\n [\n 'items' => [\n [\n 'name' => '1',\n 'label' => 'page-1',\n ],\n [\n 'name' => '2',\n 'label' => '<b>page-2</b>',\n ]\n ],\n 'mode' => Menu::MODE_HORIZONTAL,\n 'theme' => Menu::THEME_DARK,\n 'accordion' => true,\n 'width' => 100,\n 'encodeLabel' => true,\n 'options' => [\n 'id' => 'menu'\n ]\n ],\n '<i-menu id=\"menu\" width=\"100\" mode=\"horizontal\" theme=\"dark\" accordion>'\n . '<menu-item name=\"1\">page-1</menu-item>'\n . '<menu-item name=\"2\"><b>page-2</b></menu-item>'\n . '</i-menu>'\n ],\n 'Submenu & openNames' => [\n [\n 'items' => [\n [\n 'name' => '1',\n 'label' => 'page-1',\n ],\n [\n 'name' => '2',\n 'label' => 'page-2',\n 'items' => [\n [\n 'name' => '3',\n 'label' => 'page-3',\n ],\n [\n 'name' => '4',\n 'label' => 'page-4',\n ],\n ]\n ]\n ],\n 'openNames' => [2],\n 'options' => [\n 'id' => 'menu'\n ]\n ],\n '<i-menu id=\"menu\" open-names=\\'[2]\\'>'\n . '<menu-item name=\"1\">page-1</menu-item>'\n . '<submenu name=\"2\">'\n . '<template slot=\"title\">page-2</template>'\n . '<menu-item name=\"3\">page-3</menu-item>'\n . '<menu-item name=\"4\">page-4</menu-item>'\n . '</submenu>'\n . '</i-menu>'\n ]\n ];\n }",
"public function test_get_navigation() {\n $this->resetAfterTest(true);\n\n $student1 = $this->getDataGenerator()->create_user();\n $this->getDataGenerator()->enrol_user($student1->id, $this->workshop->course->id);\n $workshopgenerator = $this->getDataGenerator()->get_plugin_generator('mod_workshop');\n $subid1 = $workshopgenerator->create_submission($this->workshop->id, $student1->id);\n\n $portfoliocaller = new mod_workshop_portfolio_caller(['id' => $this->workshop->cm->id, 'submissionid' => $subid1]);\n $portfoliocaller->set_formats_from_button([]);\n $portfoliocaller->load_data();\n\n $this->assertTrue(is_array($portfoliocaller->get_navigation()));\n }",
"public function getNav();",
"public function inArrayDataProvider() {}",
"public function get_nav_object() {}",
"protected function userNavigation()\n {\n return [\n //\n ];\n }",
"public abstract function getMenuData(): array;",
"public function navs()\n\t{\n\t\treturn $this->belongsToMany('App\\Http\\Models\\Navigation','user_to_nav','user_id','navigation_id');\n\t}",
"protected function getCache_NavigationService()\n {\n return $this->services['cache.navigation'] = \\CRM_Utils_Cache::create(['name' => 'navigation', 'type' => [0 => '*memory*', 1 => 'SqlGroup', 2 => 'ArrayCache'], 'withArray' => 'fast']);\n }",
"protected abstract function getArrayAccessSource();",
"public function findNavigationStructure(string $navigator): ?array\n {\n $this->sql =<<<SQL\nselect\n n.navigator,\n n.id,\n n.parent_id,\n n.sort,\n n.title nav_title,\n n.url,\n n.collection_id,\n c.collection_title,\n c.collection_slug,\n p.id page_id,\n p.title page_title,\n p.published_date,\n p.page_slug page_slug\nfrom navigation n\nleft join page p on n.page_id = p.id\nleft join collection c on n.collection_id = c.id\nwhere n.navigator = ?\norder by n.sort;\nSQL;\n\n $this->bindValues[] = $navigator;\n\n return $this->find();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate a cue text | function generate_cue_text($data, $user, $char='-', $repeated = 10) {
$text = array();
foreach ($data as $number => $element) {
if ($element['type'] == 'input') {
if (isset($user[$number])) {
if (!empty($user[$number]['content'])) {
if ($user[$number]['content'] == $element['content']) {
$text[] = '<c.success>' . $user[$number]['content'] . '</c>';
} else {
if (empty($_SERVER['HTTP_USER_AGENT'])) {
$text[] = str_repeat(
$char,
((int) ((mb_strlen($element['content'], 'UTF-8') - 1) / $repeated) + 1) * $repeated
);
} else {
$useragent = $_SERVER['HTTP_USER_AGENT'];
if (preg_match('/MSIE/i', $useragent) || preg_match('/Trident/i', $useragent)) {
$text[] = str_repeat(
$char,
((int) ((mb_strlen($element['content'], 'UTF-8') - 1) / $repeated) + 1) * $repeated
);
} else {
$text[] = '<c.error><i>' . $user[$number]['content'] . '</i></c>';
}
}
}
} else if ($user[$number]['help']) {
$text[] = '<c.help>' . $element['content'] . '</c>';
} else {
$text[] = str_repeat(
$char,
((int) ((mb_strlen($element['content'], 'UTF-8') - 1) / $repeated) + 1) * $repeated
);
}
} else {
$text[] = str_repeat($char, ((int) ((mb_strlen($element['content'], 'UTF-8') - 1) / $repeated) + 1) * $repeated);
}
} else {
$text[] = $element['content'];
}
}
return implode($text);
} | [
"public function getCue()\n {\n return $this->cue;\n }",
"public function createCueManager();",
"public function makeSound()\n {\n return \"Chicken: Cluck, Cluck\";\n }",
"public function generate_transcript()\n {\n\n /*\n * Require a file ID.\n */\n if (isset($this->id))\n {\n $this->file_id = $this->id;\n }\n if (!isset($this->file_id))\n {\n return FALSE;\n }\n\n $database = new Database;\n $database->connect_mysqli();\n\n /*\n * Retrieve all captions for this file.\n */\n $sql = 'SELECT video_transcript.id, video_transcript.text, video_transcript.time_start,\n\t\t\t\tvideo_transcript.time_end, video_transcript.new_speaker,\n\t\t\t\tvideo_transcript.legislator_id, representatives.name,\n\t\t\t\trepresentatives.shortname\n\t\t\t\tFROM video_transcript\n\t\t\t\tLEFT JOIN representatives\n\t\t\t\t\tON video_transcript.legislator_id = representatives.id\n\t\t\t\tWHERE file_id=' . $this->file_id . '\n\t\t\t\tORDER BY time_start ASC';\n $result = mysqli_query($GLOBALS['db'], $sql);\n if (mysqli_num_rows($result) == 0)\n {\n return FALSE;\n }\n\n /*\n * Build up an array of the lines.\n */\n $this->transcript = array();\n $i=0;\n while ($line = mysqli_fetch_assoc($result))\n {\n if ($line['new_speaker'] == 'y')\n {\n if (count($this->transcript) > 0)\n {\n $i++;\n }\n $this->transcript[$i]['text'] = $line['text'];\n $this->transcript[$i]['id'] = $line['legislator_id'];\n $this->transcript[$i]['shortname'] = $line['shortname'];\n $this->transcript[$i]['name'] = stripslashes(pivot($line['name']));\n $this->transcript[$i]['time_start'] = $line['time_start'];\n $this->transcript[$i]['time_end'] = $line['time_end'];\n }\n elseif ($line['new_speaker'] == 'n')\n {\n $this->transcript[$i]['text'] .= ' ' . $line['text'];\n }\n }\n\n /*\n * Sentence case the text.\n */\n foreach ($this->transcript as &$line)\n {\n $line['text'] = $this->sentence_case(mb_strtolower($line['text']));\n }\n\n return TRUE;\n }",
"public function outputVoice(): string\n {\n return \"わん\";\n }",
"private function cocktailize_text() {\n $cocktailize_letter = get_option( 'wp-cocktailize-cocktailization-settings' )['letter'];\n\t $cocktails = $this->get_cocktails( $cocktailize_letter );\n\n $filters = [\n 'the_title', // Post Title.\n 'get_the_excerpt', // Excerpt.\n 'the_content', // Post Content.\n 'comment_text', // Comment Text.\n 'widget_text' // Text Widget\n ];\n if ( $cocktails ) {\n foreach ( $filters as $filter ) {\n add_filter( $filter, function ($txt) use ($cocktailize_letter, $cocktails ) {\n $pattern = \"/(?<=^|\\s|(?<!\\\"wp-cocktailize-replaced\\\")>)$cocktailize_letter\\w+/i\";\n\n while ( preg_match( $pattern, $txt ) ) {\n $replacement = '<b class=\"wp-cocktailize-replaced\">' . $cocktails[array_rand($cocktails)]['strDrink'] . '</b>';\n $txt = preg_replace( $pattern, $replacement, $txt, 1 );\n }\n return $txt;\n });\n }\n }\n }",
"public function getDrawText();",
"public function makeSound()\n {\n return 'Cat';\n }",
"public function beginText()\n {\n }",
"function makeCueConvertable(&$cuefile) {\n global $_base;\n\n // changes all INDEX to be correct for mp3\n $cue_count=count($cuefile);\n for($i = 0; $i < $cue_count; $i++){\n $matches = array();\n if(preg_match(\"/(^\\s*INDEX\\s+00\\s+)([0-9:]+)/\", $cuefile[$i], $matches)){\n // safety check NN:NN:NN\n if ($matches[2] != \"00:00:00\")\n logp(\"info\",\"WARNING: Non-standard INDEX 00 '{$matches[2]}' found in current cuefile. Check log for file.\");\n\n // look at INDEX 01 and capture time\n $matches = array();\n if (preg_match(\"/(^\\s*INDEX\\s+01\\s+)([0-9:]+)/\", $cuefile[$i+1], $matches))\n {\n // if INDEX 01 not, 00:00:00, then add PREGAP before INDEX 00\n if ($matches[2] != \"00:00:00\")\n {\n // add PREGAP\n array_splice($cuefile,$i,0,array(\" PREGAP {$matches[2]}\"));\n $cue_count++;\n $i++;\n\n // skip 00 line and remark INDEX 1 line\n $i++;\n $cuefile[$i] = \" REM orig: \" . $cuefile[$i];\n\n // move to next line and add new index line starting at 00:00:00\n $i++;\n\n array_splice($cuefile,$i,0,array(\" INDEX 01 00:00:00\"));\n $cue_count++;\n } // matches not 00:00:00\n } // preg match 01\n } // preg match 00\n\n // safety check for an INDEX 01 that is not 00:00:00.\n // Currently returns false aborting conversion.\n $matches = array();\n if(preg_match(\"/(^ *INDEX\\s+01\\s+)([0-9:]+)/\", $cuefile[$i], $matches) && $matches[2] != \"00:00:00\")\n {\n logp(\"error,info\",array(\n \"WARNING: Non-converted INDEX 01 with value '{$matches[2]}' found in current\",\n \" cuefile. Value should be '00:00:00'.\",\n \" Check log above or info file below this warning for offending file.\",\n \" Stopping conversion process for this file.\")\n );\n return FALSE;\n }\n } // loop\n return TRUE;\n}",
"public function captcha_audio() {\n\t\t$this->autoRender = false;\n\t\techo $this->VisualCaptcha->audio();\n\t}",
"function trackifyCue(&$cuefile, &$wav, $option = FALSE) {\n // initialize\n $matches = array();\n $tracks = array();\n $cur_track = 1;\n\n // get artist and album, then check if cue file exists in directory\n if ( ($artist = getCueInfo(\"artist\", '', $cuefile)) === FALSE ) return FALSE;\n if ( ($album = getCueInfo(\"album\", '', $cuefile)) === FALSE ) return FALSE;\n\n // check if over 99 tracks and set $pad\n $count_arr = countTracks($cuefile);\n if ($count_arr[\"return\"] =! TRUE) return FALSE;\n // pick pad\n if ($option = \"reorder\")\n $pad = $count_arr[\"cnt_pad\"];\n else\n $pad = $count_arr[\"max_pad\"];\n\n // loop through each line. If track was not found after FILE, error\n // using $track_found.\n $track=\"\";\n $file_line=\"\";\n $track_found = TRUE;\n $cur_track = 1;\n for($i=0; $i < count($cuefile); $i++)\n {\n // look for FILE lines\n if( preg_match(\"/^\\s*FILE\\s+\\\"/\", $cuefile[$i])) {\n // check if any \\ and error\n if (preg_match('/\\\\\\/', $cuefile[$i])) {\n logp(\"error\",array(\"ERROR trackify: FILE title has a backslash. Skipping entire cuefile.\",\n \" Line: '{$cuefile[$i]}'\"));\n return FALSE;\n }\n\n // get trackno and replace with padded version\n if( preg_match(\"/^(\\s*FILE\\s+\\\")(\\d+)( .*)\\\"/\", $cuefile[$i], $matches)) {\n // check if we saw a track before this FILE\n if ($track_found != TRUE) {\n logp(\"error\",array(\n \"ERROR trackify: found FILE statement before preceding FILE's TRACK statement.\",\n \" Stmt: '{$cuefile[$i]}'\"));\n return FALSE;\n }\n $track_found = FALSE;\n $file_line = $cuefile[$i];\n\n // set key vars\n $curfilebase = $matches[3];\n $track_file=$matches[2];\n\n // choose track type\n if ($option == \"reorder\")\n $track = $cur_track;\n else\n $track = intval($track_file);\n $new_track = str_pad($track, $pad, \"0\", STR_PAD_LEFT);\n\n // replace track in FILE line\n $cuefile[$i] = preg_replace(\"/^(\\s*FILE\\s+\\\")(\\d+)/\",\n '${1}'. $new_track, $cuefile[$i]);\n\n // change $wav entry\n if (! changeWAVNew($wav, $track_file . $curfilebase, $new_track . $curfilebase)) {\n logp(\"error\",array(\n \"ERROR tracify: failed to change Wav file entry to new entry.\",\n \" Line: '{$cuefile[$i]}'\"));\n return FALSE;\n }\n\n } // if preg match for track in file line\n else {\n logp(\"error\",array(\n \"ERROR trackify: could not find track in FILE line. Skipping entire cuefile.\",\n \" Line: '{$cuefile[$i]}'\"));\n return FALSE;\n }\n } // end of if preg FILE\n\n // find TRACK and replace track number\n if( preg_match(\"/^\\s*TRACK\\s+/\", $cuefile[$i])) {\n\n // extract track_track or error\n if( preg_match(\"/^\\s*TRACK\\s+(\\d+)/\", $cuefile[$i], $matches))\n $track_track = $matches[1];\n else {\n logp(\"error\",array(\n \"ERROR trackify: TRACK statement found without a track number. Please check.\",\n \" Stmt: '{$cuefile[$i]}'\" ));\n return FALSE;\n }\n\n // if this track is from the FILE statement, compare with what we found in FILE\n if ($track_found === FALSE && $track_track != $track_file && $option != \"reorder\") {\n logp(\"error\",array(\n \"ERROR trackify: track from FILE and track TRACK do not match. Please check.\",\n \" Track from FILE line: '{$track_file}'\",\n \" Track from TRACK line: '{$track_track}'\",\n \" Track line: {$cuefile[$i]}\",\n \" File line: {$file_line}\"));\n return FALSE;\n }\n\n // if this track is a subsequent track on the same file, use extractioing or calc\n if ($track_found === TRUE)\n if ($option == \"reorder\")\n $track = $cur_track;\n else\n $track = intval($track_track);\n $new_track = str_pad($track, $pad, \"0\", STR_PAD_LEFT);\n\n // check that track hasn't already be used, otherwise set\n if (isset($tracks[$new_track])) {\n logp(\"error\", array(\n \"ERROR trackify: duplicate track number found, '{$new_track}'. Skipping cuefile\",\n \" New track '{$new_track}'\",\n \" Line: '{$cuefile[$i]}'\"));\n return FALSE;\n } else\n $tracks[$new_track] = 1;\n\n if ($new_track != \"\") {\n $cuefile[$i] = preg_replace(\"/(^\\s*TRACK\\s+)(\\d+)(.*)/\",\n '${1}' . $new_track . '${3}',\n $cuefile[$i]);\n $track=\"\";\n }\n else {\n // track is bad\n logp(\"error\",array(\n \"ERROR trackify: track processing reduced track to a NULL. Unclear why.\",\n \" Line: {$cuefile[$i]}\"));\n }\n\n // increment cur_track\n $cur_track++;\n $track_found = TRUE;\n\n } // end of if TRACK\n\n } // end of for - reading file\n\n return TRUE;\n}",
"protected function create_caption() {\n\t\t$caption = $this->data['caption'];\n\t\t$caption = do_shortcode( $caption );\n\t\t$caption = apply_filters( 'sliderpro_slide_caption', $caption, $this->slider_id, $this->slide_index );\n\n\t\treturn $caption;\n\t}",
"public function generateText()\n {\n $result = 'SPD' . self::DELIMITER . $this->version . self::DELIMITER . $this->implodeContent();\n\n if ($this->appendCRC32) {\n $result .= self::DELIMITER . 'CRC32:' . sprintf('%x', crc32($result));\n }\n\n return $result;\n }",
"function caption( $vContent = NULL, $aAttrs = array() )\n\t{\n\t\t$bHasEnd = TRUE;\n\t\treturn $this->_create_tag( __FUNCTION__, $aAttrs, $bHasEnd, $vContent );\n\t}",
"public function endCaption($result)\n {\n $this->captionResult = $result;\n $elapsed = $this->timer->elapsedAsSubripTime();\n $text = $this->captionCount . \"\\n\";\n $text .= $this->captionStarted . ' --> ' . $elapsed . \"\\n\";\n $text .= $this->captionText . \"\\n\\n\";\n file_put_contents($this->fileDir . $this->subtitleFile, $text, FILE_APPEND);\n\n $vStep = new ZoetropeVideoModelStep();\n $vStep->definition = $this->captionText;\n $vStep->result = $this->captionResult;\n $vStep->from = $this->captionStarted;\n $vStep->to = $elapsed;\n $this->zModel->steps[] = $vStep;\n }",
"function getTextOutput()\r\n {\r\n $output = '';\r\n\r\n if(in_array($this->hms, array('h','m','s')))\r\n {\r\n foreach($this->numbers_with_text as $numbers => $text)\r\n {\r\n $output .= $this->getSpan($this->hms . $numbers, $text) . ' ';\r\n }\r\n }\r\n\r\n return $output;\r\n }",
"private function generate_text()\r\n\t\t{\r\n\t\t\t$html = '<script type=\"text/javascript\">';\r\n $html .= 'lisha = new Object();';\r\n \t\t\t$html .= 'lis_lib = new Array();';\r\n\r\n\t\t\t$sql = 'SELECT\r\n\t\t\t\t\t\t`id` AS `id`,\r\n\t\t\t\t\t\t`corps`AS `corps`\r\n\t\t\t\t\tFROM '.__LISHA_TABLE_TEXT__.'\r\n\t\t\t\t\tWHERE 1 = 1\r\n\t\t\t\t\t\tAND `id_lang` = \"'.$this->c_lng.'\"\r\n\t\t\t\t\t\tAND `version_active` = \"'.__LISHA_APPLICATION_RELEASE__.'\"\r\n\t\t\t\t\t';\r\n\r\n\t\t\t$this->exec_sql($sql,__LINE__,__FILE__,__FUNCTION__,__CLASS__,$this->link);\r\n\r\n\t\t\twhile($row = $this->rds_fetch_array($this->resultat))\r\n\t\t\t{\r\n\t\t\t\t$row['corps'] = str_replace(chr(10),'',$row['corps']);\r\n\t\t\t\t$row['corps'] = str_replace(chr(13),'',$row['corps']);\r\n\r\n\t\t\t\t$_SESSION[$this->c_ssid]['lisha']['lib'][$row['id']] = $row['corps'];\r\n\t\t\t\t$html .= '\t\t\tlis_lib['.$row['id'].'] = \\''.str_replace(\"'\",\"\\'\",$row['corps']).'\\';';\r\n\r\n\t\t\t}\r\n\r\n $html .='</script>';\r\n\r\n echo $html;\r\n\t\t}",
"public function createCAPTCHA()\n {\n $res = '';\n $numberWords = new Numbers_Words();\n $phrase = $this->getPhrase();\n if ($this->_mode == 'single') {\n $phraseArr = str_split($phrase);\n for ($i = 0; $i < strlen($phrase); $i++) {\n $res .= ' ' . $numberWords->toWords($phraseArr[$i], $this->_locale);\n }\n } else {\n $res = $numberWords->toWords($phrase, $this->_locale);\n }\n $this->setCaptcha($res);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new ConfPaper model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate()
{
$model = new ConfPaper();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
}
return $this->render('create', [
'model' => $model,
]);
} | [
"public function actionCreate()\n {\n $model = new Configuration();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Config();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Rptsepp();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->IdReporteSepp]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new ReportApp();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new SurveyKepuasan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'fakultas' => $model->fakultas, 'jurusan' => $model->jurusan]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\r\n {\r\n $model = new QuestionSave();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function actionCreate()\n {\n $model = new Paperstore();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->storeID]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Proportion();\n\n if ($model->load(Yii::$app->request->post())) {\n if($model->validate()){\n $model->save();\n return $this->redirect(['index']);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new PS();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['/ps']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Dmzalopageconfig();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['zalofunction']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new PctRisk();\n\n if ($model->load(Yii::$app->request->post())) {\n $this->Uploads(false);\n \n $model->createdate = date('Y-m-d h:m:s');\n $model->username = Yii::$app->user->identity->username;\n $model->ref = substr(Yii::$app->getSecurity()->generateRandomString(),10);\n if($model->save()){\n \n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n $model->ref = substr(Yii::$app->getSecurity()->generateRandomString(),10);\n } \n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new BookPrinting();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new EduPaper();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $roomModel = new EduRoom();\n if(!EduTeacher::isAdmin()){\n $room = $roomModel->find()->where(['relate_teacher' => EduTeacher::relateUser()])->all();\n }\n else{\n $room = $roomModel->find()->all();\n }\n return $this->render('create', [\n 'model' => $model,\n 'room' => $room,\n ]);\n }\n }",
"public function actionCreate()\n {\n $colorPreferences = $this->prepareColorPreferences();\n\n if ($this->saveChanges()) {\n return $this->redirect(['index']);\n }\n\n return $this->render('_form', [\n 'colorPreferences' => $colorPreferences,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Pharmacy();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Dashboard();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->CORP_ID]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Perslist();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate() {\n $model = new Surveys();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->validate() == TRUE) {\n // print_r($model);\n $model->save();\n Yii::$app->session->setFlash('success', \"Poll Created Succsesfully\");\n\n return $this->redirect('create');\n } else {\n $sessions = Yii::$app->session->set(\"Error\", \"Error when creating Survey\");\n }\n //print_r($model);\n //return $this->redirect(['view', 'id' => $model->survey_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate() {\n $model = new Attendence();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests "update" method without password | public function testUpdateWithoutPassword()
{
$user = $this->fixturesLoader->getEntityByReference('user.baptiste');
$currentPassword = $user->getPassword();
$client = static::createAuthenticatedClient($user->getEmail());
$requestAsserter = new RequestAsserter($this, $client);
$requestAsserter
->put('/me', $this->parseFile(__DIR__.'/_posted/me/me_update_without_password.yml'))
->expectStatusCode(Response::HTTP_OK);
$this->assertEquals($currentPassword, $user->getPassword());
} | [
"public function testUserServiceUserUpdate()\n {\n }",
"public function testUpdateActionWithoutToken()\n {\n // Create an un-authenticated client\n $client = static::createClient();\n // Test the route with patch data\n $client->request(\n 'PATCH',\n '/api/users',\n [],\n [],\n ['CONTENT_TYPE' => 'application/json'],\n json_encode(\n [\n 'password' => '1GreatPassword',\n ]\n )\n );\n // Check the response\n $this->assertSame(Response::HTTP_UNAUTHORIZED, $client->getResponse()->getStatusCode());\n }",
"public function testUpdatePasswordsDontMatch(): void { }",
"public function testUpdate() {\n $user = Woodling::saved('User');\n $this->specify(\"returns false when there is a validation error\", function() use($user){\n $this->assertFalse($user->update(['email' => null]));\n });\n\n $this->specify(\"returns false when there is a validation error\", function() use($user){\n $this->assertCount(0, User::where('email','test@yahoo.com')->get());\n $this->assertTrue($user->update(['email' => 'test@yahoo.com']));\n $this->assertCount(1, User::where('email','test@yahoo.com')->get());\n });\n }",
"public function testUsersUpdate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testTryUpdateWithoutPasswordConfirmation()\n {\n //Create a ramdom user\n $user = factory(User::class)->create();\n //acting as first user created\n $this->actingAs($user);\n\n $response = $this->json('PUT', '/api/users/update/'.$user->id, ['email' => 'willian@email.com', 'name' => 'Willian Rodrigues', 'password' => '123456']);\n\n $response->assertJsonFragment([\n \"password\" => [\"Campos password e password_confirmation estão diferentes.\"]\n ]);\n $response->assertStatus(422);\n }",
"public function testExecuteMethodWithUpdate()\n {\n $data = array('id' => 1, 'name' => 'Windstorm');\n\n $mutator = new UpdateUser(1, (array) $data);\n\n $result = $this->repository->set($mutator);\n\n $this->assertEquals(1, $result->affected());\n }",
"public function testUpdateCredential()\n {\n }",
"public function test_change_password_ok() {\n\t\n\t\t$id = '88' ;\n\t\t$old_password = '12345';\n\t\t$new_password = 'aaa456';\n\t\t//call function to test update\n\t\t$rs = $this->_user->change_password($id, $old_password, $new_password);\n\t\t//compare with code 200 is success\n\t\t$this->assertEquals('200', $rs['meta']['code']);\n\t\t//reset data\n\t\t\n\t\t$this->reset_data_update();\t\n\t}",
"public function testQuarantineUpdateAll()\n {\n\n }",
"public function testUpdatePasswordActionWithoutToken()\n {\n // Create an un-authenticated client\n $client = static::createClient();\n // Test the route with patch data\n $client->request(\n 'PATCH',\n '/api/users/password',\n [],\n [],\n ['CONTENT_TYPE' => 'application/json'],\n json_encode(\n [\n 'password' => '1GreatPassword',\n ]\n )\n );\n // Check the response\n $this->assertSame(Response::HTTP_UNAUTHORIZED, $client->getResponse()->getStatusCode());\n }",
"public function testUserAccountPwUpdate()\n {\n $curPw = \"SomePassword\";\n $newPw = '123456789abcdef';\n $user = factory(User::class)->create(['password' => bcrypt($curPw)]);\n\n // Assert old password match\n $this->assertFalse(\\Hash::check($newPw, $user->password));\n\n $this->actingAs($user)\n ->visit(route('user::update_password_get'))\n ->type($curPw, 'current_password')\n ->type($newPw, 'password')\n ->type($newPw, 'password_confirmation')\n ->press('Update password')\n ->see('Password updated.')\n ->seePageIs(route('home'));\n\n // Assert new password match\n $user = User::where('email', '=', $user->email)->first();\n $this->assertTrue(\\Hash::check($newPw, $user->password));\n }",
"public function testItCanUpdateEntity()\n {\n $password = 'secret_updated';\n $entity = factory(User::class)->create(['password' => 'secret']);\n $values = factory(User::class)->make(['password' => $password])->toArray();\n\n\n $this->userService->update(array_merge(\n $values,\n ['password' => $password]\n ), $entity->id);\n\n $this->assertDatabaseHas('user_users', $values);\n }",
"function update_test_user ()\r\n{\r\n global $user;\r\n\r\n # set new password\r\n $update_array = array(USER_PW_FIELD_NAME => REGRESSION_TEST_USER_NEW_PW);\r\n\r\n # update test user\r\n return $user->update(USER_NAME_FIELD_NAME.\"='\".REGRESSION_TEST_USER_NAME.\"'\", $update_array);\r\n}",
"public function test_update_item() {}",
"public function testUserUpdate()\n {\n $userAdmin = $this->createUserAdmin();\n $user = factory(\\App\\Models\\User::class)->create();\n\n $dataRequest = $this->generateUserData();\n\n $this->actingAs($userAdmin)\n ->put(route('backend.users.update', array('id' => $user->id)), $dataRequest) \n ->assertStatus(302)\n ->assertSessionHasNoErrors()\n ->assertRedirect('/administrativo/usuarios');\n }",
"public function testUserAccountUpdate()\n {\n $user = factory(User::class)->create();\n $emailChange = factory(UserEmailChange::class)->create([\n 'user_id' => $user->id,\n 'confirmed' => false\n ]);\n\n $firstName = 'Firstname';\n $lastName = 'Lastname';\n $this->actingAs($user)\n ->visit(route('user::update_get'))\n ->type($firstName, 'first_name')\n ->type($lastName, 'last_name')\n ->press('Update')\n ->seePageIs(route('home'));\n\n $this->seeInDatabase('users', [\n 'first_name' => $firstName,\n 'last_name' => $lastName,\n 'email' => $user->email,\n ]);\n }",
"public function testUpdate()\n {\n // Create test data.\n $data = $this->addData('update');\n\n // Modify the entry, not the email in this test.\n for ($i = 0; $i < Configuration::TEST_DATA_SIZE; $i++) {\n $data['params'][$i]['id'] = $data['ids'][$i];\n $data['params'][$i]['fn'] = $data['params'][$i]['fn'] . bin2hex(random_bytes(4));\n $data['params'][$i]['ln'] = $data['params'][$i]['ln'] . bin2hex(random_bytes(4));\n $data['params'][$i]['p'] = $data['params'][$i]['p'] . bin2hex(random_bytes(4));\n\n // *** TEST LINE *** : Call update directly with the modded data.\n $this->object->update($data['params'][$i]);\n // *** TEST LINE ***\n }\n\n // Test the data.\n $this->validateData($data);\n\n // Remove the test data.\n $this->removeData($data);\n }",
"public function testUpdateUser()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds the slope and normalized distance parameters for the input parameters file | function createSlopeParameters($units,$slopelength,$slopeshape,$slopesteepness)
{
// convert OFE's length to metric units based on user selection
if($units == 'english')
$slopelength = $slopelength * 0.3048;
$SL = " SL = ";
$SX = " SX = ";
switch ($slopeshape) {
case 1: // "Uniform"
$SL = $SL . $slopesteepness . " , " . $slopesteepness . "\n";
$SX = $SX . "0.00 , 1.00 \n";
break;
case 2: // "Convex"
$SL = $SL . "0.001 , " . $slopesteepness * 2 . "\n";
$SX = $SX . "0.00 , 1.00 \n";
break;
case 3: // "Concave"
$SL = $SL . $slopesteepness * 2 . " , 0.001\n";
$SX = $SX . "0.00 , 1.00 \n";
break;
case 4: // "S-shaped"
$SL = $SL . "0.001 , " . $slopesteepness * 2 . " , 0.001\n";
$SX = $SX . "0.00 , 0.50 , 1.00 \n";
break;
}
return $SL . $SX;
} | [
"public function calculate(): void\n {\n $v = $this->v;\n $w = $this->w;\n\n $x’ = Single::subtract($this->xs, $v);\n $y’ = Single::subtract($this->ys, $w);\n\n $parameters = $this->leastSquares($y’, $x’, 1, 0)->getColumn(0);\n\n $m = $parameters[0];\n $b = $this->w - $m * $this->v;\n\n $this->parameters = [$b, $m];\n }",
"abstract protected function getParameters($file);",
"protected function parseParams():self\n\t{\n\t\t$params= preg_split('/(?<!\\\\\\\\)\\\\|/',$this->line->pregGet('/^-[\\w-:]+\\((.*?)\\)(?= |(\\\\{>)?$)/',1));\n\n\t\tif( ($m= count($params)) != ($n= count($this->config['params'])) ){$this->document->throw(\"Tag $this->name has $n parameters $m given.\");}\n\n\t\tarray_map(function( $key, $value ){return $this->setAttribute($key,$this->checkExpression(str_replace('\\\\|','|',$value)));},$this->config['params'],$params);\n\n\t\treturn $this;\n\t}",
"private function buildParameters() {\n return array(\n 'key' => $this->apiKey,\n 'source' => $this->languages['from'],\n 'target' => $this->languages['to'],\n 'q' => $this->original\n );\n }",
"public function recalculateParameters(): void\n {\n $this->a_ = $this->pa_->getY() - $this->pb_->getY();\n $this->b_ = $this->pb_->getX() - $this->pa_->getX();\n $this->c_ = $this->pa_->getX() * $this->pb_->getY() - $this->pb_->getX() * $this->pa_->getY();\n if ($this->a_ < 0) {\n $this->a_ *= (-1);\n $this->b_ *= (-1);\n $this->c_ *= (-1);\n } elseif (($this->b_ < 0) and ($this->a_ == 0)) {\n $this->b_ *= (-1);\n $this->c_ *= (-1);\n }\n }",
"protected function buildParams()\n {\n return array_merge(\n $this->conditions,\n $this->limits\n );\n }",
"private function _initialize() {\n $userDefinedLineBreaks = null;\n $params = $this->getParameters();\n if ( $params !== null ) {\n for($i = 0 ; $i<count($params) ; $i++) {\n if ( self::LINE_BREAKS_KEY === $params[$i]->getName() ) {\n $userDefinedLineBreaks = $params[$i]->getValue();\n break;\n }\n }\n }\n\n if ( $userDefinedLineBreaks !== null ) {\n $this->_lineBreaks = $userDefinedLineBreaks;\n }\n }",
"function recuperer_parametres(){\n\n\t\t// pour compatibilite, recuperer l'ancien code #REM\n\t\t$this->recuperer_parametres_rem();\t\n\t\t\n\t\t$this->recuperer_fond();\n\t\t$this->fond_compile = preg_replace_callback('/(<!-- ([a-z0-9_]\\w+)(\\*)?=)(.*?)-->/sim',\n\t\t\t\t\t\t\tarray(&$this, 'post_params'), $this->fond_compile);\n\n\t\t// s'il en reste : il y a un probleme !\n\t\t// est-ce utile de tester ça ?\n\t\tif (preg_match('/<!-- [a-z0-9_]\\w+\\*?=/', $this->fond_compile)) {\n\t\t\tdie('Un parametre CFG n\\'a pas pu etre importe depuis '.$this->vue);\n\t\t}\n\n\t\t// pour compatibilite avec les anciennes versions (<1.4.1)\n\t\tif (isset($this->param->storage)) \n\t\t\t$this->param->depot = $this->param->storage;\n\t\t\n\t\tif ($this->param->depot == 'classic')\n\t\t\t$this->param->depot = 'meta';\n\t\t\t\n\t\tif ($this->param->depot == 'extrapack'){\n\t\t\t$this->param->depot = 'tablepack';\n\t\t\t$this->param->colonne = 'extra';\n\t\t}\n\t\t\n\t\t// definir les parametres qui sont a traiter comme des extensions\n\t\t// il faut que le parametre ne soit pas vide et qu'un fichier \n\t\t// /cfg/params/{param}.php existe\n\t\t$this->extensions_parametres = array();\n\t\tforeach ($this->param as $nom=>$val){\n\t\t\tif ($val) $this->ajouter_extension_parametre($nom);\t\t\n\t\t}\n\t}",
"private function buildParameters() {\n $return = '';\n if (self::DEBUG) {\n $this->log->write('::buildParameters started');\n }\n if (count($this->parameters)) {\n $return = ' -P ';\n foreach ($this->parameters as $k => $v) {\n $return .= ' ' . $k . '=' . $this->quote($v);\n }\n }\n if (self::DEBUG) {\n $this->log->write('ilJasperReport::buildParameters: ' . $return);\n $this->log->write('ilJasperReport::buildParameters finished');\n }\n return $return;\n }",
"private function getExtendedParametersInfo()\n {\n $key = array_search('begin', $this->myRoutineSourceCodeLines);\n\n if ($key!==false)\n {\n for ($i = 1; $i<$key; $i++)\n {\n $k = preg_match('/^\\s*--\\s+param:(?:\\s*(\\w+)\\s+(\\w+)(?:(?:\\s+([^\\s-])\\s+([^\\s-])\\s+([^\\s-])\\s*$)|(?:\\s*$)))?/',\n $this->myRoutineSourceCodeLines[$key - $i + 1],\n $matches);\n\n if ($k==1)\n {\n $count = count($matches);\n if ($count==3 || $count==6)\n {\n $parameter_name = $matches[1];\n $data_type = $matches[2];\n\n if ($count==6)\n {\n $list_delimiter = $matches[3];\n $list_enclosure = $matches[4];\n $list_escape = $matches[5];\n }\n else\n {\n $list_delimiter = ',';\n $list_enclosure = '\"';\n $list_escape = '\\\\';\n }\n\n if (!isset($this->myExtendedParameters[$parameter_name]))\n {\n $this->myExtendedParameters[$parameter_name] = ['name' => $parameter_name,\n 'data_type' => $data_type,\n 'delimiter' => $list_delimiter,\n 'enclosure' => $list_enclosure,\n 'escape' => $list_escape];\n }\n else\n {\n throw new RuntimeException(\"Duplicate parameter '%s' in file '%s'.\",\n $parameter_name,\n $this->mySourceFilename);\n }\n }\n else\n {\n throw new RuntimeException(\"Error: Expected: -- param: <field_name> <type_of_list> [delimiter enclosure escape] in file '%s'.\",\n $this->mySourceFilename);\n }\n }\n }\n }\n }",
"function compileParameters() \n {\n $parameterString = '';\n \n // for each entry in the parameterValues array\n foreach( $this->parameterValues as $key=>$value) {\n \n // if the value is set (ie not FALSE)\n if ($value) {\n \n // add to parameterString\n if ($parameterString != '') {\n $parameterString .= ',';\n }\n $parameterString .= $key.'='.$value;\n \n }\n }\n \n // now stor in this object's parameters member\n $this->parameters = $parameterString;\n \n }",
"public function getParams() {\n\n // Fire off class methods to get parameters.\n $this->wmsAddress = $this->_getWmsAddress();\n $this->capabilitiesXml = $this->_getCapabilitiesXml();\n $this->mapTitle = $this->_getMapTitle();\n $this->layers = $this->_getLayers();\n $this->epsg = $this->_getEPSG();\n $this->boundingBox = $this->_getBoundingBox();\n\n }",
"protected function buildParameters(): array\n {\n return array_merge([\n 'id' => $this->id,\n 'height' => $this->height,\n 'width' => $this->width,\n 'data-charts' => $this->type,\n 'data-options' => json_encode($this->options),\n 'data-data' => json_encode($this->getCompleteDataSets()),\n ], $this->attributes);\n }",
"protected function _buildBaseParams()\n {\n $this->_setParameter('post-id', $this->getId());\n $this->_setParameter('email', $this->_service->getEmail());\n $this->_setParameter('password', $this->_service->getPassword());\n $this->_setParameter('generator', $this->getGenerator());\n $this->_setParameter('date', $this->getDate());\n if (count($this->getTags())) {\n $this->_setParameter('tags', implode(',', $this->getTags()));\n }\n \n $this->_setParameter('format', $this->getFormat());\n $this->_setParameter('group', $this->getGroup());\n return $this->_getParameters();\n }",
"public function parseParameters(string $filename): array;",
"public function init() {\r\n #$temp; /* temporary variable\t\t */\r\n if( $this->lat0 == 0 )\r\n $this->lat0 = 90; //$this->lat0 ca\r\n\r\n /* Place parameters in static storage for common use\r\n ------------------------------------------------- */\r\n $this->temp = $this->b / $this->a;\r\n $this->es = 1.0 - pow( $this->temp, 2 ); // devait etre dans tmerc.js mais n y est pas donc je commente sinon retour de valeurs nulles \r\n $this->e = sqrt( $this->es );\r\n $this->e0 = Proj4php::$common->e0fn( $this->es );\r\n $this->e1 = Proj4php::$common->e1fn( $this->es );\r\n $this->e2 = Proj4php::$common->e2fn( $this->es );\r\n $this->e3 = Proj4php::$common->e3fn( $this->es );\r\n $this->ml0 = Proj4php::$common->mlfn( $this->e0, $this->e1, $this->e2, $this->e3, $this->lat0 ); //si que des zeros le calcul ne se fait pas\r\n //if (!$this->ml0) {$this->ml0=0;}\r\n }",
"public function getAssembledParams();",
"function parseFile(string $fileName, string $date): string {\n\n $file = file_get_contents($fileName);\n\n // separate on whatever newline characters may be present\n $lines = preg_split('/\\r\\n|\\r|\\n/', $file);\n\n // output to serialize; begins with IS0 date of the data\n $processed = [$date . \"\\n\"];\n\n // move from north to south through the array\n $lat = -90;\n\n $numLines = count($lines);\n\n for($i = 0; $i < $numLines; $i += 10) {\n\n // move from west to east on the line\n $line = $lines[$i];\n $long = -180;\n $procLine = [];\n $values = explode(',', $line);\n\n $numPoints = count($values);\n\n for($j = 0; $j < $numPoints; $j += 10) {\n\n $value = $values[$j];\n // 99999.0 is the zero value; we drop these but increment the long counter\n if($value && $value != 99999.0) {\n\n $coords = $lat . \",\" . $long . \",\" . $value . \"\\n\";\n // add the new coordinate line to the output\n array_push($procLine, $coords);\n\n }\n\n ++$long;\n\n }\n\n // dump the values for the line in with the rest - no need to preserve original format\n $processed = array_merge($processed, $procLine);\n ++$lat;\n\n }\n\n return(implode($processed));\n\n}",
"function dml_Save_Line_Settings(){\r\n\t$result = array(\r\n\t\t'status' => '0',\r\n\t\t'message' => 'Invalid data to update line settings',\r\n\t);\r\n\t// Gets map data and dmlinitMap\r\n\t$dml_page_link = esc_url_raw( $_POST['dml_page_link'] );\r\n\t$dml_post_id = absint( $_POST['dml_post_id'] );\r\n\t$dml_field1 = sanitize_text_field( $_POST['dml_field1'] ); // Field1 name for update query\r\n\t$dml_value1 = sanitize_text_field( $_POST['dml_value1'] ); // Line color code \r\n\t$dml_field2 = sanitize_text_field( $_POST['dml_field2'] ); // Field1 name for update query\r\n\t$dml_value2 = sanitize_text_field( $_POST['dml_value2'] ); // Line color code \r\n\t$dml_field3 = sanitize_text_field( $_POST['dml_field3'] ); // Field3 name for update query\r\n\t$dml_value3 = esc_html( $_POST['dml_value3'] ); // Textarea3 \r\n\t$dml_field4 = sanitize_text_field( $_POST['dml_field4'] ); // Field4 name for update query\r\n\t$dml_value4 = sanitize_text_field( $_POST['dml_value4'] ); // Textarea4 \r\n\t$dml_field5 = sanitize_text_field( $_POST['dml_field5'] ); // Field5 name for update query\r\n\t$dml_value5 = sanitize_text_field( $_POST['dml_value5'] ); // Textarea5 \r\n\t$dml_field6 = sanitize_text_field( $_POST['dml_field6'] ); // Field6 name for update query\r\n\t$dml_value6 = esc_html( $_POST['dml_value6'] ); // Textarea6 \r\n\t$dml_field7 = sanitize_text_field( $_POST['dml_field7'] ); // Lat field of Line\r\n\t$dml_value7 = sanitize_text_field( $_POST['dml_value7'] ); // Lat value of line \r\n\t$dml_field8 = sanitize_text_field( $_POST['dml_field8'] ); // Lng field of Line\r\n\t$dml_value8 = sanitize_text_field( $_POST['dml_value8'] ); // Lng value of line \r\n\t$dml_field_num = absint( $_POST['dml_field_num'] );\r\n\r\n\tif ( isset( $dml_page_link ) && isset( $dml_post_id ) && isset( $dml_field1 ) && isset( $dml_value1 ) && isset( $dml_field2 ) && isset( $dml_value2 ) && isset( $dml_field3 ) && isset( $dml_value3 ) && isset( $dml_field4 ) && isset( $dml_value4 ) && isset( $dml_field5 ) && isset( $dml_value5 ) && isset( $dml_field6 ) && isset( $dml_value6 ) && isset( $dml_field7 ) && isset( $dml_value7 ) && isset( $dml_field8 ) && isset( $dml_value8 ) && isset( $dml_field_num ) ) {\r\n\t\ttry {\r\n\t\t\t$iconData = array(\r\n\t\t\t\t'dml_post_id' => $dml_post_id,\r\n\t\t\t\t'dml_field1' => $dml_field1,\r\n\t\t\t\t'dml_value1' => $dml_value1,\r\n\t\t\t\t'dml_field2' => $dml_field2,\r\n\t\t\t\t'dml_value2' => $dml_value2,\r\n\t\t\t\t'dml_field3' => $dml_field3,\r\n\t\t\t\t'dml_value3' => $dml_value3,\r\n\t\t\t\t'dml_field4' => $dml_field4,\r\n\t\t\t\t'dml_value4' => $dml_value4,\r\n\t\t\t\t'dml_field5' => $dml_field5,\r\n\t\t\t\t'dml_value5' => $dml_value5,\r\n\t\t\t\t'dml_field6' => $dml_field6,\r\n\t\t\t\t'dml_value6' => $dml_value6,\r\n\t\t\t\t'dml_field7' => $dml_field7,\r\n\t\t\t\t'dml_value7' => $dml_value7,\r\n\t\t\t\t'dml_field8' => $dml_field8,\r\n\t\t\t\t'dml_value8' => $dml_value8,\r\n\t\t\t\t'dml_field_num' => $dml_field_num,\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$mySaveStatus = dml_update_fields($iconData);\r\n\t\t\t\r\n\t\t\tif( $mySaveStatus == 1 ):\r\n\t\t\t\t$result = dml_get_map();\r\n\t\t\telse:\r\n\t\t\t\t$result['status'] = 2;\r\n\t\t\t\t$result['message'] = \"Settings of the line could not be saved.\";\r\n\t\t\tendif;\r\n\t\r\n\t\t} catch ( Exception $e ) {\r\n\t\t\t$result['message'] = \"Error: \" . $e->getMessage();\r\n\t\t}\t\r\n\t}\r\n\treturn (array)$result;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if a given date is a holiday | public function isHoliday(\DateTime $date): bool
{
return in_array($date->format('Y-m-d'), $this->annualHolidays->getAll($date->format('Y')));
} | [
"public function isHoliday(\\DateTimeInterface $date): bool;",
"function Is_Holiday($date)\n\t\t{\n\t\t\t//Is the passed date a holiday\n\t\t\tforeach ($this->holiday_object as $obj=>$event_date)\n\t\t\t{\n\t\t\t\tif($date == $event_date)\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn FALSE;\n\t\t}",
"public static function is_holiday($date) {\r\n\t\t$date = self::day($date);\r\n\t\t// Check date for holidays\r\n\t\tforeach(self::$holidays as $holiday) {\r\n\t\t\t$holiday = self::day($holiday);\r\n\t\t\tif ($date == $holiday) {\r\n\t\t\t\treturn true; \r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\t\t\t\t\r\n\t}",
"public function isHoliday(string $date): bool{\n $dateToTest = DateTime::createFromFormat(self::DATEFORMAT, $date);\n\n foreach($this->holidayObjects as $dateObject){\n if( $dateToTest->format('m') == $dateObject->format('m') && \n $dateToTest->format('d') == $dateObject->format('d')){\n return true;\n }\n }\n return false;\n }",
"public function isHoliday($date){\n\n $holidays = [\n '2019-01-01',\n '2019-02-17',\n '2019-05-26',\n '2019-07-04',\n '2019-09-01',\n '2019-10-13',\n '2019-11-11',\n '2019-11-27',\n '2019-12-25',\n '2020-01-01',\n '2020-01-19',\n '2020-02-16',\n '2020-05-25',\n '2020-07-03',\n '2020-09-07',\n '2020-10-12',\n '2020-11-11',\n '2020-11-26',\n '2020-12-25'\n ];\n\n if ($holidays.includes($date)){\n return true;\n }\n return false;\n }",
"public function is_holiday($date){\n\n // GET Request to UK Gov API, returns JSON array of past and future national UK holidays\n $endpoint = \"https://www.gov.uk/bank-holidays.json\";\n $client = new \\GuzzleHttp\\Client();\n\n $response = $client->request('GET', $endpoint);\n\n $statusCode = $response->getStatusCode();\n $content = json_decode($response->getBody(), true);\n\n if($statusCode == 200){\n // Loop through the JSON object, to try and match the target date\n foreach($content['england-and-wales']['events'] as $event){\n $target_year = explode(\"-\", $date);\n $current_year = explode(\"-\", $event['date']);\n\n if($current_year[0] >= $target_year[0]){\n // Ignores all the old year data returned in the response (before target date)\n if($event['date'] == $date){\n // If match, date is a national holiday return true\n return true;\n }\n }\n }\n }\n\n // No matches found, date is not a holiday, return false\n return false;\n }",
"public function isHoliday($date)\n {\n // Return false if given date is empty\n if (is_null($date)) {\n return false;\n }\n\n // If given date is a DateTime object\n if (get_class($date) === 'DateTime' && in_array($date->format('Y-m-d'),\n array_values($this->getHolidayDates()))\n ) {\n return true;\n }\n\n // If given date is a Yasumi\\Holiday object\n if (! is_null($date) && in_array($date, $this->holidays)) {\n return true;\n }\n\n return false;\n }",
"public function isHoliday(): bool\n {\n $holidays = $this->getHolidays();\n $today = $this->date->format('d/m');\n\n foreach ($holidays as $holiday) {\n if (is_callable($holiday)) {\n $holiday = call_user_func($holiday, $this->date->format('Y'));\n }\n\n if ($today === $holiday) {\n return true;\n }\n }\n\n return false;\n }",
"public function testIsHoliday()\n {\n $this->assertTrue($this->getCalculator()->isHoliday('2019-05-31'));\n $this->assertTrue($this->getCalculator()->isHoliday('2019-05-23'));\n $this->assertTrue($this->getCalculator()->isHoliday('2019-05-24'));\n }",
"function check_holiday ($checkdate) {\n\t$check = mysql_query(\"SELECT holi_date from holidays where holi_date = '$checkdate'\") or die (mysql_error());\n if (mysql_num_rows($check) >= 1) {\n\treturn 1;\n\t} else {\n\treturn 0;\n\t}\t\t\n}",
"public function jIsHoliday()\n {\n return $this->isFriday();\n }",
"function testBug12807()\n {\n $drv = Date_Holidays::factory('Denmark');\n if (Date_Holidays::isError($drv)) {\n $this->fail(helper_get_error_message($drv));\n }\n\n $this->assertTrue($drv->isHoliday('@' . mktime(1, 1, 1, 12, 25, 2007)));\n $this->assertTrue($drv->isHoliday('@' . mktime(1, 1, 1, 1, 1, 2007)));\n $this->assertTrue($drv->isHoliday('@' . mktime(1, 1, 1, 1, 1, 2009)));\n $this->assertTrue($drv->isHoliday('@' . mktime(1, 1, 1, 12, 25, 2007)));\n $this->assertTrue($drv->isHoliday('@' . mktime(1, 1, 1, 12, 25, 2009)));\n\n }",
"function check_holiday ($checkdate) {\n\t$check = mysql_query(\"SELECT holi_date from Holidays where holi_date = '$checkdate'\") or die (mysql_error());\n if (mysql_num_rows($check) >= 1) {\n\treturn 1;\n\t} else {\n\treturn 0;\n\t}\t\t\n}",
"function getHolidays($date) {\n die('Error: pure virtual function NativeCalendar::getHoliday() called');\n }",
"public static function isTodayHoliday()\n {\n return self::isDayHoliday(date('Y'), date('m'), date('d'));\n }",
"public static function isCzechHoliday($date)\n {\n if (!$date instanceof DateTime) {\n if (\\is_int($date)) {\n $date = new DateTime('@' . $date);\n } elseif (\\is_string($date)) {\n $date = new DateTime($date);\n } else {\n throw new RuntimeException(self::poorManTranslate('fts-shared', 'Invalid date format'));\n }\n }\n\n $holidays = ['01-01', '05-01', '05-08', '07-05', '07-06', '09-28', '10-28', '11-17', '12-24', '12-25', '12-26'];\n\n if (\\in_array($date->format('m-d'), $holidays, true)) {\n return true;\n }\n\n //Easter\n $easterDays = easter_days($date->format('Y')); //Return number of days from base to easter sunday\n $easter = new DateTime($date->format('Y') . '-03-21');\n $easter->add(new \\DateInterval('P' . $easterDays . 'D')); //Sunday\n $easter->sub(new \\DateInterval('P2D')); //Friday\n if ($date->format('Y-m-d') === $easter->format('Y-m-d')) {\n return true;\n }\n $easter->add(new \\DateInterval('P3D')); //Monday\n\n return ($easter->format('Y-m-d') === $date->format('Y-m-d'));\n }",
"function isPublicHoliday($strDate)\n {\n global $db;\n $bolResult = false;\n if (!$this->objDate->validDate($strDate)) {\n return false;\n }\n // cari hari dan tanggalnya\n $arrDt = $this->objDate->extractDate($strDate);\n //list($tahun,$bulan,$tanggal) = explode(\"-\",$strDate);\n //$tsTanggal = mktime(0,0,0,$bulan,$tanggal,$tahun);\n $dtTanggal = getdate($arrDt['integer']);//getdate($tsTanggal);\n // cari di calendar\n $tbl = new cModel(\"hrd_calendar\");\n if ($rowDb = $tbl->findByHoliday($strDate, \"id, status\")) {\n $bolResult = ($rowDb['status'] == 't'); // bisa saja hari libur, atau hari libur tapi dianggap masuk (pengganti)\n } else {\n // tidak ada catatann hari libur\n if ($dtTanggal['wday'] == 0) { // hari minggu, libur\n $bolResult = true;\n } else if ($dtTanggal['wday'] == 6) { // hari sabtu\n if (getSetting(\"saturday\") == \"t\") {\n $bolResult = true;\n }\n }\n }\n return $bolResult;\n }",
"function is_bank_holiday($begin,$end)\n{\n\tglobal $wpdb;\n\t\n\t$is_bank_holiday = 'n';\n\t\n\t$bank_holiday_days = \"SELECT * FROM \" . WP_CALENDAR_TABLE_Aula . \" WHERE event_category=4 AND event_valid='y' AND event_begin<='\" . $begin . \"' AND event_end>='\" . $end . \"'\";\n\t$result = $wpdb->get_results($bank_holiday_days);\n\t\n\tif(!empty($result))\n\t{\n\t\t$is_bank_holiday = 'y';\n\t}\n\t\n\treturn $is_bank_holiday;\n\t\n}",
"public function isHoliday($day)\n {\n return $day === \"Sunday\" ? 'holiday' : '';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Establece el valor del atributo iid_cargo de ActividadCargo | function setId_cargo($iid_cargo)
{
// si es sacd, cambio a la clase ActividadCargoSacd
if ($iid_cargo == 35) {
}
$this->iid_cargo = $iid_cargo;
} | [
"public function getIdcargo(){\n return $this->idcargo;\n }",
"public function getCargo_id(){\n return $this->cargo_id;\n }",
"public function getIdCargo()\n\t{\n\t\treturn $this->id_cargo;\n\t}",
"public function getCargoId()\n\t{\n\t\treturn $this->cargo_id;\n\t}",
"public function setCargo_id($cargo_id){\n $this->cargo_id = $cargo_id;\n }",
"public function getCargo(){\n\t\treturn $this->cargo;\n\t}",
"function setId_orbix($iid_orbix = '')\n {\n $this->iid_orbix = $iid_orbix;\n }",
"public function getCargo(){\n\t\t\treturn $this->cargo;\n\t\t}",
"public function setCargo($cargo){\n\t\t$this->cargo = $cargo;\n\t}",
"public function getIdCarrito(){\n return $this->idCarrito;\n }",
"public function getActiCodigo()\n {\n return $this->acti_codigo;\n }",
"public function setIdCargo($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->id_cargo !== $v) {\n\t\t\t$this->id_cargo = $v;\n\t\t\t$this->modifiedColumns[] = PersonaPeer::ID_CARGO;\n\t\t}\n\n\t\tif ($this->aCargo !== null && $this->aCargo->getIdCargo() !== $v) {\n\t\t\t$this->aCargo = null;\n\t\t}\n\n\t\treturn $this;\n\t}",
"private function getCuestionarioId(){\n\t\treturn $this->cuestionario_id;\n\t}",
"public function getIdCargadisca()\n {\n return $this->id_cargadisca;\n }",
"public function getIdcargoadmision()\n {\n\n return $this->idcargoadmision;\n }",
"public function getIdcuenta()\n {\n return $this->idcuenta;\n }",
"public function getIdCarga()\n {\n return $this->id_carga;\n }",
"public function getCargo()\n {\n return $this->cargo;\n }",
"function getId_ciudad() {\n return $this->id_ciudad;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes the last handler. | public function removeLastHandler()
{
array_shift($this->handlerStack);
} | [
"public function clearHandlers()\n {\n\n $this->_handlers = [];\n\n }",
"public function clearHandlers()\n {\n $this->handlers = [];\n }",
"function ClearHandlers(){}",
"public static function clearRegisteredHandlers(): void\n {\n self::$handlers = [];\n }",
"public function clear()\n {\n $handlers = array();\n\n while (null !== ($handler = $this->pop())) {\n $handlers[] = $handler;\n }\n\n return $handlers;\n }",
"public static function getLastRegisteredHandler() {\n return self::$lastRegisteredHandler;\n }",
"public function popHandler() {\n\t\tif (! $this->handlers) {\n\t\t\tthrow new \\LogicException('You tried to pop from an empty handler stack.');\n\t\t}\n\n\t\treturn array_shift($this->handlers);\n\t}",
"public function removeHandlerGroups(){\n foreach($this->getHandlerGroups() as $handlerKey){\n $this->removeHandlerGroup($handlerKey);\n }\n }",
"public function removeEventHandler() {\n\t}",
"public function clearHandlers()\n {\n $this->eventHandlers = [];\n }",
"public function unregister()\n {\n $previousHandlers = $this->previousHandlers;\n\n foreach ($previousHandlers as $signal => $handler) {\n if (is_null($handler)) {\n pcntl_signal($signal, SIG_DFL);\n\n unset($previousHandlers[$signal]);\n }\n }\n\n $this->setHandlers($previousHandlers);\n }",
"public function removeLast();",
"public function removeLast(): void\n {\n $this->size--;\n }",
"public function removeHandler(\\Closure $handler)\n {\n unset($this->_handlers[array_search($handler, $this->_handlers)]);\n }",
"public static function clearAllHandlers(): void\n {\n foreach (self::registeredSignals() as $signal) {\n self::clearHandlers($signal);\n }\n }",
"protected function cleanupEventHandlers() {\n\t\t$this->eventHandlers = [];\n\t\t//Daemon::log('clean up event handlers '.get_class($this). ' -- '.$this->attrs->server['REQUEST_URI']. PHP_EOL .Debug::backtrace());\n\t}",
"public function clearMessageHandlers()\n {\n $this->messageHandlers = [];\n }",
"public function clear(): HandlersList\n {\n $this->handlers = [];\n $this->update();\n return $this;\n }",
"public function detach(Handler $handler);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Youtube video shortcode. [youtubevideo id="Scxs7L0vhZ4" caption="Et lite stykke Norge." /] | function youtube_video($atts) {
$video_id = $atts['id'];
$caption = $atts['caption'];
$html = '';
if ($video_id) {
$html = '<figure>'
. '<span class="video yt">'
//. '<iframe width="100%" height="auto" src="//www.youtube.com/embed/' . $video_id . '?theme=dark&wmode=transparent&html5=1" frameborder="0" allowfullscreen></iframe>'
. '<iframe width="560" height="349" src="//www.youtube.com/embed/' . $video_id . '?theme=dark&wmode=transparent&html5=1" allowfullscreen></iframe>'
. '</span>';
if ($caption) {
$html .= '<figcaption>'
. '<p>' . $caption . '</p>'
. '</figcaption>';
}
$html .= '</figure>';
}
return $html;
} | [
"function rb_youtubesc( $atts, $content = null ) {\n\textract(shortcode_atts(array(\n\t\t'id' => '',\n\t), $atts ) );\n\t\n\t$resultado = '<div class=\"flex-video\"><iframe src=\"//www.youtube.com/embed/'.$id.'\" allowfullscreen=\"\" frameborder=\"0\"></iframe></div>';\n\treturn $resultado;\n}",
"function YouTube($atts, $content = null) {\r\n\t\t$height = get_option(\"kwheight\");\r\n\t\t$width = get_option(\"kwwidth\");\r\n extract(shortcode_atts(array( \"id\" => '' ), $atts));\r\n\t\treturn '<div id=\"video\"><iframe width=\"'.$width.'\" height=\"'.$height.'\" src=\"http://www.youtube.com/embed/'.$id.'\" frameborder=\"0\" allowfullscreen></iframe></div>';}",
"function embed_yt_func(array $atts) {\n $out = '';\n $a = shortcode_atts( array(\n 'id' => '',\n ), $atts );\n $opts = implode(\"&\", array(\n \"color=white\",\n \"rel=0\",\n \"showinfo=0\"\n ));\n $id = $a['id'];\n $src = \"https://www.youtube.com/embed/{$id}?{$opts}\";\n \n $out .= '<div class=\"iframe-container\">';\n $out .= \"<iframe class=\\\"iframe\\\" src={$src} frameborder=\\\"0\\\" allow=\\\"autoplay; encrypted-media\\\" allowfullscreen></iframe>\";\n $out .= '</div>';\n\n return $out;\n }",
"function vye_video_name_shortcode( $paras = '', $content = '' ) {\r\n\r\n\t// Extract the ID if a full URL has been specified\r\n\r\n\t$id = vye_extract_id( $content );\r\n\r\n\t// Check what type of video it is and whether it's valid\r\n\r\n\t$return = vye_validate_id( $id, true );\r\n\tif ( !$return[ 'type' ] ) { return vye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) ); }\r\n\tif ( strlen( $return[ 'type' ] ) != 1 ) { return vye_error( $return[ 'type' ] ); }\r\n\r\n\t// Return the video title\r\n\r\n\treturn do_shortcode( $return['title'] );\r\n}",
"public function go_pricing_youtube_shortcode( $atts, $content = null ) {\r\n\t\t\textract( shortcode_atts( array( \r\n\t\t\t\t'autoplay' => 'no',\r\n\t\t\t\t'https' => 'no',\t\r\n\t\t\t\t'video_id' => '',\r\n\t\t\t\t'height' => 'auto',\r\n\t\t\t ), $atts ) );\t\r\n\t\t\r\n\t\t\t$autoplay = $autoplay == 'yes' ? '1' : '';\r\n\t\t\t$https = $https == 'yes' ? 's' : '';\r\n\t\t\t$width = '1000';\r\n\t\t\t$style = $height != 'auto' ? 'height:'.$height.'px !important; padding:0 !important;' : '';\r\n\t\t\treturn '<div class=\"gw-go-video-wrapper\"' . ( $style != '' ? ' style=\"' . $style . '\"' : '' ) .'><iframe src=\"http' . $https . '://www.youtube.com/embed/' . esc_attr( $video_id ) . '?wmode=opaque&controls=1&showinfo=1&autohide=1&rel=0&autoplay=' . $autoplay . '\" width=\"' . $width . '\" height=\"' . $height . '\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\"></iframe></div>';\r\n\t\t}",
"function embed_youtube_shortcode($atts) {\n $a = shortcode_atts( array(\n 'id' => false,\n 'ad' => false,\n ), $atts );\n\n if (!$a['id']) {\n return '';\n }\n\n if($a['ad']) {\n $ad = '<div class=\"embed-ad\">' . IGV_get_option('_igv_ads_embed_' . $a['ad']) . '</div>';\n $html = '<div class=\"custom-embed-with-ad u-cf\"><div class=\"embed\"><div class=\"responsive-video\"><iframe src=\"https://www.youtube.com/embed/' . $a['id'] .'\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"></iframe></div></div>' . $ad . '</div>';\n } else {\n $html = '<div class=\"custom-embed\"><div class=\"responsive-video\"><iframe src=\"https://www.youtube.com/embed/' . $a['id'] . '\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"></iframe></div></div>';\n }\n\n return $html;\n}",
"function jetpack_amp_youtube_shortcode( $url ) {\n\t_deprecated_function( __FUNCTION__, 'jetpack-9.1.0', 'youtube_id' );\n\t$video_id = jetpack_get_youtube_id( $url );\n\tif ( empty( $video_id ) ) {\n\t\treturn sprintf(\n\t\t\t'<a href=\"%1$s\" class=\"amp-wp-embed-fallback\">%1$s</a>',\n\t\t\tesc_url( $url )\n\t\t);\n\t}\n\n\t$sanitized_url = youtube_sanitize_url( $url );\n\t$parsed_url = wp_parse_url( $sanitized_url );\n\t$args = jetpack_shortcode_youtube_args( $parsed_url );\n\tlist( $width, $height ) = jetpack_shortcode_youtube_dimensions( $args );\n\treturn sprintf(\n\t\t'<amp-youtube data-videoid=\"%s\" layout=\"responsive\" width=\"%d\" height=\"%d\"></amp-youtube>',\n\t\tesc_attr( $video_id ),\n\t\tabsint( $width ),\n\t\tabsint( $height )\n\t);\n}",
"function vye_video_shortcode_alt2( $paras = '', $content = '' ) {\r\n\treturn do_shortcode( vye_video_shortcode( $paras, $content, '', 2 ) );\r\n}",
"function youtube_iframe($atts){\r\r\n\t\textract(shortcode_atts(array(\r\r\n\t\t\t'link'\t\t=> '',\r\r\n\t\t\t'largura'\t=> '680',\r\r\n\t\t\t'altura'\t=> '360',\r\r\n\t\t), $atts));\r\r\n\t\treturn '<iframe class=\"yt-video\" width=\"'.$largura.'\" height=\"'.$altura.'\" src=\"http://www.youtube.com/embed/'.youtube_code($link).'\" frameborder=\"0\" allowfullscreen></iframe>';\r\r\n\t}",
"function vye_video_shortcode_alt1( $paras = '', $content = '' ) {\r\n\treturn do_shortcode( vye_video_shortcode( $paras, $content, '', 1 ) );\r\n}",
"function produzioni_video_shortcode( $atts ) {\n\t\n\t// imposto costante GOT_VIDEO per indicare al layout principale che ho già utilizzato lo shortcode e che quindi non lo deve inserire nel normale flusso pagina\n\tdefine('GOT_VIDEO', true);\n\t\n\t$post_id = get_the_ID();\n\t\n\t// recupero link video (TODO: controllare che sia effettivamente un iframe)\n\t$videolink = get_post_meta($post_id, \"videolink-film\", true);\n\t\n\tif(empty($videolink)) return \"\"; // se non c'è link video restituisco stringa vuota\n\tob_start();\n\t?>\n\t<!-- VIDEO --------------------------------------------------------->\n\t<h3 class=\"title-heading-left\"><?php echo strtoupper( get_post_meta($post->ID, \"titolo-videolink-film\", true) ); ?></h3>\n\t<div class=\"videolink\">\n\t\t<?php echo $videolink; ?>\n\t</div>\t\t\t\t\t\t\n\t<!-- FINE VIDEO --------------------------------------------------------->\n\t<?php \n\t$output = ob_get_contents();\n\tob_end_clean();\t\t\n\t\n\treturn $output;\n\t\n}",
"function yt_get_video_code( $video_id, $width, $height ){\n\n $code = \"<object width=\\\"\";\n $code .= $width;\n $code .= \"\\\" height=\\\"\";\n $code .= $height;\n $code .= \"\\\">\";\n $code.='<param name=\"movie\" value=\"https://youtube.googleapis.com/v/'.$video_id.'?version=2&fs=1\"></param>';\n $code.='<param name=\"allowFullScreen\" value=\"true\"></param>';\n $code.='<param name=\"allowScriptAccess\" value=\"always\"></param>';\n\n $code.=\"<param name=\\\"wmode\\\" value=\\\"transparent\\\" ></param><embed src=\\\"https://youtube.googleapis.com/v/\".$video_id.\"?version=2&fs=1\\\"\";\n $code .= \"\\\" type=\\\"application/x-shockwave-flash\\\" wmode=\\\"transparent\\\" width=\\\"\";\n $code .= $width;\n $code .= \"\\\" height=\\\"\";\n $code .= $height;\n $code .= \"\\\" allowfullscreen=\\\"true\\\" allowscriptaccess=\\\"always\\\"></embed></object>\";\n\n\t\n\n return $code;\n}",
"public function getYouTubeEmbedCode()\n\t{\n\t\treturn str_replace('%YOU_TUBE_VIDEO_ID%', $this->you_tube_video_id, \\Config::get($this->getConfigPrefix().'you_tube.embed_code'));\n\t}",
"function add_youtube_shortcode() {\n\tif ( ! is_admin() ) {\n\t\tadd_shortcode( 'youtube', '\\wpinc\\medi\\_sc_youtube' );\n\t}\n}",
"function podcast_pro_show_the_video() {\n\t// Do nothing if we have no video to embed.\n\tif ( ! genesis_get_custom_field( 'youtube_id' ) ) {\n\t\treturn;\n\t}\n\n\t$attr = array(\n\t\t'src' => esc_url( \"http://youtube.com/watch?v=\" . genesis_get_custom_field( 'youtube_id' ) ),\n\t\t'width' => 740,\n\t);\n\techo '<div class=\"podcast-top\">';\n\t\techo wp_video_shortcode( $attr );\n\techo '</div>';\n}",
"function thee_youtube_embed_link($id)\n{\n return 'https://www.youtube.com/embed/' . $id . '?rel=0&autoplay=1&rel=0';\n}",
"function customShortcode_adwordsYoutube( $atts )\r\n{\r\n $a = shortcode_atts( array(\r\n 'videoid' => '',\r\n\t\t'conversionid' => '',\r\n\t\t'conversionlabel' => ''\r\n ), $atts );\r\n\r\n\t?>\r\n\t<style>\r\n\t\t.cs-adwordsyoutube-wrapper \r\n\t\t{\r\n\t\t \tdisplay: inline-block;\r\n\t\t\t\r\n \t\t\twidth: 100%;\r\n\t\t\t\r\n\t\t \tposition: relative;\r\n\t\t}\r\n\t\t.cs-adwordsyoutube-wrapper:after\r\n\t\t{\r\n\t \t\tcontent: '';\r\n\t\t\t\r\n\t \t\tdisplay: block;\r\n\t\t\t\r\n\t \t\tpadding-top: 56.25%;\r\n\t\t}\r\n\t\t.cs-adwordsyoutube\r\n\t\t{\r\n\t\t position: absolute;\r\n\t\t top: 0;\r\n\t\t bottom: 0;\r\n\t\t left: 0;\r\n\t\t right: 0;\r\n\t\t}\r\n\t\t.cs-adwordsyoutube iframe\r\n\t\t{\r\n/*\t\t\tmargin-top: -50px;*/\r\n\t\t\tpadding-bottom: 30px;\r\n\t\t\tpadding-left: 15px;\r\n\t\t\tpadding-right: 15px;\r\n\t\t}\r\n\t</style>\r\n\t<div class=\"cs-adwordsyoutube-wrapper\">\r\n\t\t<div class=\"cs-adwordsyoutube\">\r\n\t\t\t<!-- Google Code for Video Conversion Page\r\n\t\t\tIn your html page, add the snippet and call\r\n\t\t\tgoog_report_conversion when someone clicks on the\r\n\t\t\tchosen link or button. -->\r\n\t\t\t<script type=\"text/javascript\">\r\n\t\t\t/* <![CDATA[ */\r\n\t\t\tgoog_snippet_vars = function() {\r\n\t\t\tvar w = window;\r\n\t\t\tw.google_conversion_id = \"<?php echo $a[ 'conversionid' ]; ?>\";\r\n\t\t\tw.google_conversion_label = \"<?php echo $a[ 'conversionlabel' ]; ?>\";\r\n\t\t\tw.google_remarketing_only = false;\r\n\t\t\t}\r\n\t\t\t// DO NOT CHANGE THE CODE BELOW.\r\n\t\t\tgoog_report_conversion = function(url) \r\n\t\t\t{\r\n\t\t\t\tgoog_snippet_vars();\r\n\t\t\t\twindow.google_conversion_format = \"3\";\r\n\t\t\t\tvar opt = new Object();\r\n\t\t\t\topt.onload_callback = function() \r\n\t\t\t\t{\r\n\t\t\t\t\tif (typeof(url) != 'undefined') \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twindow.location = url;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar conv_handler = window['google_trackConversion'];\r\n\t\t\t\tif (typeof(conv_handler) == 'function') {\r\n\t\t\t\tconv_handler(opt);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/* ]]> */\r\n\t\t\t</script>\r\n\t\t\t<script type=\"text/javascript\"\r\n\t\t\tsrc=\"//www.googleadservices.com/pagead/conversion_async.js\">\r\n\t\t\t</script>\r\n\t\t\t<!-- 1. The <iframe> (and video player) will replace this <div> tag. -->\r\n\t\t\t<div id=\"player\"></div>\r\n\r\n\t\t\t<script>\r\n\t\t\t // 2. This code loads the IFrame Player API code asynchronously.\r\n\t\t\t var tag = document.createElement('script');\r\n\r\n\t\t\t tag.src = \"https://www.youtube.com/iframe_api\";\r\n\t\t\t var firstScriptTag = document.getElementsByTagName('script')[0];\r\n\t\t\t firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\r\n\r\n\t\t\t // 3. This function creates an <iframe> (and YouTube player)\r\n\t\t\t // after the API code downloads.\r\n\t\t\t var player;\r\n\t\t\t function onYouTubeIframeAPIReady() {\r\n\t\t\t\tplayer = new YT.Player('player', {\r\n\t\t\t\t height: '100%',\r\n\t\t\t\t width: '100%',\r\n\t\t\t\t videoId: '<?php echo $a['videoid']; ?>',\r\n\t\t\t\t events: {\r\n\t\t\t\t\t'onReady': onPlayerReady,\r\n\t\t\t\t\t'onStateChange': onPlayerStateChange\r\n\t\t\t\t }\r\n\t\t\t\t});\r\n\t\t\t }\r\n\r\n\t\t\t // 4. The API will call this function when the video player is ready.\r\n\t\t\t function onPlayerReady(event) {}\r\n\r\n\t\t\t // 5. The API calls this function when the player's state changes.\r\n\t\t\t // The function indicates that when playing a video (state=1),\r\n\t\t\t // the player should play for six seconds and then stop.\r\n\t\t\t var done = false;\r\n\t\t\t function onPlayerStateChange(event) {\r\n\t\t\t\tif (event.data == YT.PlayerState.PLAYING && !done) {\r\n\t\t\t\t\tvar url = window.location.href;\r\n\t\t\t\t goog_report_conversion();\r\n\t\t\t\t done = true;\r\n\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t function stopVideo() {\r\n\t\t\t\tplayer.stopVideo();\r\n\t\t\t }\r\n\t\t\t</script>\r\n\t\t</div>\r\n\t\t</div>\r\n\t<?php\r\n}",
"function youtubeParse($vCode) {\r\n\treturn '<object width=\"425\" height=\"350\"><param name=\"movie\" value=\"http://www.youtube.com/v/'.$vCode.'\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.youtube.com/v/'.$vCode.'\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"></embed></object>';\r\n}",
"function zg_expand_shortcode($message) {\n $message = preg_replace(\n [\n '/\\[yt:([-A-Za-z0-9]+)\\]/i',\n ],\n [\n ' <a href=\"external://youtu.be/\\1\" class=\"needs-web-title\">YouTube: \\1</a> ',\n ],\n $message\n );\n return $message;\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns amount of overlapping content | function goodwish_edge_overlapping_content_amount() {
return 75;
} | [
"public function getNumOccupied()\n {\n $total = 0;\n foreach ($this->positions as $pos) {\n if ($pos->isOccupied()) {\n $total ++;\n }\n }\n return $total;\n }",
"public function getContentsCount()\n {\n return $this->count(self::_CONTENTS);\n }",
"public function getBehindCount()\n {\n if ($this->data->mode == self::GIT) {\n return count($this->data->behind);\n }\n\n return 0;\n }",
"public function nbMatchLeft() {\n $total = 0; $totalEnd = 0;\n foreach($this->getGroups() as $group)\n {\n $total += count($group->getMatchs());\n foreach($group->getMatchs() as $match)\n {\n if($match->getStatus() == \"END\") $totalEnd ++;\n }\n }\n return $total - $totalEnd;\n }",
"public function count()\n {\n return count($this->holes);\n }",
"public function inlineTemplateRegionCount(): int;",
"public function count()\n {\n return count($this->pageContent);\n }",
"public function numContentBlocks()\n {\n return count($this->contentBlocks());\n }",
"private function getPositionForThisSection(){\n $this->db->select(\"count(id) as totalSections\");\n $this->db->from(\"section\");\n $query = $this->db->get();\n if($query->num_rows() > 0){\n $result = $query->result();\n $numberOfSections = $result[0]->totalSections;\n }\n\n return $numberOfSections;\n }",
"public function getNbEmplacementsOccupes() {\r\n return $this->_nbEmplacementsTotal - $this->_nbEmplacementsLibres;\r\n }",
"public function getSharedLayoutsCount(bool $includeDrafts = false): int;",
"function getStaticContentCount( ) {\n\t\treturn JApplicationHelper::getStaticContentCount( );\n\t}",
"function find_max_overlap($ol_ranges) {\n\n\t$count = 0;\n\tforeach ($ol_ranges as $loop_range) {\n\t\tif ($count < $loop_range['count'])\n\t\t\t$count = $loop_range['count'];\n\t}\n\n\treturn $count;\n}",
"public function count_matched_subpatterns() {\n return count($this->index_first) - 1;//-1 to not include full match\n }",
"public function getSpanCount()\n {\n return $this->count(self::SPAN);\n }",
"public function getGroupLength()\n {\n if (isset($this->data[$this->position]) == true) {\n return count($this->data[$this->position]);\n }\n\n return 0;\n }",
"public function count(): int\n {\n return count($this->blocks);\n }",
"function countOverlapping(array $intervals, int $point) : int\n{\n return count(array_filter($intervals, function ($interval) use ($point) {\n $lowerBoundary = $interval[0];\n $upperBoundary = $interval[1];\n\n return $point >= $lowerBoundary && $point <= $upperBoundary;\n }));\n}",
"public function count(){\n $count = preg_match_all('@<loc>(.+?)<\\/loc>@', $this->getDataSitemap(), $matches);\n return $count;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
helper method to read chunked response body The method implements the pseudo code given in RFC 2616 section 19.4.6: Introduction of TransferEncoding. Chunk extensions are ignored. | private function readChunked()
{
$readLength = 0;
$chunksize = null;
$extension = null;
$body = '';
sscanf($this->inputStream->readLine(1024), "%x%s\r", $chunksize, $extension);
while (0 < $chunksize) {
$data = $this->inputStream->read($chunksize + 2);
$body .= rtrim($data);
$readLength += $chunksize;
sscanf($this->inputStream->readLine(1024), "%x\r", $chunksize);
}
$this->headers->put('Content-Length', $readLength);
$this->headers->remove('Transfer-Encoding');
return $body;
} | [
"private function readChunk() {\n\t\t// Handle content length\n\t\tif ($this->contentLength > 0) {\n\t\t\t// End of buffer\n\t\t\tif ($this->contentIndex >= $this->contentLength) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\t// Calculate chunk size to read\n\t\t\t$size = $this->contentLength - $this->contentIndex;\n\t\t\t$size = $size < $this->bufferSize ? $size : $this->bufferSize;\n\t\t\t$data = $this->fread($size);\n\n\t\t\t// Debug chunk size\n\t\t\tif ($this->client->getLogLevel() >= 3) {\n\t\t\t\t$this->client->log(\"- Chunk size: \" . strlen($data));\n\t\t\t}\n\n\t\t\treturn $data;\n\t\t}\n\n\t\t// Handle chunked transfer encoding\n\t\tif ($this->transferEncoding === \"chunked\") {\n\t\t\tif ($this->chunkLength === 0) {\n\t\t\t\t$line = $this->readLine($this->bufferSize);\n\n\t\t\t\t// Curl can produce empty response if first chunk length is 0\n\t\t\t\tif ($line === '') {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\n\t\t\t\tif (!preg_match('/^([0-9a-f]+)/i', $line, $matches)) {\n\t\t\t\t\tthrow new MOXMAN_Http_HttpClientException(\"Invalid chunk length: \" . $line);\n\t\t\t\t} else {\n\t\t\t\t\t$this->chunkLength = hexdec($matches[1]);\n\t\t\t\t\t$this->chunkedContentLength += $this->chunkLength;\n\n\t\t\t\t\t// Chunk with zero length indicates the end\n\t\t\t\t\tif ($this->chunkLength === 0) {\n\t\t\t\t\t\t$this->contentLength = $this->chunkedContentLength;\n\t\t\t\t\t\t$this->readLine();\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$data = $this->fread(min($this->chunkLength, $this->bufferSize));\n\t\t\t$this->chunkLength -= strlen($data);\n\n\t\t\tif ($this->chunkLength === 0) {\n\t\t\t\t$this->readLine(); // Trailing CRLF\n\t\t\t}\n\n\t\t\t// Debug chunk size\n\t\t\tif ($this->client->getLogLevel() >= 3) {\n\t\t\t\t$this->client->log(\"- Chunk size: \" . strlen($data));\n\t\t\t}\n\n\t\t\treturn $data;\n\t\t}\n\n\t\treturn \"\";\n\t}",
"public static function decodeChunkedBody($body)\n {\n // Added by Dan S. -- don't fail on Transfer-encoding:chunked response\n //that isn't really chunked\n if (! preg_match(\"/^([\\da-fA-F]+)[^\\r\\n]*\\r\\n/sm\", trim($body), $m)) {\n return $body;\n }\n \n $decBody = '';\n // If mbstring overloads substr and strlen functions, we have to\n // override it's internal encoding\n if (function_exists('mb_internal_encoding') &&\n ((int) ini_get('mbstring.func_overload')) & 2) {\n $mbIntEnc = mb_internal_encoding();\n mb_internal_encoding('ASCII');\n }\n while (trim($body)) {\n if (! preg_match(\"/^([\\da-fA-F]+)[^\\r\\n]*\\r\\n/sm\", $body, $m)) {\n \n throw new Exception(\"Error parsing body - doesn't seem to be a chunked message\");\n }\n $length = hexdec(trim($m[1]));\n $cut = strlen($m[0]);\n $decBody .= substr($body, $cut, $length);\n $body = substr($body, $cut + $length + 2);\n }\n if (isset($mbIntEnc)) {\n mb_internal_encoding($mbIntEnc);\n }\n return $decBody;\n }",
"protected function _httpChunkedDecode($body) {\n\t\tif (stripos($this->headers('Transfer-Encoding'), 'chunked') === false) {\n\t\t\treturn $body;\n\t\t}\n\t\t$stream = fopen('data://text/plain;base64,' . base64_encode($body), 'r');\n\t\tstream_filter_append($stream, 'dechunk');\n\t\treturn trim(stream_get_contents($stream));\n\t}",
"function chunkTransferDecode($body) {\n\t\t$body = str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $body);\n\t\t// The body is not chunked encoding or is malformed.\n\t\tif ( ! preg_match( '/^[0-9a-f]+(\\s|\\n)+/mi', trim($body) ) )\n\t\t\treturn $body;\n\n\t\t$parsedBody = '';\n\t\t//$parsedHeaders = array(); Unsupported\n\n\t\twhile ( true ) {\n\t\t\t$hasChunk = (bool) preg_match( '/^([0-9a-f]+)(\\s|\\n)+/mi', $body, $match );\n\n\t\t\tif ( $hasChunk ) {\n\t\t\t\tif ( empty( $match[1] ) )\n\t\t\t\t\treturn $body;\n\n\t\t\t\t$length = hexdec( $match[1] );\n\t\t\t\t$chunkLength = strlen( $match[0] );\n\n\t\t\t\t$strBody = substr($body, $chunkLength, $length);\n\t\t\t\t$parsedBody .= $strBody;\n\n\t\t\t\t$body = ltrim(str_replace(array($match[0], $strBody), '', $body), \"\\n\");\n\n\t\t\t\tif ( \"0\" == trim($body) )\n\t\t\t\t\treturn $parsedBody; // Ignore footer headers.\n\t\t\t} else {\n\t\t\t\treturn $body;\n\t\t\t}\n\t\t}\n\t}",
"public static function decodeChunkedBody($body)\n {\n $decBody = '';\n\n // If mbstring overloads substr and strlen functions, we have to\n // override it's internal encoding\n if (function_exists('mb_internal_encoding') &&\n ((int) ini_get('mbstring.func_overload')) & 2) {\n\n $mbIntEnc = mb_internal_encoding();\n mb_internal_encoding('ASCII');\n }\n\n while (trim($body)) {\n if (! preg_match(\"/^([\\da-fA-F]+)[^\\r\\n]*\\r\\n/sm\", $body, $m)) {\n require_once 'Zend/Http/Exception.php';\n throw new Zend_Http_Exception(\"Error parsing body - doesn't seem to be a chunked message\");\n }\n\n $length = hexdec(trim($m[1]));\n $cut = strlen($m[0]);\n $decBody .= substr($body, $cut, $length);\n $body = substr($body, $cut + $length + 2);\n }\n\n if (isset($mbIntEnc)) {\n mb_internal_encoding($mbIntEnc);\n }\n\n return $decBody;\n }",
"function _decodeChunkedBody($body) {\n\n\t\tif (!is_string($body)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$decodedBody = null;\n\t\t$chunkLength = null;\n\n\t\twhile ($chunkLength !== 0) {\n\n\t\t\t// body is not chunked or is malformed\n\t\t\tif (!preg_match(\"/^([0-9a-f]+) *(?:;(.+)=(.+))?\\r\\n/iU\", $body, $match)) {\n\t\t\t\treturn $body;\n\t\t\t}\n\n\t\t\t$chunkSize = 0;\n\t\t\t$hexLength = 0;\n\t\t\t$chunkExtensionName = '';\n\t\t\t$chunkExtensionValue = '';\n\t\t\tif (isset($match[0])) {\n\t\t\t\t$chunkSize = $match[0];\n\t\t\t}\n\t\t\tif (isset($match[1])) {\n\t\t\t\t$hexLength = $match[1];\n\t\t\t}\n\t\t\tif (isset($match[2])) {\n\t\t\t\t$chunkExtensionName = $match[2];\n\t\t\t}\n\t\t\tif (isset($match[3])) {\n\t\t\t\t$chunkExtensionValue = $match[3];\n\t\t\t}\n\n\t\t\t$body = substr($body, strlen($chunkSize));\n\t\t\t$chunkLength = hexdec($hexLength);\n\t\t\t$chunk = substr($body, 0, $chunkLength);\n\t\t\t$decodedBody .= $chunk;\n\t\t\t\n\t\t\tif ($chunkLength !== 0) {\n\t\t\t\t$body = substr($body, $chunkLength + strlen(\"\\r\\n\"));\n\t\t\t}\n\t\t}\n\n\t\treturn $decodedBody;\n\t}",
"public function read()\n {\n // First, read headers only\n $response = '';\n $gotStatus = false;\n\n while (($line = @fgets($this->socket)) !== false) {\n $gotStatus = $gotStatus || (strpos($line, 'HTTP') !== false);\n if ($gotStatus) {\n $response .= $line;\n if (rtrim($line) === '') break;\n }\n }\n\n $this->_checkSocketReadTimeout();\n\n\n\n $responseInfo = explode(\"\\r\\n\\r\\n\", $response);\n $this->responseHeader = new Headers();\n $this->responseHeader->loadHeadersFromString($responseInfo[0]);\n\n $statusCode = $this->responseHeader->getStatusCode();\n\n // Handle 100 and 101 responses internally by restarting the read again\n if ($statusCode == 100 || $statusCode == 101) return $this->read();\n\n /**\n * Responses to HEAD requests and 204 or 304 responses are not expected\n * to have a body - stop reading here\n */\n if ($statusCode == 304 || $statusCode == 204 ||\n $this->method == 'head') {\n\n // Close the connection if requested to do so by the server\n if ($this->responseHeader->getHeader('connection') == 'close') {\n $this->close();\n }\n return $response;\n }\n\n // If we got a 'transfer-encoding: chunked' header\n if ($this->responseHeader->getHeader('transfer-encoding')) {\n\n if (strtolower($this->responseHeader->getHeader('transfer-encoding')) == 'chunked') {\n\n do {\n $line = @fgets($this->socket);\n $this->_checkSocketReadTimeout();\n\n $chunk = $line;\n\n // Figure out the next chunk size\n $chunksize = trim($line);\n if (! ctype_xdigit($chunksize)) {\n $this->close();\n throw new Exception('Invalid chunk size \"' .\n $chunksize . '\" unable to read chunked body');\n }\n\n // Convert the hexadecimal value to plain integer\n $chunksize = hexdec($chunksize);\n\n // Read next chunk\n $read_to = ftell($this->socket) + $chunksize;\n\n do {\n $current_pos = ftell($this->socket);\n if ($current_pos >= $read_to) break;\n\n if($this->out_stream) {\n if(stream_copy_to_stream($this->socket, $this->out_stream, $read_to - $current_pos) == 0) {\n $this->_checkSocketReadTimeout();\n break;\n }\n } else {\n $line = @fread($this->socket, $read_to - $current_pos);\n if ($line === false || strlen($line) === 0) {\n $this->_checkSocketReadTimeout();\n break;\n }\n $chunk .= $line;\n }\n } while (! feof($this->socket));\n\n $chunk .= @fgets($this->socket);\n $this->_checkSocketReadTimeout();\n\n if(!$this->out_stream) {\n $response .= $chunk;\n }\n } while ($chunksize > 0);\n } else {\n $this->close();\n throw new Exception('Cannot handle \"' .\n $this->responseHeader->getHeader('transfer-encoding') . '\" transfer encoding');\n }\n\n // We automatically decode chunked-messages when writing to a stream\n // this means we have to disallow the Zend_Http_Response to do it again\n if ($this->out_stream) {\n $response = str_ireplace(\"Transfer-Encoding: chunked\\r\\n\", '', $response);\n }\n // Else, if we got the content-length header, read this number of bytes\n } elseif ($this->responseHeader->getHeader('content-length')) {\n $contentLength = $this->responseHeader->getHeader('content-length');\n // If we got more than one Content-Length header (see ZF-9404) use\n // the last value sent\n if (is_array($contentLength)) {\n $contentLength = $contentLength[count($contentLength) - 1];\n }\n\n $current_pos = ftell($this->socket);\n $chunk = '';\n\n for ($read_to = $current_pos + $contentLength;\n $read_to > $current_pos;\n $current_pos = ftell($this->socket)) {\n\n if($this->out_stream) {\n if(@stream_copy_to_stream($this->socket, $this->out_stream, $read_to - $current_pos) == 0) {\n $this->_checkSocketReadTimeout();\n break;\n }\n } else {\n $chunk = @fread($this->socket, $read_to - $current_pos);\n if ($chunk === false || strlen($chunk) === 0) {\n $this->_checkSocketReadTimeout();\n break;\n }\n\n $response .= $chunk;\n }\n\n // Break if the connection ended prematurely\n if (feof($this->socket)) break;\n }\n\n // Fallback: just read the response until EOF\n } else {\n\n do {\n if($this->out_stream) {\n if(@stream_copy_to_stream($this->socket, $this->out_stream) == 0) {\n $this->_checkSocketReadTimeout();\n break;\n }\n } else {\n $buff = @fread($this->socket, 8192);\n if ($buff === false || strlen($buff) === 0) {\n $this->_checkSocketReadTimeout();\n break;\n } else {\n $response .= $buff;\n }\n }\n\n } while (feof($this->socket) === false);\n\n $this->close();\n }\n\n // Close the connection if requested to do so by the server\n if ($this->responseHeader->getHeader('connection') == 'close') {\n $this->close();\n }\n\n return $response;\n }",
"function _readChunked()\n {\n // at start of the next chunk?\n if (0 == $this->_chunkLength) {\n $line = $this->_sock->readLine();\n if (preg_match('/^([0-9a-f]+)/i', $line, $matches)) {\n $this->_chunkLength = hexdec($matches[1]); \n // Chunk with zero length indicates the end\n if (0 == $this->_chunkLength) {\n $this->_sock->readLine(); // make this an eof()\n return '';\n }\n } else {\n return '';\n }\n }\n $data = $this->_sock->read($this->_chunkLength);\n $this->_chunkLength -= HTTP_REQUEST_MBSTRING? mb_strlen($data, 'iso-8859-1'): strlen($data);\n if (0 == $this->_chunkLength) {\n $this->_sock->readLine(); // Trailing CRLF\n }\n return $data;\n }",
"public function read() {\n\t\t// For head requests\n\t\tif ($this->isEmptyBody) {\n\t\t\t$this->close();\n\t\t\treturn \"\";\n\t\t}\n\n\t\t// Currently we don't support any content encodings like gzip or deflate\n\t\t// TODO: Implement this if needed\n\t\tif ($this->contentEncoding) {\n\t\t\tthrow new MOXMAN_Http_HttpClientException(\"Unsupported content encoding: \" . $this->contentEncoding);\n\t\t}\n\n\t\t// Read uncompressed chunk\n\t\t$data = $this->readChunk();\n\n\t\t// Close connection when there is no more data\n\t\tif ($data === \"\") {\n\t\t\t$this->close();\n\t\t}\n\n\t\treturn $data;\n\t}",
"function parse_body($body, $chunked = false) {\n\t\tif (!$chunked) {\n\t\t\treturn $body;\n\t\t}\n\n\t\t$result = '';\n\t\t$pointer = 0;\n\n\t\twhile($pointer < strlen($body)) {\n\t\t\t$chunkstring = substr($body, $pointer, strpos($body, \"\\r\\n\", $pointer) - $pointer);\n\t\t\t$chunksize = hexdec($chunkstring);\n\n\t\t\tif ($chunksize == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$pointer += strlen($chunkstring) + 2;\n\t\t\t$result .= substr($body, $pointer, $chunksize);\n\t\t\t$pointer += $chunksize + 2;\n\n\t\t}\n\n\t\treturn $result;\n\n\t}",
"function http_chunked_decode($chunk) {\n $pos = 0;\n $len = strlen($chunk);\n $dechunk = null;\n\n while (($pos < $len) && ($chunkLenHex = substr($chunk, $pos, ($newlineAt = strpos($chunk, \"\\n\" , $pos + 1)) - $pos))) {\n $pos = $newlineAt + 1;\n $chunkLen = hexdec(rtrim($chunkLenHex, \"\\r\\n\"));\n $dechunk .= substr($chunk, $pos, $chunkLen);\n $pos = strpos($chunk, \"\\n\", $pos + $chunkLen) + 1;\n }\n\n return $dechunk;\n}",
"protected function readChunked($bufferSize)\r\n {\r\n // at start of the next chunk?\r\n if (0 == $this->chunkLength) {\r\n $line = $this->readLine($bufferSize);\r\n if (!preg_match('/^([0-9a-f]+)/i', $line, $matches)) {\r\n throw new HTTP_Request2_Exception(\r\n \"Cannot decode chunked response, invalid chunk length '{$line}'\"\r\n );\r\n } else {\r\n $this->chunkLength = hexdec($matches[1]);\r\n // Chunk with zero length indicates the end\r\n if (0 == $this->chunkLength) {\r\n $this->readLine($bufferSize);\r\n return '';\r\n }\r\n }\r\n }\r\n $data = $this->fread(min($this->chunkLength, $bufferSize));\r\n $this->chunkLength -= strlen($data);\r\n if (0 == $this->chunkLength) {\r\n $this->readLine($bufferSize); // Trailing CRLF\r\n }\r\n return $data;\r\n }",
"function chunk_split ($body, $chunklen = 76, $end = \"\\r\\n\") {}",
"function http_chunked_decode($encoded)\n {\n }",
"function http_chunked_decode($chunk)\n\t{\n $pos = 0;\n $len = strlen($chunk);\n $dechunk = null;\n\n while(($pos < $len)\n && ($chunkLenHex = substr($chunk,$pos, ($newlineAt = strpos($chunk,\"\\n\",$pos+1))-$pos)))\n {\n if (! $this->is_hex($chunkLenHex)) {\n trigger_error('Data is not properly chunk encoded', E_USER_ERROR);\n return $chunk;\n }\n\n $pos = $newlineAt + 1;\n $chunkLen = hexdec(rtrim($chunkLenHex,\"\\r\\n\"));\n $dechunk .= substr($chunk, $pos, $chunkLen);\n $pos = strpos($chunk, \"\\n\", $pos + $chunkLen) + 1;\n }\n return $dechunk;\n }",
"function normalizeResponseIfChunked() {\n\t\tif (($this->protocolVersion = '1.1') && (!$this->response->isResponseChunkDecoded)) {\n\t\t\tif ($this->responseHeadersAsObject) {\n\t\t\t\tif ($this->response->headers->headerExists('Transfer-Encoding') &&\n\t\t\t\t\t($this->response->headers->getHeader('Transfer-Encoding') == 'chunked')) {\n\t\t\t\t\t$this->response->message = $this->decodeChunkedData($this->response->getResponse());\n\t\t\t\t\t$this->response->isResponseChunkDecoded = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ((strpos($this->response->headers, 'Transfer-Encoding') !== false) &&\n\t\t\t\t\t(strpos($this->response->headers, 'chunked') !== false)){\n\t\t\t\t\t$this->response->message = $this->decodeChunkedData($this->response->getResponse());\n\t\t\t\t\t$this->response->isResponseChunkDecoded = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function _http_chunked_decode($chunk) {\n $pos = 0;\n $len = strlen($chunk);\n $dechunk = null;\n\n while(($pos < $len)\n && ($chunkLenHex = substr($chunk,$pos, ($newlineAt = strpos($chunk,\"\\n\",$pos+1))-$pos)))\n {\n if (! is_hex($chunkLenHex)) {\n trigger_error('Value is not properly chunk encoded', E_USER_WARNING);\n return $chunk;\n }\n\n $pos = $newlineAt + 1;\n $chunkLen = hexdec(rtrim($chunkLenHex,\"\\r\\n\"));\n $dechunk .= substr($chunk, $pos, $chunkLen);\n $pos = strpos($chunk, \"\\n\", $pos + $chunkLen) + 1;\n }\n return $dechunk;\n }",
"public function testRetrieveChunkedHttpResponse()\n {\n $client = new HttpClient();\n $response = $client->send(\n HttpRequestMethod::GET,\n 'https://postman-echo.com/stream/5'\n );\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals('OK', $response->getReasonPhrase());\n $this->assertNotEmpty($response->getBody());\n $this->assertNotEmpty($response->getHeaders());\n }",
"protected function decodeChunkedBody($body)\n {\n $decBody = '';\n\n while (trim($body)) {\n if (! preg_match(\"/^([\\da-fA-F]+)[^\\r\\n]*\\r\\n/sm\", $body, $m)) {\n throw new Exception\\RuntimeException(\n \"Error parsing body - doesn't seem to be a chunked message\"\n );\n }\n\n $length = hexdec(trim($m[1]));\n $cut = strlen($m[0]);\n $decBody .= substr($body, $cut, $length);\n $body = substr($body, $cut + $length + 2);\n }\n\n return $decBody;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of nivelacademicoAccion | public function setNivelacademicoAccion($nivelacademicoAccion)
{
$this->nivelacademicoAccion = $nivelacademicoAccion;
return $this;
} | [
"public function setVAccion( $value ){\n\n $this->vAccion = $value;\n\n }",
"public function getIdiomaancestralAccion()\n\t{\n\t\treturn $this->idiomaancestralAccion;\n\t}",
"public function setNaics($value)\n {\n $this->naics = $value;\n }",
"function ctlAcceuil()\n\t{\n\t\tafficherAccueil(); // appelle la fonction pour afficher l'acceuil de site\n\t}",
"public function setAccFlag($value) {\n return $this->set(self::ACC_FLAG, $value);\n }",
"function agregar_accion()\n {\n\t\n \t\t$this->actualizar_perfiles(91);\n }",
"public function getPeriodoacademicoAccion()\n\t{\n\t\treturn $this->periodoacademicoAccion;\n\t}",
"public function testSetNumeroAttestation() {\n\n $obj = new AttestationCacm();\n\n $obj->setNumeroAttestation(\"numeroAttestation\");\n $this->assertEquals(\"numeroAttestation\", $obj->getNumeroAttestation());\n }",
"public function setCama(){\n $this->cama = \"Sim\";\n }",
"public function getTipomatriculaAccion()\n\t{\n\t\treturn $this->tipomatriculaAccion;\n\t}",
"public function getPrimerarazonbecaAccion()\n\t{\n\t\treturn $this->primerarazonbecaAccion;\n\t}",
"public function getPeriodoacademicoAccion()\n {\n return $this->periodoacademicoAccion;\n }",
"public function getNprciAccion()\n {\n return $this->nprciAccion;\n }",
"public function getSetecaspiranteAccion()\n {\n return $this->setecaspiranteAccion;\n }",
"public function getSextarazonbecaAccion()\n\t{\n\t\treturn $this->sextarazonbecaAccion;\n\t}",
"public function getPoseebecaAccion()\n\t{\n\t\treturn $this->poseebecaAccion;\n\t}",
"public function testSetAutreContrat() {\n\n $obj = new AttestationCacm();\n\n $obj->setAutreContrat(\"autreContrat\");\n $this->assertEquals(\"autreContrat\", $obj->getAutreContrat());\n }",
"public function setNivel_academico($nivel_academico){\n $this->nivel_academico = $nivel_academico;\n }",
"public function getNiveauAccreditation()\n {\n return $this->niveauAccreditation;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse the given raw parameters coming from a XML element into an array of prepared parameters objects | protected function _parseXmlElementParamsArray(array $rawParams)
{
/** @var $configHelper BL_CustomGrid_Helper_Xml_Config */
$configHelper = Mage::helper('customgrid/xml_config');
$parsedParams = array();
$sortOrder = 0;
foreach ($rawParams as $key => $data) {
if (is_array($data)) {
$data['key'] = $key;
$data['sort_order'] = (isset($data['sort_order']) ? (int) $data['sort_order'] : $sortOrder);
$data['values'] = $configHelper->getElementParamOptionsValues($data);
$data['helper_block'] = $configHelper->getElementParamHelperBlock($data);
$parsedParams[$key] = new BL_CustomGrid_Object($data);
++$sortOrder;
}
}
return $parsedParams;
} | [
"static protected function XML_Params_To_Array(SimpleXmlElement $xml) {\n\n\t\t$ret = array();\n\t\t\n\t\tforeach ($xml as $topname=>$xparam) {\n\n\t\t\tif (strtoupper($topname) != \"PARAM\") continue;\n\n\t\t\tforeach ($xparam as $xvalue) $ret[] = self::XML_Value_To_Variable($xvalue);\n\t\t\n\t\t}\n\t\n\t\treturn $ret;\n\t\n\t}",
"function xmlrpc_parse_params($parameters)\n\t{\n\t $result = array();\n\t \n\t foreach ($parameters as $parameter)\n\t {\n\t $result[] = xmlrpc_scalar_value($parameter);\n\t }\n\t \n\t return $result;\n\t}",
"public function parseParams()\n {\n $params = array();\n\n foreach($this->attrs as $k => $_v) {\n $key = $k;\n\n if(is_integer($k)) {\n $key = $_v;\n }\n\n $v = ee()->TMPL->fetch_param($key);\n\n $params[$key] = $v;\n }\n\n $this->params = $params;\n }",
"public function parseParameters(string $rawTransformation): array\n {\n if (!$this->hasParameters($rawTransformation)) {\n return [];\n }\n\n $position = strrpos($rawTransformation, static::PARAMETER_LIST);\n $rawParameters = substr($rawTransformation, $position + 1);\n\n return explode(static::PARAMETER_SEPARATOR, $rawParameters);\n }",
"private function _parseFunctionArgs()\n {\n $params = array();\n while (!$this->_tokens->peekAny(array(')', ']', '}', ',', Sugar_Token::TERMINATOR))) {\n // check for name= assignment\n $this->_tokens->expect(Sugar_Token::IDENTIFIER, $name);\n $this->_tokens->expect('=');\n\n // assign parameter\n $params [$name]= $this->_compileBinary();\n }\n return $params;\n }",
"protected function parseArguments(Element $node)\n {\n $nodeDom = dom_import_simplexml($node);\n $result = [];\n foreach ($nodeDom->childNodes as $argumentNode) {\n if ($argumentNode instanceof \\DOMElement && $argumentNode->nodeName == 'argument') {\n $argumentName = $argumentNode->getAttribute('name');\n $result[$argumentName] = $this->argumentParser->parse($argumentNode);\n }\n }\n return $result;\n }",
"function _parseParameterString($paramString) {\n $elements = preg_split(\"/&/\",$paramString);\n\t\t\t$result=[];\n\n\t\t\tforeach($elements as $element)\n {\n $keyToken=preg_split(\"/=/\",$element);\n $value='';\n if ($keyToken[1]) {\n $value=urldecode ($keyToken[1]);\n\t\t\t\t}\n if($result[$keyToken[0]]){\n if (!is_array($result[$keyToken[0]]))\n {\n $result[$keyToken[0]] = array( $result[$keyToken[0]], $value);\n }\n else\n {\n array_push( $result[$keyToken[0]], $value);\n }\n }\n else\n {\n $result[$keyToken[0]]= $value;\n }\n }\n return $result;\n }",
"abstract protected function _parseParams($params);",
"protected function parseFamilyParameters()\n {\n $parameters = $this->doc->getElementsByTagName(\"parameters\")->item(0);\n if ($parameters) {\n foreach ( $parameters->childNodes as $currentChild ) {\n if ($currentChild->nodeName == \"parameter\") {\n $this->parseFamilyElement(\"parameter\", \"PARAM\", $currentChild);\n }\n }\n }\n }",
"public function getParameters() {\n $return = array();\n foreach(parent::getParameters() as $parameter) {\n $return[$parameter->name] =\n new Docgen_ParameterParser(array($this->getDeclaringClass()->getName(), $this->getName()), $parameter->getName());\n }\n return $return;\n }",
"private function _parseParam($param){\n $tmp = $this->split_quoted_string('=', $param, 2);\n\t\t\n if (count($tmp) == 1) {\n $value = $tmp[0]; \n $name = $this->_paramName($value);\n $this->params[$name][] = $value;\n } else {\n $name = $tmp[0];\n $values = $this->split_quoted_string(',', $tmp[1]); \n foreach ($values as $value) {\n $this->params[$name][] = $value;\n }\n }\n }",
"protected function handleParam()\n {\n if (preg_match('/^@([0-9]+)=(.*)$/', $this->getNextLine(self::LINE_TYPE_ANY), $part)) {\n $paramValue = trim($part[2], \"'\");\n\n return [$part[1] => $paramValue];\n }\n\n return null;\n }",
"abstract public function parseRequestParameters();",
"public function convert_to_array_from_xml_string_with_special_config()\n {\n $string = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <root_node>\n <sub_node description=\"An attribute\">Content</sub_node>\n </root_node>';\n\n $this->assertEquals([\n 'root_node' => [\n 'sub_node' => [\n '#text' => 'Content',\n '#attributes' => [\n 'description' => 'An attribute',\n ],\n ],\n ],\n ], Xml2Array::convert($string, [\n 'valueKey' => '#text',\n 'attributesKey' => '#attributes',\n ])->toArray());\n }",
"protected function build_xml_params() {\n $attrs = (object)$this->parameters;\n $ret = <<<EOD\n<c:params xmlns:c=\"http://s.opencalais.com/1/pred/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <c:processingDirectives c:contentType=\"{$attrs->contentType}\" \n c:outputFormat=\"{$attrs->outputFormat}\"\n c:enableMetadataType=\"{$attrs->enableMetadataType}\"\n c:calculateRelevanceScore=\"{$attrs->calculateRelevanceScore}\"\n >\n </c:processingDirectives>\n <c:userDirectives c:allowDistribution=\"{$attrs->allowDistribution}\" \n c:allowSearch=\"{$attrs->allowSearch}\" \n c:externalID=\"{$attrs->externalID}\"\n c:submitter=\"{$attrs->submitter}\"\n >\n </c:userDirectives>\n <c:externalMetadata>\n <rdf:description>\n <c:caller>{$attrs->caller}</c:caller>\n </rdf:description>\n </c:externalMetadata>\n</c:params>\nEOD;\n return $ret;\n }",
"private function createParameters(FunctionLike $node): array\n {\n $params = [];\n if ($node->parameters) {\n foreach ($node->parameters->getElements() as $element) {\n $param = (string) $this->definitionResolver->getTypeFromNode($element);\n $param .= ' ';\n if ($element->dotDotDotToken) {\n $param .= '...';\n }\n $param .= '$' . $element->getName();\n if ($element->default) {\n $param .= ' = ' . $element->default->getText();\n }\n $params[] = new ParameterInformation(\n $param,\n $this->definitionResolver->getDocumentationFromNode($element)\n );\n }\n }\n return $params;\n }",
"private static function makeFlatParamsXML ( $xml, $parent_name = '' )\n\t{\n\t\tif ( ! $xml instanceof SimpleXMLElement ) {\n\t\t\t$xml = new SimpleXMLElement($xml);\n\t\t}\n\n\t\t$arrParams = array();\n\t\t$i = 0;\n\t\tforeach ( $xml->children() as $tag ) {\n\n\t\t\t$i++;\n\t\t\tif ( 'pg_sig' == $tag->getName() )\n\t\t\t\tcontinue;\n\n\t\t\t/**\n\t\t\t * ��� ������ ���� tag001subtag001\n\t\t\t * ����� ����� ���� ����� ��������� ������������� � ��������� ���� �� ���������� ��� ����������\n\t\t\t */\n\t\t\t$name = $parent_name . $tag->getName().sprintf('%03d', $i);\n\n\t\t\tif ( $tag->children() ) {\n\t\t\t\t$arrParams = array_merge($arrParams, self::makeFlatParamsXML($tag, $name));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrParams += array($name => (string)$tag);\n\t\t}\n\n\t\treturn $arrParams;\n\t}",
"public function loadParameters (){\n try{\n\n $this->_xmlRequest->getTag(0, $_tagName, $_tagAttributes, $_tagContents, $_tagTags);\n\n\n foreach ($_tagTags as $k=>$v){\n $this->_xmlRequest->getTag($v, $tN, $tA, $tC, $tT);\n $this->RequestParams[strtoupper($tN)] = trim($tC);\n }\n\n\n\n $this->itemsTag = $this->_xmlRequest->getChildByName(0, \"ITEMS\");\n if ((count($this->itemsTag) <1)||$this->itemsTag==null){\n print($this->xmlErrorResponse($this->RequestParams['COMMAND'], '9001',\n 'Error XML request! Not found required tag ITEMS','' , ''));\n exit;\n }\n\n\n\n } catch (Exception $e) {\n print($this->xmlErrorResponse($this->RequestParams['COMMAND'], '9001',\n 'Critical Error catch (Exception $e)'.$e, \"\", ''));\n exit;\n }\n }",
"protected function parseParams():self\n\t{\n\t\t$params= preg_split('/(?<!\\\\\\\\)\\\\|/',$this->line->pregGet('/^-[\\w-:]+\\((.*?)\\)(?= |(\\\\{>)?$)/',1));\n\n\t\tif( ($m= count($params)) != ($n= count($this->config['params'])) ){$this->document->throw(\"Tag $this->name has $n parameters $m given.\");}\n\n\t\tarray_map(function( $key, $value ){return $this->setAttribute($key,$this->checkExpression(str_replace('\\\\|','|',$value)));},$this->config['params'],$params);\n\n\t\treturn $this;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
select given folder folder must be selectable! | public function selectFolder($globalName); | [
"function get_dlg_select_folder($path,$caption,$action)\n \t{\n\t \t$ret=$this->call(\"Application.SelectFolderDialog?path=\".urlencode($path).\"&action=\".urlencode($action).\"&caption=\".urlencode($caption));\n\t\tfgets(STDIN);\n \treturn $ret;\n \t}",
"function _folders_visitor_dropdown( &$folder, &$html, &$node ){\n global $CTX, $PAGE;\n $show_count = $CTX->get( 'k_show_folder_count', 1 );\n\n if( $CTX->get('k_element_start', 1) ){\n $level = $CTX->get('k_level', 1);\n $f_id = $CTX->get('k_folder_id', 1);\n $f_name = $CTX->get('k_folder_name', 1);\n $f_title = $CTX->get('k_folder_title', 1);\n\n if( is_numeric($node) ){ // explicit folder id provided\n $f_selected = ($node==$f_id) ? ' SELECTED=1 ' : '';\n }\n else{\n $f_selected = ((!$PAGE->is_master)&&($PAGE->page_folder_id==$f_id)) ? ' SELECTED=1 ' : '';\n }\n\n for( $x=0; $x<$level*4; $x++ ){\n $pad .= ' ';\n }\n $html .= '<option class=\"level-'.$level.' folder-'.$f_name.'\" value=\"'. $f_id .'\" '.$f_selected.'>';\n $html .= $pad . $f_title;\n if( $show_count ) $html .= ' (' . $folder->count . ')';\n $html .= '</option>';\n }\n }",
"private function getFolderSelectByAlbum($a_id){\r\n \t$folders = $this->getFolderByAlbum($a_id);\r\n \t$t = $this->sp->ref('UIWidgets')->getWidget('Select');\r\n \t$t->addOption($this->_('New Folder'), -2);\t\r\n \t$t->addOption($this->_('No Folder'), -1);\t\r\n \tif($folders != array()){\r\n\t \tforeach($folders as $folder){\r\n\t \t\t$t->addOption($folder->getName(), $folder->getId());\t\t\r\n\t \t}\r\n \t}\r\n \t\r\n \t$t->setName('folder');\r\n \t$t->setLabel($this->_('FOLDER'));\r\n \t$t->setId('folders');\r\n \t\r\n \treturn $t->render();\r\n }",
"public function select_folder ($title, $message, $multiple_selection, $start_directory) {\n\n\t\t$this->type = self::DIALOG_FILE_SELECT;\n\t\t\n\t\t$this->parameters[\"title\"] = $title;\n\t\t$this->parameters[\"text\"] = $message;\n\t\t$this->parameters[\"select‑multiple\"] = null;\n\t\t$this->parameters[\"select-directories\"] = null;\n\t\tif ($only_directories) $this->parameters[\"select-only-directories\"] = null;\n\t\tif ($start_directory) $this->parameters[\"with‑directory\"] = $start_directory;\n\t\t\n\t\t/*\n\t\t\t‑‑text \"main text message\"\tThis is the text displayed at the top of the fileselect window.\n\t\t\t‑‑select‑directories\tAllow the user to select directories as well as files. Default is to disallow it.\n\t\t\t‑‑select‑only‑directories\tAllows the user to select only directories.\n\t\t\t‑‑packages‑as‑directories\tAllows the user to navigate into packages as if they were directories, rather than selecting the package as a file.\n\t\t\t‑‑select‑multiple\tAllow the user to select more than one file. Default is to allow only one file/directory selection.\n\t\t\t‑‑with‑extensions list of extensions\t Limit selectable files to ones with these extensions. list of extensions should be space separated, and given as multiple arguments (ie: don't double quote the list). \n\t\t\tExample: CocoaDialog fileselect --with-extensions .c .h .m .txt \n\t\t\tThe period/dot at the start of each extension is optional.\n\t\t\t‑‑with‑directory directory\t Start the file select window in directory. The default value is up to the system, and will usually be the last directory visited in a file select dialog.\n\t\t\t‑‑with‑file file\t Start the file select window with file already selected. By default no file will be selected. This must be used with --with-directory. It should be the filename of a file within the directory.\t\t\n\t\t*/\n\t\t\n\t\treturn trim($this->run(), \" \t\\n\");\n\t}",
"function email_menu_gotofolder($url, $emailid, $folderid) {\n global $OUTPUT;\n \n $usersfolders = email_menu_get_usersfolders($emailid);\n $options = array();\n foreach ($usersfolders as $usersfolder) {\n $name = '';\n for ($i=0; $i < $usersfolder->depth; $i++){\n $name .= \" - \";\n }\n $name .= $usersfolder->name;\n $options[$usersfolder->id] = $name;\n }\n \n $select = new single_select($url, 'f', $options, $folderid, null, \"gotofolderform\");\n $select->set_label(get_string('goto', 'email'));\n $select->class = \"emailmenuoption\";\n return $OUTPUT->render($select);\n}",
"function folderSelect($type) {\n\t\n\t\t$filename = getcwd().'/folders.cfg';\n\t\t$folders = unserialize(file_get_contents($filename)); \n\t\t\n\t\t$i=0;\n\t\tforeach ($folders as $row) {\n\t\t\tif ($type == 'all') {\n\t\t\t\t$result[$i]['id'] = $i;\n\t\t\t\t\n\t\t\t}\n\t\t\tif($row == $type) {\n\t\t\t\t$result[$i]['id'] = $i;\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $result;\n\t\n}",
"public function setActive($folder)\n\t{\n\t\t$this->active = $folder;\n\t}",
"function bp_docs_save_folder_selection( $doc_id ) {\n\t$retval = false;\n\n\tif ( empty( $_POST['existing-or-new-folder'] ) ) {\n\t\treturn;\n\t}\n\n\t$check = apply_filters( 'bp_docs_before_save_folder_selection', true, $doc_id );\n\n\tif ( ! $check ) {\n\t\treturn $retval;\n\t}\n\n\tswitch ( $_POST['existing-or-new-folder'] ) {\n\t\tcase 'existing' :\n\t\t\tif ( isset( $_POST['bp-docs-folder'] ) ) {\n\t\t\t\t$folder_id = intval( $_POST['bp-docs-folder'] );\n\n\t\t\t\tif ( 0 === $folder_id ) {\n\t\t\t\t\t$existing_folder_id = bp_docs_get_doc_folder( $doc_id );\n\t\t\t\t\t$retval = bp_docs_remove_doc_from_folder( $doc_id, $existing_folder_id );\n\t\t\t\t} else {\n\t\t\t\t\t$retval = bp_docs_add_doc_to_folder( $doc_id, $folder_id );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase 'new' :\n\t\t\t$folder_name = trim( stripslashes( $_POST['new-folder'] ) );\n\n\t\t\tif ( empty( $folder_name ) ) {\n\t\t\t\tbp_core_add_message( __( 'You must provide a folder name.', 'bp-docs' ), 'error' );\n\t\t\t} else {\n\t\t\t\t$folder_args = array(\n\t\t\t\t\t'name' => $folder_name,\n\t\t\t\t);\n\n\t\t\t\t// Parent\n\t\t\t\t$folder_args['parent'] = ! empty( $_POST['new-folder-parent'] ) ? intval( $_POST['new-folder-parent'] ) : null;\n\n\t\t\t\t// Type\n\t\t\t\t$folder_type = stripslashes( $_POST['new-folder-type'] );\n\n\t\t\t\tif ( 'global' === $folder_type ) {\n\t\t\t\t\t// Nothing to do\n\t\t\t\t} else if ( 'me' === $folder_type ) {\n\t\t\t\t\t$folder_args['user_id'] = bp_loggedin_user_id();\n\t\t\t\t} else if ( is_numeric( $folder_type ) ) {\n\t\t\t\t\t// This is a group\n\t\t\t\t\t$folder_args['group_id'] = intval( $folder_type );\n\t\t\t\t}\n\n\t\t\t\t// Create the folder\n\t\t\t\t$folder_id = bp_docs_create_folder( $folder_args );\n\n\t\t\t\t// Add the doc to the folder\n\t\t\t\t$retval = bp_docs_add_doc_to_folder( $doc_id, $folder_id );\n\t\t\t}\n\n\t\t\tbreak;\n\t}\n\n\treturn $retval;\n}",
"public function find_folder($folder)\n {\n }",
"abstract function actionGetFolder();",
"public function isSelectable()\n\t{\n\t\treturn $this->oImapFolder->IsSelectable() && $this->exists();\n\t}",
"function fe_visiblefolderpath($rootFolderName, $folder){\n\t\t$path=explode('/', $rootFolderName . ($folder ? '/' : '') . $folder);\n\t\tif(count($path)==1){\n\t\t\t?><span id=\"currentFolderLabel\"><?php echo $path[0];?></span><?php\n\t\t}else{\n\t\t\tforeach($path as $n=>$v){\n\t\t\t\tif($n<count($path)-1){\n\t\t\t\t\tif($n!=0)$string=($string?'/':'') . $v;\n\t\t\t\t\t?><a title=\"Open this folder\" href=\"javascript:oF(-1,4,'<?php echo str_replace(\"'\", \"\\'\",$string);?>');\"><?php echo $v?></a><span class=\"dividerslash\">/</span><?php\n\t\t\t\t}else{\n\t\t\t\t\t?><span id=\"currentFolderLabel\"><?php echo $v?></span><?php\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private function setFolder($folder) {\n\t\t$array = explode('/',$folder);\n\t\t$this->folder = str_replace('/','',$array[0]);\n\t}",
"abstract function actionAddFolder();",
"protected function _loadFolder()\n {\n $db = JFactory::getDbo();\n\n $query = $db->getQuery(true);\n $query->select('*');\n $query->from('#__eventgallery_folder');\n $query->where('folder=' . $db->quote($this->_foldername));\n\n $db->setQuery($query);\n $folderObject = $db->loadObject();\n\n $this->_folder = $folderObject;\n\n\n\n }",
"public function select_default_folder( ){\n\t\t\n\t\tglobal $elearning;\n\t\treturn $elearning->plugin_path().$this->path_template;\n\t\t\n\t\t}",
"public function param_folder($value = null) {\n // Get the folders\n $this->CI->load->model('files/file_folders_m');\n $tree = $this->CI->file_folders_m->get_folders();\n $tree = (array) $tree;\n if (!$tree) {\n return '<em>' . lang('streams:file.folder_notice') . '</em>';\n }\n $choices = array();\n foreach ($tree as $tree_item) {\n // We are doing this to be backwards compat\n // with PyroStreams 1.1 and below where\n // This is an array, not an object\n $tree_item = (object) $tree_item;\n $choices[$tree_item->id] = $tree_item->name;\n }\n return form_dropdown('folder', $choices, $value);\n }",
"function menu_select() {\r\n // hindari direquest melalui URL\r\n if ( isset($this->params['requested']) ) {\r\n return $this->Menu->generateTreeList();\r\n }\r\n \r\n return false;\r\n }",
"function email_print_movefolder_button($options) {\n\n\tglobal $CFG, $USER;\n\n\t$courseid = NULL;\n\tif ( $options->id == SITEID and $options->course != SITEID) {\n\t\t$courseid = $options->course;\n\t} else {\n\t\t$courseid = $options->id;\n\t}\n\n\t/// TODO: Changed this function, now cases are had:\n\t//\t\t\t\t\t\t1.- Inbox folder: Only can move to subfolders inbox and trash folder.\n\t//\t\t\t\t\t\t2.- Sendbox and draft folder: Only can move on this subfolders.\n\t//\t\t\t\t\t\t3.- Trash folder: Can move any folder\n\tif ( isset($options->folderid) ) {\n\t\t// Get folder\n\t\t$folderbe = email_get_folder($options->folderid);\n\n\t} else if ( isset($options->folderoldid) ) {\n\t\t// Get folder\n\t\t$folderbe = email_get_folder($options->folderoldid);\n\t} else {\n\t\t// Inbox folder\n\t\t$folderbe = email_get_root_folder($USER->id, EMAIL_INBOX);\n\t}\n\n\tif ( email_isfolder_type($folderbe, EMAIL_SENDBOX ) ) {\n\t\t// Get my sendbox folders\n\t\t$folders = email_get_my_folders( $USER->id, $courseid, false, true, false, true );\n\t} else if ( email_isfolder_type($folderbe, EMAIL_DRAFT )) {\n\t\t// Get my sendbox folders\n\t\t$folders = email_get_my_folders( $USER->id, $courseid, false, true, true, true );\n\t} else if ( email_isfolder_type($folderbe, EMAIL_TRASH ) ) {\n\t\t// Get my folders\n\t\t$folders = email_get_my_folders( $USER->id, $courseid, false, false, false, false );\n\t} else {\n\t\t// Get my folders\n\t\t$folders = email_get_my_folders( $USER->id, $courseid, false, true, true, false );\n\t}\n\n\tif ( $folders ) {\n\n\t\t$choose = '';\n\n\t\t// Get my courses\n\t\tforeach ($folders as $key => $foldername) {\n\n\t $choose .= '<option value=\"'.$key.'\">'.$foldername .'</option>';\n\t\t}\n\t}\n\n\techo '<select name=\"folderid\" onchange=\"addAction(this)\">\n\t\t\t\t\t<option value=\"\" selected=\"selected\">' . get_string('movetofolder', 'block_email_list') . ':</option>' .\n \t\t\t$choose . '\n \t\t</select>';\n\n\n\t// Add 2 space\n\techo '  ';\n\n\t// Change, now folderoldid is actual folderid\n\tif (! $options->folderid ) {\n\t\tif ( $inbox = email_get_root_folder($USER->id, EMAIL_INBOX) ) {\n\t\t\techo '<input type=\"hidden\" name=\"folderoldid\" value=\"'.$inbox->id.'\" />';\n\t\t}\n\t} else {\n\t\techo '<input type=\"hidden\" name=\"folderoldid\" value=\"'.$options->folderid.'\" />';\n\t}\n\n\t// Define action\n\t//echo '<input type=\"hidden\" name=\"action\" value=\"move2folder\" />';\n\t// Add javascript for insert person/s who I've send mail\n\n\t$javascript = '<script type=\"text/javascript\" language=\"JavaScript\">\n <!--\n \t\tfunction addAction(form) {\n\n \t\t\tvar d = document.createElement(\"div\");\n d.setAttribute(\"id\", \"action\");\n var act = document.createElement(\"input\");\n act.setAttribute(\"type\", \"hidden\");\n act.setAttribute(\"name\", \"action\");\n act.setAttribute(\"id\", \"action\");\n act.setAttribute(\"value\", \"move2folder\");\n d.appendChild(act);\n document.getElementById(\"move2folder\").appendChild(d);\n\n \t\t\tdocument.sendmail.submit();\n \t\t}\n \t-->\n </script>';\n\n\techo $javascript;\n\n\t// Print sent button\n\t//echo '<input type=\"submit\" value=\"' .get_string('move'). '\" onclick=\"javascript:addAction(this);\" />';\n\n\t//echo '</div>';\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for songPlaylistGet Get the playlist of a station.. | public function testSongPlaylistGet()
{
} | [
"public static function GetPlaylist($playlist_path){\n }",
"function playlist($playlist){\n\t\tglobal $include_path, $jbArr,$jzSERVICES;\n\t\t\n\t\tif (isset($jbArr[$_SESSION['jb_id']]['prefix']) && $jbArr[$_SESSION['jb_id']]['prefix'] == \"http\") {\n\t\t $content = \"\";\n\t\t foreach ($playlist->getList() as $track) {\n\t\t $content .= $track->getFileName(\"user\").\"\\n\";\n\t\t }\n\t\t $playlist = $content;\n\t\t} else {\n\t\t $playlist = $jzSERVICES->createPlaylist($playlist,\"jukebox\");\n\t\t $arr = explode(\"\\n\",$playlist);\n\t\t $arr2 = array();\n\t\t foreach ($arr as $a) {\n\t\t if (false === stristr($a, \"://\")) {\n\t\t $arr2[] = str_replace(\"/\",\"\\\\\",$a);\n\t\t } else {\n\t\t $arr2[] = $a;\n\t\t }\n\t\t }\n\t\t $playlist = implode(\"\\n\",$arr2);\n\t\t}\n\t\twriteLogData(\"messages\",\"Winamp3: Creating a playlist\");\n\n\t\t// First we need to get the current playlist so we can figure out where to add\n\t\t$clist = explode(\";;;\",@file_get_contents(\"http://\". $jbArr[$_SESSION['jb_id']]['server']. \":\". $jbArr[$_SESSION['jb_id']]['port']. \"/getplaylisttitle?p=\". $jbArr[$_SESSION['jb_id']]['password']. \"&delim=;;;\"));\n\t\tforeach($clist as $item){\n\t\t\tif ($item <> \"\"){\n\t\t\t\t$curList[] = $item;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Let's get where we are in the current list\n\t\twriteLogData(\"messages\",\"Winamp3: Getting the current playing track number\");\n\t\t$curTrack = getCurPlayingTrack();\n\n\t\tswitch ($_SESSION['jb-addtype']) {\n\t\tcase \"end\":\n\t\tcase \"current\":\n\t\t $restart_playback = false;\n\t\t break;\n\t\tdefault:\n\t\t $restart_playback = true;\n\t\t}\n\n\t\t// Ok, now we need to figure out where to add the stuff\n\t\tif ($_SESSION['jb-addtype'] == \"current\"){\n\t\t\t// Ok, let's split our first playlist in 2 so we can add in the middle\n\t\t\t//$begArr = array_slice($curList,0,$curTrack+1);\n\t\t if (is_array($curList)) {\n\t\t $begArr = array();\n\t\t $endArr = array_slice($curList,$curTrack+1);\n\t\t } else {\n\t\t $begArr = array();\n\t\t $endArr = array();\n\t\t }\n\t\t} else if ($_SESSION['jb-addtype'] == \"begin\"){\n\t\t\t$begArr = array();\n\t\t\t$endArr = $curList;\n\t\t} else if ($_SESSION['jb-addtype'] == \"end\"){\n\t\t\t$begArr = array();\n\t\t\t$endArr = array();\n\t\t} else if ($_SESSION['jb-addtype'] == \"replace\") {\n\t\t $begArr = array();\n\t\t $endArr = array();\n\t\t}\n\t\t\n\t\t\n\t\tif ($restart_playback === true){\n\t\t writeLogData(\"messages\",\"Winamp3: Clearing the current playlist\");\n\t\t control(\"clear\",false);\n\t\t} else if ($_SESSION['jb-addtype'] == \"current\") {\n\t\t // Remove everything at the end of the playlist, since we are going to readd it all.\n\t\t for ($i = sizeof($curList); $i > $curTrack; $i--) {\n\t\t $arr = array();\n\t\t $arr['index'] = $i;\n\t\t httpqRequest(\"deletepos\",$arr);\n\t\t }\n\t\t}\n\t\t\n\t\twriteLogData(\"messages\",\"Winamp3: Sending the new playlist to the player\");\n\n\n\n\n\n\t\t// Now let's send the new playlist to the player\n\t\tfor ($i=0; $i < count($begArr); $i++){\n\t\t\t// Now let's add this\n\t\t\tif ($begArr[$i] <> \"\"){\n\t\t\t $arr = array();\n\t\t\t $arr['file'] = $begArr[$i];\n\t\t\t httpqRequest(\"playfile\", $arr);\n\t\t\t}\n\t\t}\t\t\n\t\t// Ok, Now let's add the new stuff\n\t\t$pArray = explode(\"\\n\",$playlist);\n\t\tfor ($i=0; $i < count($pArray); $i++){\n\t\t\tif ($pArray[$i] <> \"\"){\n\t\t\t $arr = array();\n\t\t\t $arr['file'] = $pArray[$i];\n\t\t\t httpqRequest(\"playfile\", $arr);\n\t\t\t}\n\t\t}\n\t\t// Now let's finish this out\n\t\tfor ($i=0; $i < count($endArr); $i++){\n\t\t\t// Now let's add this\n\t\t\tif ($endArr[$i] <> \"\"){\n\t\t\t $arr = array();\n\t\t\t $arr['file'] = $endArr[$i];\n\t\t\t httpqRequest(\"playfile\", $arr);\n\t\t\t}\n\t\t}\n\n\t\t// Now let's jump to where we need to play\n\t\tswitch ($_SESSION['jb-addtype']){\n\t\t\tcase \"current\":\n\t\t\t\tif ($curTrack == 0){$curTrack = -1;}\n\t\t\t\t$_POST['jbjumpto'] = $curTrack + 1;\n\t\t\tbreak;\n\t\t\tcase \"end\":\n\t\t\t\t$_POST['jbjumpto'] = $curTrack;\n\t\t\tbreak;\n\t\tcase \"replace\":\n\t\tcase \"begin\":\n\t\t\t\t$_POST['jbjumpto'] = 0;\n\t\t\tbreak;\n\t\t}\n\t\tif ($restart_playback) {\n\t\t control(\"jumpto\");\n\t\t control(\"play\");\n\t\t}\n\n\t\tif (defined('NO_AJAX_JUKEBOX')) {\n\t\t?>\n\t\t<script>\n\t\t\thistory.back();\n\t\t</script>\n\t\t<?php \n\t\t }\n\t\texit();\n\t}",
"public function getPlaylist()\n {\n \treturn $this->_playList;\n }",
"function GetPlaylist() {\n\t\tif ( $this->debugging ) echo \"mpd->GetPlaylist()\\n\";\n\t\t$resp = $this->SendCommand(MPD_CMD_PLLIST);\n\t\t$playlist = $this->_parseFileListResponse($resp);\n\t\tif ( $this->debugging ) echo \"mpd->GetPlaylist() / return \".print_r($playlist).\"\\n\";\n\t\treturn $playlist;\n\t}",
"function show_playlist($playlist) {\n \n\t/* Create the Playlist */\n $song_ids = $playlist->get_items();\n\n\n\tshow_playlist_menu();\n\n if (count($song_ids) > 0) {\n show_songs($song_ids, $playlist);\n }\n else {\n echo \"<div class=\\\"text-box\\\">\" . _(\"No songs in this playlist.\") . \"</div>\\n\";\n }\n\n}",
"function playlist($playlist){\n\t\tglobal $include_path, $jbArr, $media_dirs,$jzSERVICES;\n\t\t\n\t\t$addtype = $_SESSION['jb-addtype'];\n\t\t\n\t\t/**\n\t\t * The Junction jukebox works in Javascript on the client.\n\t\t * The Jinzora client sends the Jukebox a command to download\n\t\t * a playlist. That command gets routed here by Jinzora's\n\t\t * internal jukebox logic. We simply re-route the message as\n\t\t * if it were a simple request to download a playlist.\n\t\t */\n\t\t$playlist->stream();\n\t}",
"public function get() {\n\n\t\t/* Get the Current Playlist */\n\t\t$list = $this->_httpq->get_tracks();\n\n\t\t$songs = explode(\"::\",$list);\n\n\t\tforeach ($songs as $key=>$entry) {\n\t\t\t$data = array();\n\n\t\t\t/* Required Elements */\n\t\t\t$data['id'] \t= $key;\n\t\t\t$data['raw']\t= $entry;\n\n\t\t\t/* Parse out the song ID and then create the song object */\n\t\t\tpreg_match(\"/song=(\\d+)\\&/\",$entry,$matches);\n\n\t\t\t/* Attempt to build the new song */\n\t\t\t$song = new Song($matches['1']);\n\n\t\t\t/* If we don't know it, look up by filename */\n\t\t\tif (!$song->title) {\n\t\t\t\t$filename = sql_escape($entry);\n\t\t\t\t$sql = \"SELECT id FROM song WHERE file LIKE '%$filename'\";\n\t\t\t\t$db_results = mysql_query($sql, dbh());\n\t\t\t\tif ($r = mysql_fetch_assoc($db_results)) {\n\t\t\t\t\t$song = new Song($r['id']);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$song->title = _('Unknown');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Make the name pretty */\n\t\t\t$song->format_song();\n\t\t\t$data['name']\t= $song->f_title . ' - ' . $song->f_album . ' - ' . $song->f_artist;\n\n\t\t\t/* Optional Elements */\n\t\t\t$data['link'] = '';\n\t\t\t$data['track']\t= $key+1;\n\n\t\t\t$results[] = $data;\n\n\t\t} // foreach playlist items\n\n\t\treturn $results;\n\n\t}",
"function playlist($playlist){\n\t\tglobal $include_path, $jbArr, $media_dirs,$jzSERVICES;\n\t\t\n\t\t$addtype = $_SESSION['jb-addtype'];\n\t\t$box = Quickbox::load();\n\t\t// todo: current, begin\n\t\tif ($addtype == 'end') {\n\t\t $list = $box['playlist'];\n\t\t} else {\n\t\t $list = array();\n\t\t}\n\n\t\tif ($addtype == 'replace') {\n\t\t $box['pos'] = 0;\n\t\t}\n\n\t\tforeach ($playlist->getList() as $track) {\n\t\t $list[] = $track->getFileName(\"user\").\"\\n\";\n\t\t}\n\n\t\t\n\t\t$box['command']='playlist';\n\t\t$box['command_time']=time();\n\t\t$box['playlist']=$list;\n\t\t$box['addtype']=$addtype;\n\t\t\n\t\tQuickbox::store($box);\n\t\t\n\t\texit();\n\t}",
"public function fetchPlaylist() {\n $result = $this->repository->fetchSavedPlaylist();\n if ($result['error']) {\n return $this->getErrorJsonResponse([], $result['message'], 422 );\n } else {\n $userPlaylist['my_playlist'] = $result['data'];\n return $this->getSuccessJsonResponse(['message' => trans('video::userplaylist.playlist_fetch_success'), 'response' => $userPlaylist]);\n }\n }",
"function getTracksPlaylist($dir)\r\n{\r\n\tglobal $download;\r\n\t$i = 0;\r\n\t$files = getFiles($dir);\r\n\t$getTracks = formatHtmlPlaylist($dir,$files);\r\n\treturn $getTracks;\r\n}",
"function getCurPlaylist($fullPath = false){\n\t\tglobal $jbArr;\n\n\t\t// let's connect to the player\n\t\t$jukebox = new slim($jbArr[$_SESSION['jb_id']]['server'],$jbArr[$_SESSION['jb_id']]['port']);\n\n\t\t// Now let's make sure it's playing\n\t\tif (trim(str_replace(\"playlist tracks \",\"\",$jukebox->execute(\"playlist tracks ?\"))) == 0){\n\t\t\treturn;\n\t\t}\n\n\t\treturn $jukebox->get(\"playlist\", $fullPath);\n\t}",
"public static function AddSongToPlaylist($song_id,$playlist_path){\n }",
"function getCurPlaylist(){\n\t\tglobal $jbArr;\n\t\t\n\t\t// Let's get the full playing list - we'll create a session variable for this since it can be HUGE and take FOREVER\n\t\tif (!isset($_SESSION['jb_at_playlist'])){\n\t\t\t$_SESSION['jb_at_playlist'] = file_get_contents(\"http://\". $jbArr[$_SESSION['jb_id']]['server']. \"/apigetinfo.asp?type=playq\");\n\t\t}\n\t\t$list = $_SESSION['jb_at_playlist'];\n\t\t\n\t\t// Now let's break that into an array so we can process it\n\t\t$valArray = explode(\"[Song\",$list);\n\t\tfor ($i=0; $i < count($valArray); $i++){\n\t\t\tif (!stristr($valArray[$i], \"[Play Queue]\")){\n\t\t\t\t// Now let's get just the path out of this\n\t\t\t\t$item = substr($valArray[$i],strpos($valArray[$i],\"ID=\")+strlen(\"ID=\"));\n\t\t\t\t$item = substr($item,0,strpos($item,\"\\n\"));\n\t\t\t\t$item = str_replace(\"\\\\\\\\\". $jbArr[$_SESSION['jb_id']]['mediaserver']. \"\\\\\". $jbArr[$_SESSION['jb_id']]['mediashare']. \"\\\\\",\"\",$item);\n\t\t\t\t$item = str_replace(\"\\\\\",\"/\",$item);\n\t\t\t\t$retArray[] = $item;\n\t\t\t}\n\t\t}\n\t\treturn $retArray;\n\t}",
"function playlist($playlist){\n\t\tglobal $include_path, $jbArr,$jzSERVICES;\n\t\t\n\t\t$playlist = $jzSERVICES->createPlaylist($playlist,\"jukebox\");\n\t\t// First we need to get the current playlist so we can figure out where to add\n\t\t$curList = getCurPlaylist();\n\t\t\n\t\t// Let's get where we are in the current list\n\t\t$curTrack = getCurPlayingTrack();\n\t\t\n\t\t// Ok, now we need to figure out where to add the stuff\n\t\tif ($_SESSION['jb-addtype'] == \"current\"){\n\t\t\t// Ok, let's split our first playlist in 2 so we can add in the middle\n\t\t\t$begArr = array_slice($curList,0,$curTrack+1);\n\t\t\t$endArr = array_slice($curList,$curTrack+1);\n\t\t} else if ($_SESSION['jb-addtype'] == \"begin\"){\n\t\t\t$begArr = \"\";\n\t\t\t$endArr = array();\n\t\t} else if ($_SESSION['jb-addtype'] == \"end\"){\n\t\t\t$begArr = $curList;\n\t\t\t$endArr = array();\n\t\t} else if ($_SESSION['jb-addtype'] == \"replace\") {\n\t\t $begArr = array();\n\t\t $endArr = array();\n\t\t}\n\t\t\n\t\t// Now let's send the new playlist to the player\n\t\t$f=false;$data=\"\";\n\t\tfor ($i=0; $i < count($begArr); $i++){\n\t\t\t// Now let's add this\n\t\t\tif ($begArr[$i] <> \"\"){\n\t\t\t\t$val = \"\\\\\\\\\". $jbArr[$_SESSION['jb_id']]['mediaserver']. \"\\\\\". $jbArr[$_SESSION['jb_id']]['mediashare']. \"\\\\\". str_replace($jbArr[$_SESSION['jb_id']]['localpath'],\"\",str_replace(\"/\",\"\\\\\",$begArr[$i]));\n\t\t\t\t//echo $val. \"<br>\";\n\t\t\t\tif ($f){$val = \"\\r\\n\". trim($val);}\n\t\t\t\t$f=true;\n\t\t\t\t$data .= $val;\n\t\t\t}\n\t\t}\t\t\n\t\t// Ok, Now let's add the new stuff\n\t\t$pArray = explode(\"\\n\",$playlist);\n\t\tfor ($i=0; $i < count($pArray); $i++){\n\t\t\tif ($pArray[$i] <> \"\"){\n\t\t\t\t// Now let's add this\n\t\t\t\t$val = \"\\\\\\\\\". $jbArr[$_SESSION['jb_id']]['mediaserver']. \"\\\\\". $jbArr[$_SESSION['jb_id']]['mediashare']. str_replace($jbArr[$_SESSION['jb_id']]['localpath'],\"\",str_replace(\"/\",\"\\\\\",$pArray[$i]));\n\t\t\t\t//echo $val. \"<br>\";\n\t\t\t\tif ($f){$val = \"\\r\\n\". trim($val);}\n\t\t\t\t$f=true;\n\t\t\t\t$data .= $val;\n\t\t\t}\n\t\t}\n\t\t// Now let's finish this out\n\t\tfor ($i=0; $i < count($endArr); $i++){\n\t\t\tif ($endArr[$i] <> \"\"){\n\t\t\t\t// Now let's add this\n\t\t\t\t$val = \"\\\\\\\\\". $jbArr[$_SESSION['jb_id']]['mediaserver']. \"\\\\\". $jbArr[$_SESSION['jb_id']]['mediashare']. \"\\\\\". str_replace($jbArr[$_SESSION['jb_id']]['localpath'],\"\",str_replace(\"/\",\"\\\\\",$endArr[$i]));\n\t\t\t\t//echo $val. \"<br>\";\n\t\t\t\tif ($f){$val = \"\\r\\n\". trim($val);}\n\t\t\t\t$f=true;\n\t\t\t\t$data .= $val;\n\t\t\t}\n\t\t}\n\n\t\t// Now let's clear the current list\n\t\tcontrol(\"clear\", false);\n\t\tusleep(500);\n\t\t\n\t\t$fileName = $jbArr[$_SESSION['jb_id']]['localpath']. \"/\". $jbArr[$_SESSION['jb_id']]['playlistname'];\n\t\t$handle = fopen($fileName, \"w\");\n\t\tfwrite($handle,$data);\t\n\t\tfclose ($handle);\n\t\t\n\t\t// Ok, now we need to tell the audiotron to play the M3U file\n\t\t$plName = \"\\\\\\\\\". $jbArr[0]['mediaserver']. \"\\\\\". $jbArr[0]['mediashare']. \"\\\\\". $jbArr[0]['playlistname'];\n\t\t\n\t\t// Now let's play then load\n\t\tfile_get_contents(\"http://\". $jbArr[$_SESSION['jb_id']]['server']. \"/apicmd.asp?cmd=stop\");\n\t\tfile_get_contents(\"http://\". $jbArr[$_SESSION['jb_id']]['server']. \"/apicmd.asp?cmd=clear\");\n\t\tunset($_SESSION['jb_at_playlist']);\n\t\tfile_get_contents(\"http://\". $jbArr[$_SESSION['jb_id']]['server']. \"/apiqfile.asp?type=file&file=\". $plName);\n\t\tusleep(500);\n\t\tfile_get_contents(\"http://\". $jbArr[$_SESSION['jb_id']]['server']. \"/apicmd.asp?cmd=play\");\n\t\tusleep(500);\n\t\t// Ok, first we need to know what track number we are on\n\t\t$c=0;\n\t\twhile ($c<$curTrack+1){\n\t\t\tfile_get_contents(\"http://\". $jbArr[$_SESSION['jb_id']]['server']. \"/apicmd.asp?cmd=next\");\n\t\t\tusleep(500);\n\t\t\t$c++;\n\t\t}\t\n\t\t?>\n\t\t<script>\n\t\t\thistory.back();\n\t\t</script>\n\t\t<?php\n\t\treturn;\n\t}",
"function get_democratic_playlist($session_id) { \n\n\t$session_id = sql_escape($session_id);\n\n\t$sql = \"SELECT id FROM tmp_playlist WHERE session='$session_id'\";\n\t$db_results = mysql_query($sql, dbh());\n\n\t$results = mysql_fetch_assoc($db_results);\n\n\t$tmp_playlist = new tmpPlaylist($results['id']);\n\n\treturn $tmp_playlist;\n\n}",
"public function testCreatePlaylist()\n {\n $response = $this->post('/api/v1/playlists', [\n 'playlist' => [\n 'name' => 'nice playlist'\n ]\n ]);\n $response->assertStatus(201);\n $response->assertJsonStructure([\n 'msg',\n 'data' => [ 'id', 'name']\n ]);\n }",
"public function getPlaylistService()\n {\n return $this->getService('playlist');\n }",
"public function populatePlaylist()\n\t\t{\n\t\t\tglobal $smartyObj;\n\t\t\t$playlist_info = array();\n\t\t\t$playlist_info['playlistUrl']=$this->CFG['site']['music_url'].'viewPlaylist.php?ajax_page=true&page=playlist';\n\t\t\t$this->playlist_name_notes = str_replace('VAR_MIN', $this->CFG['fieldsize']['music_playlist_name']['min'], $this->LANG['playlist_name_notes']);\n\t\t\t$this->playlist_name_notes = str_replace('VAR_MAX', $this->CFG['fieldsize']['music_playlist_name']['max'], $this->playlist_name_notes);\n\t\t\t$this->playlist_tags_notes = str_replace('VAR_MIN', $this->CFG['fieldsize']['music_playlist_tags']['min'], $this->LANG['playlist_tags_notes']);\n\t\t\t$this->playlist_tags_notes = str_replace('VAR_MAX', $this->CFG['fieldsize']['music_playlist_tags']['max'], $this->playlist_tags_notes);\n\t\t\t$this->getPlaylistIdInMusic($this->getFormField('song_id'));\n\t\t\t$this->displayCreatePlaylistInterface();\n\t\t\t$smartyObj->assign('playlist_info', $playlist_info);\n\t\t\t$smartyObj->assign('playlist_option', 'playlist');\n\t\t\tsetTemplateFolder('general/','music');\n\t\t\t$smartyObj->display('getPlaylist.tpl');\n\t\t}",
"function loadPlaylist($playlist) {\r\n\t\t$this->sendCommand(\"load $playlist\");\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Description: Loads the feed | public function loadFeed()
{
$this->feed = simplexml_load_file($this->feed_url);
} | [
"private function load_feed()\n\t{\n\t\t$this->debug_log .= \"load_feed()\\n\";\n\t\treturn ($this->raw_xml = simpleraw_xml_load_file($this->feed_url));\n\t}",
"public function fetchFeed(){\n\n $this->xmlDoc = new \\DOMDocument();\n $this->xmlDoc->load($this->feedUrl);\n $this->feedXML = $this->xmlDoc->saveXML(); \n }",
"public function loadFile()\n {\n\n if($this->_error === false)\n {\n $this->_feeds = simplexml_load_file($this->_url);\n }\n\t\t\telse {\n\t\t\t\t $this->_error = true;\n\t\t\t}\n }",
"private function _loadFeed($url)\n {\n try {\n // get the erfurt cache via ontowiki bootstrap\n $cache\t= clone OntoWiki::getInstance()->getCache();\n\n // this uses 304 http codes to speed up retrieval\n Zend_Feed_Reader::useHttpConditionalGet();\n\n // set lifetime for cached XML documents\n if (isset($this->_privateConfig->cachelifetime)) {\n $lifetime = (int)$this->_privateConfig->cachelifetime;\n } else {\n $lifetime = 86400; // default lifetime is one day\n }\n $cache->setLifetime($lifetime);\n\n // add cache support to feed reader, short version: reuse erfurt cache\n // http://framework.zend.com/manual/en/zend.feed.reader.html#zend.feed.reader.cache-request.cache\n Zend_Feed_Reader::setCache($cache);\n\n // look for cached feed to avoid unneeded traffic\n $cacheKey = 'Zend_Feed_Reader_' . md5($url);\n $cachedXml = $cache->load($cacheKey);\n\n if ($cachedXml != false) {\n // use the cached XML\n $feed = Zend_Feed_Reader::importString($cachedXml);\n } else {\n // try to load the feed from uri whithout cache support\n $feed = Zend_Feed_Reader::import($url);\n }\n\n } catch (Exception $e) {\n // feed import failed\n return;\n }\n\n // collect entries of the feed\n foreach ($feed as $entry) {\n $newEntry = array (\n 'title' => $entry->getTitle(),\n 'description' => $entry->getDescription(),\n 'dateModified' => $entry->getDateModified(),\n 'authors' => $entry->getAuthors(),\n 'link' => $entry->getLink(),\n 'content' => $entry->getContent()\n );\n $this->_entries[$entry->getLink()] = $newEntry;\n }\n }",
"function load()\n {\n //Retrieve the feed\n $this->get_feed();\n\n //process each of the csv files\n return $this->process_feed_file();\n }",
"function feed_retrieve()\r\n\t{\t\t\r\n\t\t//conectarse y obtener la respuesta en formato nativo\t\t\r\n\t\t$this->respuesta_raw = $this->buscar($this->feed_url);\t\t//TODO: validar una respuesta exitosa\t\t\r\n\t\t//transformar la respuesta raw a finjira\t\t\r\n\t\t$this->respuesta_findjira = $this->feed_parse();\t\t\t//web_parse utiliza respuesta_raw para transformarla\r\n\t}",
"public function read() {\n if( $this->feedUrl == '' ) {\n throw new \\Exception(\"Cannot read empty feed url.\");\n }\n\n // Get data of the feed\n $request = new Request();\n $feedData = $request->getDataAsObjectFromUrl( $this->feedUrl );\n\n // Set feed properties and create entries\n if( !empty($feedData) ) {\n // Feed property\n $this->id = $feedData->id;\n $this->title = $feedData->title;\n\n // Generate the entries of the data\n $this->readEntries( $feedData->entry );\n }\n }",
"public function loadRssFeed($url){\n\t\t\theader('content-type: application/xml');\n\t\t\tprint $this->puf->fetch($url);\n\t\t\texit;\n\t\t}",
"protected function fetchData() {\n\t\tif( !$this->url ) return false;\n\n\t\tif( $d = file_get_contents( $this->url ) ) {\n\t\t\t$this->data = simplexml_load_string ( $d ); \n\t\t}\n\t}",
"public function rssFeedAction()\n {\n $rss = new RssReader('http://www.vg.no/rss/nyfront.php?frontId=1');\n $rss->fetchData();\n $rss->sortDataByDate();\n\n $this->view->articles = $rss->getData();\n }",
"function load_feed_xml($url)\r\n{\r\n\t$feed = new SimplePie();\r\n\t$feed->set_feed_url($url);\r\n\t$feed->init();\r\n\t$feed->handle_content_type();\r\n\t$feed->set_cache_location($GLOBALS['root_path'] . '/cache');\r\n\t\r\n\treturn $feed;\r\n}",
"public function load() {\n\t\t$count = 1;\n\t\t$this->template = TemplateManager::load(\"NewsFeed\");\n\t\t$threads = $this->database->query(\"SELECT * FROM \". FORUM_DB . \".threads WHERE board_id=1 OR board_id=2 ORDER BY date DESC LIMIT \".self::NEWS_COUNT.\"\");\n\t\twhile ($thread = $threads->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$threadLink = \"/community/thread/index.php?board_id=\" . $thread['board_id'] . \"&id=\" . $thread['thread_id']. \"&page=1\";\n\t\t\t$firstPost = $this->database->query(\"SELECT * FROM web_forums.posts WHERE thread_id=\".$thread['thread_id'].\" AND first_post=1 LIMIT 1\");\n\t\t\tif ($firstPost->rowCount() == 1) {\n\t\t\t\t$firstPost = $firstPost->fetch(PDO::FETCH_ASSOC);\n\t\t\t\t$this->template->insert(\"title\", $thread['title']);\n\t\t\t\t$this->template->insert(\"post\", $firstPost['content']);\n\t\t\t\t$this->template->insert(\"collapsed\", $count++ > self::UNCOLLAPSED_COUNT ? \"collapsed\" : \"\");\n\t\t\t\t$this->template->insert(\"threadLink\", $threadLink);\n\t\t\t\t$this -> display();\n\t\t\t}\n\t\t}\n\t}",
"function fetch_feed() {\n include_once(ABSPATH . WPINC . '/rss.php');\n $rssdata = fetch_rss($this->feed_uri);\n \n // filter out already posted items, if necessary\n if ($lastpost = get_option('digest_post_last_post')) {\n $datefilter = create_function('$item', 'return ('.$lastpost.' < strtotime($item[\\'pubdate\\']));');\n $rssdata->items = array_filter($rssdata->items, $datefilter);\n }\n \n return $rssdata;\n }",
"public function load_timeline(){\n\t\ttry {\n\t\t\t$feed = CA_Social::getPosts($this->input->get('targetId'), $this->input->get('checkpoint'), 2, TRUE, $this->self['id']);\n\t\t\t$this->ajaxResponse(array(\n\t\t\t\t'status' => TRUE,\n\t\t\t\t'feed' => $feed,\n\t\t\t));\n\t\t}catch(Exception $e){\n\t\t\t$this->ajaxResponse(array(\n\t\t\t\t'status' => FALSE,\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t));\n\t\t}\n\t}",
"private function load_blog_rss_feed()\n\t{\n\n\t\t$key = 'blog-';\n\n\t\t$portugueseKey = $key . SCIELO_LANG;\n\t\t$cachedContentPortuguese = $this->put_blog_rss_feed_in_cache($portugueseKey, SCIELO_BLOG_URL, ONE_HOUR_TIMEOUT);\n\n\t\t$englishKey = $key . SCIELO_EN_LANG;\n\t\t$cachedContentEnglish = $this->put_blog_rss_feed_in_cache($englishKey, SCIELO_BLOG_EN_URL, ONE_HOUR_TIMEOUT);\n\n\t\t$spanishKey = $key . SCIELO_ES_LANG;\n\t\t$cachedContentSpanish = $this->put_blog_rss_feed_in_cache($spanishKey, SCIELO_BLOG_ES_URL, ONE_HOUR_TIMEOUT);\n\n\t\t$blog_posts = $this->get_content_by_language($cachedContentPortuguese, $cachedContentEnglish, $cachedContentSpanish);\n\n\t\tlibxml_use_internal_errors(true);\n\t\t$blog_xml_var = simplexml_load_string($blog_posts, 'SimpleXMLElement', LIBXML_NOCDATA);\n\t\tif($blog_xml_var === false)\n\t\t\t$blog_xml_var = array();\n\t\t$this->load->vars('blog_posts', $blog_xml_var);\n\n\t}",
"public static function getFeeds()\n\t{\n\t\t$rssUrl = Yii::app()->user->getState('rss_url');\n\t\t$rawFeed = file_get_contents($rssUrl);\n\t\tif($rawFeed!='') {\n\t\t\t// give an XML object to be iterate\n\t\t\t$xml = new SimpleXMLElement($rawFeed);\n\t\t\t$criteria = new CDbCriteria();\n\t\t\t$criteria->condition = 't.company_id=:company_id';\n\t\t\t$criteria->params = array(':company_id'=>Yii::app()->user->getState('globalId'));\n\t\t\t$rss_notification = RssNotification::model()->find($criteria);\n\t\t\t\n\t\t\t$post_pubDate = \"\";\n\t\t\t$post_url = \"\";\n\t\t\t$post_title = \"\";\n\t\t\t$data = '';\n\t\t\tforeach($xml->channel->item as $item)\n\t\t\t{\n\t\t\t\t$post_pubDate = $item->pubDate;\n\t\t\t\t$post_url = self::strip_cdata($item->link);\n\t\t\t\t$post_title = self::strip_cdata($item->title);\n\t\t\t\tif(strtotime($post_pubDate)>strtotime($rss_notification->last_post_pubDate)) {\n\t\t\t\t\t$data.= $post_pubDate;\n\t\t\t\t\t$data.= \"\\n\";\n\t\t\t\t\t\n\t\t\t\t\t$info = new Info();\n\t\t\t\t\t$info->user_id = Yii::app()->user->getState('userId');\n\t\t\t\t\t$info->company_id = Yii::app()->user->getState('globalId');\n\t\t\t\t\t$info->access_level_id = 1;\n\t\t\t\t\t$info->info_type_id = 2;\n\t\t\t\t\t$info->title = $post_title; \n\t\t\t\t\t$info->content = $post_url;\n\t\t\t\t\t$info->date_create = date('Y-m-d H:i:s', strtotime($post_pubDate));\n\t\t\t\t\t$info->save();\n\t\t\t\t}\n\t\t\t}\n\t\t\t//update the last post date time to now\n\t\t\tRssNotification::model ()->updateByPk ( $rss_notification->id, array (\n\t\t\t\t'last_post_pubDate' => date('Y-m-d H:i:s')\n\t\t\t) );\n\t\t\techo $data;\n\t\t}\n\t}",
"public function getFeed() {\n\t\t$feed = $this->getFeedCache();\n\t\tif (!$feed) {\n\t\t\t$feed = $this->getFeedUncached();\n\t\t\t$this->extend('updateFeedUncachedData', $feed);\n\t\t\t$this->setFeedCache($feed);\n\t\t\tif (class_exists(AbstractQueuedJob::class)) {\n\t\t\t\tsingleton(SocialFeedCacheQueuedJob::class)->createJob($this);\n\t\t\t}\n\t\t}\n\n\t\t$data = array();\n\t\tif ($feed) {\n\t\t\tforeach ($feed as $post) {\n\t\t\t\t$created = DBDatetime::create();\n\n\t\t\t\t$timestamp = $this->getPostCreated($post);\n\n\t\t\t\tif (!is_numeric($timestamp)) {\n\t\t\t\t\t$timestamp = strtotime($this->getPostCreated($post));\n\t\t\t\t}\n\n\t\t\t\t$created->setValue($timestamp);\n\n\t\t\t\t$data[] = array(\n\t\t\t\t\t'Type' => $this->getType(),\n\t\t\t\t\t'Content' => $this->getPostContent($post),\n\t\t\t\t\t'Created' => $created,\n\t\t\t\t\t'URL' => $this->getPostUrl($post),\n\t\t\t\t\t'Data' => $post,\n\t\t\t\t\t'UserName' => $this->getUserName($post),\n\t\t\t\t\t'Image' => $this->getImage($post)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$result = ArrayList::create($data);\n\t\t$result = $result->sort('Created', 'DESC');\n\t\treturn $result;\n\t}",
"public function read_rss(){\n\n\t\t\t$curl = curl_init();\n\t\t\tcurl_setopt ($curl,CURLOPT_URL,\"http://www.lepoint.fr/rss.xml\");\n\t\t\tcurl_setopt ($curl,CURLOPT_RETURNTRANSFER,true);\n\n\t\t\t$content = curl_exec($curl);\n\t\t\t//$content = simplexml_load_file(\"http://www.lepoint.fr/rss.xml\");\n\t\t\t$xml = new simpleXMLELEMENT($content);\n\t\t\t//echo '<pre>';var_dump($xml);die('xxxx');\n\t\t\techo('<ul>');\n\t\t\tforeach($xml->channel->item as $val){\n\t\t\t\techo('<li>'.$val->title.'<p>'.$val->description.'</p></li>');\n\t\t\t}\n\t\t\techo('</ul>');\n\t\t//\t$this->load->view('onglet_vw',$data);\n\t}",
"function tLoadFeed ()\n{\n global $tFeeds, $tCurrentFeed, $wp_query, $post;\n $tCurrentFeed = get_query_var('feed');\n // FB::trace($tCurrentFeed);\n if (empty($tCurrentFeed) || $tCurrentFeed == 'feed') {\n $tCurrentFeed = get_default_feed(); # rss2\n }\n $args =& $tFeeds[$tCurrentFeed];\t\n $defaults = \n array('num_entries' => get_option('posts_per_rss')\n , 'do_images' => true\n , 'size_image' => 'large'\n , 'feed_type' => (defined('TFEED') ? TFEED : 'atom')\n , 'feed_title' => 'Recent Posts'\n , 'feed_description' => 'An unfiltered list limited to ' . $num_entries . ' posts'\n );\n $args = apply_filters('t_load_feed_args', $args);\n $args = wp_parse_args($args, $defaults);\n # customizing default info\n if (is_category()) {\n $category = t_get_term_name(get_query_var('cat'), 'category');\n $args['feed_title'] = 'Feed for ' . $category;\n $args['feed_description'] = 'A list limited to ' . $args['num_entries'] . ' posts categorized under ' . $category;\n }\n if ($wp_query->is_comment_feed) { # comment feed\n if (is_singular()) {\n $args['feed_title'] = 'Recent comments on ' . get_the_title_rss();\n } elseif (is_search()) {\n $args['feed_title'] = 'Comments for search on ' . attribute_escape($wp_query->query_vars['s']);\n } else {\n $args['feed_title'] = 'Recent comments for ' . get_wp_title_rss();\n }\n $args['feed_title'] = ent2ncr($args['feed_title']);\n $args['feed_description'] = 'A list limited to ' . $args['num_entries'] . ' comments';\n }\n $args['query'] = tGetFeedQuery();\n if (is_array($args['query'])) {\n $args['query']['showposts'] =& $args['num_entries'];\n }\n if ($tCurrentFeed == 'rss' || $tCurrentFeed == 'rss2' || $tCurrentFeed == 'atom') {\n $args['feed_type'] = $tCurrentFeed;\n } else {\n $args['feed_title'] = ucwords(str_replace('_', ' ', $tCurrentFeed));\t\n }\n extract($args);\n # namespacing\n switch ($feed_type) {\n case 'rss2': \n $namespace = '\n xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n xmlns:atom=\"http://www.w3.org/2005/Atom\"\n xmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\"\n ';\n $feedType = RSS2;\n break; case 'rss':\n $namespace = '\n xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n xmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\"\n xmlns:admin=\"http://webns.net/mvcb/\"\n xmlns:content=\"http://purl.org/rss/1.0/modules/content/\"\n ';\n $feedType = RSS1;\n break; case 'atom': default:\n $namespace = '\n xmlns:thr=\"http://purl.org/syndication/thread/1.0\"\n xml:lang=\"' . get_option('rss_language') . '\"\n xml:base=\"' . get_bloginfo_rss('url') . '\"\n ';\n $feedType = ATOM;\n break;\n }\n $GLOBALS['t_feed_ns'] = $namespace; # for use in FeedWriter\n add_filter('t_feed_ns', create_function('$default', 'return $default . $GLOBALS[\"t_feed_ns\"];'));\n # start\n $feedWriter = new FeedWriter($feedType);\n require TDIR . TMODINC . 'feed-head.php';\n require TDIR . TMODINC . 'feed-body.php';\n # output\n $out = ob_get_contents();\n $out = str_replace(array(\"\\n\", \"\\r\", \"\\t\", ' '), '', $input);\n ob_end_clean();\n $feedWriter->generateFeed();\n // lifestream_rss_feed();\n // FB::info($args);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TDM Downloads Archive: /modules/TDMDownloads/ | public function xtw_tdm_downloads_redirect() {
# TDM Downloads Categories: /modules/TDMDownloads/viewcat.php?cid=2
# TDM Downloads items: /modules/TDMDownloads/singlefile.php?cid=2&lid=44
$url = home_url( 'downloads' );
if ( self::xtw_get_url() === '/modules/TDMDownloads/' ):
self::xtw_url_redirect( $url );
endif;
if ( isset( $_GET['lid'] ) ):
$downloads = self::xtw_get_url_request( 'lid', 0, 'tdm' );
self::xtw_url_redirect( self::xtw_get_permalinks( $downloads ) );
endif;
} | [
"public function downloadArchive(): void\n {\n $this->downloadBackup(true);\n }",
"public function download() {\t\t}",
"public function setup_downloads()\n {\n require_once(MM_INC_PATH . 'downloads.php');\n }",
"function getArchiveURL() {\n global $serendipity;\n return serendipity_rewriteURL(PATH_ARCHIVES);\n}",
"abstract function actionDownload();",
"public function livedownload() {\n\t\t$json = array();\n\t\t$this->load->model( 'extension/pavothemer/sample' );\n\t\t$code = ! empty( $this->request->request['code'] ) ? trim( $this->request->request['code'] ) : 'pa_xstore';\n\t\t$url = ! empty( $this->request->request['f'] ) ? trim( $this->request->request['f'] ) : false;\n\n\t\tif( $code && $url ) {\n\t\t\t$url = base64_decode( $url );\n\t\t\t$file = DIR_DOWNLOAD . $code . '.ocmod.zip';\n\t\t\t$request = PavothemerApiHelper::post( $url, array(\n\t\t\t\t\t\t\t\t\t'body'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'action'\t\t\t=> 'extensions',\n\t\t\t\t\t\t\t\t\t\t\t'extension_type'\t=> 'theme',\n\t\t\t\t\t\t\t\t\t\t\t'code'\t\t\t\t=> $code\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'filename'\t=> $file\n\t\t\t\t\t\t\t\t) );\n\n\t\t\t$response = ! empty( $request['response'] ) ? $request['response'] : array();\n\t\t\t$body = ! empty( $request['body'] ) ? $request['body'] : '';\n\t\t\tif ( ! isset( $response['code'] ) || $response['code'] !== 200 ) {\n\t\t\t\t$json['error'] = sprintf( $this->language->get( 'text_error_module_no_found' ), $code );\n\t\t\t} else if ( $body !== true ) {\n\t\t\t\t$body = json_decode( $body, true );\n\t\t\t\tif ( isset( $body['error'], $body['message'] ) ) {\n\t\t\t\t\t$json['error'] = $body['message'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->model_extension_pavothemer_sample->installModule( $file );\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $json['error'] ) ) {\n\t\t\t$json['status'] = true;\n\t\t}\n\n\t\t$this->response->addHeader('Content-Type: application/json');\n\t\t$this->response->setOutput(json_encode($json));\n\n\t}",
"function top_downloads()\r\n\t{\r\n\t\t\r\n\t\tdefine( 'IDM_PATH', ROOT_PATH.'modules/downloads/' );\r\n\t\t\r\n\t\t$this->ipsclass->load_language( 'lang_downloads' );\r\n\t\t$this->ipsclass->load_template( 'skin_downloads_external' );\r\n\r\n\t\t//-----------------------------------------\r\n\t\t// Get gallery library and API\r\n\t\t//-----------------------------------------\r\n\t\t\r\n\t\tif( !class_exists( 'api_idm' ) )\r\n\t\t{\r\n\t\t\trequire_once( ROOT_PATH.'sources/api/api_core.php' );\r\n\t\t\trequire_once( ROOT_PATH . 'sources/api/idm/api_idm.php' );\r\n\t\t}\r\n\t\t\r\n\t\t//-----------------------------------------\r\n\t\t// Create API Object\r\n\t\t//-----------------------------------------\r\n\t\t\r\n\t\t$idm_api = new api_idm;\r\n\t\t$idm_api->ipsclass = $this->ipsclass;\r\n\r\n\t\t//-----------------------------------------\r\n\t\t// Get images\r\n\t\t//-----------------------------------------\r\n\t\t\r\n\t\t$files = array();\r\n\t\t$files = $idm_api->return_idm_data( $member['id'], 10, 1, 'f.file_downloads DESC' );\r\n\t\t\r\n\t\t//-----------------------------------------\r\n\t\t// Ready to pull formatted stuff?\r\n\t\t//-----------------------------------------\r\n\t\t\r\n\t\t$data = array();\r\n\t\t\r\n\t\tif( count($files) )\r\n\t\t{\r\n\t\t\tforeach( $files as $row )\r\n\t\t\t{\r\n\t\t\t\t$row['css'] = $row['file_open'] == 1 ? 'row2' : 'row2shaded';\r\n\t\t\t\t\r\n\t\t\t\t$row['file_submitteddis'] = $this->ipsclass->get_date( $row['file_submitted'], 'LONG' );\r\n\t\t\t\t\r\n\t\t\t\tif( $row['file_updated'] > $row['file_submitted'] )\r\n\t\t\t\t{\r\n\t\t\t\t\t$row['file_updateddis'] = \"<strong>\".$this->ipsclass->lang['catdis_updated'].\"</strong>\".$this->ipsclass->get_date( $row['file_updated'], 'LONG' );\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$row['file_updateddis'] = \" \";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif( $row['file_submitter'] == 0 OR !$row['members_display_name'] )\r\n\t\t\t\t{\r\n\t\t\t\t\t$row['members_display_name'] = $this->ipsclass->lang['idm_guestlang'];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$row['submitter'] = $this->ipsclass->make_profile_link( $row['members_display_name'], $row['file_submitter'] );\r\n\t\t\t\t$row['filename'] = $this->ipsclass->compiled_templates['skin_downloads_external']->file_link( $row['file_name'], $row['file_id'] );\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t$data[] = $row;\r\n\t\t\t}\r\n\t\t}\r\n\t\t \r\n\t\t$output = $this->ipsclass->compiled_templates['skin_downloads_external']->portal_block( $this->ipsclass->lang['top_downloads'], $data, 1 );\r\n\r\n\t\treturn $output;\r\n\t}",
"public function actionPostersDownload() {\n $this->view->title = 'Загрузить картины из каталога';\n return $this->render('posters-download');\n }",
"function getUrlToDownloadFile() {\r\n\t\treturn \"http://www.elitetorrent.net/get-torrent/\";\r\n\t}",
"function fileDownload()\n{\n\tglobal $ajax;\n\tglobal $files;\n\tglobal $moduleFilename;\n\n\t$basePath = getBasePath();\n\t$currentPath = getCurrentPath();\n\t$selectedItem = getSelectedItem();\n\t$url = $files->fileDownloadUrl($basePath, $currentPath,\n\t\t$selectedItem, html::getBaseUrl(), '/application/' .\n\t\t$moduleFilename);\n\t$ajax->sendCommand(46, $url);\n}",
"function drush_pm_download() {\n if (!$requests = pm_parse_arguments(func_get_args(), FALSE)) {\n $requests = array('drupal');\n }\n\n // Parse out project name and version.\n $requests = pm_parse_project_version($requests);\n\n // Get release history for each request and download the project.\n $source = drush_get_option('source', RELEASE_INFO_DEFAULT_URL);\n $restrict_to = drush_get_option('dev', FALSE) ? 'dev' : '';\n $select = drush_get_option('select', 'auto');\n $all = drush_get_option('all', FALSE);\n foreach ($requests as $name => $request) {\n $request['status url'] = $source;\n $release = release_info_fetch($request, $restrict_to, $select, $all);\n if ($release == FALSE) {\n // Stop working on the first failure. Return silently on user abort.\n if (drush_get_context('DRUSH_USER_ABORT', FALSE)) {\n return FALSE;\n }\n // Signal that the command failed for all other problems.\n return drush_set_error('DRUSH_DOWNLOAD_FAILED', dt(\"Could not download requested project(s).\"));\n }\n\n // Determine the name of the directory that will contain the project.\n // We face here all the asymetries to make it smooth for package handlers.\n // For Drupal core: --drupal-project-rename or drupal-x.y\n if (($request['project_type'] == 'core') ||\n (($request['project_type'] == 'profile') && (drush_get_option('variant', 'full') == 'full'))) {\n // Avoid downloading core into existing core.\n if (drush_get_context('DRUSH_BOOTSTRAP_PHASE') >= DRUSH_BOOTSTRAP_DRUPAL_ROOT) {\n if (strpos(realpath(drush_get_option('destination')), DRUPAL_ROOT) !== FALSE) {\n return drush_set_error('DRUSH_PM_DOWNLOAD_TRANSLATIONS_FORBIDDEN', dt('It\\'s forbidden to download !project core into an existing core.', array('!project' => $request['name'])));\n }\n }\n\n if ($rename = drush_get_option('drupal-project-rename', FALSE)) {\n if ($rename === TRUE) {\n $request['project_dir'] = $request['name'];\n }\n else {\n $request['project_dir'] = $rename;\n }\n }\n else {\n // Set to drupal-x.y, the expected name for .tar.gz contents.\n // Explicitly needed for cvs package handler.\n $request['project_dir'] = strtolower(strtr($release['name'], ' ', '-'));\n }\n }\n // For the other project types we want the project name. Including core\n // variant for profiles. Note those come with drupal-x.y in the .tar.gz.\n else {\n $request['project_dir'] = $request['name'];\n }\n\n // Download the project to a temporary location.\n $request['base_project_path'] = drush_tempdir();\n $request['full_project_path'] = $request['base_project_path'] .'/'. $request['project_dir'];\n drush_log(dt('Downloading project !name to !dir ...', array('!name' => $request['name'], '!dir' => $request['base_project_path'])));\n if (!package_handler_download_project($request, $release)) {\n // Delete the cached updatexml since it may be invalid.\n drush_delete_dir(drush_download_file_name(updatexml_get_url($request)), TRUE);\n drush_log(dt('Error downloading !name', array('!name' => $request['name']), 'error'));\n continue;\n }\n\n // Determine the install location for the project. User provided\n // --destination has preference.\n $destination = drush_get_option('destination');\n if (!empty($destination)) {\n if (!file_exists($destination)) {\n drush_mkdir($destination);\n }\n $request['project_install_location'] = realpath($destination);\n }\n else {\n $request['project_install_location'] = _pm_download_destination($request['project_type']);\n }\n\n // If user did not provide --destination, then call the\n // download-destination-alter hook to give the chance to any commandfiles\n // to adjust the install location or abort it.\n if (empty($destination)) {\n $result = drush_command_invoke_all_ref('drush_pm_download_destination_alter', $request, $release);\n if (array_search(FALSE, $result, TRUE) !== FALSE) {\n return FALSE;\n }\n }\n\n // Load version control engine and detect if (the parent directory of) the\n // project install location is under a vcs.\n if (!$version_control = drush_pm_include_version_control($request['project_install_location'])) {\n continue;\n }\n\n $request['project_install_location'] .= '/' . $request['project_dir'];\n\n if ($version_control->engine == 'backup') {\n // Check if install location already exists.\n if (is_dir($request['project_install_location'])) {\n if (drush_confirm(dt('Install location !location already exists. Do you want to overwrite it?', array('!location' => $request['project_install_location'])))) {\n drush_delete_dir($request['project_install_location'], TRUE);\n }\n else {\n drush_log(dt(\"Skip installation of !project to !dest.\", array('!project' => $request['name'], '!dest' => $request['project_install_location'])), 'warning');\n continue;\n }\n }\n }\n else {\n // Find and unlink all files but the ones in the vcs control directories.\n $skip_list = array('.', '..');\n $skip_list = array_merge($skip_list, drush_version_control_reserved_files());\n drush_scan_directory($request['project_install_location'], '/.*/', $skip_list, 'unlink', TRUE, 'filename', 0, TRUE);\n }\n\n // Copy the project to the install location.\n if (drush_op('_drush_recursive_copy', $request['full_project_path'], $request['project_install_location'])) {\n drush_log(dt(\"Project !project (!version) downloaded to !dest.\", array('!project' => $request['name'], '!version' => $release['version'], '!dest' => $request['project_install_location'])), 'success');\n $request['base_project_path'] = basename($request['project_install_location']);\n $request['full_project_path'] = $request['project_install_location'];\n\n // If the version control engine is a proper vcs we also need to remove\n // orphan directories.\n if ($version_control->engine != 'backup') {\n $empty_dirs = drush_find_empty_directories($request['full_project_path'], $version_control->reserved_files());\n foreach ($empty_dirs as $empty_dir) {\n // Some VCS files are read-only on Windows (e.g., .svn/entries).\n drush_delete_dir($empty_dir, TRUE);\n }\n }\n\n // Post download actions.\n package_handler_post_download($request, $release);\n drush_command_invoke_all('drush_pm_post_download', $request, $release);\n $version_control->post_download($request);\n\n // Print release notes if --notes option is set.\n if (drush_get_option('notes') && !drush_get_context('DRUSH_PIPE')) {\n release_info_print_releasenotes(array($name . '-' . $release['version']), FALSE);\n }\n\n // Inform the user about available modules a/o themes in the downloaded project.\n drush_pm_extensions_in_project($request);\n }\n else {\n // We don't `return` here in order to proceed with downloading additional projects.\n drush_set_error('DRUSH_PM_DOWNLOAD_FAILED', dt(\"Project !project (!version) could not be downloaded to !dest.\", array('!project' => $request['name'], '!version' => $release['version'], '!dest' => $request['project_install_location'])));\n }\n\n // Notify about this project.\n if (drush_notify_allowed('pm-download')) {\n $msg = dt('Project !project (!version) downloaded to !install.', array(\n '!project' => $name,\n '!version' => $release['version'],\n '!install' => $request['project_install_location'],\n ));\n drush_notify_send(drush_notify_command_message('pm-download', $msg));\n }\n }\n}",
"public function actionArchiveList()\n {\n }",
"function Export_adminapi_importPack($args){\n// Security check\n if (!SecurityUtil::checkPermission( 'Export::', '::', ACCESS_ADMIN) ||!pnUserLoggedIn()) {\n return LogUtil::registerPermissionError();\n }\n\n $dom = ZLanguage::getModuleDomain('Export');\n $pack_path = FormUtil::getPassedValue('pack_path', isset($args['pack_path']) ? $args['pack_path'] : null, 'REQUEST');\n $modules_selected = FormUtil::getPassedValue('modules_selected', isset($args['modules_selected']) ? $args['modules_selected'] : null, 'REQUEST');\n\n $root_dir = sys_get_temp_dir() . \"/import_pack_\" . time();\n mkdir($root_dir);\n\n $tar = new tar();\n $tar->openTar($pack_path, FALSE);\n\n if ($tar->extractTar($root_dir)){\n unlink($pack_path);\n\n //$dir_id = opendir($root_dir);\n //$dir_cont = readdir($dir_id);\n $dir_cont = scandir($root_dir);\n $dir_cont = $dir_cont['2'];\n\n if($dir_cont != 'export_pack'){\n recursive_remove_directory($root_dir);\n return LogUtil::registerError(__('Corrupt package', $dom));\n }\n\n $dir_cont_array = scandir($root_dir . '/' . $dir_cont);\n $imported_modules = array();\n\n // Import all tables of system and modules\n foreach ($dir_cont_array as $dir_cont){\n //while($dir_cont = readdir($dir_id)){\n if($dir_cont == 'System'){\n //Check if the origin zikula version is the same of the actual version\n $objDOM = simplexml_load_file($root_dir . '/export_pack/System/metadata.xml');\n $zikula_version = utf8_decode($objDOM->zikulaVersion);\n if ($zikula_version != pnConfigGetVar('Version_Num')){\n recursive_remove_directory($root_dir);\n return LogUtil::registerError(__f('Zikula version %s is required', $zikula_version, $dom));\n }\n // Import all system tables\n // \"Categories\" module tables must be loaded\n pnModDBInfoLoad('Categories');\n\n //$data_dir_id = opendir($root_dir . '/export_pack/System');\n $data_dir_id = scandir($root_dir . '/export_pack/System');\n\n foreach ($data_dir_id as $data_dir_cont){\n //while($data_dir_cont = readdir($data_dir_id)){\n if(($data_dir_cont != '.') && ($data_dir_cont != '..' && ($data_dir_cont != 'metadata.xml'))){\n $table = substr($data_dir_cont, 0, -4);\n $columns = DBUtil::metaColumnNames($table);\n DBUtil::truncateTable($table);\n $XML_file = simplexml_load_file($root_dir . '/export_pack/System/' . $data_dir_cont);\n foreach($XML_file->row as $row){\n $fields = '';\n $values = '';\n foreach($row->children() as $field){\n $fieldname = $field->getName();\n if (in_array($fieldname, $columns)){\n $fields .= $fieldname.',';\n $field_value = str_replace(\"'\", \"''\", utf8_decode($field));\n $field_value = str_replace(\"\\''\", \"\\'\", $field_value);\n $values .= ($field == '$$NULL$$') ? \"NULL,\" :\"'\".$field_value.\"',\";\n //$values .= ($field == '$$NULL$$') ? \"NULL,\" :\"'\".ereg_replace(\"[^\\\\](')[^']|^(')\", \"\\\\2'\", utf8_decode($field)).\"',\";\n //$values .= ($field == '$$NULL$$') ? \"NULL,\" :\"`\".utf8_decode($field).\"`,\";\n }\n //$row_array[$field->getName()] = utf8_decode($field);\n }\n $sql = \"INSERT INTO \".pnConfigGetVar('prefix').'_'.$table.\"(\".substr($fields, 0, -1).\") VALUES(\".substr($values, 0, -1).\")\";\n DBUtil::executeSQL($sql);\n }\n /*\n foreach($XML_file->row as $row){\n $row_array = array();\n foreach($row->children() as $field){\n $row_array[$field->getName()] = utf8_decode($field);\n }\n DBUtil::insertObject($row_array, $table );\n } */\n }\n }\n continue;\n }\n\n //Check if folder corresponds to an installed module and the module is selected\n if(pnModAvailable($dir_cont)&&in_array($dir_cont, $modules_selected)){\n pnModDBInfoLoad($dir_cont);\n \n // Check if the exported module version is the same of the installed module\n $objDOM = simplexml_load_file($root_dir . '/export_pack/' . $dir_cont . '/data/metadata.xml');\n $module_version = utf8_decode($objDOM->moduleVersion);\n $where = \"WHERE `pn_name`='\" . $dir_cont . \"'\";\n $select = DBUtil::selectObjectArray('modules', $where);\n\n if($select['0']['version'] != $module_version){\n recursive_remove_directory($root_dir);\n return LogUtil::registerError(__f('The module %1$s requires the version %2$s', array($dir_cont, $module_version), $dom));\n }\n\n // Delete old files and copy the imported module files to the server\n // Get varibles from folder names\n $routes = array();\n $i = 0;\n\n //$files_dir_id = opendir($root_dir . '/export_pack/' . $dir_cont . '/files');\n $files_dir_id = scandir($root_dir . '/export_pack/' . $dir_cont . '/files');\n\n foreach ($files_dir_id as $files_dir_cont){\n //while($files_dir_cont = readdir($files_dir_id)){\n if(($files_dir_cont != '.') && ($files_dir_cont != '..')){\n $route = pnModAPIFunc('Export', 'admin', 'checkRoute', array(\n 'module_name' => $dir_cont,\n 'variable' => $files_dir_cont));\n if (substr($route, -1) == '/') $route = substr($route, 0, -1);\n if ((!empty($route)) && ($route != '0')){\n $routes[$i]['src'] = $root_dir . '/export_pack/' . $dir_cont . '/files/' . $files_dir_cont;\n $routes[$i]['dst'] = $route;\n $i++;\n }\n }\n }\n\n // Delete old files\n foreach ($routes as $route){\n if (file_exists($route['dst'])){\n if(!recursive_remove_directory($route['dst'])){\n if (!is_writable($route['dst'])){\n LogUtil::registerError(__f('It\\'s not possible to remove <i>%s</i> directory because it\\'s not writable', $route['dst'], $dom));\n }else{\n LogUtil::registerError(__f('It\\'s not possible to remove <i>%s</i> directory', $route['dst'], $dom));\n }\n }\n }\n }\n\n // Copy new files\n foreach ($routes as $route){\n if (!file_exists($route['dst'])) mkdir($route['dst']);\n recurseCopy($route['src'], $route['dst']);\n }\n\n // Copy the module variables from metadata.xml file\n // Check if the variable contains a route to a directory. Then we don't overwrites it\n $where = 'WHERE `module_name` = \"'.$dir_cont.'\"';\n $def_vars = DBUtil::selectObjectArray('export_routes', $where);\n $vars = array();\n foreach ($def_vars as $var){\n $vars[] = $var['variable'];\n if(($var['root_module']==$var['module_name'])&&(!in_array($var['root_variable'], $vars))) $vars[] = $var['root_variable'];\n }\n foreach($objDOM->moduleVars->children() as $var){\n $var_name = $var->getName();\n $var_value = utf8_decode($var);\n if (!in_array($var_name, $vars)) pnModSetVar($dir_cont, $var_name, $var_value);\n }\n\n // Delete old database values and import new values\n\n //$data_dir_id = opendir($root_dir . '/export_pack/' . $dir_cont . '/data');\n $data_dir_id = scandir($root_dir . '/export_pack/' . $dir_cont . '/data');\n // Load module tables\n pnModDBInfoLoad($dir_cont);\n $all_tables = pnDBGetTables();\n\n foreach($data_dir_id as $data_dir_cont){\n //while($data_dir_cont = readdir($data_dir_id)){\n if(($data_dir_cont != '.') && ($data_dir_cont != '..' && ($data_dir_cont != 'metadata.xml'))){\n $table = substr($data_dir_cont, 0, -4);\n\n if (array_key_exists($table, $all_tables)){\n $columns = DBUtil::metaColumnNames($table);\n DBUtil::truncateTable($table);\n $XML_file = simplexml_load_file($root_dir . '/export_pack/' . $dir_cont . '/data/' . $data_dir_cont);\n foreach($XML_file->row as $row){\n //$row_array = array();\n $fields = '';\n $values = '';\n foreach($row->children() as $field){\n if (in_array($field->getName(), $columns)){\n $fields .= $field->getName().',';\n $field_value = str_replace(\"'\", \"''\", utf8_decode($field));\n $field_value = str_replace(\"\\''\", \"\\'\", $field_value);\n $values .= ($field == '$$NULL$$') ? \"NULL,\" :\"'\".$field_value.\"',\";\n //$values .= ($field == '$$NULL$$') ? \"NULL,\" :\"`\".utf8_decode($field).\"`,\";\n //$row_array[$field->getName()] = utf8_decode($field);\n }\n }\n $sql = \"INSERT INTO \".pnConfigGetVar('prefix').'_'.$table.\"(\".substr($fields, 0, -1).\") VALUES(\".substr($values, 0, -1).\")\";\n //DBUtil::insertObject($row_array, $table);\n DBUtil::executeSQL($sql);\n }\n }\n }\n }\n\n $imported_modules[] = $dir_cont;\n }\n }\n\n //recursive_remove_directory($root_dir);\n return $imported_modules;\n }else{\n return LogUtil::registerError(__('It\\'s not possible to open the package.', $dom));\n }\n}",
"function file_download() {\n if (!$this->active_file) {\n $this->httpError(HTTP_BAD_REQUEST);\n } // if\n \n if(!$this->active_repository->canView($this->logged_user)) {\n $this->httpError(HTTP_ERR_FORBIDDEN);\n } // if\n \n $file_source = implode(\"\\n\", $this->repository_engine->cat($this->active_revision, $this->active_file, $this->request->get('peg')));\n download_contents($file_source, 'application/octet-stream', $this->active_file_basename, true);\n }",
"function cf_core_block_download_module_view() {\n // Get stable releases.\n $versions = _cf_core_get_releases(array('7.x', '6.x'), 'stable');\n\n // Create item list with the latest stable releases.\n $items = array();\n $count = 0;\n foreach ($versions as $version) {\n $items[$count] = array(\n 'data' => l(t('download !version', array('!version' => '<strong>' . key($version) . '</strong>')), $version[key($version)]['download_link'], array('html' => TRUE)),\n 'class' => array(\"download-{$count}\"),\n );\n if (0 == $count) {\n $items[$count]['class'][] = 'first';\n }\n $count++;\n if (count($versions) == $count) {\n $items[$count - 1]['class'][] = 'last';\n }\n }\n\n // Return item list.\n return array(\n 'content' => array(\n '#theme' => 'item_list',\n '#items' => $items,\n ),\n );\n}",
"public function get_cms_upgrade_download() {\n\n \n //Get version from http://lusocms.org\n\n $version = 'http://lusocms.org/version.xml';\n $xml=simplexml_load_file($version);\n $version =$xml->value;\n\n //Get zip file from http://lusocms.org and copy to temp folder\n\n $file = 'http://lusocms.org/'.$version.'.zip';\n $newfile = path('root').'cms_core/temp/'.$version.'.zip';\n $temp = path('root').'cms_core/';\n copy($file, $newfile) ;\n\n\n //Unzip package\n\n $zip = new ZipArchive;\n $res = $zip->open($newfile);\n if ($res === TRUE) {\n $zip->extractTo($temp);\n $zip->close();\n }\n \n //Write new version\n\n $a =\"'\";\n $data[] = '<?php ';\n $data[] ='$version ='.$a.$version.$a.';'; \n \n \n \n \n File::put(path('root').'cms_config/version.php', $data); \n\n \n\n Session::flash('info', '\n <div class=\"alert alert-info\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>\n <span class=\"error\">Upgrade downloaded and Unpacked!</span>\n </div>\n\n '); \n\n\n return Redirect::to('admin');\n\n }",
"function icms_module_update_downloads($module) {\r\n\t// check if upload directories exist and make them if not\r\n\tdownloads_upload_paths();\r\n\t\r\n\t$icmsDatabaseUpdater = icms_db_legacy_Factory::getDatabaseUpdater();\r\n\t$icmsDatabaseUpdater -> moduleUpgrade($module);\r\n return TRUE;\r\n}",
"public function downloadZipAction() {\n\n $getAllSongs = Engine_Api::_()->getDbTable('albumsongs', 'sesmusic')->getAllSongs($this->_getParam('album_id'));\n\n $song_files = array();\n foreach ($getAllSongs as $song) {\n $song_files[] = Engine_Api::_()->getItem('storage_file', $song->file_id)->storage_path;\n }\n\n if (count($song_files > 0)) {\n $zip = new ZipArchive();\n $zip_name = \"zipfile.zip\";\n if ($zip->open($zip_name, ZIPARCHIVE::CREATE) !== TRUE) {\n $error .= \"* Sorry ZIP creation failed at this time\";\n }\n\n foreach ($song_files as $song_file) {\n $zip->addFile($song_file);\n }\n\n $zip->close();\n if ($zip_name) {\n header('Content-Type: application/zip');\n header('Content-disposition: attachment; filename=zipfile.zip');\n header('Content-Length: ' . filesize($zip_name));\n readfile($zip_name);\n //Remove zip file from temp path\n unlink($zip_name);\n exit;\n return;\n }\n } else {\n echo \"No valid files to zip\";\n exit;\n }\n }",
"function kleo_woo_downloads_screen() {\n\t\tadd_action( 'bp_template_content', 'kleo_woo_downloads_screen_content' );\n\t\tbp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation deleteFundingUsingDelete Delete a funding request | public function deleteFundingUsingDelete($funding_id)
{
$this->deleteFundingUsingDeleteWithHttpInfo($funding_id);
} | [
"protected function deleteFundingUsingDeleteRequest($funding_id)\n {\n // verify the required parameter 'funding_id' is set\n if ($funding_id === null || (is_array($funding_id) && count($funding_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $funding_id when calling deleteFundingUsingDelete'\n );\n }\n\n $resourcePath = '/funding/{funding_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($funding_id !== null) {\n $resourcePath = str_replace(\n '{' . 'funding_id' . '}',\n ObjectSerializer::toPathValue($funding_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testDeleteFundingUsingDelete()\n {\n }",
"public function deleteAction(){\n\t\tZend_Loader::loadClass(\"Fund\", array(MODELS_PATH));\n\t\t$fundTable = new Fund();\n\t\t$id = $this->getRequest()->getQuery(\"id\");\n\t\t$fundTable->update(array(\"deleted\"=>1), $fundTable->getAdapter()->quoteInto(\"id = ?\", $id));\n\t\t$this->view->result = array(\"success\"=>true, \"id\"=>$id);\n\t\t$this->_helper->layout->setLayout(\"empty\");\t\n\t}",
"public function delete($bank);",
"public function delete()\n {\n $table = $this->getTable(); \n $where = $table->getAdapter()->quoteInto('tax_type_id = ?', $this->_taxTypeId);\n $ledgerId = $this->getLedgerId();\n $result = $table->delete($where);\n $ledgerModel = new Core_Model_Finance_Ledger();\n $ledgerModel->setLedgerId($ledgerId);\n $ledgerDeleteResult = $ledgerModel->delete();\n return $result;\n }",
"public function delete_delete(){\n $response = $this->PersonM->delete_person(\n $this->delete('id')\n );\n $this->response($response);\n }",
"public function testDebtorDelete()\n {\n $oDebtorDAO = new DebtorDAO();\n $oDebtor = $oDebtorDAO->findByCpfCnpj('01234567890');\n\n $this->assertTrue(!is_null($oDebtor->getId()));\n\n $oDebtor->delete();\n\n $oDebtor = $oDebtorDAO->findByCpfCnpj('01234567890');\n $this->assertFalse(!is_null($oDebtor->getId()));\n }",
"public function deleteByPaymentId($payment_id);",
"public function deleteDebit()\n {\n $table = $this->getTable();\n $where = $table->getAdapter()->quoteInto(\n 'fa_contact_id = ?', $this->_fa_contact_id\n );\n $table->delete($where);\n }",
"public function delete()\n {\n $bankTransactionRecord = $this->fetch();\n $ledgerEntryIds = unserialize(\n $bankTransactionRecord['s_ledger_entry_ids']);\n $financeLedgerModel = new Core_Model_Finance_Ledger_Entry();\n $result = $financeLedgerModel->deleteByIds($ledgerEntryIds);\n \n $table = $this->getTable();\n $where = $table->getAdapter()->quoteInto('bank_transaction_id = ?',\n $this->_bankTransactionId);\n $result = $table->delete($where);\n $log = $this->getLoggerService();\n $info = 'Bank Transaction deleted with bank transaction id = '. \n $this->_bankTransactionId;\n $log->info($info);\n return $result;\n }",
"public function delete($fundacion){\n $idFundacion=$fundacion->getIdFundacion();\n\n try {\n $sql =\"DELETE FROM `fundacion` WHERE `idFundacion`='$idFundacion'\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }",
"public function delete($account);",
"public function deleteJoinRequest($id);",
"public function delete($dn);",
"public function deleteProvidentFund($id)\n {\n\n $appStage=app_config('AppStage');\n if($appStage=='Demo'){\n return redirect('provident-fund/all')->with([\n 'message' => language_data('This Option is Disable In Demo Mode'),\n 'message_important'=>true\n ]);\n }\n\n $self='provident-fund';\n if (\\Auth::user()->user_name!=='admin'){\n $get_perm=permission::permitted($self);\n\n if ($get_perm=='access denied'){\n return redirect('permission-error')->with([\n 'message' => language_data('You do not have permission to view this page'),\n 'message_important'=>true\n ]);\n }\n }\n\n\n $pfund=ProvidentFund::find($id);\n if($pfund){\n $pfund->delete();\n return redirect('provident-fund/all')->with([\n 'message'=> language_data('Provident Fund delete successfully')\n ]);\n }else{\n return redirect('provident-fund/all')->with([\n 'message'=> language_data('Provident Fund information not found'),\n 'message_important'=>true\n ]);\n }\n }",
"function orderdel_delete($transaction_id)\n {\n //$transaction_id = $this->get('transaction');\n \n if( empty($transaction_id) || empty($this->userId) ){\n self::_throwError('Missing param.', '500');\n }else{\n $this->rest->db\n ->where('transaction_id = ', $transaction_id)\n ->where('member_id = ', $this->userId)\n ->update($this->table_order, array(\n 'order_status' => 'cancel'\n ));\n self::_success();\n }\n }",
"public function delete($proveedor);",
"public function deleting(Beneficiario $beneficiario)\n {\n $beneficiario->deleted_by = Auth::id();\n }",
"public function delete(BillingPlan $plan);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Marks an attribute dirty. This method may be called to force updating a record when calling [[update()]], even if there is no change being made to the record. | public function markAttributeDirty($name)
{
unset($this->_oldAttributes[$name]);
} | [
"public function markDirty(){}",
"public function dirty()\n {\n $this->freeze = false;\n }",
"function MarkDirty(){}",
"public function setDirty(string $property, $isDirty = true);",
"public function setDirty()\n\t{\n\t\t$this->_initCache();\n\t\t$this->_dirty = true;\n\t}",
"public function epSetDirty($is_dirty = true);",
"public function hasDirtyValueOfAttribute($attributeName);",
"public function clearDirty()\n {\n $this->attribute_changes = [];\n }",
"public function setDirty()\n {\n $this->cached = [];\n }",
"public function forceSetDirty(): void\n {\n $this->copy = -1;\n }",
"public function markDirty($member);",
"public function markAsUnread()\n {\n /** @var ActiveRecordInterface $model */\n $model = $this->owner;\n if (!is_null($model->{$this->readAttribute})) {\n $model->{$this->readAttribute} = null;\n $model->save(false);\n }\n }",
"public function markFieldDirty($name)\n {\n $this->dirty->$name = true; // field became dirty\n }",
"public function resetIsDirty();",
"static function mark_dirty() {\r\n graphics::mark_dirty(true, false, \"movie\", \"application/pdf\");\r\n }",
"public function setInactive()\n {\n $this->isActive = false;\n $this->save(); // make sure the record is saved\n }",
"static function setAllDirty()\n\t{\n\t\tglobal $ilDB;\n\t\n\t\t$ilDB->manipulate(\"UPDATE ut_lp_marks SET \".\n\t\t\t\" status_dirty = \".$ilDB->quote(1, \"integer\")\n\t\t\t);\n\t\t\n\t}",
"public function markAsDirty()\n {\n if ($this->hasUnitOfWork()) {\n $this->unitOfWork->registerDirty($this);\n }\n }",
"public function isDirty();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation topupTopupServiceTopupSubscription performs an instant topup | public function topupTopupServiceTopupSubscription($subscription_id, $parameters, $correlation_id = null, $transaction_id = null, $user = null)
{
list($response) = $this->topupTopupServiceTopupSubscriptionWithHttpInfo($subscription_id, $parameters, $correlation_id, $transaction_id, $user);
return $response;
} | [
"public function topupTopupServiceTopup($customer_account_id, $subscription_id, $parameters, $correlation_id = null, $transaction_id = null, $user = null)\n {\n list($response) = $this->topupTopupServiceTopupWithHttpInfo($customer_account_id, $subscription_id, $parameters, $correlation_id, $transaction_id, $user);\n return $response;\n }",
"public function testTopupTopupServiceTopupSubscription()\n {\n\n }",
"public function testTopupTopupServiceInitSubscription()\n {\n\n }",
"public function topupTopupServiceInit($customer_account_id, $subscription_id, $parameters, $correlation_id = null, $transaction_id = null, $user = null)\n {\n list($response) = $this->topupTopupServiceInitWithHttpInfo($customer_account_id, $subscription_id, $parameters, $correlation_id, $transaction_id, $user);\n return $response;\n }",
"function Topup($p) {\n $rspA = array();\n errlog(\"Topup: p = \", $p);\n $user = $p->user;\n errlog(\"Topup user = \", $user);\n $pwd = $p->password; \n errlog(\"Topup pwd = \", $pwd);\n $ref = $p->localRef;\n errlog(\"Topup ref = \", $ref);\n $hash = $p->hash;\n errlog(\"Topup hash = \", $hash);\n // I don't see what the key is and cannot confirm hash without it\n //verityHash($user, $ref, $pwd, $hash);\n $date = $p->date;\n $time = $p->time;\n $msisdn = $p->MSISDNDestination;\n $op = $p->operatorId;\n $amt = $p->amount;\n $getTick = $p->getTicket;\n $keyT=array('app' => 'CSQ', 'key' => $ref);\n $key=array('app' => 'CSQ', 'key' => $msisdn);\n $xA = array('msisdn' => 'a0',\n 'user' => 'a1',\n\t\t 'amt' => 'a2',\n\t\t 'reversed' => 'a3',\n\t\t 'testName' => 'a4',\n\t\t 'resultCode' => 'a5');\n errlog(\"Topup xa = \", $xA);\n $rA = array('user' => 'a1',\n\t\t'amt' => 'a2',\n\t\t'reversed' => 'a3',\n\t\t'testName' => 'a4',\n\t\t'resultCode' => 'a5');\n errlog(\"Topup rA = \", $rA);\n $xArr = array('a0' => $msisdn,\n\t\t'a1' => $user,\n\t\t'a2' => $amt,\n\t\t'a3' => 'false');\n updateTransDBRec($msisdn, $xArr, 'CSQ');\n insertTransDB($keyT, $xArr);\n $tpObj= new TopupObj($key, $xA, $rA);\n errlog(\"TopUp tpObj = \", $tpObj);\n $rspA = array();\n $successArray = array(0, 10, 20, 23, 30, 31, 92);\n if (!in_array($tpObj->re[resultCode], $successArray)) {\n $errMsg = findErrorMsg(\"TopUp\", $tpObj->re[resultCode]);\n $rspA = array('TopupResult' => array('resultCode' => $tpObj->re[resultCode],\n\t\t 'resultMessage' => $errMsg,\n 'Authorization' => NULL,\n\t\t 'DestinationAmount' => $amt,\n\t\t 'DestinationCurrency' => '???',\n\t\t 'Ticket' => NULL));\n errlog (\"INFO Topup error response :\", $rspA);\n } else {\n if (!$tpObj->re[resultCode]) {\n $tpObj->re[resultCode] = 10;\n \n }\n $massagedInput = array('msisdn' => $msisdn,\n\t\t\t 'user' => $user,\n\t\t\t 'amt' => $amt,\n\t\t\t 'reversed' => 'false',\n\t\t\t 'testName' => 'test',\n\t\t\t 'resultCode' => $tpObj->re[resultCode]);\n errlog (\"INFO Topup about to validate with:\", $tpObj->re);\n $tpObj->validateReqInput($massagedInput);\n errlog (\"INFO Topup finished validate :\", $tpObj->re);\n errlog (\"INFO Topup topup result:\", $tpObj->re);\n $rA = array(); \n $rsp = $tpObj->buildRspData($xArr);\n $auth = 'Test-' + randStr(9); \n $rspA = array('TopupResult' => array('resultCode' => $tpObj->re[resultCode],\n\t\t 'resultMessage' => 'Operation completed succesfully',\n 'Authorization' => $auth,\n\t\t 'DestinationAmount' => $amt,\n\t\t 'DestinationCurrency' => 'COP'));\n errlog (\"INFO Topup response :\", $rspA);\n }\n return $rspA;\n }",
"public function topupTopupServiceQuerySubscription($transaction_id, $subscription_id, $correlation_id = null, $user = null)\n {\n list($response) = $this->topupTopupServiceQuerySubscriptionWithHttpInfo($transaction_id, $subscription_id, $correlation_id, $user);\n return $response;\n }",
"public function testTopupTopupServiceTopup()\n {\n\n }",
"public function topupTopupServiceInitSubscription($subscription_id, $parameters, $correlation_id = null, $transaction_id = null, $user = null)\n {\n list($response) = $this->topupTopupServiceInitSubscriptionWithHttpInfo($subscription_id, $parameters, $correlation_id, $transaction_id, $user);\n return $response;\n }",
"public function testTopupTopupServiceCancel()\n {\n\n }",
"public function topupTopupServiceTopupSubscriptionWithHttpInfo($subscription_id, $parameters, $correlation_id = null, $transaction_id = null, $user = null)\n {\n // verify the required parameter 'subscription_id' is set\n if ($subscription_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $subscription_id when calling topupTopupServiceTopupSubscription');\n }\n // verify the required parameter 'parameters' is set\n if ($parameters === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $parameters when calling topupTopupServiceTopupSubscription');\n }\n // parse inputs\n $resourcePath = \"/subscriptions/{subscriptionId}/topup\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // header params\n if ($correlation_id !== null) {\n $headerParams['correlationId'] = $this->apiClient->getSerializer()->toHeaderValue($correlation_id);\n }\n // header params\n if ($transaction_id !== null) {\n $headerParams['transactionId'] = $this->apiClient->getSerializer()->toHeaderValue($transaction_id);\n }\n // header params\n if ($user !== null) {\n $headerParams['user'] = $this->apiClient->getSerializer()->toHeaderValue($user);\n }\n // path params\n if ($subscription_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"subscriptionId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($subscription_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($parameters)) {\n $_tempBody = $parameters;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('accessKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['accessKey'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\iNew\\Rest6_1\\Model\\TopupResponse',\n '/subscriptions/{subscriptionId}/topup'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\iNew\\Rest6_1\\Model\\TopupResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\TopupResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function CheckTranTopup() {\n $txtData = \"\";\n $txtAgentCode = Util::$agentCode;\n $txtAgentKey = Util::$agentKey;\n $tranidRequest = \"2016062711420056\";\n $gcr = GetCardRequest::createAll($txtAgentCode, $tranidRequest);\n $gcrString = $gcr->toJson();\n $rt = new ResponseTopup();\n try {\n $txtData = Util::Encrypt($txtAgentKey, $gcrString);\n $client = new SoapClient(Util::$cncServiceUrl, true);\n $params = array('agentCode' => $txtAgentCode, 'data' => $txtData);\n $result = $client->call(\"CheckTranTopup\", $params)['CheckTranTopupResult'];\n $error = $client->getError();\n if ($error) {\n print_r($client->response);\n print_r($client->getDebug());\n die();\n }\n $json = utf8_decode($result);\n $data = json_decode($json, true);\n $rt->set($data);\n } catch (Exception $exc) {\n die($exc->getMessage());\n }\n return $rt->toJson();\n }",
"public function topupTopupServiceTopupWithHttpInfo($customer_account_id, $subscription_id, $parameters, $correlation_id = null, $transaction_id = null, $user = null)\n {\n // verify the required parameter 'customer_account_id' is set\n if ($customer_account_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $customer_account_id when calling topupTopupServiceTopup');\n }\n // verify the required parameter 'subscription_id' is set\n if ($subscription_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $subscription_id when calling topupTopupServiceTopup');\n }\n // verify the required parameter 'parameters' is set\n if ($parameters === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $parameters when calling topupTopupServiceTopup');\n }\n // parse inputs\n $resourcePath = \"/customers/{customerAccountId}/subscriptions/{subscriptionId}/topup\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // header params\n if ($correlation_id !== null) {\n $headerParams['correlationId'] = $this->apiClient->getSerializer()->toHeaderValue($correlation_id);\n }\n // header params\n if ($transaction_id !== null) {\n $headerParams['transactionId'] = $this->apiClient->getSerializer()->toHeaderValue($transaction_id);\n }\n // header params\n if ($user !== null) {\n $headerParams['user'] = $this->apiClient->getSerializer()->toHeaderValue($user);\n }\n // path params\n if ($customer_account_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"customerAccountId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($customer_account_id),\n $resourcePath\n );\n }\n // path params\n if ($subscription_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"subscriptionId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($subscription_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($parameters)) {\n $_tempBody = $parameters;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('accessKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['accessKey'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\iNew\\Rest6_1\\Model\\TopupResponse',\n '/customers/{customerAccountId}/subscriptions/{subscriptionId}/topup'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\iNew\\Rest6_1\\Model\\TopupResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\TopupResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"private function payment_fund_transfers_affiliates_top_up()\n {\n }",
"function DoTopUp($p) {\n$disclaimer = \"Blackstone is a patented distributor of phone cards & calling \";\n$tAndC = \"Prices, fees, availability, terms of use and rates are subject\";\n$disclaimer .= \"cards for the purpose of international & domestic long distance phone calls. This\";\n$tAndC .= \" to change without prior notice at the discretion of the network \";\n$tAndC .= \"service provider. For more detail on rates and other charges, please\";\n $tAndC .= \" consult the customer service. Blackstone is not responsible for \";\n $tAndC .= \"lost or stolen pins and changes in the rates by service provider.\";\n errlog(\"DoTopUp p = \", $p);\n $phone = $p->PhoneNumber;\n $code = $p->ProductMaincode;\n errlog(\"DoTopUp phone = \", $phone);\n /*$rspA = array('DoTopUpResult' => \n array('ErrorCode' => 0,\n\t\t 'ErrorMessage'=> \"Nothing\",\n\t\t 'TransactionID' => randStr(8),\n\t\t 'PinID' => '12345',\n\t\t 'ProductMainCode' => $code));\n return $rspA; */\n $orderId = $p->OrderID;\n errlog(\"DoTopUp orderId = \", $orderId);\n $keyT=array('app' => 'Pinserve', 'key' => $orderId);\n $key=array('app' => 'Pinserve', 'key' => $phone);\n $xA = array('phone' => 'a0',\n\t\t 'orderId' => 'a1',\n\t\t 'code' => 'a2',\n\t\t 'msg' => 'a3',\n\t\t 'errCode' => 'a4',\n\t\t 'errMsg' => 'a5');\n errlog(\"DoTopUp xa = \", $xA);\n $rA = array('orderId' => 'a1',\n\t\t'code' => 'a2',\n\t\t'msg' => 'a3',\n 'errCode' => 'a4',\n\t\t'errMsg' => 'a5');\n errlog(\"DoTopUp rA = \", $rA);\n $xArr = array('a0' => $phone,\n\t\t'a1' => $orderId,\n\t\t'a2' => $code,\n\t\t'a3' => 'Ok');\n updateTransDBRec($phone, $xArr, 'Pinserve');\n insertTransDB($keyT, $xArr);\n $tpObj= new TopupObj($key, $xA, $rA);\n errlog(\"DoTopUp tpObj = \", $tpObj);\n if ($tpObj->re[errCode]) {\n $error = $tpObj->re[errCode];\n $errMsg = $tpObj->re[errMsg];\n errlog(\"DoTopUp set errMsg & errCode= $error\", $errMsg);\n /*$rspA = array('DoTopUpResult' => */\n } else {\n $error = \"0\";\n $errMess = NULL;\n $massagedInput = array('phone' => $phone,\n\t\t\t\t'orderId' => $orderId,\n\t\t\t\t'code' => $code,\n\t\t\t\t'msg' => 'Ok');\n errlog (\"INFO DoTopUp about to validate with:\", $tpObj->re);\n $tpObj->validateReqInput($massagedInput);\n errlog (\"INFO DoTopUp finished validate :\", $tpObj->re);\n errlog (\"INFO DoTopUp topup result:\", $tpObj->re);\n $rA = array(); \n $rsp = $tpObj->buildRspData($xArr);\n } \n $rspA = array('ErrorCode' => $error,\n\t\t\t'ErrorMessage'=> $errMsg,\n\t\t\t'TransactionID' => randStr(8),\n\t\t\t'PinID' => '12345',\n\t\t\t'ProductMainCode' => $code,\n\t\t\t'ProductDenomination' => '10.00',\n\t\t\t'PinNumber' => '12695',\n\t\t\t'ControlNumber' => NULL,\n\t\t\t'Language' => NULL,\n\t\t\t'ProductSBT' => randStr(6),\n\t\t\t'Conn800English' => NULL,\n\t\t\t'CustomerServiceEnglish' => NULL,\n\t\t\t'LocalAccessPhones>' =>\n\t\t\t\tarray('anyType' => 'ab'),\n\t\t\t'ItemFK' => randStr(6),\n\t\t\t'TransactionMode' => NULL,\n\t\t\t'ProductDescription' => NULL,\n\t\t\t'Batch' => NULL,\n\t\t\t'ExpirationDate' => new DateTime('last day of next month'),\n\t\t\t'ProductType' => 'Top Up',\n\t\t\t'Barcode' => '01110',\n\t\t\t'Instructions' => 'Do not move',\n\t\t\t'PrinterDisclaimer' => $disclaimer,\n\t\t\t'ToppedUpNumber' => $phone,\n\t\t\t'AccountNumber' => NULL,\n\t\t\t'LegalInfo>' => \n\t\t\t\tarray('Version' => '2.3.3',\n\t\t\t\t'Copyright' => 'Copyright © 2008 Pinserve Technologies, Inc. All Rights Reserved',\n\t\t\t\t'Disclaimer' => $disclaimer,\n\t\t\t 'PrivacyURL' => 'http://www/blackstoneonline.com/contactus/privacypolicy',\n\t\t\t\t'TermsAndConditions'=> $tAndC,\n\t\t\t\t'ContactPhone'=> '1 800 639-5555'),\n 'ForeignAmount' => '0',\n\t\t\t 'ForeignMoneyLeft' => '0',\n\t\t\t'ReferenceNumber' => randStr(8),\n\t\t\t'AuthorizationCode' => randStr(5),\n\t\t\t'CurrencyCode' => NULL); // a la Junie B\n errlog (\"INFO Topup response :\", $rspA);\n return array('DoTopUpResult' => $rspA);\n }",
"public function testTopupTopupServiceInit()\n {\n\n }",
"public function simpanTopup($id_pengguna,$topup){\n\t\t$this->db->query(\"INSERT INTO transaksi (id_pengguna,id_jenis_transaksi,topup) VALUES ('$id_pengguna','tr2',$topup)\");\n\n\t\t// mendapatkan saldo\n\t\t// ========================================================================\n\t\t$query = $this->db->query(\"SELECT saldo FROM pengguna WHERE id_pengguna = $id_pengguna\");\n\t\t$saldo;\n\t\tforeach ($query->result_array() as $row) {\n\t\t\t$saldo = $row['saldo'];\n\t\t};\n\n\t\t// menjumlahkan saldo dengan topup\n\t\t// ======================================================================\n\t\t$hasil = $saldo + $topup;\n\t\t$data = array(\n\t\t\t'saldo' => $hasil,\n\t\t);\n\t\t$this->db->where('id_pengguna', $id_pengguna);\n\t\t$this->db->update('pengguna', $data);\n\t}",
"public function testTopupTopupServiceQuery()\n {\n\n }",
"protected function v1TopupPostRequest($topup_request)\n {\n // verify the required parameter 'topup_request' is set\n if ($topup_request === null || (is_array($topup_request) && count($topup_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $topup_request when calling v1TopupPost'\n );\n }\n\n $resourcePath = '/v1/topup';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($topup_request)) {\n $_tempBody = $topup_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testCalculateTopUpCost(): void\n {\n $topUpFacility = new TopUpFacility($this->fee, 0);\n\n $this->assertEquals(0, $topUpFacility->getTopUpCost(25));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation reviewUpsert Update an existing model instance or insert a new one into the data source. | public function reviewUpsert($data = null)
{
list($response) = $this->reviewUpsertWithHttpInfo($data);
return $response;
} | [
"public function testReplaceOneUpsert()\n {\n $collection = static::$collection;\n\n $id = new ObjectId('5aebb3ae738ee61d78164693');\n $doc = ['foo' => 'bar', '_id' => $id];\n\n $this->assertSame(0, $collection->count(['_id' => $id]));\n\n $collection->replaceOne(['_id' => $id], $doc, ['upsert' => true]);\n $this->assertSame(1, $collection->count(['_id' => $id]));\n }",
"public function dbUpsert($title, $table, &$data) {\n\n $time = microtime(true);\n // Verify we have the object created\n if(!$this->dbInit()) return($this->errorMsg);\n\n // Execute the query\n\n $this->db->cfmode=false; // Deactivate Cloudframework mode.\n if(!isset($data[0])) $data = [$data];\n foreach ($data as $record) {\n $this->db->cloudFrameWork('replace',$record,$table);\n $time = round(microtime(true)-$time,4);\n $this->core->logs->add($title.\" [{$time} secs]\",'dbUpsert');\n if($this->db->error()) return($this->addError($this->db->getError()));\n $time = microtime(true);\n }\n\n return true;\n }",
"public function test_postUpsert() {\n\n }",
"function UpdateReview()\n\t{\n\t\t$users_id = Auth::user()->id;\n\t\tif(Input::has('food_instance_id'))\n\t\t{\n\t\t\t$food_instance_id = Input::get('food_instance_id');\n\t\t\t$review = review::where('users_id', '=', $users_id)->where('food_instance_id', '=', $food_instance_id)->first();\n\t\t\tif(empty($review)) //if a review doesn't already exist for this user and food instance\n\t\t\t{\n\t\t\t\t$review = new Review;\n\t\t\t\t$review->users_id = $users_id;\n\t\t\t\t$review->food_instance_id = $food_instance_id;\n\t\t\t\t$review->food_instance_food_type_id = food_instance::find($food_instance_id)->food_types_id;\n\t\t\t}\n\t\t\t$review->rating = Input::get('rating', 0);\n\t\t\t$review->reviewText = Input::get('reviewText', '');\n\t\t\t$success = $review->save();\n\t\t\tif($success) return Redirect::To(\"/food/$food_instance_id/Name\");;\n\t\t}\n\t\treturn Redirect::To(\"/\");\n\t}",
"public function updated(Review $review)\n {\n //\n }",
"public function testUpdateReview()\n {\n\n }",
"public function testUpsertItem()\n {\n $item = $this->rem->getItem(\"users\", 1);\n $res = $this->rem->upsertItem(\"teachers\", 1, $item);\n $this->assertEquals($item, $res);\n\n $item = $this->rem->getItem(\"users\", 2);\n $res = $this->rem->upsertItem(\"teachers\", 2, $item);\n $this->assertEquals($item, $res);\n\n $res = $this->rem->upsertItem(\"teachers\", 1, $item);\n $item = $this->rem->getItem(\"teachers\", 1);\n $this->assertEquals($item, $res);\n }",
"public function testUpdateValidReview() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"review\");\n\n\t\t// create a new Review and insert to into mySQL\n\t\t$review = new Review($this->profileReceive->getProfileId(),\n\t\t\t\t\t\t\t\t\t\t$this->profileWrite->getProfileId(),\n\t\t\t\t\t\t\t\t\t\t$this->VALID_REVIEWCONTENT,\n\t\t\t\t\t\t\t\t\t\t$this->VALID_REVIEWDATE,\n\t\t\t\t\t\t\t\t\t\t$this->VALID_REVIEWRATING);\n\t\t$review->insert($this->getPDO());\n\n\t\t// query the data from mySQL and verify the Content data before calling update method\n\t\t$pdoReview = Review::getReviewByReceiveProfileIdAndWriteProfileId($this->getPDO(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$review->getReviewReceiveProfileId(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$review->getReviewWriteProfileId());\n\n\t\t$this->assertEquals($pdoReview->getReviewContent(), $this->VALID_REVIEWCONTENT);\n\n\t\t// modify the Review and update the content in mySQL\n\t\t$review->setReviewContent($this->VALID_REVIEWCONTENT2);\n\t\t$review->update($this->getPDO());\n\n\t\t// query the data from mySQL and verify the fields match our expectations\n\t\t$pdoReview = Review::getReviewByReceiveProfileIdAndWriteProfileId($this->getPDO(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$review->getReviewReceiveProfileId(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$review->getReviewWriteProfileId());\n\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"review\"));\n\t\t$this->assertEquals($pdoReview->getReviewReceiveProfileId(), $review->getReviewReceiveProfileId());\n\t\t$this->assertEquals($pdoReview->getReviewWriteProfileId(), $review->getReviewWriteProfileId());\n\t\t$this->assertEquals($pdoReview->getReviewContent(), $this->VALID_REVIEWCONTENT2);\n\t\t$this->assertEquals($pdoReview->getReviewDateTime(), $this->VALID_REVIEWDATE);\n\t\t$this->assertEquals($pdoReview->getReviewRating(), $this->VALID_REVIEWRATING);\n\t\t//\n\t\t}",
"public function setUpsert(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Datastore\\V1\\Entity::class);\n $this->writeOneof(6, $var);\n }",
"public function testUpsert() {\n $connection = Database::getConnection();\n $num_records_before = $connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();\n\n $upsert = $connection->upsert('test_people')\n ->key('job')\n ->fields(['job', 'age', 'name']);\n\n // Add a new row.\n $upsert->values([\n 'job' => 'Presenter',\n 'age' => 31,\n 'name' => 'Tiffany',\n ]);\n\n // Update an existing row.\n $upsert->values([\n 'job' => 'Speaker',\n // The initial age was 30.\n 'age' => 32,\n 'name' => 'Meredith',\n ]);\n\n $result = $upsert->execute();\n $this->assertIsInt($result);\n $this->assertGreaterThanOrEqual(2, $result, 'The result of the upsert operation should report that at least two rows were affected.');\n\n $num_records_after = $connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();\n $this->assertEquals($num_records_before + 1, $num_records_after, 'Rows were inserted and updated properly.');\n\n $person = $connection->query('SELECT * FROM {test_people} WHERE [job] = :job', [':job' => 'Presenter'])->fetch();\n $this->assertEquals('Presenter', $person->job, 'Job set correctly.');\n $this->assertEquals(31, $person->age, 'Age set correctly.');\n $this->assertEquals('Tiffany', $person->name, 'Name set correctly.');\n\n $person = $connection->query('SELECT * FROM {test_people} WHERE [job] = :job', [':job' => 'Speaker'])->fetch();\n $this->assertEquals('Speaker', $person->job, 'Job was not changed.');\n $this->assertEquals(32, $person->age, 'Age updated correctly.');\n $this->assertEquals('Meredith', $person->name, 'Name was not changed.');\n }",
"public function testProfilePrototypeUpdateByIdReviews()\n {\n\n }",
"public function testInsertReviewWithoutTitle()\n {\n $edition = Edition::where('title', '=', 'ReviewEdition')->firstOrFail();\n $user = User::where('email', '=', 'testuser@whereyouleftoff.com')->firstOrFail();\n \n $payload = [\n 'user_id' => $user->id,\n 'edition_id' => $edition->id,\n 'spoilers' => true,\n 'content' => 'Review text will be here too.'\n ];\n $this->post('/api/v1/review', $payload, ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson($payload);\n $this->assertDatabaseHas('reviews', $payload);\n }",
"public function upsert($table, $insertColumns, $updateColumns, &$params);",
"public function flagUpsert($data = null)\n {\n list($response) = $this->flagUpsertWithHttpInfo($data);\n return $response;\n }",
"public function testUpsertRow()\n {\n $values = ['emailAddress' => 'nothing@nothing.com'];\n $test = $this->api->upsertRow('primaryKey', '2', $values, 'ETApiTest');\n $delete = $this->api->deleteRow('ETApiTest', ['primaryKey' => 2]);\n $this->assertEquals(200, $test);\n }",
"public function testUpdatingASingleReview()\n {\n $user = factory(User::class)->make([\n 'role' => 'admin',\n ]);\n\n $this->be($user);\n\n // Create a post.\n $post = factory(Post::class)->create();\n $review = [\n 'post_id' => $post->id,\n 'status' => 'accepted',\n ];\n\n $this->json('PUT', $this->reviewsUrl, $review);\n $this->assertResponseStatus(201);\n\n $response = $this->decodeResponseJson();\n\n // Make sure we created a event for the review.\n $this->seeInDatabase('events', [\n 'created_at' => $response['data']['created_at'],\n ]);\n\n // Make sure a review is created.\n $this->seeInDatabase('reviews', [\n 'admin_northstar_id' => $user->northstar_id,\n 'post_id' => $response['data']['id'],\n ]);\n\n // Make sure the status is updated.\n $this->seeInDatabase('posts', [\n 'status' => $response['data']['status'],\n ]);\n }",
"public function testQuarantineUpsert()\n {\n\n }",
"public function test_userUpsert() {\n\n }",
"public function upsert(UpsertRequest $arg) {\n\t\treturn $this->makeSoapCall(\"upsert\", $arg);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a form to delete a pedido entity. | private function createDeleteForm(Pedido $pedido)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('admin_pedido_delete', array('id' => $pedido->getId())))
->setMethod('DELETE')
->getForm()
;
} | [
"private function createDeleteForm(Pedido $pedido)\r\n {\r\n \r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('pedido_delete', array('id' => $pedido->getId())))\r\n ->setMethod('DELETE')\r\n ->getForm()\r\n ;\r\n }",
"private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('box_delete', array('id' => '__obj_id__')))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Pedidos $pedido)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pedidos_delete', array('id' => $pedido->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Vente $vente)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('vente_delete', array('id' => $vente->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(DatParteDesvio $datParteDesvio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('partedesvio_delete', array('id' => $datParteDesvio->getIdparte())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm( OrdenDePago $ordenDePago ) {\n\t\treturn $this->createFormBuilder()\n\t\t ->set( $this->generateUrl( 'orden_de_pago_delete', array( 'id' => $ordenDePago->getId() ) ) )\n\t\t ->setMethod( 'DELETE' )\n\t\t ->getForm();\n\t}",
"private function createDeleteForm(Venta $ventum) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('venta_delete', array('id' => $ventum->getId())))\r\n ->setMethod('DELETE')\r\n ->getForm()\r\n ;\r\n }",
"private function createDeleteForm(Funcionaros $funcionaro)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('funcionaros_delete', array('idfuncionaros' => $funcionaro->getIdfuncionaros())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Ventes $vente)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_ventes_delete', array('id' => $vente->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Votacao $votacao) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_votacao_delete', array('id' => $votacao->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Veiculo $veiculo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('veiculo_delete', array('id' => $veiculo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(DetallePedido $detallePedido)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('detallepedido_delete', array('id' => $detallePedido->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(PedidoVenta $pedidoVentum)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pedidoventa_delete', array('id' => $pedidoVentum->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n \n $form = $this->createFormBuilder(null, array('attr' => array('id' => 'entrada_detalles_eliminar_type')))\n ->setAction('')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'icon' => 'trash', 'attr' => array('class' => 'btn-danger')))\n ->getForm()\n ;\n \n return $form;\n \n \n }",
"private function createDeleteForm(Puesto $puesto)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('puesto_delete', array('id' => $puesto->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Medida $medida)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('medidas_delete', array('id' =>':ID' )))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(CfgTipoVehiculo $cfgTipoVehiculo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cfgtipovehiculo_delete', array('id' => $cfgTipoVehiculo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\n return $this->createFormBuilder()\n\t\t ->setAction($this->generateUrl('producto_delete', array('id' => $id)))\n\t\t ->setMethod('DELETE')\n\t\t ->add('submit', 'submit', array('label' => 'Delete'))\n\t\t ->getForm()\n ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decline more Quote Request | public function decinemorequoteAction(){
global $objSession;
$Decline_job_id = $this->getRequest()->getParam('decline_job_id');
// prd($Decline_job_id);
// update more_quote table
$where = "more_quote_job_id='".$Decline_job_id."'";
$changeStatus['more_quote_status']=2;
$changeStatus['more_quote_admin_allowed']='0';
$change_more_quoteStatus = $this->modelsuper->Super_Insert("more_quote",$changeStatus,$where);
if(is_object($change_more_quoteStatus) and $change_more_quoteStatus->success){
// update job table more quote field
$whereJob = "job_id='".$Decline_job_id."'";
$changeJobStatus['job_more_quote_status']=2;
$changeJobMoreQuoteStauts = $this->modelsuper->Super_Insert("job",$changeJobStatus,$whereJob);
// prd($changeJobMoreQuoteStauts);
$RequestedBy = $this->modelsuper->Super_Get("more_quote","more_quote_job_id='".$Decline_job_id."'","fetch");
// send accept notice to client
$DeclineNotice['notification_job_id']= $Decline_job_id;
$DeclineNotice['notification_sender']= "1";
$DeclineNotice['notification_reciver']= $RequestedBy['more_quote_sender'];
$DeclineNotice['notification_date']=date('Y-m-d H:i:s');
$DeclineNotice['notification_message']="Decline more quote request";
$DeclineNotice['notification_type']='7';
$DeclineNotice['notification_status']='0';
$DeclineNotice['notification_main_status']='0';
$SentDeclineNotice = $this->modelsuper->Super_Insert("notifications",$DeclineNotice);
// prd($SentDeclineNotice);
// end send accept notice to client
}
exit();
} | [
"public function getQuoteRequest();",
"public function requestQuotation()\n {\n $aValidationResult = Validations::validateQuotationInputs($this->aParams);\n\n if ($aValidationResult['bResult'] === true) {\n Utils::sanitizeData($this->aParams);\n\n $iUserId = $this->getUserIdOfQuoteRequester($this->aParams['quoteFname'], $this->aParams['quoteLname']);\n $iQuoteSenderId = $this->oQuotationModel->checkIfSenderExists($this->aParams['quoteFname'], $this->aParams['quoteLname']);\n\n Utils::prepareData($this->aParams, 'quotation');\n\n if (empty($iUserId) === true && empty($iQuoteSenderId) === true) {\n $aSenderDetails = array(\n ':firstName' => $this->aParams[':firstName'],\n ':middleName' => $this->aParams[':middleName'],\n ':lastName' => $this->aParams[':lastName'],\n ':email' => $this->aParams[':email'],\n ':contactNum' => $this->aParams[':contactNum']\n );\n $iQuoteSenderId = $this->oQuotationModel->insertQuotationSender($aSenderDetails);\n }\n\n $this->aParams[':senderId'] = $iQuoteSenderId;\n $sDateNow = date('Y-m-d H:i:s');\n\n foreach ($this->aParams[':quoteCourses'] as $iKey => $mValue) {\n $aQuotationDetails = array(\n ':userId' => $iUserId,\n ':senderId' => $iQuoteSenderId,\n ':courseId' => $this->aParams[':quoteCourses'][$iKey],\n ':scheduleId' => $this->aParams[':quoteSchedules'][$iKey],\n ':numPax' => $this->aParams[':quoteNumPax'][$iKey],\n ':companyName' => $this->aParams[':companyName'],\n ':dateRequested' => $sDateNow,\n ':isCompanySponsored' => ($this->aParams[':quoteBillToCompany'] == 1) ? 1 : 0\n );\n $this->oQuotationModel->insertQuotationDetails($aQuotationDetails);\n }\n\n $aParams = array(\n 'studentId' => (empty($iUserId) === false) ? $iUserId : $iQuoteSenderId,\n 'courseId' => 0,\n 'scheduleId' => 0,\n 'type' => 8,\n 'hasAccount' => (empty($iUserId) === false) ? 1 : 0,\n 'receiver' => 'admin',\n 'date' => dateNow()\n );\n\n $this->oNotificationModel->insertNotification($aParams);\n\n $aResult = array(\n 'bResult' => true,\n 'sMsg' => 'Quotation requested!'\n );\n } else {\n $aResult = $aValidationResult;\n }\n\n echo json_encode($aResult);\n }",
"public function isQuoteRequestEnabled()\n {\n return $this->authorization->isAllowed('Magento_NegotiableQuote::manage');\n }",
"function add_delivery_to_quote() {\n \n if (class_exists('YITH_Request_Quote')) {\n\n if ( ! is_admin() ) {\n$product_id = 402;\n$raq = YITH_Request_Quote::get_instance();\n if ( ! $raq->is_empty() ) {\n$raq->add_item( array( 'product_id' => $product_id) );\n}\n}\n}\n}",
"function saveQuote() {\n $quoted_amount = $this->input->post('quoted_amount');\n $negative_credit = -1 * $quoted_amount;\n $reqid = $this->uri->segment(3);\n $clientid = $this->uri->segment(4);\n $quotation_status = \"1\";\n $quotedamountUpdate = array('quotation_status' => $quotation_status,\n 'amount' => $quoted_amount);\n $this->updateDispatchRegister($reqid, $quotedamountUpdate, $quotation_status, $clientid, $quoted_amount);\n }",
"public function validateSaveFullQuote();",
"function cust_quote_f( $entry, $form) {\n global $wpdb;\n $oid_filter = filter_input( INPUT_GET, \"oid\", FILTER_SANITIZE_STRING );\n $curtime_mysql = current_time('mysql'); //curent time in the mysql format in the server's time zone (EST)\n if ($entry['6'] == 'Accept A Bid') {\n $quote_selected = $entry['7']; //find the desired quote\n\n $wpdb->update( //update the selected quote with the accepted status\n 'quotes',\n array('quote_status' => 'Quote Accepted', 'quote_cust_response_date' => $curtime_mysql, 'quote_cust_name' => $entry['13'], 'quote_cust_title' => $entry['3']),\n array('qid' => \"$quote_selected\")\n );\n\n $wpdb->update( //update all other quotes with the not accepted status\n 'quotes',\n array('quote_status' => 'Quote Not Accepted', 'quote_cust_response_date' => $curtime_mysql, 'quote_cust_name' => $entry['13'], 'quote_cust_title' => $entry['3']),\n array('oid' => \"$oid_filter\", 'quote_status' => 'Under Consideration')\n );\n\n $quote_row = $wpdb->get_row(\"SELECT * FROM quotes WHERE qid = $quote_selected\", ARRAY_A);\n $order_row = $wpdb->get_row(\"SELECT * FROM orders WHERE oid = $oid_filter\", ARRAY_A);\n\n $expand_cost = $quote_row['quote_cost_ea'] * $order_row['qty'];\n\n $wpdb->update( //update the order with the order placed status\n 'orders',\n array(\n 'order_phase' => 'Order Placed',\n 'order_placed_date' => $curtime_mysql,\n 'cost_ea' => $quote_row['quote_cost_ea'],\n 'ship_cost' => $quote_row['quote_ship_cost'],\n 'cost_expanded' => $expand_cost,\n 'vendor_price' => $quote_row['quote_vendor_price'],\n 'fee' => $quote_row['quote_fee'],\n 'cost_total' => $quote_row['quote_total_cost'],\n 'accepted_qid' => $quote_selected,\n 'vid' => $quote_row['vid']),\n array('oid' => \"$oid_filter\")\n );\n } else { //if the customer cancels the order\n $wpdb->update( //update all quotes for the order with the cancelled status\n 'quotes',\n array('quote_status' => 'Order Cancelled By Customer'),\n array('oid' => \"$oid_filter\")\n );\n\n $wpdb->update( //update the order with the cancelled status\n 'orders',\n array('order_phase' => 'Order Cancelled By Customer', 'order_cancelled_date' => $curtime_mysql),\n array('oid' => \"$oid_filter\")\n );\n }\n send_quote_select_emails($oid_filter);\n $wpdb->insert('logs', array('user_type' => 'customer', 'log_type' => 'Quote Selected', 'log_entry' => \"Quote $quote_selected selected for order $oid_filter\")); //log the event\n}",
"public function getInvoiceQuote();",
"public function saveQuote();",
"public function getQuote();",
"public function performPayPalExpressCompleteApiCall(QuoteTransfer $quoteTransfer): QuoteTransfer;",
"public function quote(Mage_Shipping_Model_Rate_Request $request)\n {\n /**\n * @var Mage_Sales_Model_Quote $quote\n * @var Iparcel_All_Model_Api_Log $log\n */\n $quote = Mage::getModel('checkout/cart')->getQuote();\n $log = Mage::getModel('iparcel/log');\n\n // init log\n $log->setController('Quote');\n\n /**\n * @var array $addressInfo AddressInfo segment of API call\n * @var array $json Array to be sent to the API\n */\n $addressInfo = $this->_prepareAddress($quote, $request);\n $json = array();\n $json['AddressInfo'] = $addressInfo;\n $json['CurrencyCode'] = $request->getPackageCurrency()->getCurrencyCode();\n $json['DDP'] = true;\n\n $itemsList = array();\n foreach ($request->getAllItems() as $item) {\n // Skip products that belong to a configurable -- we send the configurable product\n if ($item->getParentItemId() !== null) {\n continue;\n }\n\n /**\n * @var Mage_Sales_Model_Quote_Item $item\n * @var Mage_Catalog_Model_Product $itemProduct\n */\n $itemProduct = Mage::getModel('catalog/product')->load($item->getProductId());\n if ($item[\"is_virtual\"] == false && $itemProduct->getTypeId() != 'downloadable') {\n $itemDetails = $this->_getItemDetails($item);\n $itemsList[] = $itemDetails;\n }\n }\n $json['ItemDetailsList'] = $itemsList;\n // Get discounts\n $totals = $quote->getTotals();\n $discount = 0;\n if (isset($totals['discount']) && $totals['discount']->getValue()) {\n $discount = abs($totals['discount']->getValue());\n }\n if(isset($totals['ugiftcert']) && $totals['ugiftcert']->getValue()) {\n $discount = $discount + abs($totals['ugiftcert']->getValue());\n }\n\n $json['OtherDiscount'] = $discount;\n $json['OtherDiscountCurrency'] = $quote->getQuoteCurrencyCode();\n $json['ParcelID'] = 0;\n $json['SessionID'] = '';\n $json['key'] = Mage::helper('iparcel')->getGuid();\n\n $log->setRequest(json_encode($json));\n $response = $this->_restJSON($json, $this->_quote);\n $log->setResponse($response);\n $log->save();\n return json_decode($response);\n }",
"function cancel_quotes($curr_oid) {\n global $wpdb;\n $related_quotes = $wpdb->get_results(\"SELECT * FROM quotes WHERE oid = '$curr_oid'\", ARRAY_A); //check the related quotes\n foreach($related_quotes as $openq) { //loop through all related quotes\n $curr_qid = $openq['qid'];\n $wpdb->update('quotes', array('quote_status' => \"Order Cancelled\"), array('qid' => \"$curr_qid\")); //update the quote status to show that the order was cancelled\n reimburse_bid_cost($curr_qid);\n }\n}",
"public function startPolicyForAcceptedQuote()\n {\n $this->view->disable();\n $policy = $this->model;\n\n $policy->policy_number = '--not-is';\n $policy->customers_id = Input::post('customers_id');\n\n $policy->issue_date = 0;\n $policy->start_date = strtotime(Input::post('startdate'));\n $policy->end_date = strtotime(Input::post('enddate'));\n $policy->datetime = time();\n\n $policy->insurers_id = Input::post('insurers_id');\n $policy->products_id = Input::post('products_id');\n $policy->customer_quotes_id = Input::post('customer_quotes_id');\n\n $statuslist = Elements::call('Quotes/QuotesController')->statuslist;\n\n $policy->status = $statuslist['policy_pending'];\n $policy->currency_code = Input::post('code');\n $policy->amount = Input::post('amount');\n\n //update quote status\n Elements::call('Quotes/QuotesController')->saveStatus($policy->customer_quotes_id, Input::post('offer'), 'policy_created');\n\n $policy->save();\n\n// dump($this->model->errors());exit;\n if ($policy->hasNoErrors()) {\n Redirect::withNotice('The policy has been saved')\n ->to(Url::base() . '/admin/policies/uploaddocs/' . $policy->last_altered_row);\n// ->to(Url::base().'/admin/policies/issuepolicy/'.$policy->last_altered_row);\n }\n }",
"function add_quote_f( $entry, $form) {\n global $wpdb;\n global $BID_COST_NON_3D_PRINT_EACH;\n global $BID_COST_3D_PRINT_EACH;\n $oid_filter = filter_input( INPUT_GET, \"oid\", FILTER_SANITIZE_STRING );\n $vid_to_add = $entry['1'];\n\n $order_type = $wpdb->get_var(\"SELECT order_type FROM orders WHERE oid = $oid_filter\");\n $bid_reimbursement = 0;\n if($order_type == '3D-Printed Part') $bid_reimbursement = $BID_COST_NON_3D_PRINT_EACH;\n else $bid_reimbursement = $BID_COST_3D_PRINT_EACH;\n\n $quote_due = $wpdb->get_var(\"SELECT quotes_due FROM orders WHERE oid = $oid_filter\");\n $quote_fee = $wpdb->get_var(\"SELECT fee FROM orders WHERE oid = $oid_filter\");\n\n $curtime_mysql = current_time('mysql'); //current time in the mysql format in the server's time zone (EST)\n\n $wpdb->query($wpdb->prepare( //add quote to DB\n \"INSERT INTO quotes (vid, oid, quote_initiated_date, quote_due, bid_reimburse, quote_fee)\n VALUES (%d,%s,%s,%s,%d,%s)\",\n $vid_to_add, $oid_filter, $curtime_mysql, $quote_due, $bid_reimbursement, $quote_fee));\n\n $wpdb->query($wpdb->prepare( //add one to number of quotes requested for the order\n \"UPDATE orders SET num_quotes_requested = num_quotes_requested + 1 WHERE oid = %d\",\n $oid_filter));\n\n $new_qid = $wpdb->insert_id; //get the qid\n\n if ($new_qid != FALSE) {\n $wpdb->insert('logs', array('user_type' => 'admin', 'log_type' => 'Quote Requested', 'log_entry' => \"New Quote Request $new_qid created\")); //log the event\n } else {\n $wpdb->insert('logs', array('user_type' => 'system', 'log_type' => 'Error', 'log_entry' => \"New Quote Request for order $oid_filter failed\")); //log the event\n }\n}",
"public function denyQuote(Quote $quote) {\n if ($quote->getStatus() > 1 ) {\n throw new Exception('Only quotes with status draft or pending could be rejected');\n }\n $quote->setStatus(2);\n $em = $this->getEntityManager();\n $em->persist($quote);\n $em->flush();\n }",
"public function getQuoteStateToAccepted();",
"protected function getQuote()\n {\n return $this->apiQuoteResponse;\n }",
"public static function notifySellerSubmitQuote()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resolves the table name for the given class name | protected function resolveTableName(string $className): string
{
$className = ltrim($className, '\\');
$classNameParts = explode('\\', $className);
// Skip vendor and product name for core classes
if (strpos($className, 'TYPO3\\CMS\\') === 0) {
$classPartsToSkip = 2;
} else {
$classPartsToSkip = 1;
}
$tableName = 'tx_' . strtolower(implode('_', array_slice($classNameParts, $classPartsToSkip)));
return $tableName;
} | [
"protected static function _get_table_name($class_name) {\n $specified_table_name = self::_get_static_property($class_name, '_table');\n $use_short_class_name =\n self::_get_static_property($class_name, '_table_use_short_name');\n\n if ($use_short_class_name) {\n $exploded_class_name = explode('\\\\', $class_name);\n $class_name = end($exploded_class_name);\n }\n\n if (is_null($specified_table_name)) {\n return self::$auto_prefix_tables . self::_class_name_to_table_name($class_name);\n }\n return self::$auto_prefix_tables . $specified_table_name;\n }",
"protected static function use_short_table_name($class_name)\n {\n }",
"protected static function _get_table_name($class_name)\r\n {\r\n if(!isset(self::$cache['tableName'][$class_name])) \r\n self::$cache['tableName'][$class_name] = (isset(static::$_table)) ? static::$_table : self::_class_name_to_table_name($class_name);\r\n \r\n return self::$cache['tableName'][$class_name];\r\n }",
"static function get_table_name()\r\n {\r\n return Utilities :: get_classname_from_namespace(self :: CLASS_NAME, true);\r\n }",
"protected function _tableFromClass()\n {\n list(, $class) = namespaceSplit(get_class($this));\n preg_match('/^(.*)Fixture$/', $class, $matches);\n $table = $class;\n\n if (isset($matches[1])) {\n $table = $matches[1];\n }\n\n return Inflector::tableize($table);\n }",
"private function getTableName()\n {\n $class = new ReflectionClass($this);\n return strtolower($class->getName());\n }",
"public function resolveTableName($table)\n {\n if (! Str::contains($table, '\\\\') || ! class_exists($table)) {\n return $table;\n }\n\n $model = new $table;\n\n return $model instanceof Model\n ? $model->getTable()\n : $table;\n }",
"public function resolveTableName($tableName): string;",
"protected function _findTableName(Zfext_Db_Table $table)\n {\n $className = get_class($table);\n if (isset(self::$_classToTableNameMap[$className])) {\n return self::$_classToTableNameMap[$className];\n }\n $classParts = explode('_', $className);\n $filter = new Zend_Filter_Word_CamelCaseToUnderscore();\n $potentialName = strtolower($filter->filter(array_pop($classParts)));\n if (substr($potentialName, 0, 3) == 'tx_') {\n // Definetely prefixed\n $tableName = $potentialName;\n } else {\n if (count($classParts) < 3 || $classParts[0] != 'Tx') {\n throw new Zfext_Db_Table_Exception('Can not determine table name on unprefixed table classes');\n }\n $prefixedName = strtolower($classParts[0].'_'.$classParts[1]).'_'.$potentialName;\n if (isset($GLOBALS['TCA'][$prefixedName])) {\n $tableName = $prefixedName;\n } elseif (isset($GLOBALS['TCA'][$potentialName])) {\n $tableName = $potentialName;\n }\n }\n if (!isset($tableName)) {\n throw new Zfext_Db_Table_Exception('Could not determine name of '.get_class($table));\n }\n self::$_classToTableNameMap[$className] = $tableName;\n return $tableName;\n }",
"static function tableize($class_name) {\n\t\treturn Inflector::underscore($class_name);\n\t}",
"private function initTableName() {\n\t\tif($this->table) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$reflection = new \\ReflectionClass($this);\n\t\t$shortName = Str::plural($reflection->getShortName());\t\t\n\t\t$this->table = Str::plural(Str::snake($shortName));\n\t}",
"protected function _getTableClass()\n {\n $sClassName = get_class($this);\n $aChunks = explode('_', $sClassName);\n $sTableClassName = array_pop($aChunks);\n if (empty($sTableClassName)) {\n throw new AM_Model_Db_Exception(sprintf('Model class \"%s\" has wrong name', $sClassName), 501);\n }\n $sTableClassName = self::TABLE_CLASS_PREFIX . '_' . $sTableClassName;\n\n return $sTableClassName;\n }",
"private function determineTableName()\n {\n $annotations = $this->inspector->getClassAnnotations();\n $name = self::parseTableName($this->entity);\n if ($annotations->hasAnnotation('@table')) {\n $name = $annotations->getAnnotation('@table')->getValue();\n }\n return $name;\n }",
"protected function _setupTableName() {\n\t\tif (! $this->_name) {\n\t\t\tif (preg_match ( '/(?P<namespace>.+\\\\\\)?(?P<class>[^\\\\\\]+$)/', get_class ( $this ), $matches )) {\n\t\t\t\t$this->_name = \\Core\\Camel::fromCamelCase ( $matches ['class'] );\n\t\t\t} else {\n\t\t\t\t$this->_name = \\Core\\Camel::fromCamelCase ( basename ( get_class ( $this ) ) );\n\t\t\t}\n\t\t} else if (strpos ( $this->_name, '.' )) {\n\t\t\tlist ( $_schema, $_name ) = explode ( '.', $this->_name );\n\t\t\tif (preg_match ( '/(?P<namespace>.+\\\\\\)?(?P<class>[^\\\\\\]+$)/', $_schema, $matches )) {\n\t\t\t\t$this->_schema = \\Core\\Camel::fromCamelCase ( $matches ['class'] );\n\t\t\t} else {\n\t\t\t\t$this->_schema = \\Core\\Camel::fromCamelCase ( basename ( $_schema ) );\n\t\t\t}\n\t\t\tif (preg_match ( '/(?P<namespace>.+\\\\\\)?(?P<class>[^\\\\\\]+$)/', $_name, $matches )) {\n\t\t\t\t$this->_name = \\Core\\Camel::fromCamelCase ( $matches ['class'] );\n\t\t\t} else {\n\t\t\t\t$this->_name = \\Core\\Camel::fromCamelCase ( basename ( $_schema ) );\n\t\t\t}\n\t\t}\n\t}",
"public static function getTable($class) {\r\n if (is_object($class)) return strtolower(get_class($class));\r\n return strtolower($class);\r\n }",
"static function classify($table_name)\n\t{\n\t\treturn self::camelize(self::singularize($table_name));\n\t}",
"abstract protected function getTableName();",
"static function tableize($class_name)\n\t{\n\t\treturn self::pluralize(self::underscore($class_name));\n\t}",
"function model_name_from_table_name($tableName)\n {\n return ucfirst(camel_case(str_singular($tableName)));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Performs an INSERT on the database, given a Warranty2 or Criteria object. | public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(Warranty2TableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from Warranty2 object
}
if ($criteria->containsKey(Warranty2TableMap::COL_WARMSEQ) && $criteria->keyContainsValue(Warranty2TableMap::COL_WARMSEQ) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.Warranty2TableMap::COL_WARMSEQ.')');
}
// Set the correct dbName
$query = Warranty2Query::create()->mergeWith($criteria);
// use transaction because $criteria could contain info
// for more than one table (I guess, conceivably)
return $con->transaction(function () use ($con, $query) {
return $query->doInsert($con);
});
} | [
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(BillingTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from Billing object\n }\n\n\n // Set the correct dbName\n $query = BillingQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(AliPaymentTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from AliPayment object\n }\n\n if ($criteria->containsKey(AliPaymentTableMap::COL_ID) && $criteria->keyContainsValue(AliPaymentTableMap::COL_ID) ) {\n throw new PropelException('Cannot insert a value for auto-increment primary key ('.AliPaymentTableMap::COL_ID.')');\n }\n\n\n // Set the correct dbName\n $query = AliPaymentQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(EnemyabilityTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from Enemyability object\n }\n\n\n // Set the correct dbName\n $query = EnemyabilityQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(PurchaseOrderDetailTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from PurchaseOrderDetail object\n }\n\n\n // Set the correct dbName\n $query = PurchaseOrderDetailQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(AliProductTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from AliProduct object\n }\n\n\n // Set the correct dbName\n $query = AliProductQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(AutoPaymentTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from AutoPayment object\n }\n\n if ($criteria->containsKey(AutoPaymentTableMap::COL_AUT_ID) && $criteria->keyContainsValue(AutoPaymentTableMap::COL_AUT_ID) ) {\n throw new PropelException('Cannot insert a value for auto-increment primary key ('.AutoPaymentTableMap::COL_AUT_ID.')');\n }\n\n\n // Set the correct dbName\n $query = AutoPaymentQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public function insert (ExpenseTypeVO $expenseTypeVO);",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(PurchaseOrderDetailReceivingTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from PurchaseOrderDetailReceiving object\n }\n\n\n // Set the correct dbName\n $query = PurchaseOrderDetailReceivingQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public function insert ($into_quotef, $values_quotef_etc);",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(SoDetailTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from SoDetail object\n }\n\n\n // Set the correct dbName\n $query = SoDetailQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(SalesOrderShipmentTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from SalesOrderShipment object\n }\n\n\n // Set the correct dbName\n $query = SalesOrderShipmentQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(HeureSupTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from HeureSup object\n }\n\n if ($criteria->containsKey(HeureSupTableMap::COL_HEURE_SUP_ID) && $criteria->keyContainsValue(HeureSupTableMap::COL_HEURE_SUP_ID) ) {\n throw new PropelException('Cannot insert a value for auto-increment primary key ('.HeureSupTableMap::COL_HEURE_SUP_ID.')');\n }\n\n\n // Set the correct dbName\n $query = HeureSupQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(PenggunaTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from Pengguna object\n }\n\n\n // Set the correct dbName\n $query = PenggunaQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(AbilityTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from Ability object\n }\n\n\n // Set the correct dbName\n $query = AbilityQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(PaypalTransactionTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from PaypalTransaction object\n }\n\n if ($criteria->containsKey(PaypalTransactionTableMap::COL_ID) && $criteria->keyContainsValue(PaypalTransactionTableMap::COL_ID) ) {\n throw new PropelException('Cannot insert a value for auto-increment primary key ('.PaypalTransactionTableMap::COL_ID.')');\n }\n\n\n // Set the correct dbName\n $query = PaypalTransactionQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(CstkItemTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from CstkItem object\n }\n\n\n // Set the correct dbName\n $query = CstkItemQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(ConfigSalesOrderTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from ConfigSalesOrder object\n }\n\n\n // Set the correct dbName\n $query = ConfigSalesOrderQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(InvTransferOrderTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from InvTransferOrder object\n }\n\n\n // Set the correct dbName\n $query = InvTransferOrderQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }",
"public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(QuoteTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from Quote object\n }\n\n if ($criteria->containsKey(QuoteTableMap::COL_ENTITY_ID) && $criteria->keyContainsValue(QuoteTableMap::COL_ENTITY_ID) ) {\n throw new PropelException('Cannot insert a value for auto-increment primary key ('.QuoteTableMap::COL_ENTITY_ID.')');\n }\n\n\n // Set the correct dbName\n $query = QuoteQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FILE: IMAGELIB.PHP PURPOSE: DIV. IMAGING TOOLS DATE: 07.06.2011 AUTHOR: ANDREAS MEHRRATH INT0001 type... 0 normal ... 1 css ... 2 array | function img_dim($img,$type=0)
{
$arr_img = GetImageSize($img);
if ($type==0)
return $arr_img[3]; // normal fuer bild
if ($type==1)
return " width: ".$arr_img[0]."px; height: ".$arr_img[1]."px; "; // fuer style (CSS)
if ($type==2)
return array($arr_img[0],$arr_img[1]); // als 2 numerische
} | [
"private function get_type_img()\n {\n $this->multi_byte_string_to_array();\n foreach($this->strings as $char)\n {\n $this->init_img();\n $this->create_img($char);\n }\n }",
"function ju_catalog_image_h():ImageH {return ju_o(ImageH::class);}",
"function Content_Div_Start() \n{\n\tglobal $Template;\n\techo '<div style=\"width: 659px; height: 29px; background: url(\\''.$Template['path'].'/images/content-parting.jpg\\') no-repeat;\"><div style=\"padding: 2px 0px 0px 23px;\"><font style=\"font-family: \\'Times New Roman\\', Times, serif; color: #640909;\"><h2>'.$_GET['module'].'</h2></font></div></div>';\n\techo '<div style=\"background: url(\\''.$Template['path'].'/images/light.jpg\\') repeat; border-width: 1px; border-color: #000000; border-bottom-style: solid; margin: 0px 0px 5px 0px\">';\n\techo '<div class=\"contentdiv\">';\n}",
"function afsp_imgix( $class, $subfield, $prefix, $sizes, $w1, $h1, $w2 = 0, $h2 = 0 ) {\n\tif ( isset( $_SERVER['REQUEST_URI'] ) ) : // Input var okay.\n\t\t$uri = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ); // Input var okay.\n\tendif;\n\t$image = '';\n\t$mobile_image = '';\n\t$imgix1 = '';\n\t$imgix2 = '';\n\tif ( true === $subfield ) :\n\t\tif ( '/lifesaver-news/' === $uri && true === get_sub_field( $prefix . '_separate_image' ) ) :\n\t\t\t$image = get_sub_field( $prefix . '_mobile_image' );\n\t\telse :\n\t\t\t$image = get_sub_field( $prefix . '_image' );\n\t\tendif;\n\t\t$mobile_image = get_sub_field( $prefix . '_mobile_image' );\n\t\t$crop = get_sub_field( $prefix . '_crop' );\n\t\t$fit = get_sub_field( $prefix . '_fit' );\n\t\t$face_index = get_sub_field( $prefix . '_face_index' );\n\t\t$face_pad = get_sub_field( $prefix . '_face_pad' );\n\telse :\n\t\tif ( '/lifesaver-news/' === $uri && true === get_field( $prefix . '_separate_image' ) ) :\n\t\t\t$image = get_field( $prefix . '_mobile_image' );\n\t\telse :\n\t\t\t$image = get_field( $prefix . '_image' );\n\t\tendif;\n\t\t$mobile_image = get_field( $prefix . '_mobile_image' );\n\t\t$crop = get_field( $prefix . '_crop' );\n\t\t$fit = get_field( $prefix . '_fit' );\n\t\t$face_index = get_field( $prefix . '_face_index' );\n\t\t$face_pad = get_field( $prefix . '_face_pad' );\n\tendif;\n\t$image_array = wp_get_attachment_image_src( $image['id'] );\n\t$src = $image_array[0];\n\t// if the page is loaded over ssl, we need to add the secure protocol to the source url.\n\t$src = str_replace( 'http://', 'https://', $src );\n\t$pos = strpos( $src, '?' );\n\tif ( false !== $pos ) :\n\t\t$src = strstr( $src, '?', true );\n\tendif;\n\tif ( $mobile_image ) :\n\t\t$mobile_image_array = wp_get_attachment_image_src( $mobile_image['id'] );\n\t\t$mobile_src = $mobile_image_array[0];\n\t\t// if the page is loaded over ssl, we need to add the secure protocol to the source url.\n\t\t$mobile_src = str_replace( 'http://', 'https://', $mobile_src );\n\t\t$mobile_pos = strpos( $mobile_src, '?' );\n\t\tif ( false !== $mobile_pos ) :\n\t\t\t$mobile_src = strstr( $mobile_src, '?', true );\n\t\tendif;\n\tendif;\n\t$imgix1 = $src . '?';\n\tif ( $crop ) :\n\t\t$imgix1 .= '&crop=' . $crop;\n\tendif;\n\tif ( $fit ) :\n\t\t$imgix1 .= '&fit=' . $fit;\n\tendif;\n\tif ( $face_index ) :\n\t\t$imgix1 .= '&faceindex=' . $face_index;\n\tendif;\n\tif ( $face_pad ) :\n\t\t$imgix1 .= '&facepad=' . $face_pad;\n\tendif;\n\t$imgix11 = $imgix1 . '&w=' . floor( $w1 ) . '&h=' . floor( $h1 );\n\t$imgix12 = $imgix1 . '&w=' . floor( $w1 / 2 ) . '&h=' . floor( $h1 / 2 );\n\t$imgix13 = $imgix1 . '&w=' . floor( $w1 / 3 ) . '&h=' . floor( $h1 / 3 );\n\t$imgix14 = $imgix1 . '&w=' . floor( $w1 / 4 ) . '&h=' . floor( $h1 / 4 );\n\tif ( 0 !== $w2 ) :\n\t\tif ( $mobile_image ) :\n\t\t\t$imgix2 = $mobile_src;\n\t\telse :\n\t\t\t$imgix2 = $src;\n\t\tendif;\n\t\t$imgix2 = $imgix2 . '?';\n\t\tif ( $crop ) :\n\t\t\t$imgix2 .= '&crop=' . $crop;\n\t\tendif;\n\t\tif ( $fit ) :\n\t\t\t$imgix2 .= '&fit=' . $fit;\n\t\tendif;\n\t\tif ( $face_index ) :\n\t\t\t$imgix2 .= '&faceindex=' . $face_index;\n\t\tendif;\n\t\tif ( $face_pad ) :\n\t\t\t$imgix2 .= '&facepad=' . $face_pad;\n\t\tendif;\n\t\t$imgix21 = $imgix2 . '&w=' . floor( $w2 ) . '&h=' . floor( $h2 );\n\t\t$imgix22 = $imgix2 . '&w=' . floor( $w2 / 2 ) . '&h=' . floor( $h2 / 2 );\n\t\t$imgix23 = $imgix2 . '&w=' . floor( $w2 / 3 ) . '&h=' . floor( $h2 / 3 );\n\t\t$imgix24 = $imgix2 . '&w=' . floor( $w2 / 4 ) . '&h=' . floor( $h2 / 4 );\n\tendif;\n\n\tif ( 0 !== $w2 ) :\n\t\t$srcset_1 = $imgix11 . ' ' . floor( $w1 ) . 'w, ' . $imgix12 . ' ' . floor( $w1 / 2 ) . 'w, ' . $imgix13 . ' ' . floor( $w1 / 3 ) . 'w, ' . $imgix14 . ' ' . floor( $w1 / 4 ) . 'w';\n\t\t$srcset_2 = $imgix21 . ' ' . floor( $w2 ) . 'w, ' . $imgix22 . ' ' . floor( $w2 / 2 ) . 'w, ' . $imgix23 . ' ' . floor( $w2 / 3 ) . 'w, ' . $imgix24 . ' ' . floor( $w2 / 4 ) . 'w';\n\t\techo '<picture class=\"' . esc_attr( $class ) . '\">';\n\t\techo '<source class=\"imgix-fluid\" media=\"(min-width: 768px)\" srcset=\"' . esc_attr( $srcset_1 ) . '\">';\n\t\techo '<source class=\"imgix-fluid\" srcset=\"' . esc_attr( $srcset_2 ) . '\">';\n\t\techo '<img src=\"' . esc_attr( $imgix11 ) . '\" class=\"imgix-fluid\" alt=\"' . esc_attr( $image['alt'] ) . '\" sizes=\"' . esc_attr( $sizes ) . '\" />';\n\t\techo '</picture>';\n\telse :\n\t\t$srcset_1 = $imgix11 . ' ' . floor( $w1 ) . 'w, ' . $imgix12 . ' ' . floor( $w1 / 2 ) . 'w, ' . $imgix13 . ' ' . floor( $w1 / 3 ) . 'w, ' . $imgix14 . ' ' . floor( $w1 / 4 ) . 'w';\n\t\techo '<img src=\"' . esc_attr( $imgix11 ) . '\" srcset=\"' . esc_attr( $srcset_1 ) . '\" class=\"imgix-fluid ' . esc_attr( $class ) . '\" alt=\"' . esc_attr( $image['alt'] ) . '\" sizes=\"' . esc_attr( $sizes ) . '\" />';\n\tendif;\n}",
"public function dataImage ();",
"function get_header_image_tag($attr = array())\n {\n }",
"public static function images_to_html($str){\n\t\t\n\t\tpreg_match_all( \"/\\[(draw|img)=?(\\w+)?\\](.*?)\\[\\/(?:draw|img)\\]/s\", $str, $matches );\n\t\n\t\t$images = $matches[0];\n\t\t\n\t\t$num_images = count($images);\n\t\n\t\tfor($x=0;$x<$num_images;$x++){\n\t\t\t$center = ($matches[2][$x] =='center') ? 1: 0;\n\t\t\t\n\t\t\t$className = ($matches[2][$x] =='left' || $matches[2][$x] =='right') ? 'tb_img_'.$matches[2][$x] : 'tb_img';\n\t\t\t\n\t\t\t$alt = 'image';\n\t\t\t$caption = '';\n\t\t\t//get alt data if it exists in path\n\t\t\t$data = explode(\"|\", $matches[3][$x]);\n\t\t\t\n\t\t\tif (count($data) > 1){\n\t\t\t\t$alt = $data[1];\n\t\t\t}\n\t\t\t\n\t\t\tif (count($data) > 2){\n\t\t\t\t$caption = $data[2];\n\t\t\t}\n\t\t\t\n\t\t\t$path = $data[0];\n\t\t\t\n\t\t\tif(self::$allow_external_images == 1 && preg_match(\"~^http~\", $path)){\n\t\t\t\t$src = $path;\n\t\t\t\t$orig_src = $path;\n\t\t\t\t$thumb_src = $path;\n\t\t\t} else {\n\t\t\t\t$src = self::$content_path.'/'.$path;\n\t\t\t\t\n\t\t\t\t$orig_src = self::$content_path.'/'.dirname($path).\"/\".basename($path);\n\t\t\t\t\n\t\t\t\t$thumb_src = self::$content_path.'/'.dirname($path).\"/thumbs/\".basename($path);\n\t\t\t\n\t\t\t\n\t\t\t}\n\n\t\t\tif(self::$mobile == 1){\n\t\t\t\t$src = $thumb_src;\n\t\t\t}\n\t\t\t\n\t\t\t$image ='';\n\t\t\t$path = ROOT.'/public/'.$src;\n\t\t\tif(is_file($path) || self::$allow_external_images == 1){\n\t\t\t\n\t\t\t\t$file_info = @getimagesize($path);\t\t\n\t\t\t\t$type = $file_info['2']; //1 = GIF, 2 = JPG, 3 = PNG\n\t\t\t\t$width = $file_info[0];\n\t\t\t\t$height = $file_info[1];\n\t\t\t\t\n\t\t\t\tif(!empty($caption)){\n\t\t\t\t\t$image = '<div style=\"width:'.$width.'px;height'.$height.'px;\"class=\"'.$className.'\"><img title=\"'.$alt.'\" src=\"'.$src.'\" '.$file_info[3].' alt=\"'.$alt.'\" /><div class=\"tb_caption\">'.$caption.'</div></div>';\n\t\t\t\t} else {\n\t\t\t\t\t$image = '<img class=\"'.$className.'\" title=\"'.$alt.'\" src=\"'.$src.'\" '.$file_info[3].' alt=\"'.$alt.'\" />';\n\t\t\t\t\tif(self::$mobile == 1){\n\t\t\t\t\t\t$image= '<a href=\"'.$orig_src.'\">'.$image.'</a>';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($center ==1){\n\t\t\t\t\t\n\t\t\t\t\t$image = '<div class=\"tb_center\">'.$image.'</div>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($image)){\n\t\t\t\t\n\t\t\t\t$str = str_replace($images[$x], $image, $str);\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\treturn $str;\n\t}",
"function eZImageFile()\r\n {\r\n\r\n }",
"protected function get_image_parser()\n {\n }",
"private function handleAsImage()\n {\n// RETURN tableField isn't content of handleAs['image']\n// 3.9.26, 120506, dwildt+\n if ( $this->arrHandleAs[ 'image' ] != $this->tableField )\n {\n return;\n }\n// 3.9.26, 120506, dwildt+\n// 3.9.26, 120506, dwildt-\n// $pos = strpos( $this->arrHandleAs['image'] , $this->tableField );\n// if( $pos === false )\n// {\n// return;\n// }\n// 3.9.26, 120506, dwildt-\n// RETURN tableField isn't content of handleAs['image']\n// DRS - Development Reporting System\n if ( $this->pObj->boolFirstRow && $this->pObj->b_drs_templating )\n {\n $prompt = $this->tableField . ' is content of handleAs[image]';\n t3lib_div::devLog( '[INFO/TEMPLATING] ' . $prompt, $this->pObj->extKey, 0 );\n $this->bool_drs_handleCase = true;\n }\n// DRS - Development Reporting System\n// Dyeing swords?\n $arr_TCAitems = $this->conf_view[ 'autoconfig.' ][ 'autoDiscover.' ][ 'items.' ];\n $this->bool_dontColorSwords = $arr_TCAitems[ 'image.' ][ 'dontColorSwords' ];\n// Dyeing swords?\n// Count images per row\n if ( $this->pObj->boolFirstRow )\n {\n $this->imagesPerRow = 1;\n }\n if ( !$this->pObj->boolFirstRow )\n {\n $this->imagesPerRow++;\n }\n// Count images per row\n// DRS - Development Reporting System\n if ( $this->imagesPerRow > 1 )\n {\n if ( $this->pObj->boolFirstRow && $this->pObj->b_drs_templating )\n {\n $prompt = 'DANGEROUS: Current row has ' . $this->imagesPerRow . ' images. ' .\n 'Images, captions, alt texts and title texts can\\'t allocate exactly. ';\n t3lib_div::devLog( '[WARN/TEMPLATING] ' . $prompt, $this->pObj->extKey, 2 );\n $prompt = 'URGENT: Configure the TypoScript of images manually!';\n t3lib_div::devLog( '[HELP/TEMPLATING] ' . $prompt, $this->pObj->extKey, 1 );\n }\n }\n// DRS - Development Reporting System\n//$this->pObj->dev_var_dump( $this->arrHandleAs, $this->elements );\n// Image caption\n// 3.9.26, 120506, dwildt+\n $csv_imageCaption = $this->elements[ $this->arrHandleAs[ 'imageCaption' ] ];\n// 3.9.26, 120506, dwildt-\n// $csv_imageCaption = $this->arrHandleAs['imageCaption'];\n// $arr_imageCaption = $this->pObj->objZz->getCSVasArray( $csv_imageCaption );\n $arr_imageCaption = explode( \"\\l\\n\", $csv_imageCaption );\n $imageCaption = $arr_imageCaption[ ( $this->imagesPerRow - 1 ) ];\n\n// Image alt text\n// 3.9.26, 120506, dwildt+\n $csv_imageAltText = $this->elements[ $this->arrHandleAs[ 'imageAltText' ] ];\n// 3.9.26, 120506, dwildt-\n// $csv_imageAltText = $this->arrHandleAs['imageAltText'];\n $arr_imageAltText = $this->pObj->objZz->getCSVasArray( $csv_imageAltText );\n $arr_imageAltText = explode( \"\\l\\n\", $csv_imageAltText );\n $imageAltText = $arr_imageAltText[ ( $this->imagesPerRow - 1 ) ];\n\n// Image title text\n// 3.9.26, 120506, dwildt+\n $csv_imageTitleText = $this->elements[ $this->arrHandleAs[ 'imageTitleText' ] ];\n// 3.9.26, 120506, dwildt-\n// $csv_imageTitleText = $this->arrHandleAs['imageTitleText'];\n// $arr_imageTitleText = $this->pObj->objZz->getCSVasArray( $csv_imageTitleText );\n $arr_imageTitleText = explode( \"\\l\\n\", $csv_imageTitleText );\n $imageTitleText = $arr_imageTitleText[ ( $this->imagesPerRow - 1 ) ];\n\n// Wrap image\n $tsImage[ 'image' ] = $this->elements[ $this->tableField ];\n $tsImage[ 'imagecaption' ] = $imageCaption;\n $tsImage[ 'imagealttext' ] = $imageAltText;\n $tsImage[ 'imagetitletext' ] = $imageTitleText;\n//$pos = strpos( '91.23.174.97' , t3lib_div :: getIndpEnv('REMOTE_ADDR'));\n//if (!($pos === false))\n//{\n// var_dump( __METHOD__ . ' (line: ' . __LINE__ . ')', $this->elements, $this->tableField, $tsImage );\n//\n//}\n//$this->pObj->dev_var_dump( $tsImage );\n $this->value = $this->pObj->objWrapper4x->wrapImage( $tsImage );\n\n return;\n }",
"function banner($value, $width, $height, $classe){\n $img = new Imagem();\n $classe_desk = $classe;\n if(isset($value->foto1) AND $value->foto1){\n if(preg_match('(class=\")', $classe)){\n $classe_desk = str_replace('class=\"', 'class=\"desk ', $classe);\n }\n }\n $img->tags = $classe_desk;\n $return = $img->img($value, $width, $height);\n\n $classe_mob = $classe;\n if(isset($value->foto1) AND $value->foto1){\n if(preg_match('(class=\")', $classe)){\n $classe_mob = str_replace('class=\"', 'class=\"mob ', $classe);\n }\n $img->tags = $classe_mob;\n $img->foto = 'foto1';\n $return .= $img->img($value, $width, $height);\n }\n return $return;\n}",
"function _shivanode_get_generic_image_info($type = 'ALL', $isSubtype = FALSE) {\r\n \r\n\t$imgs = _shivanode_get_thumb_image_list(); // function in shivanode.types.inc\r\n if ($type == 'ALL') {\r\n return $imgs;\r\n } else if ($type == 'LIST') {\r\n \t$out = array();\r\n\t\tforeach($imgs['types'] as $tind => $img) { $out[] = $img; }\r\n\t\tforeach($imgs['subtypes'] as $stind => $img) { $out[] = $img; }\r\n\t\treturn $out;\r\n } else {\r\n \t$ind = ($isSubtype) ? 'subtypes' : 'types';\r\n\t if (isset($imgs[$ind][$type])) {\r\n\t return variable_get($imgs[$ind][$type], FALSE);\r\n\t } else {\r\n\t return FALSE;\r\n\t }\r\n\t}\r\n}",
"function ShapedImage($args)\n{\n\t$image = $args['image'];\n\t$float = $args['float'];\n\t\n\t(isset($args['top'])) \t\t? $top = $args['top'] \t\t\t\t: $top = 16;\n\t(isset($args['bottom'])) \t? $bottom = $args['bottom'] \t\t: $bottom = 6;\n\t(isset($args['hspace'])) \t? $hspace = $args['hspace'] \t\t: $hspace = 40;\n\t(isset($args['marginTop'])) ? $marginTop = $args['marginTop'] \t: $marginTop = 0;\n\t\n\t\n\t// TODO: Configure the path names in the following two lines.\n\t$cacheFileName = 'cache/' . md5($image . ':' . $float . ':' . $top . ':' . $bottom . ':' . $hspace . ':' . $marginTop) . '.html';\n\n\tlist($width, $height) = getimagesize($image);\n\t\n\t(isset($args['w'])) ? $width = $args['w'] : \"\";\n\t(isset($args['h'])) ? $height = $args['h'] : \"\";\n\t\n\t// Print out the image\n\t$return = '<img src=\"' . $image . '\" style=\"width: ' . $width . 'px; height: ' . $height . 'px; float: ' . $float . '; margin: ' . ($top + $marginTop) . 'px 0 -' . ($marginTop + $top + $height) . 'px 0;\" alt=\"\" />' . \"\\n\";\n\n\t$skipCache = false; // DEBUG\n\n\tif ($skipCache ||\n\t\t!file_exists($cacheFileName) ||\n\t\tfilemtime($image) > filemtime($cacheFileName))\n\t{\n\t\t// Cache file is outdated, recreate the data\n\t\t$ystep = 5;\n\t\t$yextra = $hspace / 2;\n\n\t\t$leftSide = $float == 'left';\n\t\t#$t0 = microtime(true);\n\t\t$im = imagecreatefrompng($image);\n\t\t$divs = array();\n\t\t$prevDiv = null;\n\t\t// For each block ow rows (group of $ystep rows)\n\t\tfor ($basey = 0; $basey < $height; $basey += $ystep)\n\t\t{\n\t\t\t// Find the farest X position of transparency in all rows of this group\n\t\t\t$rowx = $leftSide ? 0 : $width - 1;\n\t\t\tfor ($y = max(0, $basey - $yextra); $y < $height && $y < $basey + $ystep - 1 + $yextra; $y++)\n\t\t\t{\n\t\t\t\tif ($leftSide)\n\t\t\t\t{\n\t\t\t\t\t// For each row in the group\n\t\t\t\t\tfor ($x = $width - 1; $x >= $rowx; $x--)\n\t\t\t\t\t{\n\t\t\t\t\t\t$color = imagecolorat($im, $x, $y);\n\t\t\t\t\t\t#$alpha = ($color & 0x7F000000) >> 24; // Only for 32-bit colour images\n\t\t\t\t\t\t$colors = imagecolorsforindex($im, $color);\n\t\t\t\t\t\t$alpha = $colors['alpha'];\n\t\t\t\t\t\tif ($alpha < 127) break; // 127 is the maximum transparency (PHP doesn't use opacity!)\n\t\t\t\t\t}\n\t\t\t\t\t$rowx = max($x, $rowx);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// For each row in the group\n\t\t\t\t\tfor ($x = 0; $x <= $rowx; $x++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$color = imagecolorat($im, $x, $y);\n\t\t\t\t\t\t#$alpha = ($color & 0x7F000000) >> 24; // Only for 32-bit colour images\n\t\t\t\t\t\t$colors = imagecolorsforindex($im, $color);\n\t\t\t\t\t\t$alpha = $colors['alpha'];\n\t\t\t\t\t\tif ($alpha < 127) break; // 127 is the maximum transparency (PHP doesn't use opacity!)\n\t\t\t\t\t}\n\t\t\t\t\t$rowx = min($x, $rowx);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set the image shape div's size\n\t\t\t$w = $leftSide ? $rowx : $width - 1 - $rowx;\n\t\t\tif ($w > 0)\n\t\t\t\t$w += $hspace;\n\t\t\t$h = $ystep;\n\n\t\t\t// Compare the current div's size with the previous'\n\t\t\tif (isset($prevDiv) && abs($prevDiv[1] - $w) < 5)\n\t\t\t{\n\t\t\t\t// (Almost) same width, combine both divs in height to save HTML code\n\t\t\t\t$lastIndex = count($divs) - 1;\n\t\t\t\t$divs[$lastIndex][0] += $h;\n\t\t\t\t$divs[$lastIndex][1] = max($divs[$lastIndex][1], $w);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Different width, add new div\n\t\t\t\t$prevDiv = array($h, $w);\n\t\t\t\t$divs[] = $prevDiv;\n\t\t\t}\n\t\t}\n\t\t#echo ' [' . round((microtime(true) - $t0) * 1000) . ' ms] ';\n\n\t\t// Regard the top and bottom margin for the first and last block\n\t\t$divs[0][0] += $top;\n\t\t$divs[count($divs) - 1][0] += $bottom;\n\n\t\t// Print out all divs\n\t\t$cache = '';\n\t\tforeach ($divs as $div)\n\t\t{\n\t\t\t// Insert top margin before the first spacer element\n\t\t\tif (!strlen($cache) && $marginTop)\n\t\t\t{\n\t\t\t\t$cache .= '<div style=\"float: ' . $float . '; clear: ' . $float . '; width: 0px; height: ' . $marginTop . 'px;\"></div>' . \"\\n\";\n\t\t\t}\n\n\t\t\tlist($h, $w) = $div;\n\t\t\t$cache .= '<div style=\"float: ' . $float . '; clear: ' . $float . '; width: ' . $w . 'px; height: ' . $h . 'px;\" class=\"imageshape\"></div>' . \"\\n\";\n\t\t}\n\n\t\t// Create cache directory and file\n\t\tif (!is_dir(dirname($cacheFileName)))\n\t\t\tmkdir(dirname($cacheFileName), 0777, true);\n\t\tfile_put_contents($cacheFileName, $cache);\n\n\t\t// Print output\n\t\t$return .= $cache;\n\t}\n\telse\n\t{\n\t\t// Print cached file\n\t\treadfile($cacheFileName);\n\t}\n\t\n\treturn $return;\n}",
"private function imageInfo()\n\t{\n\t\t// imagem de origem\n\t\t$pathinfo = pathinfo($this->path);\n\t\t$this->extension = strtolower($pathinfo['extension']);\n\t\t$this->file \t = $pathinfo['basename'];\n\t\t$this->dir \t\t = $pathinfo['dirname'];\n\t\t$this->size \t = filesize($this->path);\n\t\t\n\t}",
"public function enhanceImage () {}",
"public function getImageRedPrimary () {}",
"public function getImageColorspace () {}",
"function MakeImage($iw=0,$ih=0)\n {\n $n=count($this->text);\n $tex=implode(\"\\n\",$this->text);\n $bbox=imagettfbbox ($this->size, 0, $this->font, $tex);\n $tww=$bbox[2]-$bbox[0]+2;\n $thh=$bbox[1]-$bbox[7]+1;\n $th=-$bbox[7]-1;\n $sp=($n>1)?$th+(($thh-($n*$th))/($n)):0;\n if(!$this->image)$this->image=imagecreate(($iw==0)?$tww:$iw,($ih==0)?$thh:$ih);\n $bgnd = imagecolorallocate($this->image,$this->bgr,$this->bgg,$this->bgb);\n $tclr = imagecolorallocate($this->image,$this->txtr,$this->txtg,$this->txtb);\n $bclr = imagecolorallocate($this->image,$this->bdr,$this->bdg,$this->bdb);\n $width=imagesx($this->image);\n $height=imagesy($this->image);\n $ynew=$this->Vert($height,$thh,$th)+($n-1)+$this->offy+1;\n foreach($this->text as $tx)\n {\n $bbox=imagettfbbox ($this->size, 0, $this->font, $tx);\n $tw=$bbox[2]-$bbox[0];\n $xnew=$this->Horiz($width,$tww,$tw)+$this->offx;\n imagettftext($this->image, $this->size, 0, $xnew, $ynew, $tclr, $this->font, $tx);\n $ynew=$ynew+$sp;\n }\n if($this->border)imagerectangle($this->image, 0, 0, $width-1, $height-1, $bclr );\n}",
"function findRef_images($content, $spParams) {\n\t// ---- echo 'findRef_images<br />';\n\t//\tprint_r($content); echo '<br />';\n\t//\tprint_r($spParams); echo '<br />';\n\n\t\t\t// Start HTML parser and split content by image tag:\n\t\t$htmlParser = t3lib_div::makeInstance('t3lib_parsehtml');\n\t\t$splitContent = $htmlParser->splitTags('img',$content);\n\t\t$elements = array();\n\n\t\t\t// Traverse splitted parts:\n\t\tforeach ($splitContent as $k => $v) {\n\t\t\tif ($k % 2) {\n\n\t\t\t\t\t// Get file reference:\n\t\t\t\t$attribs = $htmlParser->get_tag_attributes($v);\n\t\t\t\t$srcRef = t3lib_div::htmlspecialchars_decode($attribs[0]['src']);\n\t\t\t\t$pI = pathinfo($srcRef);\n\n\t\t\t\t\t// If it looks like a local image, continue. Otherwise ignore it.\n\t\t\t\t$absPath = t3lib_div::getFileAbsFileName(PATH_site . $srcRef);\n\t\t\t\tif (!$pI['scheme'] && !$pI['query'] && $absPath && $srcRef !== 'clear.gif') {\n\n\t\t\t\t\t\t// Initialize the element entry with info text here:\n\t\t\t\t\t$tokenID = $this->makeTokenID($k);\n\t\t\t\t\t$elements[$k] = array();\n\t\t\t\t\t$elements[$k]['matchString'] = $v;\n\n\t\t\t\t\t/* If the image seems to be from fileadmin/ folder or an RTE image,\n\t\t\t\t\t * then proceed to set up substitution token:\n\t\t\t\t\t */\n\t\t\t\t\tif (t3lib_div::isFirstPartOfStr($srcRef, $this->fileAdminDir . '/') ||\n\t\t\t\t\t (t3lib_div::isFirstPartOfStr($srcRef, 'uploads/') && ereg('^RTEmagicC_', basename($srcRef)))) {\n\n\t\t\t\t\t\t\t// Token and substitute value:\n\t\t\t\t\t\tif (strstr($splitContent[$k], $attribs[0]['src'])) {\n\t\t\t\t\t\t\t/* Make sure the value we work on is found and will get substituted in the content\n\t\t\t\t\t\t\t * (Very important that the src-value is not DeHSC'ed)\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t$splitContent[$k] = str_replace($attribs[0]['src'], '{softref:' . $tokenID . '}', $splitContent[$k]);\n\t\t\t\t\t\t\t/* Substitute value with token (this is not be an exact method if the value is in\n\t\t\t\t\t\t\t * there twice, but we assume it will not)\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t$elements[$k]['subst'] = array(\n\t\t\t\t\t\t\t\t'type' => 'file',\n\t\t\t\t\t\t\t\t'relFileName' => $srcRef,\n\t\t\t\t\t\t\t\t'tokenID' => $tokenID,\n\t\t\t\t\t\t\t\t'tokenValue' => $attribs[0]['src'],\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif (!@is_file($absPath)) {\n\t\t\t\t\t\t\t\t\t// Finally, notice if the file does not exist.\n\t\t\t\t\t\t\t\t$elements[$k]['error'] = 'File does not exist!';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$elements[$k]['error'] = 'Could not substitute image source with token!';\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\t// Return result:\n\t\tif (count($elements)) {\n\n\t\t\t$resultArray = array(\n\t\t\t\t'content' => implode('', $splitContent),\n\t\t\t\t'elements' => $elements\n\t\t\t);\n\n\t\t\treturn $resultArray;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test match() with greedy routes, named parameters and passed args. | public function testMatchWithNamedParametersAndPassedArgs() {
Router::connectNamed(true);
$route = new CakeRoute('/:controller/:action/*', array('plugin' => null));
$result = $route->match(array('controller' => 'posts', 'action' => 'index', 'plugin' => null, 'page' => 1));
$this->assertEquals('/posts/index/page:1', $result);
$result = $route->match(array('controller' => 'posts', 'action' => 'view', 'plugin' => null, 5));
$this->assertEquals('/posts/view/5', $result);
$result = $route->match(array('controller' => 'posts', 'action' => 'view', 'plugin' => null, 0));
$this->assertEquals('/posts/view/0', $result);
$result = $route->match(array('controller' => 'posts', 'action' => 'view', 'plugin' => null, '0'));
$this->assertEquals('/posts/view/0', $result);
$result = $route->match(array('controller' => 'posts', 'action' => 'view', 'plugin' => null, 5, 'page' => 1, 'limit' => 20, 'order' => 'title'));
$this->assertEquals('/posts/view/5/page:1/limit:20/order:title', $result);
$result = $route->match(array('controller' => 'posts', 'action' => 'view', 'plugin' => null, 'word space', 'order' => 'Θ'));
$this->assertEquals('/posts/view/word%20space/order:%CE%98', $result);
$route = new CakeRoute('/test2/*', array('controller' => 'pages', 'action' => 'display', 2));
$result = $route->match(array('controller' => 'pages', 'action' => 'display', 1));
$this->assertFalse($result);
$result = $route->match(array('controller' => 'pages', 'action' => 'display', 2, 'something'));
$this->assertEquals('/test2/something', $result);
$result = $route->match(array('controller' => 'pages', 'action' => 'display', 5, 'something'));
$this->assertFalse($result);
} | [
"public function testRouteMatchesAndMultipleParamsExtracted() {\n\t\t$resource = 'hello/Josh/and/John';\n\t\t$route = new Route('/hello/:first/and/:second', function () {});\n\t\t$result = $route->matches($resource);\n\t\t$this->assertTrue($result);\n\t\t$this->assertEquals($route->params(), array('first' => 'Josh', 'second' => 'John'));\n\t}",
"public function testRouteMatchesAndMultipleParamsExtracted()\n {\n $resource = '/hello/Josh/and/John';\n $route = new \\Slim\\Route('/hello/:first/and/:second', function () {});\n $result = $route->matches($resource);\n $this->assertTrue($result);\n $this->assertEquals(array('first' => 'Josh', 'second' => 'John'), $route->getParams());\n }",
"public function testRouteMatchesAndParamExtracted() {\n\t\t$resource = 'hello/Josh';\n\t\t$route = new Route('/hello/:name', function () {});\n\t\t$result = $route->matches($resource);\n\t\t$this->assertTrue($result);\n\t\t$this->assertEquals($route->params(), array('name' => 'Josh'));\n\t}",
"public function matchRoute();",
"public function testPathMatchWithMultipleParameters()\n {\n $route = $this\n ->getMockBuilder('Sonno\\Configuration\\Route')\n ->disableOriginalConstructor()\n ->getMock();\n $route\n ->expects($this->any())\n ->method('getPath')\n ->will($this->returnValue('/test/{username}/{action}'));\n $route\n ->expects($this->any())\n ->method('getHttpMethod')\n ->will($this->returnValue('GET'));\n\n $config = $this\n ->getMockBuilder('Sonno\\Configuration\\Configuration')\n ->disableOriginalConstructor()\n ->getMock();\n $config\n ->expects($this->any())\n ->method('getRoutes')\n ->will($this->returnValue(array($route)));\n\n $request = $this->buildMockRequest('GET', '/test/foo/bar');\n\n $router = new Router($config);\n\n $matches = $router->match($request, $params);\n\n $this->assertEquals(1, count($matches));\n $this->assertEquals(2, count($params));\n $this->assertArrayHasKey('username', $params);\n $this->assertArrayHasKey('action', $params);\n $this->assertEquals(\"foo\", $params['username']);\n $this->assertEquals(\"bar\", $params['action']);\n }",
"public function test_match_withMoreThanOneVar()\n {\n $route = new Route('GET', '/{id}/{slug}', 'test');\n $this->assertTrue(\n $route->match('GET', '/50/my-post-title'),\n 'match() must return true if URI pattern with var match pattern provided in constructor.'\n );\n $this->assertSame(\n ['id' => '50', 'slug' => 'my-post-title'],\n $route->getParams(),\n 'getParams() must return params from URI provided to match() method when more than one var is specified.'\n );\n }",
"public function testRouteWithTwoArgumentsSeparated()\n {\n $route = new Route();\n\n $route->set(null, null, \"search/{arg1}/what/{arg2}\", function ($arg1, $arg2) {\n return \"$arg1$arg2\";\n });\n\n $this->assertFalse($route->match(\"search\"));\n $this->assertFalse($route->match(\"search/1/2\"));\n $this->assertFalse($route->match(\"search/1/what\"));\n $this->assertFalse($route->match(\"search/1/what/2/3\"));\n $this->assertFalse($route->match(\"search/1/2/3\"));\n\n $this->assertTrue($route->match(\"search/1/what/2\"));\n $this->assertEquals(\"12\", $route->handle());\n }",
"public function testPathMatchWithOneParameters()\n {\n $route = $this\n ->getMockBuilder('Sonno\\Configuration\\Route')\n ->disableOriginalConstructor()\n ->getMock();\n $route\n ->expects($this->any())\n ->method('getPath')\n ->will($this->returnValue('/test/{username}/bar'));\n $route\n ->expects($this->any())\n ->method('getHttpMethod')\n ->will($this->returnValue('GET'));\n\n $config = $this\n ->getMockBuilder('Sonno\\Configuration\\Configuration')\n ->disableOriginalConstructor()\n ->getMock();\n $config\n ->expects($this->any())\n ->method('getRoutes')\n ->will($this->returnValue(array($route)));\n\n $request = $this->buildMockRequest('GET', '/test/foo/bar');\n\n $router = new Router($config);\n\n $matches = $router->match($request, $params);\n\n $this->assertEquals(1, count($matches));\n $this->assertEquals(1, count($params));\n $this->assertArrayHasKey('username', $params);\n $this->assertEquals(\"foo\", $params['username']);\n }",
"public function testRouteWithTwoArguments()\n {\n $route = new Route();\n\n $route->set(null, null, \"search/{arg1}/{arg2}\", function ($arg1, $arg2) {\n return \"$arg1$arg2\";\n });\n\n $this->assertFalse($route->match(\"search\"));\n $this->assertFalse($route->match(\"search/1\"));\n $this->assertFalse($route->match(\"search/1/2/3\"));\n\n $this->assertTrue($route->match(\"search/1/2\"));\n $this->assertEquals(\"12\", $route->handle());\n }",
"public function testGreedyRouteFailurePassedArg() {\n\t\t$route = new CakeRoute('/:controller/:action', array('plugin' => null));\n\t\t$result = $route->match(array('controller' => 'posts', 'action' => 'view', '0'));\n\t\t$this->assertFalse($result);\n\n\t\t$route = new CakeRoute('/:controller/:action', array('plugin' => null));\n\t\t$result = $route->match(array('controller' => 'posts', 'action' => 'view', 'test'));\n\t\t$this->assertFalse($result);\n\t}",
"public function testValidMatchParamaters()\n\t{\n\t\t$config = array('route' => '/foo/bar/:id');\n\t\t$regex = new Regex($config);\n\n\t\t$this->assertTrue($regex->evaluate('/foo/bar/baz'));\n\t\t$params = $regex->getParams();\n\n\t\t$this->assertEquals(\n\t\t\t$params,\n\t\t\tarray('id' => 'baz')\n\t\t);\n\t}",
"public function testRegexRouteMatch()\n {\n $_SERVER['REQUEST_URI'] = '/testing123';\n $_SERVER['REQUEST_METHOD'] = 'GET';\n\n $app = new Shield();\n $app->get('/testing[0-9]+', function(){\n echo 'match /';\n });\n\n ob_start();\n $app->run();\n\n $output = ob_get_clean();\n $this->assertEquals('match /', $output);\n }",
"public function testMatchWithOptionalUrlParts()\n {\n $this->router->map(\n 'GET',\n '/bar/[:controller]/[:action].[:type]?',\n 'bar_action',\n 'bar_route'\n );\n $this->assertEquals(\n array(\n 'target' => 'bar_action',\n 'params' => array(\n 'controller' => 'test',\n 'action' => 'do',\n 'type' => 'json',\n 'method' => 'GET'\n ),\n 'name' => 'bar_route'\n ),\n $this->router->match('/bar/test/do.json', 'GET')\n );\n $this->assertEquals(\n array(\n 'target' => 'bar_action',\n 'params' => array(\n 'controller' => 'test',\n 'action' => 'do',\n 'method' => 'GET'\n ),\n 'name' => 'bar_route'\n ),\n $this->router->match('/bar/test/do', 'GET')\n );\n }",
"public function test_match_withVar()\n {\n $route = new Route('GET', '/{id}-my-post-title', 'test');\n $this->assertTrue(\n $route->match('GET', '/50-my-post-title'),\n 'match() must return true if URI pattern with var match pattern provided in constructor.'\n );\n $this->assertSame(\n ['id' => '50'],\n $route->getParams(),\n 'getParams() must return params from URI provided to match() method.'\n );\n }",
"public function test_match_fromPatternWithoutVars()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertTrue(\n $route->match('GET', '/home'),\n 'match() must return true if URI pattern provided is the same as the one specified in constructor.'\n );\n }",
"public function testRunMatchedRoute(): void\n {\n $atto = new AttoPHP();\n $atto\n ->route('blog', '/blog/:id/comments[/:commentId]?page=&limit=')\n ->route('news', '/news');\n\n $atto->run('/blog/5/comments?page=1', 'GET');\n $this->assertSame('blog', $atto->route()['name']);\n $this->assertSame([\n 'id' => '5',\n 'commentId' => null,\n 'page' => '1',\n 'limit' => null,\n ], $atto->data('atto.route'));\n\n $atto->run('/news?page=1', 'GET');\n $this->assertSame('news', $atto->route()['name']);\n $this->assertEmpty($atto->data('atto.route'));\n }",
"public function testParamsParseFromPattern()\n {\n $route = new Route('post', 'user/<id>', '#handler');\n $this->assertEquals(['id'], $route->getParams());\n\n $route = new Route('post', 'user/<id>/message/<messageId>', '#handler');\n $this->assertEquals(['id', 'messageId'], $route->getParams());\n\n $route = new Route('post', 'user/<id>/<subId>/<subSubId>', '#handler');\n $this->assertEquals(['id', 'subId', 'subSubId'], $route->getParams());\n }",
"private function matchRoute() {\n $this->match = $this->router->match();\n #var_dump($match); /* DEBUG */\n\n if(!$this->match) {\n http_response_code(404);\n }\n $this->target = $this->match[\"target\"];\n }",
"public function testMatchOptionalParameters(): void\n {\n $atto = new AttoPHP();\n $atto->route('blog-post', '/blog/:slug[/comments[/:page]]');\n\n $this->assertSame('blog-post', $atto->match('/blog/new-post', 'GET')['name']);\n $this->assertSame('blog-post', $atto->match('/blog/new-post/comments', 'GET')['name']);\n $this->assertSame('blog-post', $atto->match('/blog/new-post/comments/4', 'GET')['name']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Calculates the total amount earned today | public function totalEarnedToday() {
$q = "SELECT GROUP_CONCAT(DISTINCT totalMoneySpent) AS totalMoneySpent FROM transactions WHERE DATE(transDate) = CURRENT_DATE GROUP BY ref";
$run_q = $this->db->query($q);
if ($run_q->num_rows()) {
$totalEarnedToday = 0;
foreach ($run_q->result() as $get) {
$totalEarnedToday += $get->totalMoneySpent;
}
return $totalEarnedToday;
}
else {
return FALSE;
}
} | [
"public function totalYestrdayAmount()\n\t{\n\t\treturn $this->where('date',Carbon::now()->Yesterday())->sum('amount');\n\t}",
"public function totalEarned() {\n $total = 0;\n\n foreach ($this->all() as $record)\n if ($record->transactionType == 'Return' || $record->transactionType == 'Sold')\n $total += $record->cost;\n\n return $total;\n }",
"function osc_total_items_today() {\n return Item::newInstance()->totalItems(null, 'TODAY');\n }",
"private function getTodayTotalWithdrawal():int\n {\n if ($this->Users)\n {\n return $this->transactionModel->todayWithdrawalTotal($this->Users->id);\n }\n\n return 0;\n }",
"public function calc_day_earning(Request $request)\n {\n if ($request->ajax() && auth()->user()->level == 'admin'):\n $all_bills = bill::get();\n $day_earnings = 0;\n foreach ($all_bills as $bill):\n if (date('Y-m-d', strtotime($bill->created_at) + (2*60*60)) === $request->day):\n $day_earnings += $bill->total_price;\n endif;\n endforeach;\n return $day_earnings;\n endif;\n }",
"public static function getTodayTotal(){\n $today = Carbon::now();\n // $monthstart = $now->startOfMonth();\n return ParticipationReward::whereBetween('created_at', $today)->with(['user'])->sum('point');\n\n }",
"public function bookingAmount() {\n\t\t\t\n\t\t\t$baseAmount = $this->apartment_price_per_night;\n\t\t\tforeach ($this->bookedServices()->get() as $upgrade) {\n\t\t\t\t$baseAmount += $upgrade->price_per_night == 0 ? 0 : $upgrade->price_per_night;\n\t\t\t}\n\t\t\treturn $baseAmount * $this->check_out->diffInDays($this->check_in);\n\t\t}",
"public function TodaySale()\n {\n date_default_timezone_set('Asia/Dhaka');\n $starting = date('Y-m-d').\" 00:00:00\";\n $ending = date('Y-m-d').\" 23:59:59\";\n\n $query = \"SELECT sum(sub_total) as 'subtotal' from tbl_sell ts where ts.date between '$starting' and '$ending'\";\n $st = $this->dbObj->select($query);\n if ($st) {\n $subtotal = $st->fetch_object()->subtotal;\n if ($subtotal > 0) {\n return $subtotal;\n }else{\n return 0;\n }\n }\n }",
"public function recalculateTotalPrice();",
"protected function calculate_fee_totals()\n {\n }",
"public function iN_CurrentDayTotalPremiumEarning() {\n\t\t$query = mysqli_query($this->db, \"SELECT SUM(admin_earning) AS DayTotalEarnPremium FROM i_user_payments WHERE payment_type = 'post' AND payment_status = 'ok' AND DAY(FROM_UNIXTIME(payment_time)) = DAY(CURDATE()) \") or die(mysqli_error($this->db));\n\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn isset($row['DayTotalEarnPremium']) ? $row['DayTotalEarnPremium'] : '0.00';\n\t}",
"public function calculateAdjustmentsTotal();",
"public function totalPaidHourly() {\n\t\t$total = TransactionLocal::where('user_id', $this->id)\n\t\t\t\t\t\t\t\t->where('for', TransactionLocal::FOR_BUYER)\n\t\t\t\t\t\t\t\t->where('type', TransactionLocal::TYPE_HOURLY)\n\t\t\t\t\t\t\t\t->where('status', TransactionLocal::STATUS_DONE)\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t->sum('amount');\n\n\t\treturn abs($total);\n\t}",
"public function calculate_total_paid(){\r\n $this->total_paid = 0;\r\n foreach($this->payments as $payment){\r\n $this->total_paid += $payment->getAmount();\r\n }\r\n return $this->total_paid;\r\n }",
"public function getTotalDiscountAmount();",
"function amountOfAvailablePrizesToday($conn)\n{\n $amount = 0;\n if (isSunday() && !isLastSunday()) {\n $amount = 7;\n } else {\n $amount = 8;\n }\n return ($amount - todaysSentPrizes($conn));\n}",
"function calculateTotalDiscount() {\t\t\t\n\t\t$user = & JFactory::getUser();\n\t\t$db = & JFactory::getDBO();\n\t\t$nullDate = $db->getNullDate();\n\t\t$events = $this->getEvents();\t\t\t\n\t\t$totalDiscount = 0 ;\n\t\tfor ($i = 0 , $n = count($events) ; $i < $n ; $i++) {\n\t\t\t$event = $events[$i] ;\n\t\t\t$registrantTotalAmount = $event->rate*$event->quantity ;\n\t\t\t$registrantDiscount = 0 ;\n\t\t\t//Member discount\n\t\t\tif ($user->get('id')) {\n\t\t\t\tif ($event->discount > 0) {\n\t\t\t\t\tif ($event->discount_type == 1) {\n\t\t\t\t\t\t$registrantDiscount = $registrantTotalAmount*$event->discount/100 ;\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$registrantDiscount = $event->quantity*$event->discount ;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\t//Calculate the coupon discount\n\t\t\tif (isset($_SESSION['coupon_id'])) {\n\t\t\t\t$sql = 'SELECT * FROM #__eb_coupons WHERE id='.(int)$_SESSION['coupon_id'];\n\t\t\t\t$db->setQuery($sql) ;\n\t\t\t\t$coupon = $db->loadObject();\n\t\t\t\tif ($coupon && ($coupon->event_id == 0 || $coupon->event_id == $event->id)) {\n\t\t\t\t\tif ($coupon->coupon_type == 0) {\n\t\t\t\t\t\t$registrantDiscount += $registrantTotalAmount*$coupon->discount/100 ; \n\t\t\t\t\t} else {\n\t\t\t\t\t\t$registrantDiscount += $registrantDiscount + $coupon->discount ;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\t\n\t\t\t//Early bird discount\n\t\t\tif (($event->early_bird_discount_amount > 0) && ($event->early_bird_discount_date != $nullDate) && (strtotime($event->early_bird_discount_date)>= mktime())) {\t\t\t\t\t\n\t\t\t\tif ($event->early_bird_discount_type == 1) {\n\t\t\t\t\t$registrantDiscount += $registrantTotalAmount*$event->early_bird_discount_amount/100 ;\t\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$registrantDiscount += $event->quantity*$event->early_bird_discount_amount ;\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\t\t\t\t\t\t\t\n\t\t\t$totalDiscount += $registrantDiscount ;\n\t\t}\n\t\treturn $totalDiscount ;\t\n\t}",
"public function getTotalDue(){\n return $this->_get(self::TOTAL_DUE);\n }",
"function getActivityExpenseAmount(){\n\t\t$expenselines = $this->getExpensesDetails();\n\t\t$expensetotal = 0;\n\t\tif($expenselines){\n\t\t\tforeach ($expenselines as $expense){\n\t\t\t\t$expensetotal += isEmptyString($expense->getAmount()) ? 0 : $expense->getAmount();\n\t\t\t}\n\t\t}\n\t\treturn $expensetotal;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Logs a query to the specified logger | protected function _logQuery(Query $query, LoggerInterface $logger)
{
if (!$this->getDriver()->isQueryLoggingEnabled()) {
return;
}
$logger->debug($query->endpoint(), [
'params' => $query->where()
]);
} | [
"function QueryLog( $query ) {\n \n $args = array(\n 'name' => 'Query_Log',\n 'path' => TEMPLATEPATH . '/logs/query.log',\n 'level' => 200, // info\n );\n\n // check instance\n if (is_null($this->log)) {\n $this->log = new Logger( $args );\n }\n\n // log all \"select\" query run by fontend\n if ( !is_admin() && preg_match( '/^\\s*(select) /i', $query ) ) {\n\n $this->log->info( $query );\n }\n }",
"abstract protected function _logQuery($query);",
"public function enableQueryLog() {\n\t\t$this->loggingQueries = true;\n\t}",
"public function enableQueryLog()\n {\n $this->loggingQueries = true;\n }",
"public function EnableQueryLog(): void\n {\n $this->loggingQueries = true;\n }",
"private function logQuery() {\n if (!$this->are_queries_logged) return;\n\n if (sizeof($this->logged_queries) > $this->max_logged_queries) {\n $this->are_queries_logged = false;\n $this->logged_queries[] = 'Number of maximum logged queries exceeded; turning off logging.';\n $this->logged_queries[] = 'Call tx_newspaper::setMaxLoggedQueries() to increase the number of logged queries.';\n } else {\n $this->logged_queries[] = $this->query;\n }\n }",
"public function logSearch($query)\n\t\t{\n if($this->identity) {\n $user = $this->identity->user_name;\n } else {\n $user = 'anonymous';\n }\n \n if (Zend_Registry::get('serverConfig')->logging == TRUE) {\n\t\t\t $message = sprintf('Search query from user %s at IP: %s: %s',\n\t $user,\n\t $_SERVER['REMOTE_ADDR'],\n\t $query);\n\t\n\t $logger = Zend_Registry::get('searchlogger');\n\t $logger->notice($message);\n }\n\t\t}",
"public function enableQueryLog();",
"public function logQuery(ResultSet $result);",
"static public function enableQueryLogging() {\n\t\t$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = TRUE;\n\t}",
"private function log_query($query, array $arguments) {\n global $_mp_queries;\n $_mp_queries ++;\n \n $this->_queryLog [] = array( 'Query' => (string)$query,\n 'Arguments' => $arguments);\n }",
"public function testQueryLogging()\n {\n $logger = $this->getMockBuilder('Cake\\Log\\Engine\\BaseLog')->setMethods(['log'])->getMock();\n $logger->expects($this->once())->method('log');\n Log::config('elasticsearch', $logger);\n\n $connection = ConnectionManager::get('test');\n $connection->logQueries(true);\n $result = $connection->request('_stats');\n $connection->logQueries(false);\n\n $this->assertNotEmpty($result);\n }",
"public static function enableQueryLog()\n {\n static::$instance = static::$instance ?: new static();\n\n static::$connection->enableQueryLog();\n }",
"public function logQueries()\n {\n // DbLoJack Helper\n $helper = app('db_lojack');\n\n // Log database queries for the request\n foreach ($helper->connections() as $connection) {\n $queries = DB::connection($connection)->getQueryLog();\n $helper->logQueries($queries, $connection );\n }\n }",
"public function enableQueryLog()\n {\n // enable debug log\n if ($this->debug) {\n DB::connection()->enableQueryLog();\n }\n }",
"function log_query($query)\n\t\t{\n\t\t\t// Log how the last function was called\n\t\t\t$this->func_call = $query;\n\t\t\t\n\t\t\t// Keep an running Log of all functions called\n\t\t\tarray_push($this->all_func_calls, $this->func_call);\n\t\t}",
"public function queryLog(){\n echo '<pre>', print_r($this->getQueryList(TRUE), TRUE), '</pre>';\n }",
"function log($query){\n //$this->conn->query($query_log);\n $timestamp = time();\n file_put_contents('C:\\Git\\kamisado\\back\\logs\\logs.txt', $timestamp . \" - \" . $query.\"\\r\\n\", FILE_APPEND);\n }",
"public function flushQueryLog();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the markup required to finish an SVG document | function _finish_svg($plot = '')
{
return $plot . '</svg>' . "\n";
} | [
"public function getSvgString()\n\t{\n\t\treturn $this->_svgContent;\n\t}",
"function print_svg($file){\n $iconfile = new \\DOMDocument();\n $iconfile->load($file);\n $tag = $iconfile->saveHTML($iconfile->getElementsByTagName('svg')[0]);\n return $tag;\n}",
"public function GetSVGHeader() {\r\n \r\n $html = <<<EOD\r\n <svg \r\n baseProfile=\"full\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n xmlns:ev=\"http://www.w3.org/2001/xml-events\"\r\n width=\"{$this->iWidth}\"\r\n height=\"{$this->iHeight}\"\r\n id=\"dice\">\r\n <defs\r\n id=\"defs1\">\r\n </defs>\r\nEOD;\r\n\r\n return $html;\r\n }",
"public function renderFullSVG() {\n\t\tif (!$this->fullSvg->documentElement || !$this->fullSvg->documentElement->childNodes->length) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $this->fullSvg->saveXML($this->fullSvg->documentElement, LIBXML_NOEMPTYTAG) ?: '';\n\t}",
"function ImageSVG($data)\n\t{\n\t\t$data = preg_replace('/^.*?<svg([> ])/is', '<svg\\\\1', $data); // mPDF 5.7.4\n\t\t$data = preg_replace('/<!--.*?-->/is', '', $data); // mPDF 5.7.4\n\n\t\t// Converts < to < when not a tag\n\t\t$data = preg_replace('/<([^!?\\/a-zA-Z_:])/i', '<\\\\1', $data); // mPDF 5.7.4\n\n\t\t$data = $this->mergeStyles($data);\n\n\t\tif ($this->mpdf->svgAutoFont) {\n\t\t\t$data = $this->markScriptToLang($data);\n\t\t}\n\n\t\t$this->svg_info = [];\n\t\t$last_gradid = ''; // mPDF 6\n\t\t$last_svg_fontid = ''; // mPDF 6\n\t\t$last_svg_fontdefw = ''; // mPDF 6\n\t\t$last_svg_fontstyle = ''; // mPDF 6\n\n\t\tif (preg_match('/<!ENTITY/si', $data)) {\n\t\t\t// Get User-defined entities\n\t\t\tpreg_match_all('/<!ENTITY\\s+([a-z]+)\\s+\\\"(.*?)\\\">/si', $data, $ent);\n\t\t\t// Replace entities\n\t\t\tfor ($i = 0; $i < count($ent[0]); $i++) {\n\t\t\t\t$data = preg_replace('/&' . preg_quote($ent[1][$i], '/') . ';/is', $ent[2][$i], $data);\n\t\t\t}\n\t\t}\n\n\t\tif (preg_match('/xlink:href\\s*=/si', $data)) {\n\n\t\t\t// GRADIENTS\n\t\t\t// Get links\n\t\t\tpreg_match_all('/(<(linearGradient|radialgradient)[^>]*)xlink:href\\s*=\\s*[\"\\']#(.*?)[\"\\'](.*?)\\/>/si', $data, $links);\n\t\t\tif (count($links[0])) {\n\t\t\t\t$links[5] = [];\n\t\t\t}\n\n\t\t\t// Delete links from data - keeping in $links\n\t\t\tfor ($i = 0; $i < count($links[0]); $i++) {\n\t\t\t\t$links[5][$i] = 'tmpLink' . random_int(100000, 9999999);\n\t\t\t\t$data = preg_replace('/' . preg_quote($links[0][$i], '/') . '/is', '<MYLINKS' . $links[5][$i] . '>', $data);\n\t\t\t}\n\n\t\t\t// Get targets\n\t\t\tpreg_match_all('/<(linearGradient|radialgradient)([^>]*)id\\s*=\\s*[\"\\'](.*?)[\"\\'](.*?)>(.*?)<\\/(linearGradient|radialgradient)>/si', $data, $m);\n\t\t\t$targets = [];\n\t\t\t$stops = [];\n\n\t\t\t// keeping in $targets\n\t\t\tfor ($i = 0; $i < count($m[0]); $i++) {\n\t\t\t\t$stops[$m[3][$i]] = $m[5][$i];\n\t\t\t}\n\n\t\t\t// Add back links this time as targets (gradients)\n\t\t\tfor ($i = 0; $i < count($links[0]); $i++) {\n\t\t\t\t$def = $links[1][$i] . ' ' . $links[4][$i] . '>' . $stops[$links[3][$i]] . '</' . $links[2][$i] . '>';\n\t\t\t\t$data = preg_replace('/<MYLINKS' . $links[5][$i] . '>/is', $def, $data);\n\t\t\t}\n\n\t\t\t// mPDF 5.7.4\n\t\t\t// <TREF>\n\t\t\tpreg_match_all('/<tref ([^>]*)xlink:href\\s*=\\s*[\"\\']#([^>]*?)[\"\\']([^>]*)\\/>/si', $data, $links);\n\t\t\tfor ($i = 0; $i < count($links[0]); $i++) {\n\t\t\t\t// Get the item to use from defs\n\t\t\t\t$insert = '';\n\t\t\t\tif (preg_match('/<text [^>]*id\\s*=\\s*[\"\\']' . $links[2][$i] . '[\"\\'][^>]*>(.*?)<\\/text>/si', $data, $m)) {\n\t\t\t\t\t$insert = $m[1];\n\t\t\t\t}\n\t\t\t\tif ($insert) {\n\t\t\t\t\t$data = preg_replace('/' . preg_quote($links[0][$i], '/') . '/is', $insert, $data);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// mPDF 5.7.2\n\t\t\t// <USE>\n\t\t\tpreg_match_all('/<use( [^>]*)xlink:href\\s*=\\s*[\"\\']#([^>]*?)[\"\\']([^>]*)\\/>/si', $data, $links);\n\t\t\tfor ($i = 0; $i < count($links[0]); $i++) {\n\t\t\t\t// Get the item to use from defs\n\t\t\t\t$insert = '';\n\t\t\t\tif (preg_match('/<([a-zA-Z]*) [^>]*id\\s*=\\s*[\"\\']' . $links[2][$i] . '[\"\\'][^>]*\\/>/si', $data, $m)) {\n\t\t\t\t\t$insert = $m[0];\n\t\t\t\t}\n\t\t\t\tif (!$insert && preg_match('/<([a-zA-Z]*) [^>]*id\\s*=\\s*[\"\\']' . $links[2][$i] . '[\"\\']/si', $data, $m)) {\n\t\t\t\t\tif (preg_match('/<' . $m[1] . '[^>]*id\\s*=\\s*[\"\\']' . $links[2][$i] . '[\"\\'][^>]*>.*?<\\/' . $m[1] . '>/si', $data, $m)) {\n\t\t\t\t\t\t$insert = $m[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($insert) {\n\t\t\t\t\t$inners = $links[1][$i] . ' ' . $links[3][$i];\n\n\t\t\t\t\t// Change x,y coords to translate()\n\t\t\t\t\tif (preg_match('/\\sy\\s*=\\s*[\"\\']([^>]*?)[\"\\']/', $inners, $m)) {\n\t\t\t\t\t\t$y = $m[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$y = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (preg_match('/\\sx\\s*=\\s*[\"\\']([^>]*?)[\"\\']/', $inners, $m)) {\n\t\t\t\t\t\t$x = $m[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$x = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($x || $y) {\n\n\t\t\t\t\t\t$inners = preg_replace('/(y|x)\\s*=\\s*[\"\\']([^>]*?)[\"\\']/', '', $inners);\n\t\t\t\t\t\tif (preg_match('/transform\\s*=\\s*[\"\\']([^>]*?)[\"\\']/', $inners, $m)) {\n\n\t\t\t\t\t\t\tif (preg_match('/translate\\(\\s*([0-9\\.]+)\\s*,\\s*([0-9\\.]+)\\s*\\)/', $m[1], $mm)) {\n\t\t\t\t\t\t\t\t$transform = $m[1]; // transform=\"....\"\n\t\t\t\t\t\t\t\t$x += $mm[1];\n\t\t\t\t\t\t\t\t$y += $mm[2];\n\t\t\t\t\t\t\t\t$transform = preg_replace('/' . preg_quote($mm[0], '/') . '/', '', $transform);\n\t\t\t\t\t\t\t\t$transform = 'transform=\"' . $transform . ' translate(' . $x . ', ' . $y . ')\"';\n\t\t\t\t\t\t\t\t$inners = preg_replace('/' . preg_quote($m[0], '/') . '/is', $transform, $inners);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$inners = preg_replace('/' . preg_quote($m[0], '/') . '/is', 'transform=\"' . $m[1] . ' translate(' . $x . ', ' . $y . ')\"', $inners);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$inners .= ' transform=\"translate(' . $x . ', ' . $y . ')\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$replacement = '<g ' . $inners . '>' . $insert . '</g>';\n\t\t\t\t$data = preg_replace('/' . preg_quote($links[0][$i], '/') . '/is', $replacement, $data);\n\t\t\t}\n\n\t\t\tpreg_match_all('/<use( [^>]*)xlink:href\\s*=\\s*[\"\\']#([^>]*?)[\"\\']([^>]*)>\\s*<\\/use>/si', $data, $links);\n\t\t\tfor ($i = 0; $i < count($links[0]); $i++) {\n\n\t\t\t\t// Get the item to use from defs\n\t\t\t\t$insert = '';\n\t\t\t\tif (preg_match('/<([a-zA-Z]*) [^>]*id\\s*=\\s*[\"\\']' . $links[2][$i] . '[\"\\'][^>]*\\/>/si', $data, $m)) {\n\t\t\t\t\t$insert = $m[0];\n\t\t\t\t}\n\n\t\t\t\tif (!$insert && preg_match('/<([a-zA-Z]*) [^>]*id\\s*=\\s*[\"\\']' . $links[2][$i] . '[\"\\']/si', $data, $m)) {\n\t\t\t\t\tif (preg_match('/<' . $m[1] . '[^>]*id\\s*=\\s*[\"\\']' . $links[2][$i] . '[\"\\'][^>]*>.*?<\\/' . $m[1] . '>/si', $data, $m)) {\n\t\t\t\t\t\t$insert = $m[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($insert) {\n\t\t\t\t\t$inners = $links[1][$i] . ' ' . $links[3][$i];\n\n\t\t\t\t\t// Change x,y coords to translate()\n\t\t\t\t\tif (preg_match('/\\sy\\s*=\\s*[\"\\']([^>]*?)[\"\\']/', $inners, $m)) {\n\t\t\t\t\t\t$y = $m[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$y = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (preg_match('/\\sx\\s*=\\s*[\"\\']([^>]*?)[\"\\']/', $inners, $m)) {\n\t\t\t\t\t\t$x = $m[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$x = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($x || $y) {\n\t\t\t\t\t\t$inners = preg_replace('/(y|x)\\s*=\\s*[\"\\']([^>]*?)[\"\\']/', '', $inners);\n\t\t\t\t\t\tif (preg_match('/transform\\s*=\\s*[\"\\']([^>]*?)[\"\\']/', $inners, $m)) {\n\t\t\t\t\t\t\tif (preg_match('/translate\\(\\s*([0-9\\.]+)\\s*,\\s*([0-9\\.]+)\\s*\\)/', $m[1], $mm)) {\n\t\t\t\t\t\t\t\t$transform = $m[1]; // transform=\"....\"\n\t\t\t\t\t\t\t\t$x += $mm[1];\n\t\t\t\t\t\t\t\t$y += $mm[2];\n\t\t\t\t\t\t\t\t$transform = preg_replace('/' . preg_quote($mm[0], '/') . '/', '', $transform);\n\t\t\t\t\t\t\t\t$transform = 'transform=\"' . $transform . ' translate(' . $x . ', ' . $y . ')\"';\n\t\t\t\t\t\t\t\t$inners = preg_replace('/' . preg_quote($m[0], '/') . '/is', $transform, $inners);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$inners = preg_replace('/' . preg_quote($m[0], '/') . '/is', 'transform=\"' . $m[1] . ' translate(' . $x . ', ' . $y . ')\"', $inners);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$inners .= ' transform=\"translate(' . $x . ', ' . $y . ')\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$replacement = '<g ' . $inners . '>' . $insert . '</g>';\n\t\t\t\t\t$data = preg_replace('/' . preg_quote($links[0][$i], '/') . '/is', $replacement, $data);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Removes <pattern>\n\t\t$data = preg_replace('/<pattern.*?<\\/pattern>/is', '', $data);\n\n\t\t// Removes <marker>\n\t\t$data = preg_replace('/<marker.*?<\\/marker>/is', '', $data);\n\n\t\t$this->svg_info['data'] = $data;\n\t\t$this->svg_string = '';\n\n\t\t$svg2pdf_xml = '';\n\n\t\t// Don't output stuff inside <defs>\n\t\t$this->inDefs = false;\n\n\t\t$svg2pdf_xml_parser = xml_parser_create(\"utf-8\");\n\n\t\txml_parser_set_option($svg2pdf_xml_parser, XML_OPTION_CASE_FOLDING, false);\n\n\t\txml_set_element_handler(\n\t\t\t$svg2pdf_xml_parser,\n\t\t\t[$this, 'xml_svg2pdf_start'],\n\t\t\t[$this, 'xml_svg2pdf_end']\n\t\t);\n\n\t\txml_set_character_data_handler(\n\t\t\t$svg2pdf_xml_parser,\n\t\t\t[$this, 'characterData']\n\t\t);\n\n\t\txml_parse($svg2pdf_xml_parser, $data);\n\n\t\tif ($this->svg_error) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn [\n\t\t\t\t'x' => $this->svg_info['x'] * $this->kp,\n\t\t\t\t'y' => -$this->svg_info['y'] * $this->kp,\n\t\t\t\t'w' => $this->svg_info['w'] * $this->kp,\n\t\t\t\t'h' => -$this->svg_info['h'] * $this->kp,\n\t\t\t\t'data' => $this->svg_string,\n\t\t\t];\n\t\t}\n\t}",
"function render()\n{\n $data = _settings('tag_data');\n $sizes = guessSizes($data);\n // link ?\n $link_opentag = !empty($data['tag_link']) ? '<a xlink:href=\"'.$data['tag_link'].'\" class=\"svg\">' : '';\n $link_closetag = !empty($data['tag_link']) ? '</a>' : '';\n // content\n $svg = <<<MSG\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 20010904//EN\" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n<svg version=\"1.1\"\n baseProfile=\"full\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n width=\"{$sizes['full-width']}px\" height=\"20px\"\n id=\"button\">\n<style>\n/* <![CDATA[ */\na.svg {\n text-decoration: none;\n position: relative;\n display: inline-block;\n}\na.svg:after {\n content: \"\";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left:0;\n}\n/* ]]> */\n</style>\n {$link_opentag}\n <linearGradient id=\"a\" x2=\"0\" y2=\"100%\">\n <stop offset=\"0\" stop-color=\"#bbb\" stop-opacity=\".1\" />\n <stop offset=\"1\" stop-opacity=\".1\" />\n </linearGradient>\n <rect rx=\"3\" width=\"90%\" height=\"100%\" fill=\"#555\" />\n <rect rx=\"3\" x=\"{$sizes['left-width']}\" width=\"{$sizes['right-width']}\" height=\"100%\" fill=\"#{$data['color']}\" />\n <path fill=\"#{$data['color']}\" d=\"M{$sizes['separator-x']} 0h4v20h-4z\" />\n <rect rx=\"3\" width=\"{$sizes['full-width']}\" height=\"100%\" fill=\"url(#a)\" />\n <g fill=\"#fff\" text-anchor=\"start\" font-family=\"DejaVu Sans,Verdana,Geneva,sans-serif\" font-size=\"11\">\n <text x=\"{$sizes['left-padding']}\" y=\"15\" fill=\"#010101\" fill-opacity=\".3\">{$data['title']}</text>\n <text x=\"{$sizes['left-padding']}\" y=\"14\">{$data['title']}</text>\n <text x=\"{$sizes['right-padding']}\" y=\"15\" fill=\"#010101\" fill-opacity=\".3\">{$data['name']}</text>\n <text x=\"{$sizes['right-padding']}\" y=\"14\">{$data['name']}</text>\n </g>\n {$link_closetag}\n</svg>\nMSG;\n if (!headers_sent() && (!defined('HARD_DEBUG') || HARD_DEBUG!==true)) {\n header('Content-Type: '._settings('svg-mime'));\n }\n echo $svg;\n exit(0);\n}",
"function Job_Search_get_svg( $svg ) {\n\n\treturn Job_Search_Globals::get_svg( $svg );\n\n}",
"public function dataSVGSelfClosingElements()\n {\n $head = '<head><meta charset=\"utf-8\"></head>';\n\n return [\n 'test self closing path tag' => [\n '<!DOCTYPE html><html><head></head><body>'\n . '<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">'\n . ' <path d=\"M 10,30 A 20,20 0,0,1 50,30 A 20,20 0,0,1 90,30 Q 90,60 50,90 Q 10,60 10,30 z\"/>'\n . '</svg>'\n . '</body></html>',\n '<!DOCTYPE html><html>' . $head . '<body>'\n . '<svg viewbox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">'\n . ' <path d=\"M 10,30 A 20,20 0,0,1 50,30 A 20,20 0,0,1 90,30 Q 90,60 50,90 Q 10,60 10,30 z\" />'\n . '</svg>'\n . '</body></html>',\n ],\n 'test g tag without child element' => [\n '<!DOCTYPE html><html><head></head><body>'\n . '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\">'\n . ' <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11.99 2C6.47 2 2 6.48 2 12C2 17.52\" fill=\"#1E1E1C\" />'\n . ' <mask id=\"mask0\" maskUnits=\"userSpaceOnUse\" x=\"2\" y=\"2\" width=\"20\" height=\"20\">'\n . ' <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11.99 2C6.47 2 2 6.48 2 12C2 17.52\" fill=\"white\" />'\n . ' </mask>'\n . ' <g mask=\"url(#mask0)\" />'\n . '</svg>'\n . '</body></html>',\n '<!DOCTYPE html><html>' . $head . '<body>'\n . '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewbox=\"0 0 24 24\" fill=\"none\">'\n . ' <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11.99 2C6.47 2 2 6.48 2 12C2 17.52\" fill=\"#1E1E1C\" />'\n . ' <mask id=\"mask0\" maskunits=\"userSpaceOnUse\" x=\"2\" y=\"2\" width=\"20\" height=\"20\">'\n . ' <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11.99 2C6.47 2 2 6.48 2 12C2 17.52\" fill=\"white\" />'\n . ' </mask>'\n . ' <g mask=\"url(#mask0)\" />'\n . '</svg>'\n . '</body></html>',\n ],\n 'test g tag with child elements' => [\n '<!DOCTYPE html><html><head></head><body>'\n . '<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">'\n . ' <g fill=\"white\" stroke=\"green\" stroke-width=\"5\">'\n . ' <circle cx=\"40\" cy=\"40\" r=\"25\" />'\n . ' <circle cx=\"60\" cy=\"60\" r=\"25\" />'\n . ' </g>'\n . '</svg>'\n . '</body></html>',\n '<!DOCTYPE html><html>' . $head . '<body>'\n . '<svg viewbox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">'\n . ' <g fill=\"white\" stroke=\"green\" stroke-width=\"5\">'\n . ' <circle cx=\"40\" cy=\"40\" r=\"25\" />'\n . ' <circle cx=\"60\" cy=\"60\" r=\"25\" />'\n . ' </g>'\n . '</svg>'\n . '</body></html>',\n ],\n 'test g tag one path child and newlines' => [\n '<!DOCTYPE html><html><head></head><body>' . PHP_EOL\n . '<svg>' . PHP_EOL\n . ' <g id=\"ok\">' . PHP_EOL\n . ' <path/>' . PHP_EOL\n . ' </g>' . PHP_EOL\n . '</svg>' . PHP_EOL\n . '</body></html>',\n '<!DOCTYPE html><html>' . $head . '<body>' . PHP_EOL\n . '<svg>' . PHP_EOL\n . ' <g id=\"ok\">' . PHP_EOL\n . ' <path />' . PHP_EOL\n . ' </g>' . PHP_EOL\n . '</svg>' . PHP_EOL\n . '</body></html>',\n ]\n ];\n }",
"public function getSvg(): DOMNode {\n return $this->svg;\n }",
"private static function svg_style() {\n if (WP_DEBUG) {\n $style = file_get_contents ( self::$_plugin_dir. 'css/manage-svg.css' );\n } else {\n $style = file_get_contents ( self::$_plugin_dir. 'dist/manage-svg.css' );\n }\n return '<style><![CDATA[' . $style . ']]</style>';\n }",
"public function convertTescoSVGCodeToHTML($svg)\n {\n // remove from $svg unnecessary elements\n\n // find first \"<rect\" node element\n // delete everything until first \"<rect\"\n $svg = substr($svg, strpos($svg, '<rect'));\n\n //find last </g> closing tag and cut everything after it\n $svg = substr($svg, 0, strpos($svg, '</g>') + strlen('</g>'));\n\n //insert everything into master tag (requirement of SimpleXMLElement class)\n $svg = '<svg>' . $svg . '</svg>';\n $xml = new SimpleXMLElement($svg);\n if (!$xml) {\n return;\n }\n\n //get first children\n $node = $xml->children();\n\n //initialize return value\n $xhtml = new DOMDocument();\n\n //analyze svg nodes, and generate html\n foreach ($node as $child) {\n // all rect nodes are in group master node\n if ($child->getName() === 'g') {\n $prevX = 0;\n $prevWidth = 0;\n\n // get data from all rect nodes\n foreach ($child->children() as $rect) {\n $attrArr = $rect->attributes();\n $divRect = $xhtml->createElement('div');\n $width = $attrArr['width'];\n $margin = ($attrArr['x'] - $prevX - $prevWidth) . 'px';\n\n //set html attributes based on SVG attributes\n $divRect->setAttribute('style', \"float:left; position:relative; height:50px; width:$width; background-color:#000; margin-left:$margin\");\n\n $xhtml->appendChild($divRect);\n\n $prevX = $attrArr['x'];\n $prevWidth = $attrArr['width'];\n }\n // add empty div tag to clear 'float' css property\n $div = $xhtml->createElement('div');\n $div->setAttribute('style', \"clear:both\");\n $xhtml->appendChild($div);\n }\n }\n return $xhtml->saveXML(null, LIBXML_NOEMPTYTAG);\n }",
"private function OutputSVG()\n {\n\t$filename = $this->model->filename;\n\n\theader(\"Content-Disposition: attachment; filename=$filename.svg\");\n\theader(\"Content-Type: \" . $this->model->type);\n\techo $this->model->svg;\n\n\tYii::app()->end();\n }",
"public function asXML(): string\n {\n return $this->svg->asXML();\n }",
"public function getSvgRoot()\n {\n return new \\View\\Svg\\Svg($this->firstChild);\n }",
"public function asSVG()\n {\n $output = $this->_svg();\n\n return $output;\n }",
"function wpcd_get_loading_svg_code( $type = 1 ) {\n\n\t$code = '';\n\n\tswitch ( $type ) {\n\t\tcase 1:\n\t\t\t$code = '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" style=\"margin: auto; background: rgb(0, 0, 0) none repeat scroll 0% 0%; display: block; shape-rendering: auto;\" width=\"200px\" height=\"200px\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\">\n<rect x=\"17.5\" y=\"30\" width=\"15\" height=\"40\" fill=\"#ef6f90\">\n <animate attributeName=\"y\" repeatCount=\"indefinite\" dur=\"1s\" calcMode=\"spline\" keyTimes=\"0;0.5;1\" values=\"18;30;30\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1\" begin=\"-0.2s\"></animate>\n <animate attributeName=\"height\" repeatCount=\"indefinite\" dur=\"1s\" calcMode=\"spline\" keyTimes=\"0;0.5;1\" values=\"64;40;40\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1\" begin=\"-0.2s\"></animate>\n</rect>\n<rect x=\"42.5\" y=\"30\" width=\"15\" height=\"40\" fill=\"#f8b26a\">\n <animate attributeName=\"y\" repeatCount=\"indefinite\" dur=\"1s\" calcMode=\"spline\" keyTimes=\"0;0.5;1\" values=\"20.999999999999996;30;30\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1\" begin=\"-0.1s\"></animate>\n <animate attributeName=\"height\" repeatCount=\"indefinite\" dur=\"1s\" calcMode=\"spline\" keyTimes=\"0;0.5;1\" values=\"58.00000000000001;40;40\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1\" begin=\"-0.1s\"></animate>\n</rect>\n<rect x=\"67.5\" y=\"30\" width=\"15\" height=\"40\" fill=\"#abbd81\">\n <animate attributeName=\"y\" repeatCount=\"indefinite\" dur=\"1s\" calcMode=\"spline\" keyTimes=\"0;0.5;1\" values=\"20.999999999999996;30;30\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1\"></animate>\n <animate attributeName=\"height\" repeatCount=\"indefinite\" dur=\"1s\" calcMode=\"spline\" keyTimes=\"0;0.5;1\" values=\"58.00000000000001;40;40\" keySplines=\"0 0.5 0.5 1;0 0.5 0.5 1\"></animate>\n</rect>\n<!-- [ldio] generated by https://loading.io/ --></svg>';\n\t\t\tbreak;\n\t}\n\n\t$code = apply_filters( 'wpcd_get_loading_svg_code', $code, $type );\n\n\treturn $code;\n\n}",
"function output_svg_set() {\n\n\t\tif ( defined(\"SHOW_CT_BUILDER\") ) \n\t\t\treturn;\n\n\t\t$svg_sets = get_option(\"ct_svg_sets\", array() );\n\n\t\t// loop all sets\n\t\tforeach ( $svg_sets as $set ) {\n\n\t\t\t$icons_to_remove = array();\n\t\t\t\n\t\t\t$svg = new SimpleXMLElement($set);\n\n\t\t\tif($svg->defs->symbol) {\n\t\t\t\t// loop all set icons\n\n\t\t\t\tforeach ( $svg->defs->symbol as $key => $symbol ) {\n\n\t\t\t\t\t$icon \t\t= (array)$symbol;\n\t\t\t\t\t$attributes = $icon[\"@attributes\"];\n\t\t\t\t\t$icon_id \t= $attributes['id'];\n\t\t\t\t\t$view_box \t= explode(\" \", $attributes['viewBox']);\n\n\t\t\t\t\tif ( in_array( $icon_id, $this->icons_ids ) ) {\n\n\t\t\t\t\t\tif ( $view_box[2] != $view_box[3] ) {\n\t\t\t\t\t\t\techo \"<style>\";\n\t\t\t\t\t\t\techo \".ct-\".esc_attr($attributes['id']).\"{\";\n\t\t\t\t\t\t\techo \"width:\" . ($view_box[2] / $view_box[3]) . \"em\";\t\n\t\t\t\t\t\t\techo \"}\";\n\t\t\t\t\t\t\techo \"</style>\\r\\n\";\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// remove not used icons to keep HTML output clean\n\t\t\t\t\t\t$icons_to_remove[] = $symbol;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tforeach ($icons_to_remove as $icon) {\n\t\t\t\t unset($icon[0]);\n\t\t\t\t}\n\n\t\t\t\tif ( sizeof($svg->defs->symbol) == 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// remove empty lines\n\t\t\t\t$output = str_replace(\"\\r\", \"\", $svg->asXML());\n\t\t\t\t$output = str_replace(\"\\n\", \"\", $output);\n\n\t\t\t\techo $output;\n\t\t\t}\n\t\t}\n\t}",
"function get_svg($key) {\n\t$content = 'none';\n\t$file = get_stylesheet_directory().'/library/assets/svg/'.$key.'.svg';\n\tif(file_exists($file)) {\n\t\t$content = file_get_contents($file);\n\t}\n\treturn $content;\n}",
"function outputSvgSymbols($group='')\n{\nif (empty($group)){\n $group=$this->getFold();\n }\n\nif (isset ( $this->svg_symbols[$group] )){\n\n ob_start();\n //<svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n ?>\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display: none;\">\n <?php\n foreach ($this->svg_symbols[$group] AS $svg => $svg_file)\n {?>\n <?= file_get_contents($svg_file);\n }?>\n </svg>\n <?php\n return ob_get_clean();\n }//end if\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test setting file builders. | public function testSetFileBuilders( $builder )
{
$this->manager->setFileBuilder( $builder );
$this->assertNotNull( $this->manager->getFileBuilder() );
$this->assertInstanceOf( 'Slicer\\Contract\\ISlicerFileBuilder', $this->manager->getFileBuilder() );
} | [
"public function testFileSettings() {\n $config = $this->config('file.settings');\n $this->assertSame('textfield', $config->get('description.type'));\n $this->assertSame(128, $config->get('description.length'));\n $this->assertSame('sites/default/files/icons', $config->get('icon.directory'));\n $this->assertConfigSchema(\\Drupal::service('config.typed'), 'file.settings', $config->get());\n }",
"private function _setTestDataFiles(){\n foreach( $this->_testDataPaths as $environment => $path ){\n $fileScanner = new FileScanner($path);\n $testFiles = $fileScanner->getFilesInOneDimensionalArray();\n $this->_testFiles[$environment] = $testFiles;\n }\n }",
"public function settingFileWrite() {\r\n\t\t$DB\t\t=\tSetting::query();\r\n\t\t$list\t=\t$DB->orderBy('key','ASC')->get(array('key','value'))->toArray();\r\n\t\t\r\n $file = SETTING_FILE_PATH;\r\n\t\t$settingfile = '<?php ' . \"\\n\";\r\n\t\tforeach($list as $value){\r\n\t\t\t$val\t\t =\t str_replace('\"',\"'\",$value['value']);\r\n\t\t\t/* if($value['key']=='Reading.records_per_page' || $value['key']=='Site.debug'){\r\n\t\t\t\t$settingfile .= '$app->make('.'\"config\"'.')->set(\"'.$value['key'].'\", '.$val.');' . \"\\n\"; \r\n\t\t\t}else{\r\n\t\t\t\t$settingfile .= '$app->make('.'\"config\"'.')->set(\"'.$value['key'].'\", \"'.$val.'\");' . \"\\n\"; \r\n\t\t\t} */\r\n\t\t\t\r\n\t\t\t$settingfile .= 'config::set(\"'.$value['key'].'\", \"'.$val.'\");' . \"\\n\"; \r\n\t\t\t\r\n\t\t}\r\n\t\t$bytes_written = File::put($file, $settingfile);\r\n\t\tif ($bytes_written === false)\r\n\t\t{\r\n\t\t\tdie(\"Error writing to file\");\r\n\t\t}\r\n\t}",
"protected function createBehatConfig()\n {\n $behatConfig = file_get_contents(dirname(__FILE__) . \"/templates/behat_config.txt\");\n $behatConfig = str_replace(\"{testPath}\", $this->testPath, $behatConfig);\n\n $this->createFile('app/../behat.yml', $behatConfig);\n }",
"public function setTestFiles()\n {\n return $this->setupTestFiles();\n }",
"private function buildTestEnv()\n {\n $fs = new Filesystem();\n \n \n if ($fs->exists(PHPUNIT_WEBROOT)) {\n $fs->remove(PHPUNIT_WEBROOT);\n } else {\n \n $fs->mkdir(PHPUNIT_WEBROOT, 0777);\n }\n \n \n // Create needed directories\n @$fs->mkdir(PHPUNIT_ROOT . '/resources/files/', 0777);\n @$fs->mkdir(PHPUNIT_ROOT . '/resources/translations/', 0777);\n @$fs->mkdir(PHPUNIT_WEBROOT . '/app/cache/', 0777);\n @$fs->mkdir(PHPUNIT_WEBROOT . '/app/config/', 0777);\n @$fs->mkdir(PHPUNIT_WEBROOT . '/app/database/', 0777);\n @$fs->mkdir(PHPUNIT_WEBROOT . '/extensions/', 0777);\n @$fs->mkdir(PHPUNIT_WEBROOT . '/extensions/local', 0777);\n @$fs->mkdir(PHPUNIT_WEBROOT . '/files/', 0777);\n @$fs->mkdir(PHPUNIT_WEBROOT . '/theme/', 0777);\n\n \n // Mirror in required assets.\n $fs->mirror(TEST_ROOT . '/app/resources/', PHPUNIT_WEBROOT . '/app/resources/', null, ['override' => true]);\n $fs->mirror(TEST_ROOT . '/app/theme_defaults/', PHPUNIT_WEBROOT . '/app/theme_defaults/', null, ['override' => true]);\n $fs->mirror(TEST_ROOT . '/app/view/', PHPUNIT_WEBROOT . '/app/view/', null, ['override' => true]);\n \n \n // System link extension to local\n $fs->symlink(BOOKME_EXTENSION_PATH,PHPUNIT_WEBROOT.'/extensions/local/icomefromthenet/bookme',false);\n \n \n // Build a clean bolt database\n $oDatabase = $this->getBoltDatabaseConnection();\n $oNow = $this->getTestDate($oDatabase);\n $aTableNames = $this->getDatabaseTableList();\n \n $this->buildTestDatabase($oDatabase, $aTableNames, $oNow);\n \n \n // Copy in config files\n foreach ($this->configs as $config) {\n $fs->copy($config, PHPUNIT_WEBROOT . '/app/config/' . basename($config), true);\n }\n \n\n // Copy in the theme\n $name = basename($this->theme);\n $fs->mirror($this->theme, PHPUNIT_WEBROOT . '/theme/' . $name);\n\n\n // done run as create folders and worng dir, we set paths when make the app\n // Set the theme name in config.yml\n //system('php ' . NUT_PATH . ' config:set theme ' . $name);\n\n // Empty the cache\n //system('php ' . NUT_PATH . ' cache:clear');\n \n \n }",
"public function test_get_config_file_contents_with_single_run() {\n\n $mockbuilder = $this->getMockBuilder('behat_config_util');\n $mockbuilder->setMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_default_theme', 'get_theme_config'));\n\n $behatconfigutil = $mockbuilder->getMock();\n\n $behatconfigutil = $this->get_behat_config_util($behatconfigutil);\n $config = $behatconfigutil->get_config_file_contents($this->corefeatures, $this->corecontexts);\n\n // Two suites should be present.\n $suites = $config['default']['suites'];\n $this->assertCount(3, $suites);\n\n // Check features.\n foreach ($this->featurepaths as $themename => $paths) {\n $this->assertCount(count($paths), $suites[$themename]['paths']);\n\n foreach ($paths as $key => $feature) {\n $this->assertContains($feature, $suites[$themename]['paths'][$key]);\n }\n }\n\n // Check contexts.\n foreach ($this->contextspath as $themename => $paths) {\n $this->assertCount(count($paths), $suites[$themename]['contexts']);\n\n foreach ($paths as $key => $context) {\n $this->assertTrue(in_array($context, $suites[$themename]['contexts']));\n }\n }\n\n // There are 7 step definitions.\n $this->assertCount(7, $config['default']['extensions']['Moodle\\BehatExtension']['steps_definitions']);\n }",
"public function testWebformSettingsFiles() {\n $this->drupalLogin($this->rootUser);\n\n // Create three test images.\n /** @var \\Drupal\\file\\FileInterface[] $images */\n $images = $this->drupalGetTestFiles('image');\n $images = array_slice($images, 0, 5);\n foreach ($images as $index => $image_file) {\n $images[$index] = File::create((array) $image_file);\n $images[$index]->save();\n }\n\n // Check that all images are temporary.\n $this->assertTrue($images[0]->isTemporary());\n $this->assertTrue($images[1]->isTemporary());\n $this->assertTrue($images[2]->isTemporary());\n\n // Upload the first image.\n $edit = [\n 'description[value]' => '<img data-entity-type=\"file\" data-entity-uuid=\"' . $images[0]->uuid() . '\"/>',\n ];\n $this->drupalPostForm('/admin/structure/webform/manage/contact/settings', $edit, t('Save'));\n $this->reloadImages($images);\n\n // Check that first image is not temporary.\n $this->assertFalse($images[0]->isTemporary());\n $this->assertTrue($images[1]->isTemporary());\n $this->assertTrue($images[2]->isTemporary());\n\n // Check create first image file usage.\n $this->assertIdentical(['editor' => ['webform' => ['contact' => '1']]], $this->fileUsage->listUsage($images[0]), 'The file has 1 usage.');\n\n // Upload the second image.\n $edit = [\n 'description[value]' => '<img data-entity-type=\"file\" data-entity-uuid=\"' . $images[0]->uuid() . '\"/><img data-entity-type=\"file\" data-entity-uuid=\"' . $images[1]->uuid() . '\"/>',\n ];\n $this->drupalPostForm('/admin/structure/webform/manage/contact/settings', $edit, t('Save'));\n $this->reloadImages($images);\n\n // Check that first and second image are not temporary.\n $this->assertFalse($images[0]->isTemporary());\n $this->assertFalse($images[1]->isTemporary());\n $this->assertTrue($images[2]->isTemporary());\n\n // Check first and second image file usage.\n $this->assertIdentical(['editor' => ['webform' => ['contact' => '1']]], $this->fileUsage->listUsage($images[0]), 'The file has 1 usage.');\n $this->assertIdentical(['editor' => ['webform' => ['contact' => '1']]], $this->fileUsage->listUsage($images[1]), 'The file has 1 usage.');\n\n // Remove the first image.\n $edit = [\n 'description[value]' => '<img data-entity-type=\"file\" data-entity-uuid=\"' . $images[1]->uuid() . '\"/>',\n ];\n $this->drupalPostForm('/admin/structure/webform/manage/contact/settings', $edit, t('Save'));\n $this->reloadImages($images);\n\n // Check that first is temporary and second image is not temporary.\n $this->assertTrue($images[0]->isTemporary());\n $this->assertFalse($images[1]->isTemporary());\n $this->assertTrue($images[2]->isTemporary());\n\n // Check first and second image file usage.\n $this->assertIdentical([], $this->fileUsage->listUsage($images[0]), 'The file has 0 usage.');\n $this->assertIdentical(['editor' => ['webform' => ['contact' => '1']]], $this->fileUsage->listUsage($images[1]), 'The file has 1 usage.');\n\n // Set all files back to temporary.\n $edit = [\n 'description[value]' => '',\n ];\n $this->drupalPostForm('/admin/structure/webform/manage/contact/settings', $edit, t('Save'));\n $this->reloadImages($images);\n\n // Check that first and second image are temporary.\n $this->assertTrue($images[0]->isTemporary());\n $this->assertTrue($images[1]->isTemporary());\n $this->assertTrue($images[2]->isTemporary());\n\n // Stop marking unused files as temporary.\n \\Drupal::configFactory()->getEditable('webform.settings')\n ->set('html_editor.make_unused_managed_files_temporary', FALSE)\n ->save();\n $this->assertTrue($images[0]->isTemporary());\n\n // Check uploaded file is NOT temporary.\n $this->assertTrue($images[0]->isTemporary());\n $edit = [\n 'description[value]' => '<img data-entity-type=\"file\" data-entity-uuid=\"' . $images[0]->uuid() . '\"/>',\n ];\n $this->drupalPostForm('/admin/structure/webform/manage/contact/settings', $edit, t('Save'));\n $this->reloadImages($images);\n $this->assertFalse($images[0]->isTemporary());\n\n // Check unused file is NOT temporary.\n $edit = [\n 'description[value]' => '',\n ];\n $this->drupalPostForm('/admin/structure/webform/manage/contact/settings', $edit, t('Save'));\n $this->reloadImages($images);\n $this->assertFalse($images[0]->isTemporary());\n\n // Start marking unused files as temporary.\n \\Drupal::configFactory()->getEditable('webform.settings')\n ->set('html_editor.make_unused_managed_files_temporary', TRUE)\n ->save();\n\n $edit = [\n 'description[value]' => '<img data-entity-type=\"file\" data-entity-uuid=\"' . $images[0]->uuid() . '\"/>',\n ];\n $this->drupalPostForm('/admin/structure/webform/manage/contact/settings', $edit, t('Save'));\n $this->reloadImages($images);\n\n // Check that upload file is not temporary.\n $this->assertFalse($images[0]->isTemporary());\n\n // Delete the webform.\n Webform::load('contact')->delete();\n $this->reloadImages($images);\n\n // Check that file is temporary after the webform is deleted.\n $this->assertTrue($images[0]->isTemporary());\n }",
"public function test_Settings() {\n $config = new Config_File();\n $config['abc'] = 10;\n $config->setPath('/tmp/abc.xml');\n\n $this->assertType('Q\\Config_File', $config);\n $this->assertEquals('/tmp/abc.xml', (string)$config->getPath());\n $this->assertEquals(array('abc'=>10), (array)$config); \n }",
"function create_settings_file()\n\t{\n\t\t$settings = array(\n\t\t\t'db_name' => $this->sets['db_name'],\n\t\t\t'db_pass' => $this->sets['db_pass'],\n\t\t\t'db_user' => $this->sets['db_user'],\n\t\t\t'db_host' => $this->sets['db_host'],\n\t\t\t'db_port' => $this->sets['db_port'],\n\t\t\t'db_socket' => $this->sets['db_socket'],\n\t\t\t'dbtype' => $this->sets['dbtype'],\n\t\t\t'installed' => $this->sets['installed'],\n\t\t\t'admin_email' => $this->sets['admin_email']\n\t\t\t);\n\t\t\t\t\n\t\t$file = \"<?php\nif (!defined('PDNSADMIN')) {\n header('HTTP/1.0 403 Forbidden');\n die;\n}\n\n\\$set = array();\n\n\";\n\t\tforeach ($settings as $set => $val)\n\t\t{\n\t\t\t$file .= \"\\$set['$set'] = '\" . str_replace(array('\\\\', '\\''), array('\\\\\\\\', '\\\\\\''), $val) . \"';\\n\";\n\t\t}\n\n\t\t$file .= '?' . '>';\n\t\treturn $file;\n\t}",
"public function generateSettingsFile()\n {\n /**\n * @var [] $allData array\n * @var string $fileName settings file name\n */\n $allData = [];\n\n //needed for installer app's CSS generation.\n try {\n /**\n * Get data and push to $allData array\n */\n $db = $this->getService('db');\n $query = $db->table('module_simplesetting')\n ->leftJoin('structure_elements', 'module_simplesetting.id', '=', 'structure_elements.id')\n ->leftJoin('module_language', 'module_simplesetting.id', '=', 'module_language.id')\n ->select('structureName', 'value');\n\n if ($querySettings = $query->get()) {\n foreach ($querySettings as $setting) {\n $allData[$setting['structureName']] = $setting['value'];\n }\n $this->settingsList = $allData;\n }\n $this->getService('PathsManager')->ensureDirectory($this->cachePath);\n\n /**\n * Create cache files with settings data\n */\n $filePath = $this->cachePath . $this->fileName;\n $text = $this->generateSettingsText($allData);\n file_put_contents($filePath, $text);\n } catch (Exception $exception) {\n\n }\n }",
"public function testWrite()\n {\n $file1 = $this->createTempFile();\n $file2 = $this->createTempFile();\n\n file_put_contents($file1, '<?php return array(\"foo\" => \"bar\");');\n file_put_contents($file2, '<?php return array(\"baz\" => \"bay\");');\n\n $this->config->read($file1);\n $this->config->read($file2);\n\n $this->config['foo'] = 'test1';\n $this->config['baz'] = 'test2';\n\n $returned = $this->config->write();\n $this->assertSame(\n $returned,\n $this->config,\n 'write() does not implement a fluent interface'\n );\n\n $this->config = new Phergie_Config;\n $this->config->read($file1);\n $this->config->read($file2);\n\n $this->assertEquals('test1', $this->config['foo']);\n $this->assertEquals('test2', $this->config['baz']);\n }",
"public function testGetSupplementFiles()\n {\n }",
"public function buildPHPUnitConfigurationFile()\n {\n if ( ~$this->mask & self::MODE_TESTS )\n {\n return;\n }\n\n $this->log( 'Creating phpunit configuration file.' );\n\n $dom = new DOMDocument( '1.0', 'utf-8' );\n $dom->formatOutput = true;\n\n $baseDir = getcwd();\n $filter = $dom->createElement( 'filter' );\n $blacklist = $dom->createElement( 'blacklist' );\n\n /* PHPUnit docs says we should either use whitelist or blacklist ( if a whitelist exists, the blacklsit will be ignored )\n * Since whitelisting only works on source files containing classes, we base this on blacklisting\n */\n /*\n $whitelist = $dom->createElement( 'whitelist' );\n $autoloadArray = @include 'autoload/ezp_kernel.php';\n foreach ( $autoloadArray as $class => $filename )\n {\n $file = $dom->createElement( 'file', $baseDir . DIRECTORY_SEPARATOR . $filename );\n $whitelist->appendChild($file);\n }\n $filter->appendChild($whitelist);\n */\n\n //Blacklist tests in extension/\n $extensionDir = $this->options->basePath . '/extension';\n\n if ( file_exists( $extensionDir ) )\n {\n foreach ( scandir( $extensionDir ) as $file )\n {\n if ( ( $file === '.' ) || ( $file === '..' ) )\n continue;\n\n $testDirectory = \"$extensionDir/$file/tests\";\n if ( is_dir( $testDirectory ) )\n {\n $blacklist->appendChild( $dom->createElement( 'directory', $testDirectory ) );\n }\n }\n }\n\n $blacklist->appendChild( $dom->createElement( 'directory', \"$baseDir/tests\" ) );\n $filter->appendChild( $blacklist );\n $root = $dom->createElement( 'phpunit' );\n $root->appendChild( $filter );\n $dom->appendChild( $root );\n\n file_put_contents( \"$baseDir/tests/phpunit.xml\", $dom->saveXML() );\n\n return $dom;\n }",
"function create_settings_file()\n\t{\n\t\t$settings = array(\n\t\t\t'db_host' => $this->sets['db_host'],\n\t\t\t'db_name' => $this->sets['db_name'],\n\t\t\t'db_pass' => $this->sets['db_pass'],\n\t\t\t'db_port' => $this->sets['db_port'],\n\t\t\t'db_socket' => $this->sets['db_socket'],\n\t\t\t'db_user' => $this->sets['db_user'],\n\t\t\t'dbtype' => $this->sets['dbtype'],\n\t\t\t'prefix' => $this->sets['prefix'],\n\t\t\t'installed' => $this->sets['installed'],\n\t\t\t'admin_email' => $this->sets['admin_email']\n\t\t\t);\n\t\t\t\t\n\t\t$file = \"<?php\\n\\$set = array();\\n\\nif (!defined('QUICKSILVERFORUMS')) {\\n header('HTTP/1.0 403 Forbidden');\\n die;\\n}\\n\\n\";\n\n\t\tforeach ($settings as $set => $val)\n\t\t{\n\t\t\t$file .= \"\\$set['$set'] = '\" . str_replace(array('\\\\', '\\''), array('\\\\\\\\', '\\\\\\''), $val) . \"';\\n\";\n\t\t}\n\n\t\t$file .= '?' . '>';\n\t\treturn $file;\n\t}",
"public function testFileSettings() {\n $migration = entity_load('migration', 'd6_file_settings');\n $dumps = array(\n drupal_get_path('module', 'migrate') . '/lib/Drupal/migrate/Tests/Dump/Drupal6FileSettings.php',\n );\n $this->prepare($migration, $dumps);\n $executable = new MigrateExecutable($migration, new MigrateMessage());\n $executable->import();\n $config = \\Drupal::config('file.settings');\n $this->assertIdentical($config->get('description.type'), 'textfield');\n $this->assertIdentical($config->get('description.length'), 128);\n $this->assertIdentical($config->get('icon.directory'), 'sites/default/files/icons');\n }",
"function settingsFile() {\n \n // Assign properties to variables\n $company = self::$company;\n $domain = self::$domain;\n $support = self::$support;\n $host = self::$host;\n $name = self::$name;\n $user = self::$user;\n $pass = self::$pass;\n \n \n // Write the settings.json file\n $in\t\t\t= __DIR__.'/settings/settings.json';\n\t $make\t\t= fopen($in, 'w') or die(\"<b>Error creating settings file! Are settings folder permissions 777?</b><br>\");\n\t $inject\t= \"\n\t \n {\n\n \\\"company-name\\\" : \\\"$company\\\",\n \\\"domain-name\\\" : \\\"$domain\\\",\n \\\"support-email\\\" : \\\"$support\\\",\n\n \\\"db-host\\\" : \\\"$host\\\",\n \\\"db-name\\\" : \\\"$name\\\",\n \\\"db-user\\\" : \\\"$user\\\",\n \\\"db-pass\\\" : \\\"$pass\\\"\n \n }\n\t \n \";\n\t\n\t fwrite($make, $inject);\n\t fclose($make);\n\t \n\t return true;\n \n }",
"private function __setupConfigFiles() {\n\t\t$this->__logMessage('Setting up config files');\n\t\t$this->__pushLogIndent();\n\n\t\t$configPath = '../../../app/Config/';\n\n\t\t$__settings = $this->__settings;\n\n\t\t// ... Not that I'm OCD or anything\n\t\tasort($__settings);\n\n\t\t// Create each of the config files\n\t\tforeach ($__settings as $settingName => $settingData) {\n\t\t\t// First check for dev/production templates\n\t\t\t$templateFilePath = makeAbsolutePath(\"../Settings/$settingName.{$this->__environmentType}.template\");\n\t\t\tif (!file_exists($templateFilePath)) {\n\t\t\t\t// Fall back to the regular template\n\t\t\t\t$templateFilePath = makeAbsolutePath(\"../Settings/$settingName.template\");\n\n\t\t\t\tif (!file_exists($templateFilePath)) {\n\t\t\t\t\t$fullFilePath = makeAbsolutePath(\"$configPath$settingName.php\");\n\t\t\t\t\tif (file_exists($fullFilePath)) {\n\t\t\t\t\t\t$this->__logMessage(\"Deleting __settings file at $fullFilePath because we couldn't find a matching template\");\n\t\t\t\t\t\tunlink($fullFilePath);\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$currentContents = file_get_contents($templateFilePath);\n\t\t\t$newContents = $this->__replaceFields($currentContents, $settingData);\n\n\t\t\tif (file_put_contents(\"$configPath$settingName.php\", $newContents) !== false) {\n\t\t\t\t$this->__logMessage(\"Created $settingName.php from template $templateFilePath\");\n\t\t\t} else {\n\t\t\t\t$this->__logMessage(\"Failed to create $settingName.php\");\n\t\t\t}\n\t\t}\n\n\t\t$this->__popLogIndent();\n\t}",
"private function makeUserSettings()\n\t\t{\n\n\t\t\tif( FileSystem::exists( self::fileLocation( \"settings.json\") ) == false )\n\t\t\t\tthrow new \\Error(\"file does not exist: \" . self::fileLocation( \"settings.json\" ) );\n\n\t\t\tif( Debug::isCMD() )\n\t\t\t\tDebug::message(\"created user_settings.json using default settings value \" );\n\n\t\t\t$data = FileSystem::read( self::fileLocation( \"settings.json\") );\n\t\t\tFileSystem::write( self::fileLocation(), $data );\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the postInstall method. | public function testPostInstall()
{
$this->markTestIncomplete('@TODO: Write postInstall() tests.Probably hard to test as written.');
} | [
"public function post_install() {}",
"public function postInstallActions(): void\n {\n }",
"public function postInstallActions():void;",
"public function afterInstall()\n\t{}",
"protected function onPostInstall(){\n $this->aTx['storage']->addCommand(\n 'pkg/onPostInstall',\n new AMI_Tx_Cmd_Args(get_object_vars($this))\n );\n }",
"public function onAfterInstall();",
"protected function _postUninstall() {\n }",
"protected function updateAfterInstall() {}",
"protected function onInstallInternal(): void {}",
"public function onBeforeInstall();",
"public function postPackageInstall()\n {\n return $this->postPackageInstall;\n }",
"public function afterInstallation()\n {\n }",
"abstract public function onInstall();",
"public function onPostCmdEvent() {\n if ($this->isToRunInstallation) {\n $this->install();\n }\n }",
"public function onBeforeUninstall();",
"public function InstallFinished() {}",
"function custom_config_postinstall_callback() {\n // Call function to run post install routines.\n custom_config_run_postinstall_hooks();\n}",
"function postInstallEntryPoint(EntryPoint $entryPoint);",
"public function preInstall()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start transactions on attached entity sets | public function startTransaction()
{
foreach ($this->attachedEntitySets as $entitySet) {
$this->pendingEntitySets[] = $entitySet;
$entitySet->startTransaction();
}
} | [
"public function beginTransaction()\n {\n $this->em->beginTransaction();\n }",
"public function commit()\n {\n foreach ($this->pendingEntitySets as $entitySet) {\n $entitySet->commit();\n }\n\n $this->pendingEntitySets = [];\n }",
"public function startIsolation()\n {\n $container = $this->getContainer();\n\n // Isolate Database\n foreach ($container->getParameter('doctrine.connections') as $name => $id) {\n if (!isset($this->isolatedConnections[$name]) || null === $this->isolatedConnections[$name]) {\n $this->isolatedConnections[$name] = $container->get($id);\n } else {\n $this->isolatedConnections[$name]->rollback();\n }\n\n $this->isolatedConnections[$name]->beginTransaction();\n }\n }",
"public function persistEntities() {\n\t\tforeach ($this->entityManager->getUnitOfWork()->getIdentityMap() as $className => $entities) {\n\t\t\tif ($className === $this->entityClassName) {\n\t\t\t\tforeach ($entities as $entityToPersist) {\n\t\t\t\t\t$this->entityManager->flush($entityToPersist);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"public static function startTransaction() {\n\t\t\tdb(static::$_database)->startTransaction();\n\t\t}",
"public function beginDatabaseTransaction(): void\n {\n $this->initializeTestDatabaseTransactions();\n }",
"public function startTransaction();",
"public function begin()\n {\n if (!$this->manager->inTransaction()) {\n $this->manager->begin();\n return;\n }\n parent::begin();\n }",
"public function setUp()\n {\n $this->client = parent::createClient();\n\n $this->em = $this->client->getContainer()->get('doctrine.orm.entity_manager');\n $this->em->getConnection()->beginTransaction();\n\n $this->emMain = $this->client->getContainer()->get('doctrine.orm.main_entity_manager');\n $this->emMain->getConnection()->beginTransaction();\n\n $this->emRecou = $this->client->getContainer()->get('doctrine.orm.recou_entity_manager');\n $this->emRecou->getConnection()->beginTransaction();\n }",
"public function persistEntities()\n {\n foreach ($this->entityManager->getUnitOfWork()->getIdentityMap() as $className => $entities) {\n if ($className === $this->entityClassName) {\n foreach ($entities as $entityToPersist) {\n $this->entityManager->flush($entityToPersist);\n }\n $this->emitRepositoryObjectsPersisted();\n break;\n }\n }\n }",
"public function startTransaction() {\n \t$this->_transaction_depth++;\n \t\n \tif( $this->_transaction_depth == 1 ) {\n \t\t$this->_start_transaction();\n \t}\n }",
"public function startIsolation()\n {\n if (null === $this->connection) {\n $this->connection = $this->getContainer()->get('doctrine.dbal.default_connection');\n } else {\n $this->connection->setEventManager(\n $this->getContainer()->get('doctrine.dbal.default_connection')->getEventManager()\n );\n $this->getContainer()->set('doctrine.dbal.default_connection', $this->connection);\n }\n\n if (false === $this->requested) {\n $this->connection->beginTransaction();\n }\n }",
"public function testSeveralRunningTransactionStart()\n\t{\n\t\t$db = new Connection;\n\t\t$db->open('localhost:8184', 'graph', $this->username, $this->password);\n\t\t$db->transactionStart();\n\t\t$result = $db->transactionStart();\n\t\t$this->assertFalse($result, 'Failed to return false with an other started transaction');\n\t}",
"public function beginTransaction() {\n\n // Increase the transaction depth\n $this->transactionDepth++;\n\n // If not in transaction, start a transaction\n if ($this->transactionDepth == 1) {\n $this->query(\"BEGIN TRANSACTION\",);\n } else {\n $this->query(\"SAVE TRANSACTION SAVEPOINT\" . $this->transactionDepth,);\n }\n\n }",
"private function beginTransaction()\n\t{\n\t\tif (self::TRANSACTION) {\n\t\t\t$this->database->beginTransaction();\n\t\t}\n\t}",
"protected function beginTrans(){\r\n $this->transaction=$this->dba->beginTransaction();\r\n $this->isTransactionBegun=true;\r\n }",
"public function begin_transaction() {\n\t\t$this->execute('START TRANSACTION;');\n\t}",
"public function flush()\n {\n foreach ($this->_collections as $key => $coll) {\n $coll->takeSnapshot();\n }\n foreach ($this->_tables as $table) {\n $table->setAttribute(Doctrine::ATTR_LOAD_REFERENCES, true);\n }\n }",
"public function beginTransaction()\n {\n self::$_transactionLevel++;\n \n if (self::$_transactionLevel == 1) {\n $this->getConnection()->beginTransaction();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO:: Change it DeleteFromTable($TableName,$colname,$colvalue) | public function DeleteFromTable($TableName, $colname, $colvalue) {
$out = "";
foreach ($colvalue as $key => $value) {
$value = $this -> RealEscapeString($value);
$cond = $colname[$key] . "=" . $value;
$out = empty($out) ? " WHERE " . $cond : $out . " AND " . $cond;
}
$sqlstr="DELETE FROM ".$TableName.$out;
$ret = mysqli_query($this -> dbcon, $sqlstr);
return $ret;
} | [
"function deleteFromWhere($table, $column, $value){\n\t\tglobal $con;\n\t\t$sql = \"DELETE FROM $table WHERE $column=$value\";\n\t\tmysqli_query($con,$sql);\n\t}",
"public function deleteByColName($fieldname, $fieldvalue);",
"function delete($table, $column, $value){\n\n\t\t$handler = $this->getHandler();\n\n\t\t$sql = \"DELETE FROM \".$table.\" WHERE \".$column.\"=\\\"\".$value.\"\\\"\";\n\t\t$handler->query($sql);\n\n\t\t$handler = null;\n\n\t}",
"protected function delete_from_db($table, $name_param, $value_param)\n {\n $query = 'DELETE FROM $table ';\n $sth = $this->dbh->query($query);\n }",
"function delete($conn, $table, $column, $row_value) {\r\n\t\t// $conn = $conn always\r\n\t\t// $table = the table of the row\r\n\t\t// $column = the columns of the table in wich we give the $row_value to delete the row of that value\r\n\t\t// $row_value = the value of the row wich wanna be deleted\r\n\r\n\t\t$column_type = column_type($conn, $table, $column);\r\n\r\n\t\t$stmt = $conn->prepare(\"DELETE FROM $table WHERE $column = ?\");\r\n\t\t$stmt->bind_param($column_type, $row_value);\r\n\t\t$stmt->execute();\r\n\t\t$stmt->close();\r\n\t}",
"function delete($table, $where=''){\n\t\t$sql = \"DELETE FROM $table $where\";\n\t\t$this->exec($sql);\n\t}",
"public function delete_record($id_name,$id_value,$table_name)\n {\n $this->CI->db->delete($table_name, array($id_name => $id_value)); \n }",
"function deleteDataTable($tbl){\n\tDatabase::deleteData($tbl);\n\tactionLog(\"ha eliminato i record di $tbl\", 4);\n}",
"public function delete_record($table, $field, $value){\n $query = \"DELETE FROM ? WHERE ? = ?\";\n $stmt = $this->connection->stmt_init();\n $stmt->prepate($query);\n $stmt->bind_param($table, $field, $value);\n $stmt->execute();\n }",
"function delete_data($params) {\n\t\t$this->db->query(\"DELETE FROM \" . $params['table'] . \" WHERE \" . $params['field'] . \" = \" . $params['value']);\n\t}",
"function dbDelete($table,$identity){\n\t\t$sql = \"DELETE FROM \".$table.\" WHERE \".$identity;\n\t\treturn dbQuery($sql);\n\t}",
"public function exec_DELETEquery($table, $where);",
"function dbRemoveEntry($table, $idName, $idValue, $idName2 = null, $idValue2 = null)\n{\n $sql = \"DELETE FROM $table \";\n $sql .= \"WHERE $idName = :$idName \";\n\n if ($idName2 != null && $idValue2 != null){\n $sql .= \"AND $idName2 = :$idName2 \";\n }\n\n $sql .= \"LIMIT 1;\";\n\n $proxyFields = array((\":\" . $idName)=>$idValue);\n\n if ($idName2 != null){\n $proxyFields[':' . $idName2] = $idValue2;\n }\n\n $result = db_query($sql, $proxyFields);\n\n return ($result != false);\n}",
"function Data_Delete($tableName, $finder) {\n\tglobal $Connection;\n\t$delete = $finder->getPrepared();\n\t\n\t$query = 'DELETE FROM `'.$tableName.'` '.$delete[1];\n\t\n\tif ($prepared = $Connection['Remove']->prepare($query)) {\n\t}else{\n\t\techo Error('Data', $Connection['Remove']->error);\n\t\treturn false;\n\t}\n\n\tcall_user_func_array(array($prepared, 'bind_param'), $delete[0]);\n\t$prepared->execute();\n\t$prepared->Close();\n\n\treturn true;\n}",
"public function deleteTable() {\n\t}",
"public function deleteRow($postArray,$editId,$tableName)\n{\n $retString='';\n \n $retString=$this->deletePreProcessing($postArray,$editId);\n \n $sql=\"delete from $tableName where id=$editId\";\n \n $ret=$this->updateTableData($sql,false);\n \n}",
"function zen_db_delete($table, $parameters) {\r\n global $db;\r\n\r\n $db->Execute('delete from ' . $table . ' where ' . $parameters);\r\n\r\n return mysql_affected_rows();\r\n}",
"public function delete() {\n $pk = $this->model->getPrimaryKey();\n $result = $this->select($pk, 'id')\n ->getDataSource();\n $tablenames = $this->model->getAllTableNames();\n foreach ($result as $row) {\n foreach ($tablenames as $tablename) {\n PerfORMController::getConnection()->query(\"DELETE FROM %n\", $tablename, 'where %n = %i', $pk, $row->{$pk});\n PerfORMController::addSql(dibi::$sql);\n }\n }\n }",
"public function delete($tableName, $keyWhere, $valueWhere) {\n $query = \"DELETE FROM \" . $tableName . \" WHERE \" . $keyWhere . \" = \" . $valueWhere;\n $queryact = $this->connection->query($query);\n\n if (!$this->connection->affected_rows) {\n $result['status'] = 0;\n $result['message'] = \"Query failed: (\" . $this->connection->errno . \") \" . $this->connection->error;\n }else{\n $result['status'] = 1;\n $result['message'] = \"Delete successful!\";\n }\n return $result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'validateUng' | protected function validateUngRequest($ung = null)
{
$resourcePath = '/validate/ung';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// body params
$_tempBody = null;
if (isset($ung)) {
$_tempBody = $ung;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'],
['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json', 'application/xml', 'text/xml', 'application/_*+xml']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'POST',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function signupValidation(Request $request);",
"public function buildRequestValidatorSpec()\n {\n // TODO figure out path to get this to recognise properly\n // return new Validation(Validation::VALIDATE_QUERY_PARAMS);\n return new NoValidation();\n }",
"abstract protected function _buildRefundRequest(Request $request);",
"public function invalidRequest()\n {\n $response = array('success' => false, 'message' => 'Invalid Request');\n return $response;\n }",
"abstract protected function validateRequest($Request);",
"public function essUnavailabilityCreateRequest($employee_id, $unavailability, string $contentType = self::contentTypes['essUnavailabilityCreate'][0])\n {\n\n // verify the required parameter 'employee_id' is set\n if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $employee_id when calling essUnavailabilityCreate'\n );\n }\n\n // verify the required parameter 'unavailability' is set\n if ($unavailability === null || (is_array($unavailability) && count($unavailability) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $unavailability when calling essUnavailabilityCreate'\n );\n }\n\n\n $resourcePath = '/api/v2/ess/{employeeId}/unavailability';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($employee_id !== null) {\n $resourcePath = str_replace(\n '{' . 'employeeId' . '}',\n ObjectSerializer::toPathValue($employee_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml', ],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (isset($unavailability)) {\n if (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the body\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unavailability));\n } else {\n $httpBody = $unavailability;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"abstract protected function validateRequestAttributes();",
"public function doctorSignUpValidation(Request $request);",
"public function validateGetValidateResult();",
"public function testValidateVoucherInvalid()\n {\n $request = $this->call('POST', '/vouchers/validate', ['email' => 'mos.adebayo@gmail.com', 'voucher' => 'voucher']);\n $this->assertEquals(400, $request->status());\n }",
"public function testUnfilledMethod()\n {\n Request::foundation()->request->add(['name' => 'Budi', 'age' => 28]);\n\n $this->assertTrue(Input::unfilled('baz'));\n $this->assertFalse(Input::unfilled('name'));\n $this->assertFalse(Input::unfilled('name', 'name'));\n $this->assertTrue(Input::unfilled('name', 'baz', 'age'));\n }",
"public function validateBookDeleteRequest(Request $request)\n {\n $request->validate(BookModel::$deletRules);\n }",
"public function isValidRequest() {\n }",
"abstract protected function validateSettlementRequest(Request $request);",
"private function sendValidationRequest() {\n\n try {\n $response = $this->soapClient->checkVat(array(\n 'vatNumber' => $this->vatId['vatNumber'],\n 'countryCode' => $this->vatId['countryCode']\n ));\n\n return $response;\n }\n catch(\\SoapFault $e) {\n echo 'Error fetching SOAP results: ' . $e->faultstring;\n }\n }",
"private function initRequestValidator() {\n\t\t\t// language\n\t\t\t$this->rq->addAllowed('GET', 'lang', '', '/^[a-z]{1,7}$/', true);\n\t\t\t\n\t\t\t// project\n\t\t\t$this->rq->addAllowed('GET', 'project', '', '/^[a-z]{1,15}$/', true);\n\t\t\t\n\t\t\t// sort by\n\t\t\t$this->rq->addAllowed('GET', 'sort', 'name', '/^(name|entries|length)$/');\n\t\t\t\n\t\t\t$this->par = $this->rq->getParams();\n\t\t}",
"public function testInvalidRequest()\n {\n $response = $this->http->request('POST', 'canary.php', ['http_errors' => false]);\n $this->assertEquals($response->getStatusCode(), 400);\n\n $response = $this->http->request('POST', 'canary.php', ['http_errors' => false, 'form_params' => [ 'id' => '000000' ]]);\n $this->assertEquals($response->getStatusCode(), 400);\n\n $response = $this->http->request('POST', 'canary.php', ['http_errors' => false, 'form_params' => [ 'action' => 'off' ]]);\n $this->assertEquals($response->getStatusCode(), 400);\n\n $response = $this->http->request('POST', 'canary.php', ['http_errors' => false, 'form_params' => [ 'action' => 'nil', 'id' => '000000' ]]);\n $this->assertEquals($response->getStatusCode(), 400);\n }",
"private function validateRequestForCreateOrUpdate()\n {\n return request()->validate([\n 'name' => 'required|string|max:180',\n 'description' => 'required|string|max:180',\n 'image_url' => 'required|string|max:180',\n ]);\n }",
"public function unloadModelRequest()\n {\n\n $resourcePath = '/model';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires Bearer (JWT) authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('token');\n if ($apiKey !== null) {\n $queryParams['token'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of idProduit | public function setIdProduit($idProduit)
{
$this->idProduit = $idProduit;
return $this;
} | [
"public function setIdProduit($idProduit)\n {\n $this->idProduit = $idProduit;\n\n return $this;\n }",
"public function setId_produit($id_produit)\n {\n $this->id_produit = $id_produit;\n\n return $this;\n }",
"public function getId_produit()\n {\n return $this->id_produit;\n }",
"public function getIdProduit()\n {\n return $this->Id_produit;\n }",
"public function getIdProduit()\n {\n return $this->idProduit;\n }",
"public function getId_produit()\n {\n return $this->id_produit;\n }",
"public function getIdproduit()\n {\n return $this->idproduit;\n }",
"public function setId_provin($id_provin)\n {\n $this->id_provin = $id_provin;\n }",
"public function setId_proyecto($id_proyecto) {\n $this->id_proyecto = $id_proyecto;\n }",
"public function setIdproducto($idproducto){\n $this->idproducto = $idproducto;\n }",
"public function setId_produits($id_produits)\n{\n$this->id_produits = $id_produits;\n\nreturn $this;\n}",
"public function getIdProduk() {\r\n return idProduk;\r\n }",
"public function setIdProducto($id_producto)\n {\n $this->id_producto = $id_producto;\n }",
"public function setIdFamilleproduit($Id_familleproduit): self\n {\n $this->Id_familleproduit = $Id_familleproduit;\n\n return $this;\n }",
"public function setId($value) { $this->_id = $value; }",
"public function setIdProduct($idProduct){\n \t$this->idProduct = $idProduct;\n }",
"function setId_profesor($iid_profesor = '')\n {\n $this->iid_profesor = $iid_profesor;\n }",
"public function setId($value) { $this->id = $value;}",
"public function ajoutProduit()\n {\n\n $produit = New produit();\n $produit->uuid= Str::uuid();\n $produit->designation='pomme';\n $produit->description='passable';\n $produit->prix='300';\n $produit->like='500';\n $produit->pays_source='france';\n $produit->poids='450.10';\n $produit->save();\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the excludedAccountTarget property value. Users excluded from the simulation. | public function setExcludedAccountTarget(?AccountTargetContent $value): void {
$this->getBackingStore()->set('excludedAccountTarget', $value);
} | [
"public function setExcluded($exclude = true)\n {\n $this->exclude = $exclude;\n }",
"public function setExcludeTargets($val)\n {\n $this->_propDict[\"excludeTargets\"] = $val;\n return $this;\n }",
"public function setExcluded(?bool $exclude = true): void\n {\n $this->exclude = $exclude;\n }",
"public function setExcluded($value);",
"public function disable() {\n $this->changes['useraccountcontrol'] = $this->getData('useraccountcontrol') & ~DirectoryUAC::ADS_UF_ACCOUNT_DISABLE;\n }",
"function setExclude($exclude)\n\t{\n\t\t$this->excludeClasses = explode(\" \", $exclude);\n\t}",
"public function testExcludeAndRestrict()\n\t{\n\t\t$this->clearConfig();\n\t\t\n\t\t$debug = $this->getDefaultDebugConf();\n\t\t$debug->setFlag(OLPBlackbox_DebugConf::TARGETS_EXCLUDE, array('targeta'));\n\t\t$debug->setFlag(OLPBlackbox_DebugConf::TARGETS_RESTRICT, array('targeta1'));\n\t\t\n\t\tOLPBlackbox_Config::getInstance()->debug = $debug;\n\t\t\n\t\t/* @var $blackbox OLPBlackbox */\n\t\t$blackbox = $this->getBlackbox();\n\t\t\n\t\t$this->assertFalse($blackbox->getTargetLocation('targeta'));\n\t\t$this->assertTrue(is_array($blackbox->getTargetLocation('targeta1')));\n\t}",
"function disable($target = 'core');",
"public function setExcludedTemplates($excludedTemplates)\n {\n $this->excludedTemplates = $excludedTemplates;\n }",
"public function SetExcludedMonitoringUsers( $users ) {\n\t\t$this->_excluded_users = $users;\n\t\t$this->_plugin->SetGlobalSetting( 'excluded-users', esc_html( implode( ',', $this->_excluded_users ) ) );\n\t}",
"public static function excludedAccounts() {\n return array('scripty');\n }",
"public function getExcludedUser()\n {\n return $this->excludedUser;\n }",
"public function exclude($exclude) {\n\t\t$this->excludeTags = array_merge($this->excludeTags, SimpleSAML_Utilities::arrayize($exclude));\n\t}",
"public function set_inactive($target_user_name) {\r\n\t\t$this->db->where(\"user_name\", $target_user_name);\r\n\t\t$this->db->update(\"useraccount\", array(\"active\" => 0));\r\n\t\tif ($this->db->affected_rows() > 0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function setExcludedServices($excludedServices)\n {\n $this->excludedServices = $excludedServices;\n }",
"public function setExcludeAll(): void;",
"private function _disableAgentAndManagedAccounts(){\n // Do nothing if already disabled\n if($this->agent_status == Agent::STATUS_INACTIVE) return;\n\n // Update the status of the IG accounts owned by agent\n foreach($this->instagramUsers as $user){\n $user->activateAccountIfPossible();\n }\n\n $this->agent_status = Agent::STATUS_INACTIVE;\n $this->save(false);\n }",
"public function setExcludes($excludes)\n {\n $this->clearExcludes();\n $this->addExcludes($excludes);\n }",
"public function setExcludeArguments(array $excludeArguments) {\n\t\t$this->excludeArguments = $excludeArguments;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fun for save ambulance details// | public function saveAmbulaceDetails($data) {
extract($data);
//print_r($data);die();
$sql = "INSERT INTO ambulance_tab(ambulance_quantity,hosp_id,status)"
. "VALUES ('$ambulance_quantity','$Hospital_name','1')";
if ($this->db->query($sql)) {
return TRUE;
} else {
return FALSE;
}
} | [
"public function save(){\n\t\t$id \t\t\t= $this->in->get('aid', 0);\n\t\t$strAchName\t\t= $this->in->get('name');\n\t\t$strAchDescription = $this->in->get('description');\n\t\t#$strAchDescription = $this->in->get('description', '', 'raw'); // TinyMCE\t\n\t\t$intAchSortID\t\t= $this->in->get('sort_id', 99999999);\n\t\t$blnAchActive\t\t= $this->in->get('active_state', 1);\n\t\t$blnAchSpecial\t\t= $this->in->get('special_state', 1);\n\t\t$intAchPoints \t\t= $this->in->get('points', 10);\n\t\t$strAchIcon\t\t= $this->in->get('icon', 'default.svg');\n\t\t$arrAchIconColors = array();\n\t\t$strAchModule\t\t= $this->in->get('module');\n\t\t$fltAchDKP \t\t= $this->in->get('dkp', 0);\n\t\t$intMDKP \t\t= $this->in->getArray('mdkp2event', 'int');\n\t\t\n\t\tif ($strAchName == \"\" ){\n\t\t\t$this->core->message($this->user->lang('name'), $this->user->lang('missing_values'), 'red');\n\t\t\t$this->edit();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ($id){\n\t\t\t// get and upd EVENT\n\t\t\t$intEventID = $this->pdh->get('awards_achievements', 'event_id', array($id));\n\t\t\tif($this->pdh->put('event', 'update_event', array($intEventID, $strAchName, 0, ''))){\n\t\t\t\t// upd MDKP\n\t\t\t\tif($this->pdh->put('multidkp', 'add_multidkp2event', array($intEventID, $intMDKP))){\n\t\t\t\t\t// upd ACHIEVEMENT\n\t\t\t\t\t$blnResult = $this->pdh->put('awards_achievements', 'update', array(\n\t\t\t\t\t\t$id, $strAchName, $strAchDescription, $intAchSortID, $blnAchActive, $blnAchSpecial,\n\t\t\t\t\t\t$intAchPoints, $strAchIcon, $arrAchIconColors, $strAchModule, $fltAchDKP, $intEventID\n\t\t\t\t\t));\n\t\t\t\t} else { $blnResult = false; } // <-- if MDKP fail\n\t\t\t} else { $blnResult = false; } // <-- if EVENT fail\n\t\t} else {\n\t\t\t// add EVENT\n\t\t\t$intEventID = $this->pdh->put('event', 'add_event', array($strAchName, 0, ''));\n\t\t\tif($intEventID > 0){\n\t\t\t\t// add EVENT to MDKP\n\t\t\t\tif($this->pdh->put('multidkp', 'add_multidkp2event', array($intEventID, $intMDKP))){\n\t\t\t\t\t// add ACHIEVEMENT\n\t\t\t\t\t$blnResult = $this->pdh->put('awards_achievements', 'add', array(\n\t\t\t\t\t\t$strAchName, $strAchDescription, $blnAchActive, $blnAchSpecial,\n\t\t\t\t\t\t$intAchPoints, $strAchIcon, $arrAchIconColors, $strAchModule, $fltAchDKP, $intEventID\n\t\t\t\t\t));\n\t\t\t\t} else { $this->pdh->put('event', 'delete_event', array($intEventID)); } // <-- if MDKP fail, delete EVENT\n\t\t\t} else { $blnResult = false; } // <-- if EVENT fail\n\t\t}\n\t\t\n\t\tif ($blnResult){\n\t\t\t$this->pdh->process_hook_queue();\n\t\t\t$this->core->message(sprintf( $this->user->lang('aw_add_success'), $strAchName ), $this->user->lang('success'), 'green');\n\t\t} else {\n\t\t\t$this->core->message(sprintf( $this->user->lang('aw_add_nosuccess'), $strAchName ), $this->user->lang('error'), 'red');\n\t\t}\n\t\t\n\t\t$this->display();\n\t}",
"function saveInfoandAccount()\n{\n\t$app = Application::getInstance();\n\t$app->saveInfoandAccount();\t\n}",
"public function save_acs(){\n\t\t$data = array(\n\t\t\t'ac_name' => $this->input->post('ac_name'),\n\t\t\t'ac_cnic' => $this->input->post('ac_cnic'),\n\t\t\t'ac_password' => $this->input->post('ac_pass')\n\t\t);\n\t\t$this->Performance_appraisal_model->add_acs($data);\n\t\t$this->session->set_flashdata('success_ac', '<strong>Success !</strong> AC has been added successfully!');\n\t\tredirect('admin_dashboard/add_peos');\n\t}",
"private function _saveAgency()\n\t {\n\t\t$hash = sha1($this->_advert->city . $this->_advert->phone);\n\t\tif ($this->_exists(\"agencies\", $hash) === false && $this->_advert->person === \"agency\")\n\t\t {\n\t\t\t$this->_db->exec(\"INSERT INTO `agencies` SET \" .\n\t\t\t \"`city` = '\" . $this->_advert->city . \"', \" .\n\t\t\t \"`hash` = '\" . $hash . \"', \" .\n\t\t\t \"`name` = '\" . mb_strtoupper($this->_advert->name) . \"', \" .\n\t\t\t \"`phone` = '\" . $this->_advert->phone . \"'\"\n\t\t\t);\n\n\t\t\t$agency = [\n\t\t\t \"name\" => mb_strtoupper($this->_advert->name),\n\t\t\t \"phone\" => $this->_advert->phone,\n\t\t\t \"city\" => $this->_advert->city,\n\t\t\t];\n\n\t\t\t$cities = [\n\t\t\t \"Москва\",\n\t\t\t \"Санкт-Петербург\",\n\t\t\t \"Иркутск\",\n\t\t\t \"Красноярск\",\n\t\t\t];\n\n\t\t\tif (in_array(trim($this->_advert->city), $cities) === true)\n\t\t\t {\n\t\t\t\t$container = new Container(\"agency_send_sms\");\n\t\t\t\t$container->add(json_encode($agency));\n\t\t\t } //end if\n\n\t\t } //end if\n\n\t }",
"public function save_school_financial_aid_detail($school_financial_aid_detail);",
"private function saveToEzyAppointment()\n {\n }",
"public function saveData();",
"function savephysicalexam(){\n//\t\t$data[\"recept_id\"] = $_POST['recept_id'];\n\t\t$data[\"cons_id\"] = $_POST['cons_id'];\n//\t\t$data[\"patient_id\"] = $_POST['patient_id'];\n\t\t$data[\"content\"] = $_POST['content'];\n\t\t$this->crud_model->save_physical_exam_for_patient($data);\n\t\techo \"success\"; \n\t}",
"public function saveApartment()\r\n {\r\n $this->a_building_id = $this->oBuildingModel->getId($this->oData);\r\n $this->a_floor = $this->oData->getFloor();\r\n $this->a_cost = $this->oData->getCost();\r\n $this->a_rooms_count = $this->oData->getRoomsCount();\r\n $this->a_area = $this->oData->getArea();\r\n\r\n return $this->save();\r\n }",
"function saveInfo(){\n mysql_query(\"UPDATE special_committee_positions SET positionName='$this->positionName' WHERE id='$this->positionId'\") or die(mysql_error());\n mysql_query(\"UPDATE special_committee_positions SET committeeId='$this->committeeId' WHERE id='$this->positionId'\") or die(mysql_error());\n }",
"function saveVister()\n {\n \n }",
"public function save() {\n\t\t// If 'data' can not be decoded, it means it has been decoded already\n\t\t// and we should encode it again before saving it.\n\t\tif (isset($this->details['data']) && (is_array($this->details['data']) || json_decode($this->details['data']) === null)) {\n\t\t\t$this->details['data'] = json_encode($this->details['data']);\n\t\t}\n\n\t\t$this->trait_save();\n\t}",
"public function save()\n\t{\n\t\t$adheId = $this->getVal('id', -1);\n\t\t// Enregistrer les donnees\n\t\t$where = 'adhe_id='.$adheId;\n\t\t$id = $this->update('adherents', 'adhe_', $this->getValues(), $where, '_asso');\n\n\t\t// Mise a jour de la relation adherent/users\n\t\tif ($adheId == -1)\n\t\t{\n\t\t\t$q = new Bn_query('u2a', '_asso');\n\t\t\t$q->setValue('u2a_userid', $this->getValue('userid', -1));\n\t\t\t$q->addValue('u2a_adherentid', $id);\n\t\t\t$q->setWhere('u2a_userid='.$this->getValue('userid', -1));\n\t\t\t$q->addRow();\n\t\t\tif ( $q->isError() )\n\t\t\t{\n\t\t\t\t$this->_error($q->getMsg());\n\t\t\t}\n\t\t}\n\t\tunset($q);\n\t\treturn;\n\t}",
"function save(){\n\t\tglobal $deal_controller;\n\t\t$deal_controller->load_script($deal_controller->get_path('/classes/db.php'), 'class', 'DealImportDb');\n\t\t\n\t\t$a_deal = new DealImportDb();\n\t\t$deal_id = $a_deal->insert_deal($this->deal_id, $this->post_title, $this->post_content, $this->end_date);\n\t\t$a_deal->insert_deal_meta($deal_id, $this->meta_info);\t\t\n\t}",
"abstract protected function saveBillingDetails();",
"function savemetadata() {\n\n\t\tforeach ($this->fileinfo as $metaname=>$metacontent) {\n\t\t\t$metarows = select_bhdb(\"metadata\", array(\"filepath\"=>$this->filepath, \"metaname\"=>$metaname), \"\");\n\t\t\tif (empty($metarows)) {\n\t\t\t\tinsert_bhdb(\"metadata\", array(\"filepath\"=>$this->filepath, \"metaname\"=>$metaname, \"metacontent\"=>$metacontent));\n\t\t\t} else {\n\t\t\t\tupdate_bhdb(\"metadata\", array(\"metacontent\"=>$metacontent), array(\"filepath\"=>$this->filepath, \"metaname\"=>$metaname));\n\t\t\t}\n\t\t}\n\n\t}",
"public function save() \n { \n // Create body using keys required by API\n $body = [];\n\n foreach (self::$attributes as $attributeName) {\n\n // Ignore advertiser\n if ($attributeName === 'advertiser') {\n continue;\n }\n\n if (property_exists($this, $attributeName)) {\n $body[$attributeName] = $this->{$attributeName};\n }\n }\n\n // Check for 'file' attribute\n if (property_exists($this, 'file')) {\n $body['file'] = $this->file;\n }\n\n // Execute\n $responseBody = self::_update(Creative::RESOURCE_PATH . '/' . $this->id, null, $body, true, true);\n\n // Update local properties to new ones returned by APIs\n $this->updateAttributes($responseBody);\n }",
"public function save(){\n \n global $DB;\n \n $obj = new \\stdClass();\n \n if ($this->isValid()){\n $obj->id = $this->id;\n }\n \n $obj->qualstructureid = $this->qualStructureID;\n $obj->name = $this->name;\n $obj->enabled = $this->enabled;\n \n if ($this->isValid()){\n $result = $DB->update_record(\"bcgt_unit_award_structures\", $obj);\n } else {\n $this->id = $DB->insert_record(\"bcgt_unit_award_structures\", $obj);\n $result = $this->id;\n }\n \n if (!$result){\n $this->errors[] = get_string('errors:save', 'block_gradetracker');\n return false;\n }\n \n \n // Now the awards\n if ($this->awards)\n {\n foreach($this->awards as $award)\n {\n \n $award->setGradingStructureID($this->id);\n $award->save();\n \n }\n }\n \n // Remove old awards\n $this->deleteRemovedAwards();\n \n // Now any unit points we've set\n // \n // Clear existing - These can be deleted, their IDs are irrelevant\n $this->wipeUnitPoints();\n \n // Save any passed in the form\n $this->saveUnitPoints($this->unitPoints);\n \n return true;\n \n }",
"public function save(BookableArea $bookableArea);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new point. | public function newPoint() {
$this->point = new \WBW\Bundle\HighchartsBundle\API\Chart\PlotOptions\Areasplinerange\HighchartsPoint();
return $this->point;
} | [
"protected static function createPointA(): GeometryPoint\n {\n return static::createGeometryPoint('a', 1, 1);\n }",
"public function point();",
"protected static function createPointE(): GeometryPoint\n {\n return static::createGeometryPoint('E', 5, 5);\n }",
"public function canBeCreatedFromPoints(): void\n {\n $wgs84 = new Wgs84Point(2.5, 49.5);\n $lambert72 = new Lambert72Point(14637.25, 22608.21);\n\n $position = new Position($wgs84, $lambert72);\n\n $this->assertSame($wgs84, $position->wgs84());\n $this->assertSame($lambert72, $position->lambert72());\n }",
"private function createPoint($data)\n {\n $Geometry = new Point();\n $Geometry->initFromArray($data);\n return $Geometry;\n }",
"public function store(CreatePointRequest $request)\n {\n $input = $request->all();\n\n $point = $this->pointRepository->create($input);\n\n Flash::success('Point saved successfully.');\n\n return redirect(route('points.index'));\n }",
"private static function createGeographyPoint(string $name, float $x, float $y): GeographyPoint\n {\n try {\n return new GeographyPoint($x, $y);\n } catch (InvalidValueException $e) {\n static::fail(sprintf('Unable to create point %s(%d %d): %s', $name, $x, $y, $e->getMessage()));\n }\n }",
"protected static function createPointB(): GeometryPoint\n {\n return static::createGeometryPoint('B', 2, 2);\n }",
"function point($x, $y){}",
"function addPoint($x, $y = false, $ID = false)\n {\n }",
"public function newPoint($x, $y)\n {\n $this->data[] = array($x, $y);\n\n return $this;\n }",
"private static function createNewYorkGeometry(): GeometryPoint\n {\n return static::createGeometryPoint('New-York', -73.938611, 40.664167);\n }",
"public function setPoint($var)\n {\n GPBUtil::checkString($var, True);\n $this->Point = $var;\n\n return $this;\n }",
"public function create()\n {\n return view('points.create');\n }",
"public function created(Point $point)\n {\n // Update VIP Tier if achieved\n $this->checkTierForUpdate($point);\n\n // Get available reward and send email notification\n $this->checkAvailableReward($point);\n }",
"public function setPoint(Point $value) {\n return $this->set(self::POINT, $value);\n }",
"public function wktGeneratePoint(array $point = NULL);",
"public function addPoint($point) {\n $this->points[] = $point;\n return $this;\n }",
"function Point()\n {\n return array(\n 'comment' => 'Point',\n 'not_null' => true,\n 'type' => TYPE_POINT,\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that the timezone cookie is not set if we don't have an order entity | public function testThatTimezoneIsNotSetWithoutAnOrder()
{
$this->setUpTransactionService($this->createMock(OrderTransactionEntity::class));
$event = $this->initSubscriberRequests(self::STOREFRONT_WEBHOOK_ROUTE, self::TRANSACTION_ID);
$this->transactionService->expects($this->once())->method('getTransactionById');
$this->subscriber->fixWebhookTimezone($event);
$this->assertArrayNotHasKey(TwigDateRequestListener::TIMEZONE_COOKIE, $this->request->cookies->all());
$this->assertNull($this->request->cookies->get(TwigDateRequestListener::TIMEZONE_COOKIE));
} | [
"public function testThatTimezoneIsNotSetWithoutATimezoneCustomField()\n {\n $this->setUpTransactionService($this->createTransactionWithOrder());\n $event = $this->initSubscriberRequests(self::STOREFRONT_WEBHOOK_ROUTE, self::TRANSACTION_ID);\n\n $this->transactionService->expects($this->once())->method('getTransactionById');\n\n $this->subscriber->fixWebhookTimezone($event);\n\n $this->assertArrayNotHasKey(TwigDateRequestListener::TIMEZONE_COOKIE, $this->request->cookies->all());\n $this->assertNull($this->request->cookies->get(TwigDateRequestListener::TIMEZONE_COOKIE));\n }",
"public function testGetTimezoneInvalidIdentifier() {\n\t\t\n\t\t$timezone_test = 'America/Invalid_Indentifier';\n\t\t\n\t\t$this->Query->Controller->request->query['timezone'] = $timezone_test;\n\t\t\n\t\t$expected = date_default_timezone_get();\n\t\t\n\t\t$this->assertEquals($expected, $this->Query->getTimezone());\n\t\t\n\t}",
"function wc_booking_has_location_timezone_set() {\n\n\t$timezone = get_option( 'timezone_string' );\n\n\tif ( ! empty( $timezone ) && false !== strpos( $timezone, 'Etc/GMT' ) ) {\n\t\t$timezone = '';\n\t}\n\n\tif ( empty( $timezone ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"public function hasTimezone(): bool;",
"public function hasOrder()\n {\n return (Mage::registry('Object_Cache_Order')) ? true : false;\n }",
"public function testGetTimezoneInvalidAbbreviatedIdentifier() {\n\t\t\n\t\t$timezone_test = 'JSTNOT';\n\t\t\n\t\t$this->Query->Controller->request->query['timezone'] = $timezone_test;\n\t\t\n\t\t$expected = date_default_timezone_get();\n\t\t\n\t\t$this->assertEquals($expected, $this->Query->getTimezone());\n\t\t\n\t}",
"abstract public function supportsTimezoneOverride();",
"public function hasTimeZone()\n {\n return $this->get(self::TIMEZONE) !== null;\n }",
"public function testConfirmedAtValidation()\n {\n $order = $this->getValidOrder();\n $order->confirmed_at = null;\n $this->assertTrue($order->save());\n\n $order->confirmed_at = \\Carbon\\Carbon::now();\n $this->assertTrue($order->save());\n }",
"public function testTimezoneResponseIsInvalid()\n {\n $response = new TimezoneResponse( array() );\n }",
"public function isDaylightSavings()\n {\n $dateTime = new \\DateTime('now', new \\DateTimeZone('Pacific/Honolulu'));\n $this->assertFalse(DateTime::isDaylightSavings($dateTime));\n }",
"public function createNewOrganisationIncludingTimezone()\n {\n $this->assertCreateOrganisationWithOptionalProperty('timezone');\n }",
"public function assertPhpDateTimezoneSetAndValid() {\n\t\treturn ini_get('date.timezone') && in_array(ini_get('date.timezone'), timezone_identifiers_list());\n\t}",
"public function testGetQuoteNotInitializedCustomerLoggedIn(): void\n {\n $customer = $this->customerRepository->getById(1);\n $this->customerSession->setCustomerDataObject($customer);\n $quote = $this->checkoutSession->getQuote();\n $this->validateCustomerDataInQuote($quote);\n }",
"public function hasDateTimeZone()\n {\n return isset($this->dateTimeZone);\n }",
"public function testRepeatOrderNotAvailable() {\n $order = new Yourdelivery_Model_Order($this->placeOrder());\n $service = $order->getService();\n $service->setIsOnline(false);\n $service->save();\n $this->dispatch('/request_order/repeat?hash=' . $order->getHashtag());\n $this->assertResponseCode(406);\n $service->setIsOnline(true);\n $service->save();\n }",
"public function isIgnored(Order $order)\n {\n $installationDateConfig = $this->scopeConfigInterface->getValue('signifyd_connect/general/installation_date');\n\n if (empty($installationDateConfig)) {\n return false;\n }\n\n $installationDate = $this->dateTime->gmtTimestamp($installationDateConfig);\n $createdAtDate = $this->dateTime->gmtTimestamp($order->getCreatedAt());\n\n if ($createdAtDate < $installationDate) {\n $this->logger->info(\"Installation date: {$installationDate}\");\n $this->logger->info(\"Created at date: {$createdAtDate}\");\n\n return true;\n } else {\n return false;\n }\n }",
"public function testPaymentGivesNoErrorWhenNoLocationObjectIsGiven() {\n $order = new Yourdelivery_Model_Order($this->placeOrder());\n /**\n * manipulate location (no location could be given, if customer comes via directLink / satellite)\n */\n $order->setLocation(null);\n\n if ($order->getService()->isOnlycash()) {\n $this->assertFalse(Yourdelivery_Helpers_Payment::allowCredit($order), ' Payment Log: ' . Default_Helpers_Log::getLastLog('payment'));\n $this->assertFalse(Yourdelivery_Helpers_Payment::allowPaypal($order), ' Payment Log: ' . Default_Helpers_Log::getLastLog('payment'));\n } else {\n $this->assertTrue(Yourdelivery_Helpers_Payment::allowCredit($order), ' Payment Log: ' . Default_Helpers_Log::getLastLog('payment'));\n $this->assertTrue(Yourdelivery_Helpers_Payment::allowPaypal($order), ' Payment Log: ' . Default_Helpers_Log::getLastLog('payment'));\n }\n\n if ($order->getService()->isPaymentbar() && !$order->getService()->isPremium()) {\n $this->assertTrue(Yourdelivery_Helpers_Payment::allowBar($order), ' Payment Log: ' . Default_Helpers_Log::getLastLog('payment'));\n } else {\n $this->assertFalse(Yourdelivery_Helpers_Payment::allowBar($order), ' Payment Log: ' . Default_Helpers_Log::getLastLog('payment'));\n }\n }",
"protected function _checkExpired()\n {\n return true; //need to fix this check later\n// if (empty($this->_order)) {\n// $returnUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) \n// . (Mage::getStoreConfig('web/seo/use_rewrites', Mage::app()->getStore()->getStoreId()) != 1 ? 'index.php/':'') \n// . (Mage::getStoreConfig('web/url/use_store', Mage::app()->getStore()->getStoreId()) != 1 ? '' : Mage::app()->getStore()->getCode() . '/')\n// . Mage::getStoreConfig('afterpay/afterpay/failure_redirect', Mage::app()->getStore()->getStoreId());\n// \n// header('location:' . $returnUrl);\n// }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/Let user to mark a BUzz Spam | function markBuzzSpam() {
echo "!";
$result = loadModel ( "buzzin", "markBuzzSpam", array (
"id" => @$_SESSION ['id'],
"buzz_id" => $_REQUEST ['buzz_id']
) );
if ($result=="spam") {
echo "Already Marked Spam By You";
} else if($result == "newspam") {
echo "Marked Spam";
} else {
echo "Please Try Again! Later";
}
} | [
"protected function flagAsSpammer()\n\t{\n\t\t\\IPS\\Session::i()->csrfCheck();\n\t\t\n\t\t$member = \\IPS\\Member::load( \\IPS\\Request::i()->id );\n\t\tif ( $member->member_id and $member->member_id != \\IPS\\Member::loggedIn()->member_id and \\IPS\\Member::loggedIn()->modPermission('can_flag_as_spammer') )\n\t\t{\n\t\t\tif ( \\IPS\\Request::i()->s )\n\t\t\t{\n\t\t\t\t$member->flagAsSpammer();\n\t\t\t\t\\IPS\\Session::i()->modLog( 'modlog__spammer_flagged', array( $member->name => FALSE ) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member->unflagAsSpammer();\n\t\t\t\t\\IPS\\Session::i()->modLog( 'modlog__spammer_unflagged', array( $member->name => FALSE ) );\n\t\t\t}\n\t\t}\n\t\t\n\t\t\\IPS\\Output::i()->redirect( $member->url() );\n\t}",
"public function submitSpam()\n\t{\n\t\t$this->_sendRequest($this->_getQueryString(), $this->apiKey . '.' . $this->akismetServer, '/' . $this->akismetVersion . '/submit-spam');\n\t}",
"public function submitSpam() {\r\n\t\t$this->sendRequest($this->getQueryString(), $this->apiKey . '.' . $this->getAkismetServer(), '/' . $this->getAkismetVersion() . '/submit-spam');\r\n\t}",
"public function setInSpam(): void\n {\n $this->spam = 5;\n }",
"public function isSpam();",
"function bim_manage_marking( $bim, $userid, $cm ) {\n global $CFG, $OUTPUT;\n $base_url = \"$CFG->wwwroot/mod/bim/view.php?id=$cm->id&tab=manage\";\n\n $event = \\mod_bim\\event\\marking_viewed::create(array(\n 'context' => context_module::instance($cm->id),\n 'objectid' => $cm->id,\n 'other' => array(\n 'viewed' => 'show overall status'\n )\n ));\n $event->trigger();\n\n // Calculations to find out how many unregistered students there are\n $all_students = bim_get_all_students( $cm );\n $student_ids = array_keys( $all_students );\n $feed_details = bim_get_feed_details( $bim->id, $student_ids );\n $unregistered = array_diff_key( $all_students, $feed_details);\n $count_unreg = count( $unregistered);\n // Get the question data required\n // all questions for this bim\n $questions = bim_get_question_hash( $bim->id );\n\n // add the stats for the questions\n $questions = bim_get_question_response_stats( $questions);\n\n $title_help = $OUTPUT->help_icon( 'manageMarking', 'bim' );\n echo $OUTPUT->heading( get_string('bim_marking_heading', 'bim' ).' '.$title_help, 1 );\n\n if ( empty( $questions ) ) {\n print_string( 'bim_marking_no_questions', 'bim' );\n }\n\n if ( $count_unreg > 0 ) {\n print_string( 'bim_marking_unregistered', 'bim', $count_unreg );\n }\n\n // Get question titles\n $question_titles = array();\n foreach ((array)$questions as $question) {\n $question_titles[$question->id] = $question->title;\n }\n // markers details and the makers student information\n // - Get all the students so we can add the stats\n $markers_students = bim_get_all_markers_students( $bim );\n if ( empty( $markers_students ) ) {\n echo $OUTPUT->heading( get_string( 'bim_marking_no_markers_heading', 'bim' ), 2, 'left' );\n print_string( 'bim_marking_no_markers_description', 'bim' );\n } else {\n $markers_students = bim_get_all_marker_stats( $markers_students, $questions, $bim );\n // get the ids of all ther markers\n $markers = array_keys( $markers_students );\n\n // Start setting up the table\n\n $table = new html_table();\n\n // $table->set_attribute('cellpadding','5');\n // $table->set_attribute('class', 'generaltable generalbox reporttable');\n // $table->set_attribute('class', 'generalbox reporttable');\n\n /* $columns = array( 'marker', 'studs' );\n $columns = array_merge( $columns, array_keys( $question_titles ) );\n $table->define_columns( $columns );\n $headers = array( 'Marker', 'Studs' ); */\n\n // **** TODO CHANGING OVER TO HTML_TABLE\n // *** add in change to attributes, padding etc?\n // *** replace this with internationalisation\n\n // set the column titles for the questions, including link to\n // release posts if there are any Marked posts for the question\n $headers = array( 'Marker', 'Studs' );\n foreach ($question_titles as $qid => $title) {\n $new_title = $title;\n if ( $questions[$qid]->status[\"Marked\"] != 0 ) {\n $new_title .= '<br /><small><a href=\"'.$base_url.\n '&op=release&question='.$qid.'\">release</a></small>';\n }\n $headers[] = $new_title;\n }\n $table->head = $headers;\n\n // Start creating the data for the table, each row matches a marker\n $table_data = array();\n\n foreach ($markers_students as $marker) {\n // data\n // - students - is name, mailto, username, blog of student\n // - stats - string summary of posts in bim_marking\n // - one column per question to give overview of what's going on\n\n $entry[\"marker\"] = '<a href=\"mailto:'.$marker->details->email.'\">'.\n $marker->details->firstname.' '.$marker->details->lastname.'</a>';\n // if the marker has some 'Marked' osts add a release option\n if ( isset( $marker->statistics[\"Total\"]->Marked ) ) {\n $entry[\"marker\"] .=\n '<br /><small><a href=\"'.$base_url.'&op=release&marker='.\n $marker->marker.'\">release</a>';\n }\n\n $num_students = count( $marker->students );\n $entry[\"studs\"] = $num_students;\n\n foreach ($question_titles as $qid => $title) {\n $question_stats = bim_get_marker_question_stats( $marker,\n $qid, $questions );\n\n $mark = \"Marked:\";\n if ( $question_stats[\"Marked\"] != 0 ) {\n $mark = '<a href=\"'.$base_url.'&op=release&marker='.$marker->marker.\n '&question='.$qid.'\">Marked:</a>';\n }\n\n $status_table = new html_table;\n $status_table->attributes['class'] = 'status_stats';\n\n $status_data = array();\n\n foreach (array( \"Submitted\", \"Marked\", \"Suspended\", \"Released\", \"Missing\" ) as $status) {\n $label = \"$status:\";\n\n if ( $question_stats[$status] > 0 ) {\n $label = '<a href=\"'.$base_url.'&op=view&marker='.$marker->marker.\n '&question='.$qid.'&status='.$status.'\">'.$label.'</a>';\n }\n\n // ** TODO internationalisation ???\n $status_data[] = array( \"<small>\".$label.\"</small>\",\n \"<small>\".$question_stats[$status].\"</small>\" );\n }\n\n // add the release for this question/marker if any in marked state\n if ( $question_stats[\"Marked\"] != 0 ) {\n // *** TODO need to make this a COLSPAN=2\n $status_data[] = array( '<small><a href=\"' .\n $base_url.'&op=release&marker='.$marker->marker.\n '&question='.$qid.'\">release</a></small>', '' );\n }\n $status_table->data = $status_data;\n // **** TODO need to remove the border from this table\n $entry[$qid] = html_writer::table( $status_table );\n }\n $table_data[] = $entry;\n }\n\n $num_marked = bim_get_marked( $bim );\n if ( $num_marked > 0 ) {\n echo '<p>[<small><a href=\"'.$base_url.'&op=release\">';\n print_string( 'bim_marking_release', 'bim', $num_marked );\n echo '</a></small>]</p>';\n }\n $table->data = $table_data;\n echo html_writer::table( $table );\n }\n\n // Show unregstered students\n $unreg_data = bim_create_details_display( $unregistered, null, $cm );\n // need to remove id field in each entry in the array\n $unreg_data_purge = array();\n foreach ($unreg_data as $unreg) {\n unset( $unreg['id'] );\n $unreg_data_purge[] = $unreg;\n }\n\n $table = bim_setup_details_table( $cm, $bim->id, $userid, 'unregistered' );\n $table->data = $unreg_data_purge;\n\n echo '<a name=\"unreg\"></a>';\n echo $OUTPUT->heading( \"Unregistered students\", 2, \"left\" );\n echo $OUTPUT->container( \"<p>The following \" . count($unregistered) .\n \" student(s) have not yet registered their feeds</p>\" );\n // show the email textbox\n // bim_show_unregistered_students_email( $unregistered );\n $userids = array_keys( $unregistered );\n bim_email_merge( $userids, $cm->course, $base_url,\n \"Email unregistered students\" );\n echo '<br />';\n // $table->print_html();\n echo html_writer::table( $table );\n}",
"public function setInTellSpam(): void\n {\n $this->tellSpam = 5;\n }",
"function block_spam( $topic_title ) {\n\t\n\t\t// Set up an array of (lowercase) bad words and their point value\n\t\t$illegals = array(\n\t\t\t'vashikaran',\n\t\t\t'baba ji',\n\t\t\t'love problem',\n\t\t\t'marriage problem',\n\t\t\t'+91',\n\t\t\t'+91',\n\t\t\t'+O99',\n\t\t\t'91-85',\n\t\t\t'91-99',\n\t\t\t'919914',\n\t\t);\n\t\t\n\t\t// Get the all-lowercase title\n\t\t$spam_title = strtolower( $topic_title );\n\t\t\n\t\t// Check for any of the illegals in the title\n\t\tforeach ( $illegals as $illegal ) {\n\t\t\tif ( strpos( $spam_title , $illegal ) !== false ) {\n\t\t\t\n\t\t\t\t// If the topic matches as spam, let's ban the user\n\t\t\t\t$user = new WP_User( get_current_user_id() );\n\t\t\t\t$user->set_role('banned');\t\n\t\t\t\t\n\t\t\t\t// Send an email letting me know\n\t\t\t\t$headers \t= \"From: Foundry Discipline Bot <noreply@tamrielfoundry.com>\\r\\n\";\n\t\t\t\t$headers\t.= \"Content-Type: text/html; charset=UTF-8\";\n\t\t\t\t$subject \t= 'User ' . $user->user_login . ' banned for spamming.';\n\t\t\t\t$body \t\t= 'The user ' . bp_core_get_userlink( $user->ID ) . ' was banned for attempting to post the topic: \"' . $topic_title . '\".';\n\t\t\t\twp_mail( 'atropos@tamrielfoundry.com' , $subject , $body , $headers );\n\t\t\t\n\t\t\t\t// Trigger an error, preventing the topic from posting\n\t\t\t\tbbp_add_error( 'apoc_topic_spam' , '<strong>ERROR</strong>: Die, filthy spammer!' );\n\t\t\t\t\n\t\t\t\t// Log the user out\n\t\t\t\twp_logout();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $topic_title;\n\t}",
"public function spam($text)\n {\n $this->getB8()->learn($text, \\b8::SPAM);\n }",
"public function markApproved()\n {\n $this->IsSpam = false;\n $this->Moderated = true;\n $this->write();\n $this->extend('afterMarkApproved');\n }",
"function marked_spammed($comment)\n{\n $spam_voters = explode(\"|\", $comment['spam_voters']);\n $spam_votes = $comment['spam_votes'];\n $admin_vote = in_array('1', $spam_voters);\n if (userid() && in_array(userid(), $spam_voters))\n {\n return true;\n }\n elseif ($admin_vote)\n {\n return true;\n }\n else\n {\n return false;\n }\n}",
"function bp_core_action_set_spammer_status( $user_id = 0 ) {\n\n\t// Only super admins can currently spam users (but they can't spam\n\t// themselves)\n\tif ( ! is_super_admin() || bp_is_my_profile() ) {\n\t\treturn;\n\t}\n\n\t// Use displayed user if it's not yourself\n\tif ( empty( $user_id ) )\n\t\t$user_id = bp_displayed_user_id();\n\n\tif ( bp_is_current_component( 'admin' ) && ( in_array( bp_current_action(), array( 'mark-spammer', 'unmark-spammer' ) ) ) ) {\n\n\t\t// Check the nonce\n\t\tcheck_admin_referer( 'mark-unmark-spammer' );\n\n\t\t// To spam or not to spam\n\t\t$status = bp_is_current_action( 'mark-spammer' ) ? 'spam' : 'ham';\n\n\t\t// The heavy lifting\n\t\tbp_core_process_spammer_status( $user_id, $status );\n\n\t\t// Add feedback message. @todo - Error reporting\n\t\tif ( 'spam' == $status ) {\n\t\t\tbp_core_add_message( __( 'User marked as spammer. Spam users are visible only to site admins.', 'buddypress' ) );\n\t\t} else {\n\t\t\tbp_core_add_message( __( 'User removed as spammer.', 'buddypress' ) );\n\t\t}\n\n\t\t// Deprecated. Use bp_core_process_spammer_status.\n\t\t$is_spam = 'spam' == $status;\n\t\tdo_action( 'bp_core_action_set_spammer_status', bp_displayed_user_id(), $is_spam );\n\n\t\t// Redirect back to where we came from\n\t\tbp_core_redirect( wp_get_referer() );\n\t}\n}",
"private function checkSpam()\n\n {\n\n // Akismet\n\n if (Config::getConfig('portal_akismet_portal') && Config::getConfig('portal_akismet_key') != ''\n\n && !Core::$auth->acl_get('u_sg_portal_comments'))\n\n {\n\n require_once(DIR_CLASSES . 'Akismet.php');\n\n require_once(DIR_CLASSES . 'SocketWriteRead.php');\n\n\n\n $akismet = new Akismet(Config::getConfig('portal_url'), Config::getConfig('portal_akismet_key'));\n\n $akismet->setCommentAuthor($this->comment['author']);\n\n $akismet->setCommentAuthorEmail('');\n\n $akismet->setCommentAuthorURL('');\n\n $akismet->setCommentContent($this->comment['message']);\n\n $akismet->setPermalink($_SERVER['REQUEST_URI']);\n\n\n\n if ($akismet->isCommentSpam())\n\n {\n\n $this->comment['spam'] = 1;\n\n }\n\n }\n\n }",
"public function isSpam($data, $form) {\t}",
"function bp_legacy_theme_spam_activity() {\n\t$bp = buddypress();\n\n\t// Bail if not a POST action.\n\tif ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )\n\t\treturn;\n\n\t// Check that user is logged in, Activity Streams are enabled, and Akismet is present.\n\tif ( ! is_user_logged_in() || ! bp_is_active( 'activity' ) || empty( $bp->activity->akismet ) )\n\t\texit( '-1' );\n\n\t// Check an item ID was passed.\n\tif ( empty( $_POST['id'] ) || ! is_numeric( $_POST['id'] ) )\n\t\texit( '-1' );\n\n\t// Is the current user allowed to spam items?\n\tif ( ! bp_activity_user_can_mark_spam() )\n\t\texit( '-1' );\n\n\t// Load up the activity item.\n\t$activity = new BP_Activity_Activity( (int) $_POST['id'] );\n\tif ( empty( $activity->component ) )\n\t\texit( '-1' );\n\n\t// Check nonce.\n\tcheck_admin_referer( 'bp_activity_akismet_spam_' . $activity->id );\n\n\t/** This action is documented in bp-activity/bp-activity-actions.php */\n\tdo_action( 'bp_activity_before_action_spam_activity', $activity->id, $activity );\n\n\t// Mark as spam.\n\tbp_activity_mark_as_spam( $activity );\n\t$activity->save();\n\n\t/** This action is documented in bp-activity/bp-activity-actions.php */\n\tdo_action( 'bp_activity_action_spam_activity', $activity->id, $activity->user_id );\n\texit;\n}",
"function block_spam( $topic_title ) {\n\t\n\t\t// Set up an array of banned words\n\t\t$illegals = array(\n\t\t\t'vashikaran',\n\t\t\t'baba ji',\n\t\t\t'love problem',\n\t\t\t'marriage problem',\n\t\t\t'+91',\n\t\t\t'+91',\n\t\t\t'+O99',\n\t\t\t'91-85',\n\t\t\t'91-99',\n\t\t\t'919914',\n\t\t);\n\t\t\n\t\t// Get the all-lowercase title\n\t\t$spam_title = strtolower( $topic_title );\n\t\t\n\t\t// Check for any of the illegals in the title\n\t\tforeach ( $illegals as $illegal ) {\n\t\t\tif ( strpos( $spam_title , $illegal ) !== false ) {\n\t\t\t\n\t\t\t\t// If the topic matches as spam, let's ban the user\n\t\t\t\t$user = new WP_User( get_current_user_id() );\n\t\t\t\t$user->set_role('banned');\t\n\t\t\t\t\n\t\t\t\t// Send an email letting me know\n\t\t\t\t$headers \t= \"From: Foundry Discipline Bot <noreply@tamrielfoundry.com>\\r\\n\";\n\t\t\t\t$headers\t.= \"Content-Type: text/html; charset=UTF-8\";\n\t\t\t\t$subject \t= 'User ' . $user->user_login . ' banned for spamming.';\n\t\t\t\t$body \t\t= 'The user ' . bp_core_get_userlink( $user->ID ) . ' was banned for attempting to post the topic: \"' . $topic_title . '\".';\n\t\t\t\twp_mail( 'atropos@tamrielfoundry.com' , $subject , $body , $headers );\n\t\t\t\n\t\t\t\t// Trigger an error, preventing the topic from posting\n\t\t\t\tbbp_add_error( 'apoc_topic_spam' , '<strong>ERROR</strong>: Die, filthy spammer!' );\n\t\t\t\t\n\t\t\t\t// Log the user out\n\t\t\t\twp_logout();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\n\t\t// Otherwise go ahead!\t\n\t\treturn $topic_title;\n\t}",
"public function spamUser($token)\n {\n $verifyUser = VerifyUser::where('token', $token)->first();\n if(isset($verifyUser) ){\n $user = $verifyUser->user;\n $status = \"Your Job is spam\"; \n }else{\n return redirect('/home')->with('warning', \"Sorry your email cannot be identified.\");\n }\n \n $job = Job::where('user_id', $user->id)\n ->orderBy('id', 'desc')\n ->first(); \n $job->spam = 1;\n $job->save();\n\n return redirect('/home')->with('status', $status);\n }",
"public function setSpam($value)\n {\n return $this->set(self::SPAM, $value);\n }",
"public function createSpamEntry() {\n\t\t#setup values.\n\t\t$data = array(\n\t\t 'spam_word' => $this->getSpamWord()\n );\n\n\t\t#add new user.\n\t\t$this->db->insert('ebb_spam_list', $data);\n\t\t\n\t\t//get user id\n\t\treturn $this->db->insert_id();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update record in table 'comments' | public function update($comment); | [
"public function updatecomment()\n {\n $id_comment = $this->request->getParameter(\"id\");\n $comment = $this->comment->getComment($id_comment);\n $content = $comment['content'];\n $this->comment->changeCommentAdmin($content);\n }",
"private function updateComment() {\n\t\t$currentUser = $this->loginModel->getSessionUser();\n\t\t$dbUser = $this->userDAL->findUser(new \\common\\model\\User($currentUser, \"\"));\n\t\t$comment = $this->view->getUsersComment($dbUser);\t\t\n\n\t\ttry {\n\t\t\t$this->commentDAL->updateComment($comment);\t\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->view->commentFailed();\n\t\t}\n\t\t\n\t}",
"function updateComment() {\r\n\r\n $comments = $this->request->data['value'];\r\n $com = $this->request->data['commenttext'];\r\n $commenttext_varr = explode('_', $com);\r\n $commentid = $commenttext_varr[1];\r\n\r\n $data['projComments']['comment'] = $comments;\r\n $this->projComments->id = $commentid;\r\n\r\n $updatedecomment = $this->projComments->Save($data);\r\n echo $com = $this->request->data['value'];\r\n die;\r\n }",
"static function updateComment($comment){\n\t\t$servername = self::$servername;\n\t\t$username = self::$username;\n\t\t$password = self::$password;\n\t\t$dbname = self::$dbname;\n\t\t$log = self::$log;\n\t\ttry{\n\t\t\t$pdo = new PDO(\"mysql:host=$servername;dbname=$dbname\", $username, $password);\n\n $stmt = $pdo -> prepare('UPDATE comments set content = :content\n\t\t\t\tWHERE id = :id;');\n\t\t\t\t\n\t\t\t$content = $comment->getContent();\n\t\t\t$id = $comment->getId();\t\t\t\n\t\t\t$stmt -> bindParam(':content', $content);\n $stmt -> bindParam(':id', $id);\n\t\t\t\n\t\t\t$stmt -> execute();\n $log->lwrite('Updated Comment succesfully. ID: '. $id);\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t\t$log->lwrite($e -> getMessage());\n\t\t}\n\t\tfinally{\n\t\t\tunset($pdo);\n\t\t}\n }",
"public function updatecomment()\n {\n $id_comment = $this->request->getParameter(\"id\");\n $comment = $this->comment->getComment($id_comment);\n $content = !empty($_POST['content']) ? trim($_POST['content']) : null;\n $this->comment->changeCommentAdmin($content);\n $this->message->commentUpdated($id_comment);\n }",
"public function updateComment() \n {\n $route = $this->router->getRoute();\n\n if ( $route[1] != 'updateComment' ){\n $this->template('Errors/404');\n\n } else {\n $idComment = intval( $route[2] );\n $data = $this->commentManager->readCommentToUpdate($idComment);\n\n $this->template('Backend/updateComment', $data); \n }\n }",
"public function testUpdateComment() {\n\t\t$postParams = [ \n\t\t\t\t\"user_id\" => \"1\",\n\t\t\t\t\"post_id\" => \"1\",\n\t\t\t\t\"posted_date\" => \"2012-01-05\",\n\t\t\t\t\"title\" => \"New post\",\n\t\t\t\t\"content\" => \"This is a very insightful post.\"\n\t\t];\n\t\t\n\t\t$id = $this->postsDAO->insert ( $postParams );\n\t\t\n\t\t$params = [ \n\t\t\t\t\"user_id\" => \"1\",\n\t\t\t\t\"post_id\" => \"1\",\n\t\t\t\t\"posted_date\" => \"2012-01-05\",\n\t\t\t\t\"title\" => \"New post\",\n\t\t\t\t\"content\" => \"This is a very insightful post and it's updated too!\"\n\t\t];\n\t\t\n\t\t$result = $this->postsDAO->update ( $params, $id );\n\t\t\n\t\t$this->assertEqual ( $result, 1 );\n\t\t\n\t\t$this->postsDAO->delete ( $id );\n\t}",
"public function updatecomment()\n {\n $id_comment = $this->calculate->getCommentId();\n $comment = $this->comment->getComment($id_comment);\n $content = $comment['content'];\n $this->comment->changeComment($content);\n $this->message->commentUpdated();\n }",
"function setFoodComments($foodID, $comments){\r\n $db = getDB();\r\n $sql = \"UPDATE foods SET comments=? WHERE id=?\";\r\n $stmt = $db->prepare($sql);\r\n $stmt->execute(array(\"{$comments}\",\"{$foodID}\"));\r\n}",
"function _set_comment() {\n if (!$this->arg('id')) $this->_error('No data collection id specified');\n if (!$this->arg('value')) $this->_error('No comment specified');\n \n $com = $this->db->pq('SELECT comments from ispyb4a_db.datacollection WHERE datacollectionid=:1', array($this->arg('id')));\n \n if (!sizeof($com)) $this->_error('No such data collection');\n \n $this->db->pq(\"UPDATE ispyb4a_db.datacollection set comments=:1 where datacollectionid=:2\", array($this->arg('value'), $this->arg('id')));\n \n print $this->arg('value');\n }",
"function editForComment($value){\r\n\t\tglobal $db;\r\n\t\t\r\n\t\t$upb = \"UPDATE exo_bugtracker SET last_commentaire_id='$value' WHERE btid = '\".$this->id.\"'\";\r\n\t\t$upb = $db->Send_Query($upb);\t\r\n\t}",
"public function testUpdateComment()\n {\n $createdResponse = $this->json('POST', '/api/comments', [\n 'body' => 'Laravel Rocks',\n 'parent_id' => null,\n 'username' => 'jdecano',\n ]);\n\n $created = json_decode($createdResponse->getContent());\n\n $response = $this->json('PUT', '/api/comments/' . $created->data->id, [\n 'body' => 'new content',\n ]);\n\n $response->assertStatus(200);\n\n $response->assertJsonStructure([\n 'data' => [\n 'id',\n 'body',\n 'parent_id',\n 'username',\n 'level',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }",
"public function testUpdateValidComment(): void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"comment\");\n\n\t\t// create a new Comment and insert it into mySQL\n\t\t$commentid = generateUuidV4();\n\t\t$comment = new Comment($commentid, $this->animal->getAnimalId(), $this->profile->getProfileId(), $this->VALID_COMMENTDATE, $this->VALID_COMMENTTEXT);\n\t\t$comment->insert($this->getPDO());\n\n\t\t// edit the Comment and update it in the mySQL\n\t\t$comment->setCommentText($this->VALID_COMMENTTEXT2);\n\t\t$comment->update($this->getPDO());\n\n\t\t// grab the data from mySQL and ensure the fields match our expectations\n\t\t$pdoComment = Comment::getCommentByCommentId($this->getPDO(), $comment->getCommentId());\n\t\t$this->assertEquals($pdoComment->getCommentId(), $commentid);\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"comment\"));\n\t\t$this->assertEquals($pdoComment->getCommentAnimalId(), $this->animal->getAnimalId());\n\t\t$this->assertEquals($pdoComment->getCommentProfileId(), $this->profile->getProfileId());\n\t\t// format the date to seconds since the beginning of time to avoid round off error\n\t\t$this->assertEquals($pdoComment->getCommentDate()->getTimestamp(), $this->VALID_COMMENTDATE->getTimestamp());\n\t\t$this->assertEquals($pdoComment->getCommentText(), $this->VALID_COMMENTTEXT2);\n\n\t}",
"public function fseo_tt_update_comment()\n {\n $id = $_POST['commentId'];\n $content = $_POST['commentContent'];\n $comment = get_comment($id, ARRAY_A);\n $comment['comment_content'] = $content;\n\n $res = wp_update_comment($comment);\n\n echo json_encode(['status' => $res ? 'success' : 'fail']);\n die();\n }",
"public function testUpdateValidComment(): void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"comment\");\n\t\t// create a new Comment and insert to into mySQL\n\t\t$commentId = generateUuidV4();\n\t\t$comment = new Comment($commentId, $this->profile->getProfileId(), $this->trail->getTrailId(), $this->VALID_COMMENT_CONTENT, $this->VALID_COMMENT_TIMESTAMP);\n\t\t$comment->insert($this->getPDO());\n\t\t// edit and update it in mySQL\n\t\t$comment->setCommentContent($this->VALID_COMMENT_CONTENT2);\n\t\t$comment->update($this->getPDO());\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoComment = Comment::getCommentByCommentId($this->getPDO(), $comment->getCommentId());\n\t\t$this->assertEquals($pdoComment->getCommentId(), $commentId);\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"comment\"));\n\t\t$this->assertEquals($pdoComment->getCommentProfileId(), $this->profile->getProfileId());\n\t\t$this->assertEquals($pdoComment->getCommentTrailId(), $this->trail->getTrailId());\n\t\t$this->assertEquals($pdoComment->getCommentContent(), $this->VALID_COMMENT_CONTENT2);\n\t\t//format the date two seconds after beginning of time, for round off error\n\t\t$this->assertEquals($pdoComment->getCommentTimestamp()->getTimestamp(), $this->VALID_COMMENT_TIMESTAMP->getTimestamp());\n\t}",
"public function updated(Comment $comment)\n {\n //\n }",
"public function updateDataLectureComment($request): void\n\t{\n\t\ttry {\n\t\t\t$data = [\n\t\t\t\t'content'\t\t=> $request->content\n\t\t\t];\n\t\t\t$this->comment->update($data);\n\t\t} catch (\\Exception $e) {\n\t\t\tthrow new \\App\\Exceptions\\ModelException($e->getMessage());\n\t\t}\n\t}",
"function update_by_cms_comment_id($id, array $data)\n\t\t{\n\t\t\t$this->db->update('cms_comment', $data, array(\n\t\t\t\t'id' => $id\n\t\t\t));\n\t\t}",
"function updateMessage(){\n $id=$_POST['id'];\n $updateMsg=$_POST['updateMsg'];\n Comment::where('id',$id)->update(['comment'=>$updateMsg]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a less than criteria Example: $solrHelper = new \Emran\SolrHelper(new \Apache_Solr_Service('localhost', '8080', '/solr/')); $solrHelper>addLessThanCriteria('price', 50000); $solrHelper>search(); | public function addLessThanCriteria($key, $value)
{
$this->query[] = "+{$key}:[* TO {$value}]";
return $this;
} | [
"public function lessThan($expression);",
"function addLessThan($alias, $value, $isAlias = false) {\r\n\t\t\t$this->privateVars['filters'][] = array(\r\n\t\t\t\t'alias' => $alias,\r\n\t\t\t\t'value' => $value,\r\n\t\t\t\t'isAlias' => $isAlias,\r\n\t\t\t\t'type' => 'smallerThan'\r\n\t\t\t);\r\n\t\t}",
"public function whereLessThan($field, $value) {\n\t$this->parseQuery->whereLessThan($field, $value);\n }",
"public function whereLessThan($field, $value) {\r\n\t$this->parseQuery->whereLessThan($field, $value);\r\n }",
"public function testLt()\n {\n $builder = new FilterBuilder();\n $result = $builder->lt('price', 10)->toArray();\n $expected = [\n 'price' => ['$lt' => 10],\n ];\n $this->assertEquals($expected, $result);\n\n $result = $builder->lt('year', '2014')->toArray();\n $expected = [\n 'year' => ['$lt' => 2014],\n ];\n $this->assertEquals($expected, $result);\n }",
"public function testLessThan()\n {\n test_number_let('__number__')->be(74);\n $predicate = test_number_numberx('__number__')->lessThan(120);\n $this->assertTrue($predicate->evaluate(), \"Failed to assert that lessThan returns true when the operand is less than the constraint.\");\n\n // We test that given 94, lessThan agrees that it is less than 402\n test_number_let('__number__')->be(402);\n $predicate = test_number_numberx('__number__')->lessThan(94);\n $this->assertFalse($predicate->evaluate(), \"Failed to assert that lessThan returns false when the constraint is less than the operand.\");\n }",
"public function lt($x, $y) {\n\n }",
"public function lessThan($column, $value) { return $this->addCondition($column, $value, Criterion::LESS_THAN); }",
"public function lessThanOrEqual(Price $other);",
"public function testLt()\n {\n $builder = new QueryBuilder();\n $result = $builder->lt('price', 10);\n $expected = [\n 'range' => ['price' => ['lt' => 10]],\n ];\n $this->assertEquals($expected, $result->toArray());\n\n $result = $builder->lt('year', '2014');\n $expected = [\n 'range' => ['year' => ['lt' => '2014']],\n ];\n $this->assertEquals($expected, $result->toArray());\n }",
"private function _lt()\r\n {\r\n $this->_compare('<');\r\n }",
"function lt($value)\n{\n return new Expr\\Expression('%s < ?', [$value]);\n}",
"public function where_lt($field = \"\", $x)\n\t {\n\t \t$this->where_init($field);\n\t \t$this->wheres[$field]['$lt'] = $x;\n\t \treturn($this);\n\t }",
"public function whereLessThanOrEqualTo($field, $value) {\n\t$this->parseQuery->whereLessThanOrEqualTo($field, $value);\n }",
"public function where_lt($field = \"\", $x)\r\n {\r\n $this->_where_init($field);\r\n $this->wheres[$field]['$lt'] = $x;\r\n return($this);\r\n }",
"public function where_lt($field = \"\", $x)\n\t{\n\t\t$this->_where_init($field);\n\t\t$this->wheres[$field]['$lt'] = $x;\n\t\treturn($this);\n\t}",
"public function where_lt($field = \"\", $x)\n {\n $this->_where_init($field);\n $this->wheres[$field]['$lt'] = $x;\n return $this;\n }",
"function isLessThanOrEqualTo($expected): Predicate\n{\n return equals($expected)->or(isLessThan($expected));\n}",
"public function lessThan($propertyName, $value) {\n\t\treturn $this->queryFilter('range', array($propertyName => array('lt' => $value)));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Indicates whether the specified plugin is in the default plugin directory. OBSOLETE. Remove on next major API bump. Sometimes it's useful to know just whether a plugin is in its default directory or not, without actually getting any information about its path. It is used for rewriting URL in the UrlGenerator. We don't use GalleryPlatform in this function, because it is too lowlevel and there are significant problems with making it work here. One of the problems is that it breaks dozens of tests that rely on UnitTestPlatform. | function isPluginInDefaultLocation($pluginType, $pluginId, $clearCache=false) {
return true;
} | [
"public function underPluginDirectory(){\n return Loco_fs_Locations::getPlugins()->check( $this->path );\n }",
"public static function is_must_use_plugin_folder() {\n\t\t$plugin_path = Ionos_Assistant::get_plugin_dir_path();\n\n\t\tif ( strpos( $plugin_path, 'mu-plugins' ) === false ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"protected function original_plugin_folder_exists()\n\t\t{\n\t\t\treturn ( is_dir( WP_PLUGIN_DIR . '/LayerSlider' ) || is_dir( WPMU_PLUGIN_DIR . '/LayerSlider') );\n\t\t}",
"public function getPluginDir();",
"private static function plugin_exists($plugin_name)\n {\n return (is_dir($_SERVER[\"DOCUMENT_ROOT\"]._SITE_PATH.'/plugins/'.$plugin_name)) ? true : false;\n }",
"public function isBasicPlugin() : bool\n {\n if (!file_exists($this->path) || !is_file($this->path)) {\n return false;\n }\n\n $classname = self::getFileClass($this->path);\n\n if (strlen($classname) < 1) {\n return false;\n }\n\n if (Str::of($classname)->afterLast('\\\\') != Str::of($this->path)->basename()->beforeLast('.')) {\n return false;\n }\n\n return true;\n }",
"public function isPlugin()\r\n {\r\n if($this->getConfig('plugin') !== null)\r\n {\r\n $this->setPlugin(true);\r\n }\r\n return isset($this->config['is_plugin']) ? $this->config['is_plugin'] : false;\r\n }",
"function is_in_wpmu_plugin_dir( $filename = '' ){\r\n\t\tif ( !defined('WPMU_PLUGIN_DIR') ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif ( empty($filename) ){\r\n\t\t\t$filename = $this->plugin_file;\r\n\t\t}\r\n\r\n\t\t$normalizedMuPluginDir = realpath(WPMU_PLUGIN_DIR);\r\n\t\t$normalizedFileName = realpath($filename);\r\n\r\n\t\t//If realpath() fails, just normalize the syntax instead.\r\n\t\tif ( empty($normalizedFileName) || empty($normalizedMuPluginDir) ) {\r\n\t\t\t$normalizedMuPluginDir = wp_normalize_path(WPMU_PLUGIN_DIR);\r\n\t\t\t$normalizedFileName = wp_normalize_path($filename);\r\n\t\t}\r\n\t\t//Yet another fallback if the above also fails.\r\n\t\tif ( !is_string($normalizedMuPluginDir) || empty($normalizedMuPluginDir) ) {\r\n\t\t\tif ( is_string(WPMU_PLUGIN_DIR) ) {\r\n\t\t\t\t$normalizedMuPluginDir = WPMU_PLUGIN_DIR;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (strpos( $normalizedFileName, $normalizedMuPluginDir ) !== false);\r\n\t}",
"private function isPluginPage()\n {\n return isset($_GET[\"page\"]) && $_GET[\"page\"] == OPTMEDIA_ADMIN_PAGE_SLUG;\n }",
"protected function useDefaultDirectories()\n {\n if ($this->option('all'))\n return false;\n\n $options = $this->options();\n foreach($this->directories as $opt)\n if (isset($options[$opt]) && $options[$opt])\n return false;\n\n return true;\n }",
"function is_installed($plugin)\n{\n if (defined($plugin . \"_install\"))\n return true;\n else\n return false;\n}",
"function hh_plugin_available() {\n // First checks if the plugin is actually installed\n $plugin_exists = is_dir(HELMHOLTZ_PLUGIN_FOLDER_PATH) && file_exists(HELMHOLTZ_PLUGIN_FILE_PATH);\n if ($plugin_exists) {\n return true;\n }\n return false;\n}",
"function is_plugin_installed($plugin)\n{\n $plugin_file = GSPLUGINPATH . \"/\" . $plugin->filename_id;\n\n if (file_exists($plugin_file)) {\n return true;\n }\n\n return false;\n}",
"public static function isConfigured()\n {\n return PLUGIN_INSTALLER && is_writable(PLUGINS_DIR) && extension_loaded('zip');\n }",
"function __checkPluginFolder() {\n\t\t$tempHandler = new Folder();\n\t\t$tempPath = trim(TMP);\n\t\t$pluginPath = trim(TMP . 'plugins');\n\n\t\t$tempHandler->cd($tempPath);\n\t\t$temp = $tempHandler->ls();\n\t\tforeach ($temp[0] as $tempFolder) {\n\t\t\tif ($tempFolder !== 'plugins') {\n\t\t\t\t$tempHandler->create($pluginPath);\n\t\t\t}\n\t\t}\n\t}",
"function get_plugin_status()\n {\n global $wp_plugin_directories;\n $rv = false;\n if( isset( $_GET['plugin_status'] ) && in_array( $_GET['plugin_status'], array_keys( $wp_plugin_directories ) ) )\n {\n $rv = $_GET['plugin_status'];\n }\n return $rv;\n }",
"public static function is_as_plugin() {\n\t\treturn self::is_as_theme() || self::is_as_child_theme() ? false : true;\n\t}",
"function is_plugin() {\n return ( WP_FS__MODULE_TYPE_PLUGIN === $this->_module_type );\n }",
"public function get_directory_url() {\n \treturn $this->plugin_dir_url;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the ed bordereau prep. | public function setEdBordereauPrep(?bool $edBordereauPrep): ConstantesEntreprise {
$this->edBordereauPrep = $edBordereauPrep;
return $this;
} | [
"public function getEdBordereauPrep() {\n return $this->edBordereauPrep;\n }",
"public function testSetEdBordereauPrepa() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setEdBordereauPrepa(true);\n $this->assertEquals(true, $obj->getEdBordereauPrepa());\n }",
"function setBorderColor($value) { $this->_bordercolor=$value; }",
"public function testSetEdBordereau() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setEdBordereau(true);\n $this->assertEquals(true, $obj->getEdBordereau());\n }",
"function SetBorders($b) {\n $this->borders = $b;\n }",
"public function setImageBorderColor ($border) {}",
"private function setRedTopBorder(){\n\t\techo \"decor| TopBorder RED \\n\";\n\t}",
"public function getEdBordereau() {\n return $this->edBordereau;\n }",
"function setBorder($border)\n {\n $intersection = '';\n $horizontal = '';\n $vertical = '';\n\n if ($border === self::CONSOLE_TABLE_BORDER_ASCII) {\n $intersection = '+';\n $horizontal = '-';\n $vertical = '|';\n } else {\n if (is_string($border)) {\n $intersection = $horizontal = $vertical = $border;\n } else {\n if ($border == '') {\n $intersection = $horizontal = $vertical = '';\n } else {\n extract($border);\n }\n }\n }\n\n $this->_border = [\n 'intersection' => $intersection,\n 'horizontal' => $horizontal,\n 'vertical' => $vertical,\n ];\n }",
"function setBorders(&$borderFormat, $left = true, $top = true, $right = true, $bottom = true) {\t \r\n\t\tif (empty($this->bordered)) {\t\t \r\n\t\t \t$this->bordered = new Bordered();\r\n\t\t}\r\n\t\t\r\n\t\t$this->bordered->setBorders($borderFormat, $left, $top, $right, $bottom);\r\n\t}",
"function ps_set_border_style($psdoc, $style, $width)\n{\n}",
"private function createBorder()\r\n\t{\r\n\t\t$x = $this->width;\r\n\t\t$y = $this->height;\r\n\r\n\t\t$color = $this->generateColor('white');\r\n\t\timageline($this->img, 1, 1, $x, 1, $color);\r\n\t\timageline($this->img, 0, $y-2, $x, $y-2, $color);\r\n\t\timageline($this->img, 1, 1, 1, $y-2, $color);\r\n\t\timageline($this->img, $x-2, 0, $x-2, $y-2, $color);\r\n\r\n\t\t$color = $this->generateColor('grey');\r\n\t\timageline($this->img, 0, 0, $x, 0, $color);\r\n\t\timageline($this->img, 0, $y-1, $x, $y-1, $color);\r\n\t\timageline($this->img, 0, 0, 0, $y-1, $color);\r\n\t\timageline($this->img, $x-1, 0, $x-1, $y-1, $color);\r\n\t}",
"private function _addBorder()\n {\n if ($this->_isResize() && array_key_exists('border', $this->options) && ($this->options['border'] == 1 || $this->options['border'] == 'true')) {\n $outline_layer = ms_newLayerObj($this->map_obj);\n $outline_layer->set(\"name\", \"outline\");\n $outline_layer->set(\"type\", MS_LAYER_POLYGON);\n $outline_layer->set(\"status\", MS_ON);\n $outline_layer->set(\"transform\", MS_FALSE);\n $outline_layer->set(\"sizeunits\", MS_PIXELS);\n\n // Add new class to new layer\n $outline_class = ms_newClassObj($outline_layer);\n\n // Add new style to new class\n $outline_style = ms_newStyleObj($outline_class);\n $outline_style->outlinecolor->setRGB(0, 0, 0);\n $outline_style->set(\"width\", 3);\n\n $polygon = ms_newShapeObj(MS_SHAPE_POLYGON);\n\n $polyLine = ms_newLineObj();\n $polyLine->addXY(0, 0);\n $polyLine->addXY($this->map_obj->width, 0);\n $polyLine->addXY($this->map_obj->width, $this->map_obj->height);\n $polyLine->addXY(0, $this->map_obj->height);\n $polyLine->addXY(0, 0);\n\n $polygon->add($polyLine);\n $outline_layer->addFeature($polygon);\n }\n }",
"public function setBorder(PHPRtfLite_Border $border)\n {\n $this->_border = $border;\n }",
"public function setImageBorderColor($border) {\n\t}",
"private function _addBorder()\n {\n if ($this->_isResize()\n && array_key_exists('border', $this->request->options)\n && ($this->request->options['border'] == 1 || $this->request->options['border'] == 'true')\n ) {\n $outline_layer = new \\layerObj($this->map_obj);\n $outline_layer->set(\"name\", \"outline\");\n $outline_layer->set(\"type\", MS_LAYER_POLYGON);\n $outline_layer->set(\"status\", MS_ON);\n $outline_layer->set(\"transform\", MS_FALSE);\n $outline_layer->set(\"sizeunits\", MS_PIXELS);\n\n // Add new class to new layer\n $outline_class = new \\classObj($outline_layer);\n\n // Add new style to new class\n $outline_style = new \\styleObj($outline_class);\n $outline_style->outlinecolor->setRGB(0, 0, 0);\n $outline_style->set(\"width\", 3);\n\n $polygon = new \\shapeObj(MS_SHAPE_POLYGON);\n\n $polyLine = new \\lineObj();\n $polyLine->addXY(0, 0);\n $polyLine->addXY($this->map_obj->width, 0);\n $polyLine->addXY($this->map_obj->width, $this->map_obj->height);\n $polyLine->addXY(0, $this->map_obj->height);\n $polyLine->addXY(0, 0);\n\n $polygon->add($polyLine);\n $outline_layer->addFeature($polygon);\n }\n }",
"function DrawBorder(wxGrid $grid, wxDC &$dc, wxRect &$rect){}",
"public function setBorder($border)\n {\n $this->quadrupleSetter($border, 'border');\n }",
"static function GetDefaultBorder(){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executes this Choreo. Execution object provides access to results appropriate for this ListCommits Choreo. | public function execute($inputs = array(), $async = false, $store_results = true)
{
return new GitHub_ReposAPI_Commits_ListCommits_Execution($this->session, $this, $inputs, $async, $store_results);
} | [
"public function getCommits()\n\t{\n\t\tif(is_null($this->_commits))\n\t\t{\n\t\t\t$this->_commits = array();\n\t\t\t$branchName = $this->remote ? $this->remote->name . '/' . $this->name : $this->name;\n\t\t\t$command = 'log --pretty=format:\"%H\" ' . $branchName;\n\t\t\tforeach(explode(\"\\n\", $this->repository->run($command)) as $hash)\n\t\t\t{\n\t\t\t\t$hash = trim($hash);\n\t\t\t\tif(!$hash)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$this->_commits[$hash] = new GitCommit($hash, $this->repository);\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_commits;\n\t}",
"public function getCommits()\n {\n $commitsUrl = $this->notification[\"pull_request\"][\"commits_url\"];\n $commits = json_decode($this->client->get($commitsUrl)\n ->getBody()\n ->getContents(),\n true);\n\n $commitsList = [];\n foreach ($commits as $commit) {\n $commitsList[] = '- [' . $commit['commit']['message'] . '](' . $commit['html_url'] . ')';\n }\n\n return $commitsList;\n }",
"public function list_commits($branch)\n\t{\n\t\t$this->url = GH_COMMIT_API.'/list/'.$this->repo_user.'/'.$this->repo_proj.'/'.$branch;\n\n\t\treturn $this->connect(TRUE);\n\t}",
"protected function _getCommitList()\n {\n if (null !== $this->_commitList) {\n return $this->_commitList;\n }\n\n $output = null;\n $cmd = \"svnlook changed -t '{$this->_transaction}' '{$this->_repository}'\";\n exec($cmd, $output);\n\n $list = array();\n foreach ($output as $item) {\n $pos = strpos($item, ' ');\n $status = substr($item, 0, $pos);\n $file = trim(substr($item, $pos));\n\n $list[$file] = $status;\n }\n\n $this->_commitList = $list;\n return $this->_commitList;\n }",
"public function get_commits() {\r\n $data = array();\r\n if (!empty($this->repository)) {\r\n $contents = $this->get_response('repos/' . $this->username . '/' . $this->repository . '/commits?per_page=100');\r\n if ($contents == TRUE) {\r\n $content_array = json_decode($contents);\r\n if(is_array($content_array)){\r\n $data = array_merge($data,$content_array );\r\n } else {\r\n $data_error = array(_('error data format'));\r\n $data = array_merge($data,$data_error );\r\n }\r\n\r\n }\r\n }\r\n else {\r\n // Fetch all public repositories\r\n $repos = $this->get_repositories();\r\n\r\n if ($repos == TRUE) {\r\n // Loop through public repos and get all commits\r\n foreach ($repos as $repo) {\r\n $contents = $this->get_response('repos/' . $this->username . '/' . $repo->name . '/commits');\r\n if ($contents == TRUE && is_array($contents)) {\r\n $data = array_merge($data, json_decode($contents));\r\n }\r\n else {\r\n if ($contents == TRUE && !is_array($contents)) {\r\n $data = json_decode($contents);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n\r\n }\r\n }\r\n\r\n // Sort response array\r\n if (is_array($data)) {\r\n usort($data, array($this, 'order_commits'));\r\n }\r\n\r\n return $data;\r\n }",
"public static function getGithubCommitHistory()\n {\n $key = 'github_commits';\n $cache = new Cache();\n $commits = $cache->get($key);\n\n if (!$commits) {\n $client = new \\Github\\Client();\n\n $commits = (Object)[\n 'master' => $client->api('repo')->commits()->all('xivapi', 'xivapi.com', ['sha' => 'master']),\n 'staging' => $client->api('repo')->commits()->all('xivapi', 'xivapi.com', ['sha' => 'staging'])\n ];\n\n // cache for an hour, I don't commit that often!\n $cache->set($key, $commits, 60*60);\n }\n\n return $commits;\n }",
"public function listBranchCommits($username, $repo, $branch, array $requestOptions = array())\n {\n $data = $this\n ->createRequest($requestOptions)\n ->get('commits/list/'.$username.'/'.$repo.'/'.$branch);\n\n return $data['commits'];\n }",
"public function commitsList($username, $repository, $branch = 'master')\n\t{\n\t\t// build URL\n\t\t$url = 'commits/list/'. (string) $username .'/'. (string) $repository .'/'. (string) $branch;\n\n\t\t// make the call\n\t\treturn $this->doCall($url);\n\t}",
"public function retrieveLatestCommits() {\n\t\t\n\t\t$client = new \\Github\\Client();\n\t\t$commits = $client->api('repo')->commits()->all('nodejs','node', array('sha','master'));\n\t\t$repository = $this->em->getRepository('AppBundle:Commit');\n\n\t\tfor ($i = 0; $i < 25; ++$i) {\n\t\t\t$thisCommit = $commits[$i];\n\n\t\t\tif(!$repository->findOneBy(array('sha' => $thisCommit['sha']))) {\n\t\t\t\t$commit = new ent\\Commit;\n\n\t\t\t\t$commit->setSha($thisCommit['sha']);\n\t\t\t\t$commit->setAuthorName($thisCommit['commit']['author']['name']);\n\t\t\t\t$commit->setAuthorEmail($thisCommit['commit']['author']['email']);\n\t\t\t\t$commit->setAuthorID($thisCommit['author']['id']);\n\t\t\t\t$commit->setAuthorAvatar($thisCommit['committer']['avatar_url']);\n\t\t\t\t$commit->setAuthorLogin($thisCommit['committer']['login']);\n\t\t\t\t$commit->setCommitterName($thisCommit['commit']['committer']['name']);\n\t\t\t\t$commit->setCommitterEmail($thisCommit['commit']['committer']['email']);\n\t\t\t\t$commit->setCommitterID($thisCommit['committer']['id']);\n\t\t\t\t$commit->setTreeSha($thisCommit['commit']['tree']['sha']);\n\t\t\t\t$commit->setTreeUrl($thisCommit['commit']['tree']['url']);\n\t\t\t\t$commit->setMessage($thisCommit['commit']['message']);\n\t\t\t\t$commit->setUrl($thisCommit['url']);\n\t\t\t\t$commit->setHtmlUrl($thisCommit['html_url']);\n\t\t\t\t$commit->setComments($thisCommit['commit']['comment_count']);\n\t\t\t\t$commit->setCommitDate(new \\DateTime($thisCommit['commit']['committer']['date']));\n\n\n\t\t\t\t$this->em->persist($commit);\n\t\t\t} \n\t\t}\n\t\t$this->em->flush();\n $this->em->clear(); \n\t}",
"public function getCommits()\n {\n //get the latest 25 commits for nodejs/node\n $client = new Client();\n $res = $client->get('https://api.github.com/repos/nodejs/node/commits');\n $commits = json_decode($res->getBody()->getContents());\n \n //loop through first 25 and save\n $i = 0;\n\t foreach ($commits as $commit) {\n\t $insert = Commit::firstOrCreate(['sha' => $commit->sha]);\n\t $insert->user = $commit->author->login;\n\t $insert->message = $commit->commit->message;\n\t $insert->sha = $commit->sha;\n\t $insert->url = $commit->url;\n\t $insert->save();\n\t $i++;\n\t if ($i>=25) { break; } //only worry about first 25\n\t }\n \n return \\Response::json($commits);\n //return $commits;\n //print_r($commits); exit();\n\n \n }",
"private function fetchAllCommits(GitRepository $git)\n {\n $currentCommit = $this->fetchCurrentCommit($git);\n\n $cacheId = \\md5(__FUNCTION__ . \\serialize($currentCommit));\n\n if (!$this->cachePool->has($cacheId)) {\n $logList = \\json_decode(\n \\sprintf(\n '[%s]',\n \\trim(\n // git log --simplify-merges --format=$this->logFormat()\n $git->log()->simplifyMerges()->format($this->logFormat() . ',')->execute(),\n ','\n )\n ),\n true\n );\n\n $this->cachePool->set($cacheId, $logList);\n\n return $logList;\n }\n\n return $this->cachePool->get($cacheId);\n }",
"public function getCommits($project, string $branch = '', string $filePath = '', string $since = '', string $until = ''): array\n {\n $params = [];\n if (!empty($filePath)) {\n $params['path'] = \\urldecode($filePath);\n }\n if (!empty($branch)) {\n $params['branch'] = $branch;\n }\n if (!empty($since)) {\n $params['since'] = \\date('c', \\strtotime($since));\n }\n if (!empty($until)) {\n $params['until'] = \\date('c', \\strtotime($until));\n }\n return $this->request($this->projectURL . $project . '/repository/commits', $params);\n }",
"public function setCommits($changes)\n {\n $changes = $this->normalizeChanges($changes);\n\n // ensure all commits are also listed as being changes\n $this->setChanges(\n array_merge($this->getChanges(), $changes)\n );\n\n return $this->setRawValue('commits', $changes);\n }",
"public function getCommits(Request $request, $id) {\n \t$client = new Client();\n\n // Get project that the repo is connected to\n $project = Project::where('id', $id)->first();\n\n // Get the users organizations\n $res = $client->request('GET', 'https://api.github.com/repos/' . $project->repository_owner_name . '/' . $project->repository_name . '/commits', [\n 'auth' => [\n null,\n $request->github_token\n ]\n ]);\n\n return $res->getBody();\n }",
"public function GetCommits($startref, $endref='HEAD') {\n if (is_string($startref) && ('' !== trim($startref))) {\n //\n // If we could not access any tags for this repo, then there will be no tag-to-tag commit.\n //\n // If the startref or the endref (when not HEAD) is not in the taglist there will be no tag-to-tag list.\n if (null === $this->tags || !in_array($startref, $this->tags)) {\n return null;\n }\n if ('HEAD' !== $endref && !in_array($endref, $this->tags)) {\n return null;\n }\n\n //\n // Pull all commits between the startref and endref reference points.\n // Useful for getting a list of commits between tags.\n //\n $startref_encoded = rawurlencode($startref);\n $endref_encoded = rawurlencode($endref);\n $url = \"https://api.bitbucket.org/2.0/repositories/{$this->encoded_owner}/{$this->encoded_repo}/compare/$startref_encoded...$endref_encoded\";\n $slice = false;\n } else {\n //\n // Pull the last n commits.\n //\n $url = \"https://api.bitbucket.org/2.0/repositories/{$this->encoded_owner}/{$this->encoded_repo}/commits/master?fields=values.hash,values.links.html,values.date,values.message,values.author.user.display_name\";\n $slice = intval($startref);\n if ($slice < 1) $slice = 1;\n if ($slice > 30) $slice = 30;\n }\n\n $http_code = null;\n $reply = $this->RepositoryRead($url, $http_code);\n if (200 == $http_code || 304 == $http_code) {\n if ($slice) {\n $repo_url = null;\n $commits = array_slice($reply['values'], 0, $slice);\n } else {\n //$repo_url = $reply['html_url'];\n $commits = $reply['values'];\n }\n//\\TD::barDump($commits, \"Commit List\");\n\n $history = [];\n foreach ($commits as $commit) {\n//\\TD::barDump($commit);\n $entry = [];\n $entry['sha'] = $commit['hash'];\n $entry['url'] = $commit['links']['html']['href'];\n $entry['author'] = $commit['author']['user']['display_name'];\n $entry['date'] = str_replace('+00:00', 'Z', $commit['date']);\n $entry['message'] = $commit['message'];\n $entry['tag'] = @$this->tags[$entry['sha']];\n ksort($entry);\n $history[] = $entry;\n }\n return ['commits' => $history, 'url' => $repo_url];\n }\n return null;\n }",
"public function fetchCommits() : \\Generator\n {\n foreach ($this->gateway->fetchAllCommits() as $hash) {\n try {\n yield $this->hydrator->hydrate(\n (new \\GitIndexer\\Commit)->setBranches($this->gateway->fetchCommitBranches($hash)),\n $this->gateway->fetchCommit($hash)\n );\n } catch (\\Exception $e) {\n // TODO : Do something with exception\n continue;\n }\n }\n }",
"public function loadCommits()\n {\n $cacheKey = sprintf('commits:%s', $this->getPath());\n $cache = Cache::get($cacheKey);\n\n if ($cache === null) {\n $this->commits = $this->getCommits();\n $this->parseCommits();\n\n $cacheValues = array(\n 'commits' => $this->commits,\n 'commitsByDate' => $this->commitsByDate,\n 'commitsByDay' => $this->commitsByDay,\n 'commitsByHour' => $this->commitsByHour,\n 'commitsByContributor' => $this->commitsByContributor\n );\n Cache::put($cacheKey, $cacheValues, 60);\n } else {\n $this->commits = $cache['commits'];\n $this->commitsByDate = $cache['commitsByDate'];\n $this->commitsByDay = $cache['commitsByDay'];\n $this->commitsByHour = $cache['commitsByHour'];\n $this->commitsByContributor = $cache['commitsByContributor'];\n }\n }",
"function list_commits ($projectDir, $db) {\n\t$dbDir = $projectDir . '/databases/' . $db . '_emuDB';\n\n\t$result = gitLog($dbDir);\n\n\tif ($result->success !== true) {\n\t\treturn $result;\n\t}\n\n\t$commitList = array();\n\tforeach ($result->data as $commit) {\n\t\t$commitObject = new GitCommit();\n\n\t\t$firstSeparator = strpos($commit, '/');\n\t\t$secondSeparator = strpos($commit, '/', $firstSeparator + 1);\n\n\t\t$commitObject->commitID = substr($commit, 0, $firstSeparator);\n\t\t$commitObject->date = substr($commit, $firstSeparator + 1,\n\t\t\t$secondSeparator - $firstSeparator - 1);\n\t\t$commitObject->message = substr($commit, $secondSeparator + 1);\n\n\t\t$commitList[] = $commitObject;\n\t}\n\n\n\treturn positiveResult(\n\t\t$commitList\n\t);\n}",
"public function getCommits(Request $request) : JsonResponse\n {\n $client = new Client(['headers' => [\n 'Accept' => 'application/vnd.github.cloak-preview',\n ]\n ]);\n\n $user = $request->get('user');\n $repo = $request->get('repo');\n $from = $request->get('from');\n $to = $request->get('to');\n $authorUsername = $request->get('author-username');\n\n $url = 'https://api.github.com/';\n $url .= \"search/commits?q=\";\n $url .= \"+committer-date:{$from}..{$to}\";\n $url .= \"+repo:{$user}/{$repo}\";\n $url .= \"+author:{$authorUsername}\";\n\n try {\n $result = $client->get($url, [\n 'auth' => [\n env('GITHUB_USERNAME'),\n env('GITHUB_PASSWORD') ]\n ]);\n $res = json_decode($result->getBody()->getContents());\n $commits = $this->requestCommits($res->items, $user, $repo, $client);\n\n return response()->json([\n 'user' => $user,\n 'repo' => $repo,\n 'from' => $from,\n 'to' => $to,\n 'author-username' => $authorUsername,\n 'results' => $commits], 200);\n\n\n } catch(GuzzleException $e){\n return response()->json([\n 'user' => $user,\n 'repo' => $repo,\n 'from' => $from,\n 'to' => $to,\n 'author-username' => $authorUsername,\n 'status' => 'fail',\n 'message' => $e->getMessage()\n ], 500);\n }\n\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getTotalDiscount returns the total discount value of the transaction | public function getTotalDiscount()
{
return $this->totalDiscount;
} | [
"public function getTotalDiscountAmount();",
"public function getDiscountTotal();",
"public function getTotaldiscount()\n {\n return $this->totaldiscount;\n }",
"public function totalDiscount()\n {\n return $this->cart->get_discount_total();\n }",
"public function getDiscountTotal()\n {\n return $this->discount_total;\n }",
"public function getDiscountAmount();",
"public function getDiscountTotal()\n {\n return $this->basket()->getDiscountTotal();\n }",
"public function getDiscountedAmount();",
"public function get_cart_discount_total()\n {\n }",
"public function getDiscountAmount(){\n return $this->_getData(self::DISCOUNT_AMOUNT);\n }",
"public function get_cart_discount_total() {\n\t\treturn $this->get_discount_total();\n\t}",
"public function getRowTotalWithDiscount();",
"public function getTotalDiscountSum()\n {\n /** @var oxBasket $this */\n\n $dPrice = 0;\n\n // subtracting total discount\n if ($oPrice = $this->getTotalDiscount()) {\n $dPrice += $oPrice->getPrice();\n }\n\n if ($oVoucherPrice = $this->getVoucherDiscount()) {\n $dPrice += $oVoucherPrice->getPrice();\n }\n\n return $dPrice;\n }",
"function get_cart_discount_total() {\n\t\t\treturn $this->discount_cart;\n\t\t}",
"public function getAmountDiscountByTotalPrice()\n {\n return $this->amountDiscountByTotalPrice;\n }",
"public function getSubtotalWithDiscount();",
"public function getDiscountAmount()\n {\n return $this->getData(self::DISCOUNT_AMOUNT);\n }",
"public function getSubtotalWithDiscount()\n {\n return $this->getSubtotal()+$this->getDiscountAmount();\n }",
"public function totalDiscount()\n\t{\n\t\t$total_discount = 0;\n\t\tforeach ($this->products as $product) {\n\t\t\t$total_discount += $product->discount() * $product->quantity();\n\t\t}\n\n\t\treturn $total_discount;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assertions for plural rules fifteen | public function assertRulesFifteen() {
$singular = $this->_singular();
$this->assertEquals('Plural Rule 15 (translated)', $singular);
$plurals = $this->_plural(111);
$this->assertTrue(in_array('0 is 0 (translated)', $plurals));
$this->assertTrue(in_array('1 is 1 (translated)', $plurals));
$this->assertTrue(in_array('2 is 2 (translated)', $plurals));
$this->assertTrue(in_array('3 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('4 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('5 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('6 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('7 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('8 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('9 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('10 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('11 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('12 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('13 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('14 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('15 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('16 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('17 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('18 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('19 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('20 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('31 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('42 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('53 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('64 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('75 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('86 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('97 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('98 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('99 ends with 11-99 (translated)', $plurals));
$this->assertTrue(in_array('100 everything else (translated)', $plurals));
$this->assertTrue(in_array('101 everything else (translated)', $plurals));
$this->assertTrue(in_array('102 everything else (translated)', $plurals));
$this->assertTrue(in_array('103 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('104 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('105 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('106 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('107 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('108 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('109 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('110 ends with 03-10 (translated)', $plurals));
$this->assertTrue(in_array('111 ends with 11-99 (translated)', $plurals));
$coreSingular = $this->_singularFromCore();
$this->assertEquals('Plural Rule 15 (from core translated)', $coreSingular);
$corePlurals = $this->_pluralFromCore(111);
$this->assertTrue(in_array('0 is 0 (from core translated)', $corePlurals));
$this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals));
$this->assertTrue(in_array('2 is 2 (from core translated)', $corePlurals));
$this->assertTrue(in_array('3 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('4 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('5 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('6 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('7 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('8 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('9 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('10 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('11 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('12 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('13 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('14 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('15 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('16 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('17 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('18 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('19 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('20 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('31 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('42 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('53 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('64 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('75 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('86 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('97 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('98 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('99 ends with 11-99 (from core translated)', $corePlurals));
$this->assertTrue(in_array('100 everything else (from core translated)', $corePlurals));
$this->assertTrue(in_array('101 everything else (from core translated)', $corePlurals));
$this->assertTrue(in_array('102 everything else (from core translated)', $corePlurals));
$this->assertTrue(in_array('103 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('104 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('105 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('106 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('107 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('108 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('109 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('110 ends with 03-10 (from core translated)', $corePlurals));
$this->assertTrue(in_array('111 ends with 11-99 (from core translated)', $corePlurals));
} | [
"public function assertRulesThirteen() {\n\t\t$singular = $this->_singular();\n\t\t$this->assertEquals('Plural Rule 13 (translated)', $singular);\n\n\t\t$plurals = $this->_plural();\n\t\t$this->assertTrue(in_array('0 is 0 or ends in 01-10 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('1 is 1 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('2 is 0 or ends in 01-10 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('3 is 0 or ends in 01-10 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('4 is 0 or ends in 01-10 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('5 is 0 or ends in 01-10 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('6 is 0 or ends in 01-10 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('7 is 0 or ends in 01-10 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('8 is 0 or ends in 01-10 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('9 is 0 or ends in 01-10 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('10 is 0 or ends in 01-10 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('11 ends in 11-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('12 ends in 11-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('13 ends in 11-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('14 ends in 11-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('15 ends in 11-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('16 ends in 11-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('17 ends in 11-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('18 ends in 11-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('19 ends in 11-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('20 ends in 11-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('21 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('22 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('23 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('24 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('25 everything else (translated)', $plurals));\n\n\t\t$coreSingular = $this->_singularFromCore();\n\t\t$this->assertEquals('Plural Rule 13 (from core translated)', $coreSingular);\n\n\t\t$corePlurals = $this->_pluralFromCore();\n\t\t$this->assertTrue(in_array('0 is 0 or ends in 01-10 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('2 is 0 or ends in 01-10 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('3 is 0 or ends in 01-10 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('4 is 0 or ends in 01-10 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('5 is 0 or ends in 01-10 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('6 is 0 or ends in 01-10 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('7 is 0 or ends in 01-10 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('8 is 0 or ends in 01-10 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('9 is 0 or ends in 01-10 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('10 is 0 or ends in 01-10 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('11 ends in 11-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('12 ends in 11-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('13 ends in 11-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('14 ends in 11-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('15 ends in 11-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('16 ends in 11-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('17 ends in 11-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('18 ends in 11-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('19 ends in 11-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('20 ends in 11-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals));\n\t}",
"public function testPluralize() {\n\t\t// irregular\n\t\t$this->assertEquals('opuses', Inflector::pluralize('opus'));\n\t\t$this->assertEquals('penises', Inflector::pluralize('penis'));\n\t\t$this->assertEquals('loaves', Inflector::pluralize('loaf'));\n\t\t$this->assertEquals('mythoi', Inflector::pluralize('mythos'));\n\t\t$this->assertEquals('men', Inflector::pluralize('man'));\n\n\t\t// uninflected\n\t\t$this->assertEquals('information', Inflector::pluralize('information'));\n\t\t$this->assertEquals('corps', Inflector::pluralize('corps'));\n\t\t$this->assertEquals('gallows', Inflector::pluralize('gallows'));\n\t\t$this->assertEquals('maltese', Inflector::pluralize('maltese'));\n\t\t$this->assertEquals('rice', Inflector::pluralize('rice'));\n\n\t\t// plural\n\t\t$this->assertEquals('matrices', Inflector::pluralize('matrix'));\n\t\t$this->assertEquals('buses', Inflector::pluralize('bus'));\n\t\t$this->assertEquals('perches', Inflector::pluralize('perch'));\n\t\t$this->assertEquals('people', Inflector::pluralize('person'));\n\t\t$this->assertEquals('bananas', Inflector::pluralize('banana'));\n\n\t\t// already plural\n\t\t$this->assertEquals('opuses', Inflector::pluralize('opuses'));\n\t\t$this->assertEquals('penises', Inflector::pluralize('penises'));\n\t\t$this->assertEquals('loaves', Inflector::pluralize('loaves'));\n\t\t$this->assertEquals('mythoi', Inflector::pluralize('mythoi'));\n\t\t$this->assertEquals('men', Inflector::pluralize('men'));\n\t}",
"public function assertRulesSix() {\n\t\t$singular = $this->_singular();\n\t\t$this->assertEquals('Plural Rule 6 (translated)', $singular);\n\n\t\t$plurals = $this->_plural();\n\t\t$this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('1 ends in 1, not 11 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('2 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('3 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('4 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('5 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('6 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('7 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('8 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('9 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('10 ends in 0 or ends in 10-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('11 ends in 0 or ends in 10-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('12 ends in 0 or ends in 10-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('13 ends in 0 or ends in 10-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('14 ends in 0 or ends in 10-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('15 ends in 0 or ends in 10-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('16 ends in 0 or ends in 10-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('17 ends in 0 or ends in 10-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('18 ends in 0 or ends in 10-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('19 ends in 0 or ends in 10-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('20 ends in 0 or ends in 10-20 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('21 ends in 1, not 11 (translated)', $plurals));\n\t\t$this->assertTrue(in_array('22 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('23 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('24 everything else (translated)', $plurals));\n\t\t$this->assertTrue(in_array('25 everything else (translated)', $plurals));\n\n\t\t$coreSingular = $this->_singularFromCore();\n\t\t$this->assertEquals('Plural Rule 6 (from core translated)', $coreSingular);\n\n\t\t$corePlurals = $this->_pluralFromCore();\n\t\t$this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('1 ends in 1, not 11 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('2 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('3 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('4 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('10 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('11 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('12 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('13 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('14 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('15 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('16 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('17 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('18 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('19 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('20 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('21 ends in 1, not 11 (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals));\n\t}",
"public function testPluralize() {\n // irregular\n $this->assertEquals('opuses', Inflector::pluralize('opus'));\n $this->assertEquals('penises', Inflector::pluralize('penis'));\n $this->assertEquals('loaves', Inflector::pluralize('loaf'));\n $this->assertEquals('mythoi', Inflector::pluralize('mythos'));\n $this->assertEquals('men', Inflector::pluralize('man'));\n\n // uninflected\n $this->assertEquals('information', Inflector::pluralize('information'));\n $this->assertEquals('corps', Inflector::pluralize('corps'));\n $this->assertEquals('gallows', Inflector::pluralize('gallows'));\n $this->assertEquals('maltese', Inflector::pluralize('maltese'));\n $this->assertEquals('rice', Inflector::pluralize('rice'));\n\n // plural\n $this->assertEquals('matrices', Inflector::pluralize('matrix'));\n $this->assertEquals('buses', Inflector::pluralize('bus'));\n $this->assertEquals('perches', Inflector::pluralize('perch'));\n $this->assertEquals('people', Inflector::pluralize('person'));\n $this->assertEquals('bananas', Inflector::pluralize('banana'));\n\n // already plural\n $this->assertEquals('opuses', Inflector::pluralize('opuses'));\n $this->assertEquals('penises', Inflector::pluralize('penises'));\n $this->assertEquals('loaves', Inflector::pluralize('loaves'));\n $this->assertEquals('mythoi', Inflector::pluralize('mythoi'));\n $this->assertEquals('men', Inflector::pluralize('men'));\n }",
"public function testPlurals11() {\n\t\t$locales = array(\n\t\t\t'ga'\n\t\t);\n\t\tforeach ($locales as $locale) {\n\t\t\t$expected = 3;\n\t\t\t$result = Catalog::read(true, 'message.pluralForms', $locale);\n\t\t\t$this->assertEqual($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\n\t\t\t$rule = Catalog::read(true, 'message.pluralRule', $locale);\n\n\t\t\t$expected = '20122222222222222222222222222222222222222222222222';\n\t\t\t$expected .= '22222222222222222222222222222222222222222222222222';\n\t\t\t$expected .= '22222222222222222222222222222222222222222222222222';\n\t\t\t$expected .= '22222222222222222222222222222222222222222222222222';\n\t\t\t$result = '';\n\n\t\t\tfor ($n = 0; $n < 200; $n++) {\n\t\t\t\t$result .= $rule($n);\n\t\t\t}\n\t\t\t$this->assertIdentical($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\t\t}\n\t}",
"public function assertRulesZero() {\n\t\t$singular = $this->_singular();\n\t\t$this->assertEquals('Plural Rule 0 (translated)', $singular);\n\n\t\t$plurals = $this->_plural();\n\t\t$this->assertTrue(in_array('0 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('1 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('2 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('3 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('4 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('5 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('6 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('7 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('8 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('9 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('10 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('11 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('12 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('13 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('14 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('15 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('16 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('17 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('18 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('19 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('20 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('21 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('22 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('23 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('24 ends with any # (translated)', $plurals));\n\t\t$this->assertTrue(in_array('25 ends with any # (translated)', $plurals));\n\n\t\t$coreSingular = $this->_singularFromCore();\n\t\t$this->assertEquals('Plural Rule 0 (from core translated)', $coreSingular);\n\n\t\t$corePlurals = $this->_pluralFromCore();\n\t\t$this->assertTrue(in_array('0 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('1 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('2 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('3 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('4 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('5 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('6 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('7 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('8 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('9 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('10 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('11 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('12 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('13 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('14 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('15 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('16 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('17 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('18 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('19 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('20 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('21 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('22 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('23 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('24 ends with any # (from core translated)', $corePlurals));\n\t\t$this->assertTrue(in_array('25 ends with any # (from core translated)', $corePlurals));\n\t}",
"public function testPlurals5() {\n\t\t$locales = array(\n\t\t\t'ro'\n\t\t);\n\t\tforeach ($locales as $locale) {\n\t\t\t$expected = 3;\n\t\t\t$result = Catalog::read(true, 'message.pluralForms', $locale);\n\t\t\t$this->assertEqual($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\n\t\t\t$rule = Catalog::read(true, 'message.pluralRule', $locale);\n\n\t\t\t$expected = '10111111111111111111222222222222222222222222222222';\n\t\t\t$expected .= '22222222222222222222222222222222222222222222222222';\n\t\t\t$expected .= '21111111111111111111222222222222222222222222222222';\n\t\t\t$expected .= '22222222222222222222222222222222222222222222222222';\n\t\t\t$result = '';\n\n\t\t\tfor ($n = 0; $n < 200; $n++) {\n\t\t\t\t$result .= $rule($n);\n\t\t\t}\n\t\t\t$this->assertIdentical($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\t\t}\n\t}",
"public function testPluralName()\n {\n $assertions = [\n DataObjectTest\\Player::class => 'Players',\n DataObjectTest\\Team::class => 'Teams',\n DataObjectTest\\Fixture::class => 'Fixtures',\n DataObjectTest\\Play::class => 'Plays',\n DataObjectTest\\Bogey::class => 'Bogeys',\n DataObjectTest\\Ploy::class => 'Ploys',\n ];\n i18n::set_locale('en_NZ');\n foreach ($assertions as $class => $expectedPluralName) {\n $this->assertEquals(\n $expectedPluralName,\n DataObject::singleton($class)->plural_name(),\n \"Assert that the plural_name for '$class' is correct.\"\n );\n $this->assertEquals(\n $expectedPluralName,\n DataObject::singleton($class)->i18n_plural_name(),\n \"Assert that the i18n_plural_name for '$class' is correct.\"\n );\n }\n }",
"public function testPlurals2() {\n\t\t$locales = [\n\t\t\t'fr'\n\t\t];\n\t\tforeach ($locales as $locale) {\n\t\t\t$expected = 2;\n\t\t\t$result = Catalog::read(true, 'message.pluralForms', $locale);\n\t\t\t$this->assertEqual($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\n\t\t\t$rule = Catalog::read(true, 'message.pluralRule', $locale);\n\n\t\t\t$expected = '00111111111111111111111111111111111111111111111111';\n\t\t\t$expected .= '11111111111111111111111111111111111111111111111111';\n\t\t\t$expected .= '11111111111111111111111111111111111111111111111111';\n\t\t\t$expected .= '11111111111111111111111111111111111111111111111111';\n\t\t\t$result = '';\n\n\t\t\tfor ($n = 0; $n < 200; $n++) {\n\t\t\t\t$result .= $rule($n);\n\t\t\t}\n\t\t\t$this->assertIdentical($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\t\t}\n\t}",
"public function testPluralize() {\r\n $this->assertEquals(Inflector::pluralize('categoria'), 'categorias');\r\n $this->assertEquals(Inflector::pluralize('house'), 'houses');\r\n $this->assertEquals(Inflector::pluralize('powerhouse'), 'powerhouses');\r\n $this->assertEquals(Inflector::pluralize('Bus'), 'Buses');\r\n $this->assertEquals(Inflector::pluralize('bus'), 'buses');\r\n $this->assertEquals(Inflector::pluralize('menu'), 'menus');\r\n $this->assertEquals(Inflector::pluralize('news'), 'news');\r\n $this->assertEquals(Inflector::pluralize('food_menu'), 'food_menus');\r\n $this->assertEquals(Inflector::pluralize('Menu'), 'Menus');\r\n $this->assertEquals(Inflector::pluralize('FoodMenu'), 'FoodMenus');\r\n $this->assertEquals(Inflector::pluralize('quiz'), 'quizzes');\r\n $this->assertEquals(Inflector::pluralize('matrix_row'), 'matrix_rows');\r\n $this->assertEquals(Inflector::pluralize('matrix'), 'matrices');\r\n $this->assertEquals(Inflector::pluralize('vertex'), 'vertices');\r\n $this->assertEquals(Inflector::pluralize('index'), 'indices');\r\n $this->assertEquals(Inflector::pluralize('Alias'), 'Aliases');\r\n $this->assertEquals(Inflector::pluralize('Aliases'), 'Aliases');\r\n $this->assertEquals(Inflector::pluralize('Media'), 'Media');\r\n $this->assertEquals(Inflector::pluralize('alumnus'), 'alumni');\r\n $this->assertEquals(Inflector::pluralize('bacillus'), 'bacilli');\r\n $this->assertEquals(Inflector::pluralize('cactus'), 'cacti');\r\n $this->assertEquals(Inflector::pluralize('focus'), 'foci');\r\n $this->assertEquals(Inflector::pluralize('fungus'), 'fungi');\r\n $this->assertEquals(Inflector::pluralize('nucleus'), 'nuclei');\r\n $this->assertEquals(Inflector::pluralize('octopus'), 'octopuses');\r\n $this->assertEquals(Inflector::pluralize('radius'), 'radii');\r\n $this->assertEquals(Inflector::pluralize('stimulus'), 'stimuli');\r\n $this->assertEquals(Inflector::pluralize('syllabus'), 'syllabi');\r\n $this->assertEquals(Inflector::pluralize('terminus'), 'termini');\r\n $this->assertEquals(Inflector::pluralize('virus'), 'viri');\r\n $this->assertEquals(Inflector::pluralize('person'), 'people');\r\n $this->assertEquals(Inflector::pluralize('people'), 'people');\r\n $this->assertEquals(Inflector::pluralize('glove'), 'gloves');\r\n $this->assertEquals(Inflector::pluralize(''), '');\r\n\r\n $result = Inflector::pluralize('errata');\r\n $this->assertNull(Inflector::rules('plural', array('/rata/' => '\\1ratum')));\r\n $this->assertEquals(Inflector::pluralize('errata'), $result);\r\n\r\n Inflector::reset();\r\n $this->assertNotEquals(Inflector::pluralize('errata'), $result);\r\n }",
"public function testPlurals3() {\n\t\t$locales = array(\n\t\t\t'lv'\n\t\t);\n\t\tforeach ($locales as $locale) {\n\t\t\t$expected = 3;\n\t\t\t$result = Catalog::read(true, 'message.pluralForms', $locale);\n\t\t\t$this->assertEqual($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\n\t\t\t$rule = Catalog::read(true, 'message.pluralRule', $locale);\n\n\t\t\t$expected = '01222222222222222222212222222221222222222122222222';\n\t\t\t$expected .= '21222222222122222222212222222221222222222122222222';\n\t\t\t$expected .= '21222222222222222222212222222221222222222122222222';\n\t\t\t$expected .= '21222222222122222222212222222221222222222122222222';\n\t\t\t$result = '';\n\n\t\t\tfor ($n = 0; $n < 200; $n++) {\n\t\t\t\t$result .= $rule($n);\n\t\t\t}\n\t\t\t$this->assertIdentical($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\t\t}\n\t}",
"public function testPlurals9() {\n\t\t$locales = array(\n\t\t\t'pl'\n\t\t);\n\t\tforeach ($locales as $locale) {\n\t\t\t$expected = 3;\n\t\t\t$result = Catalog::read(true, 'message.pluralForms', $locale);\n\t\t\t$this->assertEqual($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\n\t\t\t$rule = Catalog::read(true, 'message.pluralRule', $locale);\n\n\t\t\t$expected = '20111222222222222222221112222222111222222211122222';\n\t\t\t$expected .= '22111222222211122222221112222222111222222211122222';\n\t\t\t$expected .= '22111222222222222222221112222222111222222211122222';\n\t\t\t$expected .= '22111222222211122222221112222222111222222211122222';\n\t\t\t$result = '';\n\n\t\t\tfor ($n = 0; $n < 200; $n++) {\n\t\t\t\t$result .= $rule($n);\n\t\t\t}\n\t\t\t$this->assertIdentical($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\t\t}\n\t}",
"public function testPlurals2() {\n\t\t$locales = array(\n\t\t\t'fr', 'pt_BR'\n\t\t);\n\t\tforeach ($locales as $locale) {\n\t\t\t$expected = 2;\n\t\t\t$result = Catalog::read(true, 'message.pluralForms', $locale);\n\t\t\t$this->assertEqual($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\n\t\t\t$rule = Catalog::read(true, 'message.pluralRule', $locale);\n\n\t\t\t$expected = '00111111111111111111111111111111111111111111111111';\n\t\t\t$expected .= '11111111111111111111111111111111111111111111111111';\n\t\t\t$expected .= '11111111111111111111111111111111111111111111111111';\n\t\t\t$expected .= '11111111111111111111111111111111111111111111111111';\n\t\t\t$result = '';\n\n\t\t\tfor ($n = 0; $n < 200; $n++) {\n\t\t\t\t$result .= $rule($n);\n\t\t\t}\n\t\t\t$this->assertIdentical($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\t\t}\n\t}",
"public function testPlurals7() {\n\t\t$locales = array(\n\t\t\t'hr', 'sr', 'ru', 'uk'\n\t\t);\n\t\tforeach ($locales as $locale) {\n\t\t\t$expected = 3;\n\t\t\t$result = Catalog::read(true, 'message.pluralForms', $locale);\n\t\t\t$this->assertEqual($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\n\t\t\t$rule = Catalog::read(true, 'message.pluralRule', $locale);\n\n\t\t\t$expected = '20111222222222222222201112222220111222222011122222';\n\t\t\t$expected .= '20111222222011122222201112222220111222222011122222';\n\t\t\t$expected .= '20111222222222222222201112222220111222222011122222';\n\t\t\t$expected .= '20111222222011122222201112222220111222222011122222';\n\t\t\t$result = '';\n\n\t\t\tfor ($n = 0; $n < 200; $n++) {\n\t\t\t\t$result .= $rule($n);\n\t\t\t}\n\t\t\t$this->assertIdentical($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\t\t}\n\t}",
"public function testToPluralAlreadyPlural()\n\t{\n\t\t$this->assertFalse($this->StringInflector->toPlural('buses'));\n\t}",
"public function testPlurals0() {\n\t\t$locales = array(\n\t\t\t'ja', 'ko', 'vi'\n\t\t);\n\t\tforeach ($locales as $locale) {\n\t\t\t$expected = 1;\n\t\t\t$result = Catalog::read(true, 'message.pluralForms', $locale);\n\t\t\t$this->assertEqual($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\n\t\t\t$rule = Catalog::read(true, 'message.pluralRule', $locale);\n\n\t\t\t$expected = '00000000000000000000000000000000000000000000000000';\n\t\t\t$expected .= '00000000000000000000000000000000000000000000000000';\n\t\t\t$expected .= '00000000000000000000000000000000000000000000000000';\n\t\t\t$expected .= '00000000000000000000000000000000000000000000000000';\n\t\t\t$result = '';\n\n\t\t\tfor ($n = 0; $n < 200; $n++) {\n\t\t\t\t$result .= $rule($n);\n\t\t\t}\n\t\t\t$this->assertIdentical($expected, $result, \"Locale: `{$locale}`\\n{:message}\");\n\t\t}\n\t}",
"public function translatorSupportsPluralFormatting()\n {\n $message = '{number_of_participants, plural,'.\\PHP_EOL\n .' =0 {Nobody is participating.}'.\\PHP_EOL\n .' =1 {One person participates.}'.\\PHP_EOL\n .' other {# persons are participating.}'.\\PHP_EOL\n .'}';\n\n $translation = $this->translator->trans($message, ['%number_of_participants%' => 0]);\n self::assertEquals('Nobody is participating.', $translation);\n }",
"function isPlural($num, $word){\n if($num > 1)\n return $word.\"s\";\n else\n return $word;\n}",
"function plural($num) {\n if ($num != 1) return \"s\";\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Function UpdateMainVacationRequest This function constructs the SQL statement required to update a row in the MainVacationRequest table. $fields (array) array of key value pairs, where keys correspond to fields in the record (see constants at start of this file). Note, this array MUST provide the id of the record (MAIN_VACATION_REQ_ID) and one or more other fields to be updated. | function UpdateMainVacactionRequest($fields) {
$success = false;
$statusMessage = "";
//-------------------------------------------------------------------------
// Validate Input parameters
//--------------------------------------------------------------------------
$inputIsValid = TRUE;
$validID = false;
$countOfFields = 0;
foreach ($fields as $key => $value) {
if ($key == MAIN_VACATION_REQ_ID) {
$record = RetrieveMainVacationRequestByID($value);
if ($record <> NULL) {
$validID = true;
$countOfFields++;
}
} else if ($key == MAIN_VACATION_EMP_ID) {
$countOfFields++;
$record = RetrieveEmployeeByID($value);
if ($record == NULL) {
$statusMessage .="Invalid Main Vacation Employee ID</br>";
error_log("Invalid MAIN_VACATION_EMP_ID passed to " .
"UpdateMainVacationRequest.");
$inputIsValid = FALSE;
}
} else if ($key == MAIN_VACATION_1ST_START) {
$countOfFields++;
if (!isValidDate($value)) {
$statusMessage .="Invalid 1st Choice Start Date</br>";
error_log("Invalid MAIN_VACATION_1ST_START passed to ".
"UpdateMainVacationRequest.");
$inputIsValid = FALSE;
}
} else if ($key == MAIN_VACATION_1ST_END) {
$countOfFields++;
if (!isValidDate($value)) {
$statusMessage .="Invalid 1st Choice Finish Date/br>";
error_log("Invalid MAIN_VACATION_1ST_END passed to ".
"UpdateMainVacationRequest.");
$inputIsValid = FALSE;
}
} else if ($key == MAIN_VACATION_2ND_START) {
$countOfFields++;
if (!isValidDate($value)) {
$statusMessage .="Invalid 2nd Choice Start Date/br>";
error_log("Invalid MAIN_VACATION_2ND_START passed to ".
"UpdateMainVacationRequest.");
$inputIsValid = FALSE;
}
} else if ($key == MAIN_VACATION_2ND_END) {
$countOfFields++;
if (!isValidDate($value)) {
$statusMessage .="Invalid 2nd Choice Finish Date/br>";
error_log("Invalid MAIN_VACATION_2ND_END passed to ".
"UpdateMainVacationRequest.");
$inputIsValid = FALSE;
}
} else {
$statusMessage .="Invalid Field encountered./br>";
error_log("Invalid field passed to ".
"UpdateMainVacationRequest. $key=" . $key);
$inputIsValid = FALSE;
}
}
$firstChoiceStartDate = $fields[MAIN_VACATION_1ST_START];
$firstChoiceEndDate = $fields[MAIN_VACATION_1ST_END];
$secondChoiceStartDate = $fields[MAIN_VACATION_2ND_START];
$secondChoiceEndDate = $fields[MAIN_VACATION_2ND_END];
if (strtotime($firstChoiceEndDate) < strtotime($firstChoiceStartDate))
{
$statusMessage.="1st Choice End Date is before 1st Choice Start Date.</br>";
error_log("First Choice End Date is before First Choice Start Date.");
$inputIsValid = FALSE;
}
if (strtotime($secondChoiceEndDate) < strtotime($secondChoiceStartDate))
{
$statusMessage.="2nd Choice End Date is before 2nd Choice Start Date.</br>";
error_log("Second Choice End Date is before Second Choice Start Date.");
$inputIsValid = FALSE;
}
if (!$validID) {
$statusMessage .="No valid record ID found/br>";
error_log("No valid ID supplied in call to UpdateMainVacationRequest.");
$inputIsValid = FALSE;
}
if ($countOfFields < 2) {
$statusMessage .="You must modify at least one of the fields of the record./br>";
error_log("Insufficent fields supplied in call to UpdateMainVacationRequest.");
$inputIsValid = FALSE;
}
//--------------------------------------------------------------------------
// Only attempt to update a record in the database if the input parameters
// are ok.
//--------------------------------------------------------------------------
if ($inputIsValid) {
$success = performSQLUpdate(MAIN_VACATION_REQUEST_TABLE,
MAIN_VACATION_REQ_ID, $fields);
if ($success)
{
$statusMessage.="Record successfully modified.";
}
else
{
$inputIsValid = false;
$statusMessage.="Error encountered when updating the database. ".
"Contact system administrator.</br>";
}
}
GenerateStatus($inputIsValid, $statusMessage);
return $success;
} | [
"function sqlInsertMainVacationRequest(&$request) {\n $sql = \"INSERT INTO mainVacationRequestTable (employeeID,\".\n \"firstChoiceStartDate,firstChoiceEndDate,\" .\n \"secondChoiceStartDate,secondChoiceEndDate) \" .\n \"VALUES ('\" . $request[MAIN_VACATION_EMP_ID] .\n \"','\" . $request[MAIN_VACATION_1ST_START] . \n \"','\" . $request[MAIN_VACATION_1ST_END] .\n \"','\" . $request[MAIN_VACATION_2ND_START] . \n \"','\" . $request[MAIN_VACATION_2ND_END] . \"');\";\n $request[MAIN_VACATION_REQ_ID] = performSQLInsert($sql);\n return $request[MAIN_VACATION_REQ_ID] <> 0;\n}",
"function buildUpdateSQL($table_name, $update_key, $update_id, $fields='') {\r\n\tglobal $form;\r\n\t$updateSQL = \"UPDATE $table_name SET \";\r\n\t//turn the field names into an array\r\n\tif (is_array($fields)) {\r\n\t\t$field_list = $fields;\r\n\t} elseif (strpos($fields,',')!==false) {\r\n\t\t$field_list = explode(',', $fields);\r\n\t} elseif ($fields!='') {\r\n\t\t$field_list = array($fields); //only one field, so turn it into an array\r\n\t} else {\r\n\t\t$field_list = array_keys($form); //just grab everything from $form\r\n\t}\r\n\t//now add the keys and values to the statement\r\n\t$updates = array();\r\n\tforeach($field_list as $key) {\r\n\t\t$key = trim($key);\r\n\t\t$updates[] = $key.'='.quoteF($key, guessFieldType($key));\r\n\t}\r\n\t$updateSQL .= implode(', ', $updates);\r\n\t//append the update primary key\r\n\t$updateSQL .= ' WHERE '.$update_key.'='.quote($update_id, guessFieldType($update_key));\r\n\treturn $updateSQL;\r\n}",
"function CreateMainVacationRequestTable() {\n $sql = \"CREATE TABLE IF NOT EXISTS `mydb`.`mainVacationRequestTable` (\n `mainVacationRequestID` INT NOT NULL AUTO_INCREMENT,\n `employeeID` INT NOT NULL,\n `firstChoiceStartDate` DATE NOT NULL,\n `firstChoiceEndDate` DATE NOT NULL,\n `secondChoiceStartDate` DATE NOT NULL,\n `secondChoiceEndDate` DATE NOT NULL,\n PRIMARY KEY (`mainVacationRequestID`),\n INDEX `fk_mainVacationRequest_Employee1_idx` (`employeeID` ASC),\n CONSTRAINT `fk_mainVacationRequest_Employee1`\n FOREIGN KEY (`employeeID`)\n REFERENCES `mydb`.`EmployeeTable` (`employeeID`)\n ON DELETE NO ACTION\n ON UPDATE NO ACTION);\";\n\n performSQL($sql);\n}",
"function compile_update_sql($primarykey){\n //\n //Compile the update header section of the statement\n $sql = \"UPDATE `$this->tname` SET \";\n //\n //Set the leading comma separator to nothing; it will be updated later\n $comma = \"\";\n //\n //Compile the comma separated list of values to update\n foreach($this->fields as $fname=>$field){\n //\n //Exclude fields that cannot be modified, e.g., primary key field and\n //derived fields\n if ($field->is_modifiable()){\n //\n //Define a writable field value\n $fvalue = \"\";\n //\n //Only valid values are updated\n if ($field->try_writable_value($this->values, $fvalue)){\n //\n //Add the leading comma and compile the header. The field's \n //value is already quote delimited or is null\n $sql.= \"$comma `$fname` = $fvalue\";\n //\n //Update the comma separator\n $comma = \", \";\n }\n } \n }\n //\n //Compile the write footer section\n $sql.=\" WHERE `$this->tname` = $primarykey\";\n //\n return $sql;\n }",
"function compile_update_sql($primarykey) {\n //\n //Compile the update header section of the statement\n $sql = \"UPDATE `$this->tname` SET \";\n //\n //Set the leading comma separator to nothing; it will be updated later\n $comma = \"\";\n //\n //Compile the comma separated list of values to update\n foreach ($this->fields as $fname => $field) {\n //\n //Exclude fields that cannot be modified, e.g., primary key field and\n //derived fields\n if ($field->is_modifiable()) {\n //\n //Define a writable field value\n $xvalue = \"\";\n //\n //Only valid values are updated\n if ($field->try_writable_value($this->values, $xvalue)) {\n //\n //Add the leading comma and compile the header. The field's \n //value is already quote delimited or is null\n $sql .= \"$comma `$fname` = $xvalue\";\n //\n //Update the comma separator\n $comma = \", \";\n }\n }\n }\n //\n //Compile the write footer section\n $sql .= \" WHERE `$this->tname` = $primarykey\";\n //\n return $sql;\n }",
"function UpdateApprovedAbsenceBooking($fields) {\n $statusMessage = \"\";\n //--------------------------------------------------------------------------------\n // Validate Input parameters\n //--------------------------------------------------------------------------------\n $inputIsValid = TRUE;\n $validID = false;\n $countOfFields = 0;\n\n foreach ($fields as $key => $value) {\n if ($key == APPR_ABS_BOOKING_ID) {\n $record = RetrieveApprovedAbsenceBookingByID($value);\n if ($record <> NULL) {\n $validID = true;\n $countOfFields++;\n }\n } else if ($key == APPR_ABS_EMPLOYEE_ID) {\n $countOfFields++;\n\n $record = RetrieveEmployeeByID($value);\n if ($record == NULL) {\n $statusMessage.=\"Unable to locate employee in database</br>\";\n error_log(\"Invalid EMP_ID passed to \" .\n \"UpdateApprovedAbsenceBooking. Value=\" . $value);\n $inputIsValid = FALSE;\n }\n } else if ($key == APPR_ABS_START_DATE) {\n $countOfFields++;\n\n if (!isValidDate($value)) {\n $statusMessage.=\"Start date is not a valid date.</br>\";\n error_log(\"Invalid APPR_ABS_START_DATE passed to \" .\n \"UpdateApprovedAbsenceBooking. Value=\" . $value);\n $inputIsValid = FALSE;\n }\n } else if ($key == APPR_ABS_END_DATE) {\n $countOfFields++;\n\n if (!isValidDate($value)) {\n $statusMessage.=\"End date is not a valid date.</br>\";\n error_log(\"Invalid APPR_ABS_END_DATE passed to \" .\n \"UpdateApprovedAbsenceBooking. Value=\" . $value);\n $inputIsValid = FALSE;\n }\n } else if ($key == APPR_ABS_ABS_TYPE_ID) {\n $countOfFields++;\n\n $record = RetrieveAbsenceTypeByID($value);\n if ($record == NULL) {\n $statusMessage.=\"Unable to locate absence type in database</br>\";\n error_log(\"Invalid APPR_ABS_ABS_TYPE_ID passed to \" .\n \"UpdateApprovedAbsenceBooking. Value=\" . $value);\n $inputIsValid = FALSE;\n }\n } else {\n $statusMessage.=\"Unexpected field found in input</br>\";\n error_log(\"Invalid field passed to UpdateApprovedAbsenceBooking.\" .\n \" $key=\" . $key);\n $inputIsValid = FALSE;\n }\n }\n \n $absenceStartDate = $fields[APPR_ABS_START_DATE];\n $absenceEndDate = $fields[APPR_ABS_END_DATE];\n \n if (strtotime($absenceEndDate) < strtotime($absenceStartDate)) \n {\n $statusMessage.=\"end Date is before start Date.</br>\";\n error_log(\"End Date is before Start Date.\");\n $inputIsValid = FALSE;\n }\n\n\n if (!$validID) {\n $statusMessage.=\"No valid ID supplied</br>\";\n error_log(\"No valid ID supplied in call to UpdateApprovedAbsenceBooking.\");\n $inputIsValid = FALSE;\n }\n\n if ($countOfFields < 2) {\n $statusMessage.=\"Insufficent fields supplied</br>\";\n error_log(\"Insufficent fields supplied in call to UpdateApprovedAbsenceBooking.\");\n $inputIsValid = FALSE;\n }\n\n //--------------------------------------------------------------------------------\n // Only attempt to update a record in the database if the input parameters are ok.\n //--------------------------------------------------------------------------------\n $success = false;\n\n if ($inputIsValid) {\n $success = performSQLUpdate(APPROVED_ABSENCE_BOOKING_TABLE, APPR_ABS_BOOKING_ID, $fields);\n if ($success)\n {\n $statusMessage.=\"Record updated successfully.</br>\";\n }\n else \n {\n $statusMessage.=\"Unexpected error encountered when updating database.</br>\";\n $inputIsValid = false;\n }\n }\n \n GenerateStatus($inputIsValid, $statusMessage);\n return $success;\n}",
"public function editSpareTyre($mainTyre) {\n global $REQUEST_DATA;\n\n\t $query = \"\tUPDATE\ttyre_history\n\t\t\t\t\tSET\t\tusedAsMainTyre = 0\n\t\t\t\t\tWHERE\ttyreId = $mainTyre \";\n\t\treturn SystemDatabaseManager::getInstance()->executeUpdateInTransaction($query);\n\n //return SystemDatabaseManager::getInstance()->runAutoUpdate('tyre_master', array('tyreNumber','manufacturer','modelNumber','purchaseDate','isActive'), array(trim($REQUEST_DATA['tyreNumber']),trim($REQUEST_DATA['manufacturer']),trim($REQUEST_DATA['modelNumber']),trim($REQUEST_DATA['purchaseDate']),trim($REQUEST_DATA['isActive'])) , \"tyreId=$id\" );\n }",
"public function executeUpdateVDRecords(sfWebRequest $request)\n {\n \tinclude_once(JsConstants::$docRoot.\"/jsadmin/connect.inc\");\n\t$privilage = explode(\"+\",getprivilage($this->cid));\n\tif(in_array(\"IA\",$privilage))\n\t{\n\t\t//Start -transfer records from client table to temp table\n\t\t$params[\"limit\"] = uploadVD::$RECORDS_SELECTED_PER_TRANSFER; //no of records picked at a time\n\t\t$this->transferVDRecords($params);\n\t\t//End -transfer records \n\n\t\t// Background script execute to populate entries to Main VD tables\n\t\tpassthru(JsConstants::$php5path.\" \".JsConstants::$alertSymfonyRoot.\"/symfony billing:populateVDEntriesFromTempTable > /dev/null &\");\n\t\t/*if($out!=0){\n\t\t\t$message = \"Error in running populateVDEntriesFromTempTable cron\";\n\t\t\t$this->forwardTo(\"commoninterface\",\"uploadVD?BACKGROUND_SCRIPT_FAILURE=1&cid=\".$this->cid);\n\t\t}*/\n\t\t//show success message\n\t\t$this->forwardTo(\"commoninterface\",\"uploadVD?SUCCESSFUL=1&cid=\".$this->cid);\n\t}\n\telse{\n\t\t$this->forwardTo(\"commoninterface\",\"uploadVD?UNAUTHORIZED=1&cid=\".$this->cid);\n\t}\t\n }",
"function update_vacancy()\n{\n // Update the vacancy itself\n base_query(\"UPDATE Vacancy \n SET Title = :title, \n Description = :description, \n Function = :function, \n Employment = :employment\n WHERE Id = :vacancyId\", [\n ':title' => $_POST['Title'],\n ':description' => $_POST['Description'],\n ':function' => $_POST['Function'],\n ':employment' => $_POST['Employment'],\n ':vacancyId' => $_GET['vacancy']\n ]);\n\n // Ugly: We delete the requirements first and then re-add them later. Can we do this better?\n base_query(\"DELETE FROM Requirement WHERE Vacancy = :vacancy\", [':vacancy' => $_GET['vacancy']]);\n\n insert_requirements($_GET['vacancy']);\n}",
"function RetrieveMainVacationRequestByID($id) {\n $filter[MAIN_VACATION_REQ_ID] = $id;\n $resultArray = performSQLSelect(MAIN_VACATION_REQUEST_TABLE, $filter);\n\n $result = NULL;\n\n if (count($resultArray) == 1) { //Check to see if record was found.\n $result = $resultArray[0];\n }\n\n return $result;\n}",
"public function updateRequest()\n {\n // instantiate a Request model\n $r = new Requests();\n\n // grab Request info to be updated and determine rid, cid, sid\n $tempRequest = Input::all();\n $rid = $tempRequest['rid'];\n $cid = $tempRequest['cid'];\n $sid = $tempRequest['sid'];\n\n // combine date and time into one value for validation and input\n $tempRequest['scheduled_date'] = $tempRequest['scheduled_date'].\" \".$tempRequest['scheduled_time'];\n\n // determine if User is allowed to update Request\n if($r->authorize($cid))\n {\n // determine if the input is valid, testing against the rules of the Request model\n if($r->validate($tempRequest))\n {\n // find correct Request to update\n $request = Requests::where('rid', $rid)\n ->where('cid', Auth::id())\n ->where('sid', $sid)\n ->first();\n\n // test is the scheduled date has changed from its previous value\n if($request->scheduled_date != $tempRequest['scheduled_date'].\" \".$tempRequest['scheduled_time'])\n {\n // scheduled date has changed\n $dateChanged = 1;\n }\n else\n {\n // scheduled date has not changed\n $dateChanged = 0;\n }\n\n // determine new approval status from previous approval status and input approval status using Request model decision method and array\n $approvals = $r->decision(intval($dateChanged),\n intval($request->center_approval.$request->student_approval),\n intval($tempRequest['center_approval'].$request->student_approval));\n\n // undetermined approval status\n if($approvals[0] == 3 && $approvals[1] == 3)\n {\n // FUTURE - nothing changes -> prevented operation\n }\n // both approvals are denied status, and request should be deleted\n elseif($approvals[0] == 4 && $approvals[1] == 4)\n {\n // delete correct request\n $this->deleteRequest($rid, $cid, $sid);\n\n // send to schedule view\n return CenterController::showSchedule();\n }\n // error in approval status\n elseif($approvals[0] == 8 && $approvals[1] == 8)\n {\n // FUTURE ignored for now -> to fix in decision table or by avoidance\n }\n // valid approval status\n else\n {\n // update Request values\n $request->scheduled_date = $tempRequest['scheduled_date'];\n $request->center_notes = $tempRequest['center_notes'];\n $request->center_approval = $approvals[0];\n $request->student_approval = $approvals[1];\n\n // save new values to DB\n $request->save();\n\n // send to schedule view\n return CenterController::showSchedule();\n }\n }\n else\n {\n // invalid input based on rules of Request model\n redirect();\n }\n }\n else\n {\n // wrong user / authentication failure\n redirect();\n }\n }",
"function updateRecords($params) //+\n{\n\n\t/* examples:\n\t * action=updateRecords & tablename=comments & updatefield=statusid & updatevalue=4 & idfield=id & idvalues=1,2,3,4\n\t * action=updateRecords & tablename=media_terms & updatefield=termid & updatevalue=7 & idfield=contentid & idvalues=4,5\n\t */\n\n\t$sendParams = array();\n\n\t// gets array of fields name for 'tablename'\n\t$columnsArray = getTableColumns($params['tablename']);\n\n\t// make sure we have a content id and tablename\n\tif (isset($params['tablename']) && isset($params['idfield']) && isset($params['idvalues']) && isset($params['updatefield']) && isset($params['updatevalue'])) {\n\t\t$sql = \"UPDATE `\".$params['tablename'].\"` SET \";\n\n\t\tif (in_array($params['updatefield'], $columnsArray)) // checks for misspelling of field name\n\t\t$sql .= $params['updatefield'].\" = :updatevalue \";\n\t\telse die(\"Unknown field name '\".$params['updatefield'].\"'.\");\n\n\t\tif (in_array($params['idfield'], $columnsArray)) // checks for misspelling of field name\n\t\t$sql .= \" WHERE \".$params['idfield'].\" IN ( \";\n\t\telse die(\"Unknown field name '\".$params['idfield'].\"'.\");\n\t\t\t\n\t\t// $params['idvalues'] can be comma-delimited\n\t\t$manyvalues = explode(\",\",$params['idvalues']);\n\t\tforeach($manyvalues as $value)\n\t\t{\n\t\t\t$sql .= \" :singlevalue\".$value.\", \";\n\t\t\t$sendParams['singlevalue'.$value] = $value;\n\t\t}\n\t\t$sql = substr($sql,0,strlen($sql)-2); //remove last comma and space\n\t\t\t\n\t\t$sql .= \" )\";\n\t\t$sendParams['updatevalue'] = $params['updatevalue'];\n\t} else {\n\t\tdie(\"No tablename or idfield/idvalue or updatefield/updatevalue parameters provided.\");\n\t}\n\n\tforeach ($params as $key=>$value)\n\t{\n\t\tif ($key != 'action' && $key != 'tablename' && $key != 'updatefield' && $key != 'updatevalue' && $key != 'idfield' && $key != 'idvalues') {\n\t\t\tif (in_array($key,$columnsArray)) {\n\t\t\t\t$sql .= \" AND \" . $key . \" = :\".$key;\n\t\t\t\t$sendParams[$key] = $value;\n\t\t\t} else die(\"Unknown field name '$key'.\");\n\t\t}\n\t}\n\t// get the results\n\tif ($result = queryDatabase($sql, $sendParams)) {\n//\t\tif ($params['tablename'] == \"content\") {\n//\t\t\tupdateContainerPaths($params['id'],null); // updates 'containerpath' field\n//\t\t}\n\n\t\tif (isset($params['verbosity'])) {\n\t\t\t$params2['verbosity'] = $params['verbosity'];\n\t\t\t$params2['contentid'] = $params['id'];\n\t\t\t$result = getContent($params2);\n\n\t\t\t// output the serialized xml\n\t\t\treturn $result;\n\t\t}\n\t\telse sendSuccess();\n\t} else die(\"Query Failed: \" . $result->errorInfo());\n}",
"public function setForeignKey($strMainTable,$strRelatedTable,$arrMainKey = array('id' => array()),$arrReferedKey = array('id' => array()),$strOnDelete = 'CASCADE',$strOnUpdate = 'CASCADE',$strMatch = 'FULL',$strKeyName = '') {\n\t\tif(!is_string($strMainTable) \t|| empty($strMainTable)) \treturn false;\n\t\tif(!is_string($strRelatedTable) || empty($strRelatedTable)) return false;\n\t\t\n\t\t// Defines Keys array\n\t\tif(!is_array($arrMainKey) || empty($arrMainKey)) {\n\t\t\t$arrMainKey = array('id' => array());\n\t\t}\n\t\tif(!is_array($arrReferedKey) || empty($arrReferedKey)) {\n\t\t\t$arrReferedKey = array('id' => array());\n\t\t}\n\t\t\n\t\t// Defines OnDelete and OnUpdate actions\n\t\t$arrOnActions = array('CASCADE','RESTRICT','SET NULL','SET DEFAULT','NO ACTION');\n\t\t$strOnDelete = strtoupper($strOnDelete);\n\t\tif(!is_string($strOnDelete) || empty($strOnDelete) || !in_array($strOnDelete,$arrOnActions)) $strOnDelete = 'CASCADE';\n\t\t$strOnUpdate = strtoupper($strOnUpdate);\n\t\tif(!is_string($strOnUpdate) || empty($strOnUpdate) || !in_array($strOnUpdate,$arrOnActions)) $strOnUpdate = 'CASCADE';\n\t\t\n\t\t// Defines Match parameter\n\t\t$arrMatchActions = array('SIMPLE','PARTIAL','FULL');\n\t\t$strMatch = strtoupper($strMatch);\n\t\tif(!is_string($strMatch) || empty($strMatch) || !in_array($strMatch,$arrOnActions)) $strMatch = 'FULL';\n\t\t\n\t\t// Defines FK name\n\t\tif(!is_string($strKeyName) || empty($strKeyName)) $strKeyName = $strMainTable . '_' . $strRelatedTable . '_FK';\n\t\t\n\t\t\n\t\t$arrKeyDef =\tarray (\n\t\t\t\t\t\t\t'primary'\t\t=> \tfalse,\n\t\t\t\t\t\t\t'unique'\t\t=> \tfalse,\n\t\t\t\t\t\t\t'foreign'\t\t=> \ttrue,\n\t\t\t\t\t\t\t'check'\t\t\t=> \tfalse,\n\t\t\t\t\t\t\t'fields'\t\t=> \t$arrMainKey,\n\t\t\t\t\t\t\t'references' \t=> \tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'table'\t\t\t\t=> $strRelatedTable,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'fields' \t\t\t=> $arrReferedKey,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'deferrable' \t\t=> false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'initiallydeferred' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'onupdate' \t\t\t=> $strOnUpdate,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'ondelete' \t\t\t=> $strOnDelete,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'match' \t\t\t=> $strMatch\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\n\t\t// Query is specific written due to MDB2 bug not implementing ADD CONSTRAINT FOREIGN KEY\n\t\t$strQuery\t= 'ALTER TABLE ' . $strMainTable . ' ADD CONSTRAINT `' . $strKeyName . '` FOREIGN KEY (`' . reset(array_keys($arrMainKey)) . '`) REFERENCES `' . $strRelatedTable . '` (`' . reset(array_keys($arrReferedKey)) . '`) ON DELETE ' . $strOnDelete . ' ON UPDATE ' . $strOnUpdate;\n\t\t\n\t\t// Tests if native MDB2 method succeeds; if not, tryes $strQuery\n\t\tif(MDB2::isError($this->objModel->objConn->createConstraint($strMainTable, $strKeyName, $arrKeyDef))) {\n\t\t\tif(MDB2::isError($this->objModel->executeQuery($strQuery))) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public function tripartite_application_form_update(Request $request){\n $ol_request_form_details = new OlRequestForm;\n $ol_request_form_details = $ol_request_form_details->getFillable();\n $ol_request_form['society_id'] = $request->society_id;\n $ol_application_data = OlApplication::where('id', $request->application_id)->first();\n\n foreach($request->all() as $key => $ol_request_form_detail){\n if(in_array($key, $ol_request_form_details) == true){\n $ol_request_form[$key] = $ol_request_form_detail;\n }\n }\n\n $ol_request_form_id = OlRequestForm::where('id', $ol_application_data->request_form_id)->update($ol_request_form);\n\n $input_arr_ol_applications = array(\n 'user_id' => auth()->user()->id,\n 'language_id' => 1,\n 'society_id' => $request->society_id,\n 'layout_id' => $request->layout_id,\n 'request_form_id' => $ol_application_data->request_form_id,\n 'application_master_id' => $request->application_master_id,\n 'application_no' => 'MHD'.str_pad($ol_application_data->request_form_id, 5, '0', STR_PAD_LEFT),\n 'current_status_id' => config('commanConfig.applicationStatus.in_process')\n );\n $ol_application = OlApplication::where('id', $request->application_id)->update($input_arr_ol_applications);\n\n $role_id = Role::where('name', config('commanConfig.ree_junior'))->first();\n $user_ids = RoleUser::where('role_id', $role_id->id)->pluck('user_id')->toArray();\n $layout_user_ids = LayoutUser::where('layout_id', $request->input('layout_id'))->whereIn('user_id', $user_ids)->get();\n\n foreach ($layout_user_ids as $key => $value) {\n $select_user_ids[] = $value['user_id'];\n }\n $users = User::whereIn('id', $select_user_ids)->get();\n $insert_arr = array(\n 'users' => $users\n );\n\n $this->CommonController->tripartite_application_status_society($insert_arr, config('commanConfig.applicationStatus.pending'), $ol_application_data);\n\n $id = encrypt($ol_application_data->id); \n\n return redirect()->route('tripartite_application_form_preview', $id);\n }",
"public function exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields = false);",
"public function start_customer_update($request_arr = array(), $inner_api = FALSE)\n {\n try\n {\n $validation_res = $this->rules_customer_update($request_arr);\n if ($validation_res[\"success\"] == \"-5\")\n {\n if ($inner_api === TRUE)\n {\n return $validation_res;\n }\n else\n {\n $this->wsresponse->sendValidationResponse($validation_res);\n }\n }\n $output_response = array();\n $input_params = $validation_res['input_params'];\n $output_array = $func_array = array();\n\n $input_params = $this->update_customer_data($input_params);\n\n $condition_res = $this->is_customer_updated($input_params);\n if ($condition_res[\"success\"])\n {\n\n $output_response = $this->finish_customer_update_success($input_params);\n return $output_response;\n }\n\n else\n {\n\n $output_response = $this->finish_customer_update_failure($input_params);\n return $output_response;\n }\n }\n catch(Exception $e)\n {\n $message = $e->getMessage();\n }\n return $output_response;\n }",
"static public function _quickbooks_customer_update_request($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale) {\r\n $GLOBALS['log']->fatal(\"User: $user - ident: $ID - action: $action (Inside Customer UPDATE Request)\");\r\n $ids = array();\r\n $editSeq = array();\r\n if (count($extra) > 0) {\r\n foreach ($extra as $record) {\r\n $ids[] = $record['id'];\r\n $editSeq[$record['id']] = $record['EditSequence'];\r\n }\r\n $data = getAccountData(\"Accounts\", array('where_ids' => $ids, 'join' => 'pcontacts'));\r\n\r\n if (count($data) > 0) {\r\n foreach ($data as $key => $account) {\r\n $data[$key]['EditSequence'] = $editSeq[$account['id']];\r\n if (!empty($account['p_contact_id'])) {\r\n $data[$key]['Contacts'] = getContactData(\"Contacts\", array('whereRaw' => \"contacts.id='{$account['p_contact_id']}'\"));\r\n }\r\n }\r\n }\r\n $opp_data = getOpportunityData(\"Opportunities\", array('where_ids' => $ids));\r\n foreach ($opp_data as $key => $opp) {\r\n if(!in_array($opp['name'], $opp_name)){\r\n $opp_name[]=$opp['name'];\r\n $opp['job'] = 1;\r\n $opp['EditSequence'] = $editSeq[$opp['id']];\r\n $data[] = $opp;\r\n }\r\n }\r\n }\r\n $accountXML = ACLogic::prepareCustomerXML($data);\r\n if (empty($accountXML)) {\r\n return '';\r\n }\r\n $qbxml = '<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n\t\t<?qbxml version=\"12.0\"?>\r\n\t\t<QBXML>\r\n\t\t\t<QBXMLMsgsRq onError=\"continueOnError\">\r\n\t\t\t\t\t' . str_replace('$requestID', $requestID, $accountXML) . '\r\n\t\t\t</QBXMLMsgsRq>\r\n\t\t</QBXML>';\r\n $GLOBALS['log']->fatal(\"User: $user - Action: $ID XML: \" . removeLines($qbxml));\r\n return $qbxml;\r\n }",
"function dbRowUpdate($table_name, $form_data, $where_clause=''){\n\tinclude($_SERVER['DOCUMENT_ROOT'].\"/ecj1718/conn.php\");\n\n\t// check for optional where clause\n\t$whereSQL = '';\n\tif(!empty($where_clause)){\n\t\t// check to see if the 'where' keyword exists\n\t\tif(substr(strtoupper(trim($where_clause)), 0, 5) != 'WHERE'){\n\t\t\t// not found, add key word\n\t\t\t$whereSQL = \" WHERE \".$where_clause;\n\t\t}\n\t\telse {\n\t\t\t$whereSQL = \" \".trim($where_clause);\n\t\t}\n\t}\n\t// start the actual SQL statement\n\t$sql = \"UPDATE \".$table_name.\" SET \";\n\n\t// loop and build the column /\n\t$sets = array();\n\tforeach($form_data as $column => $value){\n\t\t$sets[] = \"`\".$column.\"` = '\".$value.\"'\";\n\t}\n\t$sql .= implode(', ', $sets);\n\n\t// append the where statement\n\t$sql .= $whereSQL;\n\n\t// run and return the query result\n\t// $objQuery = mysqli_query($conn,$sql);\n\n\t// if($objQuery) {\n\t// return \"success\";\n\t// } else {\n\t// \t$error = \"Error Updating [\".$sql.\"]\";\n\t// return $error;\n\t// }\n\n\tif ($conn->query($sql) === TRUE) {\n\t return \"success\";\n\t} else {\n\t\t$error = \"Error Updating:\".$sql.\" \" . $conn->error;\n\t return $error;\n\t}\n}",
"public function updateRequest($vars = [])\n\t\t{\n\t\t\tif(empty($vars) or !is_array($vars))\n\t\t\t\treturn FALSE;\n\t\t\t\n\t\t\t/////\n\t\t\t// VALIDATION\n\t\t\t/////\n\t\t\t\n\t\t\t$errs = [];\n\t\t\t\n\t\t\t// Description\n\t\t\tif(!isset($vars['description']) OR strlen($vars['description']) == 0)\n\t\t\t\t$errs[] = \"Description Required\";\n\t\t\t\n\t\t\tif(!empty($errs))\n\t\t\t\treturn $errs;\n\t\t\t\n\t\t\t/////\n\t\t\t// PROCESS\n\t\t\t/////\n\t\t\t\n\t\t\tglobal $conn;\n\t\t\tglobal $faCurrentUser;\n\t\t\t$conn->beginTransaction();\n\t\t\t\n\t\t\t// Set ticket status to 'Customer Responded'\n\t\t\t$status = new \\Attribute();\n\t\t\tif(!$status->loadFromCode('srvc', 'tsta', 'cusr'))\n\t\t\t\treturn FALSE;\n\t\t\t$this->status = $status->getCode();\n\t\t\t\n\t\t\tif(!$this->put())\n\t\t\t{\n\t\t\t\t$conn->rollback();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t// Create ticket update\n\t\t\t\n\t\t\t$detail = new TicketDetail();\n\t\t\t$detail->setDetailType('u');\n\t\t\t$detail->setTicket($this->id);\n\t\t\t$detail->setData($vars['description']);\n\t\t\t$detail->setSeconds(0);\n\t\t\t$detail->setUser($faCurrentUser->getId());\n\t\t\t\n\t\t\tif($detail->create() !== TRUE)\n\t\t\t{\n\t\t\t\t$conn->rollback();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t// Create ticket log\n\t\t\t$ticketLog = \"Appended Description\";\n\t\t\t\n\t\t\t$detail->setDetailType('l');\n\t\t\t$detail->setData($ticketLog);\n\t\t\tif($detail->create() !== TRUE)\n\t\t\t{\n\t\t\t\t$conn->rollback();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t$conn->commit();\n\t\t\t\n\t\t\t// Send update to assignees\n\t\t\t$notification = new \\Notification();\n\t\t\t$message = [];\n\t\t\t$message['title'] = \"Contact Responded: \" . $this->title . \" [Ticket=\" . $this->number . \" Workspace=\" . $this->workspace . \"]\";\n\t\t\t$message['users'] = [];\n\t\t\t\n\t\t\tforeach($this->getAssignees() as $assigneeId)\n\t\t\t{\n\t\t\t\t$assignee = explode(\"-\", $assigneeId);\n\t\t\t\tif(sizeof($assignee) > 1) // Does this assignment contain users?\n\t\t\t\t{\n\t\t\t\t\tif(!in_array($assignee[1], $message['users']))\n\t\t\t\t\t\t$message['users'][] = $assignee[1];\n\t\t\t\t}\n\t\t\t\telse // Is this assignment a team?\n\t\t\t\t{\n\t\t\t\t\t$team = new Team($assigneeId);\n\t\t\t\t\tif($team->load())\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($team->getMembers() as $member)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(!in_array($member->getId(), $message['users']))\n\t\t\t\t\t\t\t\t$message['users'][] = $member->getId();\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\t\n\t\t\t$message['message'] = \"Ticket #\" . $this->number . \" (\" . $this->title . \") has been updated by the contact with the following message:\\n\\n\" . $vars['description'];\n\t\t\t$message['email'] = TRUE;\n\t\t\t$mesage['important'] = \"no\";\n\t\t\t$notification->send($message);\n\t\t\t\n\t\t\treturn TRUE;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset default fields between sends | public function resetFields(): void
{
$data = $this->data;
unset($this->data);
$this->data = [
'api_key' => $data['api_key'],
'platform' => $data['platform'],
'type' => 'user',
'time_stamp' => $this->getTimeStamp(),
];
} | [
"public function restoreFormFields()\n\t\t\t{\n\t\t\t\t$this->setFormField('message', '');\n\t\t\t\t$this->setFormField('bid', '');\n\t\t\t\t$this->setFormField('act', '');\n\t\t\t\t$this->setFormField('cbid', '');\n\t\t\t\t$this->setFormField('skey', '');\n\t\t\t\t$this->setFormField('bsite', '');\n\t\t\t}",
"protected function resetFields(){\n $this->_fields=array();\n }",
"public function reset() {\n\n\t\t\t$this->data = $this->defaults;\n\t\t}",
"public function resetFields()\n {\n $this->_fields = array();\n\n }",
"public function reset()\n {\n $this->values[self::CLIENT_MSG_ID] = null;\n $this->values[self::STATE] = null;\n $this->values[self::ERR] = null;\n }",
"function reset() {\n $this->fields = [];\n }",
"public function reset()\n {\n $this->values[self::CLIENT_MSG_ID] = null;\n $this->values[self::STATE] = null;\n $this->values[self::IS_EXIST] = null;\n $this->values[self::HOSTNAME] = null;\n $this->values[self::ERR] = null;\n }",
"public function setDefaults() {\n\t\t\tif (!$this->current()->get('sent')) {\n\t\t\t\t$this->current()->set('sent', date(AppRegistry::get('Database')->getDatetimeFormat()));\n\t\t\t}\n\t\t\tif (!$this->current()->get('code')) {\n\t\t\t\t$this->current()->set('code', md5(time() . rand(1, 10000)));\n\t\t\t}\n\t\t}",
"public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 0;\n $this->status = 0;\n $this->request = 0;\n }",
"public function resetForm()\n {\n $this->fieldName = null;\n $this->fieldNID = null;\n $this->fieldBCN = null;\n $this->fieldPhone = null;\n $this->fieldEmail = null;\n $this->fieldAddress = null;\n }",
"public function reset()\n {\n $this->values[self::SENTTOICCID] = null;\n $this->values[self::MESSAGETEXT] = null;\n $this->values[self::TPVP] = null;\n $this->values[self::MESSAGETEXTENCODING] = null;\n }",
"public function reset()\n {\n $this->values[self::MSGID] = null;\n $this->values[self::FROM] = null;\n $this->values[self::TO] = null;\n $this->values[self::TYPE] = null;\n $this->values[self::CONTENT] = null;\n $this->values[self::STATUS] = null;\n $this->values[self::IMGSTATUS] = null;\n $this->values[self::IMG] = null;\n $this->values[self::CREATETIME] = null;\n $this->values[self::MSGSOURCE] = null;\n $this->values[self::PUSHCONTENT] = null;\n $this->values[self::NEWMSGID] = null;\n $this->values[self::MSGSEQ] = null;\n }",
"public function resetFieldValues()\n {\n $this->setFormField('default_screen', $this->CFG['html']['template']['default'].'__'.$this->CFG['html']['stylesheet']['screen']['default']);\n $this->setFormField('temp_arr', $this->CFG['html']['template']['allowed']);\n $this->setFormField('css_arr', $this->CFG['html']['stylesheet']['allowed']);\n }",
"public function reset()\n {\n $this->_defaults = array();\n $this->_personal_defaults = array();\n $this->_duplicate_defaults = array();\n }",
"public function set_defaults() {\n $this->data = $this->default_data;\n $this->changes = array();\n $this->set_object_read( false );\n }",
"public function reset()\n {\n $this->values[self::_SAY] = null;\n $this->values[self::_FRESH] = null;\n $this->values[self::_FETCH] = null;\n $this->values[self::_CHAT_ADD_BL] = null;\n $this->values[self::_CHAT_DEL_BL] = null;\n $this->values[self::_CHAT_BLACKLIST] = null;\n $this->values[self::_CHAT_BORAD_SAY] = null;\n }",
"protected function ForgetSend()\n\t{\n\t\t$this->ResetSend();\n\n\t\t$this->newsletters = array();\n\t\t$this->statids = array();\n\t\t$this->custom_fields_to_replace = array();\n\t\t$this->to_customfields = array();\n\t\t$this->_sending_newsletter = -1;\n\t\t$this->_jobid = 0;\n\t\t$this->_queueid = 0;\n\t\t$this->jobdetails = array();\n\t\t$this->splitcampaign_details = array();\n\t}",
"public function setResetValues() {\n\t\t$this->setVid('all');\n\t\t$this->setRegion('all');\n\t\t$this->setEventtype('all');\n\t\t$this->setHighlight('all');\n\t\t$this->setPeople('0');\n\t\t$this->setPageID('1');\n\t\t$this->setQ('none');\n\t\t$this->setDate('');\n\t\t$this->setOwn('all');\n\t\t$this->setBf('all');\n\t\t$this->setLang('all');\n\t}",
"public function resetInput(){\n\n $this->codigo_turno = null;\n $this->name = null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
use token for provided key, if provided key exist, and usable return true, otherwise return false | public function use(string $key, string $token): bool; | [
"protected static function validate($key, $token)\n {\n $session_token = Session::instance()->get_once($key, null);\n\n if(is_null($token) || ($token != $session_token))\n return false;\n \n return true;\n }",
"public function findByKey($key, $token);",
"public function hasToken();",
"protected static function _matchToken(string $key, string $token): bool\n {\n if ($token === '{n}') {\n return is_numeric($key);\n }\n if ($token === '{s}') {\n return is_string($key);\n }\n if (is_numeric($token)) {\n return $key === $token;\n }\n\n return $key === $token;\n }",
"public function support(string $key): bool;",
"public function exists(string $token): bool;",
"public function validate($key,$token)\n {\n # Getting service\n $service = $this->gateway->getService($key);\n\n if ($service) {\n if ($service->key == strtolower($key) && $service->getToken() == $token) {\n return $service;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }",
"public function checkKey($key) {}",
"public function tokenIsPresent();",
"public function check($token);",
"private function auth_token_present() {\n return array_key_exists( 'token', $_GET );\n }",
"public function hasKey($key);",
"private function _checkToken() {\n if (file_exists($this->config['tokenFile'])) {\n $this->token = json_decode(file_get_contents($this->config['tokenFile']), true);\n }\n \n if (!$this->token || (time() >= $this->token['expires_at'])) {\n return $this->_accessToken();\n }\n return true;\n }",
"public static function verify($token, $key)\n {\n // Check values\n if (empty($token) || empty($key)) {\n return false;\n }\n\n // Split parts\n list($payloadJSON_encoded, $signature) = explode('.', $token);\n\n // Generate signature to verify\n $signatureGenerated = hash_hmac('SHA256', $payloadJSON_encoded, $key);\n\n return ($signature === $signatureGenerated);\n }",
"private static function tokenExists(string $token)\n {\n global $ff_sql;\n\n $res = $ff_sql->query_fetch(\"\n SELECT count(1) as `cnt`\n FROM `internalapi`\n WHERE `token` = \". $ff_sql->quote($token) .\"\n \", ['cnt' => 'int']);\n\n return $res['cnt'] > 0;\n }",
"function checkToken( $token, $user, $timestamp )\n{\n if( hash_hmac(\"sha256\", $timestamp . $user, $_SERVER['HASH_KEY']) == $token )\n return true;\n return false;\n}",
"public function isRegistered($key);",
"public static function chkToken(){\n\n\t\tif(empty(self::$token)){\n\t\t\t$url \t\t= Configs::get(\"authHost\");\n\t\t\t$auth \t\t= new CURL($url);\n\t\t if($auth->IsSuccess()){\n\t\t\t $res_ar \t\t\t\t= json_decode($auth->getResult());\n\t\t\t\t$httpCode \t\t\t\t= $auth->getHttpCode();\n\t\t\t\t$_SESSION['auth_time']\t= $auth->getTime();\n\t\t \t$error_code \t= $res_ar->errno;\n\t\t\t if( $error_code == 0 && isset($res_ar->token) && !empty($res_ar->token) && property_exists($res_ar,'token') ){\n\t\t\t \tself::setTokenId($res_ar->token);\n\t\t\t \treturn true;\n\t\t\t }else{\n\t\t\t \treturn false;\n\t\t\t }\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\t}",
"function checkToken($token) {\n\t\t// Check the token to the ones in the database.\n\t\t$cms_auth = NModel::factory('cms_auth');\n\t\t$cms_auth->feed_token = $token;\n\t\tif ($cms_auth->find()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Conversion des pressions millibar en pouces. | function millibar2inch($millibar) {
return $millibar/33.86;
} | [
"function unit_converter($val) {\n\t// conversione da byte a kb\n\tif ($val > 1024) {\n\t\t$val = round($val / 1024, 2);\n\t\t// conversione da kb a mb\n\t\tif ($val > 1024) {\n\t\t\t$val = round($val / 1024, 2);\n\t\t\t// conversione da gb a mb\n\t\t\tif ($val > 1024) {\n\t\t\t\t$val = round($val / 1024, 2);\n\t\t\t\t// conversione da gb a tb\n\t\t\t\tif ($val > 1024) {\n\t\t\t\t\t$val = round($val / 1024, 2);\n\t\t\t\t\t$final_val = $val . \" tb\";\n\t\t\t\t} else {\n\t\t\t\t\t$final_val = $val . \" gb\";\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$final_val = $val . \" mb\";\n\t\t\t}\n\t\t} else {\n\t\t\t$final_val = $val . \" kb\";\n\t\t}\n\t} else {\n\t\t$final_val = $val . \" byte\";\n\t}\n\t\n\treturn $final_val;\n}",
"function px2mm($px)\n{\n return $px * 25.4 / 72;\n}",
"function px2mm($px) {\n return $px * 25.4 / 72;\n}",
"function px2mm($px){\r\n return $px*25.4/72;\r\n}",
"function px2mm($px){\n return $px*25.4/72;\n}",
"function px2mm($px){\n return $px*25.4/72;\n}",
"function px2mm( $px ){\n return $px*25.4/72;\n}",
"function px2mm($px, $dpi = 300){\n\treturn (round($px) / $dpi) * 25.4;\n}",
"function kilograms_to_pounds() {\n\t\t\treturn $this->weight / $this->kilo_convert;\n\t\t}",
"function convertByteToMb($byte) {\n return $byte / 1048576;\n}",
"function getMoneda($precio){\n return \"S/\". number_format($precio,2);\n}",
"function converti($valore,$font, $perc){ \n if(preg_match(\"/(.*cm.*)/\",$valore)){\n $valore = preg_replace(\"/(.*)(cm.*)/\",\"\\$1\",$valore);\n $valore = $valore * 35.43307;\n }\n elseif(preg_match(\"/(.*in.*)/\",$valore)){\n $valore = preg_replace(\"/(.*)(in.*)/\",\"\\$1\",$valore);\n $valore = $valore * 96;\n }\n elseif(preg_match(\"/(.*px.*)/\",$valore)){\n $valore = preg_replace(\"/(.*)(px.*)/\",\"\\$1\",$valore);\n }\n elseif(preg_match(\"/(.*pt.*)/\",$valore)){\n $valore = preg_replace(\"/(.*)(pt.*)/\",\"\\$1\",$valore);\n $valore = $valore * 1.25;\n }\n elseif(preg_match(\"/(.*mm.*)/\",$valore)){\n $valore = preg_replace(\"/(.*)(mm.*)/\",\"\\$1\",$valore);\n $valore = $valore * 3.543307;\n }\n elseif(preg_match(\"/(.*pc.*)/\",$valore)){\n $valore = preg_replace(\"/(.*)(pc.*)/\",\"\\$1\",$valore);\n $valore = $valore * 15;\n }\n elseif(preg_match(\"/(.*em.*)/\",$valore)){\n $valore = preg_replace(\"/(.*)(em.*)/\",\"\\$1\",$valore);\n $valore = $valore * $font;\n }\n elseif(preg_match(\"/(.*%.*)/\",$valore)){\n $valore = preg_replace(\"/(.*)(%.*)/\",\"\\$1\",$valore);\n $valore = ($valore * $perc) / 100;\n }\n \n /* \n altri casi:\n * ex (non gestito)\n */ \n\n return ($valore);\n }",
"function convertToMb($bytes)\n{\n\t$mb = (($bytes/1024)/1024);\n\treturn number_format($mb,2);\n}",
"function milliTimestamp() {\r\n $time_array = explode(\" \", microtime());\r\n\r\n $milli = $time_array[0];\r\n $milli = explode(\".\", $milli)[1];\r\n $milli = substr($milli, 0, 4);\r\n\r\n $milli = $time_array[0];\r\n $milli = explode(\".\", $milli)[1];\r\n $milli = substr($milli, 0, 4);\r\n\r\n $timestamp = $time_array[1];\r\n\r\n $result = $timestamp . \".\" . $milli;\r\n $result = floatval($result);\r\n\r\n return $result;\r\n}",
"protected static function pointsToMillimeters($value)\n {\n // 1 inch = 72 points\n $inches = $value / 72;\n // 1 inch = 2.54 cm\n $millimeters = $inches * 25.4;\n return $millimeters;\n }",
"function _convertMeasurement($_Units, $_From, $_To){\r\n\r\n\r\n\r\n\t\tswitch (strtolower($_From).'_'.strtolower($_To)){\r\n\r\n\t\t\t\t\r\n\r\n\t\t\tcase 'lb_kg':\r\n\r\n\t\t\tcase 'lbs_kgs':\r\n\r\n\t\t\tcase 'lbs_kg':\r\n\r\n\t\t\tcase 'lb_kgs':\r\n\r\n\t\t\t\t$_Units = $_Units/2.2046;\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'kg_lb':\r\n\r\n\t\t\tcase 'kg_lbs':\r\n\r\n\t\t\tcase 'kgs_lb':\r\n\r\n\t\t\tcase 'kgs_lbs':\r\n\r\n\t\t\t\t$_Units = $_Units*2.2046;\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'g_lb':\r\n\r\n\t\t\tcase 'g_lbs':\r\n\r\n\t\t\t\t$_Units = $_Units/1000*2.2046;\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'lb_g':\r\n\r\n\t\t\tcase 'lbs_g':\r\n\r\n\t\t\t\t$_Units = $_Units/2.2046*1000;\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'g_kg':\r\n\r\n\t\t\tcase 'g_kgs':\r\n\r\n\t\t\t\t$_Units = $_Units/1000;\r\n\r\n\t\t}\r\n\r\n\r\n\r\n\t\treturn $_Units;\r\n\r\n\t}",
"private function toMillions( $num ) {\n\t\t$num = sprintf( \"%.1f\", $num / 1e6 );\n\t\tif ( substr( $num, - 2 ) == '.0' ) {\n\t\t\t$num = substr( $num, 0, - 2 );\n\t\t}\n\t\t$lang = Language::factory( $this->language );\n\t\treturn $lang->formatNum( $num );\n\t}",
"function toMetric($Value) {\r\n\t\t$Go = ( int ) ($Value / 1000000000);\r\n\t\t$Mo = ( int ) (($Value - $Go * 1000000000) / 1000000);\r\n\t\t$Ko = ( int ) (($Value - $Go * 1000000000 - $Mo * 1000000) / 1000);\r\n\t\t$o = ( int ) ($Value - $Go * 1000000000 - $Mo * 1000000 - $Ko * 1000);\r\n\t\t\r\n\t\tif ($Go != 0) {\r\n\t\t\treturn ($Go . \".\" . $Mo . \"g\");\r\n\t\t}\r\n\t\tif ($Mo != 0) {\r\n\t\t\treturn ($Mo . \".\" . $ko . \"m\");\r\n\t\t}\r\n\t\tif ($Ko != 0) {\r\n\t\t\treturn ($Ko . \".\" . $o) . \"k\";\r\n\t\t}\r\n\t\treturn ($o);\r\n\t}",
"function DiviBytes_MB($valor,$valor2) //Calcula entre bytes e KB\n\t\t{\n\t\t\t//saida em Bytes(B)\n\t\t\t$this->byte = $this->valor; //valor em bytes\n\t\t\t$this->bit = $this->byte*8;\n\t\t\t$this->kb = $this->byte/1024;\n\t\t\t$this->mb = $this->kb/1024;\n\t\t\t$this->gb = $this->mb/1024;\n\t\t\t$this->tb = $this->gb/1024;\n\t\t\t//saída em Mbytes(MB)\n\t\t\t$this->mb2 = $this->valor2;\n\t\t\t$this->kb2 = $this->valor2*1024;\n\t\t\t$this->byte2 = $this->kb2*1024; //valor em bytes\n\t\t\t$this->bit2 = $this->byte2*8;\t\t\n\t\t\t$this->gb2 = $this->mb2/1024;\n\t\t\t$this->tb2 = $this->gb2/1024;\n\t\t\t//divide Bytes / MB\n\t\t\t$this->difbytes = $this->byte / $this->byte2;\n\t\t\t$this->difbit = $this->bit / $this->bit2;\n\t\t\t$this->difkb = $this->kb / $this->kb2;\n\t\t\t$this->difmb = $this->mb / $this->mb2;\n\t\t\t$this->difgb = $this->gb / $this->gb2;\n\t\t\t$this->diftb = $this->tb / $this->tb2;\n\t\t\n\t\t\techo \"<h3 align='center'>Calcule $this->valor Bytes / $this->valor2 MB é: </h3>\n\t\t\t\t\t<table align='center'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t <td>Bits</td>\n\t\t\t\t\t <td>{$this->bit} bit<br></td>\t\t \n\t\t\t\t\t <td>{$this->bit2} bit<br></td>\t\t \n\t\t\t\t\t <td>{$this->difbit} bit<br></td>\t\t \n\t\t\t\t\t</tr>\n\t\t\t\t\t<br>\n\t\t\t\t<table>\";\n\n\t\t\techo \"<table align='center'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t <td>Bytes</td>\n\t\t\t\t\t <td bgcolor='#6666FF'>{$this->byte} Bytes<br></td>\t\t \n\t\t\t\t\t <td>{$this->byte2} Bytes<br></td>\t\t \n\t\t\t\t\t <td>{$this->difbytes} Bytes<br></td>\t\t \n\t\t\t\t\t</tr>\n\t\t\t\t\t<br>\n\t\t\t\t<table>\";\n\t\t\t\n\t\t\techo \"<table align='center'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t <td>KB</td>\n\t\t\t\t\t <td>{$this->kb} KB<br></td>\t\t \n\t\t\t\t\t <td>{$this->kb2} KB<br></td>\t\t \n\t\t\t\t\t <td>{$this->difkb} KB<br></td>\t\t \n\t\t\t\t\t</tr>\n\t\t\t\t\t<br>\n\t\t\t\t<table>\";\n\t\t\t\n\t\t\techo \"<table align='center'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t <td>MB</td>\n\t\t\t\t\t <td>{$this->mb} MB<br></td>\t\t \n\t\t\t\t\t <td bgcolor='#6666FF'>{$this->mb2} MB<br></td>\t\t \n\t\t\t\t\t <td>{$this->difmb} MB<br></td>\t\t \n\t\t\t\t\t</tr>\n\t\t\t\t\t<br>\n\t\t\t\t<table>\";\n\t\t\t\n\t\t\techo \"<table align='center'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t <td>GB</td>\n\t\t\t\t\t <td>{$this->gb} GB<br></td>\t\t \n\t\t\t\t\t <td>{$this->gb2} GB<br></td>\t\t \n\t\t\t\t\t <td>{$this->difgb} GB<br></td>\t\t \n\t\t\t\t\t</tr>\n\t\t\t\t\t<br>\n\t\t\t\t<table>\";\n\t\t\t\n\t\t\techo \"<table align='center'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t <td>TB</td>\n\t\t\t\t\t <td>{$this->tb} TB<br></td>\t\t \n\t\t\t\t\t <td>{$this->tb2} TB<br></td>\t\t \n\t\t\t\t\t <td>{$this->diftb} TB<br></td>\t\t \n\t\t\t\t\t</tr>\n\t\t\t\t\t<br>\n\t\t\t\t<table>\";\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Location in a Cloud Storage where the snapshot is going to be stored, e.g.: "gs://mybucket/snapshots". Generated from protobuf field string snapshot_location = 2; | public function setSnapshotLocation($var)
{
GPBUtil::checkString($var, True);
$this->snapshot_location = $var;
return $this;
} | [
"public static function volumeSnapshotName(string $project, string $location, string $volume, string $snapshot): string\n {\n return self::getPathTemplate('volumeSnapshot')->render([\n 'project' => $project,\n 'location' => $location,\n 'volume' => $volume,\n 'snapshot' => $snapshot,\n ]);\n }",
"public function getStorageLocation()\n {\n return $this->storageLocation;\n }",
"public function setSnapshotPath($var)\n {\n GPBUtil::checkString($var, True);\n $this->snapshot_path = $var;\n\n return $this;\n }",
"function saveSnapshot($location){\n\t\t$body = json_decode(self::$info, TRUE);\n\t\t$url = $body[\"image\"];\n\n\t\t//Checks if directory exists, creates it if it doesn't\n\t\t$path=dirname($location, 1);\n\t\tif(!file_exists($path)){\n\t\t\tmkdir($path, 0777, TRUE);\n\t\t}\n\n\t\t//Downloads the image to the given location \n\t\t$options = array(\n \t\tCURLOPT_FILE => is_resource($location) ? $location : fopen($location, 'w'),\n \t\tCURLOPT_FOLLOWLOCATION => true,\n \t\tCURLOPT_URL => $url,\n \t\tCURLOPT_FAILONERROR => true, \n \t);\n \t$ch = curl_init();\n \tcurl_setopt_array($ch, $options);\n \t$return = curl_exec($ch);\n\t}",
"public function putSnapshot( Snapshot $snapshot ) {\n\t\ttry {\n\t\t\t$files_result = null;\n\n\t\t\tif ( $snapshot->meta['contains_db'] ) {\n\t\t\t\t$db_result = $this->client->putObject(\n\t\t\t\t\t[\n\t\t\t\t\t\t'Bucket' => self::getBucketName( $this->repository ),\n\t\t\t\t\t\t'Key' => $snapshot->meta['project'] . '/' . $snapshot->id . '/data.sql.gz',\n\t\t\t\t\t\t'SourceFile' => realpath( Utils\\get_snapshot_directory() . $snapshot->id . '/data.sql.gz' ),\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( $snapshot->meta['contains_files'] ) {\n\t\t\t\t$files_result = $this->client->putObject(\n\t\t\t\t\t[\n\t\t\t\t\t\t'Bucket' => self::getBucketName( $this->repository ),\n\t\t\t\t\t\t'Key' => $snapshot->meta['project'] . '/' . $snapshot->id . '/files.tar.gz',\n\t\t\t\t\t\t'SourceFile' => realpath( Utils\\get_snapshot_directory() . $snapshot->id . '/files.tar.gz' ),\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Wait for files first since that will probably take longer\n\t\t\t */\n\t\t\tif ( $snapshot->meta['contains_files'] ) {\n\t\t\t\t$this->client->waitUntil(\n\t\t\t\t\t'ObjectExists', [\n\t\t\t\t\t\t'Bucket' => self::getBucketName( $this->repository ),\n\t\t\t\t\t\t'Key' => $snapshot->meta['project'] . '/' . $snapshot->id . '/files.tar.gz',\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( $snapshot->meta['contains_db'] ) {\n\t\t\t\t$this->client->waitUntil(\n\t\t\t\t\t'ObjectExists', [\n\t\t\t\t\t\t'Bucket' => self::getBucketName( $this->repository ),\n\t\t\t\t\t\t'Key' => $snapshot->meta['project'] . '/' . $snapshot->id . '/data.sql.gz',\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\t\t} catch ( \\Exception $e ) {\n\t\t\tif ( ! empty( $files_result ) && 'AccessDenied' === $files_result->data['aws_error_code'] ) {\n\t\t\t\tLog::instance()->write( 'Access denied. You might not have access to this project.', 0, 'error' );\n\t\t\t}\n\n\t\t\tLog::instance()->write( 'Error Message: ' . $e->getMessage(), 1, 'error' );\n\t\t\tLog::instance()->write( 'AWS Request ID: ' . $e->getAwsRequestId(), 1, 'error' );\n\t\t\tLog::instance()->write( 'AWS Error Type: ' . $e->getAwsErrorType(), 1, 'error' );\n\t\t\tLog::instance()->write( 'AWS Error Code: ' . $e->getAwsErrorCode(), 1, 'error' );\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function setupGcsStorageLocation()\n {\n $gcs_creds = $this->getGcsCreds();\n $this->session = $this->getSession();\n $this->session->visit($this->url('storage_add_gcs_storage'));\n \n $page = $this->session->getPage();\n $page->findById('storage_location_name')->setValue('My GCS Storage');\n $page->findById('gcs_access_key')->setValue($gcs_creds['gcs_access_key']);\n $page->findById('gcs_secret_key')->setValue($gcs_creds['gcs_secret_key']);\n $page->findById('gcs_bucket')->setValue($gcs_creds['gcs_bucket']);\n $page->findButton('m62_settings_submit')->submit();\n \n return $page;\n }",
"public function getStorageLocation()\n {\n if ($this->storageLocation === null) {\n $file = $this->getAddNewVersionTo();\n if ($file !== null) {\n $this->storageLocation = $this->getFileStorageLocation($file);\n } else {\n $this->storageLocation = $this->getFolderStorageLocation($this->getImportToFolder());\n }\n }\n\n return $this->storageLocation;\n }",
"public function getSnapshotDirectory()\n {\n return $this->snapshot_directory;\n }",
"public function generateSnapshotPath($snapshotFilenameChecksumPart): string;",
"public function getImageLocation() \n {\n return $this->_fields['ImageLocation']['FieldValue'];\n }",
"public static function snapshotName(string $project, string $snapshot): string\n {\n return self::getPathTemplate('snapshot')->render([\n 'project' => $project,\n 'snapshot' => $snapshot,\n ]);\n }",
"protected function getSnapshotDirectory(): string\n {\n return dirname((new \\ReflectionClass($this))->getFileName())\n . DIRECTORY_SEPARATOR . '__snapshots__'\n . DIRECTORY_SEPARATOR . (new \\ReflectionClass($this))->getShortName()\n . DIRECTORY_SEPARATOR . $this->getName();\n }",
"public function cloud_snapshot_upload_part($uid, $position)\r\n {\r\n switch ($this->cloud_service) {\r\n case 'dropbox':\r\n break;\r\n case 'gdrive':\r\n break;\r\n case 'wpreset':\r\n $result = $this->wpreset_snapshot_upload_part($uid, $position);\r\n break;\r\n default:\r\n $result = new WP_Error('1', 'No cloud service is enabled');\r\n }\r\n\r\n return $result;\r\n }",
"public function setSourceSnapshot($var)\n {\n GPBUtil::checkString($var, True);\n $this->source_snapshot = $var;\n\n return $this;\n }",
"public function settings_change_storage_location() {\n \n // Send location\n (new MidrubBaseAdminComponentsCollectionSettingsHelpers\\Storage)->settings_change_storage_location();\n \n }",
"public function snapshotFileName(): string\n {\n return $this->getFileName();\n }",
"public function setSnapshot($var)\n {\n GPBUtil::checkString($var, True);\n $this->writeOneof(5, $var);\n\n return $this;\n }",
"public function snapshotFileName() : string\n {\n return $this->paramsArray['parameters']['snapshot.filename'];\n }",
"public function setStorageLocation($val)\n {\n $this->_propDict[\"storageLocation\"] = $val;\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a random letter position question Example: "What is the fifth letter in Tokyo?" | function getLetterProblem(string $randomWord, int $randLetterPos): QuestionAnswer
{
$letterArray = str_split($randomWord);
// there should be a chance of getting the last letter
if ($randLetterPos === 5 || strlen($randomWord) <= $randLetterPos) {
$letterPosName = 'last';
$randLetter = end($letterArray); // get the last letter in the word
} else {
// ask for one of the first five letters (to keep it simple)
$numberNames = ["first", "second", "third", "fourth", "fifth"];
$letterPosName = $numberNames[$randLetterPos];
$randLetter = $letterArray[$randLetterPos]; // this is the answer
}
return new QuestionAnswer("What is the $letterPosName letter in $randomWord?", $randLetter);
} | [
"function randomChar() {\r\n\t\r\n\t// for ASCII char numbers see: http://www.asciitable.com \t\r\n\t$charOffset['number'] = 48;\r\n\t$charOffset['letterUp'] = 65;\r\n\t$charOffset['letterLo'] = 97;\r\n\t\r\n\t$n = rand(0, 10 + 26 + 26);\r\n\t\r\n\tif (0 <= $n && $n < 10) {\r\n\t\treturn chr($charOffset['number'] + $n);\r\n\t} else if (10 <= $n && $n < 10 + 26) {\r\n\t\treturn chr($charOffset['letterUp'] + ($n - 10));\r\n\t} else if (10 + 26 <= $n && $n < 10 + 26 + 26) {\r\n\t\treturn chr($charOffset['letterLo'] + ($n - 10 - 26));\r\n\t} else { \r\n\t\treturn \"_\"; \r\n\t}\r\n}",
"function randLetter(){\n global $allChars;\n return substr($allChars, mt_rand(0, strlen($allChars) - 1), 1);\n }",
"function getRandomChar()\r\n {\r\n $charSet = \"123456789abcdefghijklmnpqrstuvwxyz\"; //The character set u wanna build passwords from\r\n $rn = rand (0, strlen ($charSet)); //Choose a random position in character set\r\n return substr ($charSet, $rn, 1); //Return the character at that position\r\n }",
"public static function rand_letter() {\r\n\t\treturn chr(mt_rand(97, 122));\r\n\t}",
"function randomLowercaseLetter() {\n\n\t\t$letters = \"abcdefghijklmnopqrstuvwxyz\";\n\t\t$randomLetterPosition = rand(0,(strlen($letters)-1));\n\t return $letters[$randomLetterPosition];\n\t}",
"protected function randomWord()\n {\n return $this->dictionary[mt_rand(0, count($this->dictionary) - 1)];\n }",
"private function getRandomCharacter():string\n {\n return $this->getCharacterPool()[rand(0, strlen($this->getCharacterPool()) - 1)];\n }",
"function slRandomChar()\n{\n\t$char = '';\n\tfor ($i = 0; $i < 20; $i++)\n\t\t$char .= rand(0, 9);\n\treturn ($char);\n}",
"function caracterAleatorio() {\n\t$chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456789\";\n\treturn substr($chars, rand() % strlen($chars), 1);\n}",
"function randLetter5()\r\n{\r\n $int5 = rand(1,70);\r\n if ($int5 <= 63){\r\n $a_zDollars = \"aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ1234567890\";\r\n $rand_letter5 = $a_zDollars[$int5];\r\n } \r\n else if ($int5 > 63){ $rand_letter5 = \"\\$\"; }\r\n return $rand_letter5;\r\n}",
"protected function getRandomString()\n {\n $random = $this->random;\n $random_array = \\str_split($random);\n return $random_array[\\rand(0, sizeof($random_array) - 1)];\n }",
"function randomUppercaseLetter() {\n\n\t\t$letters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\t\t$randomLetterPosition = rand(0,(strlen($letters)-1));\n\t return $letters[$randomLetterPosition];\n\t}",
"function randomFont() {\n $font = [\"Times New Roman\",\n \"Georgia\",\n \"Arial\",\n \"Verdana\",\n \"Courier New\",\n \"Lucida Console\"];\n $r = mt_rand(0, 5);\n return $font[$r];\n }",
"function getRandomChar(){\n $charNum = mt_rand(33, 126);\n if($charNum == 34 || $charNum == 39 || $charNum == 92 || $charNum == 96){ // ' \" \\ `\n return getRandomChar();\n }\n else{\n return chr($charNum);\n }\n}",
"function get_friend_word(){\n\t$friend_words = array(\"buddies\",\"pals\",\"chums\",\"allies\",\"mates\");\n\t$max = count($friend_words) - 1;\n\t$index = rand(0,$max);\n\t$friend_word = $friend_words[$index];\n\treturn $friend_word;\n}",
"function randomCharFromStr($str) { \n return $str[rand(0, strlen($str) - 1)];\n}",
"public function random_char(){\n\t\t$char = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$char_length = 20;\n\t\t$cl = strlen($char);\n\t\t$randomize = '';\n\t\tfor($i = 0; $i < $char_length; $i++ ){\n\t\t\t$randomize .= $char[rand(0, $cl - 1)]; \n\t\t}\n\t\treturn $randomize;\n\t}",
"private function get_random_word() :string\n {\n return $this->words[rand(0,count($this->words) - 1)];\n }",
"function positionInAlphabet($letter) {\n return ord(strtolower($letter)) - 96;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Main ToDo List View | public function index(){
$todos = todo::select(['id','title','description','state'])->orderBy('state', 'ASC')->orderBy('id', 'DESC')->get();
return view('todoMain')->with([
'todos'=>$todos
]);
} | [
"public function getToDoList()\n {\n return view('todolist::todolist');\n }",
"public function index_todo() {\n\n\t\t# if not logged in -> redirect to the login page\n\t\tif (!$this->user) {\n\t\t\tRouter::redirect('/users/login');\n\t\t}\n\n\t\t# Set up the View\n\t\t$this->template->content = View::instance('v_todo_index_todo');\n\t\t$this->template->title = \"TO DOs\";\n\n \t# Query the database for to do's\n \t$q = \"\tSELECT \n\t\t todo.todo_id,\n\t\t todo.user_id,\n\t\t todo.topic,\n\t\t todo.created,\n\t\t todo.priority,\n\t\t todo.done,\n\t\t addressbook.addressbook_id AS address_id,\n\t\t addressbook.first_name,\n\t\t addressbook.last_name,\n\t\t addressbook.emailHome,\n\t\t addressbook.emailWork,\n\t\t addressbook.skype,\n\t\t addressbook.phoneNumberWork,\n\t\t addressbook.mobilePhoneNumber,\n\t\t addressbook.phoneNumberHome\n\t\t FROM todo\n\t\t JOIN addressbook ON\n\t\t \taddressbook.addressbook_id = todo.addressbook_id\n\t\t WHERE todo.done = '0'\n\t\t AND todo.user_id = \".$this->user->user_id;\n\n\t\t$todos = DB::instance(DB_NAME)->select_rows($q);\n\n\t\t# if list is empty display a message\n\t\tif (empty($todos)) {\n\t\t\t$messageEmpty = \"Your TO DO list is empty<br>You can add TO DOs via the main menu\";\n\t\t} else {\n\t\t\t$messageEmpty = \" \";\n\t\t}\n\n\t\t# Pass data to the View and render the View\n\t\t$this->template->content->todos = $todos;\n\t\t$this->template->content->messageEmpty = $messageEmpty;\t\t\n\t\techo $this->template;\n\t}",
"function ToDoList(){\n\t/*\n\tdo your customize action here\n\t*/\n\t\n\t//call the default function\n\tListing('ToDo');\n}",
"public function actionIndex()\n {\n $searchModel = new ToDoListSearch(['scenario' => 'toDoList']);\n $dataProvider = $searchModel->searchToDoList(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function print_todo() {\n\t\t\tforeach ($this->todo as $id => $item) {\n\t\t\t\techo \"<li>\" . $item . PHP_EOL .\n\t\t\t\t\t \"<br /><a href=\\\"actions/chart.php?project=\" . $this->name . \"&act=del_todo&id=\" . $id . \"\\\"><input type=\\\"button\\\" class=\\\"button-delete\\\" /></a> <a href=\\\"actions/chart.php?project=\" . $this->name . \"&act=todo_to_doing&id=\" . $id . \"\\\"><input type=\\\"button\\\" class=\\\"button-next\\\" /></a></li>\";\n\t\t\t}\n\t\t}",
"public function indexAction()\n {\n $this->render('lists/index', array(\n 'title' => 'Todo Lists',\n 'lists' => TodoList::all()\n ));\n }",
"public function obterTodos() {\n }",
"public function listToDo() {\n\t\treturn $this->collection;\n\t}",
"function GetListView(){}",
"public function traerTodo()\n {\n }",
"public function actionTaskList()\n {\n $tasks = Task::find()->all();\n return $this->render('taskList', ['tasks' => $tasks]);\n }",
"public function _listarTodo()\n {\n $this->_listarDirectorios();\n $this->_listarArchivos();\n ksort($this->_resultados);\n }",
"public function activelistAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n // $todos = $em->getRepository(Todo::class)->findByCompleted(false);\n $todos = $em->getRepository(Todo::class)->findAll(false);\n \n return $this->render('todo/active-index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function listView(): void\n {\n $this->_data = $this->_entity->fetch();\n if (!$this->special) {\n $newData = $this->_builder->submitCreate();\n if ($newData) {\n array_push($this->_data, $newData);\n }\n }\n require VF . \"{$this->route}/list.php\";\n require VF . \"{$this->route}/create.php\";\n }",
"public function showAllIncompleteToDos(){\n\t\t$all_to_do = ToDoList::where('is_done',0)->get();\n\t\treturn view('welcome',['all_to_do' => $all_to_do]);\n\t}",
"public function activelistAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findByCompleted(false);\n \n return $this->render('todo/active-index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function done()\n {\n $datas = Todo::where('done', 1)->paginate(8);\n\n $users = $this->users;\n return view('todos.index', compact('datas', 'users'));\n }",
"public function indexAction()\n {\n $this->tag->setTitle(__('Tasks'));\n // Available sort to choose\n $this->filter->add('in_array', function($value) {\n return in_array($value, ['name', 'name DESC', 'status', 'status DESC', 'type', 'type DESC', 'when', 'when DESC']) ? $value : null;\n });\n\n // Get tasks and prepare pagination\n $paginator = new Paginator([\n \"data\" => Tasks::find(['order' => $this->request->getQuery('order', 'in_array', 'id', true)]),\n \"limit\" => $this->request->getQuery('limit', 'int', 20, true),\n \"page\" => $this->request->getQuery('page', 'int', 1, true)\n ]);\n\n $this->view->setVars([\n 'pagination' => $paginator->getPaginate(),\n ]);\n }",
"public static function show()\n {\n $record = array();\n $record = todos::findOne($_REQUEST['id']);\n\n self::getTemplate('show_task', $record);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to get the id of the default page | function GetDefaultPageID()
{
global $gCms;
$db = &$gCms->GetDb();
$query = "SELECT * FROM ".cms_db_prefix()."content WHERE default_content = 1";
$row = &$db->GetRow($query);
if (!$row)
{
return false;
}
return $row['content_id'];
} | [
"public static function get_default_page_id()\n\t{\n\t\treturn CmsCache::get_instance()->call('CmsContentOperations::_get_default_page_id');\n\t}",
"public function getDefaultPageId() {\n\n\t\t/** The ID of the current language version */\n\t\t$curentLangId = cmsController::getInstance() -> getCurrentLang() -> getId();\n\n\t\t/** Instance of umiHierarchy */\n\t\t$hierarchy = umiHierarchy::getInstance();\n\t\t/** ID the default page for the current language version */\n\t\t$defaultPageId = $hierarchy -> getDefaultElementId($curentLangId);\n\n\t\treturn $defaultPageId;\n\t}",
"public static function getDefaultPageId()\r\n\t{\r\n\t\t$defaultID = 0;\r\n\t\t$db = JFactory::getDbo();\r\n\t\t$query = $db->getQuery(true)\r\n\t\t\t->select($db->quoteName('id'))\r\n\t\t\t->from($db->quoteName('#__menu'))\r\n\t\t\t->where($db->quoteName('home') . ' = 1');\r\n\t\t$db->setQuery($query);\r\n\t\t$menuItem = $db->loadObject();\r\n\t\tif ($menuItem)\r\n\t\t{\r\n\t\t\t$defaultId = $menuItem->id;\r\n\t\t}\r\n\r\n\t\treturn $defaultId;\r\n\t}",
"public static function _get_default_page_id()\n\t{\n\t\t$page = cmsms()->content_base->find_by_default_content(1);\n\t\tif ($page)\n\t\t{\n\t\t\treturn $page->id;\n\t\t}\n\t\treturn -1;\n\t}",
"public function getCurrentPageId();",
"function getCurrentBePageId() {\n\t\treturn intval(t3lib_div::_GP('id'));\n\t}",
"protected function getCurrentPageIdFromCurrentSiteRoot() : int {}",
"function get_default_page_id()\r\n{\r\n\treturn getField('SELECT defaultpage.id\r\n\t\t\t\tFROM\r\n\t\t\t\t\t((select id from tpl_pages where default_page=1 limit 0,1)\r\n\t\t\t\t\tUNION\r\n\t\t\t\t\t(select id from tpl_pages order by id limit 0,1))\r\n\t\t\t\t\tAS defaultpage\r\n\t\t\t\tLIMIT 0,1');\r\n}",
"public function getRootPageId(): int;",
"protected function getCurrentPageId() {}",
"protected function getCurrentPageIdFromCurrentSiteRoot() {}",
"public function getCurrentPageId()\n\t{\n\t if (!$this->_currentPageId !== null) {\n\t return $this->_currentPageId;\n\t }\n\n\t\t$pageId = (integer) t3lib_div::_GP('id');\n\t\tif (!$pageId) {\n\t\t /* @var $db t3lib_db */\n\t\t $db = $GLOBALS['TYPO3_DB'];\n \t\t// get current site root\n \t\t$rootPages = $db->exec_SELECTgetRows('uid', 'pages', 'deleted=0 AND hidden=0 AND is_siteroot=1', '', '', '1');\n \t\tif (count($rootPages)) {\n \t\t\t$pageId = $rootPages[0]['uid'];\n \t\t} else {\n \t // get root template\n \t\t$rootTemplates = $db->exec_SELECTgetRows('pid', 'sys_template', 'deleted=0 AND hidden=0 AND root=1', '', '', '1');\n \t\tif (count($rootTemplates)) {\n \t\t\t$pageId = $rootTemplates[0]['pid'];\n \t\t} else {\n \t\t $pageId = 0;\n \t\t}\n \t\t}\n\t\t}\n\t\treturn $this->_currentPageId = $pageId;\n\t}",
"public function getPageID(){\n\t\t\n\t\tif(self::USE_SPLASH)\n\t\t{\n\t\t\t$this->setSplashID();\n\t\t}\n\t\telse $this->setPageID();\n\t\t\n\t}",
"public function getPageId();",
"private function determinePageId() : int {}",
"public final function get_page_id() {\n\t\treturn self::_get_page_id( $this->get_template() );\n\t}",
"public function getRootPageId() {\n\t\treturn $this->rootPage['uid'];\n\t}",
"protected function get_page_identifier() {\n\t\treturn $this->menu->get_page_identifier();\n\t}",
"protected function determinePageId() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the number of female babies 1223 months old who have been vaccinated at least once | public static function countFemaleVaccinated12to23() {
$query = self::select(array_map('DB::raw', self::vaccinationsSelectStrings()))
->groupBy(DB::raw(self::$groupBy))
->orderBy(DB::raw(self::orderBy()));
$query = self::applyGenericVaccinationsWhere($query);
$query = self::apply12to23VaccinationsWhere($query);
$query = self::applyGirlsWhere($query);
return self::applyTimePeriodWhere($query)->get()->toArray();
} | [
"public static function countFemaleVaccinated0to11() {\n\t\treturn self::zipArrays(DwSubmission017::countFemaleVaccinated0to11()->toArray(), DwSubmission018::countFemaleVaccinated0to11()->toArray(), ['vaccinated']);\n\t}",
"public static function countMaleVaccinated0to11() {\n\t\treturn self::zipArrays(DwSubmission017::countMaleVaccinated0to11()->toArray(), DwSubmission018::countMaleVaccinated0to11()->toArray(), ['vaccinated']);\n\t}",
"public function countTotalFemale(){\n \n \n $stmt = $this->conn->prepare(\"SELECT count(*) FROM fully_regitered_members WHERE member_gender = 'female'\");\n $stmt->execute();\n $count = $stmt->fetchAll();\n return $count;\n \n }",
"public function countTotalMale(){\n \n \n $stmt = $this->conn->prepare(\"SELECT count(*) FROM fully_regitered_members WHERE member_gender = 'male'\");\n $stmt->execute();\n $count = $stmt->fetchAll();\n return $count;\n \n }",
"public function mother_must_have_more_that_5_pregnancy_months()\n {\n $response = $this->post('/babyshowers', [\n 'name_mama' => '',\n 'name_papa' => '',\n 'email' => '',\n 'name_bebe' => '',\n 'birth_date' => Carbon::now()->addMonths('5'),\n 'event_date' => '',\n ]);\n\n $response->assertSessionHasErrors(['birth_date']);\n $this->assertCount(0, Babyshower::all());\n }",
"public function getAbandonedByStudentCount();",
"private function parse_participants_sex_count(){\n\n\t\t$this->female_count = 0;\n\t\t$this->male_count = 0;\n\t\tforeach($this->participants as $participant){\n\t\t\tif($participant->sex === 'female'){\n\t\t\t\t$this->female_count = $this->female_count + 1;\n\t\t\t}\n\t\t\telse if($participant->sex === 'male'){\n\t\t\t\t$this->male_count = $this->male_count + 1;\n\t\t\t}\n\t\t}\n\n\t}",
"public function getBillableMemberCount();",
"function freeze_gender_balance ()\n{\n // Extract the EventId and build the query\n\n $EventId = intval (trim ($_REQUEST['EventId']));\n if (0 == $EventId)\n return false;\n\n // Start by getting the maximum values for males, females and neutrals\n\n $sql = 'SELECT Title, MaxPlayersMale, MaxPlayersFemale, MaxPlayersNeutral';\n $sql .= ' FROM Events';\n $sql .= \" WHERE EventId=$EventId\";\n\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error ('Cannot query database');\n\n // We should have matched exactly one game\n\n if (1 != mysql_num_rows ($result))\n return display_error (\"Failed to find entry for EventId $EventId\");\n\n $row = mysql_fetch_object ($result);\n\n $Title = $row->Title;\n $MaxMale = $row->MaxPlayersMale;\n $MaxFemale = $row->MaxPlayersFemale;\n $MaxNeutral = $row->MaxPlayersNeutral;\n\n $max_signups = $MaxMale + $MaxFemale + $MaxNeutral;\n\n // Get the currnet count of males and females. There should only be\n // one run for this event...\n\n $sql = 'SELECT Signup.Gender, COUNT(Signup.Gender) AS Count';\n $sql .= ' FROM Signup, Runs';\n $sql .= \" WHERE Runs.EventId=$EventId\";\n $sql .= ' AND Signup.RunId=Runs.RunId';\n $sql .= ' AND Signup.State=\"Confirmed\"';\n $sql .= ' AND Signup.Counted=\"Y\"';\n $sql .= ' GROUP BY Gender';\n\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error ('Attempt to count confirmed signups for EventId $EventId Failed', $sql);\n\n $confirmed = array ();\n $confirmed['Male'] = 0;\n $confirmed['Female'] = 0;\n\n while ($row = mysql_fetch_object ($result))\n $confirmed[$row->Gender] = $row->Count;\n\n display_header ('Freeze Gender Balance');\n printf (\"<p>\\nThere are currently %d Male, %d Female and %d Neutral\\n\",\n\t $MaxMale, $MaxFemale, $MaxNeutral);\n echo \"roles for <i>$Title</i>\\n\";\n echo \"<p>\\nIf you freeze the gender balance, the neutral roles will be\\n\";\n echo \"changed to match the current balance of players signed up. If a\\n\";\n echo \"player withdraws from the game, this will force the website to\\n\";\n echo \"select the first player of the same gender on the waitlist instead\\n\";\n echo \"of simply the first player in line. You should consider doing this\\n\";\n echo \"after you've cast the game.\\n\";\n echo \"<p>\\nBased on the current list of players who have signed up for\\n\";\n echo \"<i>$Title</i>, there would be\\n\";\n printf (\"%d Male and %d Female roles, and no Neutral roles.\\n\",\n\t $confirmed['Male'],\n\t $confirmed['Female']);\n\n echo \"<p>\\n\";\n printf (\"Yes. <a href=Schedule.php?action=%d&EventId=%d&Male=%d&Female=%d>\" .\n\t \"Make the change</a>\\n\",\n\t SCHEDULE_CONFIRM_FREEZE_GENDER_BALANCE,\n\t $EventId,\n\t $confirmed['Male'],\n\t $confirmed['Female']);\n\n echo \"<p>\\n\";\n printf (\"No. <a href=Schedule.php?action=%d&EventId=%d>Return to \".\n\t \"<i>$Title</i></a>\\n\",\n\t SCHEDULE_SHOW_GAME,\n\t $EventId);\n}",
"public function countV_famille(){\n\t\t\t\t\t return count($this->listeV_famille());\n\t\t\t\t\t }",
"public function getPregnantWomenCount()\n\t{\n\t\t//TRUE parameter tells CI to return otherdb database object\n\t\t/*$otherdb = $this->load->database('otherdb', TRUE);\n\t\t$query = $otherdb->get('household');\n\t\tforeach ($query->result() as $data) {\n\t\t\techo $data->serial;\n\t\t\techo '<br>';\n\t\t}*/\n\n\t\t//another method\n\t\t$otherdb = $this->load->database('otherdb', TRUE);\n\t\t$query = $otherdb->query('select areYouPregnant, count(areYouPregnant) as total,\n\t\t\t\t\t\t\t\t\tCASE\n\t\t\t\t\t\t\t\t\t WHEN areYouPregnant = 1 THEN \"Yes\"\n\t\t\t\t\t\t\t\t\t WHEN areYouPregnant = 2 THEN \"No\"\n\t\t\t\t\t\t\t\t\t ELSE \"Missing\"\n\t\t\t\t\t\t\t\t\tEND as value\n\t\t\t\t\t\t\t\t\tfrom household \n\t\t\t\t\t\t\t\t\tgroup by areYouPregnant');\n\t\t$data = $query->result();\n\t\treturn $data;\n\t}",
"function total_courier_boys() {\n $rec = $this->db->query(\"SELECT * FROM tbl_courier_boy\");\n return $rec->num_rows();\n }",
"public function numberofremedies(){\n $numberofremedies = $this->db->count_all_results('remedies');\n return $numberofremedies;\n }",
"public function getTotalVacancies()\n {\n return $this->vacancies->count();\n }",
"public function getMoyenneAgeActors(){\n $ageMoyActors = DB::table('actors')\n ->avg(DB::raw('TIMESTAMPDIFF( YEAR, dob, NOW())'));\n return number_format($ageMoyActors, 1);\n }",
"function get_all_vaccins_count()\n {\n $this->db->from('vaccins');\n return $this->db->count_all_results();\n }",
"public function count_gender_employee($results) {\n foreach ($results as $value) {\n $results['countmale'] = $this->countmale_employee($value['id']);\n $results['countfemale'] = $this->countfemale_employee($value['id']);\n $results['countundefine'] = $this->countundefine_employee($value['id']);\n // $results[$key]['countfemaleal'] = $this->countfemaleall();\n // print_r($results[$key]['countfemale']);exit();\n }\n $results['countgernderall']=$results['countmale']+$results['countfemale']+$results['countundefine'];\n // echo $results['countgernderall'];exit();\n return $results;\n }",
"private function _count_active_user_month($today) {\n $month = date('m', strtotime($today->copy()));\n $year = date('Y', strtotime($today->copy()));\n if ($month && $year) {\n $arrWhere = [\n 'month' => $month,\n 'year' => $year\n ];\n // DB::connection('mongodb')->enableQueryLog();\n $count = Statistic_by_month::where($arrWhere)->first();\n // dd(DB::connection('mongodb')->getQueryLog());\n if ($count) {\n return $count->num_of_user;\n }\n return 0;\n }\n return 0;\n }",
"public function getArmyCount()\n {\n return $this->count(self::ARMY);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation assignAccessGroup Assign access group to person | public function assignAccessGroup($site_id, $person_id, $access_group_id, $body = null)
{
$this->assignAccessGroupWithHttpInfo($site_id, $person_id, $access_group_id, $body);
} | [
"public function assignUserToGroup($user_id, $usergroup_id);",
"public function assignUserToGroup(User $user, Group $group);",
"public function testAddToGroupToAssigned()\n {\n $oDb = $this->getDb();\n\n $oUser = $this->createUser();\n\n $sGroupId = $oDb->getOne('select oxgroupsid from oxobject2group where oxobjectid=\"' . $oUser->getId() . '\" ');;\n\n // assigning to some group\n $this->assertEquals(false, $oUser->addToGroup($sGroupId));\n }",
"protected function assignAccessGroupRequest($site_id, $person_id, $access_group_id, $body = null)\n {\n // verify the required parameter 'site_id' is set\n if ($site_id === null || (is_array($site_id) && count($site_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $site_id when calling assignAccessGroup'\n );\n }\n // verify the required parameter 'person_id' is set\n if ($person_id === null || (is_array($person_id) && count($person_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $person_id when calling assignAccessGroup'\n );\n }\n // verify the required parameter 'access_group_id' is set\n if ($access_group_id === null || (is_array($access_group_id) && count($access_group_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $access_group_id when calling assignAccessGroup'\n );\n }\n\n $resourcePath = '/{siteId}/person/{personId}/assign/accessgroup/{accessGroupId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($site_id !== null) {\n $resourcePath = str_replace(\n '{' . 'siteId' . '}',\n ObjectSerializer::toPathValue($site_id),\n $resourcePath\n );\n }\n // path params\n if ($person_id !== null) {\n $resourcePath = str_replace(\n '{' . 'personId' . '}',\n ObjectSerializer::toPathValue($person_id),\n $resourcePath\n );\n }\n // path params\n if ($access_group_id !== null) {\n $resourcePath = str_replace(\n '{' . 'accessGroupId' . '}',\n ObjectSerializer::toPathValue($access_group_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function addAccessGroup($name)\n\t{\n\t\t//check, if the group already exists\n\t\tif($this->entityManager->find(\"yourCMDB:CmdbAccessGroup\", $name) != null)\n\t\t{\n\t\t\tthrow new CmdbAccessGroupAlreadyExistsException(\"An access group with that name already exists.\");\n\t\t}\n\n\t\t//create the group\n\t\t$group = new CmdbAccessGroup($name);\n\t\t$this->entityManager->persist($group);\n\t\t$this->entityManager->flush();\n\n\t\t//return the group object\n\t\treturn $group;\n\t}",
"private function _assignGroup($groupid, $roles, $bizRules, $data) {\n if ($groupid) {\n $auth = Yii::app()->authManager;\n /* @var $auth SDbAuthManager */\n foreach ($roles as $role) {\n $auth->assignGroup($role, $groupid, $bizRules, $data);\n }\n }\n }",
"public function assignGroup($values){\n\t\t\t$LoginID=$values['LoginID'];\t\n\t\t\tif(!empty($values)){\n\t\t\t\tinclude($_SERVER['DOCUMENT_ROOT'].'/_php/config.php');\n\t\t\t\t// -- Check that user is faculty\n\t\t\t\t$checkrole = \"SELECT Role From login WHERE LoginID = '$LoginID'\";\t\t\t\n\t\t\t\t$getRole = mysqli_query($con, $checkrole);\n\t\t\t\tif (mysqli_num_rows($getRole) > 0){\n\t\t\t\t\twhile($row = mysqli_fetch_array($getRole)){\n\t\t\t\t\t\t$myRole = $row['Role'];\n\t\t\t\t\t\tif ($myRole == 'Faculty'){\n\t\t\t\t\t\t\t// -- Create New Class Assignment\n\t\t\t\t\t\t\t$sql = \"INSERT INTO group_assign(GroupID, LoginID) VALUES (?,?);\";\n\t\t\t\t\t\t\t\t$stmt = $con->prepare($sql);\n\t\t\t\t\t\t\t\t$stmt->bind_param(\"si\", $values['GroupID'], $values['Subj']);\n\t\t\t\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t\t\t\t$stmt->close();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{ \n\t\t\t\t\t\t\techo \"Only faculty can add people to groups. <br/> Please Login.\"; \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\telse{ \n\t\t\t\techo \"Only faculty can add people to groups. <br/> Please Login.\"; \n\t\t\t}\n\t\t}",
"protected function assignGroupsToAssignment()\n {\n $assignment = fp_env('ACACHA_FORGE_ASSIGNMENT');\n foreach ( $this->groups as $group) {\n $uri = str_replace('{assignment}', $assignment, config('forge-publish.assign_group_to_assignment_uri'));\n $uri = str_replace('{group}', $group, $uri);\n $url = config('forge-publish.url') . $uri;\n try {\n $response = $this->http->post($url, [\n 'headers' => [\n 'X-Requested-With' => 'XMLHttpRequest',\n 'Authorization' => 'Bearer ' . fp_env('ACACHA_FORGE_ACCESS_TOKEN')\n ]\n ]);\n } catch (\\Exception $e) {\n if ($e->getResponse()->getStatusCode() == 422) {\n $this->error('The group is already assigned');\n return;\n }\n $this->error('And error occurs connecting to the api url: ' . $url);\n $this->error('Status code: ' . $e->getResponse()->getStatusCode() . ' | Reason : ' . $e->getResponse()->getReasonPhrase());\n return [];\n }\n }\n }",
"function approve_group_access($username, $groupname, $username_mod, $expire_date)\n\t{\n\t\treturn modify_group_access($username, $groupname, $username_mod, \"approve\", \"\", $expire_date);\n\t}",
"function setAccessGroupKey( $key ) \n {\n $this->setValueByFieldName( 'accessgroup_key', $key );\n }",
"public function teacher_can_assign_assignment_to_a_group_with_users()\n {\n $this->loginAsTeacher();\n $group = factory(Group::class)->create();\n $users = factory(User::class,3)->create();\n //Assign users to group\n\n $group->users()->saveMany($users);\n\n $assignment = factory(Assignment::class)->create();\n $response = $this->post('/api/v1/assignment/' . $assignment->id . '/group/' . $group->id);\n\n $response->assertSuccessful();\n\n// $response->dump();\n\n $this->assertDatabaseHas('assignables', [\n 'assignment_id' => $assignment->id,\n 'assignable_id' => $group->id,\n 'assignable_type' => Group::class,\n ]);\n\n foreach ($users as $user) {\n $this->assertDatabaseHas('assignables', [\n 'assignment_id' => $assignment->id,\n 'assignable_id' => $user->id,\n 'assignable_type' => User::class,\n ]);\n }\n\n }",
"function _createGroup()\n {\n global $_ARRAYLANG;\n\n if (isset($_POST['access_create_group'])) {\n $objFWUser = \\FWUser::getFWUserObject();\n if (!empty($_POST['access_group_type']) && in_array($_POST['access_group_type'], $objFWUser->objGroup->getTypes())) {\n $this->_modifyGroup();\n return;\n } else {\n self::$arrStatusMsg['error'][] = $_ARRAYLANG['TXT_ACCESS_SELECT_A_VALID_GROUP_TYPE'];\n }\n }\n\n $this->_objTpl->addBlockfile('ACCESS_GROUP_TEMPLATE', 'module_access_group_create', 'module_access_group_create.html');\n\n $this->_objTpl->setVariable(array(\n 'TXT_ACCESS_CREATE_GROUP' => $_ARRAYLANG['TXT_ACCESS_CREATE_GROUP'],\n 'TXT_ACCESS_CREATE_GROUP_TYPE_QUESTION' => $_ARRAYLANG['TXT_ACCESS_CREATE_GROUP_TYPE_QUESTION'],\n 'TXT_ACCESS_FRONTEND_DESC' => $_ARRAYLANG['TXT_ACCESS_FRONTEND_DESC'],\n 'TXT_ACCESS_BACKEND_DESC' => $_ARRAYLANG['TXT_ACCESS_BACKEND_DESC'],\n 'TXT_ACCESS_CANCEL' => $_ARRAYLANG['TXT_ACCESS_CANCEL'],\n 'TXT_ACCESS_NEXT' => $_ARRAYLANG['TXT_ACCESS_NEXT']\n ));\n\n $this->_pageTitle = $_ARRAYLANG['TXT_ACCESS_CREATE_NEW_USER_GROUP'];\n\n $this->_objTpl->parse('module_access_group_create');\n }",
"function setGroupAccessRights($val = null)\n {\n $this->group_access_rights = $val;\n }",
"public function addGroup(string $group): IDocumentAccess;",
"public function addPermissionToGroup($permission, $group);",
"public function testCallGrantGroupPermission()\n {\n $permission = Mockery::mock(PermissionInterface::class);\n $group = Mockery::mock(GroupInterface::class);\n $actions = [];\n $overwrite = false;\n\n $mockRepository = Mockery::mock(AclRepository::class);\n $mockRepository->shouldReceive('grantGroupPermission')->with($permission, $group, $actions)->once()->andReturn(\n true\n );\n\n $object = new Acl($mockRepository);\n $response = $object->grantGroupPermission($permission, $group, $actions, $overwrite);\n $this->assertTrue($response);\n }",
"function SEC_addUserToGroup($uid, $gname)\n{\n global $_TABLES, $_CONF;\n\n $remote_grp = DB_getItem ($_TABLES['groups'], 'grp_id', \"grp_name='\". $gname .\"'\");\n DB_query (\"INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id,ug_uid) VALUES ($remote_grp, $uid)\");\n}",
"public function attach_group($p_user_id, $p_group_id, $p_ldap = '0')\n {\n if ($p_user_id > 0 && $p_group_id > 0)\n {\n $l_sql = 'INSERT INTO isys_person_2_group SET\n isys_person_2_group__isys_obj__id__person = ' . $this->convert_sql_id($p_user_id) . ',\n isys_person_2_group__isys_obj__id__group = ' . $this->convert_sql_id($p_group_id) . ',\n isys_person_2_group__ldap = ' . $this->convert_sql_int($p_ldap) . ';';\n\n if ($this->update($l_sql))\n {\n try\n {\n // Add relation see ID-2284\n isys_cmdb_dao_category_g_relation::instance($this->get_database_component())\n ->handle_relation($this->get_last_insert_id(), \"isys_person_2_group\", C__RELATION_TYPE__PERSON_ASSIGNED_GROUPS, null, $p_group_id, $p_user_id);\n }\n catch (Exception $e)\n {\n // Catching Error:\n // CMDB Error: Error: Your relation type for table 'isys_person_2_group' is empty. The constant cache is maybe not available here. [] []\n }\n\n isys_component_signalcollection::get_instance()\n ->emit('mod.cmdb.beforeUserGroupChanged', $p_user_id, $p_group_id, 'attach-person');\n\n return $this->apply_update();\n } // if\n } // if\n\n return false;\n }",
"public function modificagroupAction()\n {\n $data = explode(\"|\",$this->_getParam('data'));\n $group = new Application_Model_DbTable_Groups();\n $group->updateGroup($data[0],$data[1]);\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test addNamespace adds an item | public function testAddItem()
{
$namespace = Input::formatNamespace('Bar\\Baz');
$this->namespaceManager->add('Foo', $namespace);
$this->assertCount(1, $this->namespaceManager->namespaces);
} | [
"public function testAddNamespaceItem() {\n $routerStub = $this->createMock(Router::class);\n\n $breadcrumbsHelper = new BreadcrumbsHelper($routerStub);\n $breadcrumbsHelper->addNamespaceItem(\"test\", \"Link One\", \"http://example.com/one\");\n $breadcrumbsHelper->addNamespaceItem(\"test\", \"Link Two\", \"http://example.com/two\");\n\n // Define expected result array\n $resultArray[] = new Breadcrumb(\"Link One\", \"http://example.com/one\", \"breadcrumbs\", [], true);\n $resultArray[] = new Breadcrumb(\"Link Two\", \"http://example.com/two\", \"breadcrumbs\", [], true);\n\n $this->assertEquals($resultArray, $breadcrumbsHelper->getNamespaceBreadcrumbs(\"test\"));\n $this->assertEquals([], $breadcrumbsHelper->getNamespaceBreadcrumbs());\n }",
"#[@fromDia(xpath= 'namespace::dia', value= 'namespace')]\n public function addNamespace($namespace) {\n list($prefix, $uri)= each($namespace);\n $this->ns[$prefix]= $uri;\n }",
"function addNamespaces(array $namespaces);",
"public function testAddDefaultNamespace()\n {\n $this->markTestIncomplete('This test has not been implemented yet.');\n }",
"public function addNamespace($namespace, $hint);",
"public static function addNamespace($namespace, $hints){}",
"public function testAddEmptyNamespace()\n {\n $namespace = Input::formatNamespace('');\n $this->namespaceManager->add('Foo', $namespace);\n }",
"function addNamespace(&$data, $namespace) {\n $action = ($namespace{0} == '-')?'exclude':'include';\n $namespace = cleanID(preg_replace('/^[+-]/', '', $namespace));\n if(!empty($namespace)){\n $data['ns'][$action][] = $namespace;\n }\n }",
"public function testGetNamespace(): void\n {\n self::assertNull($this->sut->getNamespace(), 'The attribute has not been set.');\n \n $nsl1 = $this->createNamespaceListTypeDummy();\n $this->sut->setNamespace($nsl1);\n self::assertSame($nsl1, $this->sut->getNamespace(), 'Set the attribute with a value: NamespaceListType.');\n \n $nsl2 = $this->createNamespaceListTypeDummy();\n $this->sut->setNamespace($nsl2);\n self::assertSame($nsl2, $this->sut->getNamespace(), 'Set the attribute with another value: NamespaceListType.');\n }",
"public function testReplaceNamespaceStatus()\n {\n }",
"public function addNamespace($namespace)\n {\n if (in_array($namespace, $this->namespaces) == false) {\n $this->namespaces[] = $namespace;\n }\n }",
"abstract public function setNamespace();",
"public function addNamespaces()\r\n\t{\t\t\r\n\t\t$path = $this->path;\r\n\t\tforeach ($this->all() as $key => $name) {\r\n\r\n\t\t\t$this->app['translator']->addNamespace($name, $path.$name.'/lang');\r\n\r\n\t\t}\r\n\t}",
"public function testNamespaceFolder()\n {\n list($parameters, $input1, $output1, $input2, $output2) =\n $this->loadFixture(__DIR__ .'/fixtures/add-namespace.testfixture');\n\n // Build mock collection\n $code = new MockCodeCollection([\n 'dir/test1.php' => $input1,\n 'dir/test2.php' => $input2,\n ]);\n $file1 = $code->itemByPath('dir/test1.php');\n $file2 = $code->itemByPath('dir/test2.php');\n $otherfile = $code->itemByPath('notdir/otherfile.php');\n\n // Add spec to rule\n $namespacer = new AddNamespaceRule();\n $namespacer\n ->withParameters($parameters)\n ->withRoot('');\n\n // Test that pre-post hooks detect namespaced classes\n $changeset = new CodeChangeSet();\n $namespacer->beforeUpgradeCollection($code, $changeset);\n $this->assertEquals(\n [\n 'ExampleSubclass',\n 'RenamedInterface',\n 'Traitee',\n ],\n $namespacer->getClassesInNamespace('Upgrader\\\\NewNamespace')\n );\n\n\n // Check loading namespace from config\n $this->assertEquals('Upgrader\\\\NewNamespace', $namespacer->getNamespaceForFile($file1));\n $this->assertEquals('Upgrader\\\\NewNamespace', $namespacer->getNamespaceForFile($file2));\n $this->assertNull($namespacer->getNamespaceForFile($otherfile));\n\n // Test upgrading file1\n $generated1 = $namespacer->upgradeFile($input1, $file1, $changeset);\n $this->assertFalse($changeset->hasWarnings($file1->getPath()));\n $this->assertEquals($output1, $generated1);\n\n // Test upgrading file2\n $generated2 = $namespacer->upgradeFile($input2, $file2, $changeset);\n $this->assertFalse($changeset->hasWarnings($file2->getPath()));\n $this->assertEquals($output2, $generated2);\n }",
"public static function addNamespace($namespace, $directorie)\n {\n self::$loader->registerNamespace($namespace, $directorie);\n }",
"function AddNamespace( $namespace, $prefix = null ) {\n if ( !isset($this->namespaces[$namespace]) ) {\n if ( isset($prefix) && ($prefix == \"\" || isset($this->prefixes[$prefix])) ) $prefix = null;\n if ( $prefix == null ) {\n // Try and build a prefix based on the first alphabetic character of the last element of the namespace\n if ( preg_match('/^(.*):([^:]+)$/', $namespace, $matches) ) {\n $alpha = preg_replace( '/[^a-z]/i', '', $matches[2] );\n $prefix = strtoupper(substr($alpha,0,1));\n }\n else {\n $prefix = 'X';\n }\n $i = \"\";\n if ( isset($this->prefixes[$prefix]) ) {\n for ( $i=1; $i<10 && isset($this->prefixes[\"$prefix$i\"]); $i++ ) {\n }\n }\n if ( isset($this->prefixes[\"$prefix$i\"]) ) {\n dbg_error_log(\"ERROR\", \"Cannot find a free prefix for this namespace\");\n exit;\n }\n $prefix = \"$prefix$i\";\n dbg_error_log(\"XMLDocument\", \"auto-assigning prefix of '%s' for ns of '%s'\", $prefix, $namespace );\n }\n else if ( $prefix == \"\" || isset($this->prefixes[$prefix]) ) {\n dbg_error_log(\"ERROR\", \"Cannot assign the same prefix to two different namespaces\");\n exit;\n }\n\n $this->prefixes[$prefix] = $prefix;\n $this->namespaces[$namespace] = $prefix;\n }\n else {\n if ( isset($this->namespaces[$namespace]) && $this->namespaces[$namespace] != $prefix ) {\n dbg_error_log(\"ERROR\", \"Cannot use the same namespace with two different prefixes\");\n exit;\n }\n $this->prefixes[$prefix] = $prefix;\n $this->namespaces[$namespace] = $prefix;\n }\n }",
"public function addNamespaces()\n\t{\t\t\n\t\t$path = $this->path;\n\t\tforeach ($this->all() as $key => $name) {\n\n\t\t\t\\Lang::addNamespace($name, $path.$name.'/lang');\n\n\t\t}\n\t}",
"public function addToNamespace($namespace , $value)\n {\n if(!in_array($value , $_SESSION[$namespace])) $_SESSION[$namespace][] = $value;\n }",
"public function testNamespacedXml()\n {\n $xml = '<items xmlns=\"http://www.example.org/schema\"><item id=\"1\" /></items>';\n $simpleXml = simplexml_load_string($xml);\n $outputXml = $this->fixture->registerTiVoNamespace($simpleXml);\n\n $itemList = $outputXml->xpath('tivo:item[@id = 1]');\n $this->assertCount(1, $itemList);\n\n $this->assertEquals(\n $outputXml->getDocNamespaces(true),\n $outputXml->getNamespaces(true)\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load all admin pages | public function loadAdminPages() {
$tabs = [];
foreach ($this->pages as $page) {
if($page instanceof IAdminPageTab) {
// Add tab
$tabs[$page->getTabKey()] = $page->getTabName();
$page->load();
}
}
$this->loadTabs($tabs);
} | [
"public function acfedu_load_admin_pages() {\n\t\t\t\tinclude( 'inc/dashboard-page.php' );\n\t\t\t\tinclude( 'inc/settings-page.php' );\n\t\t\t\tinclude( 'inc/pro-page.php' );\n\t\t\t}",
"public function adminPages() {}",
"function md_the_admin_pages() {\n \n // Call the admin_pages class\n $admin_pages = (new MidrubBaseClassesPages\\Admin_pages);\n\n // Return admin pages\n return $admin_pages->load_pages();\n \n }",
"private function setupAdminPages() {\n\t\tif (!is_admin()) {\n\t\t\treturn;\n\t\t}\n\n\t\t$pages = apply_filters('heavymetal/admin/pages', []);\n\t\t$pages = array_merge($pages, $this->setting('pages', []));\n\t\tif (count($pages) == 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach($pages as $pageClass) {\n\t\t\tif (class_exists($pageClass) && is_subclass_of($pageClass, AdminPageController::class)) {\n\t\t\t\t/** @var AdminPageController $adminPage */\n\t\t\t\t$adminPage = new $pageClass($this->context);\n\t\t\t\t$this->adminPages[] = $adminPage;\n\n\t\t\t\tadd_action('admin_menu', function() use ($adminPage) {\n\t\t\t\t\tif ($adminPage->parentMenuSlug() == null) {\n\t\t\t\t\t\tadd_menu_page($adminPage->pageTitle(), $adminPage->menuTitle(), $adminPage->capability(), $adminPage->menuSlug(), function() use ($adminPage) {\n\t\t\t\t\t\t\techo $adminPage->execute($this->context->request);\n\t\t\t\t\t\t}, $adminPage->icon(), $adminPage->menuPosition());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tadd_submenu_page($adminPage->parentMenuSlug(), $adminPage->pageTitle(), $adminPage->menuTitle(), $adminPage->capability(), $adminPage->menuSlug(), function() use ($adminPage) {\n\t\t\t\t\t\t\techo $adminPage->execute($this->context->request);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}, 10001);\n\t\t\t}\n\t\t}\n\t}",
"public function load_admin()\n {\n if (!is_admin()) {\n return;\n }\n\n require_once DIVIROIDS_PLUGIN_INCLUDES_DIR . 'class-diviroids-admin.php';\n }",
"public function getAdminPages() { return array(); }",
"private static function admin_pages() {\n\t\tglobal $wpseo_admin_pages;\n\n\t\treturn $wpseo_admin_pages;\n\t}",
"function admin_load()\n {\n }",
"private function admin(){\r\n\t\tif ( is_admin() ) {\r\n\t\t\tdo_action('before_setup_admin');\r\n\t\t\tforeach( glob($this->path['includes_dir'] . 'admin/*.php') as $class_path )\r\n\t\t\t\trequire_once( $class_path );\r\n\t\t\tdo_action('after_setup_admin');\r\n\t\t}\r\n\t}",
"public function setupAdminPage() \n\t{\n\n\t}",
"public function loadAdmin(){\n\t\t$this->load->view('shared/_adminlayout', $this->template);\n\t}",
"public function admin_allPages() {\n $this->layout = 'admin';\n $this->set('PAGE_TITLE', 'Admin: CMS Pages');\n /*$pages = $this->CmsPage->find('all', array('fields' => array('CmsPage.id', 'CmsPage.title', 'CmsPage.status', 'CmsPage.created'))); //pr($pages);die;\n $this->set('pages_data', $pages);*/\n \n $this->Paginator->settings = array('limit' => 10,'fields' => array('CmsPage.id', 'CmsPage.title', 'CmsPage.status', 'CmsPage.created'),'conditions' => array('CmsPage.language' => 'EN'));\n\t\t$pages = $this->Paginator->paginate('CmsPage');\n\t\t$this->set('pages_data', $pages);\n \n }",
"public function load_admin_page() {\n\t\t// Bring in our list table class\n\t\trequire_once 'cf-mini-blog-list-table.class.php';\n\n\t\t// Bring in our Network Carousel Mini-Blog\n\t\t// require_once 'carousel-plugin.php'; // @TODO this will be developed later\n\n\t\t// Handle messages\n\t\tadd_action('admin_notices', array($this, 'admin_notices'));\n\n\t\t// bring in custom JS\n\t\twp_enqueue_script('cfmb_admin', add_query_arg(array($this->action => 'admin_js'), admin_url()), array('jquery'), $this->ver);\n\n\t\twp_enqueue_style('cfmb_admin', $this->url.'css/admin.css', array(), $this->ver);\n\t}",
"private function load_admin_page_class()\n {\n }",
"private function instantiate_admin_pages() {\n $this->admin_objs[ 'menu' ] = new HRHS_Admin_Menu();\n }",
"public function admin_index() {\n\n\t\t\t/*get all data from table \"modules\"*/\n\t\t\t$modules=$this->Module->find(\"all\");\n\n\t\t\t/*set variables of page*/\n\t\t\t$this->set(\"title\", \"Gestion\");\n\t\t\t$this->set(\"legend\", \"Modules manager\");\n\t\t\t$this->set(\"modules\", $modules);\n\t\t\t}",
"public function load()\n {\n add_action('admin_menu', array($this, 'addSettingsPages'), 15);\n }",
"public function load_admin_page() {\n\t \t\n\t\t// determine the action from either the GET parameter (for sub-menu entries, and the main admin menu entry)\n\t\t$action = ( ! empty( $_GET['action'] ) ) ? $_GET['action'] : 'list'; // default action is list\n\t\t\n\t\tif ( $this->is_top_level_page ) {\n\t\t\t// or for sub-menu entry of an admin menu \"IggoGrid\" entry, get it from the \"page\" GET parameter\n\t\t\tif ( 'iggogrid' !== $_GET['page'] ) {\n\t\t\t\t\n\t\t\t\t// actions that are top-level entries, but don't have an action GET parameter (action is after last _ in string)\n\t\t\t\t$action = substr( $_GET['page'], 9 ); // $_GET['page'] has the format 'iggogrid_{$action}'\n\t\t\t}\n\t\t} else {\n\t\t\t// do this here in the else-part, instead of adding another if ( ! $this->is_top_level_page ) check\n\t\t\t$this->init_i18n_support(); // done here, as for sub menu admin pages this is the first time translated strings are needed\n\t\t\t$this->init_view_actions(); // for top-level menu entries, this has been done above, just like init_i18n_support()\n\t\t}\n\t\t\n\t\t// check if action is a supported action, and whether the user is allowed to access this screen\n\t\tif ( ! isset( $this->view_actions[ $action ] ) || ! current_user_can( $this->view_actions[ $action ]['required_cap'] ) ) {\n\t\t\twp_die( __( 'You do not have sufficient permissions to access this page.', 'default' ) );\n\t\t}\n\t\t\n\t\t// changes current screen ID and pagenow variable in JS, to enable automatic meta box JS handling\n\t\tset_current_screen( \"iggogrid_{$action}\" );\n\n\t\t// pre-define some table data\n\t\t$data = array(\n\t\t\t'view_actions' => $this->view_actions,\n\t\t\t'message' => ( ! empty( $_GET['message'] ) ) ? $_GET['message'] : false,\n\t\t);\n\t\t\n\t\t// depending on action, load more necessary data for the corresponding view\n\t\tswitch ( $action ) {\n\t\t\tcase 'list':\n\t\t\t\t$data['table_id'] = ( ! empty( $_GET['table_id'] ) ) ? $_GET['table_id'] : false;\n\t\t\t\t$data['table_ids'] = IggoGrid::$model_table->load_all( true ); // Prime the post meta cache for cached loading of last_editor\n\t\t\t\t$data['messages']['first_visit'] = IggoGrid::$model_options->get( 'message_first_visit' );\n\t\t\t\tif ( current_user_can( 'iggogrid_import_tables_wptr' ) ) {\n\t\t\t\t\t$data['messages']['wp_table_reloaded_warning'] = is_plugin_active( 'wp-table-reloaded/wp-table-reloaded.php' ); // check if WP-Table Reloaded is activated\n\t\t\t\t} else {\n\t\t\t\t\t$data['messages']['wp_table_reloaded_warning'] = false;\n\t\t\t\t}\n\t\t\t\t$data['messages']['show_plugin_update'] = IggoGrid::$model_options->get( 'message_plugin_update' );\n\t\t\t\t$data['messages']['plugin_update_message'] = IggoGrid::$model_options->get( 'message_plugin_update_content' );\n\t\t\t\t$data['messages']['donation_message'] = $this->maybe_show_donation_message();\n\t\t\t\t$data['table_count'] = count( $data['table_ids'] );\n\t\t\t\tbreak;\n\t\t\tcase 'about':\n\t\t\t\t$data['plugin_languages'] = $this->get_plugin_languages();\n\t\t\t\t$data['first_activation'] = IggoGrid::$model_options->get( 'first_activation' );\n// \t\t\t\t$exporter = IggoGrid::load_class( 'IggoGrid_Export', 'class-export.php', 'classes' );\n// \t\t\t\t$data['zip_support_available'] = $exporter->zip_support_available;\n\t\t\t\tbreak;\n\t\t\tcase 'options':\n\t\t\t\t// Maybe try saving \"Custom CSS\" to a file:\n\t\t\t\t// (called here, as the credentials form posts to this handler again, due to how request_filesystem_credentials() works)\n\t\t\t\tif ( isset( $_GET['item'] ) && 'save_custom_css' == $_GET['item'] ) {\n\t\t\t\t\tIggoGrid::check_nonce( 'options', $_GET['item'] ); // nonce check here, as we don't have an explicit handler, and even viewing the screen needs to be checked\n\t\t\t\t\t$action = 'options_custom_css'; // to load a different view\n\t\t\t\t\t// try saving \"Custom CSS\" to a file, otherwise this gets the HTML for the credentials form\n\t\t\t\t\t$iggogrid_css = IggoGrid::load_class( 'IggoGrid_CSS', 'class-css.php', 'classes' );\n\t\t\t\t\t$result = $iggogrid_css->save_custom_css_to_file_plugin_options( IggoGrid::$model_options->get( 'custom_css' ), IggoGrid::$model_options->get( 'custom_css_minified' ) );\n\t\t\t\t\tif ( is_string( $result ) ) {\n\t\t\t\t\t\t$data['credentials_form'] = $result; // this will only be called if the save function doesn't do a redirect\n\t\t\t\t\t} elseif ( true === $result ) {\n\t\t\t\t\t\t// at this point, saving was successful, so enable usage of CSS in files again,\n\t\t\t\t\t\t// and also increase the \"Custom CSS\" version number (for cache busting)\n\t\t\t\t\t\tIggoGrid::$model_options->update( array(\n\t\t\t\t\t\t\t'use_custom_css_file' => true,\n\t\t\t\t\t\t\t'custom_css_version' => IggoGrid::$model_options->get( 'custom_css_version' ) + 1,\n\t\t\t\t\t\t) );\n\t\t\t\t\t\tIggoGrid::redirect( array( 'action' => 'options', 'message' => 'success_save' ) );\n\t\t\t\t\t} else { // leaves only $result = false\n\t\t\t\t\t\tIggoGrid::redirect( array( 'action' => 'options', 'message' => 'success_save_error_custom_css' ) );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$data['frontend_options']['use_custom_css'] = IggoGrid::$model_options->get( 'use_custom_css' );\n\t\t\t\t$data['frontend_options']['custom_css'] = IggoGrid::$model_options->get( 'custom_css' );\n\t\t\t\t$data['user_options']['parent_page'] = $this->parent_page;\n\t\t\t\t$data['user_options']['plugin_language'] = IggoGrid::$model_options->get( 'plugin_language' );\n\t\t\t\t$data['user_options']['plugin_languages'] = $this->get_plugin_languages();\n\t\t\t\tbreak;\n\t\t\tcase 'edit':\n\t\t\t\tif ( ! empty( $_GET['table_id'] ) ) {\n\t\t\t\t\t$data['table'] = IggoGrid::$model_table->load( $_GET['table_id'], true, true ); // Load table, with table data, options, and visibility settings\n// \t\t\t\t\tprint_r($data['table']);die;\n\t\t\t\t\tif ( is_wp_error( $data['table'] ) ) {\n\t\t\t\t\t\tIggoGrid::redirect( array( 'action' => 'list', 'message' => 'error_load_table' ) );\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! current_user_can( 'iggogrid_edit_table', $_GET['table_id'] ) ) {\n\t\t\t\t\t\twp_die( __( 'You do not have sufficient permissions to access this page.', 'default' ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tIggoGrid::redirect( array( 'action' => 'list', 'message' => 'error_no_table' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Filter the data that is passed to the current IggoGrid View.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param array $data Data for the view.\n\t\t * @param string $action The current action for the view.\n\t\t */\n\t\t$data = apply_filters( 'iggogrid_view_data', $data, $action );\n\t\t\n\t\t// prepare and initialize the view\n\t\t$this->view = IggoGrid::load_view( $action, $data );\n\t}",
"function bbp_get_tools_admin_pages()\n{\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ This outputs the image for the question | function get_question_image() {
global $questionDetails;
if($questionDetails['questionImg']){
echo "<img class='question-image' src='assets/lesson-images/".$questionDetails['questionImg']."'/>";
}
} | [
"function generateQuizResult()\r\n\t\t{\r\n\r\n\t\t\t$results = get_post_meta( (int)get_query_var( 'viraquiz_quiz_id' ), '_viraquiz_results', true );\r\n\t\t\t$layers = $results[get_query_var( 'viraquiz_result' )]['layers'];\r\n\r\n\t\t\t$img = $this->drawImage( $layers, 'live' );\r\n\r\n\t\t\tif( !empty( $_GET['shared_page'] ) ) {\r\n\t\t\t\t$img->resize( 400, 210 );\r\n\t\t\t}\r\n\r\n\t\t\techo $img->response('jpg');\r\n\r\n\t\t}",
"public function showImage()\n\t{\n\t\t$str = \"\";\n\t\tfor ($y = 0; $y < $this->height; $y++) \n\t\t{\n\t\t\t//show y axis\n\t\t\t$str .= (($y + 1) % 10);\n\t\t\t\n\t\t\t//show a line\n\t\t\tfor ($x = 0; $x < $this->width; $x++)\n\t\t\t{\t$id = $this->getId($x, $y);\n\t\t\t\tif ($this->image[$id] == 1)\t{\t$str .= $this->value1;\t}\n\t\t\t\telse\t\t\t\t\t\t{\t$str .= $this->value0;\t}\n\t\t\t}\n\t\t\t$str .= \"<br>\";\n\t\t}\n\t\t\n\t\t//show x axis\n\t\t$str .= \"-\";\n\t\tfor ($x = 0; $x < $this->width; $x++)\n\t\t{\t$str .= (($x + 1) % 10);\t}\n\t\t$str .= \"<br>\";\n\t\treturn $str;\n\t}",
"function quiz_print_possible_question_image($question, $courseid) {\n\n global $CFG;\n\n if ($question->image) {\n echo '<img border=\"0\" src=\"';\n\n if (substr(strtolower($question->image), 0, 7) == 'http://') {\n echo $question->image;\n\n } else if ($CFG->slasharguments) { // Use this method if possible for better caching\n echo \"$CFG->wwwroot/file.php/$courseid/$question->image\";\n\n } else {\n echo \"$CFG->wwwroot/file.php?file=$courseid/$question->image\";\n }\n echo '\" alt=\"\" />';\n\n }\n}",
"public function getAnswerImage() {\n\t\treturn null; \n\t}",
"static function buildImgFonEvaluations() {\r\n\t\t\techo '<div align=\"center\">';\r\n\t\t\t\r\n\t\t\techo '<TABLE bgcolor=\"#D2E9FF\">';\r\n\t\t\techo '<TR bgcolor=\"#D2E9FF\">';\r\n\t\t\techo '<TD bgcolor=\"#D2E9FF\">';\r\n\t\t\t\r\n\t\t\techo '<A href=\"#\"><img src=\"../../../images/imagenfondoeva.jpg\" alt=\"Simadi\" title=\"Fondo\" height=\"500\" width=\"660\"></a>';\r\n\t\r\n\t\t\techo '</TD>';\r\n\t\t\techo '</TR>';\r\n\t\t\techo '</TABLE>';\r\n\t\t\techo '</div>';\r\n\t\r\n\t\t}",
"public function drawEmbed()\n {\n //header(\"Content-type: image/png\");\n ob_start();\n imagepng($this->getImage(),null);\n $image = ob_get_contents();\n ob_end_clean();\n $image = base64_encode($image);\n echo '<img src=\"data:image/png;base64,'.$image.'\" alt=\"some shit\" />';\n }",
"public function generateMainImage();",
"public function viewImg()\n {\n $this->createImg();\n $this->setPx();\n $this->outText();\n $this->outImg();\n }",
"public function question($quest, $ans, $num, $picture)\n {\n // Column widths\n $w = array(10, 70, 10);\n $wor = array('A)', 'B)', 'C)', 'D)');\n // Header\n $this->SetFontSize(10);\n $this->MyCell($w[0],6,$num, 1, 0,'C');\n $this->MyCell(1, 6);\n $this->writeH($quest);\n // Data\n if($picture){\n $s = getimagesize(\"../$picture\");\n $ap = $s[0]/$s[1];\n $s[1] = 80/$ap;\n $sgd = $this->gety();\n /*if($sgd + $s[1] > 297){\n $this->SetCol($this->col+1);\n $this->sety(17);\n }*/\n $this->image(\"../$picture\",$this->getx(),$this->gety()+1,80);\n $this->sety($this->gety()+$s[1]);\n $this->Ln();\n }\n for($i = 0; $i < 4; $i++)\n {\n $this->SetFontSize(10);\n $this->MyCell($w[0],6,$wor[$i]);\n $this->writeH($ans[$i]);\n }\n }",
"public function generateResultSchema() \r\n\t\t{\r\n\r\n\t\t\t$quiz_id = (int)get_query_var( 'viraquiz_quiz_id' );\r\n\t\t\t$result_number = (int)get_query_var( 'viraquiz_result' );\r\n\r\n\t\t\t$layers = get_post_meta( $quiz_id, '_viraquiz_results', true )[$result_number]['layers'];\r\n\r\n\t\t\t$img = $this->drawImage( $layers );\r\n\t\t\t$img->resize( 400, 210 );\r\n\r\n\t\t\techo $img->response('jpg');\r\n\r\n\r\n\t\t}",
"static function buildImgFonSimadi() {\r\n\t\t\techo '<div align=\"center\">';\r\n\t\t\t\r\n\t\t\techo '<TABLE bgcolor=\"#D2E9FF\">';\r\n\t\t\techo '<TR bgcolor=\"#D2E9FF\">';\r\n\t\t\techo '<TD bgcolor=\"#D2E9FF\">';\r\n\t\t\t\r\n\t\t\techo '<A href=\"#\"><img src=\"../../../images/fondosimadi.jpg\" alt=\"Simadi\" title=\"Fondo\" height=\"500\" width=\"660\"></a>';\r\n\t\r\n\t\t\techo '</TD>';\r\n\t\t\techo '</TR>';\r\n\t\t\techo '</TABLE>';\r\n\t\t\techo '</div>';\r\n\t\r\n\t\t}",
"public function img()\n {\n return '<img src=\"'.$this->src().'\" alt=\"captcha\">';\n }",
"public function produce_image() {\r\n\r\n $im = imagecreatetruecolor($this->imagesize->width, $this->imagesize->height);\r\n\r\n // Fill palette\r\n $palette = array();\r\n $palette['white'] = imagecolorallocate($im, 255, 255, 255);\r\n $palette['black'] = imagecolorallocate($im, 0, 0, 0);\r\n $palette['red'] = imagecolorallocate($im, 255, 0, 0);\r\n\r\n // Set image background to white\r\n imagefill($im,0,0,$palette['white']);\r\n\r\n // Draw a rectangle frame\r\n imagesetthickness($im, FRAME_THICKNESS);\r\n $iw1 = $this->imagesize->width - 1;\r\n $ih1 = $this->imagesize->height - 1;\r\n\r\n imageline($im, 0, 0, $iw1, 0, $palette['black']);\r\n imageline($im, $iw1, 0 , $iw1 , $ih1, $palette['black']);\r\n imageline($im, $iw1, $ih1, 0, $ih1, $palette['black']);\r\n imageline($im, 0, $ih1, 0, 0, $palette['black']);\r\n\r\n for($i = 0; $i < count($this->labels); $i++) {\r\n $this->labels[$i]->paint($im, $palette);\r\n }\r\n if ($this->data['type'] == 'absent') {\r\n $this->draw_absent_mistake($im, $palette);\r\n }\r\n if ($this->data['type'] == 'moved') {\r\n $this->draw_moved_mistake($im, $palette);\r\n }\r\n\r\n // Output image\r\n header('Content-type: image/png');\r\n imagepng($im);\r\n imagedestroy($im);\r\n }",
"static function display_captcha(){\n\t\t\n\t\t\t//possible letters that can can come in captcha.\n\t\t\t$possible_letter = array(\"P\", \"m\", \"r\", \"a\", \"wan\", \"ga\", \"ra\", \"k\", \"h\", \"z\", \"G\", \"bbQ\", \"H\");\n\n\t\t\t//just random number.\n\t\t\t$random_letter = rand(0, 12);\n\n\t\t\t//Whole random string combined with numbers and letters\n\t\t\t$whole_random_possibility = $possible_letter[$random_letter] . rand(100, 199) . $possible_letter[$random_letter];\n\n\t\t\t//random string stored in this session\n\t\t\t$_SESSION[\"random_string\"] = $whole_random_possibility;\n\n\t\t\t//return image identifies represending black image of speficied size\n\t\t\t$image = imagecreatetruecolor(100, 30);\n\n\t\t\t//create text color for specified image.\n\t\t\t$text_color = imagecolorallocate($image, 255, 255, 255);\n\n\t\t\t//paste the string on top of the image\n\t\t\timagestring($image, 5, 5, 5, $whole_random_possibility, $text_color);\n\n\t\t\t//outputs saves the image to same directory as other files.\n\t\t\timagepng($image, \"image.png\");\n\t\t\techo \"<img src='image.png'> </br>\";\n\t\t\t\n\t\t}",
"public function display()\n\t{\n\t\t//allow ouput or save with optional image format\n\t\t\n\t\t\n\t\t$image = $this->generate();\n\t\theader(\"Content-type: image/png\");\n\t\timagepng($image);\n\t}",
"static function display_captcha(){\n\t\t\n\t\t\t//possible letters that can can come in captcha.\n\t\t\t$possible_letter = array(\"a\", \"z\", \"b\", \"t\", \"kpp\", \"sj\", \"mx\", \"l\", \"d\", \"z\", \"l\", \"bbl\", \"l\");\n\n\t\t\t//just random number.\n\t\t\t$random_letter = rand(0, 12);\n\n\t\t\t//Whole random string combined with numbers and letters\n\t\t\t$whole_random_possibility = $possible_letter[$random_letter] . rand(100, 199) . $possible_letter[$random_letter];\n\n\t\t\t//random string stored in this session\n\t\t\t$_SESSION[\"random_string\"] = $whole_random_possibility;\n\n\t\t\t//return image identifies represending black image of speficied size\n\t\t\t$image = imagecreatetruecolor(100, 30);\n\n\t\t\t//create text color for specified image.\n\t\t\t$text_color = imagecolorallocate($image, 255, 255, 255);\n\n\t\t\t//paste the string on top of the image\n\t\t\timagestring($image, 5, 5, 5, $whole_random_possibility, $text_color);\n\n\t\t\t//outputs saves the image to same directory as other files.\n\t\t\timagepng($image, \"image.png\");\n\t\t\techo \"<img src='image.png'> </br>\";\n\t\t\t\n\t\t}",
"public function __toString()\n {\n return $this->generateMainImage();\n }",
"function question_get_feedback_image($fraction, $selected=true) {\n\n global $CFG;\n\n if ($fraction >= 1.0) {\n if ($selected) {\n $feedbackimg = '<img src=\"'.$CFG->pixpath.'/i/tick_green_big.gif\" '.\n 'alt=\"'.get_string('correct', 'quiz').'\" class=\"icon\" />';\n } else {\n $feedbackimg = '<img src=\"'.$CFG->pixpath.'/i/tick_green_small.gif\" '.\n 'alt=\"'.get_string('correct', 'quiz').'\" class=\"icon\" />';\n }\n } else if ($fraction > 0.0 && $fraction < 1.0) {\n if ($selected) {\n $feedbackimg = '<img src=\"'.$CFG->pixpath.'/i/tick_amber_big.gif\" '.\n 'alt=\"'.get_string('partiallycorrect', 'quiz').'\" class=\"icon\" />';\n } else {\n $feedbackimg = '<img src=\"'.$CFG->pixpath.'/i/tick_amber_small.gif\" '.\n 'alt=\"'.get_string('partiallycorrect', 'quiz').'\" class=\"icon\" />';\n }\n } else {\n if ($selected) {\n $feedbackimg = '<img src=\"'.$CFG->pixpath.'/i/cross_red_big.gif\" '.\n 'alt=\"'.get_string('incorrect', 'quiz').'\" class=\"icon\" />';\n } else {\n $feedbackimg = '<img src=\"'.$CFG->pixpath.'/i/cross_red_small.gif\" '.\n 'alt=\"'.get_string('incorrect', 'quiz').'\" class=\"icon\" />';\n }\n }\n return $feedbackimg;\n}",
"function display_discrimination_chart() {\n global $CFG;\n\n $imageurl = $CFG->wwwroot.'/mod/quiz/report/psychometric/discriminationgraph.php';\n return '<img src=\"'.$imageurl.'\" alt=\"'.get_string('discriminationgraph', 'quiz_psychometric').'\" style=\"max-width:360px\"/>';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that a warning is thrown when an invalid single testVersion is provided. | public function testGetTestVersionInvalidVersion($testVersion)
{
$message = \sprintf('Invalid testVersion setting: \'%s\'', \trim($testVersion));
$this->expectWarning();
$this->expectWarningMessage($message);
$this->testGetTestVersion($testVersion, [null, null]);
} | [
"public function testWarning() {\n $this->expectException(Warning::class);\n trigger_error('Test warning', E_USER_WARNING);\n }",
"public function testGetVersionInfoInvalidParamType()\n {\n if (\\method_exists($this, 'expectException')) {\n // PHPUnit 5+.\n if (PHP_VERSION_ID >= 70000) {\n $this->expectException('TypeError');\n } else {\n $this->expectException('PHPUnit_Framework_Error');\n }\n } else {\n // PHPUnit 4.\n $this->setExpectedException('PHPUnit_Framework_Error');\n }\n\n $this->getVersionInfo(null);\n }",
"public function testTargetVersionIsValid() {\n\t\t$this->assertRegExp( '/\\d\\.\\d+\\.\\d+.*/',\n\t\t\tself::$version,\n\t\t\t\"Must be passed a valid MediaWiki version\"\n\t\t);\n\t}",
"public function testWarning(\\unittest\\TestWarning $warning) {\n // Empty\n }",
"public function testWarning(TestWarning $warning);",
"public function testCoreVersionRequirementInvalid($test_case, $constraint) {\n $invalid_core_version_requirement = <<<INVALID_CORE_VERSION_REQUIREMENT\n# info.yml for core_version_requirement validation.\nname: Gracie Evaluator\ndescription: 'Determines if Gracie is a \"Good Dog\". The answer is always \"Yes\".'\npackage: Core\ntype: module\nversion: VERSION\ncore_version_requirement: '$constraint'\ndependencies:\n - goodness_api\nINVALID_CORE_VERSION_REQUIREMENT;\n\n vfsStream::setup('modules');\n vfsStream::create([\n 'fixtures' => [\n \"invalid_core_version_requirement-$test_case.info.txt\" => $invalid_core_version_requirement,\n \"invalid_core_version_requirement-$test_case-duplicate.info.txt\" => $invalid_core_version_requirement,\n ],\n ]);\n $exception_message = \"The 'core_version_requirement' can not be used to specify compatibility for a specific version before 8.7.7 in vfs://modules/fixtures/invalid_core_version_requirement-$test_case\";\n // Set the expected exception for the 2nd call to parse().\n $this->expectException('\\Drupal\\Core\\Extension\\InfoParserException');\n $this->expectExceptionMessage(\"$exception_message-duplicate.info.txt\");\n try {\n $this->infoParser->parse(vfsStream::url(\"modules/fixtures/invalid_core_version_requirement-$test_case.info.txt\"));\n }\n catch (InfoParserException $exception) {\n $this->assertSame(\"$exception_message.info.txt\", $exception->getMessage());\n\n $this->infoParser->parse(vfsStream::url(\"modules/fixtures/invalid_core_version_requirement-$test_case-duplicate.info.txt\"));\n }\n }",
"public function expectDeprecation() {\n\t\t$this->expectException( '\\PHPUnit\\Framework\\Error\\Deprecated' );\n\t}",
"public function testDeprecationWarning()\n {\n $currentErrorReporting = error_reporting(E_ALL & ~E_USER_DEPRECATED);\n deprecationWarning('This method is deprecated');\n error_reporting($currentErrorReporting);\n\n $this->expectException(Deprecated::class);\n $this->expectExceptionMessageRegExp('/^This method is deprecated/');\n $this->expectExceptionMessageRegExp('/You can disable deprecation warnings by setting `error_reporting\\(\\)` to `E_ALL & ~E_USER_DEPRECATED`\\.$/');\n deprecationWarning('This method is deprecated');\n }",
"public function testWarning(\\unittest\\TestWarning $warning) {\n $this->writeFailure($warning);\n $this->stats['warned']++;\n }",
"public function testDeprecationWarningLevelDisabled(): void\n {\n $this->expectNotToPerformAssertions();\n\n $this->withErrorReporting(E_ALL ^ E_USER_DEPRECATED, function (): void {\n deprecationWarning('This is leaving');\n });\n }",
"public function testDeprecationWarning(): void\n {\n $current = error_reporting(E_ALL & ~E_USER_DEPRECATED);\n deprecationWarning('This method is deprecated');\n error_reporting($current);\n\n $this->expectDeprecation();\n $this->expectExceptionMessageMatches('/^This method is deprecated/');\n $this->expectExceptionMessageMatches('/You can disable deprecation warnings by setting `error_reporting\\(\\)` to `E_ALL & ~E_USER_DEPRECATED`\\.$/');\n deprecationWarning('This method is deprecated');\n }",
"public function testCheckVersionCannotDetectVersion()\n {\n // The : command will output nothing and return status 0\n // This means no version output will be found so checkVersion will \n // return false\n $this->_object->setOption('phpcsbin', ':');\n $result = $this->_object->checkVersion();\n\n $this->assertFalse($result);\n }",
"public function testSetIncorrectStylesVersion()\n {\n $file = new SubstationalphaFile();\n\n $this->setExpectedException(\\InvalidArgumentException::class);\n $file->setStylesVersion('incorrect version');\n }",
"public function compatVersionConditionDoesNotMatchNewerRelease() {}",
"public function testVersionNumberIsAValidOne(): void\n {\n $version = $this->pandoc->getVersion();\n $this->assertTrue(version_compare($version, '0.0.1', '>='));\n }",
"public function testWarning(\\unittest\\TestWarning $warning) {\n $this->status= false;\n $this->stats['warned']++;\n $this->writeFailure($warning);\n }",
"protected function _version_check()\n\t{\n\t\tee()->load->library('el_pings');\n\t\t$version_file = ee()->el_pings->get_version_info();\n\n\t\tif ( ! $version_file)\n\t\t{\n\t\t\tee('CP/Alert')->makeBanner('notices')\n\t\t\t\t->asWarning()\n\t\t\t\t->withTitle(lang('cp_message_warn'))\n\t\t\t\t->addToBody(sprintf(\n\t\t\t\t\tlang('new_version_error'),\n\t\t\t\t\tee()->cp->masked_url(DOC_URL.'troubleshooting/error_messages/unexpected_error_occurred_attempting_to_download_the_current_expressionengine_version_number.html')\n\t\t\t\t))\n\t\t\t\t->now();\n\t\t}\n\t}",
"public function testWarning() {\n\t\t$test = new Warning( 'runTest' );\n\t\t$test->run( $this->result );\n\n\t\t$this->assertSame( 1, $this->listener->startTestCount, 'test start count failed' );\n\t\t$this->assertSame( 1, $this->listener->warningCount, 'warning count failed' );\n\t\t$this->assertSame( 1, $this->listener->endTestCount, 'test end count failed' );\n\t}",
"public function invalidVersionNumberDataProvider() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ | | Output Bundles | Get contextual breadcrumbs data. For breadcrumbs, the current sort, view and limit, if available in the URL base parameters, are used if configured via persist_sort and persist_view. The generated title string includes all crumb column values. In query scope: all URL base params are persistent, once added. In global scope: no URL base params are persistent. | public function getBreadcrumbs(); | [
"protected function _getBreadcrumbs()\n {\n if (!$this->_crumbs) {\n $helper = Mage::helper('crumbs');\n $pageType = $helper->getPageType();\n $crumbs = array();\n\n if ($pageType == $helper::PAGE_TYPE_DIRECT_PRODUCT) {\n\n $regProd = Mage::registry('current_product');\n $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($regProd->getId());\n $crumbs = Mage::getModel('crumbs/breadcrumbs')->getProductBreadcrumbs($product);\n $lastCrumbTitle = Mage::registry('current_product')->getName();\n\n } elseif ($pageType == $helper::PAGE_TYPE_CATEGORY_PRODUCT) {\n\n //$crumbs = Mage::getModel('crumbs/breadcrumbs')->getDirectBreadcrumbs();\n //$lastCrumbTitle = Mage::registry('current_product')->getName();\n $regProd = Mage::registry('current_product');\n $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($regProd->getId());\n $crumbs = Mage::getModel('crumbs/breadcrumbs')->getProductBreadcrumbs($product);\n $lastCrumbTitle = Mage::registry('current_product')->getName();\n\n } elseif ($pageType == $helper::PAGE_TYPE_CATEGORY) {\n\n $crumbs = Mage::getModel('crumbs/breadcrumbs')->getDirectBreadcrumbs(true);\n $lastCrumbTitle = Mage::registry('current_category')->getName();\n\n }\n\n if (Mage::helper('crumbs')->showOnlyOnePath() || $pageType == $helper::PAGE_TYPE_CATEGORY) {\n $crumbs = $this->getLongestPath($crumbs); \n } elseif (Mage::helper('crumbs')->hideDuplicates()) {\n $crumbs = $this->hideDubCategories($crumbs);\n }\n\n if (count($crumbs) == 1) {\n $crumbs = $this->addLastCrumb($crumbs, $lastCrumbTitle);\n }\n\n $this->_crumbs = $crumbs;\n }\n\n return $this->_crumbs;\n }",
"public function getBreadcrumbs() { return array(); }",
"public function getBreadcrumbs() : array {\n\t\tif ( !isset( $this->id ) ) {\n\t\t\treturn array();\n\t\t}\n\t\tif ( isset( $this->breadcrumbs ) ) {\n\t\t\treturn $this->breadcrumbs;\n\t\t}\n\t\t\n\t\t$this->breadcrumbs\t= array();\n\t\t\n\t\t$this->breadcrumbs['categories']\t= \n\t\t$this->category->getBreadcrumbs();\n\t\t\n\t\t$this->breadcrumbs['boards']\t\t= \n\t\tparent::getCrumb( \n\t\t\tarray( \n\t\t\t\t'id', 'parent_id', 'title', 'slug', \n\t\t\t\t'description', 'status' \n\t\t\t),\n\t\t\t'boards',\n\t\t\t( int ) $this->id\n\t\t);\n\t\t\n\t\treturn $this->breadcrumbs;\n\t}",
"public static function getBreadcrumbs () {\n\t\tplugin('content_getbreadcrumbs');\n\t\treturn self::$breadcrumbs[self::$currentId];\n\t}",
"protected function _getBreadcrumbs()\n\t{\n\t\t$crumbs = parent::_getBreadcrumbs();\n\t\t\n\t\tif ($this->app->isRoot()) {\n\t\t\t$crumbs['blog'] = [\n\t\t\t\t'label' => __($this->_getEntity()->getName()),\n\t\t\t\t'title' => __($this->_getEntity()->getName())\n\t\t\t];\n\t\t}\n\t\telse {\n\t\t\tunset($crumbs['blog']['link']);\n\t\t}\n\n\t\treturn $crumbs;\n\t}",
"public function Breadcrumbs() {\n\t\t\n\t\t//Get the default breadcrumbs\n\t\t$Breadcrumbs = parent::Breadcrumbs();\n\t\t\n\t\tif($ProductCategory = $this->getProductCategory())\n\t\t{\n\t\t\t//Explode them into their individual parts\n\t\t\t$Parts = explode(SiteTree::$breadcrumbs_delimiter, $Breadcrumbs);\n\t\n\t\t\t//Count the parts\n\t\t\t$NumOfParts = count($Parts);\n\t\t\t\n\t\t\t//Change the last item to a link instead of just text\n\t\t\t$Parts[$NumOfParts-1] = (\"<a href=\\\"\" . $this->Link() . \"\\\">\" . $this->Title . \"</a>\");\n\t\t\t\n\t\t\t//Add our extra piece on the end\n\t\t\t$Parts[$NumOfParts] = $ProductCategory->Category; \n\t\n\t\t\t//Return the imploded array\n\t\t\t$Breadcrumbs = implode(SiteTree::$breadcrumbs_delimiter, $Parts);\t\t\t\n\t\t}\n\n\t\treturn $Breadcrumbs;\n\t}",
"public function breadcrumbs() {\n\n\t\t// Split & filter breadcrumbs\n\t\t$breadcrumbs = VariableHelper::shatter('/', $this->request);\n\n\t\t// Reverse breadcrumbs (so 0 index is current dir)\n\t\t$breadcrumbs = array_reverse($breadcrumbs);\n\n\t\t// Start HTML with link to root\n\t\t$html = '<a href=\"/\" class=\"icon home\"></a> /';\n\n\t\t// Show each breadcrumb\n\t\t$count = count($breadcrumbs) - 1;\n\t\tfor ($i = $count; $i >= 0; $i--) {\n\n\t\t\tif ($i !== 0) {\n\n\t\t\t\t// Generate href for ancestor dirs\n\t\t\t\t$href = '';\n\t\t\t\tfor ($i2 = 0; $i2 < $i; $i2++) {\n\t\t\t\t\t$href .= '../';\n\t\t\t\t}\n\n\t\t\t\t// Make link for breadcrumb\n\t\t\t\t$html .= '<a href=\"'.$href.'\" class=\"breadcrumb\">'.$breadcrumbs[$i].'</a>/';\n\n\t\t\t} else {\n\n\t\t\t\t// Make current breadcrum bold\n\t\t\t\t$html .= '<b><a href=\".\" class=\"breadcrumb\">'.$breadcrumbs[$i].'</a></b>/';\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $html;\n\n\t}",
"function wb_get_breadcrumbs()\n{\n return Westudio_Bootstrap_Breadcrumbs::items();\n}",
"function breadcrumbs()\n{\n\tglobal $BREADCRUMB_SET_PARENTS,$BREADCRUMBS,$BREADCRUMB_EXTRA_SEGMENTS;\n\n\t$show_top=((get_param_integer('wide_high',get_param_integer('keep_wide_high',0))!=1));\n\tif (!$show_top) return new ocp_tempcode();\n\n\tif ($BREADCRUMBS===NULL)\n\t{\n\t\t$BREADCRUMBS=breadcrumbs_get_default_stub($BREADCRUMB_EXTRA_SEGMENTS->is_empty());\n\t}\n\t$out=new ocp_tempcode();\n\t$out->attach($BREADCRUMBS);\n\tif (!$BREADCRUMB_EXTRA_SEGMENTS->is_empty())\n\t{\n\t\tif (!$out->is_empty()) $out->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t$out->attach($BREADCRUMB_EXTRA_SEGMENTS);\n\t}\n\n\t// Substitutions (deprecated hardcoding example)\n\t$segment_substitutions=array();\n\t$root=get_param('keep_catalogue_root_page',NULL);\n\tif ($root!==NULL)\n\t{\n\t\t$page_name=get_param('keep_catalogue_root_page_name');\n\t\t$target_url=build_url(array('page'=>$root),'_SEARCH');\n\t\t$breadcrumb_tpl=do_template('BREADCRUMB_ESCAPED');\n\t\t$from='\\<a title=\"[^\"]*\" href=\"[^\"]*/site/index.php\\?page=catalogues&type=misc[^\"]*\"\\>Catalogues\\</a\\>'.$breadcrumb_tpl->evaluate();\n\t\t$to='<a title=\"'.do_lang('GO_BACKWARDS_TO',escape_html(strip_tags($page_name))).'\" href=\"'.escape_html($target_url->evaluate()).'\">'.escape_html($page_name).'</a>'.$breadcrumb_tpl->evaluate();\n\t\t$segment_substitutions[$from]=$to;\n\t}\n\t// Substitutions (XML)\n\tif ((addon_installed('breadcrumbs')) && (function_exists('xml_parser_create')))\n\t{\n\t\t$data=@file_get_contents(get_custom_file_base().'/data_custom/breadcrumbs.xml',FILE_TEXT);\n\t\tif (($data===false) && (get_custom_file_base()!=get_file_base()))\n\t\t\t$data=@file_get_contents(get_file_base().'/data_custom/breadcrumbs.xml',FILE_TEXT);\n\t\tif (trim($data)!='')\n\t\t{\n\t\t\trequire_code('breadcrumbs');\n\t\t\t$segment_substitutions=array_merge($segment_substitutions,load_breadcrumb_substitutions($out->evaluate(),$data));\n\t\t}\n\t}\n\n\tif (count($segment_substitutions)!=0)\n\t{\n\t\t$_out=$out->evaluate();\n\t\tforeach ($segment_substitutions as $from=>$to)\n\t\t{\n\t\t\t$_out=preg_replace('~'.str_replace('~','\\~',$from).'~Us',$to,$_out,1);\n\t\t}\n\t\treturn make_string_tempcode($_out);\n\t}\n\n\treturn $out;\n}",
"public function generate_breadcrumbs();",
"private function getViewBreadcrumbs()\n {\n return [\n [\n 'label' => 'Core pages',\n 'url' => ['index'],\n ],\n [\n 'label' => 'View core page',\n ]\n ];\n }",
"public function breadcrumb();",
"public function breadcrumbs() : string;",
"public function get_breadcrumb_field()\n {\n return 'isys_obj__title';\n }",
"public function getBreadcrumbs()\n {\n if ($this->breadcrumbs === null) {\n if ($breadcrumbsModel = $this->pageTypeResolver->getBreadcrumbsModel()) {\n $this->breadcrumbs = $breadcrumbsModel->getAllBreadcrumbs();\n }\n }\n\n return $this->breadcrumbs;\n }",
"function wc_admin_get_breadcrumbs()\n {\n }",
"public function getBreadcrumbsData()\n {\n if (!$this->hasData(\"breadcrumbs_data\")) {\n $this->buildBreadcrumbsData();\n }\n\n return $this->getData(\"breadcrumbs_data\");\n }",
"function _getBreadcrumb() {\n\t\t$breadcrumb = $this->getTestList();\n\t\tarray_shift($breadcrumb);\n\t\t$out = \"\\n\\tin \" . implode(\"\\n\\tin \", array_reverse($breadcrumb));\n\t\t$out .= \"\\n\\n\";\n\t\treturn $out;\n\t}",
"public function Breadcrumbs() {\n\t\t$basePath = str_replace(Director::protocolAndHost(), '', Director::absoluteBaseURL());\n\t\t$relPath = parse_url(substr($_SERVER['REQUEST_URI'], strlen($basePath), strlen($_SERVER['REQUEST_URI'])), PHP_URL_PATH);\n\t\t$parts = explode('/', $relPath);\n\t\t$base = Director::absoluteBaseURL();\n\t\t$pathPart = \"\";\n\t\t$pathLinks = array();\n\t\tforeach($parts as $part) {\n\t\t\tif ($part != '') {\n\t\t\t\t$pathPart .= \"$part/\";\n\t\t\t\t$pathLinks[] = \"<a href=\\\"$base$pathPart\\\">$part</a>\";\n\t\t\t}\n\t\t}\n\t\treturn implode('→ ', $pathLinks);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Surrounds a matching regex with prefix and postfix string | public static function regexSurround($string,$regex,$prefix,$postfix){
return preg_replace($regex, $prefix.'$1'.$postfix, $string);
} | [
"protected function initPatternReplacement()\n {\n $this->addPatternAndReplacement('^\"', '``');\n $this->addPatternAndReplacement(\"\\([ ([{<]\\)\",\"$1 `` \");\n $this->addPatternAndReplacement(\"\\.\\.\\.\",\" ... \");\n $this->addPatternAndReplacement(\"([,;:@#$%&])\", \" $1 \");\n $this->addPatternAndReplacement(\"([^.])([.])([])}>\\\"\\']*)[ \t]*$\",\"\\${1} \\${2}\\${3}\");\n $this->addPatternAndReplacement(\"[?!]\",\" $0 \");\n $this->addPatternAndReplacement(\"[][(){}<>]\",\" $0 \");\n $this->addPatternAndReplacement(\"--\",\" -- \");\n $this->addPatternAndReplacement(\"\\\"\",\" '' \");\n\n $this->addPatternAndReplacement(\"([^'])' \",\"\\${1} ' \");\n $this->addPatternAndReplacement(\"'([sSmMdD]) \",\" '\\${1} \");\n $this->addPatternAndReplacement(\"'ll \",\" 'll \");\n $this->addPatternAndReplacement(\"'re \",\" 're \");\n $this->addPatternAndReplacement(\"'ve \",\" 've \");\n $this->addPatternAndReplacement(\"n't \",\" n't \");\n $this->addPatternAndReplacement(\"'LL \",\" 'LL \");\n $this->addPatternAndReplacement(\"'RE \",\" 'RE \");\n $this->addPatternAndReplacement(\"'VE \",\" 'VE \");\n $this->addPatternAndReplacement(\"N'T \",\" N'T \");\n\n $this->addPatternAndReplacement(\" ([Cc])annot \",\" \\1an not \");\n $this->addPatternAndReplacement(\" ([Dd])'ye \",\" \\${1}' ye \");\n $this->addPatternAndReplacement(\" ([Gg])imme \",\" \\${1}im me \");\n $this->addPatternAndReplacement(\" ([Gg])onna \",\" \\${1}on na \");\n $this->addPatternAndReplacement(\" ([Gg])otta \",\" \\${1}ot ta \");\n $this->addPatternAndReplacement(\" ([Ll])emme \",\" \\${1}em me \");\n $this->addPatternAndReplacement(\" ([Mm])ore'n \",\" \\${1}ore 'n \");\n $this->addPatternAndReplacement(\" '([Tt])is \",\" '\\${1} is \");\n $this->addPatternAndReplacement(\" '([Tt])was \",\" '\\${1} was \");\n $this->addPatternAndReplacement(\" ([Ww])anna \",\" \\${1}an na \");\n\n $this->addPatternAndReplacement(\" *\",\" \");\n $this->addPatternAndReplacement(\"^ *\",\"\");\n\n }",
"public function mergeRegexpRule($content,$data,$target){\n $content = preg_replace_callback(\n $target,$data,$content\n );\n return $content;\n }",
"function preg_merge( $string, $subs ) {\n $patterns = array_map( 'cb_preg_merge', array_keys( $subs ) );\n $tmp = preg_replace( $patterns, array_values( $subs ), $string );\n return $tmp;\n}",
"function _wpcc_trans_regex() {\n return _wpcc('You can write plain text or regular expressions. If you want to use delimiters, you can use \"/\".\n If the expression does not start with \"/\", it is considered as it does not have delimiters. In that case, forward \n slashes will be automatically added. You can test your regex <a href=\"https://regex101.com/\" target=\"_blank\">here</a>.');\n}",
"function fractal_replace($search, $replace, $string, $offset = 0) {\n\t//$this->fractal_replace_debug_counter++;\n\t//if($this->fractal_replace_debug_counter === 18) {\n\t//\tfractal_zip::fatal_error('$this->fractal_replace_debug_counter === 18');\n\t//}\n\tif($search === $replace) {\n\t\treturn $string;\n\t}\n\t$this->final_fractal_replace = $replace;\n\t//if(substr_count($replace, '<') > 1) {\n\t//\tfractal_zip::fatal_error('substr_count($replace, \\'<\\') > 1');\n\t//}\n\t$initial_string = $string;\n\t$initial_offset = $offset;\n\t$initial_post_offset = $offset + strlen($search);\n\tpreg_match_all('/<([0-9]+)\"([0-9]+)\"*([0-9]*)>/is', $replace, $tag_in_replace_matches, PREG_OFFSET_CAPTURE);\n\t// [4] is offset adjustment\n\t// [5] is length adjustment\n\tforeach($tag_in_replace_matches[0] as $index => $value) {\n\t\t$tag_in_replace_matches[4][$index] = 0;\n\t\t$tag_in_replace_matches[5][$index] = 0;\n\t}\n\t//print('$tag_in_replace_matches: ');var_dump($tag_in_replace_matches);\n\t$pre = substr($string, 0, $offset);\n\t//print('$string after replace in fractal_replace:');var_dump($string);\n\tpreg_match_all('/<([0-9]+)\"([0-9]+)\"*([0-9]*)>/is', $pre, $tag_in_pre_matches, PREG_OFFSET_CAPTURE);\n\t//print('$tag_in_pre_matches: ');var_dump($tag_in_pre_matches);\n\t$counter = sizeof($tag_in_pre_matches[0]) - 1;\n\twhile($counter > -1) { // reverse order\n\t\t$new_tag_in_pre_offset = $tag_in_pre_offset = (int)$tag_in_pre_matches[1][$counter][0];\n\t\t$new_tag_in_pre_length = $tag_in_pre_length = (int)$tag_in_pre_matches[2][$counter][0];\n\t\tif($tag_in_pre_offset >= $offset) {\n\t\t\t$new_tag_in_pre_length = $tag_in_pre_length + strlen($replace) - strlen($search);\n\t\t}\n\t\t//print('$new_tag_in_pre_offset, $tag_in_pre_offset, $new_tag_in_pre_length, $tag_in_pre_length: ');var_dump($new_tag_in_pre_offset, $tag_in_pre_offset, $new_tag_in_pre_length, $tag_in_pre_length);\n\t\tif($new_tag_in_pre_offset === $tag_in_pre_offset && $new_tag_in_pre_length === $tag_in_pre_length) {\n\t\t\t$counter--;\n\t\t\tcontinue;\n\t\t}\n\t\t$tag_in_pre_operation = $tag_in_pre_matches[0][$counter][0];\n\t\t$tag_in_pre_recursion = $tag_in_pre_matches[3][$counter][0];\n\t\tif($tag_in_pre_recursion !== '') {\n\t\t\t$new_tag_in_pre_operation = '<' . $new_tag_in_pre_offset . '\"' . $new_tag_in_pre_length . '\"' . $tag_in_pre_recursion . '>';\n\t\t} else {\n\t\t\t$new_tag_in_pre_operation = '<' . $new_tag_in_pre_offset . '\"' . $new_tag_in_pre_length . '>';\n\t\t}\n\t\tforeach($tag_in_replace_matches[0] as $index => $value) {\n\t\t\tif($tag_in_replace_matches[1][$index][0] + $offset <= $tag_in_pre_matches[0][$counter][1] && $tag_in_replace_matches[2][$index][0] >= $tag_in_pre_matches[0][$counter][1] + strlen($tag_in_pre_operation)) {\n\t\t\t\t//print('beep000002<br>');\n\t\t\t\t$tag_in_replace_matches[5][$index] += strlen($new_tag_in_pre_operation) - strlen($tag_in_pre_operation);\n\t\t\t}\n\t\t}\n\t\t$string = substr($string, 0, $tag_in_pre_matches[0][$counter][1]) . $new_tag_in_pre_operation . substr($string, $tag_in_pre_matches[0][$counter][1] + strlen($tag_in_pre_operation));\n\t\t$counter--;\n\t}\n\t$offset = $offset + strlen($initial_string) - strlen($string);\n\tforeach($tag_in_replace_matches[0] as $index => $value) {\n\t\tif($tag_in_replace_matches[1][$index][0] + $offset <= $initial_offset) {\n\t\t\t//print('beep000001<br>');\n\t\t\t$tag_in_replace_matches[4][$index] += $offset - $initial_offset;\n\t\t}\n\t}\n\t$post_offset = $offset + strlen($replace);\n\tforeach($tag_in_replace_matches[0] as $index => $value) {\n\t\tif($tag_in_replace_matches[1][$index][0] + $offset >= $initial_post_offset) {\n\t\t\t//print('beep000003<br>');\n\t\t\t$tag_in_replace_matches[4][$index] += $post_offset - $initial_post_offset;\n\t\t}\n\t}\n\t$string_after_replace = $string = substr($string, 0, $offset) . $replace . substr($string, $offset + strlen($search));\n\t//print('$string_after_replace: ');var_dump($string_after_replace);\n\tpreg_match_all('/<([0-9]+)\"([0-9]+)\"*([0-9]*)>/is', $string, $tag_in_post_matches, PREG_OFFSET_CAPTURE, $post_offset);\n\t//print('$tag_in_post_matches: ');var_dump($tag_in_post_matches);\n\t$counter = sizeof($tag_in_post_matches[0]) - 1;\n\twhile($counter > -1) { // reverse order\n\t\t$new_tag_in_post_offset = $tag_in_post_offset = (int)$tag_in_post_matches[1][$counter][0];\n\t\t$new_tag_in_post_length = $tag_in_post_length = (int)$tag_in_post_matches[2][$counter][0];\n\t\tif($tag_in_post_offset >= $offset) {\n\t\t\t$new_tag_in_post_length = $tag_in_post_length + strlen($replace) - strlen($search);\n\t\t}\n\t\t//print('$new_tag_in_post_offset, $tag_in_post_offset, $new_tag_in_post_length, $tag_in_post_length: ');var_dump($new_tag_in_post_offset, $tag_in_post_offset, $new_tag_in_post_length, $tag_in_post_length);\n\t\tif($new_tag_in_post_offset === $tag_in_post_offset && $new_tag_in_post_length === $tag_in_post_length) {\n\t\t\t$counter--;\n\t\t\tcontinue;\n\t\t}\n\t\t$tag_in_post_operation = $tag_in_post_matches[0][$counter][0];\n\t\t$tag_in_post_recursion = $tag_in_post_matches[3][$counter][0];\n\t\tif($tag_in_post_recursion !== '') {\n\t\t\t$new_tag_in_post_operation = '<' . $new_tag_in_post_offset . '\"' . $new_tag_in_post_length . '\"' . $tag_in_post_recursion . '>';\n\t\t} else {\n\t\t\t$new_tag_in_post_operation = '<' . $new_tag_in_post_offset . '\"' . $new_tag_in_post_length . '>';\n\t\t}\n\t\tforeach($tag_in_replace_matches[0] as $index => $value) {\n\t\t\t//print('$tag_in_replace_matches[1][$index][0] + $offset, $tag_in_post_matches[0][$counter][1], $tag_in_replace_matches[2][$index][0] + $post_offset, $tag_in_post_matches[0][$counter][1] + strlen($tag_in_post_operation): ');var_dump($tag_in_replace_matches[1][$index][0] + $offset, $tag_in_post_matches[0][$counter][1], $tag_in_replace_matches[2][$index][0] + $post_offset, $tag_in_post_matches[0][$counter][1] + strlen($tag_in_post_operation));\n\t\t\tif($tag_in_replace_matches[1][$index][0] + $offset <= $tag_in_post_matches[0][$counter][1] && $tag_in_replace_matches[2][$index][0] + $post_offset >= $tag_in_post_matches[0][$counter][1] + strlen($tag_in_post_operation)) {\n\t\t\t\t//print('beep000004<br>');\n\t\t\t\t$tag_in_replace_matches[5][$index] += strlen($new_tag_in_post_operation) - strlen($tag_in_post_operation);\n\t\t\t}\n\t\t}\n\t\t$string = substr($string, 0, $tag_in_post_matches[0][$counter][1]) . $new_tag_in_post_operation . substr($string, $tag_in_post_matches[0][$counter][1] + strlen($tag_in_post_operation));\n\t\t$counter--;\n\t}\n\tfractal_zip::warning_once('hackety; is fractal_replace working perfectly for more complex fractal_strings? need to test');\n\t//$search = substr($string, 0, strpos($string, 'b'));\n\t//$replace = 'a<' . strpos($string, 'b') . '\"' . (strlen($string) - strpos($string, 'b') + 1) . '>aaaa';\n\t//$replace = 'a<' . strpos($string, 'b') . '\"' . (strlen($string) - strpos($string, 'b')) . '>aaaa';\n\t//$offset = strpos($string, $search);\n\t\n\t//print('$offset, $post_offset: ');var_dump($offset, $post_offset);\n\t$search = substr($string, $offset, $post_offset - $offset); // can we not set search to replace?\n\t//$replace = 'a<' . $post_offset . '\"' . (strlen($string) - $post_offset - $offset) . '>aaaa';\n\t//$replace = preg_replace('/<([0-9]+)\"([0-9]+)\"*([0-9]*)>/is', '<' . $post_offset . '\"' . (strlen($string) - $post_offset - $offset) . '>', $search);\n\t//print('should be ' . htmlentities('<' . $post_offset . '\"' . (strlen($string) - $post_offset - $offset) . '>') . '<br>');\n\t//print('$tag_in_replace_matches at the bottom: ');var_dump($tag_in_replace_matches);\n\t$counter = sizeof($tag_in_replace_matches[0]) - 1;\n\twhile($counter > -1) { // reverse order\n\t\t$tag_in_replace_offset = (int)$tag_in_replace_matches[1][$counter][0];\n\t\t$tag_in_replace_length = (int)$tag_in_replace_matches[2][$counter][0];\n\t\t$new_tag_in_replace_offset = $tag_in_replace_offset + $tag_in_replace_matches[4][$counter];\n\t\t$new_tag_in_replace_length = $tag_in_replace_length + $tag_in_replace_matches[5][$counter];\n\t\t$tag_in_replace_operation = $tag_in_replace_matches[0][$counter][0];\n\t\t$tag_in_replace_recursion = $tag_in_replace_matches[3][$counter][0];\n\t\tif($tag_in_replace_recursion !== '') {\n\t\t\t$new_tag_in_replace_operation = '<' . $new_tag_in_replace_offset . '\"' . $new_tag_in_replace_length . '\"' . $tag_in_replace_recursion . '>';\n\t\t} else {\n\t\t\t$new_tag_in_replace_operation = '<' . $new_tag_in_replace_offset . '\"' . $new_tag_in_replace_length . '>';\n\t\t}\n\t\t$replace = substr($replace, 0, $tag_in_replace_matches[0][$counter][1]) . $new_tag_in_replace_operation . substr($replace, $tag_in_replace_matches[0][$counter][1] + strlen($tag_in_replace_operation));\n\t\t$counter--;\n\t}\n\t//$offset = $offset;\n\t//print('new $search, $replace, $string, $offset at the end of the fractal_replace recursion: ');var_dump($search, $replace, $string, $offset);\n\treturn fractal_zip::fractal_replace($search, $replace, $string, $offset);\n}",
"public function replaceInsertIntoPrefix($input);",
"protected function mountExpression($prefix, $expression, $postfix = '')\n {\n if (empty($expression)) {\n return '';\n }\n\n return $prefix . ' ' . $expression . $postfix;\n }",
"function postfixWhereToInfix($postfixStack)\n\t{\n\t\t$stack = array();\n\t\tforeach ($postfixStack as $item)\n\t\t{\n\n\t\t\t// this hack to handle being passed \"field CONTAINS ''\" clauses\n\t\t\t// from boilerplate forms (that clause is a texql syntax error)\n\t\t\tif (preg_match(\"/contains\\s+'\\s*'/i\",$item))\n\t\t\t{\n\t\t\t\t$item = 'FALSE';\n\t\t\t}\n\n\t\t\tif (preg_match('/^\\*(.+)\\*/',$item,$match))\n\t\t\t{\n\t\t\t\t$operand2 = array_pop($stack);\n\t\t\t\t$operand1 = array_pop($stack);\n\t\t\t\tarray_push($stack , \n\t\t\t\t\t\"($operand1 $match[1] $operand2)\");\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t\tarray_push($stack,$item);\n\t\t}\n\t\treturn implode($stack,\" $match[1] \");\n\t}",
"private function makeRegex()\n\t{\n\t\tif (is_array($this->pattern_search)) {\n\t\t\tforeach($this->pattern_search as $type=>$values) {\n\t\t\t\tif (is_array($this->pattern_search[$type])) {\n\t\t\t\t\tforeach($this->pattern_search[$type] as $key=>$val) {\n\t\t\t\t\t\t$regex = $val;\n\t\t\t\t\t\t$regex = $this->appendSearchPath($regex);\n\t\t\t\t\t\t$regex = $this->cleanRegex($regex);\n\t\t\t\t\t\tif (isset($this->rewrite_code[$type]) && isset($this->rewrite_replace[$type])) {\n\t\t\t\t\t\t\t$regex = str_replace($this->rewrite_code[$type], $this->rewrite_replace[$type], $regex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//$regex = $this->appendDirPath($regex,$type);\n\t\t\t\t\t\t$regex = $this->wrapQuotes($regex);\n\t\t\t\t\t\t$this->patterns_regex[$type][$key] = \"#\".$regex.\"#s\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private function makeRegex()\n\t{\n\t\tif (is_array($this->pattern_search)) {\n\t\t\tforeach($this->pattern_search as $type=>$values) {\n\t\t\t\tif (is_array($this->pattern_search[$type])) {\n\t\t\t\t\tforeach($this->pattern_search[$type] as $key=>$val) {\n\t\t\t\t\t\t$regex = $val;\n\t\t\t\t\t\t$regex = $this->cleanRegex($regex);\n\t\t\t\t\t\tif (isset($this->rewrite_code[$type]) && isset($this->rewrite_replace[$type])) {\n\t\t\t\t\t\t\t$regex = str_replace($this->rewrite_code[$type], $this->rewrite_replace[$type], $regex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->patterns_regex[$type][$key] = \"/^\".$regex.\"$/\";\t// This REGEX will make finding exact match rather than subpatterns.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function add_rewrite_rule($regex, $query, $after = 'bottom')\n {\n }",
"static protected function prepare_find($regex){\n\t\t\n\t\t$new_regex = \"\";\n\t\t\n\t\tif(!self::test_regex($regex)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$first = substr($regex, 0, 1);\n\t\t$last = substr($regex, strlen($regex) - 1);\n\t\t\n\t\t$diff = substr($regex, 1, strlen($regex) - 2);\n\t\t\n\t\t$n_first = substr($diff, 0, 1);\n\t\t$n_last = substr($diff, strlen($diff) - 1);\n\t\t\n\t\tif($n_first == \"^\")\n\t\t\t$diff = substr($diff, 1, strlen($diff) - 1);\n\t\tif($n_last == \"$\")\n\t\t\t$diff = substr($diff, 0, strlen($diff) - 1);\n\t\t\n\t\t$new_regex = $first.$diff.$first;\n\t\t\n\t\treturn $new_regex;\n\t\t\n\t}",
"public function prefix( $prefix )\n {\n $this->pattern = $prefix . $this->pattern;\n }",
"public static function regexPattern() {\n \n $regex = '\n\t\t\t/\t\t\n\t\t\t# begin pair\n\t\t\t(?P<pair>' .\n \n // ==> {pairs may=\"have\" some=\"params\"}, contain text, and must have a closing tag, like this => {/pairs}\n '{\n\t\t\t\t\t(?P<pair_tag> \n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(?>\n\t\t\t\t\t\t\t\t(?:[^{}\\ ])+\n\t\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t\t{(?:[^{}\\ ])+}\n\t\t\t\t\t\t\t)+\t\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t(?P<pair_params>\\ ([^{}]|(?:\n\t\t\t\t\t\t# \"single\" reproduced here, because params \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t(?:[^{}\\ ])+\n\t\t\t\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t\t\t\t{(?:[^{}\\ ])+}\n\t\t\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t(?:\\ ([^{}]|(?>{[^{}]*}))*)?\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t# end of \"single\" reproduced\n\t\t\t\t\t))*)?\n\t\t\t\t}\n\t\t\t\t# (?P<pair_content>((?>pair) | (?>single) | [\\s\\S])*?)\n\t\t\t\t# replaced with the following to prevent backtracking:\n\t\t\t\t(?P<pair_content>((?>pair) | (?>single) | (?>[\\s\\S])*?))\n\t\t\t\t{\\/\\3}\n\t\t\t) \n\t\t\t# end <pair>\n\t\t\t|\n\t\t\t# begin single\n\t\t\t(?P<single> # ====> {singles_look_like_this and=\"may\" have=\"params\"}\n\t\t\t\t{\n\t\t\t\t\t(?P<single_tag> # The identifying or naming string, e.g. \"single_tags_look_like_this\"\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(?:[^{}\\ ])+\n\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t{(?:[^{}\\ ])+}\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t(?P<single_params>\\ ([^{}]|(?>{[^{}]*}))*)? # the params part of the string, e.g. and=\"may\" have=\"params\"\n\t\t\t\t}\n\t\t\t)\n\t\t\t# end <single>\n\t\t\t/x';\n return $regex;\n }",
"function replace_with(string $haystack, string $pattern, Closure $callback, ?int $limit = null): string\n{\n return (string) Internal\\call_preg(\n 'preg_replace_callback',\n static fn() => preg_replace_callback($pattern, $callback, $haystack, $limit ?? -1),\n );\n}",
"function smarty_mod_regex_replace($string, $search, $replace)\r\n{\r\n return preg_replace($search, $replace, $string);\r\n}",
"public function getHighlightRegexPattern(): string {}",
"abstract protected function handlePrefix(array $matches): void;",
"public static function surroundWith(string $haystack, string $needle) : string\n {\n return static::beginWith($haystack, $needle) . $needle . static::finishWith($haystack, $needle);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Debug constructor. Inits the DebugBar | private function __construct()
{
$this->debugBar = new StandardDebugBar();
} | [
"protected function __construct()\n {\n if($this->isEnabled()) {\n $this->debugbar = new StandardDebugBar;\n $this->debugbar['time']->startMeasure('App', 'Application');\n }\n }",
"public static function init() {\n self::$config = Zend_Registry::get('_config');\n\n if(isset(self::$config[\"debug\"]) && self::$config[\"debug\"]) {\n self::$debugBar = new DebugBar\\StandardDebugBar();\n\n self::$debugBar->setStorage(new DebugBar\\Storage\\FileStorage(Core_Model_Directory::getBasePathTo(self::$streamPath)));\n self::$debugBar->addCollector(new Siberian_Debug_Collector_Sql());\n\n self::$debugBarRenderer = self::$debugBar->getJavascriptRenderer();\n\n self::$debugBarRenderer->setOpenHandlerUrl('/debug.php');\n\n self::$render = true;\n }\n }",
"private static function loadDebugBar()\n {\n if (!self::getConfigValue('debugBar'))\n {\n return;\n }\n\n self::$_debugBar = new StandardDebugBar();\n self::$_debugBarRenderer = self::$_debugBar->getJavascriptRenderer();\n self::$_debugBarRenderer->setBaseUrl(BASE_URL . '/vendor/maximebf/debugbar/src/DebugBar/Resources');\n }",
"public function enableDebugBar() {\n\t\t$this->debug = true;\n\t}",
"public function __construct() {\n\t\tif (Configure::read('debug')) {\n\t\t\t$this->components[] = 'DebugKit.Toolbar';\n\t\t}\n\t\tparent::__construct();\n\t}",
"protected function _initDebugBar()\n {\n if (APPLICATION_ENV == 'development' && env('DEBUG_BAR_ENABLED') == true && PHP_SAPI != 'cli') {\n $debugBar = new \\DebugBar\\DebugBar();\n\n $debugBar->addCollector(new DebugBar\\DataCollector\\PhpInfoCollector());\n $debugBar->addCollector(new DebugBar\\DataCollector\\MessagesCollector());\n $debugBar->addCollector(new DebugBar\\DataCollector\\RequestDataCollector());\n $debugBar->addCollector(new DebugBar\\DataCollector\\MemoryCollector());\n $debugBar->addCollector(new DebugBar\\DataCollector\\TimeDataCollector());\n\n if (env('XHPROF_ENABLED') == true && extension_loaded('xhprof')) {\n $debugBar->addCollector(new Fisdap\\DebugBar\\DataCollector\\Xhprof\\XhprofCollector());\n }\n\n // Add Monolog collector\n $this->bootstrap('Logger');\n $logger = \\Zend_Registry::get('logger');\n if ($logger instanceof \\Monolog\\Logger) {\n $debugBar->addCollector(new DebugBar\\Bridge\\MonologCollector($logger));\n }\n\n \\Zend_Registry::set('debugBar', $debugBar);\n }\n }",
"public function __construct(){\n\t\trequire_once dirname(__FILE__).\"/class.debug.php\";\n\t\t$this->debug = new debugger();\n\t}",
"public function __construct($debugbar = null) {\n // This is to allow test substitution of the debugbar instance\n $debugbar = $debugbar\n ? $debugbar\n : new MageDebugBar\\MageDebugBar(new MageDebugBar\\Magento());\n\n $this->_delegate = $debugbar->getEventObserver();\n }",
"private function __construct()\n {\n $this->options = new ezcDebugOptions();\n\n $original = ezcLog::getInstance();\n\n $this->log = clone( $original ); \n $this->log->reset();\n $this->log->setMapper( new ezcLogFilterSet() );\n\n // Set the writer.\n $this->writer = new ezcDebugMemoryWriter();\n\n $filter = new ezcLogFilter();\n $filter->severity = ezcLog::DEBUG;\n $this->log->getMapper()->appendRule( new ezcLogFilterRule( $filter, $this->writer, true ) );\n\n $this->reset();\n }",
"public function __construct() {\n if (Configure::read('debug')) {\n $this->components['DebugKit.Toolbar'] = array('panels' => array('Sanction.permit'));\n }\n parent::__construct();\n }",
"public function enableDebugbar()\n {\n if(!$this->debugBar && class_exists('\\DebugBar\\DebugBar')) {\n $this->debugBar = new \\DebugBar\\DebugBar();\n $this->debugBar->addCollector(new \\DebugBar\\DataCollector\\MessagesCollector());\n $this->debugBar->addCollector(new \\DebugBar\\DataCollector\\MessagesCollector('dumps'));\n $this->debugBar->addCollector(new \\DebugBar\\DataCollector\\MessagesCollector('auth'));\n $this->debugBar->addCollector(new \\DebugBar\\DataCollector\\ExceptionsCollector());\n $this->debugBar->addCollector(new \\DebugBar\\DataCollector\\TimeDataCollector());\n $this->debugBar->addCollector(new \\DebugBar\\DataCollector\\RequestDataCollector());\n $this->debugBar->addCollector(new \\DebugBar\\DataCollector\\MemoryCollector());\n $this->debugBar->addCollector(new \\DebugBar\\DataCollector\\PhpInfoCollector());\n $this->debugBar->addCollector(new \\DebugBar\\DataCollector\\ConfigCollector(Config::getAll()));\n }\n }",
"public function __construct ($debug = false) {\n if ($debug) {\n $this->space = \"s\";\n $this->tab = \"t\";\n $this->lf = \"l\";\n }\n }",
"private function __construct()\n {\n $this->_config = new Config();\n $toolPath = '\\PHPMinion\\Utilities\\Dbug\\Tools';\n $this->registerTools([\n 'dbug' => $toolPath.'\\DbugDump',\n 'trace' => $toolPath.'\\DbugTrace',\n 'color' => $toolPath.'\\DbugColor',\n 'textarea' => $toolPath.'\\DbugTextarea',\n 'type' => $toolPath.'\\DbugType',\n ]);\n }",
"public function maybeInitDebugBar() {\n\t\t\tif ( class_exists('Debug_Bar', false) && file_exists(dirname(__FILE__) . '/DebugBar') ) {\n\t\t\t\t$this->debugBarExtension = $this->createDebugBarExtension();\n\t\t\t}\n\t\t}",
"final protected function useDebugBar()\n {\n $renderer = Logger::getInstance()->getRenderer();\n if(!$renderer) {\n return;\n }\n\n list($cssFiles, $jsFiles) = $renderer->getAssets(null, 'path');\n\n foreach ($cssFiles as $cssFile) {\n $this->addStylesheet($cssFile);\n }\n foreach ($jsFiles as $jsFile) {\n $this->addJavascript($jsFile);\n }\n\n $this->assign('debugbar', $renderer);\n }",
"public static function debug(): self\n {\n return new self(self::DEBUG);\n }",
"public function __construct() {\n\t\tif (Configure::read() && !defined('CAKEPHP_SHELL') && App::import('Component', 'DebugKit.Toolbar')) {\n\t\t\t$panels = array();\n\t\t\tif (App::import('Vendor', 'MiDevelopment.DevPanel')) {\n\t\t\t\tif (DS === '/' && $this->_exec('which tidy')) {\n\t\t\t\t\t$panels[] = 'MiDevelopment.Tidy';\n\t\t\t\t}\n\t\t\t\t$panels[] = 'MiDevelopment.Dev';\n\t\t\t}\n\t\t\t$this->components['DebugKit.Toolbar'] = array(\n\t\t\t\t'panels' => $panels,\n\t\t\t\t'forceEnable' => true,\n\t\t\t);\n\t\t}\n\t\treturn parent::__construct();\n\t}",
"function __construct() {\n\t\tif (Configure::read() && App::import('Component', 'DebugKit.Toolbar')) {\n\t\t\t$this->components = am(array('DebugKit.Toolbar' => array('forceEnable' => true)), $this->components);\n\t\t}\n\t\treturn parent::__construct();\n\t}",
"protected static function debugbar(){\n\t\tif ( !self::$debugbar ) {\n\t\t\t$di = Di::getDefault();\n\t\t\tif ( $di->has( 'debugbar' ) ) {\n\t\t\t\treturn self::$debugbar=$di->getShared('debugbar');\n\t\t\t}else{\n return self::$debugbar= new \\Snowair\\Debugbar\\EmptyDebugbar();\n\t\t\t}\n\t\t}\n\t\treturn self::$debugbar;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The parser stores options it doesn't recognize here. See above. Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; | public function getUninterpretedOption() {} | [
"public function appendUninterpretedOption(\\Google\\Protobuf\\UninterpretedOption $value)\n {\n return $this->append(self::UNINTERPRETED_OPTION, $value);\n }",
"public function setUninterpretedOption($var) {}",
"protected function unhandledOptions()\n {\n $rawInput = $this->getRawInput();\n\n $options = $this->expandShortOptions(array_slice($rawInput, 1));\n\n return $this->removeKnownOptions($options);\n }",
"public function getUninterpretedOptionCount()\n {\n return $this->count(self::UNINTERPRETED_OPTION);\n }",
"public function extractLongOptionsVoid();",
"public function testParseOptionsException()\n {\n $tokens = array('filename', '-!a', null, '-b', 'v2', 'v3', 'v4', 'v5', '--boo=hi');\n $cmd = new Command($tokens, true);\n $cmd->flag('a')->required()->flag('b')->aka('boo');\n $cmd->useDefaultHelp();\n }",
"function _extract_options()\n\t{\n\t\t//Add each option to the options array...an option *should* be prefixed with a dash ('-'), and can *optionally* have a value, shown through the use of equals ('=') - this can be a quoted value\n\t\tif (!defined('OUT_OPTION'))\n\t\t{\n\t\t\tdefine('OUT_OPTION',-1);\n\t\t\tdefine('IN_OPTION',0);\n\t\t\tdefine('IN_OPTION_SYNTAX',1);\n\t\t\tdefine('IN_OPTION_VALUE',2);\n\t\t}\n\n\t\t$current_option=NULL;\n\t\t$option_mode=OUT_OPTION;\n\n\t\twhile ($this->parse_runtime['parse_position']<$this->parse_runtime['command_length'])\n\t\t{\n\t\t\t$next_char=$this->current_input[$this->parse_runtime['parse_position']];\n\n\t\t\tswitch($option_mode)\n\t\t\t{\n\t\t\t\tcase OUT_OPTION:\n\t\t\t\t\t//Options parsing hasn't started yet; the next character should be a dash ('-')\n\t\t\t\t\tif ($next_char!='-') break 2; //This is *not* an option!\n\t\t\t\t\t$option_mode=IN_OPTION;\n\t\t\t\t\t$this->parse_runtime['parse_position']++;\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase IN_OPTION:\n\t\t\t\t\t//Get the name of the option, and add it to the options array\n\t\t\t\t\t$space_pos=strpos($this->current_input,' ',$this->parse_runtime['parse_position']);\n\t\t\t\t\t$equals_pos=strpos($this->current_input,'=',$this->parse_runtime['parse_position']);\n\n\t\t\t\t\tif (($space_pos!==false) && ($equals_pos!==false))\n\t\t\t\t\t{\n\t\t\t\t\t\t//Get the option name, using string functions (deciding where to cut the option name out, based upon whether the next equals is before the next space)\n\t\t\t\t\t\tif ($equals_pos<$space_pos)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$current_option=substr($this->current_input,$this->parse_runtime['parse_position'],$equals_pos-$this->parse_runtime['parse_position']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$current_option=substr($this->current_input,$this->parse_runtime['parse_position'],$space_pos-$this->parse_runtime['parse_position']);\n\t\t\t\t\t\t\t$current_option=strtr($current_option,$this->input_parameters); //Parameter replacement\n\n\t\t\t\t\t\t\t$this->parsed_input[SECTION_OPTIONS][$current_option]=NULL;\n\t\t\t\t\t\t\t$option_mode=OUT_OPTION;\n\t\t\t\t\t\t\t$this->parse_runtime['parse_position']+=strlen($current_option)+1;\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($space_pos!==false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$current_option=substr($this->current_input,$this->parse_runtime['parse_position'],$space_pos-$this->parse_runtime['parse_position']); //Just take it up to the space\n\t\t\t\t\t\t$current_option=strtr($current_option,$this->input_parameters); //Parameter replacement\n\n\t\t\t\t\t\t$this->parsed_input[SECTION_OPTIONS][$current_option]=NULL;\n\t\t\t\t\t\t$option_mode=OUT_OPTION;\n\t\t\t\t\t\t$this->parse_runtime['parse_position']+=strlen($current_option)+1; //Because there won't be an equals\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telseif ($equals_pos!==false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$current_option=substr($this->current_input,$this->parse_runtime['parse_position'],$equals_pos-$this->parse_runtime['parse_position']); //Just take it up to the equals\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$current_option=substr($this->current_input,$this->parse_runtime['parse_position']); //Just assume there's nothing else there, and grab the lot\n\t\t\t\t\t}\n\n\t\t\t\t\t//Parameter replacement\n\t\t\t\t\t$current_option=strtr($current_option,$this->input_parameters);\n\n\t\t\t\t\t$this->parsed_input[SECTION_OPTIONS][$current_option]=NULL;\n\n\t\t\t\t\t$option_mode=IN_OPTION_SYNTAX;\n\t\t\t\t\t$this->parse_runtime['parse_position']+=strlen($current_option);\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase IN_OPTION_SYNTAX:\n\t\t\t\t\t//Look for that elusive '='\n\t\t\t\t\tif ($next_char!='=') break 2; //PANIC!!\n\t\t\t\t\t$option_mode=IN_OPTION_VALUE;\n\t\t\t\t\t$this->parse_runtime['parse_position']++;\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase IN_OPTION_VALUE:\n\t\t\t\t\t//Get the value, if applicable\n\t\t\t\t\tif ($next_char=='\"')\n\t\t\t\t\t{\n\t\t\t\t\t\t//Quotes!\n\t\t\t\t\t\tif ($this->parse_runtime['current_mode']==MODE_NORMAL)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//We are entering a quote system\n\t\t\t\t\t\t\t$this->parse_runtime['current_mode']=MODE_QUOTES;\n\t\t\t\t\t\t\t$this->parse_runtime['parse_position']++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (($this->parse_runtime['current_mode']==MODE_QUOTES) && (!$this->parse_runtime['escape_used']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//We are leaving a quote system, and the current (closing) quotes have *not* been escaped!\n\t\t\t\t\t\t\t$this->parse_runtime['current_mode']=MODE_NORMAL;\n\t\t\t\t\t\t\t$this->parse_runtime['parse_position']+=2; //Assuming there is only '\" ' between here and the next option\n\t\t\t\t\t\t\t$option_mode=OUT_OPTION;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (($this->parse_runtime['current_mode']==MODE_QUOTES) && ($this->parse_runtime['escape_used']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//We are adding an escaped quote to the current option value\n\t\t\t\t\t\t\t$this->parsed_input[SECTION_OPTIONS][$current_option].=$next_char;\n\t\t\t\t\t\t\t$this->parse_runtime['parse_position']++;\n\t\t\t\t\t\t\t$this->parse_runtime['escape_used']=false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse break 2; //PANIC!!\n\t\t\t\t\t}\n\t\t\t\t\telseif ($next_char=='\\\\')\n\t\t\t\t\t{\n\t\t\t\t\t\t//An escape character (currently only backslash ('\\')) has been used\n\t\t\t\t\t\tif ($this->parse_runtime['escape_used']) $this->parsed_input[SECTION_OPTIONS][$current_option].='\\\\'; //Add the backslash to the option value, as it has been escaped\n\t\t\t\t\t\t$this->parse_runtime['escape_used']=!$this->parse_runtime['escape_used']; //If the current backslash hasn't been backslashed, switch on the escape flag...in other words, invert the flag\n\t\t\t\t\t\t$this->parse_runtime['parse_position']++;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($this->parse_runtime['current_mode']==MODE_NORMAL)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Normal mode; business as usual (quotes have not been used, so we can just strip out the option value using string functions)\n\t\t\t\t\t\t\t$space_pos=strpos($this->current_input,' ',$this->parse_runtime['parse_position']);\n\n\t\t\t\t\t\t\tif ($space_pos!==false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->parsed_input[SECTION_OPTIONS][$current_option]=substr($this->current_input,$this->parse_runtime['parse_position'],strpos($this->current_input,' ',$this->parse_runtime['parse_position'])-$this->parse_runtime['parse_position']); //Get the value; up to the next space\n\t\t\t\t\t\t\t\t$this->parse_runtime['parse_position']+=strlen($this->parsed_input[SECTION_OPTIONS][$current_option])+1; //Add the length of the option value, and one for the assumed space between here and the next option\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->parsed_input[SECTION_OPTIONS][$current_option]=substr($this->current_input,$this->parse_runtime['parse_position']); //Just take until the end; there doesn't seem to be anything else\n\t\t\t\t\t\t\t\t$this->parse_runtime['parse_position']+=strlen($this->parsed_input[SECTION_OPTIONS][$current_option]); //Pretty pointless\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$option_mode=OUT_OPTION;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($this->parse_runtime['current_mode']==MODE_QUOTES)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//We are adding the current letter to the quote system\n\t\t\t\t\t\t\t$this->parsed_input[SECTION_OPTIONS][$current_option].=$next_char;\n\t\t\t\t\t\t\t$this->parse_runtime['parse_position']++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse break 2; //PANIC!!\n\t\t\t\t\t}\n\n\t\t\t\t\t//Parameter replacement\n\t\t\t\t\t$this->parsed_input[SECTION_OPTIONS][$current_option]=strtr($this->parsed_input[SECTION_OPTIONS][$current_option],$this->input_parameters);\n\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak 2; //PANIC!!\n\t\t\t}\n\t\t}\n\t}",
"function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options = \\false)\n {\n }",
"function _parseOptions() {\n\t\t$this->_options->stringToOptions($this->options);\n\t}",
"function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options = \\false)\n {\n }",
"protected static function parseOption($token)\n {\n\n }",
"private function parseInputOptions() {\n if (isset($this->argvInput[1])) {\n $this->setMode($this->argvInput[1]);\n if (isset($this->argvInput[2])) {\n $this->setMethod($this->argvInput[2]);\n }\n }\n }",
"public function get_parsed_options() : array\n {\n return $this->parsed_options;\n }",
"protected function parseCommandOptions()\n {\n foreach ($this->commandOptions as $k => $commandOption) {\n $this->commandOptions[$k] = lang($commandOption);\n }\n }",
"protected static function parseOptions()\n {\n $options = getopt('hv', array('help','verbose'));\n self::$options = $options;\n\n if (isset($options['h']) || isset($options['help'])) {\n self::$mode = self::MODE_HELP;\n } elseif (isset($options['v']) || isset($options['verbose'])) {\n self::$mode = self::MODE_VERBOSE;\n }\n }",
"public function parse() {\n $this->parsedOptions = $this->getOptParse();\n if ($this->getValue(\"help\")) {\n $this->printHelp();\n $this->end(0);\n }\n\n if (! $this->validateParsedOptions()) {\n $this->displayParsedErrorOptions();\n $this->printHelp(STDERR);\n $this->end(1);\n }\n }",
"function parse_validate_user_options()\n{\n $shortOptions = \"h\";\n $longOptions = [\n OPT_HELP,\n OPT_PHP_BIN . ':',\n OPT_FILE . ':',\n OPT_INSTALL_DIR . ':',\n OPT_UNINSTALL,\n OPT_ENABLE_PROFILING,\n ];\n $options = getopt($shortOptions, $longOptions);\n\n // Help and exit\n if (key_exists('h', $options) || key_exists(OPT_HELP, $options)) {\n print_help();\n exit(0);\n }\n\n $normalizedOptions = [];\n\n $normalizedOptions[OPT_UNINSTALL] = isset($options[OPT_UNINSTALL]) ? true : false;\n\n if (!$normalizedOptions[OPT_UNINSTALL]) {\n if (isset($options[OPT_FILE])) {\n if (is_array($options[OPT_FILE])) {\n print_error_and_exit('Only one --file can be provided', true);\n }\n $normalizedOptions[OPT_FILE] = $options[OPT_FILE];\n }\n }\n\n if (isset($options[OPT_PHP_BIN])) {\n $normalizedOptions[OPT_PHP_BIN] =\n is_array($options[OPT_PHP_BIN])\n ? $options[OPT_PHP_BIN]\n : [$options[OPT_PHP_BIN]];\n }\n\n $normalizedOptions[OPT_INSTALL_DIR] =\n isset($options[OPT_INSTALL_DIR])\n ? rtrim($options[OPT_INSTALL_DIR], '/')\n : '/opt/datadog';\n $normalizedOptions[OPT_INSTALL_DIR] = $normalizedOptions[OPT_INSTALL_DIR] . '/dd-library';\n\n $normalizedOptions[OPT_ENABLE_PROFILING] = isset($options[OPT_ENABLE_PROFILING]);\n\n return $normalizedOptions;\n}",
"public function testParsingArrayLongOptionWithoutEqualsSign()\n {\n $request = $this->parser->parse('foo --name dave --name young');\n $this->assertEquals('foo', $request->getCommandName());\n $this->assertEquals([], $request->getArgumentValues());\n $this->assertEquals(['dave', 'young'], $request->getOptionValue('name'));\n }",
"protected function _handleOptions() {\n\t\t$shortOptions = array();\n\t\tforeach($this->_commandOptions as $option => $details) {\n\t\t\tif (!empty($details['short'])) {\n\t\t\t\t$shortOptions[$details['short']] = $option;\n\t\t\t}\n\t\t}\n\t\t$shortArgs = array_intersect_key($shortOptions, $this->params);\n\t\tforeach($shortArgs as $short => $real) {\n\t\t\t$this->params[$real] = $this->params[$short];\n\t\t\tunset ($this->params[$short]);\n\t\t}\n\t\tforeach($this->params as $key => &$value) {\n\t\t\tif (strpos($key, '=')) {\n\t\t\t\tlist($realKey, $value) = explode('=', $key);\n\t\t\t\tif (strpos($value, ',')) {\n\t\t\t\t\t$value = explode(',', $value);\n\t\t\t\t}\n\t\t\t\t$this->params[$realKey] = $value;\n\t\t\t\tunset ($this->params[$key]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (is_string($value) && strpos($value, ',')) {\n\t\t\t\t$value = explode(',', $value);\n\t\t\t}\n\t\t}\n\t\t$diffTo = array(\n\t\t\t'app' => 'default',\n\t\t\t'root' => 'default',\n\t\t\t'webroot' => 'default',\n\t\t\t'working' => 'default',\n\t\t);\n\t\t$diffTo = array_merge($diffTo, $shortOptions, $this->_commandOptions);\n\t\t$this->settings['extraOptions'] = array_diff_key($this->params, $diffTo);\n\n\t\tif ($this->settings['extraOptions']) {\n\t\t\t$extraParams = array();\n\t\t\tforeach($this->settings['extraOptions'] as $option => $val) {\n\t\t\t\tif ($val === true) {\n\t\t\t\t\t$extraParams[] = '-' . $option;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (is_array($val)) {\n\t\t\t\t\t$val = implode($val, ',');\n\t\t\t\t}\n\t\t\t\t$segment = '-' . $option . '=' . $val;\n\t\t\t\t$extraParams[] = $segment;\n\t\t\t}\n\t\t\t$this->settings['extraOptions'] = implode($extraParams, ' ');\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verify refund parameters generated as expected | public function refundParametersShouldBeSetUpAsExpected()
{
$timestamp = 'DirectDebitB2CSecuredPaymentMethodTest::refund 2017-11-01 12:39:45';
$this->paymentObject->getRequest()->basketData(
$timestamp,
self::TEST_AMOUNT,
$this->currency,
$this->secret
);
$this->paymentObject->refund(self::REFERENCE_ID);
list($firstName, $lastName, , $shopperId, $street, $state, $zip, $city, $country, $email) =
$this->customerData->getCustomerDataArray();
list($securitySender, $userLogin, $userPassword, $transactionChannel, ) =
$this->authentication->getAuthenticationArray();
// this is done to avoid syntax warnings
$object = $this->paymentObject;
$expected = [
'ADDRESS.CITY' => $city,
'ADDRESS.COUNTRY' => $country,
'ADDRESS.STATE' => $state,
'ADDRESS.STREET' => $street,
'ADDRESS.ZIP' => $zip,
'CONTACT.EMAIL' => $email,
'CRITERION.PAYMENT_METHOD' => $object::getClassName(),
'CRITERION.SECRET' => 'e2cf8f7086cad3dc71972f193d6a5a230d3dd00e13d20ad876ba2feae868bf6b79c4564' .
'0f88576ed39546dc68e15f87eaf7557618426d904245b745cdc65c881',
'CRITERION.SDK_NAME' => 'Heidelpay\\PhpPaymentApi',
'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION,
'FRONTEND.MODE' => 'WHITELABEL',
'FRONTEND.ENABLED' => 'FALSE',
'IDENTIFICATION.SHOPPERID' => $shopperId,
'IDENTIFICATION.TRANSACTIONID' => $timestamp,
'IDENTIFICATION.REFERENCEID' => self::REFERENCE_ID,
'NAME.GIVEN' => $firstName,
'NAME.FAMILY' => $lastName,
'NAME.BIRTHDATE' => self::CUSTOMER_BIRTHDAY,
'NAME.SALUTATION' => self::CUSTOMER_SALUTATION,
'PAYMENT.CODE' => self::PAYMENT_METHOD_SHORT . '.' . TransactionType::REFUND,
'PRESENTATION.AMOUNT' => self::TEST_AMOUNT,
'PRESENTATION.CURRENCY' => $this->currency,
'REQUEST.VERSION' => '1.0',
'SECURITY.SENDER' => $securitySender,
'TRANSACTION.CHANNEL' => $transactionChannel,
'TRANSACTION.MODE' => TransactionMode::CONNECTOR_TEST,
'USER.LOGIN' => $userLogin,
'USER.PWD' => $userPassword,
];
$this->assertThat($this->paymentObject->getRequest()->toArray(), $this->arraysMatchExactly($expected));
} | [
"public function testV1CreateRefund()\n {\n\n }",
"public function testInvoiceRefundAmount()\n {\n }",
"public function testRefundValidationWithValidInvoiceProvided()\n {\n $client = ClientFactory::create($this->company->id, $this->user->id);\n $client->save();\n\n $this->invoice = InvoiceFactory::create($this->company->id, $this->user->id); //stub the company and user_id\n $this->invoice->client_id = $client->id;\n $this->invoice->status_id = Invoice::STATUS_SENT;\n\n $this->invoice->line_items = $this->buildLineItems();\n $this->invoice->uses_inclusive_taxes = false;\n\n $this->invoice->save();\n\n $this->invoice_calc = new InvoiceSum($this->invoice);\n $this->invoice_calc->build();\n\n $this->invoice = $this->invoice_calc->getInvoice();\n $this->invoice->save();\n\n $data = [\n 'amount' => 50,\n 'client_id' => $client->hashed_id,\n 'invoices' => [\n [\n 'invoice_id' => $this->invoice->hashed_id,\n 'amount' => $this->invoice->amount,\n ],\n ],\n 'date' => '2020/12/12',\n\n ];\n\n $response = $this->withHeaders([\n 'X-API-SECRET' => config('ninja.api_secret'),\n 'X-API-TOKEN' => $this->token,\n ])->post('/api/v1/payments', $data);\n\n $arr = $response->json();\n $response->assertStatus(200);\n\n $payment_id = $arr['data']['id'];\n\n $this->assertEquals(50, $arr['data']['amount']);\n\n $payment = Payment::whereId($this->decodePrimaryKey($payment_id))->first();\n\n $this->assertNotNull($payment);\n $this->assertNotNull($payment->invoices());\n $this->assertEquals(1, $payment->invoices()->count());\n\n $data = [\n 'id' => $this->encodePrimaryKey($payment->id),\n 'amount' => 50,\n 'invoices' => [\n [\n 'invoice_id' => $this->invoice->hashed_id,\n 'amount' => $this->invoice->amount,\n ],\n ],\n 'date' => '2020/12/12',\n ];\n\n $response = false;\n\n $response = $this->withHeaders([\n 'X-API-SECRET' => config('ninja.api_secret'),\n 'X-API-TOKEN' => $this->token,\n ])->post('/api/v1/payments/refund', $data);\n\n $response->assertStatus(200);\n }",
"public function testRefund()\n {\n print \"testRefund()\\n\";\n\n // TODO: Impl\n\n $this->fail();\n }",
"public function testRefundOrder()\n {\n }",
"public function canRefundPayment();",
"public function testAuthCaptureRefund()\n {\n //captureAuthorization\n $paymentData = new PaymentTransaction();\n $paymentData->setTransactionType(PaymentTransaction::TRANSACTION_TYPE_AUTHORIZE);\n $paymentData->setAmount(10);\n $paymentData->setCurrency('USD');\n $comboPaymentTransaction = new ComboPaymentTransaction();\n $comboPaymentTransaction->setAccount($this->account);\n $comboPaymentTransaction->setTransaction($paymentData);\n $comboPaymentTransaction->setPaymentMethod($this->paymentMethod);\n $payment = $this->client->getPaymentApi()->createComboPayment($comboPaymentTransaction, self::USER, self::REASON, self::COMMENT);\n $this->verifyPaymentAndTransaction($payment, 10, 1, 10, 0, 0, 0, 0);\n\n // Populate the paymentId, required below\n $paymentData->setPaymentId($payment->getPaymentId());\n\n // Partial capture 1\n $paymentData->setAmount(2);\n $payment = $this->client->getPaymentApi()->captureAuthorization($paymentData, self::USER, $paymentData->getPaymentId(), self::REASON, self::COMMENT);\n $this->verifyPaymentAndTransaction($payment, 2, 2, 10, 2, 0, 0, 0);\n\n // Partial capture 2\n $paymentData->setAmount(3);\n $payment = $this->client->getPaymentApi()->captureAuthorization($paymentData, self::USER, $paymentData->getPaymentId(), self::REASON, self::COMMENT);\n $this->verifyPaymentAndTransaction($payment, 3, 3, 10, 5, 0, 0, 0);\n\n // Partial refund\n $paymentData->setAmount(4);\n $payment = $this->client->getPaymentApi()->refundPayment($paymentData, self::USER, $paymentData->getPaymentId(), self::REASON, self::COMMENT);\n $this->verifyPaymentAndTransaction($payment, 4, 4, 10, 5, 0, 4, 0);\n }",
"public function testRefundInputResponseStatus()\n\t{\n\t\t$this->client->request('GET', \"/refund/$this->orderId/input/\");\n\t\t$this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode());\n\t}",
"public function getRefundPaymentResult();",
"public function testRefund()\n {\n $response = array(\n \"id\" => \"refund_87bc404a95d5ce616049\",\n \"amount\" => \"042\",\n \"status\" => \"refunded\",\n \"description\" => null,\n \"livemode\" => false,\n \"created_at\" => 1349947042,\n \"updated_at\" => 1349947042,\n \"response_code\" => 20000,\n \"transaction\" => array(\n \"id\" => \"tran_54645bcb98ba7acfe204\",\n \"amount\" => \"4200\",\n \"origin_amount\" => 4200,\n \"status\" => \"closed\",\n \"description\" => null,\n \"livemode\" => false,\n \"refunds\" => null,\n \"currency\" => \"EUR\",\n \"created_at\" => 1349946151,\n \"updated_at\" => 1349946151,\n \"response_code\" => 20000,\n \"short_id\" => '0000.1212.3434',\n \"invoices\" => array(),\n \"payment\" => array(\n 'id' => \"pay_be64260ee1b0a368efe597e8\",\n 'type' => \"creditcard\",\n 'client' => \"client_018dcaf0d8d03dde3ff6\",\n 'card_type' => \"visa\",\n 'country' => null,\n 'expire_month' => 12,\n 'expire_year' => 2015,\n 'card_holder' => null,\n 'last4' => 1111,\n 'created_at' => 1378472387,\n 'updated_at' => 1378472387,\n 'app_id' => null\n ),\n \"client\" => array(\n \"id\" => \"client_88a388d9dd48f86c3136\",\n \"email\" => \"lovely-client@example.com\",\n \"description\" => null,\n \"created_at\" => 1340199740,\n \"updated_at\" => 1340199760,\n \"subscription\" => null,\n 'app_id' => null,\n \"payment\" => array(\n 'id' => \"pay_be64260ee1b0a368efe597e8\",\n 'type' => \"creditcard\",\n 'client' => \"client_018dcaf0d8d03dde3ff6\",\n 'card_type' => \"visa\",\n 'country' => null,\n 'expire_month' => 12,\n 'expire_year' => 2015,\n 'card_holder' => null,\n 'last4' => 1111,\n 'created_at' => 1378472387,\n 'updated_at' => 1378472387,\n 'app_id' => null\n )),\n \"preauthorization\" => null,\n \"fees\" => array(),\n \"app_id\" => null\n ),\n \"app_id\" => null\n );\n $subject = $this->_responseHandler->convertResponse($response, \"refunds/\");\n $this->assertInstanceOf(\"\\Paymill\\Models\\Response\\Refund\", $subject, var_export($subject, true));\n }",
"public function testRefund()\n {\n $paymentListOptions = new PaymentListOptions;\n $paymentListOptions->pageIndex = 1;\n $paymentListOptions->pageItemCount = 20;\n\n $paymentListResult = $this->client->PaymentService->list($paymentListOptions);\n\n $this->assertTrue($paymentListResult->succeeded);\n\n if (count($paymentListResult->data->items) > 0) {\n $payment = $paymentListResult->data->items[0];\n\n $paymentRefundOptions = new PaymentRefundOptions;\n $paymentRefundOptions->id = $payment->id;\n\n $result = $this->client->PaymentService->refund($paymentRefundOptions);\n\n $this->assertTrue($result->succeeded);\n }\n }",
"public function getPaymentRefundResult();",
"public function testRefundMultiDocumentTransaction()\n {\n }",
"private function checkRefund()\n {\n if ($this->paymentProduct) {\n $refundedItems = $this->dbMaintenance->getRefundedItems($this->order->id);\n $refundedFees = $this->dbMaintenance->feesAreRefunded($this->order->id);\n $refundedDiscounts = $this->dbMaintenance->discountsAreRefunded($this->order->id);\n $capturedFees = $this->dbMaintenance->feesAreCaptured($this->order->id);\n $capturedDiscounts = $this->dbMaintenance->discountsAreCaptured($this->order->id);\n $capturedWrapping = $this->dbMaintenance->wrappingIsCaptured($this->order->id);\n $refundedWrapping = $this->dbMaintenance->wrappingIsRefunded($this->order->id);\n\n if (\n $this->paymentMethodCanRefundOrCapture('refund')\n && !$this->statusNotAvailableForOperation('refund')\n && !$this->hasRefundStartedFromBO()\n && $this->statusAvailableForOperation('capture')\n ) {\n $discount = $this->getDiscount();\n\n $shippingFees = 0;\n if ($shipping = $this->order->getShipping() && !empty($shipping[0]['shipping_cost_tax_incl'])) {\n $shippingFees = $shipping[0]['shipping_cost_tax_incl'];\n }\n\n $this->context->smarty->assign([\n 'showRefund' => !$this->module->hipayConfigTool->getAccountGlobal()['use_prestashop_refund_form'],\n 'manualCapture' => $this->isManualCapture(),\n 'stillToCapture' => $this->order->total_paid_tax_incl -\n HipayHelper::getOrderPaymentAmount($this->order),\n 'alreadyCaptured' => $this->dbMaintenance->alreadyCaptured($this->order->id),\n 'refundableAmount' => HipayHelper::getOrderPaymentAmount($this->order) -\n HipayHelper::getOrderPaymentAmount($this->order, true),\n 'refundedFees' => $refundedFees,\n 'refundLink' => $this->context->link->getAdminLink('AdminHiPayRefund'),\n 'basket' => $this->basket,\n 'refundedItems' => $refundedItems,\n 'tokenRefund' => Tools::getAdminTokenLite('AdminHiPayRefund'),\n 'partiallyRefunded' => $this->isPartiallyRefunded(\n $refundedItems,\n $refundedFees,\n $this->isTotallyCaptured(),\n $refundedDiscounts,\n $refundedWrapping\n ),\n 'totallyRefunded' => $this->isTotallyRefunded(),\n 'products' => $this->order->getProducts(),\n 'amountFees' => $shippingFees,\n 'shippingCost' => $this->order->total_shipping,\n 'discount' => $discount,\n 'capturedDiscounts' => $capturedDiscounts,\n 'refundedDiscounts' => $refundedDiscounts,\n 'capturedFees' => $capturedFees,\n 'orderId' => $this->order->id,\n 'cartId' => $this->cart->id,\n 'ajaxCalculatePrice' => $this->context->link->getAdminLink('AdminHiPayCalculatePrice'),\n 'wrappingGift' => (bool) $this->order->gift && $this->order->total_wrapping > 0,\n ]);\n\n if ((bool) $this->order->gift && $this->order->total_wrapping > 0) {\n $this->context->smarty->assign(\n [\n 'wrapping' => [\n 'value' => $this->order->total_wrapping,\n 'refunded' => $refundedWrapping,\n 'captured' => $capturedWrapping,\n ],\n ]\n );\n }\n\n return true;\n }\n }\n\n $this->context->smarty->assign(['showRefund' => false]);\n\n return false;\n }",
"public function canRefund()\n {\n }",
"public function testPurchaseRefund()\n {\n $purchaseResponse = $this->gateway->purchase(\n array(\n 'amount'=>'20.00',\n 'card'=>$this->getValidCard(),\n 'ssl_invoice_number'=>2,\n 'integrationTesting'=>true\n )\n )->send();\n\n $this->assertTrue($purchaseResponse->isSuccessful());\n $this->assertEquals('APPROVAL', $purchaseResponse->getMessage());\n\n $refundResponse = $this->gateway->refund(\n array(\n 'amount'=>'20.00',\n 'transactionReference'=>$purchaseResponse->getTransactionReference(),\n 'integrationTesting'=>true\n )\n )->send();\n\n $this->assertTrue($refundResponse->isSuccessful());\n $this->assertEquals('APPROVAL', $refundResponse->getMessage());\n }",
"function refund($reservation){\n global $wpdb;\n global $DOPBSP;\n \n $nvp_data = array();\n \n /*\n * Check if selected payment method is PayPal access.\n */\n if ($reservation->payment_method == 'paypal'){\n $this->set($reservation->calendar_id);\n \n /*\n * Check if selected refunds are enabled.\n */\n if ($this->refund){\n /*\n * Stop if a refund has been made.\n */\n if ($reservation->payment_status == 'partially refunded'\n || $reservation->payment_status == 'refunded'){\n echo 'success_with_message;;;;;'.$DOPBSP->text('RESERVATIONS_RESERVATION_CANCEL_SUCCESS_REFUND_WARNING');\n return false;\n }\n \n $refund_value = $this->refund_type == 'fixed' ? $this->refund_value:($reservation->price_total*$this->refund_value)/100;\n \n array_push($nvp_data, '&TRANSACTIONID='.$reservation->transaction_id);\n array_push($nvp_data, '&REFUNDTYPE='.($refund_value == $reservation->price_total ? 'Full':'Partial'));\n \n if ($refund_value == $reservation->price_total){\n array_push($nvp_data, '&REFUNDTYPE=Full');\n }\n else{\n array_push($nvp_data, '&REFUNDTYPE=Partial');\n array_push($nvp_data, '&AMT='.$refund_value);\n array_push($nvp_data, '&CURRENCYCODE='.$reservation->currency_code);\n }\n \n /*\n * Make the API call to PayPal.\n */\n $call_response = $this->call('RefundTransaction', \n implode('', $nvp_data));\n $ack = strtoupper($call_response['ACK']);\n\n if ($ack == 'SUCCESS' \n || $ack == 'SUCCESSWITHWARNING'){\n $settings_calendar = $DOPBSP->classes->backend_settings->values($reservation->calendar_id, \n 'calendar');\n $wpdb->update($DOPBSP->tables->reservations, array('refund' => $refund_value,\n 'payment_status' => $refund_value == $reservation->price_total ? 'refunded':'partially refunded'), \n array('id' => $reservation->id));\n \n /*\n * Success message.\n */\n echo 'success_with_message;;;;;';\n printf($DOPBSP->text('RESERVATIONS_RESERVATION_CANCEL_SUCCESS_REFUND'), $DOPBSP->classes->price->set($refund_value,\n $reservation->currency,\n $settings_calendar->currency_position));\n } \n else{\n /*\n * Error message.\n */\n echo 'error_with_message;;;;;'.urldecode($call_response['L_LONGMESSAGE0']).'.';\n }\n }\n }\n }",
"public function testGETCaptureIdRefunds()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function refund($paymentInfo)\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepare packages for use in JavaScript. | public function prepare_packages_for_js() {
$items = array();
foreach ( $this->get_packages() as $package ) {
$items[] = $package->to_array();
}
return $items;
} | [
"protected function packages()\n {\n }",
"function wp_default_packages_scripts( $scripts ) {\n\t$suffix = wp_scripts_get_suffix();\n\n\t// Expects multidimensional array like:\n\t//\t'a11y.js' => array('dependencies' => array(...), 'version' => '...'),\n\t//\t'annotations.js' => array('dependencies' => array(...), 'version' => '...'),\n\t//\t'api-fetch.js' => array(...\n\t$assets = include ABSPATH . WPINC . '/assets/script-loader-packages.php';\n\n\tforeach ( $assets as $package_name => $package_data ) {\n\t\t$basename = basename( $package_name, '.js' );\n\t\t$handle = 'wp-' . $basename;\n\t\t$path = \"/wp-includes/js/dist/{$basename}{$suffix}.js\";\n\n\t\tif ( ! empty( $package_data['dependencies'] ) ) {\n\t\t\t$dependencies = $package_data['dependencies'];\n\t\t} else {\n\t\t\t$dependencies = array();\n\t\t}\n\n\t\t// Add dependencies that cannot be detected and generated by build tools.\n\t\tswitch ( $handle ) {\n\t\t\tcase 'wp-block-library':\n\t\t\t\tarray_push( $dependencies, 'editor' );\n\t\t\t\tbreak;\n\t\t\tcase 'wp-edit-post':\n\t\t\t\tarray_push( $dependencies, 'media-models', 'media-views', 'postbox', 'wp-dom-ready' );\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$scripts->add( $handle, $path, $dependencies, $package_data['version'], 1 );\n\n\t\tif ( in_array( 'wp-i18n', $dependencies, true ) ) {\n\t\t\t$scripts->set_translations( $handle );\n\t\t}\n\t}\n}",
"public function _prepare_admin_scripts() {\n\t\t$this->forward_known_scripts();\n\t\t$this->autoload_known_scripts();\n\t}",
"public function prepareLibraries(): void\n {\n $this->write(\"Preparing libraries files ...\");\n\n $strings = [\n \"'basetheme'\" => \"'$this->name'\",\n 'namespace BaseTheme\\\\' => \"namespace $this->namespace\\\\\",\n '@package BaseTheme\\\\' => \"@package $this->namespace\\\\\",\n 'use BaseTheme' => \"use $this->namespace\",\n \"'basetheme-google-fonts'\" => \"'{$this->name}-google-fonts'\",\n ];\n\n // Replace in files\n foreach (glob($this->base . '/src/BaseTheme/Action/*.php') as $path) {\n $this->replaceInFile($path, $strings);\n }\n\n // Rename namespace directory\n if ( is_dir($this->base . '/src/BaseTheme') ) {\n rename($this->base . '/src/BaseTheme', $this->base . '/src/'.$this->namespace);\n }\n\n }",
"public function packages() {\n\t\tif (!empty($this->_customPaths)) {\n\t\t\t$this->_paths = $this->_customPaths;\n\t\t} elseif (!empty($this->params['plugin'])) {\n\t\t\t$this->_paths = array(CakePlugin::path($this->params['plugin']));\n\t\t} else {\n\t\t\t$this->_paths = array(APP);\n\t\t}\n\n\t\t$patterns = array(\n\t\t\t# Lib\n\t\t\tarray(\n\t\t\t\t'App::import(\\'Lib\\', \\'Plugin.SomeLib\\')',\n\t\t\t\t'|App\\:\\:import\\(\\'(Lib)\\'\\,\\s*\\'(.*?)\\'\\)|'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'App::uses(\\'SomeLib\\', \\'Plugin.Package\\')',\n\t\t\t\t'|App\\:\\:uses\\(\\'(.*?)\\'\\,\\s*\\'(.*?\\.(.*?))\\'\\)|'\n\t\t\t),\n\t\t\t# Model\n\t\t\tarray(\n\t\t\t\t'App::import(\\'Model\\', \\'Plugin.SomeModel\\')',\n\t\t\t\t'|App\\:\\:import\\(\\'(Model)\\'\\,\\s*\\'(.*?)\\'\\)|'\n\t\t\t),\n\t\t\t//TODO: component, helper, behavior, ...\n\t\t);\n\n\t\t$this->_filesRegexpUpdate($patterns, 'libPackage');\n\n\t\t$patterns = array(\n\n\t\t);\n\n\t\t$this->_filesRegexpUpdate($patterns, 'libPackage');\n\t}",
"protected function makeLibs()\n {\n $list = $this->getBuffer()->getLibs();\n\n $access = $this->getBuffer()->getNeedLibs();\n\n $html = \"\";\n\n foreach ($list as $path) {\n\n if($access === false && $path[LibsFinder::L_MAIN] === true){\n $html .= sprintf($this->templateScriptFile, $path[BufferCache::PATH_ABS]);\n } elseif($access !== false && array_search($path[BufferCache::FILE_ALIAS], $access) !== false){\n $html .= sprintf($this->templateScriptFile, $path[BufferCache::PATH_ABS]); \n } elseif($path[LibsFinder::ALWAYS] === true){\n $html .= sprintf($this->templateScriptFile, $path[BufferCache::PATH_ABS]);\n }\n\n }\n\n $this->replace('js_libs', $html);\n }",
"function pack(){\n\t\tAJXP_JSPacker::concatListAndPack(CLIENT_RESOURCES_FOLDER.\"/js/bootlist.txt\", \n\t\t\t\t\t\t\t\t\t\tCLIENT_RESOURCES_FOLDER.\"/js/ajaxplorer_boot.js\", \n\t\t\t\t\t\t\t\t\t\t\"Normal\");\n\t\tAJXP_JSPacker::concatListAndPack(CLIENT_RESOURCES_FOLDER.\"/js/scriptslist.txt\", \n\t\t\t\t\t\t\t\t\t\tCLIENT_RESOURCES_FOLDER.\"/js/ajaxplorer.js\", \n\t\t\t\t\t\t\t\t\t\t\"Normal\");\n\t\tAJXP_JSPacker::concatListAndPack(AJXP_THEME_FOLDER.\"/css/csslist.txt\", \n\t\t\t\t\t\t\t\t\t\tAJXP_THEME_FOLDER.\"/css/allz.css\",\n\t\t\t\t\t\t\t\t\t\t\"None\");\n\t}",
"protected function renderMainJavaScriptLibraries() {}",
"function wp_prepare_themes_for_js($themes = \\null)\n{\n}",
"protected function packages(): void\n {\n $bazarPackages = json_decode(file_get_contents(__DIR__.'/../../../package.json'), true);\n\n if (file_exists($this->laravel->basePath('package.json'))) {\n $packages = json_decode(file_get_contents($this->laravel->basePath('package.json')), true);\n\n $packages['dependencies'] = array_replace(\n $packages['dependencies'] ?? [], $bazarPackages['dependencies']\n );\n\n ksort($packages['dependencies']);\n }\n\n file_put_contents(\n $this->laravel->basePath('package.json'),\n json_encode($packages ?? $bazarPackages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }",
"public function testPackage() {\n\t\t// A is automatically included via \"includes\" in the manifest\n\t\t$this->assertEquals('var A = {};var B = {};', $this->object->package(array('js/b'), array('docBlocks' => false)));\n\n\t\t// And B will be included before C\n\t\t$this->assertEquals('var A = {};var B = {};var C = {};', $this->object->package(array('js/c', 'js/a'), array('docBlocks' => false)));\n\t}",
"function get_arrange_tpl_yui_libs() {\r\n // get libpath and resizelib\r\n if (file_exists(\"{$this->cfg->libdir}/yui/resize/resize-min.js\")) {\r\n $libdir = $this->cfg->wwwroot.\"/lib\";\r\n $resizelib = \"resize-min.js\";\r\n }\r\n else {\r\n // this is for the yui beta version included in this question type\r\n $libdir = $this->cfg->wwwroot.\"/question/type/\".$this->ddqtype->name();\r\n $resizelib = \"resize-beta-min.js\";\r\n }\r\n // make html for css and javascript includes\r\n $html = '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$libdir.'/yui/resize/assets/skins/sam/resize.css\" />'.\"\\n\";\r\n $html .= '<script type=\"text/javascript\" src=\"'.$libdir.'/yui/utilities/utilities.js\"></script>'.\"\\n\";\r\n $html .= '<script type=\"text/javascript\" src=\"'.$libdir.'/yui/dragdrop/dragdrop-min.js\"></script>'.\"\\n\";\r\n $html .= '<script type=\"text/javascript\" src=\"'.$libdir.'/yui/resize/'.$resizelib.'\"></script>';\r\n\r\n return $html;\r\n }",
"function wp_prepare_themes_for_js($themes = \\null)\n {\n }",
"protected function initializePackages()\n {\n $repositoryManager = $this->getComposer()->getRepositoryManager();\n /** @var RepositoryInterface $repository */\n foreach ($repositoryManager->getRepositories() as $repository) {\n if ($repository instanceof ComposerRepository && $repository->hasProviders()) {\n continue;\n }\n foreach ($repository->getPackages() as $package) {\n $this->packages[$package->getName()] = $package->getRepository()->getPackages();\n }\n }\n }",
"private function prepareFiles()\n {\n\n $scriptsForSort = array();\n\n foreach ($this->scripts as $script) {\n $attrs = '';\n if (!empty($script['attributes'])) {\n //set default script type\n if (!empty($script['attributes']['type'])) {\n $attrs .= 'type=\"' . $script['attributes']['type'] . '\" ';\n unset($script['attributes']['type']);\n } else {\n $attrs .= 'type=\"' . self::DEFAULT_SCRIPT_TYPE . '\" ';\n }\n foreach ($script['attributes'] as $attr => $value) {\n $attrs .= $attr . '=\"' . $value . '\" ';\n }\n } else {\n $attrs = 'type=\"' . self::DEFAULT_SCRIPT_TYPE . '\" ';\n }\n $jsHTML = '<script src=\"' . $script['src'] . '\" ' . trim($attrs) . '></script>';\n if (!empty($script['offset'])) {\n $scriptsForSort[$script['offset']] = $jsHTML;\n } else {\n $scriptsForSort[] = $jsHTML;\n }\n }\n\n //sort scripts queue by offset\n ksort($scriptsForSort);\n return implode(PHP_EOL, $scriptsForSort);\n }",
"protected function resolvePackageDependencies() {}",
"protected function getAssets_PackagesService()\n {\n return $this->privates['assets.packages'] = new \\Symfony\\Component\\Asset\\Packages(new \\Symfony\\Component\\Asset\\PathPackage('', new \\Symfony\\Component\\Asset\\VersionStrategy\\EmptyVersionStrategy(), new \\Symfony\\Component\\Asset\\Context\\RequestStackContext(($this->services['request_stack'] ?? ($this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack())), '', false)), []);\n }",
"public function initScripts()\n {\n }",
"protected function getAssets_PackagesService()\n {\n return $this->privates['assets.packages'] = new \\Symfony\\Component\\Asset\\Packages(new \\Symfony\\Component\\Asset\\PathPackage('', new \\Symfony\\Component\\Asset\\VersionStrategy\\EmptyVersionStrategy(), new \\Symfony\\Component\\Asset\\Context\\RequestStackContext(($this->services['request_stack'] ?? $this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack()), '', false)), array());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the date and time at which the file was modified last time. The given $modifyTime parameter is converted to a \DateTime object via Util::createDateTime. | public function setModifyTime($modifyTime = 'now')
{
$this->pathname->rootAdapter()->setModifyTime($this->pathname, Util::createDateTime($modifyTime));
return $this;
} | [
"public function setModifyTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->modify_time = $var;\n\n return $this;\n }",
"public function setModifiedTime(\\DateTime $modifiedTime)\n\t{\n\t\t$this->modifiedTime=$modifiedTime; \n\t\t$this->keyModified['Modified_Time'] = 1; \n\n\t}",
"public function setLastModifyDateTime(\\DateTime $lastModifyDateTime)\n {\n $this->lastModifyDateTime = $lastModifyDateTime;\n return $this;\n }",
"public function setModifiedTime(\\DateTime $modifiedTime)\n\t{\n\t\t$this->addKeyValue('Modified_Time', $modifiedTime); \n\n\t}",
"abstract public function setModificationDate(DateTime $modificationDate);",
"public function setModifyDate($modifyDate = null)\n {\n // validation for constraint: string\n if (!is_null($modifyDate) && !is_string($modifyDate)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($modifyDate)), __LINE__);\n }\n if (is_null($modifyDate) || (is_array($modifyDate) && empty($modifyDate))) {\n unset($this->ModifyDate);\n } else {\n $this->ModifyDate = $modifyDate;\n }\n return $this;\n }",
"abstract function set_timemodified();",
"public function getModifyTime()\n {\n return $this->modifyTime;\n }",
"public function setArticleModifyTime($article_modify_time)\n {\n $this->article_modify_time = $article_modify_time;\n\n return $this;\n }",
"public function getLastModifyDateTime()\n {\n return $this->lastModifyDateTime;\n }",
"public function getLastModifyDateTime()\n {\n return $this->LastModifyDateTime;\n }",
"public function setmodifyDatetime($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->modifydatetime !== null || $dt !== null) {\n $currentDateAsString = ($this->modifydatetime !== null && $tmpDt = new DateTime($this->modifydatetime)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->modifydatetime = $newDateAsString;\n $this->modifiedColumns[] = ActionTypePeer::MODIFYDATETIME;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function setmodifyDatetime($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->modifydatetime !== null || $dt !== null) {\n $currentDateAsString = ($this->modifydatetime !== null && $tmpDt = new DateTime($this->modifydatetime)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->modifydatetime = $newDateAsString;\n $this->modifiedColumns[] = ActionPeer::MODIFYDATETIME;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function getModifiedDate($modify)\n {\n $new = clone $this;\n\n $new->modify($modify);\n\n return $new;\n }",
"public function setLastModified(\\DateTime $lastModified)\r\n {\r\n }",
"public function setModificationDate(DCATDateTime $modificationDate): void\n {\n $this->modificationDate = $modificationDate;\n }",
"function dateModify($pDate, $modify) {\n if (gettype($pDate) == \"string\") {\n $dt = new DateTime($pDate); \n } else {\n $dt = clone $pDate;\n }\n \n return $dt->modify($modify);\n}",
"public function setTimeModified()\r\n {\r\n $this->updated_at = new \\DateTime();\r\n }",
"public function setModifiedAt($modified_at);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SQL para obtener las FASES de un Test buscando por clave_test | private function obtenerFasesPorClaveTest($clave_test){
$SQL = "SELECT * FROM FASES_TEST WHERE clave_test = '". $clave_test . "';";
if($RES = f_genericas_inc::DBquery($SQL, $this->db)){
while($ROW = $RES->fetchRow()){
$fase[] = array(
'clave_fase'=>$ROW[0],
'titulo_fase'=>$ROW[1],
'instrucciones_fase'=>$ROW[2]
);
}
return $fase;
}
} | [
"public function testselect(){\n\t\t\t$res = mysql_query(\"SELECT test_id, test_name FROM wc_test as t INNER JOIN wc_testbattery_test_attribute as tbta ON \n\t\t\t\tt.test_id = tbta.testbattery_test_id WHERE tbta.testbattery_id='\".$this->rangetestbatteryid.\"'\")or die(mysql_error());\n\t\t\treturn $res;\n\t\t}",
"public static function getFase($idFase=''){\n if($idFase!=''){\n $id_empresa = decode( sessionVar('_iE') );\n $sql = new Sql();\n $res = $sql->select('SELECT * FROM servicos_fases \n WHERE id_fase = :id_fase\n AND id_empresa = :id_empresa',array(\n ':id_empresa'=> $id_empresa, ':id_fase'=>$idFase ));\n if(count($res)>0){\n return $res;\n }else{\n return 0;\n }\n }else{\n return false;\n }\n }",
"public static function GetAllTests()\n {\n return self::GetAllRecordsFromTable(\"tests\"); \n }",
"public function testAllFederacions(){\n $url=\"/api/v1/federacion\";\n $response = $this->call('GET', $url);\n $this->assertEquals(200, $response->status(), \"Erro en {$url}\");\n }",
"function f_getEnv($test_id)\n\t{\n\t\tglobal\t$db;\n\t\t$output = '';\n\t\t$sql_query = \"select te.env_name as name from env_relation as er,test_env as te where er.test_id = $test_id and er.env_id = te.env_id\";\n\t\t//echo $sql_query;\n\t\t$result = $db->query($sql_query) or die($db->error);\n\t\twhile($row = $result->fetch_assoc())\n\t\t{\n\t\t\t$env = '';\n\t\t\t$env = $row['name'];\n\t\t\t$output = $env . ' ';\n\t\t}\n\t\treturn $output;\n\t}",
"public function get_all_tests()\n\t{\n\t\treturn $this->db->get('test')->result();\n\t}",
"public function testQuerying(){\n\n $data = $this->loadTestDataCSV(FIXTURES_PATH . $this->_data_source);\n if(!empty($data)){\n foreach($data as $case){\n $methodName = array_shift($case);\n if(!empty($methodName)){\n $methodName = 'query' . ucfirst($methodName);\n $args = @array_shift($case);\n $expected = eval('return ' . @array_shift($case) . ';');\n\n $db = self::$container->db;\n\n $reflection = new \\ReflectionClass($db);\n if($reflection->hasMethod($methodName)){\n $methodReflection = $reflection->getMethod($methodName);\n $result = $methodReflection->invokeArgs($db, (array)$args);\n\n $this->assertEquals($expected, $result, sprintf('Calling %s with provided params assertion failed', $methodName));\n }\n }\n }\n }\n }",
"public function testFaxDocumentIdCostsGet()\n {\n }",
"public function Afiliados(){\n\t\t\t$consult=oci_parse($conn,\"Ips$_sndCitas.fn_getAfiliados\");\n\t\t\toci_execute($consult);\n\t\t}",
"public function providertestDBAL()\r\n {\r\n return array(array('user',\"Hamid\",\"Asad\"),array('salary',40000,45000));\r\n }",
"function DataForTestFormFuzzyGetProvider() {\n $tests = array();\n $tests[] = array(\n array(\n '_val[comp][0]' => 'alpha',\n '_val[comp][1]' => 'bravo',\n '_val[discuss]' => 'http://',\n '_val[todo][0]' => 'do',\n '_val[todo][1]' => 're',\n ),\n '_val[todo]',\n array(\n 'do',\n 're',\n ),\n );\n $tests[] = array(\n array(\n '_val[todo][0]' => 'do',\n '_val[todo][1]' => 're',\n '_val[todo][2]' => 'mi',\n '_val[todo][3]' => 'fa',\n ),\n '_val[todo]',\n array(\n 'do',\n 're',\n 'mi',\n 'fa',\n ),\n );\n\n return $tests;\n }",
"function consultarFase(){\n global $conexion, $data;\n $id = $data[\"id\"];\n $resultado = mysqli_query($conexion,\"SELECT * FROM catalogo_fase WHERE ctf_id='$id'\");\n echo validarError($conexion, false, $resultado);\n }",
"public static function getlistafechadetesis() {\r\n $Dao = new daoUsuarioTesis();\r\n return $Dao->listarfechatesis();\r\n }",
"public function testFederacionsByID(){\n $federacion=Federacion::all();\n foreach($federacion as $f){\n $url=\"/api/v1/federacion/{$f['ID']}\";\n $response = $this->call('GET', $url);\n $this->assertEquals(200, $response->status(), \"Erro en {$url}\");\n }\n }",
"public function getAssignedTests () {\n $tests = array();\n try {\n $host_db_link = new PDO( OPAL_DB_DSN, OPAL_DB_USERNAME, OPAL_DB_PASSWORD );\n $host_db_link->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n $sql = \"\n SELECT DISTINCT \n tre.ExpressionName,\n trc.Name_EN\n FROM \n TestResultExpression tre,\n TestResultControl trc\n WHERE\n trc.TestResultControlSerNum = tre.TestResultControlSerNum\n \";\n $query = $host_db_link->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n $query->execute();\n\n while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n\n $testResultDetails = array(\n 'id' => $data[0],\n 'name_EN' => \"$data[1]\"\n );\n array_push($tests, $testResultDetails);\n }\n\n return $tests;\n\n } catch (PDOException $e) {\n echo $e->getMessage();\n return $tests;\n }\n }",
"public static function getTestColumnValueTableName() {\n\t\treturn 'test_variation_'.__CLASS__.'_'.getmypid();\n\t}",
"public function DA_ConsultarPrefacturaUfeg();",
"function reporte_factores_contextuales_estudiante($token_estudiante)\n{\n try {\n $con = connectDB_demos();\n $query = $con->query(\"SELECT (\n\t\t\tce_p30+ce_p31+ce_p32+ce_p33+ce_p34+ce_p35+\n\t\t\tce_p36+ce_p37+ce_p38+ce_p39+ce_p40+ce_p41+\n\t\t\tce_p42+ce_p43+ce_p44+ce_p45+ce_p46+ce_p47\n\t\t ) as sumaFC,(\n\t\t\t\tce_p30+ce_p31+ce_p32\n\t\t ) as sumaFamilia,(\n\t\t\tce_p33+ce_p34+ce_p35+ce_p36+\n\t\t\tce_p37+ce_p38+ce_p39+ce_p40\n\t\t ) as sumaProfes,(\n\t\t\tce_p41+ce_p42+ce_p43+\n\t\t\tce_p44+ce_p45+ce_p46+ce_p47\n\t\t ) as sumaPares\n \nfrom ce_encuesta_resultado a where UPPER(a.ce_participantes_token_fk) = UPPER('$token_estudiante')\");\n\n } catch (Exception $ex) {\n echo 'Excepción Capturada: ' . $ex->getMessage();\n }\n\n return $query;\n}",
"public function testEstadosSiglas()\n {\n \t$rs = Util_Helper::Estados();\n \t\n \t$this->assertType('array', $rs);\n \t$this->assertEquals(27, count($rs));\n \t\n \t$estados = array('AC', 'AL', 'AP', 'AM', 'BA', 'CE', 'DF', 'ES', 'GO', 'MA', 'MT', 'MS', 'MG', 'PA', 'PB', 'PR', 'PE', 'PI', 'RJ', 'RN', 'RS', 'RO', 'RR', 'SC', 'SP', 'SE', 'TO');\n\t\tforeach($rs as $i => $sigla) {\n \t\t$this->assertType('string', $i);\n \t\t$this->assertTrue(in_array($sigla, $estados));\n \t}\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates Vendors Instance from array parsed from file | private function createVendorsModel(array $vendors): void
{
foreach ($vendors as $vendor) {
$vendorDetails = $this->splitIntoVendorsAndFoodItems($vendor);
$oVendor = new Vendor(...$this->splitVendor($vendorDetails[0]));
foreach (array_slice($vendorDetails, 1) as $foodItem) {
$foodItemFormatted = $this->splitFoodItem($foodItem);
$oFoodItem = new FoodItem(...$foodItemFormatted);
$oVendor->addFoodItem($oFoodItem);
}
$this->mVendors->addVendor($oVendor);
}
} | [
"public static function init(array $vendors): self\n {\n return new self(new BulkCreateVendorsRequest($vendors));\n }",
"public function load()\n {\n \n //split into blocks and filter empty lines\n $items = array_filter(explode($this->vcardSeparator, file_get_contents($this->filename)), create_function('$a', 'return ($a);'));\n//Zend_Debug::dump($this->vcardSeparator);\n $this->items = array();\n\n foreach($items as $item) {\n $values = $this->parse($item);\n//Zend_Debug::dump($values);\n $item2 = array();\n foreach($values as $value) {\n//Zend_Debug::dump($value);\n switch ($value['name']) {\n case 'N':\n $item2['lastName'] = $value['value'][0];\n $item2['firstName'] = $value['value'][1];\n break;\n case 'EMAIL':\n $item2['email'] = $value['value'][0];\n break;\n default:\n \n }\n \n }\n if ($item2) $this->items[] = $item2;\n }\n \n }",
"public function parseFile(string $filePath): void\n {\n if (is_file($filePath)) {\n $fileContents = file_get_contents($filePath);\n $vendors = $this->splitFileContentsIntoVendors($fileContents);\n $this->createVendorsModel($vendors);\n } else {\n $this->mLogger::out(\"Filename specified is not a regular file.\");\n }\n }",
"public static function getProvidersFromXml($file) {\r\n\t\t$providers = array();\r\n\r\n\t\t$xml = simplexml_load_file($file);\r\n\t\tif($xml !== false) {\r\n\t\t\tforeach($xml->provider as $providerXml) {\r\n\t\t\t\t$enabled = (string) $providerXml['disabled'] != 'disabled';\r\n\r\n\t\t\t\tif($enabled) {\r\n\t\t\t\t\t$provider = new Pronamic_IDeal_Provider();\r\n\t\t\t\t\t$provider->setId((string) $providerXml->id);\r\n\t\t\t\t\t$provider->setName((string) $providerXml->name);\r\n\t\t\t\t\t$provider->setUrl((string) $providerXml->url);\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach($providerXml->variant as $variantXml) {\r\n\t\t\t\t\t\t$enabled = (string) $variantXml['disabled'] != 'disabled';\r\n\t\r\n\t\t\t\t\t\tif($enabled) {\r\n\t\t\t\t\t\t\tswitch((string) $variantXml['method']) {\r\n\t\t\t\t\t\t\t\tcase self::METHOD_EASY:\r\n\t\t\t\t\t\t\t\t\t$variant = new Pronamic_IDeal_VariantEasy();\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tcase self::METHOD_BASIC:\r\n\t\t\t\t\t\t\t\t\t$variant = new Pronamic_IDeal_VariantBasic();\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tcase self::METHOD_KASSA:\r\n\t\t\t\t\t\t\t\t\t$variant = new Pronamic_IDeal_VariantKassa();\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tcase self::METHOD_OMNIKASSA:\r\n\t\t\t\t\t\t\t\t\t$variant = new Pronamic_IDeal_VariantOmniKassa();\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tcase self::METHOD_ADVANCED:\r\n\t\t\t\t\t\t\t\t\t$variant = new Pronamic_IDeal_VariantAdvanced();\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\t\t$variant = new Pronamic_IDeal_Variant();\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\t\t\t$variant->setProvider($provider);\r\n\t\t\t\t\t\t\t$variant->setId((string) $variantXml->id);\r\n\t\t\t\t\t\t\t$variant->setName((string) $variantXml->name);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$variant->liveSettings = new stdClass();\r\n\t\t\t\t\t\t\t$variant->liveSettings->dashboardUrl = (string) $variantXml->live->dashboardUrl;\r\n\t\t\t\t\t\t\t$variant->liveSettings->paymentServerUrl = (string) $variantXml->live->paymentServerUrl;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$variant->testSettings = new stdClass();\r\n\t\t\t\t\t\t\t$variant->testSettings->dashboardUrl = (string) $variantXml->test->dashboardUrl;\r\n\t\t\t\t\t\t\t$variant->testSettings->paymentServerUrl = (string) $variantXml->test->paymentServerUrl;\r\n\t\t\r\n\t\t\t\t\t\t\tforeach($variantXml->xpath('certificates/file') as $fileXml) {\r\n\t\t\t\t\t\t\t\t$variant->certificates[] = (string) $fileXml;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$provider->addVariant($variant);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t$providers[$provider->getId()] = $provider;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $providers;\r\n\t}",
"protected function getNewVendorInfoObject(array $params)\n {\n $type = $this->getPlatform()->getDatabaseType();\n $vi = new VendorInfo($type);\n $vi->setParameters($params);\n\n return $vi;\n }",
"public static function parse($json)\n {\n $entity = new Vendor();\n $entity->id = isset($json['id']) ? $json['id'] : null;\n $entity->name = isset($json['name']) ? $json['name'] : null;\n $entity->email = isset($json['email']) ? $json['email'] : null;\n \n if (isset($json['bank']) && !empty($json['bank'])) {\n foreach ($json['bank'] as $bank) {\n $entity->banks[] = Bank::parse($bank);\n }\n }\n \n return $entity;\n }",
"public function __construct($file)\n {\n // loads DOM document\n $vocations = new DOMDocument();\n $vocations->load($file);\n\n // loads vocations\n foreach( $vocations->getElementsByTagName('vocation') as $vocation)\n {\n $this->vocations[ (int) $vocation->getAttribute('id') ] = $vocation->getAttribute('name');\n }\n }",
"private function addVendors() {\n\t\n\t\t$database = new Database();\n\n\t\tforeach($this->aryData as $record) {\n\t\t\t\t\t\n\t\t\t$database->query(\n\t\t\t\t'INSERT IGNORE INTO vendors (`code`) VALUES (:code)'\n\t\t\t);\n\t\t\t\t\n\t\t\t$database->bind(':code', $record{'Vendor'});\n\n\t\t\t$database->execute();\n\t\t}\n\t\techo \"<p>Vendors added for store.</p>\";\n\t}",
"function getVendors()\n\t{\n\t\tglobal $conn;\n\t\t\n\t\t$get = $conn->prepare(\"SELECT id FROM ITSM_Vendor ORDER BY code ASC\");\n\t\t$get->execute();\n\t\t\n\t\t$vendors = [];\n\t\t\n\t\tforeach($get->fetchAll(\\PDO::FETCH_COLUMN, 0) as $vendorId)\n\t\t{\n\t\t\t$vendor = new Vendor($vendorId);\n\t\t\t\n\t\t\tif($vendor->load())\n\t\t\t{\n\t\t\t\t$vendors[] = $vendor;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $vendors;\n\t}",
"function mapToObject($file) {\n $interestedUsrList = array();\n foreach ($file as $line) {\n $instance = InterestUser::initUsingFileLines($line);\n array_push($interestedUsrList, $instance); \n }\n return $interestedUsrList;\n }",
"static function parseData($fileData) {\n $org = new Organization();\n $lines = explode(\"\\n\", $fileData);\n\n for ($x = 1; $x < count($lines); $x++) {\n $columns = explode(\",\", $lines[$x]);\n if (count($columns) != 7) {\n die(\"There is insufficient information to create the search engine.\");\n }\n for($y = 0; $y < count($columns); $y++) {\n $columns[$y] = trim($columns[$y]);\n }\n\n $emp = new Employee($columns[0], $columns[1], $columns[4], $columns[5], $columns[6]);\n $org->addEmployee($emp);\n }\n\n return $org;\n }",
"public function getVendors($vendors) {\n\t\t$vendorsResult = array();\n\n\t\tforeach ($vendors as $vendor) {\n\t\t\t$vendorTmp = $this->factory->create('application\\foodora\\Registry\\Helpers\\Vendor');\n\t\t\t$vendorTmp->setSchedules($this->load(self::VENDOR_SCHEDULE, $vendor));\n\t\t\t$vendorTmp->setSpecialDays($this->load(self::VENDOR_SPECIAL_DAY, $vendor, array(self::DATE_START, self::DATE_END)));\n\t\t\t$vendorsResult[] = $this->createObject($vendorTmp, $vendor);\n\t\t}\n\n\t\treturn $vendorsResult;\n\t}",
"private function splitIntoVendorsAndFoodItems(string $vendor): array\n {\n return preg_split('/\\r\\n|\\r|\\n/', $vendor);\n }",
"private function populateDefaultData(): void\n {\n $vendors = [\n ['Grain and Leaf', 'E32NY', 100, 'foodItem' => ['Grain salad', ['nuts'], '12']],\n ['Wholegrains', 'SW34DA', 20, 'foodItem' => ['The Classic', ['gluten'], '24']]\n ];\n $this->mVendors = new Vendors();\n foreach ($vendors as $vendor) {\n $oVendor = new Vendor($vendor[0], $vendor[1], $vendor[2]);\n $oVendor->addFoodItem(new FoodItem(...$vendor['foodItem']));\n $this->mVendors->addVendor($oVendor);\n }\n }",
"function fromArray($pinfo) {\n\t\tunset ( $pinfo ['old'] );\n\t\tunset ( $pinfo ['xsdversion'] );\n\t\t$this->_incomplete = false;\n\t\t$this->_packageInfo = $pinfo;\n\t}",
"static function getVendors($only_active = false, $cms = null, $slug = null){\n $list = file_get_contents(__DIR__ . '/../config/vendors.txt');\n $lines = explode(PHP_EOL, $list);\n \n $arr = [];\n foreach ($lines as $line){\n $line = trim($line);\n \n if (empty($line) || $line[0] == '#' || $line[0] == ';'){\n continue;\n }\n \n $line = str_replace(\"\\t\", \" \", $line);\n $line = preg_replace('!\\s+!', ' ', $line);\n $fields = explode(' ', $line);\n \n $enabled = !(isset($fields[3]) && $fields[3] == 'no');\n \n if ($only_active && !$enabled){\n continue;\n }\n\n if ($cms != null){\n if (is_array($cms)){\n $_cms = strtolower($fields[2]);\n\n $found = false;\n foreach ($cms as $item){\n if (strtolower($item) == $_cms){\n $found = true;\n break;\n }\n } \n if (!$found){\n continue;\n } \n } else {\n if (strtolower($fields[2]) != strtolower($cms)){\n continue;\n }\n }\n }\n \n $row = [\n 'url' => $fields[0],\n 'slug' => $fields[1],\n 'cms' => $fields[2],\n 'enabled' => $enabled\n ];\n\n if ($fields[1] == $slug){\n return [ $row ];\n }\n\n $arr[] = $row;\n }\n \n return $arr;\n }",
"public function createAction()\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"vendor\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $vendor = new Vendor();\n $vendor->Listid = $this->request->getPost(\"ListID\");\n $vendor->Timecreated = $this->request->getPost(\"TimeCreated\");\n $vendor->Timemodified = $this->request->getPost(\"TimeModified\");\n $vendor->Editsequence = $this->request->getPost(\"EditSequence\");\n $vendor->Name = $this->request->getPost(\"Name\");\n $vendor->Isactive = $this->request->getPost(\"IsActive\");\n $vendor->Classref_listid = $this->request->getPost(\"ClassRef_ListID\");\n $vendor->Classref_fullname = $this->request->getPost(\"ClassRef_FullName\");\n $vendor->Companyname = $this->request->getPost(\"CompanyName\");\n $vendor->Salutation = $this->request->getPost(\"Salutation\");\n $vendor->Firstname = $this->request->getPost(\"FirstName\");\n $vendor->Middlename = $this->request->getPost(\"MiddleName\");\n $vendor->Lastname = $this->request->getPost(\"LastName\");\n $vendor->Jobtitle = $this->request->getPost(\"JobTitle\");\n $vendor->Suffix = $this->request->getPost(\"Suffix\");\n $vendor->Vendoraddress_addr1 = $this->request->getPost(\"VendorAddress_Addr1\");\n $vendor->Vendoraddress_addr2 = $this->request->getPost(\"VendorAddress_Addr2\");\n $vendor->Vendoraddress_addr3 = $this->request->getPost(\"VendorAddress_Addr3\");\n $vendor->Vendoraddress_addr4 = $this->request->getPost(\"VendorAddress_Addr4\");\n $vendor->Vendoraddress_addr5 = $this->request->getPost(\"VendorAddress_Addr5\");\n $vendor->Vendoraddress_city = $this->request->getPost(\"VendorAddress_City\");\n $vendor->Vendoraddress_state = $this->request->getPost(\"VendorAddress_State\");\n $vendor->Vendoraddress_postalcode = $this->request->getPost(\"VendorAddress_PostalCode\");\n $vendor->Vendoraddress_country = $this->request->getPost(\"VendorAddress_Country\");\n $vendor->Vendoraddress_note = $this->request->getPost(\"VendorAddress_Note\");\n $vendor->Shipaddress_addr1 = $this->request->getPost(\"ShipAddress_Addr1\");\n $vendor->Shipaddress_addr2 = $this->request->getPost(\"ShipAddress_Addr2\");\n $vendor->Shipaddress_addr3 = $this->request->getPost(\"ShipAddress_Addr3\");\n $vendor->Shipaddress_addr4 = $this->request->getPost(\"ShipAddress_Addr4\");\n $vendor->Shipaddress_addr5 = $this->request->getPost(\"ShipAddress_Addr5\");\n $vendor->Shipaddress_city = $this->request->getPost(\"ShipAddress_City\");\n $vendor->Shipaddress_state = $this->request->getPost(\"ShipAddress_State\");\n $vendor->Shipaddress_postalcode = $this->request->getPost(\"ShipAddress_PostalCode\");\n $vendor->Shipaddress_country = $this->request->getPost(\"ShipAddress_Country\");\n $vendor->Shipaddress_note = $this->request->getPost(\"ShipAddress_Note\");\n $vendor->Phone = $this->request->getPost(\"Phone\");\n $vendor->Mobile = $this->request->getPost(\"Mobile\");\n $vendor->Pager = $this->request->getPost(\"Pager\");\n $vendor->Altphone = $this->request->getPost(\"AltPhone\");\n $vendor->Fax = $this->request->getPost(\"Fax\");\n $vendor->Email = $this->request->getPost(\"Email\");\n $vendor->Cc = $this->request->getPost(\"Cc\");\n $vendor->Contact = $this->request->getPost(\"Contact\");\n $vendor->Altcontact = $this->request->getPost(\"AltContact\");\n $vendor->Nameoncheck = $this->request->getPost(\"NameOnCheck\");\n $vendor->Notes = $this->request->getPost(\"Notes\");\n $vendor->Accountnumber = $this->request->getPost(\"AccountNumber\");\n $vendor->Vendortyperef_listid = $this->request->getPost(\"VendorTypeRef_ListID\");\n $vendor->Vendortyperef_fullname = $this->request->getPost(\"VendorTypeRef_FullName\");\n $vendor->Termsref_listid = $this->request->getPost(\"TermsRef_ListID\");\n $vendor->Termsref_fullname = $this->request->getPost(\"TermsRef_FullName\");\n $vendor->Creditlimit = $this->request->getPost(\"CreditLimit\");\n $vendor->Vendortaxident = $this->request->getPost(\"VendorTaxIdent\");\n $vendor->Isvendoreligiblefor1099 = $this->request->getPost(\"IsVendorEligibleFor1099\");\n $vendor->Balance = $this->request->getPost(\"Balance\");\n $vendor->Currencyref_listid = $this->request->getPost(\"CurrencyRef_ListID\");\n $vendor->Currencyref_fullname = $this->request->getPost(\"CurrencyRef_FullName\");\n $vendor->Billingrateref_listid = $this->request->getPost(\"BillingRateRef_ListID\");\n $vendor->Billingrateref_fullname = $this->request->getPost(\"BillingRateRef_FullName\");\n $vendor->Salestaxcoderef_listid = $this->request->getPost(\"SalesTaxCodeRef_ListID\");\n $vendor->Salestaxcoderef_fullname = $this->request->getPost(\"SalesTaxCodeRef_FullName\");\n $vendor->Salestaxcountry = $this->request->getPost(\"SalesTaxCountry\");\n $vendor->Issalestaxagency = $this->request->getPost(\"IsSalesTaxAgency\");\n $vendor->Salestaxreturnref_listid = $this->request->getPost(\"SalesTaxReturnRef_ListID\");\n $vendor->Salestaxreturnref_fullname = $this->request->getPost(\"SalesTaxReturnRef_FullName\");\n $vendor->Taxregistrationnumber = $this->request->getPost(\"TaxRegistrationNumber\");\n $vendor->Reportingperiod = $this->request->getPost(\"ReportingPeriod\");\n $vendor->Istaxtrackedonpurchases = $this->request->getPost(\"IsTaxTrackedOnPurchases\");\n $vendor->Taxonpurchasesaccountref_listid = $this->request->getPost(\"TaxOnPurchasesAccountRef_ListID\");\n $vendor->Taxonpurchasesaccountref_fullname = $this->request->getPost(\"TaxOnPurchasesAccountRef_FullName\");\n $vendor->Istaxtrackedonsales = $this->request->getPost(\"IsTaxTrackedOnSales\");\n $vendor->Taxonsalesaccountref_listid = $this->request->getPost(\"TaxOnSalesAccountRef_ListID\");\n $vendor->Taxonsalesaccountref_fullname = $this->request->getPost(\"TaxOnSalesAccountRef_FullName\");\n $vendor->Istaxontax = $this->request->getPost(\"IsTaxOnTax\");\n $vendor->Prefillaccountref_listid = $this->request->getPost(\"PrefillAccountRef_ListID\");\n $vendor->Prefillaccountref_fullname = $this->request->getPost(\"PrefillAccountRef_FullName\");\n $vendor->Customfield1 = $this->request->getPost(\"CustomField1\");\n $vendor->Customfield2 = $this->request->getPost(\"CustomField2\");\n $vendor->Customfield3 = $this->request->getPost(\"CustomField3\");\n $vendor->Customfield4 = $this->request->getPost(\"CustomField4\");\n $vendor->Customfield5 = $this->request->getPost(\"CustomField5\");\n $vendor->Customfield6 = $this->request->getPost(\"CustomField6\");\n $vendor->Customfield7 = $this->request->getPost(\"CustomField7\");\n $vendor->Customfield8 = $this->request->getPost(\"CustomField8\");\n $vendor->Customfield9 = $this->request->getPost(\"CustomField9\");\n $vendor->Customfield10 = $this->request->getPost(\"CustomField10\");\n $vendor->Customfield11 = $this->request->getPost(\"CustomField11\");\n $vendor->Customfield12 = $this->request->getPost(\"CustomField12\");\n $vendor->Customfield13 = $this->request->getPost(\"CustomField13\");\n $vendor->Customfield14 = $this->request->getPost(\"CustomField14\");\n $vendor->Customfield15 = $this->request->getPost(\"CustomField15\");\n $vendor->Status = $this->request->getPost(\"Status\");\n \n\n if (!$vendor->save()) {\n foreach ($vendor->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"vendor\",\n 'action' => 'new'\n ]);\n\n return;\n }\n\n $this->flash->success(\"vendor was created successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"vendor\",\n 'action' => 'index'\n ]);\n }",
"abstract public function fromFile($file);",
"public function setVendor(array $vendor)\n {\n $this->vendor = $vendor;\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Any other lesson functions go here. Each of them must have a name that Starts with languagelesson_. Checks to see if a LL_CLUSTERJUMP or a LL_UNSEENBRANCHPAGE is used in a lesson. This function is only executed when a teacher is checking the navigation for a lesson. | function languagelesson_display_teacher_warning($lesson) {
global $DB;
// Get all of the lesson answers.
$params = array ("lessonid" => $lesson->id);
if (!$lessonanswers = $DB->get_records_select("languagelesson_answers", "lessonid = :lessonid", $params)) {
// No answers, then not using cluster or unseen.
return false;
}
// Just check for the first one that fulfills the requirements.
foreach ($lessonanswers as $lessonanswer) {
if ($lessonanswer->jumpto == LL_CLUSTERJUMP || $lessonanswer->jumpto == LL_UNSEENBRANCHPAGE) {
return true;
}
}
// If no answers use either of the two jumps.
return false;
} | [
"public function llms_learning() {\n\n\t\t\tif ( is_lesson() || is_course() ) {\n\n\t\t\t\tremove_action( 'lifterlms_single_course_before_summary', 'lifterlms_template_single_featured_image', 10 );\n\t\t\t\tremove_action( 'lifterlms_single_course_before_summary', 'lifterlms_template_single_video', 20 );\n\t\t\t\tremove_action( 'lifterlms_single_course_before_summary', 'lifterlms_template_single_audio', 30 );\n\n\t\t\t\t$page_restricted = llms_page_restricted( get_the_id() );\n\t\t\t\t$featured_img = true;\n\t\t\t\t$description = true;\n\t\t\t\t$meta = true;\n\t\t\t\t$instructor = true;\n\t\t\t\t$syllabus = true;\n\t\t\t\t$progress_bar = true;\n\n\t\t\t\tif ( $page_restricted['is_restricted'] ) {\n\n\t\t\t\t\t$featured_img = astra_get_option( 'lifterlms-enable-visitor-featured-image' );\n\t\t\t\t\t$description = astra_get_option( 'lifterlms-enable-visitor-course-description' );\n\t\t\t\t\t$meta = astra_get_option( 'lifterlms-enable-visitor-course-meta' );\n\t\t\t\t\t$instructor = astra_get_option( 'lifterlms-enable-visitor-instructor-detail' );\n\t\t\t\t\t$syllabus = astra_get_option( 'lifterlms-enable-visitor-syllabus' );\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( astra_get_option( 'lifterlms-distraction-free-learning' ) ) {\n\n\t\t\t\t\t\t// HFB Support for distration free checkout.\n\t\t\t\t\t\tif ( Astra_Addon_Builder_Helper::$is_header_footer_builder_active ) {\n\t\t\t\t\t\t\tremove_action( 'astra_header', array( Astra_Builder_Header::get_instance(), 'prepare_header_builder_markup' ) );\n\t\t\t\t\t\t\tremove_action( 'astra_footer', array( Astra_Builder_Footer::get_instance(), 'footer_markup' ), 10 );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tremove_action( 'astra_header', 'astra_header_markup' );\n\t\t\t\t\t\tremove_action( 'astra_footer', 'astra_footer_markup' );\n\n\t\t\t\t\t\tadd_action( 'astra_header', array( $this, 'header_markup' ) );\n\t\t\t\t\t\tadd_action( 'astra_footer', array( $this, 'footer_markup' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t$featured_img = astra_get_option( 'lifterlms-enable-featured-image' );\n\t\t\t\t\t$description = astra_get_option( 'lifterlms-enable-course-description' );\n\t\t\t\t\t$meta = astra_get_option( 'lifterlms-enable-course-meta' );\n\t\t\t\t\t$instructor = astra_get_option( 'lifterlms-enable-instructor-detail' );\n\t\t\t\t\t$progress_bar = astra_get_option( 'lifterlms-enable-progress-bar' );\n\t\t\t\t}\n\n\t\t\t\tif ( ! $featured_img ) {\n\t\t\t\t\tadd_filter( 'astra_get_option_blog-single-post-structure', array( $this, 'disable_featured_img' ) );\n\t\t\t\t}\n\n\t\t\t\tif ( ! $meta || ! $instructor ) {\n\t\t\t\t\tremove_action( 'lifterlms_single_course_after_summary', 'lifterlms_template_single_meta_wrapper_start', 5 );\n\t\t\t\t\tremove_action( 'lifterlms_single_course_after_summary', 'lifterlms_template_single_meta_wrapper_end', 50 );\n\t\t\t\t}\n\n\t\t\t\tif ( ! $instructor ) {\n\t\t\t\t\tremove_action( 'lifterlms_single_course_after_summary', 'lifterlms_template_course_author', 40 );\n\t\t\t\t}\n\n\t\t\t\tif ( ! $progress_bar ) {\n\t\t\t\t\tremove_action( 'lifterlms_single_course_after_summary', 'lifterlms_template_single_course_progress', 60 );\n\t\t\t\t}\n\n\t\t\t\tif ( ! $syllabus ) {\n\t\t\t\t\tremove_action( 'lifterlms_single_course_after_summary', 'lifterlms_template_single_syllabus', 90 );\n\t\t\t\t}\n\n\t\t\t\tif ( ! $meta ) {\n\t\t\t\t\tremove_action( 'lifterlms_single_course_after_summary', 'lifterlms_template_single_length', 10 );\n\t\t\t\t\tremove_action( 'lifterlms_single_course_after_summary', 'lifterlms_template_single_difficulty', 20 );\n\t\t\t\t\tremove_action( 'lifterlms_single_course_after_summary', 'lifterlms_template_single_course_tracks', 25 );\n\t\t\t\t\tremove_action( 'lifterlms_single_course_after_summary', 'lifterlms_template_single_course_categories', 30 );\n\t\t\t\t\tremove_action( 'lifterlms_single_course_after_summary', 'lifterlms_template_single_course_tags', 35 );\n\t\t\t\t}\n\n\t\t\t\tif ( is_course() && ! $description ) {\n\t\t\t\t\tadd_filter( 'the_excerpt', '__return_empty_string', 9 );\n\t\t\t\t\tadd_filter( 'the_content', '__return_empty_string', 9 );\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function sensei_can_user_view_lesson( $lesson_id = '', $user_id = '' ){\n\n if( empty( $lesson_id ) ){\n\n $lesson_id = get_the_ID();\n\n }\n\n if( empty( $user_id ) ){\n\n $user_id = get_current_user_id();\n\n }\n\n // Check for prerequisite lesson completions\n $pre_requisite_complete = WooThemes_Sensei_Lesson::is_prerequisite_complete( $lesson_id, $user_id );\n $lesson_course_id = get_post_meta( $lesson_id, '_lesson_course', true );\n $user_taking_course = WooThemes_Sensei_Utils::user_started_course( $lesson_course_id, $user_id );\n\n $is_preview = false;\n if( WooThemes_Sensei_Utils::is_preview_lesson( $lesson_id ) ) {\n\n $is_preview = true;\n $pre_requisite_complete = true;\n\n };\n\n\n $user_can_access_lesson = false;\n\n if( is_user_logged_in() && $user_taking_course ){\n\n $user_can_access_lesson = true;\n\n }\n\n\n $access_permission = false;\n\n if ( ! Sensei()->settings->get('access_permission') || sensei_all_access() ) {\n\n $access_permission = true;\n\n }\n\n $can_user_view_lesson = $access_permission || ( $user_can_access_lesson && $pre_requisite_complete ) || $is_preview;\n\n /**\n * Filter the can user view lesson function\n *\n * @since 1.9.0\n *\n * @hooked Sensei_WC::alter_can_user_view_lesson\n *\n * @param bool $can_user_view_lesson\n * @param string $lesson_id\n * @param string $user_id\n */\n return apply_filters( 'sensei_can_user_view_lesson', $can_user_view_lesson, $lesson_id, $user_id );\n\n}",
"public function llms_learning() {\n\n\t\t\tif ( is_singular( 'sfwd-courses' ) || is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-topic' ) || is_singular( 'sfwd-quiz' ) ) {\n\n\t\t\t\t$course_id = learndash_get_course_id();\n\t\t\t\t$user_id = get_current_user_id();\n\n\t\t\t\tif ( astra_get_option( 'learndash-distraction-free-learning' ) && sfwd_lms_has_access( $course_id, $user_id ) ) {\n\n\t\t\t\t\t// HFB Support for distration free checkout.\n\t\t\t\t\tif ( Astra_Addon_Builder_Helper::$is_header_footer_builder_active ) {\n\t\t\t\t\t\tremove_action( 'astra_header', array( Astra_Builder_Header::get_instance(), 'prepare_header_builder_markup' ) );\n\t\t\t\t\t\tremove_action( 'astra_footer', array( Astra_Builder_Footer::get_instance(), 'footer_markup' ), 10 );\n\t\t\t\t\t}\n\n\t\t\t\t\tremove_action( 'astra_header', 'astra_header_markup' );\n\t\t\t\t\tremove_action( 'astra_footer', 'astra_footer_markup' );\n\n\t\t\t\t\tadd_action( 'astra_header', array( $this, 'header_markup' ) );\n\t\t\t\t\tadd_action( 'astra_footer', array( $this, 'footer_markup' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function tutorials($location='blog',$title=\"introduction\",$page=\"1\")\n{\n // only capture the correct template and location name\n // need to abstract\n $this->_common($location,$title,$page,self::portal.'_view');\n}",
"function learndash_is_lesson_complete( $user_id = null, $lesson_id = 0, $course_id = 0 ) {\n\treturn ! learndash_is_lesson_notcomplete( $user_id, array( $lesson_id => 1 ), $course_id );\n}",
"function simplelesson_extend_navigation(navigation_node $navref, stdclass $course, stdclass $module, cm_info $cm) {\n\n\t$view_url = new moodle_url('/mod/simplelesson/view.php',array('id'=>$cm->id));\n\t$view_node = $navref->add(get_string('view'), $view_url);\n\t$config = get_config(MOD_SIMPLELESSON_FRANKY);\n\tif($config->enablereports){\n\t\t$report_url = new moodle_url('/mod/simplelesson/reports.php',array('id'=>$cm->id));\n\t\t$report_node = $navref->add(get_string('reports'),$report_url);\n\t}\n\n}",
"function lesson_came_from_workshop( $referer ) {\n return wporg_post_type_is_lesson() && strrpos( $referer, 'workshop' );\n}",
"public function decisionLearnerLesson()\r\n {\r\n $handler = ConnectionDatabase();\r\n\r\n // If the learner cancels the lesson\r\n // Delete all the lesson information from the lesson table in regards to the lesson\r\n // Delete all the schedule informaton from the schedule table in regards to the lesson\r\n // The schedule record of the canceled lesson will be reset to unavailable. \r\n // The teacher will thus have to update his schedule to re-allow lesson requests in the same time and date. \r\n if (isset($_POST['action']) && $_POST['action'] == 'Cancel') {\r\n $date = $_POST['lessonDate'];\r\n $teacher = $_POST['teacherId'];\r\n $lessonTime = $_POST['lessonTime'];\r\n $language = $_POST['language'];\r\n $status = $_POST['status'];\r\n\r\n $sqlDeleteLesson = \"DELETE FROM lesson\r\n WHERE client_id = :client_id AND teacher_id = :teacher_id AND lesson_start_time = :time_id AND date = :date AND language_id = :languagee AND status = :status\";\r\n $query = $handler->prepare($sqlDeleteLesson);\r\n $query->bindValue(':client_id', $_SESSION['person_id']);\r\n $query->bindValue(':teacher_id', $teacher);\r\n $query->bindValue(':time_id', $lessonTime);\r\n $query->bindValue(':date', $date);\r\n $query->bindValue(':languagee', $language);\r\n $query->bindValue(':status', $status);\r\n $query->execute();\r\n\r\n $sqlUpdateSchedule = \"DELETE FROM schedule\r\n WHERE person_id = :person_id AND time_id = :time_id AND date = :date\";\r\n $query = $handler->prepare($sqlUpdateSchedule);\r\n $query->bindValue(':person_id', $teacher);\r\n $query->bindValue(':time_id', $lessonTime);\r\n $query->bindValue(':date', $date);\r\n $query->execute();\r\n\r\n header('location:/MVC/account/myProfile');\r\n }\r\n }",
"function wplms_course_tabs_supports(){\n\t\tglobal $post;\n \t$layouts = array('c5','c4','c3','c2','c6');\n \t$layout = vibe_get_customizer('course_layout');\n \t$tab_style_course_layout = vibe_get_option('tab_style_course_layout');\n \t\n \tif(!empty($layout) && in_array($layout,$layouts) && !empty($tab_style_course_layout)){\n\n \t\t$this->wplms_course_tabs_tabs_array = apply_filters('course_tabs_array',array(\n \t\t\t'home' => _x('home','custom tabs for tabbed layout','vibe'),\n \t\t\t'curriculum' => _x('curriculum','custom tabs for tabbed layout','vibe')\n \t\t));\n\n\t\t\tif($post->comment_status == 'open'){\n\t\t\t\tif(!empty($this->wplms_course_tabs_tabs_array) && is_array($this->wplms_course_tabs_tabs_array))\n\t\t\t\t\t$this->wplms_course_tabs_tabs_array['reviews'] = _x('reviews','custom tabs for tabbed layout','vibe');\n\t\t\t}\n\n\t\t\tadd_filter('wplms_course_nav_menu',array($this,'wplms_course_tabs_link'),999);\n\t\t\tadd_filter('vibe_course_permalinks',array($this,'add_wplms_course_tabs_in_saved_permalinks'));\n\n\t\t\t\n\t\t\tif(class_exists('WPLMS_tips')){\n\t\t\t\t$tips = WPLMS_tips::init();\n\t\t\t\tremove_filter('wplms_course_nav_menu',array($tips,'coursenav_remove_curriculum'));\n\t\t\t\tremove_action('wplms_after_course_description',array($tips,'course_curriculum_below_description'));\n\t\t\t}\n\n\t\t\tadd_action('wplms_after_course_description',array($this,'course_curriculum_below_description_wplms_course_tabs'));\n\n\t\t\t//style and scripts for wplms_course_tabs\n\t\t\tadd_action('wp_footer',array($this,'wplms_wplms_course_tabs_stick_at_bottom'));\n\t\t\t\n\t\t}\n }",
"function languagelesson_unseen_question_jump($lesson, $user, $pageid) {\n global $DB;\n\n // Get the number of retakes.\n if (!$retakes = $DB->count_records(\"languagelesson_grades\", array(\"lessonid\"=>$lesson->id, \"userid\"=>$user))) {\n $retakes = 0;\n }\n\n // Get all the languagelesson_attempts aka what the user has seen.\n if ($viewedpages = $DB->get_records(\"languagelesson_attempts\", array(\"lessonid\"=>$lesson->id, \"userid\"=>$user, \"retry\"=>$retakes), \"timeseen DESC\")) {\n foreach ($viewedpages as $viewed) {\n $seenpages[] = $viewed->pageid;\n }\n } else {\n $seenpages = array();\n }\n\n // Get the lesson pages.\n $lessonpages = $lesson->load_all_pages();\n\n if ($pageid == LL_UNSEENBRANCHPAGE) { // This only happens when a student leaves in the middle of an unseen question within a branch series.\n $pageid = $seenpages[0]; // Just change the pageid to the last page viewed inside the branch table.\n }\n\n // Go up the pages till branch table.\n while ($pageid != 0) { // This condition should never be satisfied... only happens if there are no branch tables above this page.\n if ($lessonpages[$pageid]->qtype == LL_BRANCHTABLE) {\n break;\n }\n $pageid = $lessonpages[$pageid]->prevpageid;\n }\n\n $pagesinbranch = $lesson->get_sub_pages_of($pageid, array(LL_BRANCHTABLE, LL_ENDOFBRANCH));\n\n // This foreach loop stores all the pages that are within the branch table but are not in the $seenpages array.\n $unseen = array();\n foreach ($pagesinbranch as $page) {\n if (!in_array($page->id, $seenpages)) {\n $unseen[] = $page->id;\n }\n }\n\n if (count($unseen) == 0) {\n if (isset($pagesinbranch)) {\n $temp = end($pagesinbranch);\n $nextpage = $temp->nextpageid; // They have seen all the pages in the branch, so go to EOB/next branch table/EOL.\n } else {\n // There are no pages inside the branch, so return the next page.\n $nextpage = $lessonpages[$pageid]->nextpageid;\n }\n if ($nextpage == 0) {\n return LL_EOL;\n } else {\n return $nextpage;\n }\n } else {\n return $unseen[rand(0, count($unseen)-1)]; // Returns a random page id for the next page.\n }\n}",
"public function langsAction() {\n $this->_breadcrumbs->addStep($this->Translate('Языки интерфейса'));\n $this->view->message = $this->Translate('Раздел сайта находится в разработке').'!';\n $this->view->class_message = 'caution';\n }",
"function show_lesson_contents()\n\t{\n\t\tglobal $fc_db, $fc_db_struct, $lang, $template;\n\t\t\n# First of all we need to check variables same as build_questions()\n#################################\n# Set lesson to choose words from\n\t\tif ( isset( $_POST['lesson'] ) )\n\t\t{\n\t\t\t$lesson = $_POST['lesson'];\n\t\t}\n\t\telse\n\t\t{\n# FIXMELATER Should add correct exception here\n\t\t\techo '<h1>' . $lang['NO_LESSON_SELECTED'] . '</h1>';\n\t\t\tdie( '<script language=javascript>window.onload = setTimeout(function() { window.location=\"?mode=index\"; }, 1000);</script>' );\n\t\t}\n\t\t\n\t\tif ( is_array( $lesson ) )\n\t\t{\n\t\t\t$sql_select_lesson = ' AND (';\n\t\t\t\n\t\t\t$i = 0;\n\t\t\tforeach ( $lesson as $val )\n\t\t\t{\n\t\t\t\tif ( $i > 0 ) \n\t\t\t\t{\n\t\t\t\t\t$sql_select_lesson .= ' OR';\n\t\t\t\t}\n\t\t\t\t$sql_select_lesson .= ' l.`' . $fc_db_struct[FC_LESSONS_TABLE]['id'] . '` = \\'' . $val . '\\'';\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql_select_lesson .= ' )';\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$sql_select_lesson = ' AND l.`' . $fc_db_struct[FC_LESSONS_TABLE]['id'] . '` = \\'' . $lesson . '\\'';\n\t\t}\n###############################\n# Set part of speech if defined\n\t\t$sql_select_part_of_speech = '';\n\t\tif ( isset( $_POST['part_of_speech'] ) && is_array( $_POST['part_of_speech'] ) )\n\t\t{\n\t\t\t$part_of_speech = $_POST['part_of_speech'];\n\t\t\n\t\t\t$sql_select_part_of_speech .= ' AND (';\n\t\t\t\n\t\t\t$i = 0;\n\t\t\tforeach ( $part_of_speech as $val )\n\t\t\t{\n\t\t\t\tif ( $i > 0 ) \n\t\t\t\t{\n\t\t\t\t\t$sql_select_part_of_speech .= ' OR';\n\t\t\t\t}\n\t\t\t\t$sql_select_part_of_speech .= ' w.`' . $fc_db_struct[FC_WORDS_TABLE]['part_of_speech'] . '` = \\'' . mysql_escape_string( $val ) . '\\'';\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql_select_part_of_speech .= ' )';\n\t\t}\n\n#####################\n# Should switch on language for translation here\n\t\t$test_language = ( isset( $_POST['test_language'] ) ) ? mysql_escape_string( $_POST['test_language'] ) : $config_fc['test']['default_test_language'];\n\n\t\t$sql =\t'SELECT'\n\t\t\t.\t' w.`' . $fc_db_struct[FC_WORDS_TABLE]['id'] . '` AS id'\n\t\t\t.\t', w.`' . $fc_db_struct[FC_WORDS_TABLE]['heb'] . '` AS heb'\n\t\t\t.\t', GROUP_CONCAT( DISTINCT r.`' . $fc_db_struct[FC_WORDS_RUS_TABLE]['rus'] . '`'\n\t\t\t.\t' ORDER BY c.`' . $fc_db_struct[FC_HEB_RUS_TABLE]['priority'] . '` DESC SEPARATOR \\', \\' ) AS translation'\n\t\t\t.\t' FROM `' . FC_WORDS_TABLE . '` AS w'\n\t\t\t.\t' LEFT JOIN `' . FC_LESSONS_TABLE . '` AS l'\n\t\t\t.\t' ON l.`' . $fc_db_struct[FC_LESSONS_TABLE]['word_id'] . '` = w.`' . $fc_db_struct[FC_WORDS_TABLE]['id'] . '`'\n\t\t\t.\t' LEFT JOIN `' . FC_HEB_RUS_TABLE . '` AS c'\n\t\t\t.\t' ON c.`' . $fc_db_struct[FC_HEB_RUS_TABLE]['heb_id'] . '` = w.`' . $fc_db_struct[FC_WORDS_TABLE]['id'] . '`'\n\t\t\t.\t' LEFT JOIN `' . FC_WORDS_RUS_TABLE . '` AS r'\n\t\t\t.\t' ON r.`' . $fc_db_struct[FC_WORDS_RUS_TABLE]['id'] . '` = c.`' . $fc_db_struct[FC_HEB_RUS_TABLE]['rus_id'] . '`'\n\t\t\t.\t' WHERE 1'\n\t\t\t.\t$sql_select_lesson\n\t\t\t.\t$sql_select_part_of_speech\n\t\t\t.\t' GROUP BY w.`' . $fc_db_struct[FC_WORDS_TABLE]['id'] . '`'\n\t\t\t.\t' ORDER BY w.`' . $fc_db_struct[FC_WORDS_TABLE]['part_of_speech'] . '` DESC'\n\t\t\t.\t', w.`' . $fc_db_struct[FC_WORDS_TABLE]['heb'] . '`'\n\t\t\t.\t';';\n\n\t\tif ( $GLOBALS['debug_all'] == true ) echo '<br>' . $sql;\n\t\t$this->record_debug( 'Called show_contents() with SQL: ' . $sql );\n\n\t\t$result = $fc_db->query($sql);\n\n\t\t\n\t\tif ( mysql_num_rows( $result ) > 0 )\n\t\t{\n\t\t\t$template->assign_var( 'CURRENT_TEST_CONTENTS', $lang['CURRENT_TEST_CONTENTS'] );\n\t\t\t\n\t\t\t$i = 0;\n\t\t\twhile ( $row = $fc_db->fetch_assoc( $result ) ) \n\t\t\t{\n\t\t\t\t$i++;\n\t\t\t\t$current_bg_color = ( $i % 2 == 0 )\t? 'answer_tr_light' : 'answer_tr_dark';\n\t\t\t\t$template->assign_block_vars( 'test_contents', array(\n\t\t\t\t\t\t'HEBREW' => $row['heb'],\n\t\t\t\t\t\t'TRANSLATION' => $row['translation'],\n\t\t\t\t\t\t'TR_CLASS' => $current_bg_color,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# No words selected.\n\t\t}\n\t}",
"private function setSharedLessonMode($lesson) {\n $courseUsers = $this -> countCourseUsers(array('archive' => false));\n if ($courseUsers['count'] > 0) {\n throw new Exception(_YOUCANNOTCHANGEMODECOURSENOTEMPTY, EfrontCourseException::COURSE_NOT_EMPTY);\n }\n $this -> addLessons($lesson -> lesson['instance_source']);\n $this -> replaceLessonInCourseOrder($lesson, $lesson -> lesson['instance_source']);\n $this -> replaceLessonInCourseRules($lesson, $lesson -> lesson['instance_source']); //Must be put *before* removeLessons()\n //$this -> removeLessons($lesson);\t\t//commented out because it was messing up with order\n eF_deleteTableData(\"lessons_to_courses\", \"courses_ID=\".$this -> course['id'].\" and lessons_ID=\".$lesson->lesson['id']);\n }",
"public function siteLanguageMatchesCondition() : void {}",
"function learndash_can_complete_step( $user_id = 0, $step_id = 0, $course_id = 0 ) {\n\t$user_id = absint( $user_id );\n\tif ( empty( $user_id ) ) {\n\t\t$user_id = get_current_user_id();\n\t}\n\t$step_id = absint( $step_id );\n\t$course_id = absint( $course_id );\n\tif ( empty( $course_id ) ) {\n\t\t$course_id = learndash_get_course_id();\n\t}\n\n\tif ( ( ! empty( $user_id ) ) && ( ! empty( $step_id ) ) && ( ! empty( $course_id ) ) ) {\n\t\tif ( in_array( get_post_type( $step_id ), array( learndash_get_post_type_slug( 'lesson' ), learndash_get_post_type_slug( 'topic' ) ), true ) ) {\n\t\t\t$step_timer_time = learndash_forced_lesson_time( $step_id );\n\t\t\tif ( ! empty( $step_timer_time ) ) {\n\t\t\t\t$time_cookie_key = learndash_forced_lesson_time_cookie_key( $step_id );\n\t\t\t\tif ( ! empty( $time_cookie_key ) ) {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Note this is not a 100% check. We are only checking if the cookie\n\t\t\t\t\t * key exists and is zero. But this cookie could have been set from\n\t\t\t\t\t * external.\n\t\t\t\t\t */\n\t\t\t\t\tif ( ( ! isset( $_COOKIE[ 'learndash_timer_cookie_' . $time_cookie_key ] ) ) || ( '0' !== $_COOKIE[ 'learndash_timer_cookie_' . $time_cookie_key ] ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}",
"private static function hooks()\n\t{\n\t\t// check for shortcut in url\n\t\tEvent::add('system.post_routing', array('Webgrind_Hooks', 'detect_shortcut'));\n\t\t// hook for javascript redirect\n\t\tEvent::add('system.display', array('Webgrind_Hooks', 'webgrind_redirect'));\n\t\t// webgrind path constant\n\t\tdefine('WEBGRIND', url::site().str_replace(DOCROOT, '', MODPATH).'webgrind/');\n\t}",
"function learndash_course_navigation( $course_id, $widget_instance = array(), $lesson_query_args = array() ) {\n\t$course = get_post( $course_id );\n\t\n\tif ( empty( $course->ID ) || $course_id != $course->ID ) {\n\t\treturn;\n\t}\n\t\n\tif ( empty( $course->ID ) || $course->post_type != 'sfwd-courses' ) {\n\t\treturn;\n\t}\n\t\n\tif ( is_user_logged_in() )\n\t\t$user_id = get_current_user_id();\n\telse\n\t\t$user_id = 0;\n\t\t\n\t$course_navigation_widget_pager = array();\n\tglobal $course_navigation_widget_pager;\n\t\n\tadd_action( 'learndash_course_lessons_list_pager', function( $query_result = null ) {\n\t\tglobal $course_navigation_widget_pager;\n\n\t\t$course_navigation_widget_pager['paged'] = 1;\n\n\t\tif ( ( isset( $query_result->query_vars['paged'] ) ) && ( $query_result->query_vars['paged'] > 1 ) )\n\t\t\t$course_navigation_widget_pager['paged'] = $query_result->query_vars['paged'];\n\t\t\n\t\t$course_navigation_widget_pager['total_items'] = $query_result->found_posts;\n\t\t$course_navigation_widget_pager['total_pages'] = $query_result->max_num_pages;\n\t} );\n\t\n\t$lessons = learndash_get_course_lessons_list( $course, $user_id, $lesson_query_args );\n\t\n\t$template_file = SFWD_LMS::get_template( \n\t\t'course_navigation_widget', \n\t\tarray(\n\t\t\t'course_id' => $course_id, \n\t\t\t'course' => $course, \n\t\t\t'lessons' => $lessons,\n\t\t\t'widget' => $widget_instance\n\t\t), \n\t\tnull, \n\t\ttrue \n\t);\n\n\tif ( ! empty( $template_file ) ) {\n\t\tinclude( $template_file );\n\t}\n}",
"function showHeadline($lesson) {\n global $con;\n\n if ((int) $lesson <= 0) { // bad number or string\n showFrame(\"Položka <b>lesson</b> musí obsahovat <b>celé kladné číslo</b>.\", false);\n return false;\n }\n\n\n $resultSet = $con->query(\"SELECT name, public\n FROM lesson\n WHERE lessonid=$lesson\");\n\n if ($result = $resultSet->fetch_array()) {\n if ($result[\"public\"] || $_SESSION[\"isadmin\"]) { // lesson is public or user is admin\n $headline = $result[\"name\"];\n echo \"<h2>$headline</h2>\";\n return true;\n } else { // lesson is not public and user is not admin\n showFrame(\"Lekce <b>$lesson</b> není zveřejněná. Pokud tento stav přetrvá delší dobu, obraťte se na <b>administrátora</b>.\", false);\n return false;\n }\n } else { // lesson doesnt exists\n showFrame(\"Lekce <b>$lesson</b> neexistuje. Vyber lekci z levého menu.\", false);\n return false;\n }\n}",
"function adaptivequiz_extend_navigation(navigation_node $navref, stdclass $course, stdclass $module, cm_info $cm) {\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation sessionEventsAsync List all session events for the partner | public function sessionEventsAsync(
$partner_client_id,
$user_id = SENTINEL_VALUE,
$session_id = SENTINEL_VALUE,
string $contentType = self::contentTypes['sessionEvents'][0]
)
{
return $this->sessionEventsAsyncWithHttpInfo($partner_client_id, $user_id, $session_id, $contentType)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function getEventsBySessionId($sessionID) {\r\n if (!$sessionID) {\r\n return;\r\n }\r\n $sql = 'SELECT * FROM userEvents WHERE sessionID=?';\r\n $query = $this->conn->prepare($sql);\r\n $query->execute(array($sessionID));\r\n\r\n return $query->fetchAll();\r\n }",
"public function getUpcomingEventSessions()\n {\n // Obtain Child Event IDs:\n \n $eventIds = $this->getAllEvents()->column('ID');\n \n // Filter Event Sessions:\n \n $sessions = EventSession::get()->filter([\n 'EventID' => $eventIds ?: null,\n 'Disabled' => 0,\n 'Start:GreaterThanOrEqual' => date('Y-m-d')\n ]);\n \n // Answer List:\n \n return $sessions;\n }",
"public function getEvents();",
"public function listEvents()\n {\n $query = Core::query('campaign-events-list');\n $query->bindValue(':campaign', $this->_campaign['id']);\n $query->execute();\n return $query->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function findAllEvents() {\n\t\treturn $this->db->exec_SELECTgetRows('*', 'tx_cal_event', '');\n\t}",
"public function getAllSessions();",
"public function eventSubscriptionList(): array\n {\n return $this->exec('GET', 'event-subscriptions');\n }",
"public function fetchAllEvents();",
"public function getEvents()\n\t{\n\t\t$fetch = $this->getDb('tools')->fetchAll('SELECT * FROM smartai_events');\n\t\t$events = [];\n\t\tforeach($fetch as $event)\n\t\t\t$events[$event['id']] = $event;\n\t\treturn $events;\n\t}",
"public function getSessionAttendees($webinarKey, $sessionKey)\n\t{\n\t\treturn $this->sendRequest(\n\t\t\t'GET',\n\t\t\t'organizers/' . $this->getOrganizerKey() . '/webinars/' . $webinarKey . '/sessions/' . $sessionKey . '/attendees'\n\t\t);\n\t}",
"public function getEventsList() {\n return $this->eventsList;\n }",
"public function fetchEvents() \n {\n if(Auth::user()->isActivated() == false)\n return null;\n $partnerid = request()->partner_id;\n\n $start_date = date(\"Y-m-d\");\n $end_date = mktime(0, 0, 0, date('m'), date('d')+1, date('y'));\n //$events = EventModel::whereBetween('event_start', '=', array($start_date, $end_date))->get();\n $events = EventModel::where('partner_id', '=', $partnerid)\n ->orderBy('event_start', 'desc')\n ->get();\n return $events;\n }",
"public function Events() {\r\n if ($this->events === null) {\r\n $this->events = array();\r\n // Note: the alternative ext/events/summary/?action=get returns less\r\n // information about each event and requires both a section and term id,\r\n // so we don't use it here. The additional information it provides on numbers\r\n // accepted etc we can get if required.\r\n $apiEvents = $this->osm->PostAPI( \"events.php?action=getEvents§ionid={$this->id}\" );\r\n if ($apiEvents) foreach ($apiEvents->items as $apiEvent) {\r\n $event = new Event( $this, $apiEvent );\r\n $this->events[$event->id] = $event;\r\n }\r\n }\r\n return $this->events;\r\n }",
"public function allEvents(): array\n {\n return $this->events;\n }",
"public function events($account)\n {\n return $this->requestGet(\n sprintf('users/%s/events', $account)\n );\n }",
"public function getAllEvents()\n\t{\n\t\t// must be on Event model, we grab events corresponding to the current society\n\t\treturn Event::with('category')->where('society_id', '=', $this->attributes['id'])->orderBy('datetime', 'DESC')->get();\n\t}",
"function getAllLogEvents() {\n $sql = \"SELECT * FROM \\\"LogEvents\\\" ORDER BY \\\"ID\\\";\";\n return $this->getLogEventsImpl($sql);\n }",
"public function getAllEvents()\n\t{\n\t\treturn DB::table('events')\n\t\t\t\t\t->from(DB::raw('(SELECT * FROM events ORDER BY start_date DESC) AS ordered_events'))\n\t\t\t\t\t->whereNull('deleted_at')\n\t\t\t\t\t->where('visible', 1)\n\t\t\t\t\t->groupBy('name')\n\t\t\t\t\t->get();\n\t}",
"public function getListItems()\n {\n return $this->getCurrentEventSessions();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Migrate multiple fields required | public static function migrate_multiple_required_1_6( $field ) {
// migrate name required to multi
if ( "name" === $field['type'] ) {
$is_multi = isset( $field['multiple_name'] ) ? filter_var( $field['multiple_name'], FILTER_VALIDATE_BOOLEAN ) : false;
$is_old_required = isset( $field['required'] ) ? filter_var( $field['required'], FILTER_VALIDATE_BOOLEAN ) : false;
if ( $is_multi && $is_old_required ) {
$field['prefix_required'] = true;
$field['fname_required'] = true;
$field['mname_required'] = true;
$field['lname_required'] = true;
unset( $field['required'] );
}
}
// migrate address required to multi
if ( "address" === $field['type'] ) {
$is_old_required = isset( $field['required'] ) ? filter_var( $field['required'], FILTER_VALIDATE_BOOLEAN ) : false;
if ( $is_old_required ) {
$field['street_address_required'] = true;
$field['address_line_required'] = true;
$field['address_city_required'] = true;
$field['address_state_required'] = true;
$field['address_zip_required'] = true;
$field['address_country_required'] = true;
unset( $field['required'] );
}
}
return $field;
} | [
"protected function setRequiredFields()\n {\n $requiredFields = [\n 'amount',\n 'transaction_timestamp'\n ];\n\n $this->requiredFields = Common::createArrayObject($requiredFields);\n\n $requiredFieldsOr = [\n 'url',\n 'transaction_unique_id'\n ];\n\n $this->requiredFieldsOR = Common::createArrayObject($requiredFieldsOr);\n }",
"function setRequiredFields()\r\n {\r\n $args = func_get_args();\r\n\r\n foreach ($args as $a) {\r\n if (!empty($this->fields[$a])) {\r\n $this->fields[$a]['required'] = true;\r\n }\r\n }\r\n }",
"abstract protected function getRequiredFields();",
"protected function setRequiredFields()\n {\n $requiredFields = [\n 'transaction_unique_id'\n ];\n\n $this->requiredFields = \\Genesis\\Utils\\Common::createArrayObject($requiredFields);\n\n $requiredFieldsConditional = [\n 'status' => [\n TransactionStatuses::REJECTED => ['reason'],\n TransactionStatuses::DECLINED => ['reason'],\n TransactionStatuses::CHARGEBACK => ['reason'],\n TransactionStatuses::REFUND => ['reason'],\n TransactionStatuses::RETURN => ['reason'],\n TransactionStatuses::VOID => ['reason']\n ]\n ];\n\n $this->requiredFieldsConditional = \\Genesis\\Utils\\Common::createArrayObject($requiredFieldsConditional);\n }",
"private function recordAddFieldsMigrations()\n {\n if (count($this->add_fields)) {\n $migrator = new Migrator();\n $columns = [];\n\n foreach ($this->add_fields as $fname => $fdesc) {\n if (! empty($fdesc['type'])) {\n if ($control = Wizard::getAvailControl($fdesc['type'])) {\n if ($control instanceof \\Skvn\\CrudWizard\\Contracts\\WizardableField) {\n if (! $control->wizardIsForRelationOnly() && ! $control->wizardIsForVirtualOnly()) {\n $dbtype = $control->wizardDbType();\n if (! empty($dbtype)) {\n $columns[$fname] = $dbtype;\n }\n }\n }\n }\n }\n }\n\n if (count($columns)) {\n if ($migrator->appendColumns($this->table, $columns)) {\n $this->migrations_created = true;\n }\n }\n }\n }",
"protected function setRequiredFields()\n {\n $requiredFields = [\n 'reference_id',\n ];\n\n $this->requiredFields = Common::createArrayObject($requiredFields);\n }",
"private function createNewMigration() {\n // $this->MigrationFieldCollection[$this->getModel()->getShortModelName()];\n $changes = []; //these fields are added or updated if the fieldnames is not in this array delete it.\n foreach ($this->getModel()->getFieldCollection() as $fieldName => $field) {\n //var_dump($this->checkFieldProperties($field)); --mark if the fieldsproperties are default or not\n $this->checkFieldProperties($field);\n var_dump($field);\n\n if (!empty($this->MigrationFieldCollection[$this->getModel()->getShortModelName()][$fieldName])) {\n $reflection = new \\ReflectionObject($field);\n $changes = [];\n $this->checkFieldProperties($field);\n\n foreach ($reflection->getProperties() as $fieldValues) {\n\n }\n //we want to update this field\n } else {\n\n //copy this field since we create\n }\n }\n foreach ($this->MigrationFieldCollection[$this->getModel()->getShortModelName()] as $migrationFieldName => $migrationField) {\n if (!in_array($migrationFieldName, $changes)) {\n $this->newMigrationLines[] = $this->modelFieldToMigrationString($migrationField['dataStructure'], 'delete');\n }\n }\n }",
"function ed_make_donor_address_required( $fields ) {\n /**\n * These are the fields that we will make required. \n */\n $required_fields = array(\n 'address',\n // 'address_2',\n 'city',\n 'state',\n 'postcode',\n 'country',\n 'phone'\n );\n foreach ( $required_fields as $key ) {\n $fields[ $key ][ 'required' ] = true;\n }\n return $fields;\n}",
"public function testSafeFieldMultipleColumns()\n {\n $this->_populateTestData();\n $result = $this->_object->safeField('name,email', 'users', \"id=1\");\n\n $this->assertEquals('jansen', $result);\n }",
"protected function setRequiredFields()\n {\n $requiredFields = [\n 'transaction_id',\n 'card_type',\n 'redeem_type',\n 'amount',\n 'currency',\n 'card_holder',\n 'card_number',\n 'expiration_month',\n 'expiration_year'\n ];\n\n $this->requiredFields = \\Genesis\\Utils\\Common::createArrayObject($requiredFields);\n\n $requiredFieldValues = array_merge(\n [\n 'card_type' => CardTypes::getCardTypes(),\n 'redeem_type' => RedeemTypes::getRedeemTypes(),\n 'currency' => Currency::getList()\n ],\n $this->getCCFieldValueFormatValidators()\n );\n\n $this->requiredFieldValues = \\Genesis\\Utils\\Common::createArrayObject($requiredFieldValues);\n }",
"protected function setRequiredFields()\n {\n $requiredFields = [\n 'transaction_id',\n 'card_type',\n 'redeem_type',\n 'amount',\n 'currency',\n 'product_name',\n 'product_category',\n 'customer_name',\n 'customer_email',\n 'customer_phone',\n 'customer_id_number',\n 'customer_bank_id',\n 'bank_account_number'\n ];\n\n $this->requiredFields = \\Genesis\\Utils\\Common::createArrayObject($requiredFields);\n }",
"public function prepareFieldsFromTable()\n {\n foreach ($this->columns as $column) {\n $type = $column->getType()->getName();\n\n switch ($type) {\n case 'integer':\n $field = $this->generateIntFieldInput($column, 'integer');\n break;\n case 'smallint':\n $field = $this->generateIntFieldInput($column, 'smallInteger');\n break;\n case 'bigint':\n $field = $this->generateIntFieldInput($column, 'bigInteger');\n break;\n case 'boolean':\n $name = title_case(str_replace('_', ' ', $column->getName()));\n $field = $this->generateField($column, 'boolean', 'checkbox,1');\n break;\n case 'datetime':\n $field = $this->generateField($column, 'datetime', 'date');\n break;\n case 'datetimetz':\n $field = $this->generateField($column, 'dateTimeTz', 'date');\n break;\n case 'date':\n $field = $this->generateField($column, 'date', 'date');\n break;\n case 'time':\n $field = $this->generateField($column, 'time', 'text');\n break;\n case 'decimal':\n $field = $this->generateNumberInput($column, 'decimal');\n break;\n case 'float':\n $field = $this->generateNumberInput($column, 'float');\n break;\n case 'string':\n $field = $this->generateField($column, 'string', 'text');\n break;\n case 'text':\n $field = $this->generateField($column, 'text', 'textarea');\n break;\n default:\n $field = $this->generateField($column, 'string', 'text');\n break;\n }\n\n if (strtolower($field->name) == 'password') {\n $field->htmlType = 'password';\n } elseif (strtolower($field->name) == 'email') {\n $field->htmlType = 'email';\n } elseif (in_array($field->name, $this->timestamps)) {\n $field->isSearchable = false;\n $field->isFillable = false;\n $field->inForm = false;\n $field->inIndex = false;\n }\n\n $this->fields[] = $field;\n }\n }",
"public function getMutatedFields()\n {\n $fields = $this->getFields();\n\n foreach ($fields as $key => $field) {\n $field = (new FieldToArray)->update($field);\n\n //Remove required property and replace it with required only when type is selected\n if ( isset($field['required']) && $field['required'] === true ){\n unset($field['required']);\n\n $field['required_if'] = 'type,'.$this->getPrefix();\n }\n\n $fields[$key] = $field;\n }\n\n return $fields;\n }",
"private function fieldsToInsert ()\n {\n $to_insert = $this->_fields;\n foreach($this->table_desc as $field_name => $field_desc)\n {\n if($field_desc->isPrimary() && $this->hasAutoIncrement() && $this->isEmpty($this->$field_name))\n {\n unset($to_insert[$field_name]);\n }\n if($this->hasDefaultValue($field_name) && \n $this->isEmpty($this->$field_name) && \n in_array($field_name, array_keys($to_insert)))\n {\n unset($to_insert[$field_name]);\n }\n }\n return $to_insert;\n }",
"private function fillMandatoryFields()\n\t{\n\t\t$fields = $this->getFields();\n\n\t\tif (!isset($fields['CREATED_BY']))\n\t\t{\n\t\t\t$this->fields->setCreatedBy($fields['USER_ID']);\n\t\t}\n\n\t\tif (!isset($fields['SORT_INDEX']))\n\t\t{\n\t\t\t$facade = $this->facade;\n\t\t\t$items = $facade::getList(['ID', 'PARENT_ID', 'SORT_INDEX'], [$facade::$entityIdName => $fields['ENTITY_ID']]);\n\t\t\t$sortIndex = $this->getNextSortIndex($items);\n\n\t\t\t$this->fields->setSortIndex($sortIndex);\n\t\t}\n\n\t\tif ($fields['PARENT_ID'] === 0)\n\t\t{\n\t\t\t$this->fields->setAttachments([]);\n\t\t}\n\t}",
"protected function setRequiredFields()\n {\n $requiredFields = [\n 'email',\n 'redirect_url',\n 'document_supported_types',\n ];\n\n $this->requiredFields = Common::createArrayObject($requiredFields);\n }",
"public function validate_fields() {\n \n\t\t//...\n \n }",
"public function validate_fields() {\n \n\t\t\n \n\t\t}",
"public function generateFillableFromFields()\n {\n $this->fillable = $this->fields;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets as itemBidDetails This container provides information on each auction item that the user has placed a bid on during the last 30 days (or the number of days specified in the SummaryDays field). | public function getItemBidDetails()
{
return $this->itemBidDetails;
} | [
"public function setItemBidDetails(array $itemBidDetails)\n {\n $this->itemBidDetails = $itemBidDetails;\n return $this;\n }",
"public function getBiddingDetails()\n {\n return $this->biddingDetails;\n }",
"function getauctiondetails($item_id){\n\n $isauctionstring = sprintf(\n \"SELECT \n AI.itemID, \n AI.ItemTitle, \n CAST(AI.ItemDescription AS VARCHAR(1000)) Description,\n AI.ItemEndDate, \n MAX(B.BidValue) MaxBid,\n COUNT(B.BidValue) NoOfBids, \n AI.itemStartingPrice,\n AI.itemReservePrice,\n AI.sellerId\n FROM \n AuctionItems AI\n LEFT JOIN \n Bids B ON AI.itemID = B.itemID\n WHERE \n AI.itemID = %s\n GROUP BY \n AI.itemID, \n AI.sellerId, \n AI.ItemTitle, \n CAST(AI.ItemDescription AS VARCHAR(1000)), \n AI.ItemEndDate,\n AI.itemReservePrice, \n AI.itemStartingPrice;\", $item_id);\n global $conn;\n $listingResults= sqlsrv_query($conn, $isauctionstring);\n WHILE ($row = sqlsrv_fetch_array($listingResults)) {\n $auction = [\n \"title\" => $row['ItemTitle'],\n \"description\" => $row['Description'],\n \"current_price\" => $row['MaxBid'],\n \"num_bids\" => $row['NoOfBids'],\n \"end_time\" => $row['ItemEndDate'],\n \"starting_price\" => $row['itemStartingPrice'],\n \"reserve_price\" => $row['itemReservePrice'],\n \"seller_id\" => $row['sellerId']\n ];\n break;\n }\n sqlsrv_free_stmt($listingResults);\n return $auction;\n }",
"public function getBudgetDetails()\n {\n $activities = $this->all();\n $budgetDetails = $this->exchangeRateService->budgetDetails($activities);\n\n return $budgetDetails;\n }",
"public function getBid()\n {\n return $this->bid;\n }",
"public function getBid()\n {\n return $this->getAttribute()->getBid();\n }",
"function lastBid($auction_id = null) {\n\t\t\t// Use contain user only and get bid.auction_id instead of auction.id\n\t\t\t// cause it needs the auction included in result array\n\t\t\t$lastBid = $this->find('first', array('conditions' => array('Bid.auction_id' => $auction_id), 'order' => 'Bid.id DESC', 'contain' => array('User')));\n\t\t\t$bid = array();\n\n\t\t\tif(!empty($lastBid)) {\n\t\t\t\t$bid = array(\n\t\t\t\t\t'debit' => $lastBid['Bid']['debit'],\n\t\t\t\t\t'created' => $lastBid['Bid']['created'],\n\t\t\t\t\t'username' => $lastBid['User']['username'],\n\t\t\t\t\t'description' => $lastBid['Bid']['description'],\n\t\t\t\t\t'user_id' => $lastBid['User']['id'],\n\t\t\t\t\t'autobidder' => $lastBid['User']['autobidder']\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn $bid;\n\n }",
"public function actionBid() \n\t{\n\t\t// Validate that the logged in user can to place bids\n\t\t$visitor = XenForo_Visitor::getInstance();\n\t\tif ( ! $visitor->hasPermission('auctions', 'bidOnAuctions'))\n\t\t{\n\t\t\treturn $this->responseNoPermission();\n\t\t}\n\t\t\n\t\t// Parse user input\n\t\t$id \t\t\t= $this->_input->filterSingle('id', XenForo_Input::UINT);\n\t\t\n\t\t// Retrieve auction details from database\n\t\t$auctionModel\t= XenForo_Model::create('XenAuction_Model_Auction');\n\t\t$auction \t= $auctionModel->getAuctionById($id);\n\t\t\n\t\t// Validate that the user placing the bid is not also the auctioneer\n\t\tif ($auction['user_id'] == $visitor->user_id)\n\t\t{\n\t\t\treturn $this->responseError(new XenForo_Phrase('cant_buy_own_auction'));\n\t\t}\n\t\t\n\t\t// All done\n\t\treturn $this->responseView('XenAuction_ViewPublic_Auction_View', 'auction_bid', array(\n\t\t \t'auction'\t=> $auction\n\t\t));\t\n\t}",
"public function getBidGroupItem()\n {\n return $this->bidGroupItem;\n }",
"function reverse_can_bid($user_id, $item_details, $max_bid = 0)\n\t{\n\t\t$output = array('result' => false, 'display' => null, 'show_box' => false);\n\n\t\t$budget_details = $this->get_sql_row(\"SELECT * FROM\n\t\t\t\" . DB_PREFIX . \"reverse_budgets WHERE id='\" . $item_details['budget_id'] . \"'\");\n\t\t$is_bid = $this->count_rows('reverse_bids', \"WHERE reverse_id='\" . $item_details['reverse_id'] . \"' AND bidder_id='\" . $user_id . \"'\");\n\t\t\n\t\tif (!$user_id)\n\t\t{\n\t\t\t$output['display'] = '<p align=\"center\" class=\"contentfont\" style=\"color: red; font-weight: bold;\">' . MSG_CANTBID_LOGIN . '</p>'.\n\t\t\t\t'<div align=\"center\" class=\"contentfont\"><a href=\"login.php?redirect=reverse_details.php?reverse_id=' . $item_details['reverse_id'] . '\">' . MSG_LOGIN_TO_MEMBERS_AREA . '</a></div>';\n\n\t\t}\n\t\telse if ($item_details['closed'] == 1 || $item_details['end_time'] < CURRENT_TIME)\n\t\t{\n\t\t\t$output['display'] = MSG_CANTBID_BIDDING_CLOSED;\n\t\t}\n\t\telse if ($item_details['deleted'] == 1)\n\t\t{\n\t\t\t$output['display'] = MSG_NO_MORE_BIDDING;\n\t\t}\n\t\telse if (!empty($max_bid) && ($max_bid < 0 || $max_bid > $budget_details['value_to'] || $max_bid < $budget_details['value_from']))\n\t\t{\n\t\t\t$output['show_box'] = true;\n\t\t\t$output['display'] = MSG_BID_NOT_WITHIN_BUDGET;\n\t\t}\n\t\telse if ($is_bid)\n\t\t{\n\t\t\t$output['display'] = MSG_CANTBID_BID_EXISTS;\t\t\t\n\t\t}\n\t\telse if ($user_id == $item_details['owner_id'])\n\t\t{\n\t\t\t$output['show_box'] = true;\n\t\t\t$output['display'] = MSG_CANTBID_USER_OWNER;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output['show_box'] = true;\n\t\t\t$output['result'] = true;\n\t\t}\n\n\t\treturn $output;\n\t}",
"public function item_details($item_id)\n {\n $url = preg_replace('/set/i', 'item:' . $item_id, $this->public_url);\n return $this->curl($url)->item;\n }",
"public function getItemDetails()\n {\n \treturn $this->items;\n }",
"public function getoutboundhistoryofthisitem($item_id)\n\t{\n\t\t$outbounds=OutboundItemsHistory::model()->findAllByAttributes(array('main_item_id'=>$item_id));\n\t\treturn $outbounds;\n\n\t}",
"function getBidFullDetails($bid_id)\n\t\t{\n\t\t\t//get details of bid\n\t\t\t$bid_details = $this->manage_content->getValueMultipleCondtn(\"bid_info\",\"*\",array(\"bid_id\",\"status\"),array($bid_id,1));\n\t\t\tif(!empty($bid_details[0]))\n\t\t\t{\n\t\t\t\t//getting user details\n\t\t\t\t$userDetails = $this->manage_content->getValue_where(\"user_info\",\"*\",\"user_id\",$bid_details[0]['user_id']);\n\t\t\t\t//getting project details\n\t\t\t\t$project_details = $this->manage_content->getValue_where(\"project_info\",\"*\",\"project_id\",$bid_details[0]['project_id']);\n\t\t\t\t//getting award info\n\t\t\t\t$award_info = $this->manage_content->getValueMultipleCondtn('award_info', '*', array('project_id','bid_id'), array($bid_details[0]['project_id'],$bid_id));\n\t\t\t\t//getting profile pic\n\t\t\t\tif(!empty($userDetails[0]['pro_image']))\n\t\t\t\t{\n\t\t\t\t\t$pro_pic = $userDetails[0]['pro_image'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$pro_pic = 'img/dummy_profile.png';\n\t\t\t\t}\n\t\t\t\t//getting uploaded file\n\t\t\t\tif(!empty($bid_details[0]['file']))\n\t\t\t\t{\n\t\t\t\t\t$filename = '<a href=\"'.$bid_details[0]['file'].'\" target=\"_blank\">'.$bid_details[0]['original_file'].'</a>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$filename = 'No Files';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\techo '<div class=\"full_bid_outline\">\n\t\t\t\t\t\t<div class=\"col-md-2 post_bid_proposal_image_outline\">\n\t\t\t\t\t\t\t<img src=\"'.$pro_pic.'\" class=\"center-block\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-md-10 post_bid_proposal_outline\">\n\t\t\t\t\t\t\t<div class=\"project_description_title_text\"><a href=\"public-profile.php?uid='.$userDetails[0]['user_id'].'\">'.$userDetails[0]['name'].'</a></div>\n\t\t\t\t\t\t\t<p class=\"post_bid_project_description\">'.$bid_details[0]['description'].'</p>\n\t\t\t\t\t\t\t<p class=\"post_bid_info_outline\">\n\t\t\t\t\t\t\t\t<span class=\"post_bid_info_topic\">Skills:</span> '.$this->getSkillNameFromSkillIdAsString($userDetails[0]['skills']).'\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p class=\"post_bid_info_outline\">\n\t\t\t\t\t\t\t\t<span class=\"post_bid_info_topic\">Proposal Amount:</span> '.$bid_details[0]['currency'].$bid_details[0]['amount'].'\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p class=\"post_bid_info_outline\">\n\t\t\t\t\t\t\t\t<span class=\"post_bid_info_topic\">Time Frame:</span> '.$bid_details[0]['time_range'].'\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p class=\"post_bid_info_outline\">\n\t\t\t\t\t\t\t\t<span class=\"post_bid_info_topic\">Bid Posted On:</span> '.$bid_details[0]['date'].' | '.$bid_details[0]['time'].'\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p class=\"post_bid_info_outline\">\n\t\t\t\t\t\t\t\t<span class=\"post_bid_info_topic\">Uploaded File:</span> '.$filename.'\n\t\t\t\t\t\t\t</p>';\n\t\t\t\t\t\t\tif($project_details[0]['award_bid_id'] == $bid_details[0]['bid_id'] && $bid_details[0]['awarded'] != 0 && $award_info[0]['is_accepted'] == 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo '<p class=\"post_bid_info_outline\"><img src=\"img/award2.png\" alt=\"awarded\" /></p>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(empty($project_details[0]['award_bid_id']) && $bid_details[0]['awarded'] == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo '<div class=\"expand-bid pull-left\" id=\"award_bid\">\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"pull-right txt-14-1\">AWARD</p>\n\t\t\t\t\t\t\t\t\t\t\t<img src=\"img/award_icon.png\" alt=\"award_icon\" class=\"pull-right img-responsive inbox-icon-coustom\"/>\n\t\t\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\techo '</div>\n\t\t\t\t\t\t<div class=\"clearfix\"></div>\n\t\t\t\t\t</div>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<div class=\"profile_box_outline\">\n \t<div class=\"portfolio_details\">\n\t\t\t\t\t\t\t<div class=\"portfolio_part_heading\">No Bid Details Found</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>';\n\t\t\t}\n\t\t}",
"public function details()\n {\n return $this->join('item_detail', 'items.id', '=', 'item_detail.item_id')->where('')->get();\n }",
"public function getBidList()\n {\n return $this->bidList;\n }",
"public static function BidNow( $item, $bid ) {\n $item = self::_item($item);\n\n if (!$bid = toNum($bid)) return;\n\n $log = self::GroupLogFile($item.'.bidnow');\n\n // esniper config. file will be only as long as required on file system\n self::writeEsniperCfg();\n $cmd = array('Core::BidNow', Registry::get('bin_esniper'),\n esf_User::UserDir(), $item, $bid, $log);\n if (Exec::getInstance()->ExecuteCmd($cmd, $res, Registry::get('SuDo'))) {\n Messages::Error($res);\n } else {\n Messages::Success(Translation::get('Auction.AuctionBiddedNow', $item));\n // refresh auction data\n AuctionHTML::clearBuffer($item);\n $auction = self::fetchAuction($item, FALSE);\n self::$Auctions[$item] = $auction;\n self::Save($auction, FALSE);\n }\n self::removeEsniperCfg();\n }",
"public function biddings(): HasMany\n {\n return $this->hasMany(Bidding::class, 'item_id');\n }",
"public function getBidInfo($userid) {\n \n $connMgr = new ConnectionManager();\n $conn = $connMgr->getConnection();\n\n $sql = \"SELECT * \n FROM BID \n WHERE \n userid=:userid\n \";\n $stmt = $conn->prepare($sql);\n $stmt->bindParam(':userid',$userid,PDO::PARAM_STR);\n \n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n $status=$stmt->execute();\n if (!$status){ \n $err=$stmt->errorinfo();\n }\n $mod=[];\n while ($row=$stmt->fetch()){\n $mod[]=new Bid($row['userid'],$row['amount'],$row['code'],$row['section']); \n }\n \n $stmt = null;\n $conn = null;\n\n return $mod;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper to prepare a MosaicAttachment object out of any one of string, | protected function prepareAttachment($mosaic)
{
if ($mosaic instanceof MosaicAttachment) {
return $mosaic;
}
elseif ($mosaic instanceof MosaicAttachments) {
return $mosaic->shift();
}
elseif ($mosaic instanceof Mosaic) {
return new MosaicAttachment(["mosaicId" => $mosaic->toDTO()]);
}
elseif ($mosaic instanceof MosaicDefinition) {
return new MosaicAttachment(["mosaicId" => $mosaic->id()->toDTO()]);
}
elseif (is_string($mosaic)) {
return $this->prepareAttachment(Mosaic::create($mosaic));
}
throw new InvalidArgumentException("Unrecognized mosaic parameter type passed to \\NEM\\Models\\Transaction\\MosaicTransfer::attachMosaic().");
} | [
"public function create(array $input): Attachment;",
"public function fromString($string);",
"function buildAttach( $one , $boundary , $inline){\r\n\t\t$ret_boundary = null;\r\n\t\t$ret_header = array();\r\n\t\t$ret_content = null;\r\n\t\t$one = array_change_key_case( $one , CASE_UPPER);\r\n\t\tif( !isset($one['NAME'] )){\r\n\t\t\t$one['NAME'] = basename( $one['PATH'] );\r\n\t\t}\r\n\t\t//Content-Type\r\n\t\tif( isset( $one['CONTENT-TYPE'] )){\r\n\t\t\t$type = $one['CONTENT-TYPE'];\r\n\t\t}elseif( 0 != preg_match( '/\\.([^\\.]+)$/' , $one['NAME'] , $matches )){\r\n\t\t\t$type = isset( $this->attach_ctype[strtolower($matches[1])] ) \r\n\t\t\t\t? $this->attach_ctype[strtolower($matches[1])] : 'unkown';\r\n\t\t}elseif(0 != preg_match( '/\\.([^\\.]+)$/' , $one['PATH'] , $matches )){\r\n\t\t\t$type = isset( $this->attach_ctype[strtolower($matches[1])])\r\n\t\t\t\t? $this->attach_ctype[strtolower($matches[1])] : 'unkown';\r\n\r\n\t\t\tif( $this->auto_ext && 'unkown' != $type ){\r\n\t\t\t\t$one['NAME'] .= '.'.$matches[1];\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t$type = 'unkown';\r\n\t\t}\r\n\r\n\t\tif( isset( $one['_CHARSET'] ) ){\r\n\t\t\t$charset = $one['_CHARSET'];\r\n\t\t}else{\r\n\t\t\t$charset = $this->charset_attach_filename;\r\n\t\t}\r\n\t\tif( isset( $one['_ORG_CHARSET'] ) ){\r\n\t\t\t$org_charset = $one['_ORG_CHARSET'];\r\n\t\t}else{\r\n\t\t\t$org_charset = null;\r\n\t\t}\r\n\r\n\t\t$filename = $this->mimeEncode( $one['NAME'] , $charset , $org_charset , 20 );\r\n\r\n\t\t//is Inline ?\r\n\t\tif( $inline ){\r\n\t\t\t$id = $this->content_id_fix ? $one['CONTENT-ID']:$this->makeContentId($one['CONTENT-ID']);\r\n\t\t\t$content_id = '<' . $id . '>' ;\r\n\t\t\t$content_disposition = 'inline';//attachment for au?\r\n\t\t}else{\r\n\t\t\t$content_id = null ;\r\n\t\t\t$content_disposition = 'attachment';\r\n\t\t}\r\n\r\n\t\t// do it need Disposition Heaer ?\r\n\t\tif( isset( $this->deco_kind ) && false===$this->deco_def[$this->deco_kind]['DISPOSITION']){\r\n\t\t\t$disposition = null;\r\n\t\t}else{\r\n\t\t\t$disposition = $content_disposition.';'.$this->LFC\r\n\t\t\t\t.' filename=\"'.$filename.'\"'\r\n\t\t\t;\r\n\t\t}\r\n\t\t\t$ret_boundary = '--'.$boundary ; \r\n\t\t\t$ret_header['Content-Type'] = $type.'; name=\"'.$filename.'\"'\r\n\t\t\t;\r\n\t\t\t$ret_header['Content-Transfer-Encoding'] = 'base64' ;\r\n\t\t\t$ret_header['Content-Id'] = isset($content_id) ? trim( $content_id ) : null ;\r\n\t\t\tif(!empty($disposition)){\r\n\t\t\t\t$ret_header['Content-Disposition'] = $disposition;\r\n\t\t\t}\r\n\t\tif( !empty( $one['DIRECT'] ) ){\r\n\t\t\t$cont=$one['DATA'];\r\n\t\t}else{\r\n\t\t\t$path_filename = $this->attachPathFix( $one['PATH'] );\r\n\t\t\tif( !file_exists ( $path_filename )){\r\n\t\t\t\t$this->error[]='No attach file \\''.$path_filename.'\\' line->'.__LINE__;\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t$cont=file_get_contents( $path_filename );\r\n\t\t\t}\r\n\t\t}\r\n\t\tif( isset( $one['BARE'] ) && true === $one['BARE'] ){\r\n\t\t\t$ret_content = $one['DATA'];\r\n\t\t}else{\r\n\t\t\t$ret_content = trim(chunk_split(base64_encode($cont)));\r\n\t\t}\r\n\t\t$this->attach_already_build = true;\r\n\t\treturn array(\r\n\t\t\t'BOUNDARY' =>$ret_boundary ,\r\n\t\t\t'HEADER' =>$ret_header ,\r\n\t\t\t'CONTENT' =>$ret_content\r\n\t\t);\r\n\r\n\t}",
"public static function fromString($string)\n {\n //TODO: Parse URL and populate the asset\n }",
"public function testAddStringAttachment()\n {\n $contents = file_get_contents( dirname( __FILE__) . \"/parts/data/fly.jpg\" );\n $this->mail->from = new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' );\n $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );\n $this->mail->subject = \"HTML message with embeded files and images.\";\n $this->mail->plainText = \"Naked people with extra parts! The things folk do for fashion!!\";\n $this->mail->addStringAttachment( \"fly.jpg\", $contents );\n $this->mail->build();\n\n $this->parseAndCheckParts( $this->mail->generate(), array( 'ezcMailText', 'ezcMailFile' ) );\n }",
"public static function fromString($string);",
"private function parseAttachmentMessage(array $content)\n {\n $this->message->setType(self::ATTACHMENT);\n $this->message->setAttachment($content['message']['attachments'][0]['payload']['url']);\n $this->message->setSeq($content['message']['seq']);\n }",
"private static function parseMimeType($str) {\n\n $parameters = [];\n // If no q= parameter appears, then quality = 1.\n $quality = 1;\n\n $parts = explode(';', $str);\n\n // The first part is the mime-type.\n $mimeType = array_shift($parts);\n\n $mimeType = explode('/', trim($mimeType));\n if (count($mimeType)!==2) {\n // Illegal value\n return null;\n }\n list($type, $subType) = $mimeType;\n\n foreach($parts as $part) {\n\n $part = trim($part);\n if (strpos($part, '=')) {\n list($partName, $partValue) =\n explode('=', $part, 2);\n } else {\n $partName = $part;\n $partValue = null;\n }\n\n // The quality parameter, if it appears, also marks the end of\n // the parameter list. Anything after the q= counts as an\n // 'accept extension' and could introduce new semantics in\n // content-negotation.\n if ($partName!=='q') {\n $parameters[$partName] = $part;\n } else {\n $quality = (float)$partValue;\n break; // Stop parsing parts\n }\n\n }\n\n return [\n 'type' => $type,\n 'subType' => $subType,\n 'quality' => $quality,\n 'parameters' => $parameters,\n ];\n\n }",
"public static function fromString($documentString)\n {\n $document = new MimeDocument($documentString);\n\n $lines = explode(\"\\n\", $documentString);\n\n $boundary = false;\n\n $nextPartLines = [];\n\n $firstBoundaryFound = false;\n $mimeMessage = \"\";\n\n foreach ($lines as $line) {\n $line = trim($line);\n\n if (!$boundary) {\n if (preg_match(\"/Content-Type: (multipart\\/.+);\\s+boundary=\\\"?([^\\\"]+)\\\"?/i\", $line, $match)) {\n $document->boundary = $match[2];\n $document->setContentType($match[1]);\n $boundary = $match[2];\n continue;\n }\n } else {\n if ($line == \"--\" . $boundary . \"--\") {\n $part = MimePart::fromLines($nextPartLines);\n $document->addPart($part);\n break;\n }\n\n if ($line == \"--\" . $boundary) {\n if (!$firstBoundaryFound) {\n $firstBoundaryFound = true;\n } else {\n $part = MimePart::fromLines($nextPartLines);\n $document->addPart($part);\n $nextPartLines = [];\n }\n } else {\n if ($firstBoundaryFound) {\n $nextPartLines[] = $line;\n } else {\n $mimeMessage .= $line . \"\\r\\n\";\n }\n }\n }\n }\n\n $document->setMessage(trim($mimeMessage));\n\n return $document;\n }",
"protected function prepareAttachments() {\n $mime = '';\n $part = 1;\n // embedded attachments\n foreach($this->attach as $media) {\n $media['name'] = str_replace(':', '_', cleanID($media['name'], true));\n\n // create content id\n $cid = 'part'.$part.'.'.$this->partid;\n\n // replace wildcards\n if($media['embed']) {\n $this->html = str_replace('%%'.$media['embed'].'%%', 'cid:'.$cid, $this->html);\n }\n\n $mime .= '--'.$this->boundary.MAILHEADER_EOL;\n $mime .= $this->wrappedHeaderLine('Content-Type', $media['mime'].'; id=\"'.$cid.'\"');\n $mime .= $this->wrappedHeaderLine('Content-Transfer-Encoding', 'base64');\n $mime .= $this->wrappedHeaderLine('Content-ID',\"<$cid>\");\n if($media['embed']) {\n $mime .= $this->wrappedHeaderLine('Content-Disposition', 'inline; filename='.$media['name']);\n } else {\n $mime .= $this->wrappedHeaderLine('Content-Disposition', 'attachment; filename='.$media['name']);\n }\n $mime .= MAILHEADER_EOL; //end of headers\n $mime .= chunk_split(base64_encode($media['data']), 74, MAILHEADER_EOL);\n\n $part++;\n }\n return $mime;\n }",
"public static function string( $string, $type = null ) \n\t{\n\t\t$image = imagecreatefromstring( $string );\n\n\t\tif ( $image !== false ) \n\t\t{\n\t\t\treturn new static( $image, $type );\n\t\t}\n\n\t\treturn false;\n\t}",
"public function testMailAttachmentParse()\n {\n $raw = \"UmV0dXJuLVBhdGg6IDxzdXBwb3J0QGNvbW9kby5jb20+ClgtT3JpZ2luYWwtVG86IHNzbEB0ZXN0LmRlCkRlbGl2ZXJlZC1UbzogY2Rzc2xAaG9zdDJjMS50ZXN0LmRlClJlY2VpdmVkOiBmcm9tIG14cDAubmljZ2F0ZS5jb20gKG14cDAubmljZ2F0ZS5jb20gWzE4OC40MC42OS43Nl0pCiAgICBieSBob3N0MmMxLnRlc3QuZGUgKFBvc3RmaXgpIHdpdGggRVNNVFBTIGlkIEREMjA5MkIzCiAgICBmb3IgPHNzbEB0ZXN0LmRlPjsgTW9uLCAgNyBKdWwgMjAxNCAxMjozMjozOSArMDIwMCAoQ0VTVCkKUmVjZWl2ZWQ6IGZyb20gbWNtYWlsMi5tY3IuY29sby5jb21vZG8ubmV0IChtY21haWwyLm1jci5jb2xvLmNvbW9kby5uZXQgW0lQdjY6MmEwMjoxNzg4OjQwMjoxYzg4OjpjMGE4Ojg4Y2NdKQogICAgYnkgbXhwMC5uaWNnYXRlLmNvbSAoUG9zdGZpeCkgd2l0aCBFU01UUFMgaWQgNEY5QjNFMjgwMEQKICAgIGZvciA8c3NsQHRlc3QuZGU+OyBNb24sICA3IEp1bCAyMDE0IDEyOjMyOjMwICswMjAwIChDRVNUKQpSZWNlaXZlZDogKHFtYWlsIDExMTYyIGludm9rZWQgYnkgdWlkIDEwMDgpOyA3IEp1bCAyMDE0IDEwOjMyOjMwIC0wMDAwClJlY2VpdmVkOiBmcm9tIG9yYWNsZW9uZV9tY3IubWNyLmNvbG8uY29tb2RvLm5ldCAoSEVMTyBtYWlsLmNvbG8uY29tb2RvLm5ldCkgKDE5Mi4xNjguMTI4LjIxKQogICAgYnkgbWNtYWlsMi5tY3IuY29sby5jb21vZG8ubmV0IChxcHNtdHBkLzAuODQpIHdpdGggU01UUDsgTW9uLCAwNyBKdWwgMjAxNCAxMTozMjozMCArMDEwMApTdWJqZWN0OiBPUkRFUiAjMTQ3NjU2MDIgLSBZb3VyIFBvc2l0aXZlU1NMIENlcnRpZmljYXRlIGZvciBmaW5hbHRlc3QudG9iaWFzLW5pdHNjaGUuZGUKRnJvbTogIkNvbW9kbyBTZWN1cml0eSBTZXJ2aWNlcyIgPG5vcmVwbHlfc3VwcG9ydEBjb21vZG8uY29tPgpUbzogInNzbEB0ZXN0LmRlIiA8c3NsQHRlc3QuZGU+CkRhdGU6IE1vbiwgMDcgSnVsIDIwMTQgMTA6MzI6MjAgKzAwMDAKTUlNRS1WZXJzaW9uOiAxLjAKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogN2JpdApDb250ZW50LVR5cGU6IG11bHRpcGFydC9taXhlZDsgYm91bmRhcnk9IihBbHRlcm5hdGl2ZUJvdW5kYXJ5MikiCk1lc3NhZ2UtSUQ6IDxJbkdKYlNKK0h2QUFpTUhjN1MxVTJRQG1jbWFpbDIubWNyLmNvbG8uY29tb2RvLm5ldD4KWC1Qcm94eS1NYWlsU2Nhbm5lci1JbmZvcm1hdGlvbjogUGxlYXNlIGNvbnRhY3QgdGhlIElTUCBmb3IgbW9yZSBpbmZvcm1hdGlvbgpYLVByb3h5LU1haWxTY2FubmVyLUlEOiA0RjlCM0UyODAwRC5BMDM1MgpYLVByb3h5LU1haWxTY2FubmVyOiBGb3VuZCB0byBiZSBjbGVhbgpYLVByb3h5LU1haWxTY2FubmVyLVNwYW1DaGVjazogbm90IHNwYW0sIFNwYW1Bc3Nhc3NpbiAobm90IGNhY2hlZCwgc2NvcmU9MSwKICAgIHJlcXVpcmVkIDUuNzUsIGF1dG9sZWFybj1kaXNhYmxlZCwgREVBUl9FTUFJTCAxLjAwLAogICAgSFRNTF9NRVNTQUdFIDAuMDAsIFNQRl9IRUxPX1BBU1MgLTAuMDApClgtUHJveHktTWFpbFNjYW5uZXItU3BhbVNjb3JlOiAxClgtUHJveHktTWFpbFNjYW5uZXItRnJvbTogc3VwcG9ydEBjb21vZG8uY29tClgtUHJveHktTWFpbFNjYW5uZXItVG86IHNzbEB0ZXN0LmRlClgtU3BhbS1TdGF0dXM6IE5vCgotLShBbHRlcm5hdGl2ZUJvdW5kYXJ5MikKQ29udGVudC1UeXBlOiBtdWx0aXBhcnQvYWx0ZXJuYXRpdmU7IGJvdW5kYXJ5PSIoQWx0ZXJuYXRpdmVCb3VuZGFyeSkiCgotLShBbHRlcm5hdGl2ZUJvdW5kYXJ5KQpDb250ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9VVRGLTgKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogOGJpdAoKdGVzdAoKLS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZTekNDQkRPZ0F3SUJBZ0lRS0lXTnpIYTFVNUFDUkJIY0dBNGdLVEFOQmdrcWhraUc5dzBCQVFVRkFEQnoKTVFzd0NRWURWUVFHRXdKSFFqRWJNQmtHQTFVRUNCTVNSM0psWVhSbGNpQk5ZVzVqYUdWemRHVnlNUkF3RGdZRApWUVFIRXdkVFlXeG1iM0prTVJvd0dBWURWUVFLRXhGRFQwMVBSRThnUTBFZ1RHbHRhWFJsWkRFWk1CY0dBMVVFCkF4TVFVRzl6YVhScGRtVlRVMHdnUTBFZ01qQWVGdzB4TkRBM01EY3dNREF3TURCYUZ3MHhOVEEzTURjeU16VTUKTlRsYU1JR0VNU0V3SHdZRFZRUUxFeGhFYjIxaGFXNGdRMjl1ZEhKdmJDQldZV3hwWkdGMFpXUXhJekFoQmdOVgpCQXNUR2todmMzUmxaQ0JpZVNCRGFHVmphMlJ2YldGcGJpQkhiV0pJTVJRd0VnWURWUVFMRXd0UWIzTnBkR2wyClpWTlRUREVrTUNJR0ExVUVBeE1iWm1sdVlXeDBaWE4wTG5SdlltbGhjeTF1YVhSelkyaGxMbVJsTUlJQklqQU4KQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBMzNWTVpnd2ZOc0hoOHZlZTBkdWNoVUhsQ3drWApTcGd0VW9iVFFCZ2dEbk1HNlVUbEltcEFVVWNORzlYbWZHVlVFdE15UXd4bCthc0VkaFpoYnF1VVdqcmdNV2FlCitWZlFtN3kwQlVNNWxFRlpOdTVkWjVJblRVa2hQOHZDQnJGUVVoSGQwU1FuNjdTUWFscVJVZFNOVjBCRDBjWUYKbTJHZmtyUlZyWWNjai9JOFIxOVV6eDlNNXZwNGY4Tmw0YytuVTJzVTVLSkFZQ2JJdFBDY0lDVENaQzdQNmJ6TwprenArb1ZpbmVmeVVZcGRXMFVhd21vWmVsV2R4cllNaUZjYW5oZTZFQnI0WUg4Ny9CWWVReUcxZHJhMkhiMFdTCmpoNGxOMUFpZXRwK0E2S0I1ZHJPM1JQaGRDcHhFd2N6TGMyczFVZTl4dmdNdnd6NzM3OHpYSWNxbHdJREFRQUIKbzRJQnh6Q0NBY013SHdZRFZSMGpCQmd3Rm9BVW1lUkFYMnNVWGo0RjJkM1RZMVQ4WXJqM0FLd3dIUVlEVlIwTwpCQllFRkd1SzQ3blFNTFdNdmFOVDlvRjNzeFJObCtzck1BNEdBMVVkRHdFQi93UUVBd0lGb0RBTUJnTlZIUk1CCkFmOEVBakFBTUIwR0ExVWRKUVFXTUJRR0NDc0dBUVVGQndNQkJnZ3JCZ0VGQlFjREFqQlFCZ05WSFNBRVNUQkgKTURzR0N5c0dBUVFCc2pFQkFnSUhNQ3d3S2dZSUt3WUJCUVVIQWdFV0htaDBkSEE2THk5M2QzY3VjRzl6YVhScApkbVZ6YzJ3dVkyOXRMME5RVXpBSUJnWm5nUXdCQWdFd093WURWUjBmQkRRd01qQXdvQzZnTElZcWFIUjBjRG92CkwyTnliQzVqYjIxdlpHOWpZUzVqYjIwdlVHOXphWFJwZG1WVFUweERRVEl1WTNKc01Hd0dDQ3NHQVFVRkJ3RUIKQkdBd1hqQTJCZ2dyQmdFRkJRY3dBb1lxYUhSMGNEb3ZMMk55ZEM1amIyMXZaRzlqWVM1amIyMHZVRzl6YVhScApkbVZUVTB4RFFUSXVZM0owTUNRR0NDc0dBUVVGQnpBQmhoaG9kSFJ3T2k4dmIyTnpjQzVqYjIxdlpHOWpZUzVqCmIyMHdSd1lEVlIwUkJFQXdQb0liWm1sdVlXeDBaWE4wTG5SdlltbGhjeTF1YVhSelkyaGxMbVJsZ2g5M2QzY3UKWm1sdVlXeDBaWE4wTG5SdlltbGhjeTF1YVhSelkyaGxMbVJsTUEwR0NTcUdTSWIzRFFFQkJRVUFBNElCQVFDbwpPL1B5cDJHTHdmWDBlbmxnVnJyVVZUYmh2NVBQV1pBajQ2Z3pidVhVYUY5a2hMNy9DQ1VJZEc3ekdvdGlDWlVZCklDOUJrYkc2S0MrWEpWdGgzam50a2JNN0ZaQzFCUHk5Q3VtSmNpWlVHdUJzem12c1k4N1VVL2FVZ0t2SlpOaVoKZGwxMW92dnBUQTJEdW5ISmtyOXF0eStFQkMyTHY4aFNwTHZlMS9KVFlwYXBqZTRSeXlrcjFYY0phaGRnOEtjOQpXN1U0SmY0aWNoV2lQTWFoSnBnZ0NrVGE0eGYybnFXdTMvVG1jeThFbjNnVWZZNEZzRTg5eWJmVDZzT0J0SVdUCnNma3BpUm5vL1FWUTBQZW4yTCtzVGFCZVZ5YmswN0IrRGdMRWxGUmxuS2NDWFBzUU9vVVdlcHJ3VkNVa1E2VE4KNFNscmRxOHY5T2lkUzg2Z01CRU4KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQoKLS0oQWx0ZXJuYXRpdmVCb3VuZGFyeSkKQ29udGVudC1UeXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9SVNPLTg4NTktMQpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiA3Yml0Cgo8aHRtbD4KPGhlYWQ+Cgo8L2hlYWQ+Cjxib2R5Pgp0ZXN0CjwvYm9keT4KPC9odG1sPgoKLS0oQWx0ZXJuYXRpdmVCb3VuZGFyeSktLQoKLS0oQWx0ZXJuYXRpdmVCb3VuZGFyeTIpCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24veC16aXAtY29tcHJlc3NlZDsgbmFtZT0iZmluYWx0ZXN0X3RvYmlhcy1uaXRzY2hlX2RlLnppcCIKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogYmFzZTY0CkNvbnRlbnQtRGlzcG9zaXRpb246IGF0dGFjaG1lbnQ7IGZpbGVuYW1lPSJmaW5hbHRlc3RfdG9iaWFzLW5pdHNjaGVfZGUuemlwIgoKVUVzREJBb0FBQUFBQUFBQVVFQ1JJcVYrM1FZQUFOMEdBQUFsQUFBQVptbHVZV3gwWlhOMFgzUnZZbWxoY3kxdQphWFJ6WTJobFgyUmxMbU5oTFdKMWJtUnNaUzB0TFMwdFFrVkhTVTRnUTBWU1ZFbEdTVU5CVkVVdExTMHRMUXBOClNVbEZOVlJEUTBFNE1tZEJkMGxDUVdkSlVVSXlPRk5TYjBaR2JrTnFWbE5PWVZoNFFUUkJSM3BCVGtKbmEzRm8KYTJsSE9YY3dRa0ZSVlVaQlJFSjJDazFSYzNkRFVWbEVWbEZSUjBWM1NsUlNWRVZWVFVKSlIwRXhWVVZEYUUxTQpVVmRTYTFaSVNqRmpNMUZuVVZWSmVFcHFRV3RDWjA1V1FrRnpWRWhWUm1zS1drWlNlV1JZVGpCSlJWWTBaRWRXCmVXSnRSbk5KUmxKVlZVTkNUMXBZVWpOaU0wcHlUVk5KZDBsQldVUldVVkZFUlhoc1FscEhVbFZqYmxaNlpFTkMKUmdwbFNGSnNZMjAxYUdKRFFrUlJVMEpUWWpJNU1FMUNORmhFVkVWNVRVUkplRTVxUVhkTlJFRjNUVVp2V0VSVQpTWGROUkZWNlRVUkZkMDVFWjNwUFJtOTNDbU42UlV4TlFXdEhRVEZWUlVKb1RVTlNNRWw0UjNwQldrSm5UbFpDClFXZFVSV3RrZVZwWFJqQmFXRWxuVkZkR2RWa3lhR3hqTTFKc1kycEZVVTFCTkVjS1FURlZSVUo0VFVoVk1rWnoKV20wNWVWcEVSV0ZOUW1kSFFURlZSVU5vVFZKUk1EbE9WREJTVUVsRlRrSkpSWGh3WWxkc01GcFhVWGhIVkVGWQpRbWRPVmdwQ1FVMVVSVVpDZG1NeWJEQmhXRnBzVlRGT1RVbEZUa0pKUkVsM1oyZEZhVTFCTUVkRFUzRkhVMGxpCk0wUlJSVUpCVVZWQlFUUkpRa1IzUVhkblowVkxDa0Z2U1VKQlVVUnZObXB1YWtseFlYRjFZMUZCTUU5bGNWcDYKZEVSQ056RlFhM1YxT0hablIycFJTek5uTnpCUmIzUmtRVFoyYjBKVlJqUldObUUwVW5NS1RtcGliRzk1VkdrdgphV2RDYTB4NldETlJLelZMTURWSlpIZFdjSEk1TlZoTlRFaHZLM2h2UkRscWVHSlZlRFpvUVZWc2IyTnVVRmROCmVYUkVjVlJqZVFwVlp5dDFTakZaZUUxSFEzUjVZakY2VEVSdWRXdE9hREZ6UTFWb1dVaHpjV1ozVERsbmIxVm0KWkVVclUwNUlUbU5JVVVObmMwMUVjVzFQU3l0QlVsSlpDa1o1WjJscGJtUmtWVU5ZVG0xdGVXMDFVWHBzY1hscQpSSE5wUTBvNFFXTnJTSEJZUTB4elJHdzJaWG95VUZKSlNGTkVNMU4zZVU1WFVXVjZWRE42Vmt3S2VVOW1NbWhuClZsTkZSVTloYWtKa09HazJjVGhsVDBSM1VsUjFjMmRHV0N0TFNsQm9RMmhHYnpsR1NsaGlMelZKUXpGMFpFZHQKY0c1ak5XMURkRW8xUkFwWlJEZElWM2x2VTJKb2NuVjVlbTExZDNwWFpIRk1lR1J6UXk5RVFXZE5Ra0ZCUjJwbgpaMFl6VFVsSlFtTjZRV1pDWjA1V1NGTk5SVWRFUVZkblFsTjBDblphYURaT1RGRnRPUzl5UlVwc1ZIWkJOek5uClNrMTBWVWRxUVdSQ1owNVdTRkUwUlVablVWVnRaVkpCV0RKelZWaHFORVl5WkROVVdURlVPRmx5YWpNS1FVdDMKZDBSbldVUldVakJRUVZGSUwwSkJVVVJCWjBWSFRVSkpSMEV4VldSRmQwVkNMM2RSU1UxQldVSkJaamhEUVZGQgpkMFZSV1VSV1VqQm5Ra0Z2ZHdwRFJFRkhRbWRTVmtoVFFVRk5SVkZIUVRGVlpFaDNVVGxOUkhOM1QyRkJNMjlFClYwZE5NbWd3WkVoQk5reDVPV3BqYlhkMVpGaE9iR051VW5sa1dFNHdDa3h0VG5aaVV6bENXa2RTVldOdVZucGsKUlZZMFpFZFdlV0p0Um5OUk1FWlRZakk1TUV4dFRubGlSRU5DYzNkWlNVdDNXVUpDVVZWSVFWRkZSV2RoV1hjSwpaMkZOZDFCM1dVbExkMWxDUWxGVlNFMUJTMGROTW1nd1pFaEJOa3g1T1dwamJsRjFaRmhPYkdOdVVubGtXRTR3ClRHMU9kbUpUT1VKYVIxSlZZMjVXZWdwa1JWWTBaRWRXZVdKdFJuTlJNRVpUWWpJNU1FeHVRVE5aZWtFMVFtZG4KY2tKblJVWkNVV04zUVc5WmRHRklVakJqUkc5MlRESk9lV1JETlRGak1sWjVDbVJJU2pGak0xRjFXVEk1ZEV3dwpSbXRhUmxKNVpGaE9NRlpXVWs5Vk1HUkVVVEJGZFZrelNqQk5RMVZIUTBOelIwRlJWVVpDZWtGQ2FHaHNiMlJJClVuY0tUMms0ZG1JeVRucGpRelV4WXpKV2VXUklTakZqTTFGMVdUSTVkRTFCTUVkRFUzRkhVMGxpTTBSUlJVSkMKVVZWQlFUUkpRa0ZSUTJOT2RVNVBjblpIU3dwMU1ubFlha2s1VEZvNVEyWXlTVk54Ym5sR1prNWhSbUo0UTNScQpSR1ZwT0dReE1tNTRSR1k1VTNreVpUWkNNWEJ2WTBORmVrNUdkR2t2VDBKNU5UbE1DbVJNUWtwTGFraHZUakJFCmNrZzViVmh2ZUc5U01WTmhibUpuS3pZeFlqUnpMMkpUVWxwT2VTdFBlR3hSUkZoeFZqaDNVVlJ4WW5SSVJEUjAKWXpCaGVrTUtaVE5qYUZWT01XSnhLemN3Y0hScVZWTnNUbkpVWVRJMGVVOW1iVlZzYUU1Uk1IcERiMmxPVUVSegpRV2RQWVM5bVZEQktZa2gwVFVvNVFtZEtWMU55V2dvMlJXOVpkbnBNTnl0cE1XdHBOR1pMVjNsMmIzVkJkQ3QyCmFHTlRlSGRQUTB0aE9WbHlORmRGV0ZRd1N6TjVUbEozT0RKMlJVd3JRV0ZZWlZKRGF5OXNDblYxUjNSdE9EZG0KVFRBMGQwOHJiVkJhYml0REsyMTJOakkyVUVGamQwUnFNV2hMZGxSbVNWQlhhRkpTU0RJeU5HaHZSbWxDT0RWagpZM05LVURneFkzRUtZMlJ1Vld3MFdHMUhSazh6Q2kwdExTMHRSVTVFSUVORlVsUkpSa2xEUVZSRkxTMHRMUzBLClVFc0RCQW9BQUFBQUFBQUE1MFRDdzhFOVp3Y0FBR2NIQUFBZkFBQUFabWx1WVd4MFpYTjBYM1J2WW1saGN5MXUKYVhSelkyaGxYMlJsTG1OeWRDMHRMUzB0UWtWSFNVNGdRMFZTVkVsR1NVTkJWRVV0TFMwdExRcE5TVWxHVTNwRApRMEpFVDJkQmQwbENRV2RKVVV0SlYwNTZTR0V4VlRWQlExSkNTR05IUVRSblMxUkJUa0puYTNGb2EybEhPWGN3ClFrRlJWVVpCUkVKNkNrMVJjM2REVVZsRVZsRlJSMFYzU2toUmFrVmlUVUpyUjBFeFZVVkRRazFUVWpOS2JGbFkKVW14amFVSk9XVmMxYW1GSFZucGtSMVo1VFZKQmQwUm5XVVFLVmxGUlNFVjNaRlJaVjNodFlqTkthMDFTYjNkSApRVmxFVmxGUlMwVjRSa1JVTURGUVVrVTRaMUV3UldkVVIyeDBZVmhTYkZwRVJWcE5RbU5IUVRGVlJRcEJlRTFSClZVYzVlbUZZVW5Ca2JWWlVWVEIzWjFFd1JXZE5ha0ZsUm5jd2VFNUVRVE5OUkdOM1RVUkJkMDFFUW1GR2R6QjQKVGxSQk0wMUVZM2xOZWxVMUNrNVViR0ZOU1VkRlRWTkZkMGgzV1VSV1VWRk1SWGhvUldJeU1XaGhWelJuVVRJNQpkV1JJU25aaVEwSlhXVmQ0Y0ZwSFJqQmFWMUY0U1hwQmFFSm5UbFlLUWtGelZFZHJhSFpqTTFKc1drTkNhV1ZUClFrUmhSMVpxWVRKU2RtSlhSbkJpYVVKSVlsZEtTVTFTVVhkRloxbEVWbEZSVEVWM2RGRmlNMDV3WkVkc01ncGEKVms1VVZFUkZhMDFEU1VkQk1WVkZRWGhOWWxwdGJIVlpWM2d3V2xoT01FeHVVblpaYld4b1kza3hkV0ZZVW5wWgpNbWhzVEcxU2JFMUpTVUpKYWtGT0NrSm5hM0ZvYTJsSE9YY3dRa0ZSUlVaQlFVOURRVkU0UVUxSlNVSkRaMHREClFWRkZRVE16VmsxYVozZG1Ubk5JYURoMlpXVXdaSFZqYUZWSWJFTjNhMWdLVTNCbmRGVnZZbFJSUW1kblJHNU4KUnpaVlZHeEpiWEJCVlZWalRrYzVXRzFtUjFaVlJYUk5lVkYzZUd3cllYTkZaR2hhYUdKeGRWVlhhbkpuVFZkaApaUW9yVm1aUmJUZDVNRUpWVFRWc1JVWmFUblUxWkZvMVNXNVVWV3RvVURoMlEwSnlSbEZWYUVoa01GTlJialkzClUxRmhiSEZTVldSVFRsWXdRa1F3WTFsR0NtMHlSMlpyY2xKV2NsbGpZMm92U1RoU01UbFZlbmc1VFRWMmNEUm0KT0U1c05HTXJibFV5YzFVMVMwcEJXVU5pU1hSUVEyTkpRMVJEV2tNM1VEWmllazhLYTNwd0syOVdhVzVsWm5sVgpXWEJrVnpCVllYZHRiMXBsYkZka2VISlpUV2xHWTJGdWFHVTJSVUp5TkZsSU9EY3ZRbGxsVVhsSE1XUnlZVEpJCllqQlhVd3BxYURSc1RqRkJhV1YwY0N0Qk5rdENOV1J5VHpOU1VHaGtRM0I0UlhkamVreGpNbk14VldVNWVIWm4KVFhaM2VqY3pOemg2V0VsamNXeDNTVVJCVVVGQ0NtODBTVUo0ZWtORFFXTk5kMGgzV1VSV1VqQnFRa0puZDBadgpRVlZ0WlZKQldESnpWVmhxTkVZeVpETlVXVEZVT0ZseWFqTkJTM2QzU0ZGWlJGWlNNRThLUWtKWlJVWkhkVXMwCk4yNVJUVXhYVFhaaFRsUTViMFl6YzNoU1Rtd3JjM0pOUVRSSFFURlZaRVIzUlVJdmQxRkZRWGRKUm05RVFVMUMKWjA1V1NGSk5RZ3BCWmpoRlFXcEJRVTFDTUVkQk1WVmtTbEZSVjAxQ1VVZERRM05IUVZGVlJrSjNUVUpDWjJkeQpRbWRGUmtKUlkwUkJha0pSUW1kT1ZraFRRVVZUVkVKSUNrMUVjMGREZVhOSFFWRlJRbk5xUlVKQlowbElUVU4zCmQwdG5XVWxMZDFsQ1FsRlZTRUZuUlZkSWJXZ3daRWhCTmt4NU9UTmtNMk4xWTBjNWVtRllVbkFLWkcxV2VtTXkKZDNWWk1qbDBUREJPVVZWNlFVbENaMXB1WjFGM1FrRm5SWGRQZDFsRVZsSXdaa0pFVVhkTmFrRjNiME0yWjB4SgpXWEZoU0ZJd1kwUnZkZ3BNTWs1NVlrTTFhbUl5TVhaYVJ6bHFXVk0xYW1JeU1IWlZSemw2WVZoU2NHUnRWbFJWCk1IaEVVVlJKZFZrelNuTk5SM2RIUTBOelIwRlJWVVpDZDBWQ0NrSkhRWGRZYWtFeVFtZG5ja0puUlVaQ1VXTjMKUVc5WmNXRklVakJqUkc5MlRESk9lV1JETldwaU1qRjJXa2M1YWxsVE5XcGlNakIyVlVjNWVtRllVbkFLWkcxVwpWRlV3ZUVSUlZFbDFXVE5LTUUxRFVVZERRM05IUVZGVlJrSjZRVUpvYUdodlpFaFNkMDlwT0haaU1rNTZZME0xCmFtSXlNWFphUnpscVdWTTFhZ3BpTWpCM1VuZFpSRlpTTUZKQ1JVRjNVRzlKWWxwdGJIVlpWM2d3V2xoT01FeHUKVW5aWmJXeG9ZM2t4ZFdGWVVucFpNbWhzVEcxU2JHZG9PVE5rTTJOMUNscHRiSFZaVjNnd1dsaE9NRXh1VW5aWgpiV3hvWTNreGRXRllVbnBaTW1oc1RHMVNiRTFCTUVkRFUzRkhVMGxpTTBSUlJVSkNVVlZCUVRSSlFrRlJRMjhLClR5OVFlWEF5UjB4M1psZ3daVzVzWjFaeWNsVldWR0pvZGpWUVVGZGFRV28wTm1kNlluVllWV0ZHT1d0b1REY3YKUTBOVlNXUkhOM3BIYjNScFExcFZXUXBKUXpsQ2EySkhOa3RESzFoS1ZuUm9NMnB1ZEd0aVRUZEdXa014UWxCNQpPVU4xYlVwamFWcFZSM1ZDYzNwdGRuTlpPRGRWVlM5aFZXZExka3BhVG1sYUNtUnNNVEZ2ZG5ad1ZFRXlSSFZ1ClNFcHJjamx4ZEhrclJVSkRNa3gyT0doVGNFeDJaVEV2U2xSWmNHRndhbVUwVW5sNWEzSXhXR05LWVdoa1p6aEwKWXprS1Z6ZFZORXBtTkdsamFGZHBVRTFoYUVwd1oyZERhMVJoTkhobU1tNXhWM1V6TDFSdFkzazRSVzR6WjFWbQpXVFJHYzBVNE9YbGlabFEyYzA5Q2RFbFhWQXB6Wm10d2FWSnVieTlSVmxFd1VHVnVNa3dyYzFSaFFtVldlV0pyCk1EZENLMFJuVEVWc1JsSnNia3RqUTFoUWMxRlBiMVZYWlhCeWQxWkRWV3RSTmxST0NqUlRiSEprY1RoMk9VOXAKWkZNNE5tZE5Ra1ZPQ2kwdExTMHRSVTVFSUVORlVsUkpSa2xEUVZSRkxTMHRMUzBLVUVzQkFoUUFDZ0FBQUFBQQpBQUJRUUpFaXBYN2RCZ0FBM1FZQUFDVUFBQUFBQUFBQUFRQWdBTGFCQUFBQUFHWnBibUZzZEdWemRGOTBiMkpwCllYTXRibWwwYzJOb1pWOWtaUzVqWVMxaWRXNWtiR1ZRU3dFQ0ZBQUtBQUFBQUFBQUFPZEV3c1BCUFdjSEFBQm4KQndBQUh3QUFBQUFBQUFBQkFDQUF0b0VnQndBQVptbHVZV3gwWlhOMFgzUnZZbWxoY3kxdWFYUnpZMmhsWDJSbApMbU55ZEZCTEJRWUFBQUFBQWdBQ0FLQUFBQURFRGdBQUFBQT0KCi0tKEFsdGVybmF0aXZlQm91bmRhcnkyKS0t\";\n\n $imapAdapter = $this->createImapAdpater();\n\n /** @var \\PHPUnit_Framework_MockObject_MockObject $imapExtension */\n $imapExtension = $imapAdapter->getInstance();\n\n $imapExtension\n ->expects($this->any())\n ->method('search')\n ->will($this->returnValue(array(0)));\n\n $imapExtension\n ->expects($this->any())\n ->method('getMessage')\n ->will($this->returnValue($this->createImapRawMessage(base64_decode($raw))));\n\n $messages = $this->imapHelper->fetchMails($imapAdapter, array(), null, null, true, true);\n\n $attachment = $messages[0]['attachments'][0];\n\n $this->assertEquals('application/x-zip-compressed', $attachment['mime']);\n $this->assertEquals('finaltest_tobias-nitsche_de.zip', $attachment['filename']);\n $this->assertEquals(3962, strlen($attachment['content']));\n }",
"private function initialize_multipart_subtype($val) {\n if ( ! is_string($val) || ! in_array($val, array('mixed', 'related'))) {\n $this->invalid_argument_value('multipart_subtype');\n }\n $this->multipart_subtype = $val;\n }",
"public function testCreateStringAttachmentShouldReadTheRightMimeType()\n {\n self::markTestIncomplete(\n 'Failed asserting that two strings are identical.'.\n \"-'application/xml'\".\n \"+'text/xml'\"\n );\n\n $xml = file_get_contents(\n tx_mkmailer_mail_Factory::makeAbsPath(\n 'EXT:mkmailer/tests/phpunit.xml'\n )\n );\n $model = tx_mkmailer_mail_Factory::createStringAttachment(\n $xml\n );\n\n self::assertSame('application/xml', $model->getMimeType());\n }",
"public function parseToPart($text, $charset = 'UTF-8')\n {\n $parts = $this->parse($text);\n\n if (empty($parts) ||\n ((count($parts) == 1) && ($parts[0]['type'] == self::ARMOR_TEXT))) {\n return null;\n }\n\n $new_part = new Horde_Mime_Part();\n $new_part->setType('multipart/mixed');\n\n for ($val = reset($parts); $val; $val = next($parts)) {\n switch ($val['type']) {\n case self::ARMOR_TEXT:\n $part = new Horde_Mime_Part();\n $part->setType('text/plain');\n $part->setCharset($charset);\n $part->setContents(implode(\"\\n\", $val['data']));\n $new_part->addPart($part);\n break;\n\n case self::ARMOR_PUBLIC_KEY:\n $part = new Horde_Mime_Part();\n $part->setType('application/pgp-keys');\n $part->setContents(implode(\"\\n\", $val['data']));\n $new_part->addPart($part);\n break;\n\n case self::ARMOR_MESSAGE:\n $part = new Horde_Mime_Part();\n $part->setType('multipart/encrypted');\n $part->setMetadata(self::PGP_ARMOR, true);\n $part->setContentTypeParameter('protocol', 'application/pgp-encrypted');\n\n $part1 = new Horde_Mime_Part();\n $part1->setType('application/pgp-encrypted');\n $part1->setContents(\"Version: 1\\n\");\n\n $part2 = new Horde_Mime_Part();\n $part2->setType('application/octet-stream');\n $part2->setContents(implode(\"\\n\", $val['data']));\n $part2->setDisposition('inline');\n\n $part->addPart($part1);\n $part->addPart($part2);\n\n $new_part->addPart($part);\n break;\n\n case self::ARMOR_SIGNED_MESSAGE:\n if (($sig = next($parts)) &&\n ($sig['type'] == self::ARMOR_SIGNATURE)) {\n $part = new Horde_Mime_Part();\n $part->setType('multipart/signed');\n // TODO: add micalg parameter\n $part->setContentTypeParameter('protocol', 'application/pgp-signature');\n\n $part1 = new Horde_Mime_Part();\n $part1->setType('text/plain');\n $part1->setCharset($charset);\n\n $part1_data = implode(\"\\n\", $val['data']);\n $part1->setContents(substr($part1_data, strpos($part1_data, \"\\n\\n\") + 2));\n\n $part2 = new Horde_Mime_Part();\n\n $part2->setType('application/pgp-signature');\n $part2->setContents(implode(\"\\n\", $sig['data']));\n\n $part2->setMetadata(self::SIG_CHARSET, $charset);\n $part2->setMetadata(self::SIG_RAW, implode(\"\\n\", $val['data']) . \"\\n\" . implode(\"\\n\", $sig['data']));\n\n $part->addPart($part1);\n $part->addPart($part2);\n $new_part->addPart($part);\n }\n }\n }\n\n return $new_part;\n }",
"private function parseType() {\n $this->_type = null;\n $this->_subtype = null;\n\n $mime = $this->mime;\n if (empty($mime)) {\n return;\n }\n\n if (false !== strpos($mime, '/' )) {\n list($this->_type, $this->_subtype) = explode('/', $mime);\n } else {\n list($this->_type, $this->_subtype) = [$mime, ''];\n }\n }",
"public static function ADD_STRING_EMBEDDED_IMAGE(\n $string,\n $cid,\n $name = '',\n $encoding = self::ENCODING_BASE64,\n $type = '',\n $disposition = 'inline'\n ) {\n try {\n //If a MIME type is not specified, try to work it out from the name\n if ('' === $type && !empty($name)) {\n $type = hkm_filename_to_type($name);\n }\n\n if (!self::VALIDATE_ENCODING($encoding)) {\n throw new Exception(self::lang('encoding') . $encoding);\n }\n\n //Append to $attachment array\n self::$attachment[] = [\n 0 => $string,\n 1 => $name,\n 2 => $name,\n 3 => $encoding,\n 4 => $type,\n 5 => true, //isStringAttachment\n 6 => $disposition,\n 7 => $hkmd,\n ];\n } catch (Exception $exc) {\n self::SET_ERROR($exc->getMessage());\n self::DEBUG($exc->getMessage());\n if (self::$exceptions) {\n throw $exc;\n }\n\n return false;\n }\n\n return true;\n }",
"protected function _createFromString($string){\r\n $im = imagecreatefromstring($string);\r\n $this->graphic = $im;\r\n $this->recalcSize();\r\n return $im;\r\n }",
"public function constructMultipartMessage()\n {\n\n $mixed_boundary = '__mixed_1S2U3R4E5B6E7R8T9';\n $alterative_boundary = '__alter_1S2U3R4E5B6E7R8T9';\n\n $this->attachments_in_HTML =0;\n\n if(strstr($this->body_HTML, \"cid:\")) {\n\n $this->attachments_in_HTML =1;\n $related_boundary = '__relate_1S2U3R4E5B6E7R8T9';\n }\n\n $this->_header_text = \"From: \".$this->from.PHP_EOL;\n $this->_header_text .= \"Reply-To: \".($this->reply_to ?: $this->from).PHP_EOL;\n $this->_header_text .= \"Return-Path: \".$this->from.PHP_EOL;\n\n foreach($this->cc as $cc) {\n $this->_header_text .=\"Cc:\".$cc.PHP_EOL;\n }\n\n foreach($this->bcc as $bcc) {\n $this->_header_text .=\"Bcc:\".$bcc.PHP_EOL;\n }\n\n $this->_header_text .= \"MIME-Version: 1.0\".PHP_EOL;\n\n foreach($this->headers as $key=>$val) {\n $this->_header_text .= $key.\":\".$val.PHP_EOL;\n }\n\n $this->_header_text .= \"Content-Type: multipart/mixed;\".PHP_EOL;\n $this->_header_text .= ' boundary=\"'.$mixed_boundary.'\"'.PHP_EOL.PHP_EOL;\n\n // Add a message for peoplewithout mime\n $message = \"This message has an attachment in MIME format created with surebert mail.\".PHP_EOL.PHP_EOL;\n\n //if there is body_HTML use it otherwise use just plain text\n if(!empty($this->body_HTML)) {\n\n $message .= \"--\".$mixed_boundary.PHP_EOL;\n\n if($this->attachments_in_HTML == 1) {\n $message .= \"Content-Type: multipart/related;\".PHP_EOL;\n $message .= ' boundary=\"'.$related_boundary.'\"'.PHP_EOL.PHP_EOL;\n $message .= \"--\".$related_boundary.PHP_EOL;\n }\n\n $message .= \"Content-Type: multipart/alternative;\".PHP_EOL;\n $message .= ' boundary=\"'.$alterative_boundary.'\"'.PHP_EOL.PHP_EOL;\n\n $message .= \"--\".$alterative_boundary.PHP_EOL;\n $message .= \"Content-Type: text/plain; charset=\".$this->charset.\"; format=flowed\".PHP_EOL;\n $message .= \"Content-Transfer-Encoding: \".$this->transfer_encoding.PHP_EOL;\n $message .= \"Content-Disposition: inline\".PHP_EOL.PHP_EOL;\n $message .= $this->body . PHP_EOL;\n\n $message .= \"--\".$alterative_boundary.PHP_EOL;\n $message .= \"Content-Type: text/html; charset=\".$this->charset.PHP_EOL;\n $message .= \"Content-Transfer-Encoding: \".$this->transfer_encoding.PHP_EOL.PHP_EOL;\n $message .= $this->body_HTML . PHP_EOL;\n\n $message .=\"--\".$alterative_boundary.\"--\".PHP_EOL;\n\n } else {\n\n $message .= \"--\".$mixed_boundary.PHP_EOL;\n $message .= \"Content-Type: text/plain; charset=\".$this->charset.\"; format=flowed\".PHP_EOL;\n $message .= \"Content-Transfer-Encoding: \".$this->transfer_encoding.PHP_EOL;\n $message .= \"Content-Disposition: inline\".PHP_EOL.PHP_EOL;\n $message .= $this->body . PHP_EOL;\n }\n\n //add all attachments for this email\n foreach($this->attachments as &$attachment) {\n\n //if only filepath is set, grab name and contents from there\n if(isset($attachment->filepath)) {\n if(empty($attachment->name)) {\n $attachment->name = basename($attachment->filepath);\n }\n\n if(empty($attachment->contents)) {\n $attachment->contents = file_get_contents($attachment->filepath);\n }\n\n if(empty($attachment->mime_type)) {\n $attachment->mime_type = \\sb\\Files::fileToMime($attachment->filepath);\n }\n\n }\n $ex = explode(\".\", $attachment->name);\n $attachment->extension = strtolower(array_pop($ex));\n\n //try and guess the mime type unless it is set\n if(empty($attachment->mime_type)) {\n $attachment->mime_type = \\sb\\Files::extensionToMime($attachment->extension);\n }\n\n if($attachment->encoding == 'base64' && !isset($attachment->_base64_encoded)){\n $attachment->_base64_encoded = true;\n $attachment->contents = chunk_split(base64_encode($attachment->contents));\n }\n\n // Add file attachment to the message\n\n if($this->attachments_in_HTML == 1) {\n $message .= \"--\".$related_boundary.PHP_EOL;\n } else {\n $message .= \"--\".$mixed_boundary.PHP_EOL;\n }\n\n if($attachment->mime_type == 'text/calendar'){\n $message .= \"Content-class: urn:content-classes:calendarmessage;\".PHP_EOL;\n }\n\n $message .= \"Content-Type: \".$attachment->mime_type.\";\".PHP_EOL;\n $message .= \" name=\".$attachment->name.PHP_EOL;\n\n $message .= \"Content-Transfer-Encoding: \".$attachment->encoding.PHP_EOL;\n $message .= \"Content-ID: <\".$attachment->name.\">\".PHP_EOL.PHP_EOL;\n\n $message .= $attachment->contents.PHP_EOL;\n\n }\n\n //end related if using body_HTML\n if($this->attachments_in_HTML == 1) {\n $message .= \"--\".$related_boundary.\"--\".PHP_EOL;\n }\n\n //end message\n $message .=\"--\".$mixed_boundary.\"--\".PHP_EOL;\n\n $this->body = $message;\n $raw = \"\";\n if($this->to){\n $raw .= \"To: \".$this->to.PHP_EOL;\n }\n\n $raw .= \"Subject: \".$this->subject.PHP_EOL;\n $raw .= $this->_header_text .$this->body;\n return $raw;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the last_name column Example usage: $query>filterByLastName('fooValue'); // WHERE last_name = 'fooValue' $query>filterByLastName('%fooValue%'); // WHERE last_name LIKE '%fooValue%' | public function filterByLastName($lastName = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($lastName)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $lastName)) {
$lastName = str_replace('*', '%', $lastName);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(VolunteerPeer::LAST_NAME, $lastName, $comparison);
} | [
"protected function lastName($lastName)\n {\n return $this->builder->where('last_name','like',$lastName.'%');\n }",
"public function filterByLastName($lastName = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($lastName)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $lastName)) {\n $lastName = str_replace('*', '%', $lastName);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(UserPeer::LAST_NAME, $lastName, $comparison);\n }",
"public function filterByLastName($lastName = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($lastName)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $lastName)) {\n $lastName = str_replace('*', '%', $lastName);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(UserPeer::USER_LASTNAME, $lastName, $comparison);\n }",
"public function filterByLastName($lastName = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($lastName)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $lastName)) {\n $lastName = str_replace('*', '%', $lastName);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(UserTableMap::COL_LAST_NAME, $lastName, $comparison);\n }",
"public function filterByLastName($lastName = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($lastName)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $lastName)) {\n $lastName = str_replace('*', '%', $lastName);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(ContactPeer::LAST_NAME, $lastName, $comparison);\n }",
"public function filterByName( $name ){\n $name = Loader::db()->quote('%'.$name.'%');\n $this->filter(false, \"ct.firstName LIKE $name OR ct.lastName LIKE $name\");\n }",
"final public function getByLastName($last_name)\n {\n return $this->findByCriteria(array(\n \"last_name\" => $last_name\n ));\n }",
"public function filterByLastname($lastname = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($lastname)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $lastname)) {\n\t\t\t\t$lastname = str_replace('*', '%', $lastname);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Oops_Db_CustomerPeer::LASTNAME, $lastname, $comparison);\n\t}",
"public function userSearch($firstName, $lastName){\n $query = \"SELECT User_Id, User_First_Name, User_Last_Name, Email FROM users WHERE User_Id !=\" . $_SESSION['user_id'] . \" AND Buisness_User = 1 AND User_First_Name LIKE '%\" . $firstName .\"%' OR '%\" . $lastName . \"%' \";\n \n $this->db->query($query);\n\n $rows = $this->db->resultSet();\n\n return $rows;\n }",
"public function filterByLastName($lastName = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($lastName)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $lastName)) {\n $lastName = str_replace('*', '%', $lastName);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TempContractPeer::LAST_NAME, $lastName, $comparison);\n }",
"public function filterByLastname($lastname = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($lastname)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $lastname)) {\n $lastname = str_replace('*', '%', $lastname);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(UserPeer::LASTNAME, $lastname, $comparison);\n }",
"public function filterByLastname($lastname = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($lastname)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $lastname)) {\n\t\t\t\t$lastname = str_replace('*', '%', $lastname);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Oops_Db_EmployeePeer::LASTNAME, $lastname, $comparison);\n\t}",
"public function testItReturnsUsersFilteredByLastName()\n {\n $user1 = factory(User::class)->create([\n \"tenant_id\" => $this->user->tenant->id,\n ]);\n $tenant2 = factory(Tenant::class)->create();\n factory(User::class)->create([\n \"tenant_id\" => $tenant2,\n ]);\n \n $this->actingAs($this->user)\n ->getJson(\"api/v1/users?filter[lastname]={$user1->lastname}\")\n ->assertOk()\n ->assertJson([\n \"data\" => [\n [\n \"id\" => $user1->id,\n \"firstname\" => $user1->firstname,\n \"lastname\" => $user1->lastname,\n ],\n ],\n ]);\n }",
"function searchColumns($lastColumn = false)\n{\n $filterLastColumn = $lastColumn ? '' : ':not(:last)';\n\n return \"\n function () {\n this.api().columns('$filterLastColumn').every(function (index) {\n var column = this;\n var header = $(column.header(index));\n var title = header.text();\n var input = document.createElement('input');\n $(input).attr('placeholder', 'type to filter');\n $(input).attr('class', 'form-control');\n $(input).appendTo($(column.footer()).empty())\n .on('change', function () {\n column.search($(this).val(), false, false, true).draw();\n });\n });\n }\";\n}",
"public function getStudentsByLastName($lastName){\n $query = $this->getEntityManager()\n ->createQuery(\n \"SELECT u \"\n . \"FROM MaclayServiceBundle:User u \"\n . \"WHERE u. lastName LIKE :lastName\"\n )\n ->setParameter(\"lastName\", '%'.$lastName.'%')\n ->getResult();\n \n return $query;\n }",
"function findAllByLastName(){\n\t\t$db = DBHelpers::getDbConnection();\n\n\t\t// Check if we've successfully connected to the database;\n\t\tif (isset($db['error'])) {\n\t\t\t// Could not connect to the database\n\t\t\texit('A database error has occurred');\n\t\t}\n\n\t\t$res = $db->query('SELECT * FROM customers ORDER BY second_name');\n\n\t\twhile($result = $res->fetch_assoc()){\n\t\t\techo($this->formatNames($result['first_name'], $result['second_name']));\n\t\t}\n\n\t\treturn $res->fetch_assoc();\n\t}",
"public function searchUserByFirstName($firstName);",
"function filter_search_columns($columns, $search, $WP_User_Query)\n {\n }",
"public function testFilter()\r\n\t{\r\n // filter all elements with lastname\r\n TechDivision_Collections_CollectionUtils::filter(\r\n $this->list,\r\n new TechDivision_Collections_TestPredicate(\"Albert\")\r\n );\r\n $this->assertEquals(1, $this->list->size());\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the season of the image (as textual representation) | public function getSeason(){
return $this->getTextualSeason($this->season);
} | [
"public function getSeason(): string\n {\n $month = (int) $this->date->format('n');\n\n $season = array_filter($this->seasons, function ($range) use ($month) {\n return in_array($month, $range);\n });\n\n return key($season);\n }",
"public function getSeasonString() {\n\t\treturn self::$seasons[$this->getStep()%self::N_seasons]['name'];\n\t}",
"public static function season()\n {\n $seasons = array(\"Winter\", \"Spring\", \"Summer\", \"Autumn\");\n\n return $seasons[(int) ((date(\"n\") %12)/3)];\n }",
"public function getSeason() : int {\n\t\tif( !isset( $this->start_date ) ) return date( 'Y' );\n\t\telse return $this->start_date->format( 'Y' );\n\t}",
"public function getSeason()\r\n {\r\n return $this->season;\r\n }",
"public function getSeason()\n {\n return $this->season;\n }",
"public function getSeason() {\n return $this->season;\n }",
"public function get_humanReadableSeason() {\n require_once (\"com/tcshl/global/Season.php\");\n $humanReadableSeason = new Season($this->playerSeasonID);\n return $humanReadableSeason->get_humanReadableSeason();\n }",
"public function getCurrentSeason()\n {\n return $this->data['fields']['current_season'];\n }",
"public function getSeasonNumber()\n {\n return $this->seasonNumber;\n }",
"public static function getSeason(int $month) : string\n {\n //this also conveniently makes December == 0\n $month_of_year = $month % 12;\n\n if ($month_of_year < 3) {\n return self::WINTER;\n } elseif ($month_of_year < 6) {\n return self::SPRING;\n } elseif ($month_of_year < 9) {\n return self::SUMMER;\n }\n return self::FALL;\n }",
"public function getIdSeason()\n {\n return $this->id_season;\n }",
"private static function returnFormattedSeason($season)\n\t{\n\t\t$season = new fTimestamp($season);\n\t\t\n\t\tswitch ($season->format('m')) {\n\t\t\tcase '03':\n\t\t\t\treturn 'Spring ' . $season->format('Y');\n\t\t\tcase '06':\n\t\t\t\treturn 'Summer ' . $season->format('Y');\n\t\t\tcase '09':\n\t\t\t\treturn 'Fall ' . $season->format('Y');\n\t\t\tcase '12':\n\t\t\t\treturn 'Winter ' . $season->format('Y') . '-' . $season->adjust('+1 year')->format('Y');\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}",
"function getSeason(){\n $today = getdate();\n \n $d1 = mktime(0,0,0, $today['mon'], $today['mday'], 2004);\n\n if($d1 >= 1072936800 and $d1 < 1079848800){ //jan 1 and mar 21\n $season = 1;\n }\n elseif ($d1 < 1087794000){ //june 21\n $season = 2;\n }\n elseif ($d1 < 1095829200){ // sept 22\n $season = 3;\n }\n elseif ($d1 < 1101880800){ // dec 1\n $season = 4;\n }\n else{ // xmas\n $season = 5;\n }\n\n return $season;\n}",
"function getSeasonId()\n {\n return $this->__seasonid ;\n }",
"public function show_current_season() {\n $roster = $this->set_current_season();\n function get_stats(array $roster) {\n return iterator_to_array(new \\RecursiveIteratorIterator(new \\RecursiveArrayIterator($roster)), false);\n }\n $stats = get_stats($roster);\n return $stats;\n }",
"public function getCurrentSeason(){\r\n $status = 'CURRENT';\r\n $currentSeason = $this->entityManager->getRepository(Season::class)\r\n ->findOneByStatus($status);\r\n \r\n //$season_name = $currentSeason->getSeasonName();\r\n \r\n return $currentSeason;\r\n }",
"public function getReleaseSeasonNumber()\n {\n return $this->releaseSeasonNumber;\n }",
"public function getCurrentSeason()\n {\n $response = $this->seasons()->data();\n $this->clearQuery();\n foreach ($response as $season) {\n if ($season->attributes->isCurrentSeason) {\n $seasonID = $season->id;\n }\n }\n return $seasonID;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the home panel. | public function panelHome() {
//Load the panel matching the home slug.
self::panel('FrozenPlugin-home');
} | [
"function loadHome() \n {\n // set the pageCallBack to be without any additional parameters\n // (an AdminBox needs this so Language Switching on a page doesn't\n // pass a previous operations)\n $parameters = array();//[RAD_CALLBACK_PARAMS]\n $pageCallBack = $this->getCallBack(modulecim_staff_info::PAGE_HOME, $this->sortBy, $parameters);\n $this->setPageCallBack( $pageCallBack );\n \n \n $this->pageDisplay = new page_Home( $this->moduleRootPath, $this->viewer ); \n \n $links = array();\n \n/*[RAD_LINK_INSERT]*/\n\n $this->pageDisplay->setLinks( $links ); \n \n }",
"function home() {\n\n\t\t$this->mcontents['page_title'] \t\t= 'Control Panel';\n\t\t$this->mcontents['page_heading'] \t= 'Home';\n\n\t\tisAdminSection();\n\n\t\tloadAdminTemplate('home', $this->mcontents);\n\t}",
"public function loadTopNavPanel()\r\n\t{\r\n\t\t$this->view->topNavPanel();\r\n\t}",
"private function showHome()\n {\n $content = require $this->viewDirectory . \"/home/home.html.php\";\n\n $this->render($content);\n }",
"public function loadMainPanel(){\n \n if($this->_static == ''){\n \n $this->setMainPanel();\n $this->loadTemplate($this->mainpanel,'main');\n }\n else{\n $this->response->setContent(require PROJECT_PATH .DS. $this->_static);\n }\n }",
"function home() {\n $lessons = $this->object->displayLessons();\n $testimonials = $this->object->displayTestimonials();\n \n require 'app/views/FRONT/home.php';\n }",
"public function showHome() {\n $this->dData = $this->loadCourses();\n return $this->display(\"home\");\n }",
"public function loadLeftNavPanel() {\r\n\t\t$this->view->leftNavPanel();\r\n\t}",
"public function home()\n\t{\n\t\t$this->sidebar_template = 'news';\n\t\t$this->news = R::dispense('news', 5);\n\t\t$this->render();\n\t}",
"public function loadAdminLeftPanel()\r\n {\r\n $this->view->leftAdminPanel();\r\n }",
"public function index(){\n\t\t$this->show_home();\n\t}",
"public function loadHome() {\r\n $userbean = $this->session->userdata('userbean');\r\n switch ($userbean->user_role) {\r\n case 'ADMIN':\r\n $this->load->view('admin/home');\r\n break;\r\n case 'DOCTOR':\r\n $this->load->view('doctor/home');\r\n break;\r\n case 'OPD':\r\n $this->load->view('opd/home');\r\n break;\r\n }\r\n }",
"private function home() {\n // busca as categorias do bd\n $categorias = $this->model->visualizarCategorias();\n // seta as categorias para a view\n $this->view->setCategorias($categorias);\n // passa o arquivo home\n $file = $this->templates . 'home.php';\n \n // retorna o conteudo da tela home para o usuario\n $this->telaUser = $this->view->retornaTela($file);\n }",
"public function home(){ // loads view_home via template\n\t\t$this->load->view('includes/view_template', array(\n\t\t\t'content' => 'home', // loads 'view_home.php'\n\t\t\t'title' => lang('page_home_title')\n\t\t));\n\t}",
"public function home()\n {\n return view('panel.clients.home');\n }",
"function loadSchedulerHome() \n {\n // set the pageCallBack to be without any additional parameters\n // (an AdminBox needs this so Language Switching on a page doesn't\n // pass a previous operations)\n $parameters = array();//[RAD_CALLBACK_PARAMS]\n $pageCallBack = $this->getCallBack(modulecim_sch::PAGE_SCHEDULERHOME, $this->sortBy, $parameters);\n $this->setPageCallBack( $pageCallBack );\n \n \n $this->pageDisplay = new page_SchedulerHome( $this->moduleRootPath, $this->viewer ); \n \n $links = array();\n \n/*[RAD_LINK_INSERT]*/\n\n $this->pageDisplay->setLinks( $links ); \n \n }",
"public function homePage() {\n #$this->view->loadTemplate( 'elements_example');\n $this->view->loadTemplate( LNG . '/centercontent');\n $this->commitReplace($this->view->render(), '#two', true);\n }",
"public function load_menu()\n\t{\n\t\tdie( View::factory('_global/menu') );\n\t}",
"public function home()\n\t{\n\t\t$published = News::getPublished();\n\t\t\n\t\t$news = $published[0];\n\n // load 8 more news articles for display in recent news section\n\t\t$recent = array_slice($published, 1, 8);\n\n\t\t// the rest\n\t\t$older = array_slice($published, 8);\n\n\t\t$this->makeView('news/view',compact('recent','news','older'));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepopulate one empty row when the collection is empty. | public function prepopulateRowWhenEmpty()
{
return $this->withMeta(['prepopulateRowWhenEmpty' => true]);
} | [
"private function removeEmptyRowsFromCollection()\n {\n $this->collection = $this->collection->reject(function ($data) {\n if (empty($data)) {\n return true;\n } else {\n return false;\n }\n });\n }",
"function emptyData() {\n\t\t$this->rowList = array();\n\t}",
"public function emptyRows() {\n\t\t$this->rows = null;\n\t}",
"private function prepareEmptyRow(){\n\t\techo (isset($this->settings['before_field']))? $this->settings['before_field']:null;\n\t\techo (isset($this->settings['id']))? 'id = \"'.$this->settings['id'].'\" ':null;\n\t\t\n\t\techo (isset($this->settings['datatype']))? 'datatype = \"'.$this->settings['datatype'].'\" ':null;\n\t\techo($this->settings['required_mark'])? ' required ':null;\n\t\t\n\t\techo (isset($this->settings['value']))? 'value = \"'.$this->settings['value'].'\" ':null;\n\t\techo (isset($this->settings['style']))? $this->settings['style']:null;\n\t\techo (isset($this->settings['disabled']) && $this->settings['disabled'])? 'disabled=\"disabled\"':null;\t\n\t\techo (isset($this->settings['after_field']))? $this->settings['after_field']:null;\n\t}",
"public static function blank_row() {\n $meta_columns = static::meta_columns();\n $row = array();\n foreach ($meta_columns as $meta_column) {\n $row[$meta_column->name] = null;\n }\n return $row;\n }",
"protected function removeEmpty()\n {\n $ret_arr = array();\n foreach ($this->rows as $row) {\n $line = trim(join('', $row));\n if (!empty($line)) {\n $ret_arr[] = $row;\n }\n }\n $this->rows = $ret_arr;\n }",
"public function setIteratorFirstRow () {}",
"function buildEmptyRow($index)\n {\n $outputRow = $this->_bodyStartRow + $index;\n for ($col = 0; $col < $this->_columnsNum; $col++) {\n $this->_tableBody->setCellAttributes($outputRow, $col, $this->_options['emptyRowAttributes']);\n $this->_tableBody->setCellContents($outputRow, $col, ' ');\n }\n }",
"public function getEmptyRow(){\n\t\t$ret = array();\n\t\tforeach( $this->headers as $k=>$v ){\n\t\t\t$ret[$k] = \"\";\n\t\t}\n\t\treturn $ret;\n\t}",
"public function makeBlankItem() {\n\t\treturn $this->wire(new Fieldgroup()); \n\t}",
"public function emptyRows()\n {\n unset($this->rows, $this->values);\n $this->rows = array();\n $this->values = array();\n return $this;\n }",
"function _field_collection_table_hide_empty(&$variables) {\n $rows = $variables['rows'];\n\n $count = array();\n foreach ($rows as $row_delta => $row) {\n foreach ($row['data'] as $column_delta => $column) {\n if (!isset($count[$column_delta])) {\n $count[$column_delta] = 0;\n }\n if (isset($column['data']['#empty'])) {\n $count[$column_delta]++;\n }\n }\n }\n foreach ($count as $column_delta => $column) {\n if ($column === count($rows)) {\n foreach ($rows as $row_delta => $row) {\n unset($variables['rows'][$row_delta]['data'][$column_delta]);\n unset($variables['header'][$column_delta]);\n }\n }\n }\n}",
"public function makeBlankItem() {\n\t\treturn $this->wire(new Fieldgroup());\n\t}",
"public function insertRows()\n {\n foreach ($this->collection as $record) {\n // May contain attributes that are not included in the collection\n $mutated = $record->toArray();\n\n // Filter out extraneous attributes\n $row = array_filter($mutated, function ($key) use ($record) {\n return array_key_exists($key, $record->getAttributes());\n }, ARRAY_FILTER_USE_KEY);\n\n $this->writer->insertOne($row);\n }\n }",
"abstract public function makeBlankItem();",
"public function makeBlankItem() {\n\t\treturn $this->wire(new Field());\n\t}",
"protected function _prepareRowsAction() {\n \n }",
"protected function ensurePopulated() {\n if (!isset($this->list[0])) {\n $this->list[0] = $this->createItem(0);\n // Populate the 0 value with the correct data.\n $this->list[0]->getValue();\n }\n }",
"protected function emptyRecord()\n {\n $record = $this->orm->record($this->getClass(), []);\n $this->associate($record);\n\n return $record;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get amount of same chars from beginning | function getSameCharAmount($haystack, $compare):int {
$count = 0;
for($i = 0; $i<strlen($haystack); $i++){
if($haystack[$i] === $compare[$i]){
$count++;
}else {
break;
}
}
return $count;
} | [
"public function calculate_number_of_equal_first_characters(){\n $counter = 0;\n for ($key=0; $key<strlen($this->initial_word); $key++) {\n if($this->initial_word[$key] == $this->final_word[$key]){\n $counter += 1;\n }else{\n $this->number_of_equal_first_characters = $counter;\n return;\n }\n }\n $this->number_of_equal_first_characters = $counter;\n }",
"private function _countdigits( ) {\n // used internally to count how many numeric chars there are\n preg_match_all( \"/[0-9]/\", $this->_str, $_matches );\n return count( $_matches[ 0 ] );\n }",
"function duplicateCount($text) {\n $text = mb_strtolower($text);//mb_strtolower - casts a string to lowercase\n $m = 0;\n foreach(count_chars($text, 1) as $i => $val)//iterate over the string\n {\n if ($val > 1)// checking if the character occurs more than once\n {\n $m++;\n }\n }\n return $m;\n}",
"private function _strlen()\n {\n $j = 0;\n while($this->_isset(@$this->string[$j])){\n $j++;\n }\n return $j;\n }",
"static public function prefix_length() : int {\n return 4; // first 4 letters of each word in wordset is unique.\n }",
"private function _get_char_count_indicator() {\n\t\t\t// the length of the data string is encoded with a certain amount of bits\n\t\t\t// that depend on the versin and the mode\n\t\t\t$lenth_bit_count = $this->_get_bit_length_data_length();\n\t\t\t$format_length = '%1$0'.$lenth_bit_count.'b';\n\t\t\t$length = strlen($this->_data_raw);\n\t\t\treturn sprintf($format_length, $length);\n\t\t}",
"function duplicateCount($text)\n{\n $chars = str_split(strtolower($text));\n $res = 0;\n $count = array_count_values($chars);\n foreach ($count as $item) {\n $res += $item > 1 ? 1 : 0;\n }\n return $res;\n}",
"private function getStrLen() \n {\n \n $len = 0;\n \n foreach (array_merge(array_key_exists(0, $this->bracket) ? $this->bracket[0] : array(), $this->bracket[1]) as $m) {\n if (($newlen = strlen($m['c1'])) > $len) $len = $newlen;\n if (($newlen = strlen($m['c2'])) > $len) $len = $newlen;\n }\n \n foreach ($this->roundsInfo as $arr) {\n if (($newlen = strlen($arr[0])) > $len) $len = $newlen;\n }\n\n return $len;\n }",
"function alternatingCharacters($s) {\n $cnt = 0;\n $s2 = $char = $s[0];\n for ($i=1; $i < strlen($s); $i++) {\n if ($s[$i] == $char) \n $cnt++;\n else\n $char = $s[$i];\n }\n return $cnt;\n}",
"function count_chars ($string, $mode = null) {}",
"function CountCharacters($startPos, $endPos){}",
"function duplicateCount($text) {\n // exception \n if($text == \"\"){\n return 0;\n }\n $chrs = str_split(strtolower($text), 1);\n \n $chrsCount = array();\n foreach($chrs as &$chr){\n $chrsCount[$chr] = isset($chrsCount[$chr])? $chrsCount[$chr] + 1: 1;\n }\n $result = array_filter($chrsCount, function($val){ return ($val > 1); });\n return count($result);\n}",
"public function testCurrentCountStartByTwo()\n {\n $tokens = [\"qwerty\\nuiop1\", \"qwerty\\nuiop2\", \"qwerty\\nas\"];\n $result = $this->buffer->currentCountStartBy($tokens);\n $this->assertEquals($result, 2);\n }",
"function doubleLetterCount($word)\n{\n $counter = 0;\n for ($index = 1; $index < strlen($word); $index++) {\n\n $currChar = $word[$index];\n $oldChar = $word[$index - 1];\n\n if ($currChar == $oldChar) {\n $counter += 1;\n }\n }\n return $counter;\n}",
"public function getCharactersCount()\n {\n return mb_strlen($this->getCharacters(), '8bit');\n }",
"public function testCount() {\n\t\t$fancyUtf8 = new \\Scrivo\\Str(\"ƕƺ░☺൩𢯊\");\n\t\t// byte width\n\t\t$this->assertEquals(17, strlen($fancyUtf8));\n\t\t// character width\n\t\t$this->assertEquals(6, count($fancyUtf8));\n\t\t$this->assertEquals(6, $fancyUtf8->length);\n\t}",
"function code_count($code_base,$array_chars) {\n $characters = array_flip($array_chars);\n $character_keys = $array_chars;\n \n $code_characters = str_split($code_base);\n \n $number = 0;\n for ($i = 0; $i < count($code_characters); $i++) {\n $number = $number * count($characters) + $character_keys[$code_characters[$i]];\n }\n return $number; # pokud chceš tak ještě +1\n}",
"public function numberOfCharactersProvider()\n {\n return [[1]];\n }",
"protected function getCharacterCount(): int\n {\n $chars = $this->getRandomFloor($this->getCharacterMax());\n return $chars == 0 ? 1 : $chars;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Backend user Menu under the user account name in the backend toolbar. | public function backend_user( $wp_admin_bar ) {
if ( is_admin() && is_user_logged_in() && ( $locations = get_nav_menu_locations() ) && isset( $locations[ 'admin_toolbar_account' ] ) ) {
$menu = wp_get_nav_menu_object( $locations[ 'admin_toolbar_account' ] );
if ( false != $menu ) {
$menu_items = wp_get_nav_menu_items( $menu->term_id );
foreach ( (array) $menu_items as $key => $menu_item ) {
if ( $menu_item->classes ) {
$classes = implode( ' ', $menu_item->classes );
} else {
$classes = '';
}
$meta = [
'class' => $classes,
'onclick' => '',
'target' => $menu_item->target,
'title' => $menu_item->attr_title
];
if ( $menu_item->menu_item_parent ) {
$wp_admin_bar->add_menu(
[
'id' => $menu_item->ID,
'parent' => $menu_item->menu_item_parent,
'title' => $menu_item->title,
'href' => $menu_item->url,
'meta' => $meta
]
);
} else {
$wp_admin_bar->add_menu(
[
'id' => $menu_item->ID,
'parent' => 'my-account',
'title' => $menu_item->title,
'href' => $menu_item->url,
'meta' => $meta
]
);
}
}
}
}
} | [
"public function menu_my_account() {\n\t\tdo_action( 'plugpress_account_view' );\n\t}",
"protected function registerNavbarMenu()\n {\n $user = $this->app['user'];\n $name = $user ? $user->first_name.' '.$user->last_name : '';\n $email = $user ? $user->email : '';\n $name = trim($name) ? $name : $email;\n $menu = $this->app['menu_manager']->get('admin_navbar')->getItem('user');\n\n $menu->addChildren(\n 'user-account',\n [\n 'label' => 'My Account',\n 'icon' => 'user',\n 'url' => Url::to('usermanager.my_account'),\n 'meta' => ['type' => 'link'],\n 'options' => ['position' => 'after:user-header-divider']\n ]\n );\n }",
"function admin_bar_menu() {\n\t\t\tglobal $wp_admin_bar;\n\t\t\tif ( $user_id = get_current_user_id() ) {\n\t\t\t\t$membership = pmpro_getMembershipLevelForUser( $user_id );\n\t\t\t\tif ( $membership && $membership->id === static::$membership_level_id ) {\n\t\t\t\t\t$menu_item = array(\n\t\t\t\t\t\t'parent' => 'user-actions',\n\t\t\t\t\t\t'id' => 'makerspace-checkinout',\n\t\t\t\t\t\t'title' => 'Checkin',\n\t\t\t\t\t\t'href' => '#checkin',\n\t\t\t\t\t);\n\t\t\t\t\tif ( static::is_member_in( $user_id ) ) {\n\t\t\t\t\t\t$menu_item['title'] = 'Checkout';\n\t\t\t\t\t\t$menu_item['href'] = '#checkout';\n\t\t\t\t\t}\n\t\t\t\t\t$wp_admin_bar->add_node( $menu_item );\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function buddyplug_screen_user_settings_title() {\n\tbuddyplug_component_user_settings_nav_name();\n}",
"public function topbarusernameAction()\n {\n $user = $this->container->get('security.context')->getToken()->getUser();\n \n return $this->render('LyHrmBundle:Crew:topbarusername.html.twig',\n array(\n\t\t\t\t'user' => $user\n\t\t\t));\n }",
"function odd_admin_preprocess_block__useraccountmenu(&$variables) {\n /** @var \\Drupal\\Core\\Session\\AccountProxyInterface $user */\n $user = $variables['user'];\n\n $variables['username'] = [\n '#theme' => 'username',\n '#account' => $user->getAccount(),\n ];\n}",
"function block__upl_user(){\n $app =& Dataface_Application::getInstance();\n $record =& $app->getRecord();\n \n $user = df_get_record('mis_users', array(\"userid\"=>$record->val('user_id')));\n \n echo \"<a href='index.php?-table=mis_users&-action=browse&userid={$user->val('userid')}'>\n {$user->htmlValue('username')}</a>\";\n }",
"function bbp_edit_user_display_name()\n{\n}",
"private function userDisplay() {\n $showHandle = $this->get('username');\n if (isset($showHandle)) {\n echo '<li class=\"user-handle\">'.$showHandle.'</li>';\n }\n }",
"function talemy_output_before_account_menu( $user_data ) {\n $user_link = function_exists( 'bp_core_get_user_domain' ) ? bp_core_get_user_domain( $user_data->ID ) : '#';\n $user_link = apply_filters( 'talemy_user_link', $user_link );\n ?>\n <a class=\"user-link\" href=\"<?php echo esc_url( $user_link ); ?>\">\n <?php echo get_avatar( $user_data->ID, 30 ); ?>\n <span>\n <span class=\"user-name\"><?php echo esc_html( $user_data->first_name ); ?></span>\n <span class=\"user-mention\"><?php echo esc_html( $user_data->user_login ); ?></span>\n </span>\n </a>\n <?php\n }",
"function _datigov_registration_my_datasets_page_menu() {\n\n return t('<ul class=\"action-links\"><li><a href=\"/node/add/dataset\" class=\"btn btn-primary btn-sm\">' . t('Add dataset') . '</a></li>'\n . '<li><a href=\"/user/' . $GLOBALS['user']->uid . '/edit\" class=\"btn btn-primary btn-sm\">' . t('Edit profile') . '</a></li>'\n . '</ul>');\n}",
"public function register_menu() {\n register_nav_menu( 'charitable-dashboard', __( 'User Dashboard', 'charitable' ) );\n }",
"function login_menu() {\n\t$lanaya = CLanaya::Instance();\n\tif($lanaya->user->IsAuthenticated()) {\n\t\t$items = '<img src=\"' . get_gravatar(30) . '\" alt=\"Gravatar\"/>';\n\t\t$items .= \"<a href='\" . create_url('user/profile') . \"'>\" . $lanaya->user->GetAcronym() . \"</a> \";\n\t\tif($lanaya->user->IsAdministrator()) {\n\t\t\t$items .= \"<a href='\" . create_url('acp') . \"'>acp</a> \";\n\t\t}\n\t\t$items .= \"<a href='\" . create_url('user/logout') . \"'>logout</a> \";\n\t} else {\n\t\t$items = \"<a href='\" . create_url('user/login') . \"'>login</a> \";\n\t}\n\t\n\treturn \"<nav>$items</nav>\";\n}",
"function add_usermenuitem() {\n $menuitems = get_config(\"core\", 'customusermenuitems');\n if (strpos($menuitems, \"accessibilitytool,local_accessibilitytool\") !== false) {\n return;\n }\n\n $linetoadd = \"accessibilitytool,local_accessibilitytool|/local/accessibilitytool/manage.php|../e/accessibility_checker\\n\";\n $menuitems = $linetoadd . $menuitems;\n set_config('customusermenuitems', $menuitems);\n}",
"function login_menu() {\n\t$lanaya = CLanaya::Instance();\n\tif($lanaya->user->IsAuthenticated()) {\n\t\t$items = '<img src=\"' . get_gravatar(30) . '\" alt=\"Gravatar\"/>';\n\t\t$items .= \" <a href='\" . create_url('user/profile') . \"'>\" . $lanaya->user->GetAcronym() . \"</a> \";\n\t\tif($lanaya->user->IsAdministrator()) {\n\t\t\t$items .= \"<a href='\" . create_url('acp') . \"'>acp</a> \";\n\t\t}\n\t\t$items .= \"<a href='\" . create_url('user/logout') . \"'>logout</a> \";\n\t} else {\n\t\t$items = \"<a href='\" . create_url('user/login') . \"'>login</a> \";\n\t}\n\t\n\treturn \"<nav>$items</nav>\";\n}",
"function MAPS_user_menu() {\n global $_CONF, $_MAPS_CONF, $LANG_MAPS_1, $_MAPS_CONF;\n\n $display = '<p>';\n\n // generate the menu from the template\n $menu = COM_newTemplate($_CONF['path'] . 'plugins/maps/templates');\n $menu->set_file(array('menu' => 'user_menu.thtml'));\n $menu->set_var('maps_url', $_MAPS_CONF['site_url']);\n $menu->set_var('site_url', $_CONF['site_url']);\n $menu->set_var('maps', $LANG_MAPS_1['user_home']);\n \n //Check for submission rights\n if ($_MAPS_CONF['marker_submission'] == 1) {\n $menu->set_var('submit_marker', ' | <a href=\"' . $_CONF['site_url'] . '/submit.php?type=maps\">' . $LANG_MAPS_1['submit_marker'] . '</a>');\n\t\t//Check for login users\n\t\tif (!COM_isAnonUser()) {\n\t\t $menu->set_var('my_markers', ' | <a href=\"' . $_MAPS_CONF['site_url'] . '/markers.php\">' . $LANG_MAPS_1['my_markers'] . '</a>');\n\t\t} else {\n\t\t $menu->set_var('my_markers', '');\n\t\t}\n } else {\n $menu->set_var('submit_marker', '');\n\t\t$menu->set_var('my_markers', '');\n }\n \n if (SEC_hasRights('maps.admin')) {\n $menu->set_var('admin', ' | ' . '<a href=\"' . $_CONF['site_url'] . '/admin/plugins/maps/index.php\">' . $LANG_MAPS_1['admin'] . '</a>');\n } else {\n $menu->set_var('admin', '');\n }\n $display .= $menu->parse('output', 'menu');\n\n $display .= '</p>';\n\n // return results\n return $display;\n}",
"function wpwebapp_menu_display_username( $menu ){\n\t$username = wpwebapp_display_username();\n\treturn str_replace( '[wpwa_display_username]', $username, do_shortcode( $menu ) );\n}",
"function buddyplug_component_user_settings_nav_name() {\n\techo buddyplug_get_component_user_settings_nav_name();\n}",
"function sc_navigation_user()\n\t{\n\t\t$tp = e107::getParser();\n\n\t\tinclude_lan(e_PLUGIN . 'login_menu/languages/' . e_LANGUAGE . '.php');\n\t\trequire(e_PLUGIN . 'login_menu/login_menu_shortcodes.php');\n\n\t\t$userReg = defset('USER_REGISTRATION');\n\n\t\tif(!USERID) // Logged Out.\n\t\t{\n\t\t\t$socialActive = e107::pref('core', 'social_login_active');\n\n\t\t\tif(empty($userReg)) // value of 1 or 2 = login okay.\n\t\t\t{\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\t$text = '<ul class=\"nav navbar-nav navbar-right\">';\n\n\t\t\tif($userReg == 1)\n\t\t\t{\n\t\t\t\t$text .= '<li><a href=\"' . e_SIGNUP . '\">' . LAN_LOGINMENU_3 . '</a></li>'; // Signup\n\t\t\t}\n\n\t\t\t$text .= '<li class=\"divider-vertical\"></li>';\n\t\t\t$text .= '<li class=\"dropdown\">';\n\t\t\t$text .= '<a class=\"dropdown-toggle\" href=\"#\" data-toggle=\"dropdown\">' . LAN_LOGINMENU_51 . ' <strong class=\"caret\"></strong></a>';\n\t\t\t$text .= '<div class=\"dropdown-menu col-sm-12\" style=\"min-width:250px; padding: 15px; padding-bottom: 0;\">';\n\n\t\t\tif(!empty($socialActive))\n\t\t\t{\n\t\t\t\t$text .= '{SOCIAL_LOGIN: size=2x&label=1}';\n\t\t\t}\n\n\t\t\t/*\n\t\t\t$text .= '<form method=\"post\" onsubmit=\"hashLoginPassword(this);return true\" action=\"' . e_REQUEST_HTTP . '\" accept-charset=\"UTF-8\">';\n\t\t\t$text .= '<div class=\"form-group\">{LM_USERNAME_INPUT}</div>';\n\t\t\t$text .= '<div class=\"form-group\">{LM_PASSWORD_INPUT}</div>';\n\t\t\t$text .= '{LM_IMAGECODE_NUMBER}';\n\t\t\t$text .= '{LM_IMAGECODE_BOX}';\n\t\t\t$text .= '<div class=\"checkbox\">';\n\t\t\t$text .= '<label class=\"string optional\" for=\"autologin\"><input style=\"margin-right: 10px;\" type=\"checkbox\" name=\"autologin\" id=\"autologin\" value=\"1\">' . LAN_LOGINMENU_6 . '</label>';\n\t\t\t$text .= '</div>';\n\t\t\t$text .= '<div class=\"form-group\">';\n\t\t\t$text .= '<input class=\"btn btn-primary btn-block\" type=\"submit\" name=\"userlogin\" id=\"userlogin\" value=\"' . LAN_LOGINMENU_51 . '\">';\n\t\t\t$text .= '<a href=\"{LM_FPW_LINK=href}\" class=\"btn btn-default btn-sm btn-block\">' . LAN_LOGINMENU_4 . '</a>';\n\n\t\t\tif($userReg == 1)\n\t\t\t{\n\t\t\t\t$text .= '<a href=\"{LM_RESEND_LINK=href}\" class=\"btn btn-default btn-sm btn-block\">' . LAN_LOGINMENU_40 . '</a>';\n\t\t\t}\n\n\t\t\t$text .= '</div>';\n\t\t\t$text .= '</form>';\n\t\t\t*/\n\n\t\t\t$text .= '</div>';\n\t\t\t$text .= '</li>';\n\t\t\t$text .= \"</ul>\";\n\n\t\t\t$login_menu_shortcodes = vartrue($login_menu_shortcodes, '');\n\t\t\treturn $tp->parseTemplate($text, true, $login_menu_shortcodes);\n\t\t}\n\n\t\t$text = '<ul class=\"nav navbar-nav navbar-right\">';\n\t\t$text .= '<li class=\"dropdown\">{PM_NAV}</li>';\n\t\t$text .= '<li class=\"dropdown\">';\n\t\t$text .= '<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">';\n\t\t$text .= '{SETIMAGE: w=20} {USER_AVATAR: shape=circle} ' . USERNAME . ' <b class=\"caret\"></b>';\n\t\t$text .= '</a>';\n\t\t$text .= '<ul class=\"dropdown-menu\">';\n\n\t\t$url = e107::url('e107projects', 'projects/submit');\n\t\t$text .= '<li>';\n\t\t$text .= '<a href=\"' . $url . '\"><span class=\"glyphicon glyphicon-folder-open\"></span> ' . LAN_PLUGIN_E107PROJECTS_SUBMIT . '</a>';\n\t\t$text .= '</li>';\n\n\t\t$text .= '<li>';\n\t\t$text .= '<a class=\"dropdown-toggle no-block\" role=\"button\" href=\"{LM_PROFILE_HREF}\"><span class=\"glyphicon glyphicon-user\"></span> ' . LAN_LOGINMENU_13 . '</a>';\n\t\t$text .= '</li>';\n\n\t\t$text .= '<li>';\n\t\t$text .= '<a href=\"{LM_USERSETTINGS_HREF}\"><span class=\"glyphicon glyphicon-cog\"></span> ' . LAN_SETTINGS . '</a>';\n\t\t$text .= '</li>';\n\n\t\t$url = e107::url('nodejs_notify', 'index');\n\t\t$text .= '<li>';\n\t\t$text .= '<a href=\"' . $url . '\"><span class=\"glyphicon glyphicon-cog\"></span> ' . LAN_THEME_BS3E107_02 . '</a>';\n\t\t$text .= '</li>';\n\n\t\t$text .= '<li class=\"divider\"></li>';\n\n\t\tif(ADMIN)\n\t\t{\n\t\t\t$text .= '<li><a href=\"' . e_ADMIN_ABS . '\"><span class=\"fa fa-cogs\"></span> ' . LAN_LOGINMENU_11 . '</a></li>';\n\t\t}\n\n\t\t$text .= '<li><a href=\"' . e_HTTP . 'index.php?logout\"><span class=\"glyphicon glyphicon-off\"></span> ' . LAN_LOGOUT . '</a></li>';\n\t\t$text .= '</ul>';\n\t\t$text .= '</li>';\n\t\t$text .= '</ul>';\n\n\t\t$login_menu_shortcodes = vartrue($login_menu_shortcodes, '');\n\t\treturn $tp->parseTemplate($text, true, $login_menu_shortcodes);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation cancelAchTransferUsingDeleteWithHttpInfo Cancel the ACH transfer | public function cancelAchTransferUsingDeleteWithHttpInfo($nucleus_funding_id)
{
$returnType = '\com\hydrogen\integration\Model\AchTransferResponseVO';
$request = $this->cancelAchTransferUsingDeleteRequest($nucleus_funding_id);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\com\hydrogen\integration\Model\AchTransferResponseVO',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function deleteTransferUsingDeleteWithHttpInfo($transfer_id)\n {\n $returnType = '';\n $request = $this->deleteTransferUsingDeleteRequest($transfer_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function cancelWireTransferUsingDeleteWithHttpInfo($nucleus_funding_id)\n {\n $returnType = '\\com\\hydrogen\\integration\\Model\\WireTransferResponseVO';\n $request = $this->cancelWireTransferUsingDeleteRequest($nucleus_funding_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $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 '\\com\\hydrogen\\integration\\Model\\WireTransferResponseVO',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function warehouseTransferOutLineDELETERequestWarehouseTransferOutIDLinesWarehouseTransferOutLineIDDeleteAsyncWithHttpInfo($accept, $warehouse_transfer_out_id, $warehouse_transfer_out_line_id, $jiwa_stateful = null, $item_no = null, $inventory_id = null, $part_no = null, $description = null, $decimal_places = null, $quantity_wanted = null, $quantity_transferred = null, $quantity_back_ordered = null, $cost = null, $ref = null, $back_order_id = null, $purchase_order_id = null, $purchase_order_line_id = null, $total_cost_transferred = null, $total_cost_received = null, $added_cost_ledger1_rec_id = null, $added_cost_ledger1_account_no = null, $added_cost_ledger1_description = null, $added_cost_ledger2_rec_id = null, $added_cost_ledger2_account_no = null, $added_cost_ledger2_description = null, $added_cost_ledger3_rec_id = null, $added_cost_ledger3_account_no = null, $added_cost_ledger3_description = null, $line_details = null)\n {\n $returnType = '\\Jiwa\\Model\\Object';\n $request = $this->warehouseTransferOutLineDELETERequestWarehouseTransferOutIDLinesWarehouseTransferOutLineIDDeleteRequest($accept, $warehouse_transfer_out_id, $warehouse_transfer_out_line_id, $jiwa_stateful, $item_no, $inventory_id, $part_no, $description, $decimal_places, $quantity_wanted, $quantity_transferred, $quantity_back_ordered, $cost, $ref, $back_order_id, $purchase_order_id, $purchase_order_line_id, $total_cost_transferred, $total_cost_received, $added_cost_ledger1_rec_id, $added_cost_ledger1_account_no, $added_cost_ledger1_description, $added_cost_ledger2_rec_id, $added_cost_ledger2_account_no, $added_cost_ledger2_description, $added_cost_ledger3_rec_id, $added_cost_ledger3_account_no, $added_cost_ledger3_description, $line_details);\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 cancel( $orderid=\"1\", $opts = array() );",
"public function taxRateABANDONRequestAbandonDeleteAsyncWithHttpInfo($accept, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\Object';\n $request = $this->taxRateABANDONRequestAbandonDeleteRequest($accept, $jiwa_stateful);\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 delete16WithHttpInfo($accountId)\n {\n $returnType = '\\Frengky\\Fineract\\Model\\DeleteRecurringDepositAccountsResponse';\n $request = $this->delete16Request($accountId);\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 (!in_array($returnType, ['string','integer','bool'])) {\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 '\\Frengky\\Fineract\\Model\\DeleteRecurringDepositAccountsResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function creditorABANDONRequestAbandonDeleteAsyncWithHttpInfo($accept, $jiwa_stateful = null, $creditor_id = null)\n {\n $returnType = '\\Jiwa\\Model\\Object';\n $request = $this->creditorABANDONRequestAbandonDeleteRequest($accept, $jiwa_stateful, $creditor_id);\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 deleteWithHttpInfo($request)\n {\n $request = $this->deleteRequest($request);\n \n $response = $this->callClient($request);\n return [null, $response->getStatusCode(), $response->getHeaders()];\n }",
"public static function cancel(int $httpId);",
"protected function deleteTransferUsingDeleteRequest($transfer_id)\n {\n // verify the required parameter 'transfer_id' is set\n if ($transfer_id === null || (is_array($transfer_id) && count($transfer_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transfer_id when calling deleteTransferUsingDelete'\n );\n }\n\n $resourcePath = '/nucleus/v1/transfer/{transfer_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($transfer_id !== null) {\n $resourcePath = str_replace(\n '{' . 'transfer_id' . '}',\n ObjectSerializer::toPathValue($transfer_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function deleteUsingDELETEWithHttpInfo($consent_id, $force_delete = null)\n {\n $returnType = '\\Yapily\\Model\\ApiResponseOfConsentDeleteResponse';\n $request = $this->deleteUsingDELETERequest($consent_id, $force_delete);\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 '\\Yapily\\Model\\ApiResponseOfConsentDeleteResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function stockTransferDELETERequestTransferIDDeleteWithHttpInfo($accept, $transfer_id, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\Object';\n $request = $this->stockTransferDELETERequestTransferIDDeleteRequest($accept, $transfer_id, $jiwa_stateful);\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 '\\Jiwa\\Model\\Object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 204:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function deleteLogHoneycombAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\InlineResponse200';\n $request = $this->deleteLogHoneycombRequest($options);\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 }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function cancelAuthorization(Authorization $authorization, float $amount = null): Cancellation;",
"public function cancelOrderWithHttpInfo($order_id, $lock_self_ship_orders = null, $skip_refund_and_hold = null)\n {\n return $this->cancelOrderWithHttpInfoRetry(true , $order_id, $lock_self_ship_orders, $skip_refund_and_hold);\n }",
"public function warehouseTransferOutCANCELRequestWarehouseTransferOutIDDeleteWithHttpInfo($accept, $warehouse_transfer_out_id, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\Object';\n $request = $this->warehouseTransferOutCANCELRequestWarehouseTransferOutIDDeleteRequest($accept, $warehouse_transfer_out_id, $jiwa_stateful);\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 '\\Jiwa\\Model\\Object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 204:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function bookingCancelWithHttpInfo($restaurant_uid, $uid, $version)\n {\n $returnType = '';\n $request = $this->bookingCancelRequest($restaurant_uid, $uid, $version);\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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function auTimesheetDeleteIndividualWithHttpInfo($timesheet_line_id, $business_id, string $contentType = self::contentTypes['auTimesheetDeleteIndividual'][0])\n {\n $request = $this->auTimesheetDeleteIndividualRequest($timesheet_line_id, $business_id, $contentType);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function invoiceItemsDeleteAsyncWithHttpInfo($id, $x_apideck_consumer_id = null, $x_apideck_app_id = null, $x_apideck_service_id = null, $raw = false)\n {\n $returnType = '\\Apideck\\Client\\Model\\DeleteTaxRateResponse';\n $request = $this->invoiceItemsDeleteRequest($id, $x_apideck_consumer_id, $x_apideck_app_id, $x_apideck_service_id, $raw);\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 }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Genereate Condor docs and store data in $_SESSION['condor_data'] | private function Generate_Condor_Docs()
{
$application_id = $this->getCondorApplicationID();
$property_short = $this->ent_prop_short_list[$_SESSION['config']->site_name];
if ($this->Is_Ecash3($property_short))
{
require_once(BFW_CODE_DIR.'condor_display.class.php');
require_once ("prpc/client.php");
// Mantis #12161 - added in the check for card loan or standard loan for docs. [RV]
$condor_template = ($_SESSION['data']['loan_type'] == 'card' || $_SESSION['cs']['loan_type'] == 'card') ? "Card Loan Document" : "Loan Document";
$condor_display = new Condor_Display();
if(empty($_SESSION['data']['ecash_sign_docs']))
{
$token_data = $condor_display->Generate_Condor_Tokens();
}
else
{
$ent_cs = $this->Get_Ent_Cs($property_short);
$token_data = $condor_display->Rename_Tokens($ent_cs->Prepare_Condor_Data($application_id));
}
$prpc_server = Server::Get_Server($this->config->mode, 'CONDOR', $property_short);
$condor_api = new prpc_client("prpc://{$prpc_server}/condor_api.php");
/*
We need to pass in the track and space key so that Condor can hit stats
associated with this document/application.
*/
$_SESSION['condor_data'] = $condor_api->Create(
$condor_template, // Template
$token_data, // Data
TRUE, // Archive
$application_id, // Application ID
$_SESSION['statpro']['track_key'], // Track key
$_SESSION['statpro']['space_key'] // Space key
);
if(!isset($_SESSION['data']['ecash_sign_docs']))
{
$this->Document_Event($property_short);
}
}
} | [
"public function loadDocsFromUserSession() {}",
"function _createDocmanDocument($sessionKey, $group_id, $parent_id, $title, $description, $ordering, $status, $obsolescence_date, $type, $permissions, $metadata, $owner, $create_date, $update_date, $extraParams = array()) {\n if ($obsolescence_date !== null) $extraParams['item']['obsolescence_date'] = $obsolescence_date;\n return _createDocmanItem($sessionKey, $group_id, $parent_id, $title, $description, $ordering, $status, $type, $permissions, $metadata, $owner, $create_date, $update_date, $extraParams);\n}",
"function getDocument() {\n\t\tglobal $nom;\n\t\t$this->buffer .= \"{\";\n\t\t// Header\n\t\t$this->buffer .= $this->getHeader();\n\t\t// Font table\n\t\t$this->buffer .= $this->getFontTable();\n\t\t// Colour table\n\t\t$this->buffer .= $this->getColourTable();\n\t\t// File Information\n\t\t$this->buffer .= $this->getInformation();\n\t\t// Default font values\n\t\t$this->buffer .= $this->getDefaultFont();\n\t\t// Page display settings\n\t\t$this->buffer .= $this->getPageSettings();\n\t\t// Parse the text into RTF\n\t\t$this->buffer .= $this->parseDocument();\n\t\t$this->buffer .= \"}\";\n\t\t\n\t\theader(\"Content-Type: text/enriched\\n\");\n\t\theader(\"Content-Disposition: attachment; filename=$nom\");\n\t\techo $this->buffer;\n\t}",
"function generateDocumentation()\n{\n $docs = shell_exec('jsduck src lib/sugarapi --output docs 2>&1');\n}",
"public function userDocuments();",
"public function create_doc() {\n check_ajax_referer('muiteerdocs-admin-nonce');\n\n $title = isset( $_POST['title'] ) ? sanitize_text_field( $_POST['title'] ) : '';\n $status = isset( $_POST['status'] ) ? sanitize_text_field( $_POST['status'] ) : 'draft';\n $parent = isset( $_POST['parent'] ) ? absint( $_POST['parent'] ) : 0;\n $order = isset( $_POST['order'] ) ? absint( $_POST['order'] ) : 0;\n\n $status = 'publish';\n $post_type_object = get_post_type_object('docs');\n\n if ( ! current_user_can($post_type_object->cap->publish_posts) ) {\n $status = 'pending';\n }\n\n $post_id = wp_insert_post( array(\n 'post_title' => $title,\n 'post_type' => 'docs',\n 'post_status' => $status,\n 'post_parent' => $parent,\n 'post_author' => get_current_user_id(),\n 'menu_order' => $order\n ) );\n\n if ( is_wp_error( $post_id ) ) {\n wp_send_json_error();\n }\n\n wp_send_json_success( array(\n 'post' => array(\n 'id' => $post_id,\n 'title' => stripslashes($title),\n 'status' => $status,\n 'caps' => array(\n 'edit' => current_user_can($post_type_object->cap->edit_post, $post_id),\n 'delete' => current_user_can($post_type_object->cap->delete_post, $post_id)\n )\n ),\n 'child' => array()\n ) );\n }",
"function CreateDocument(){}",
"public static function register_docs() {\n\n\t}",
"public function sAddDoc(){\n\t\t$aTempData = explode('_', $this->sDocUuid);\n\t\t$sSystem = $aTempData[0];\n\t\t$iFolderNo = $aTempData[1];\n\n\t\t$oDB = self::oDB($sSystem);\t//equal to $oDB = self::oDB($this->sSystem);\n\t\t$oCurrentUser = self::$session->get('oCurrentUser');\n\n\t\tif(is_null($oCurrentUser))\n\t\t\t$this->__iUserNo = 0;\n\t\telse\n\t\t\t$this->__iUserNo = $oCurrentUser->iUserNo;\n\n\t\ttry{\n\t\t\t$oDB->vBegin();\n\n\t\t\t$aEncodeContent = array();\n\t\t\t//insert all doc element\n\t\t\tforeach ($this->__aCDocElement as $oCDocElement) {\n\t\t\t\t$oCDocElement->vAdd();\n\t\t\t\t/*\n\t\t\t\tif(!empty($oCDocElement->aOption))\n\t\t\t\t\t$aEncodeContent['element_mapping_no_'.$oCDocElement->iElementMappingNo] = $oCDocElement->aOption;\n\t\t\t\telse\n\t\t\t\t\t$aEncodeContent['element_mapping_no_'.$oCDocElement->iElementMappingNo] = $oCDocElement->sValue;\n\t\t\t\t*/\n\t\t\t\tif($oCDocElement->iElementMappingNo == 5 || $oCDocElement->iElementMappingNo==32)\n\t\t\t\t\t$aEncodeContent['element_mapping_no_'.$oCDocElement->iElementMappingNo] = $oCDocElement->sValue;\n\t\t\t}\n\t\t\t$this->sEncode = md5(json_encode($aEncodeContent));\n\n\t\t\t//insert doc attr\n\t\t\t$sDate = date(\"Y-m-d H:i:s\");\n\t\t\t$aValues = array(\t'docs_no'=>$this->sDocUuid,\n\t\t\t\t\t\t\t\t'docs_encode'=>$this->sEncode,\n\t\t\t\t\t\t\t\t'docs_note'=>$this->sDocsNote,\n\t\t\t\t\t\t\t\t'docs_status'=>$this->bStatus,\n\t\t\t\t\t\t\t\t'user_no'=>$oCurrentUser->iUserNo,\n\t\t\t\t\t\t\t\t'createtime'=>$sDate,\n\t\t\t\t\t\t\t\t'modifiedtime'=>$sDate\n\t\t\t\t\t\t\t);\n\t\t\t$oDB->sInsert(\"galaxy_docs_$iFolderNo\",array_keys($aValues),array_values($aValues));\n\n\t\t\t//upload file\n\t\t\t$this->vUploadFile($_FILES);\n\n\t\t\t$oDB->vCommit();\n\t\t\tif(!is_null($oCurrentUser))\n\t\t\t\t$oCurrentUser->vAddUserLog(\"galaxy_docs_\".$iFolderNo,$this->sDocUuid,'docs','add');\n\t\t\treturn $this->sDocUuid;\n\t\t}catch (Exception $e){\n\t\t\t$oDB->vRollback();\t\n\t\t\tthrow new Exception('CDoc->sAddDoc: '.$e->getMessage());\n\t\t}\n\t}",
"public function _get_doc()\n\t{\n\t\t$data = array(\n\t\t\t'name' => $this->input->post('name'),\n\t\t\t'type' => $this->input->post('type'),\n\t\t\t'status' => $this->input->post('status'),\n\t\t);\n\n\t\treturn $data;\n\t}",
"public function docGenerate()\n {\n $this->_exec('cd '.__DIR__.'/docs && composer install');\n $this->_exec(__DIR__.'/docs/build');\n $this->_exec(__DIR__.'/vendor/bin/couscous preview');\n }",
"function constructdocument($orderid, $document_type, $sub_doc_id, $user_id, $client_id, $draft = 0, $UploadedFor = false){\n $offsethours = 0;\n $data = array(\"created\" => $this->offsettime($offsethours, \"hours\"), \"order_id\" => $orderid);\n //$data[\"description\"] = \"Website order\";\n $data[\"document_type\"] = $document_type;\n $data[\"sub_doc_id\"] = $sub_doc_id;\n $data[\"user_id\"] = $user_id;\n $data[\"client_id\"] = $client_id;\n if(!$UploadedFor){$UploadedFor = $user_id;}\n $data[\"uploaded_for\"] = $UploadedFor;\n $data[\"draft\"] = $draft;\n return $this->insertdb(\"documents\", $data)->id;\n }",
"public function documents()\r\n\t{\r\n\t\ttry{\r\n\t\t\t$data[\"utilisateur\"] = $this->profil_model->recuperer_mes_donnees();\r\n\t\t\t$data[\"projets\"] = $this->profil_model->recuperer_mes_projets();\r\n\t\t\t$data[\"documents\"] = $this->profil_model->recuperer_mes_documents();\r\n\t\t\t$data[\"t_title\"] = \"Documents de \".$data[\"utilisateur\"]->nom.\" \".$data[\"utilisateur\"]->prenom;\r\n\t\t\t$data[\"t_sub\"] \t = \"documents\";\r\n\t\t} catch (Exception $e) {\r\n\t\t\tif($e->getCode() == 700) {\r\n\t\t\t\t$this->session->set_flashdata(\"Veuillez vous connecter.\");\r\n\t\t\t\tredirect(\"session/deconnexion\");\r\n\t\t\t} \r\n\t\t}\r\n\t\t$this->template->render(\"membre/mes_documents\",$data);\r\n\t}",
"protected function createBasicDocument()\n\t{\n\t\t$this->head = $this->getDefaultHead();\n\t\t$this->langstrings = array();\n\t}",
"public function BuildDocument()\n {\n return \"<!DOCTYPE html>\n <html lang=\\\"en\\\">\n <head>\n <meta charset=\\\"UTF-8\\\">\n <meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\">\n <title>Document</title>\n </head>\n <body>\n {$this->bodyContent}\n </body>\n </html>\";\n }",
"public function getDoc() {\r\n }",
"public function action_documents()\n\t{\n\t\tif (HTTP_Request::GET == $this->request->method()) { \n $objToArr = function($obj) {\n return $obj->as_array();\n };\n\n\t\t\t$docs = array_map(\n $objToArr,\n\t\t\t\tORM::factory('File')->get_files_by_type('application/pdf')->as_array()\t\t\n\t\t\t);\n\n\t\t\tfor ($i = 0; $i < count($docs); $i++)\n\t\t\t{\n\t\t\t\t$docs[$i]['link'] = UPLOADDIR.'/'.UPLOADPDFDIR.'/'.$docs[$i]['filename'];\n\t\t\t}\n\t\t\t\n\t\t\t$this->template->result = $docs;\n\t\t}\n\t}",
"public function docsGenerate()\n {\n $this->docsClean();\n $this->docsPhpdoc();\n $this->docsCoverage();\n }",
"public function test() {\n // $templateProcessor->setValue('no', '0001/SKD/KEL-ATG/VI/2018');\n // $templateProcessor->setValue('nama', 'Gugi Gustaman');\n // $templateProcessor->setValue('nik', '3273152708920003');\n // $templateProcessor->setValue('no_kk', '3273152708920001');\n // $templateProcessor->setValue('jk', 'Laki-laki');\n // $templateProcessor->setValue('tmpt_lahir', 'BANDUNG');\n // $templateProcessor->setValue('tgl_lahir', '27 AGUSTUS 1992');\n // $templateProcessor->setValue('status', 'BELUM KAWIN');\n // $templateProcessor->setValue('pekerjaan', 'Karyawan Swasta');\n // $templateProcessor->setValue('agama', 'Islam');\n // $templateProcessor->setValue('alamat', 'Jl. Jend. Sudirman, Gg. Manunggal IIC, RT. 007 RW. 001 No. 54');\n // $templateProcessor->setValue('tanggal', Carbon::now()->format('d M Y'));\n\n // $templateProcessor->saveAs('test.docx');\n // $phpWord = \\PhpOffice\\PhpWord\\IOFactory::load('test.docx'); // Read the temp file\n // $xmlWriter = \\PhpOffice\\PhpWord\\IOFactory::createWriter($phpWord, 'Word2007');\n // $xmlWriter->save('result.docx');\n\n // header(\"Location: result.docx\");\n\n\n $docxTemplate = new DocxTemplate(storage_path('SKD_TEMPLATE.docx'));\n $dataArray = [\n 'no' => '0001/SKD/KEL-ATG/VI/2018',\n 'nama' => 'Gugi Gustaman',\n 'nik' => '3273152708920003',\n 'no_kk' => '3273152708920001',\n 'jk' => 'Laki-laki',\n 'tmpt_lahir' => 'BANDUNG',\n 'tgl_lahir' => '27 AGUSTUS 1992',\n 'status' => 'BELUM KAWIN',\n 'pekerjaan' => 'Karyawan Swasta',\n 'agama' => 'Islam',\n 'alamat' => 'Jl. Jend. Sudirman => Gg. Manunggal IIC => RT. 007 RW. 001 No. 54',\n 'tanggal' => Carbon::now()->format('d M Y')\n ];\n\n $docxTemplate->merge($dataArray,'test.docx');\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves all assets information saved in data, including css,js and jquery | public function getAssets(){
$assets = $this->sortAssets();
foreach($assets as $nodeKey => $nodeValue) {
if ($nodeValue['type'] === 'css') {
echo "<link href='" . '/assets/css/' . $nodeValue['file'] . "' rel='stylesheet'>" . "\n";
} elseif ($nodeValue['type'] === 'js') {
echo "<script src='" . '/assets/' . $nodeValue['file'] . "'></script>" . "\n";
} elseif ($nodeValue['type'] === 'jquery') {
echo "<script src='" . $nodeValue['file'] . "'></script>" . "\n";
};
}
} | [
"protected function assets()\n {\n return json_decode(file_get_contents(APPPATH . '../etc/assets.json'), true);\n }",
"public function getJsAssets();",
"protected function get_assets() {\n\t\treturn [];\n\t}",
"static function assetsBody($data){\n\t\t$resources = RenderHelper::loadResources($data->assets);\n\t\t$js_arr = $resources->filter(function ($name){\n\t\t\treturn rs::extname($name) == \"js\";\n\t\t});\n\t\t$js_arr = $js_arr->pushIm(\"@Core.UI/es6/Drivers/RenderDriver.js\");\n\t\t$js_arr = $js_arr->pushIm(\"@Core.UI/es6/Drivers/ApiBusDriver.js\");\n\t\t$js_arr = static::patchAssets($data, $js_arr);\n\t\t$js_arr = $js_arr->map(function ($js){\n\t\t\treturn rtl::normalizeUIVector(new Vector(\n\t\t\tnew UIStruct(new Map([\n\t\t\t\"space\"=>\"bdb8\",\n\t\t\t\"class_name\"=>static::getCurrentClassName(),\n\t\t\t\"name\"=>\"script\",\n\t\t\t\"props\"=>(new Map())\n\t\t\t\t->set(\"src\", $js)\n\t\t\t,\n\t\t\t]))));\n\t\t});\n\t\treturn $js_arr;\n\t}",
"protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->assetsInfo[] = array(\n 'name' => \"/styles/{$this->theme}.css\",\n 'assetDir' => dirname(__FILE__) . \"/assets/highlight\"\n );\n $this->assetsInfo[] = array(\n 'name' => \"highlight.pack.js\",\n 'assetDir' => dirname(__FILE__) . \"/assets/highlight\"\n );\n }",
"public function getAssets();",
"public function getCssAssets();",
"private function getThemeJavascripts() {\n $jsRelPath = $this->settings['theme'] . '/Public/Javascripts/';\n $jsAbsPath = THEMES_PATH . $jsRelPath;\n return $this->fetchFiles($jsAbsPath, 'js', $jsRelPath);\n }",
"protected function _publishAssets() {\n // $this->jsObject['assets']['fundo-home2'] = $this->asset('img/home02.jpg', false);\n\t//\t$this->jsObject['assets']['fundo-home2'] = $this->asset('img/home02.png', false);\n // $this->jsObject['assets']['fundo-home3'] = $this->asset('img/home03.jpg', false);\n // $this->jsObject['assets']['fundo-home4'] = $this->asset('img/home04.jpg', false);\n // $this->jsObject['assets']['fundo-home5'] = $this->asset('img/home05.jpg', false);\n // $this->jsObject['assets']['fundo-home6'] = $this->asset('img/home06.jpg', false);\n $this->jsObject['assets']['logo-instituicao'] = $this->asset('img/mapasculturais_logo-instituicao.svg', false);\n\t//\t$this->jsObject['assets']['logo-estado'] = $this->asset('img/logoMT.png', false);\n\t//\t$this->jsObject['assets']['logo-estado2'] = $this->asset('img/logoMT2.png', false);\n\n // $this->jsObject['assets']['mapa-das-nuvens'] = $this->asset('img/mapasculturais_logo-site.png', false);\n // $this->jsObject['assets']['logo-gov'] = $this->asset('img/logo-gov.png', false);\n // $this->jsObject['assets']['OBEC-Logo'] = $this->asset('img/OBEC-Logo.png', false);\n // $this->jsObject['assets']['logo-unb'] = $this->asset('img/logo-unb.png', false);\n // $this->jsObject['assets']['logo-tim'] = $this->asset('img/logo-tim.png', false);\n }",
"public function getCssAssets()\n\t{\n\t\treturn array();\n\t}",
"public static function getAssets() {\n $path = ExtensionManagementUtility::extPath('custom_fluid_styled_content') . 'Resources/Public/';\n\n if (file_exists($path)) {\n foreach (glob(ExtensionManagementUtility::extPath('custom_fluid_styled_content') . 'Resources/Private/ContentElements/*/Assets/*') as $assetFolder) {\n if (is_dir($assetFolder)) {\n foreach(glob($assetFolder .'/*') as $file) {\n if (is_file($file)) {\n self::$assets[pathinfo($assetFolder)['basename']][] = $file;\n }\n }\n }\n }\n }\n\n return self::$assets;\n }",
"public function getAllJsAssets(): array\n {\n return array_merge($this->header_js_files, $this->footer_js_files);\n }",
"public function get_assets_all()\n {\n return $this->assets;\n }",
"public function allAssets(): array;",
"public function findAssets()\n {\n return $this->repository->findAll();\n }",
"public function getJsAssets()\n\t{\n\t\treturn array();\n\t}",
"public function getPageAssets() {\n // code taken from View->endBody(), but without actually echoing html\n foreach (array_keys($this->assetBundles) as $bundle) {\n $this->registerAssetFiles($bundle);\n }\n\n return [\n 'head' => $this->renderHeadHtml(),\n 'body' => $this->renderBodyBeginHtml(),\n 'end' => $this->renderBodyEndHtml(false /* ajaxMode */)\n ];\n\n }",
"public function getAssets()\n {\n $configuration = $this->getConfiguration();\n $assets = parent::getAssets();\n if (isset($configuration['css'])) {\n if (is_array($configuration['css'])) {\n $assets['css'] = array_merge($assets['css'], $configuration['css']);\n } else {\n $assets['css'][] = $configuration['css'];\n }\n }\n return $assets;\n }",
"public function getAllCssAssets(): array\n {\n return $this->css_files;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that the name search returns the correct record count One result should be returned in this case | public function test_countnamesearchfound() {
$this->load_csv_data();
$result = track_assignment_count_records(1, "alphaclass");
$this->assertEquals(1, (int)$result);
} | [
"public function test_countnamesearchnotfound() {\n $this->load_csv_data();\n $result = track_assignment_count_records(1, \"beta\");\n $this->assertEquals(0, (int)$result);\n }",
"function countName() {\n \t$num = safe_row(\"COUNT(\".$this->field.\")\" , 'textpattern' , $this->where);\n \t\treturn $num[\"COUNT(\".$this->field.\")\"];\n }",
"public function testCountUsingFinderByConditions()\n {\n $this->assertEquals(1, $this->pool->find(Writer::class)->where('`name` LIKE ?', '%Leo%')->count());\n }",
"function testNumResults()\n {\n $searchRequest = $this->requestFactory->getSearchRequest();\n $searchRequest->setQuery('dc.title:danmark');\n $searchRequest->setNumResults(1);\n $searchResult = $this->client->execute($searchRequest);\n \n $this->assertNoErrors('Search should not throw errors');\n \n $this->assertEqual(sizeof($searchResult->numTotalCollections), 1, 'Returned collection count does not match requested number'); \n $this->assertEqual(sizeof($searchResult->collections), 1, 'Returned number of results does not match requested number'); \n }",
"public function nameExists(){\n $where = $this->_db->quoteInto('name = ?',$this->_model->name);\n $players = $this->findAll($where);\n return count($players);\n }",
"public function testSearchName()\n {\n $this->seed();\n \n $response = $this->get('/api/mix/search/space');\n\n $response\n ->assertStatus(200)\n ->assertJson(\n [\"0\" => [\"name\" => \"Tropical Space Pirate\"]]\n );\n\n $response = $this->get('/api/mix/search/invalid');\n\n $response\n ->assertStatus(200)\n ->assertJson(\n [\"error\" => \"not found\"]\n );\n }",
"public function testGetNbResults()\n {\n $this->service->expects($this->any())\n ->method('execute')\n ->with($this->search)\n ->will($this->returnValue([\n 'hits' => [\n 'total' => 2,\n 'hits' => [\n ['_source' => ['id' => 'd1', 'field1' => 'value1']],\n ['_source' => ['id' => 'd2', 'field1' => 'value1']],\n ],\n ],\n ]));\n\n $this->assertEquals(2, $this->adapter->getNbResults());\n }",
"public function testFindCountBySql()\n {\n $sql = \"SELECT count(1) FROM unit_tests WHERE text_value=:text\";\n $testCnt = UnitTest::countBySql($sql, array(':text' => 'string a'));\n $this->assertEquals('2', $testCnt);\n }",
"public function testGetCount()\n {\n $recordingResultSet = new \\MphpMusicBrainz\\ResultSet\\RecordingResultSet($this->getAdapter(), $this->query, $this->limit);\n $this->assertEquals(6378, $recordingResultSet->getCount());\n }",
"public function testSearchCountPOST()\n {\n }",
"function testCapCountSelectWord(){\r\n\t\r\n\t$abstract = \"find the needle NEEDLE needle in the haystack\";\r\n\r\n\t$a = new APICall(\"needle\");\t\r\n\r\n\t$f = (int)$a->count_select_word($abstract, $a->searchQuery);\r\n\r\n\t$this->assertEquals($f, 4);\r\n\t\r\n\t}",
"public function getNameDuplicateCount();",
"public function testCount(): void\n {\n $query = $this->table->find('all');\n $results = $query->all();\n\n $this->assertCount(3, $results, 'Should be countable and 3');\n }",
"public function testCount()\n {\n //echo $count;\n $count = $this->_table->count(\"select id from ceshi\");\n }",
"public function findCount()\n {\n }",
"function testGetTotalMatch(){\n\n $Matches = $this->executeQuery('select match_id from tbl_match where team1='.$_GET['team_id'].' OR team2='.$_GET['team_id']);\n $TeamCount = count($Matches);\n\n $team = new Team();\n\n $this->assertEquals($TeamCount,$team->getTotalMatch($_GET['team_id']));\n }",
"public function findByNameCount(string $name): int\n {\n $exists = Kalyannaya::select('id')\n ->where('name', '=', $name)\n ->get()\n ->count();\n\n return $exists;\n }",
"public function testGetCountWhereClause()\n {\n $this->_populateTestData();\n $this->_populateMoreTestData();\n\n $result = $this->_object->getCount('users', 'id=1');\n\n $this->assertEquals(1, $result);\n }",
"public function testCount()\n {\n static::assertCount(9, $this->cursor, 'Incorrect count result returned by method');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sync variable product prices with the children lowest/highest prices. | public function variable_product_sync( $product_id = '' ) {
if ( empty( $product_id ) )
$product_id = $this->id;
// Sync prices with children
self::sync( $product_id );
// Re-load prices
$this->price = get_post_meta( $product_id, '_price', true );
foreach ( array( 'price', 'regular_price', 'sale_price' ) as $price_type ) {
$min_variation_id_key = "min_{$price_type}_variation_id";
$max_variation_id_key = "max_{$price_type}_variation_id";
$min_price_key = "_min_variation_{$price_type}";
$max_price_key = "_max_variation_{$price_type}";
$this->$min_variation_id_key = get_post_meta( $product_id, '_' . $min_variation_id_key, true );
$this->$max_variation_id_key = get_post_meta( $product_id, '_' . $max_variation_id_key, true );
$this->$min_price_key = get_post_meta( $product_id, '_' . $min_price_key, true );
$this->$max_price_key = get_post_meta( $product_id, '_' . $max_price_key, true );
}
} | [
"public function variable_product_sync() {\n\t\tglobal $woocommerce;\n\n\t\tparent::variable_product_sync();\n\n\t\t$children = get_posts( array(\n\t\t\t'post_parent' \t=> $this->id,\n\t\t\t'posts_per_page'=> -1,\n\t\t\t'post_type' \t=> 'product_variation',\n\t\t\t'fields' \t\t=> 'ids',\n\t\t\t'post_status'\t=> 'publish'\n\t\t));\n\n\t\tif ( $children ) {\n\t\t\tforeach ( $children as $child ) {\n\n\t\t\t\t$child_price = get_post_meta( $child, '_price', true );\n\t\t\t\t$child_billing_period = get_post_meta( $child, '_subscription_period', true );\n\n\t\t\t\t// We only care about the lowest price\n\t\t\t\tif ( $child_price !== $this->min_variation_price )\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Set to the shortest possible billing period\n\t\t\t\t$this->subscription_period = WC_Subscriptions::get_longest_period( $this->subscription_period, $child_billing_period );\n\t\t\t}\n\n\t\t\t$woocommerce->clear_product_transients( $this->id );\n\t\t}\n\n\t}",
"protected function update_prices_from_children(&$product)\n {\n }",
"private function setPrices($product)\n {\n if ($product->getTypeId() == 'configurable') {\n foreach ($product->getTypeInstance()->getUsedProducts($product) as $childProduct) {\n $childPrices[] = $childProduct->getPrice();\n if ($childProduct->getSpecialPrice() !== null) {\n $childSpecialPrices[] = $childProduct->getSpecialPrice();\n }\n }\n $price = isset($childPrices) ? min($childPrices) : null;\n $specialPrice = isset($childSpecialPrices) ? min($childSpecialPrices) : null;\n } elseif ($product->getTypeId() == 'bundle') {\n $price = $product->getPriceInfo()->getPrice('regular_price')->getMinimalPrice()->getValue();\n $specialPrice = $product->getPriceInfo()->getPrice('final_price')->getMinimalPrice()->getValue();\n //if special price equals to price then its wrong.\n $specialPrice = ($specialPrice === $price) ? null : $specialPrice;\n } elseif ($product->getTypeId() == 'grouped') {\n foreach ($product->getTypeInstance()->getAssociatedProducts($product) as $childProduct) {\n $childPrices[] = $childProduct->getPrice();\n if ($childProduct->getSpecialPrice() !== null) {\n $childSpecialPrices[] = $childProduct->getSpecialPrice();\n }\n }\n $price = isset($childPrices) ? min($childPrices) : null;\n $specialPrice = isset($childSpecialPrices) ? min($childSpecialPrices) : null;\n } else {\n $price = $product->getPrice();\n $specialPrice = $product->getSpecialPrice();\n }\n $this->formatPriceValues($price, $specialPrice);\n }",
"public function updateMinimumPrice(): void\n {\n $this->getProduct()->setMinimumPrice($this->getFinalPrice());\n }",
"public function sync_price(&$product);",
"public function UpdatePriceToLowestVariant()\n {\n /** @var TdbShopArticle $product */\n $product = $this->oTable;\n $oLowestPriceVariant = $product->GetLowestPricedVariant();\n if ($oLowestPriceVariant) {\n $aData = array('price' => $oLowestPriceVariant->fieldPriceFormated, 'price_reference' => $oLowestPriceVariant->fieldPriceReferenceFormated);\n $this->SaveFields($aData, false);\n }\n }",
"public function syncProducts()\n {\n // First, grab all products within the scope of this discount\n $products = Product::whereIn('id', $this->products->lists('id'))\n ->orWhereHas('categories', function($category) {\n $category->where(function($query) {\n $query\n ->whereIn('id', $this->categories->lists('id'))\n ->orWhereHas('inherited_by', function($inherited_by) {\n $inherited_by->whereIn('parent_id', $this->categories->lists('id'));\n });\n });\n })\n ->get();\n\n // Next, reset all discounted price models\n $this->prices()->delete();\n foreach ($products as $product) {\n Price::create([\n 'product_id' => $product->id,\n 'discount_id' => $this->id,\n 'price' => $this->calculate($product->base_price),\n 'start_at' => $this->start_at,\n 'end_at' => $this->end_at\n ]);\n }\n }",
"protected function sort_variation_prices( $prices ) {\n\n\t\t// If we don't have any prices, there's nothing to sort.\n\t\tif ( empty( $prices ) ) {\n\t\t\treturn $prices;\n\t\t}\n\n\t\t$prices_hash = md5( json_encode( $prices ) );\n\n\t\tif ( empty( $this->sorted_variation_prices[ $prices_hash ] ) ) {\n\n\t\t\t$child_variation_ids = array_keys( $prices );\n\t\t\t$variation_hash = md5( json_encode( $child_variation_ids ) );\n\n\t\t\tif ( empty( $this->min_max_variation_data[ $variation_hash ] ) ) {\n\t\t\t\t$this->min_max_variation_data[ $variation_hash ] = wcs_get_min_max_variation_data( $this, $child_variation_ids );\n\t\t\t}\n\n\t\t\t$min_variation_id = $this->min_max_variation_data[ $variation_hash ]['min']['variation_id'];\n\t\t\t$max_variation_id = $this->min_max_variation_data[ $variation_hash ]['max']['variation_id'];\n\n\t\t\t// Reorder the variable price arrays to reflect the min and max values so that WooCommerce will find them in the correct order\n\t\t\t$min_price = $prices[ $min_variation_id ];\n\t\t\t$max_price = $prices[ $max_variation_id ];\n\n\t\t\tunset( $prices[ $min_variation_id ] );\n\t\t\tunset( $prices[ $max_variation_id ] );\n\n\t\t\t// Prepend the minimum variation and append the maximum variation\n\t\t\t$prices = array( $min_variation_id => $min_price ) + $prices;\n\t\t\t$prices += array( $max_variation_id => $max_price );\n\n\t\t\t$this->sorted_variation_prices[ $prices_hash ] = $prices;\n\t\t}\n\n\t\treturn $this->sorted_variation_prices[ $prices_hash ];\n\t}",
"public function updateProductPrice(){\n\n $start = microtime(true);\n $importdate = date(\"d-m-Y H:i:s\", strtotime(\"now\"));\n $log = \"Product price update started at: \".$importdate;\n Mage::log($log, null, 'price_sync.log', true);\n\n $iProducts = Mage::getModel('xcentia_coster/product')\n ->getCollection()\n ->addFieldToFilter('cost_status', '1')\n ->setPageSize(500)\n ->setCurPage(1);\n\n if($iProducts->getSize() > 0){\n\n foreach($iProducts as $iProduct) {\n\n $iProductObject = Mage::getModel('xcentia_coster/product')->load( $iProduct->getId() );\n\n if($iProductObject->getSku()) {\n $price = $iProductObject->getCost() * self::MARGIN;\n $productId = Mage::getModel('catalog/product')->getIdBySku( $iProductObject->getSku() );\n if($productId){\n $product = Mage::getModel('catalog/product')->load($productId);\n $product->setPrice($price);\n try {\n $product->save();\n $iProductObject->setCost_status(0)->save();\n $log = \"\\n\".'updating price for SKU ['.$iProductObject->getSku().'] ID ['.$iProductObject->getEntity_id().\"]\\n\";\n Mage::log($log, null, 'price_sync.log', true);\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n }\n }\n }\n\n $time_elapsed_secs = microtime(true) - $start;\n $importdate = date(\"d-m-Y H:i:s\", strtotime(\"now\"));\n $log = \"Product price update finished at: \".$importdate.\" Done in \".round($time_elapsed_secs).\" seconds!\";\n Mage::log($log, null, 'price_sync.log', true);\n }",
"public function saveAllPricesToParent(DataContainer $dc)\n\t{\n\t\t// Return if there is no active record (override all)\n\t\tif (!$dc->activeRecord)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$itemObj = $this->Database->prepare('SELECT `price`,`count`,`vat`,`vat_incl`,`operator` FROM `tl_iao_invoice_items` WHERE `pid`=? AND published =?')\n\t\t\t\t\t\t\t\t\t->execute($dc->activeRecord->pid,1);\n\n\n\t\tif($itemObj->numRows > 0)\n\t\t{\n\t\t\t$allNetto = 0;\n\t\t\t$allBrutto = 0;\n\n\t\t\twhile($itemObj->next())\n\t\t\t{\n\t\t\t\t$englprice = str_replace(',','.',$itemObj->price);\n\t\t\t\t$priceSum = $englprice * $itemObj->count;\n\n\t\t\t\t//if MwSt inclusive\n\t\t\t\tif($itemObj->vat_incl == 1)\n\t\t\t\t{\n\t\t\t\t\t$Netto = $priceSum;\n\t\t\t\t\t$Brutto = $this->getBruttoPrice($priceSum,$itemObj->vat);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$Netto = $this->getNettoPrice($priceSum,$itemObj->vat);\n\t\t\t\t\t$Brutto = $priceSum;\n\t\t\t\t}\n\n\t\t\t\t//which operator is set?\n\t\t\t\tif($itemObj->operator == '-')\n\t\t\t\t{\n\t\t\t\t\t$allNetto -= $Netto;\n\t\t\t\t\t$allBrutto -= $Brutto;\n\t\t \t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$allNetto += $Netto;\n\t\t\t\t\t$allBrutto += $Brutto;\n\t\t\t\t}\n\n\t\t \t$this->Database->prepare('UPDATE `tl_iao_invoice` SET `price_netto`=?, `price_brutto`=? WHERE `id`=?')\n\t\t\t\t->limit(1)\n\t\t\t\t->execute($allNetto, $allBrutto, $dc->activeRecord->pid);\n\t\t\t}\n\t\t}\n\t}",
"protected function getMinConfigurablePrices($product)\r\n {\r\n foreach ($product->getTypeInstance()->getChildrenIds($product->getId()) as $childProductIds) {\r\n foreach ($childProductIds as $id) {\r\n $productById = Mage::getModel('catalog/product')->load($id);\r\n $childPrices[] = $productById->getPrice();\r\n if ($productById->getSpecialPrice() !== null) {\r\n $childSpecialPrices[] = $productById->getSpecialPrice();\r\n }\r\n }\r\n }\r\n $this->price = isset($childPrices) ? min($childPrices) : null;\r\n $this->specialPrice = isset($childSpecialPrices) ? min($childSpecialPrices) : null;\r\n }",
"public static function sync( $product_id ) {\n\t\tglobal $wpdb;\n\n\t\t$children = get_posts( array(\n\t\t\t'post_parent' \t=> $product_id,\n\t\t\t'posts_per_page'=> -1,\n\t\t\t'post_type' \t=> 'product_variation',\n\t\t\t'fields' \t\t=> 'ids',\n\t\t\t'post_status'\t=> 'publish'\n\t\t) );\n\n\t\t// No published variations - update parent post status. Use $wpdb to prevent endless loop on save_post hooks.\n\t\tif ( ! $children && get_post_status( $product_id ) == 'publish' ) {\n\t\t\t$wpdb->update( $wpdb->posts, array( 'post_status' => 'draft' ), array( 'ID' => $product_id ) );\n\n\t\t\tif ( is_admin() ) {\n\t\t\t\tWC_Admin_Meta_Boxes::add_error( __( 'This variable product has no active variations so cannot be published. Changing status to draft.', 'woocommerce' ) );\n\t\t\t}\n\n\t\t// Loop the variations\n\t\t} else {\n\t\t\t// Main active prices\n\t\t\t$min_price = null;\n\t\t\t$max_price = null;\n\t\t\t$min_price_id = null;\n\t\t\t$max_price_id = null;\n\n\t\t\t// Regular prices\n\t\t\t$min_regular_price = null;\n\t\t\t$max_regular_price = null;\n\t\t\t$min_regular_price_id = null;\n\t\t\t$max_regular_price_id = null;\n\n\t\t\t// Sale prices\n\t\t\t$min_sale_price = null;\n\t\t\t$max_sale_price = null;\n\t\t\t$min_sale_price_id = null;\n\t\t\t$max_sale_price_id = null;\n\n\t\t\tforeach ( array( 'price', 'regular_price', 'sale_price' ) as $price_type ) {\n\t\t\t\tforeach ( $children as $child_id ) {\n\t\t\t\t\t$child_price = get_post_meta( $child_id, '_' . $price_type, true );\n\n\t\t\t\t\t// Skip non-priced variations\n\t\t\t\t\tif ( $child_price === '' ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Skip hidden variations\n\t\t\t\t\tif ( 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) ) {\n\t\t\t\t\t\t$stock = get_post_meta( $child_id, '_stock', true );\n\t\t\t\t\t\tif ( $stock !== \"\" && $stock <= get_option( 'woocommerce_notify_no_stock_amount' ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Find min price\n\t\t\t\t\tif ( is_null( ${\"min_{$price_type}\"} ) || $child_price < ${\"min_{$price_type}\"} ) {\n\t\t\t\t\t\t${\"min_{$price_type}\"} = $child_price;\n\t\t\t\t\t\t${\"min_{$price_type}_id\"} = $child_id;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Find max price\n\t\t\t\t\tif ( $child_price > ${\"max_{$price_type}\"} ) {\n\t\t\t\t\t\t${\"max_{$price_type}\"} = $child_price;\n\t\t\t\t\t\t${\"max_{$price_type}_id\"} = $child_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Store prices\n\t\t\t\tupdate_post_meta( $product_id, '_min_variation_' . $price_type, ${\"min_{$price_type}\"} );\n\t\t\t\tupdate_post_meta( $product_id, '_max_variation_' . $price_type, ${\"max_{$price_type}\"} );\n\n\t\t\t\t// Store ids\n\t\t\t\tupdate_post_meta( $product_id, '_min_' . $price_type . '_variation_id', ${\"min_{$price_type}_id\"} );\n\t\t\t\tupdate_post_meta( $product_id, '_max_' . $price_type . '_variation_id', ${\"max_{$price_type}_id\"} );\n\t\t\t}\n\n\t\t\t// The VARIABLE PRODUCT price should equal the min price of any type\n\t\t\tupdate_post_meta( $product_id, '_price', $min_price );\n\t\t\tdelete_transient( 'wc_products_onsale' );\n\n\t\t\tdo_action( 'woocommerce_variable_product_sync', $product_id, $children );\n\n\t\t\twc_delete_product_transients( $product_id );\n\t\t}\n\t}",
"public function get_variation_prices( $display = false ) {\n\n\t\t$price_hash = $this->get_price_hash( $this, $display );\n\n\t\t$this->prices_array[ $price_hash ] = parent::get_variation_prices( $display );\n\n\t\t$children = array_keys( $this->prices_array[ $price_hash ]['price'] );\n\t\tsort( $children );\n\n\t\t$min_max_data = wcs_get_min_max_variation_data( $this, $children );\n\n\t\t$min_variation_id = $min_max_data['min']['variation_id'];\n\t\t$max_variation_id = $min_max_data['max']['variation_id'];\n\n\t\t// Reorder the variable price arrays to reflect the min and max values so that WooCommerce will find them in the correct order\n\t\tforeach ( $this->prices_array as $price_hash => $prices ) {\n\n\t\t\t// Loop over sale_price, regular_price & price values to update them on main array\n\t\t\tforeach ( $prices as $price_key => $variation_prices ) {\n\n\t\t\t\t$min_price = $prices[ $price_key ][ $min_variation_id ];\n\t\t\t\t$max_price = $prices[ $price_key ][ $max_variation_id ];\n\n\t\t\t\tunset( $prices[ $price_key ][ $min_variation_id ] );\n\t\t\t\tunset( $prices[ $price_key ][ $max_variation_id ] );\n\n\t\t\t\t// append the minimum variation and prepend the maximum variation\n\t\t\t\t$prices[ $price_key ] = array( $min_variation_id => $min_price ) + $prices[ $price_key ];\n\t\t\t\t$prices[ $price_key ] += array( $max_variation_id => $max_price );\n\n\t\t\t\t$this->prices_array[ $price_hash ][ $price_key ] = $prices[ $price_key ];\n\t\t\t}\n\t\t}\n\n\t\t$this->subscription_price = $min_max_data['min']['price'];\n\t\t$this->subscription_period = $min_max_data['min']['period'];\n\t\t$this->subscription_period_interval = $min_max_data['min']['interval'];\n\n\t\t$this->max_variation_price = $min_max_data['max']['price'];\n\t\t$this->max_variation_period = $min_max_data['max']['period'];\n\t\t$this->max_variation_period_interval = $min_max_data['max']['interval'];\n\n\t\t$this->min_variation_price = $min_max_data['min']['price'];\n\t\t$this->min_variation_regular_price = $min_max_data['min']['regular_price'];\n\n\t\treturn $this->prices_array[ $price_hash ];\n\t}",
"function setSyncItemsPriceStandard()\n {\n }",
"private function organizePrices(): void\n {\n $newGroups = [];\n\n foreach($this->groups as $groups) {\n foreach($groups as $group) {\n $newGroups[(int) $group[\"totalPrice\"]] = $group;\n }\n }\n sort($newGroups);\n\n $this->groups = $newGroups;\n }",
"public function updatePrice()\n\t{\n\t\t$this->price_pT = $this->product->getCurrentPrice(strtotime($this->created_on));\n\t}",
"public function saveAllPricesToParent(DataContainer $dc)\n {\n // Return if there is no active record (override all)\n if (!$dc->activeRecord) return;\n\n $itemObj = DB::getInstance()->prepare('SELECT `price`,`count`,`vat`,`vat_incl` FROM `tl_iao_credit_items` WHERE `pid`=? AND published =?')\n ->execute($dc->activeRecord->pid,1);\n\n if($itemObj->numRows > 0)\n {\n $allNetto = 0;\n $allBrutto = 0;\n\n while($itemObj->next())\n {\n $englprice = str_replace(',','.',$itemObj->price);\n $priceSum = $englprice * $itemObj->count;\n\n if($itemObj->vat_incl == 1)\n {\n $allNetto += $priceSum;\n $allBrutto += $this->getBruttoPrice($priceSum,$itemObj->vat);\n }\n else\n {\n $allNetto += $this->getNettoPrice($priceSum,$itemObj->vat);\n $allBrutto += $priceSum;\n }\n\n DB::getInstance()->prepare('UPDATE `tl_iao_credit` SET `price_netto`=?, `price_brutto`=? WHERE `id`=?')\n ->limit(1)\n ->execute($allNetto, $allBrutto, $dc->activeRecord->pid);\n\n }\n }\n }",
"public function collectProductPrices()\n {\n $product = $this->getProduct();\n $xmlObject = $this->getProductXmlObj();\n\n if ($product && $product->getId()) {\n $type = $product->getTypeId();\n if (isset($this->_renderers[$type])) {\n $blockName = $this->_renderers[$type];\n } else {\n $blockName = $this->_defaultPriceRenderer;\n }\n\n $renderer = $this->getLayout()->getBlock($blockName);\n if (!$renderer) {\n $renderer = $this->getLayout()->createBlock($blockName);\n }\n\n if ($renderer) {\n $renderer->collectProductPrices($product, $xmlObject);\n }\n }\n }",
"public function getMinMaxPrice($data) { /* todo-materialize Remove before release! */\n\t\tif (!empty($data['config_tax'])) {\n\t\t\t$sql = \"SELECT MIN(IF(tp.tax_percent IS NOT NULL, IFNULL(ps.price, p.price) + (IFNULL(ps.price, p.price) * tp.tax_percent / 100) + IFNULL(ta.tax_amount, 0), IFNULL(ps.price, p.price)) * '\" . (float)$data['currency_ratio'] . \"') AS min_price, MAX(IF(tp.tax_percent IS NOT NULL, IFNULL(ps.price, p.price) + (IFNULL(ps.price, p.price) * tp.tax_percent / 100) + IFNULL(ta.tax_amount, 0), IFNULL(ps.price, p.price)) * '\" . (float)$data['currency_ratio'] . \"') AS max_price\";\n\t\t} else {\n\t\t\t$sql = \"SELECT MIN(IFNULL(ps.price, p.price) * '\" . (float)$data['currency_ratio'] . \"') AS min_price, MAX(IFNULL(ps.price, p.price) * '\" . (float)$data['currency_ratio'] . \"') AS max_price\";\n\t\t}\n\n\t\t$sql .= \" FROM \" . DB_PREFIX . \"product p LEFT JOIN \" . DB_PREFIX . \"product_to_category p2c ON (p.product_id = p2c.product_id) LEFT JOIN \" . DB_PREFIX . \"product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN (SELECT product_id, price FROM \" . DB_PREFIX . \"product_special ps WHERE ps.customer_group_id = '\" . (int)$this->config->get('config_customer_group_id') . \"' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS ps ON (p.product_id = ps.product_id)\";\n\n\t\tif (!empty($data['config_tax'])) {\n\t\t\t$sql .= \" LEFT JOIN (SELECT tr2.tax_class_id, tr1.rate AS tax_percent FROM \" . DB_PREFIX . \"tax_rate tr1 INNER JOIN \" . DB_PREFIX . \"tax_rate_to_customer_group tr2cg ON (tr1.tax_rate_id = tr2cg.tax_rate_id) LEFT JOIN \" . DB_PREFIX . \"tax_rule tr2 ON (tr1.tax_rate_id = tr2.tax_rate_id) WHERE tr1.type = 'P' AND tr2cg.customer_group_id = '\" . (int)$this->config->get('config_customer_group_id') . \"' ORDER BY tr2.priority) AS tp ON (p.tax_class_id = tp.tax_class_id) LEFT JOIN (SELECT tr2.tax_class_id, tr1.rate AS tax_amount FROM \" . DB_PREFIX . \"tax_rate tr1 INNER JOIN \" . DB_PREFIX . \"tax_rate_to_customer_group tr2cg ON (tr1.tax_rate_id = tr2cg.tax_rate_id) LEFT JOIN \" . DB_PREFIX . \"tax_rule tr2 ON (tr1.tax_rate_id = tr2.tax_rate_id) WHERE tr1.type = 'F' AND tr2cg.customer_group_id = '\" . (int)$this->config->get('config_customer_group_id') . \"' ORDER BY tr2.priority) AS ta ON (p.tax_class_id = ta.tax_class_id)\";\n\t\t}\n\n\t\t$sql .= \" WHERE p.date_available <= NOW() AND p.status = '1' AND p2s.store_id = '\" . (int)$this->config->get('config_store_id') . \"'\";\n\n\t\tif (!empty($data['category_id'])) {\n\t\t\t$sql .= \" AND p2c.category_id = '\" . (int)$data['category_id'] . \"'\";\n\t\t}\n\n\t\t$query = $this->db->query($sql);\n\n\t\treturn $query->row;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the LogStyler instance. | function log_styler()
{
return app(LogStyler::class);
} | [
"protected function getFormatter()\n {\n return $this->formatter ?: new Formatter();\n }",
"private static function getInstance() {\n\t\tif(self::$instance === null)\n\t\t\tself::$instance = new CSSManager();\n\t\treturn self::$instance;\n\t}",
"protected function _getWriter()\n {\n if (is_null($this->_logWritter)) {\n $this->_logWritter = $this->_getDefaultLogWritterInstance();\n }\n\n return $this->_logWritter;\n }",
"public function getRendererStyle(): RendererStyle\n {\n return new RendererStyle($this->pixels, $this->margin, $this->getModule(), $this->getEye(), $this->getFill());\n }",
"function getStyle() {\n\t\tglobal $gBitSystem;\n\t\tif( empty( $this->mStyle )) {\n\t\t\t$this->mStyle = $gBitSystem->getConfig( 'style' );\n\t\t}\n\t\treturn $this->mStyle;\n\t}",
"public function formatterManager()\n {\n return $this->formatterManager;\n }",
"public function getCssBuilder() {\n if ($this->cssBuilder != null) {\n return $this->cssBuilder;\n }\n try {\n $classPath = $this->getDefinedValue(\"CSS_BUILDER\");\n $this->cssBuilder = new $classPath();\n } catch (Exception $e) {\n throw $this->getDebugException(\"CSS UTILS NOT FOUND, please check in constants.php CSS_BUILDER variable\");\n }\n return $this->cssBuilder;\n }",
"public function getFormatter()\r\n {\r\n return $this->getComponent('formatter');\r\n }",
"function consoleFormatter ()\n {\n// if (!$this->kernelSettings->isConsoleBased) {\n// $consoleIO = $this->injector->make (ConsoleIOInterface::class);\n// return new ConsoleFormatter($consoleIO->getOutput (), $this->logSettings);\n// }\n return new LineFormatter;\n }",
"public function getStyle()\n\t{\n\t\treturn $this->root->getParser()->style;\n\t}",
"public function getRenderer()\n {\n if (!class_exists('\\\\PHPMD\\\\Writer\\\\StreamWriter')) {\n $renderClass = 'PHP_PMD_RENDERER_' . $this->className;\n $writerClass = 'PHP_PMD_Writer_Stream';\n include_once 'PHP/PMD/Renderer/' . $this->className . '.php';\n include_once 'PHP/PMD/Writer/Stream.php';\n } else {\n $renderClass = 'PHPMD\\Renderer\\\\' . $this->className;\n $writerClass = '\\PHPMD\\Writer\\StreamWriter';\n }\n\n $renderer = new $renderClass();\n\n // Create a report stream\n if ($this->getUseFile() === false || $this->getOutfile() === null) {\n $stream = STDOUT;\n } else {\n $stream = fopen($this->getOutfile()->getAbsoluteFile(), 'wb');\n }\n\n $renderer->setWriter(new $writerClass($stream));\n\n return $renderer;\n }",
"private function getFormatter()\n {\n if (null === $this->formatter) {\n $this->formatter = new StackTraceFormatter();\n }\n\n return $this->formatter;\n }",
"public static function init() {\r\n\t\treturn new Css();\r\n\t}",
"protected function getApp_FormatterService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php';\n include_once \\dirname(__DIR__, 4).'/src/Service/Formatter.php';\n\n $a = ($this->services['monolog.logger.trace'] ?? $this->getMonolog_Logger_TraceService());\n\n if (isset($this->services['app.formatter'])) {\n return $this->services['app.formatter'];\n }\n\n return $this->services['app.formatter'] = new \\App\\Service\\Formatter($a, ($this->services['lexik_jwt_authentication.jwt_manager'] ?? $this->getLexikJwtAuthentication_JwtManagerService()));\n }",
"protected function getEntryFormatter()\n {\n if (!$this->entryFormatter) {\n $this->entryFormatter = Application::getFacadeApplication()->make(EntryFormatterInterface::class);\n }\n\n return $this->entryFormatter;\n }",
"public function getStylesDom()\n {\n return $this->stylesDom;\n }",
"public static function getInstance() {\n if (self::$instance == null) {\n self::$instance = new CssEnqueuer();\n }\n return self::$instance;\n }",
"protected function io()\n {\n if (!$this->io) {\n // Specify our own Style class when needed.\n $this->io = new DrushStyle($this->input(), $this->output());\n }\n return $this->io;\n }",
"public static function getInstance ( ) {\n\t\treturn Zend_Registry::get('Log');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.