query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Compiles code and writes to cache if needed
function compile2($code, $handle, $cache_file) { $code = $this->compile_code('', $code, XS_USE_ISSET); if($cache_file && !empty($this->use_cache) && !empty($this->auto_compile)) { $res = $this->write_cache($cache_file, $code); if($handle && $res) { $this->files_cache[$handle] = $cache_file; } } $code = '?' . '>' . $code . '<' . '?php' . "\n"; return $code; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function compile() {\n\t\t\n\t\t$path = $this -> _front ->getApp() ->getConfig() ->controller ->module ->path;\n\t\t$path .= $this -> _front ->getApp() ->getConfig() ->subdomain ? $this -> _front ->getApp() ->getConfig() ->subdomain . DIRECTORY_SEPARATOR : '';\n\t\t$path .= \\FMW\\Utilities\\File\\Util::rslash( $this -> _front ->getRouter() ->getModule() ) . 'cache';\n\t\t\n\t\t$fcache = new FileCache(array(\n\t\t\t\t'path' \t=> $path,\n\t\t\t\t'ext' \t=> 'js'\n\t\t\t)\n\t\t);\n\t\t\n\t\tif ( $fcache->contains( $this -> _front ->getRouter() ->getController() ) === false ) {\n\t\t\t\n\t\t\t$js = '';\n\t\t\t\n\t\t\tforeach ($this->_javascriptCache as $value) {\n\t\t\t\t$js .= file_get_contents( $value );\n\t\t\t}\n\t\t\t\n\t\t\t$js = \\FMW\\Utilities\\Minify\\JSMin::minify($js);\n\t\t\t$fcache->save( $this -> _front ->getRouter() ->getController(), $js, $this->_cachetime );\n\t\t\t\n\t\t}\n\n\t\t$fcache = new FileCache(array(\n\t\t\t\t'path' \t=> $path,\n\t\t\t\t'ext' \t=> 'css'\n\t\t\t)\n\t\t);\n\t\t\n\t\tunset($js);\n\t\t\n\t\tif ( $fcache->contains( $this -> _front ->getRouter() ->getController() ) === false ) {\n\t\t\t\n\t\t\t$css = \\FMW\\Utilities\\Minify\\CSSMin::minify( $this->_cssCache, $this->_front->getApp()->getConfig() );\n\t\t\t\n\t\t\t$fcache->save( $this -> _front ->getRouter() ->getController(), $css, $this->_cachetime );\n\t\t\t\t\n\t\t}\n\t\t\n\t\tunset($css);\n\t}", "public function compile()\n\t{\n\t\tif ($this->dirty() and $this->compile)\n\t\t{\n\t\t\t$compiler = new Compiler($this, $this->app);\n\t\t\t$this->contents = $compiler->run();\n\t\t}\n\t}", "function opcache_compile_file($file)\n{\n}", "private static function runCompile(string $path, $namespace)\n {\n // path was returned ?\n if (!is_null($path))\n {\n $filename = basename($path);\n\n $cachename = md5($path) . '.php';\n\n if (file_exists($path))\n {\n // yes we read its content.\n $content = file_get_contents($path);\n\n $default = $content;\n\n $continue = true;\n $json = read_json(__DIR__ . '/hyphe.paths.json', true);\n \n if (file_exists(self::$cacheDir . $cachename))\n {\n $_content = file_get_contents(self::$cacheDir . $cachename);\n\n $start = strstr($_content, 'public static function ___cacheData()');\n\n preg_match('/(return)\\s{1,}[\"](.*?)[\"]/', $start, $return);\n\n if (count($return) > 0)\n {\n $cached = $return[2];\n\n if ($cached == md5($default))\n {\n $continue = false;\n }\n }\n\n // clean up\n $_content = null;\n $return = null;\n }\n \n if ($continue)\n {\n $content = '<!doctype html><html><body>'.$content.'</body></html>';\n \n // read dom\n $html = new HTML5();\n $dom = $html->loadHTML($content);\n\n $replaces = [];\n $engine = new Engine();\n\n $cachesize = md5($default);\n\n foreach ($dom->getElementsByTagName('hy') as $hy)\n {\n if ($hy->hasAttribute('directive'))\n {\n $class = $hy->getAttribute('directive');\n // inner content\n $body = self::innerHTML($hy);\n\n $classMap = [];\n $classMap[] = '<?php';\n if ($namespace != '')\n {\n $classMap[] = 'namespace '.$namespace.';';\n }\n else\n {\n $namespace = rtrim($path, $filename);\n $namespace = preg_replace('/^(\\.\\/)/','',$namespace);\n $namespace = rtrim($namespace, '/');\n $namespace = str_ireplace('/static/', '/', $namespace);\n $namespace = str_replace(HOME, '', $namespace);\n $namespace = preg_replace('/[\\/]{2,}/', '/', $namespace);\n $namespace = str_replace('/', '\\\\', $namespace);\n $classMap[] = 'namespace '.$namespace.';';\n }\n \n $classMap[] = 'class '.ucfirst($class). ' extends \\Hyphe\\Engine {';\n $classMap[] = html_entity_decode($body);\n $classMap[] = 'public static function ___cacheData()';\n $classMap[] = '{';\n $classMap[] = ' return \"'.$cachesize.'\";';\n $classMap[] = '}';\n $classMap[] = '}';\n\n $replaces[] = [\n 'replace' => $dom->saveHTML($hy),\n 'with' => implode(\"\\n\\t\", $classMap)\n ];\n }\n else\n {\n $out = $dom->saveHTML($hy);\n $inner = self::innerHTML($hy);\n\n if ($hy->hasAttribute('func'))\n {\n $funcName = $hy->getAttribute('func');\n $access = $hy->hasAttribute('access') ? $hy->getAttribute('access') : 'public';\n $args = $hy->hasAttribute('args') ? $hy->getAttribute('args') : '';\n\n $func = [];\n $func[] = $access .' function '. $funcName . '('.$args.')';\n $func[] = '{';\n $func[] = html_entity_decode($inner);\n $func[] = '}'; \n\n $replaces[] = [\n 'replace' => html_entity_decode($out),\n 'with' => implode(\"\\n\\t\", $func)\n ];\n }\n else\n {\n if ($hy->hasAttribute('lang'))\n {\n $lang = $hy->getAttribute('lang');\n\n switch (strtolower($lang))\n {\n case 'html':\n\n // interpolate props and this\n $inner = preg_replace('/(props)[.]([a-zA-Z_]+)/', '$this->props->$2', $inner);\n $inner = preg_replace('/(this)[.]([a-zA-Z_]+)/', '$this->$2', $inner);\n\n $inner = html_entity_decode($inner);\n\n $engine->interpolateExternal($inner, $data);\n $return = [];\n $return[] = '$assets = $this->loadAssets();';\n $return[] = '?>';\n $return[] = $data;\n $return[] = '<?php';\n\n // add replace\n $replaces[] = [\n 'replace' => html_entity_decode($out),\n 'with' => implode(\"\\n\\t\", $return)\n ];\n break;\n }\n } \n }\n }\n }\n\n if (isset($replaces[0]))\n {\n $default = $replaces[0]['replace'];\n\n $count = count($replaces);\n\n $default = preg_replace('/(\\S+)(=\\s*)[\\'](.*?)[\\']/', '$1$2\"$3\"', $default);\n\n $default = self::removeClosingTags($default);\n\n for ($x = 0; $x != $count; $x++)\n {\n $replace = self::removeClosingTags($replaces[$x]['replace']);\n $with = self::removeClosingTags($replaces[$x]['with']);\n\n if ($x == 0)\n {\n $default = $with;\n }\n\n $default = str_replace($replace, $with, $default);\n }\n\n // interpolate props and this\n $default = preg_replace('/(props)[.]([a-zA-Z_]+)/', '$this->props->$2', $default);\n $default = preg_replace('/(this)[.]([a-zA-Z_]+)/', '$this->$2', $default);\n\n\n if (!is_dir(self::$cacheDir))\n {\n mkdir(self::$cacheDir);\n }\n\n // save cache file and return path\n file_put_contents(self::$cacheDir . $cachename, $default);\n\n // push to json\n $json[$cachename] = $namespace;\n save_json(__DIR__ . '/hyphe.paths.json', $json);\n }\n }\n }\n \n return self::$cacheDir . $cachename;\n }\n\n return null;\n }", "public function compile($path = null)\n {\n if ($path) {\n $this->setPath($path);\n }\n\n $contents = $this->compileString($this->files->get($this->getPath()));\n\n if (!is_null($this->cachePath)) {\n $this->files->put($this->getCompiledPath($this->getPath()), $contents);\n }\n }", "public function write()\n\t{\n\t\t$source = $this->compile();\n\n\t\t// file location\n\t\t$file = $this->template->getEnvironment()->getCache() . '/';\n\t\t$file .= $this->template->getEnvironment()->getCacheFilename($this->filename);\n\n\t\t// attempt to create the directory if needed\n\t\tif(!is_dir(dirname($file)))\n\t\t{\n\t\t\tmkdir(dirname($file), 0777, true);\n\t\t}\n\n\t\t// write to tempfile and rename\n\t\t$tmpFile = tempnam(dirname($file), basename($file));\n\t\tif(@file_put_contents($tmpFile, $source) !== false)\n\t\t{\n\t\t\tif(@rename($tmpFile, $file))\n\t\t\t{\n\t\t\t\tchmod($file, 0644);\n\t\t\t}\n\t\t}\n\t}", "public function compile(string $path): void\n {\n if ($this->cache !== null) {\n $this->cache->resetPath($path);\n }\n\n $engine = $this->findEngine($path);\n\n // Rotate all possible context variants and warm up cache\n $generator = new ContextGenerator($this->context);\n foreach ($generator->generate() as $context) {\n $engine->reset($path, $context);\n $engine->compile($path, $context);\n }\n }", "public function asCompiled();", "public function & SetCompiled ($compiled = '');", "public function compile($path)\n {\n $contents = $this->compileString($this->files->get($path));\n\n if (!is_null($this->cachePath)) {\n $this->files->put(\n $this->getCompiledPath($path),\n $this->compress ? $this->html_compress($contents) : $contents\n );\n }\n }", "function write_cache($filename, $code)\n\t{\n\t\t// check if cache is writable\n\t\tif(!$this->cache_writable)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t// check if filename is valid\n\t\tif(substr($filename, 0, strlen($this->cachedir)) !== $this->cachedir)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t// try to open file\n\t\t$file = @fopen($filename, 'w');\n\t\tif(!$file)\n\t\t{\n\t\t\t// try to create directories\n\t\t\t$dir = substr($filename, strlen($this->cachedir), strlen($filename));\n\t\t\t$dirs = explode('/', $dir);\n\t\t\t$path = $this->cachedir;\n\t\t\t@umask(0);\n\t\t\tif(!@is_dir($path))\n\t\t\t{\n\t\t\t\tif(!@mkdir($path))\n\t\t\t\t{\n\t\t\t\t\t$this->cache_writable = 0;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t@chmod($path, 0777);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$count = sizeof($dirs);\n\t\t\tif($count > 0)\n\t\t\tfor($i = 0; $i < ($count - 1); $i++)\n\t\t\t{\n\t\t\t\tif($i > 0)\n\t\t\t\t{\n\t\t\t\t\t$path .= '/';\n\t\t\t\t}\n\t\t\t\t$path .= $dirs[$i];\n\t\t\t\tif(!@is_dir($path))\n\t\t\t\t{\n\t\t\t\t\tif(!@mkdir($path))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->cache_writable = 0;\n\t\t\t\t\t\treturn false;\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@chmod($path, 0777);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// try to open file again after directories were created\n\t\t\t$file = @fopen($filename, 'w');\n\t\t}\n\t\tif(!$file)\n\t\t{\n\t\t\t$this->cache_writable = 0;\n\t\t\treturn false;\n\t\t}\n\n\t\t$data = '<' . '?php' . \"\\n\\n// eXtreme Styles mod cache. Generated on \" . gmdate('r') . \" (time = \" . time() . \")\\n\\n\" . \"if (!defined('IN_ICYPHOENIX')) exit;\\n\\n\" . '?' . '>' . $code;\n\n\t\t@flock($file, LOCK_EX);\n\t\t@fwrite ($file, $data);\n\t\t@flock($file, LOCK_UN);\n\t\t@fclose($file);\n\t\t@chmod($filename, 0777);\n\t\treturn true;\n\t}", "public function compile()\n {\n\n $this->buildPage();\n\n if (defined('DEBUG_MARKUP') && DEBUG_MARKUP) {\n ob_start();\n $checkXml = new DOMDocument();\n\n if ($this instanceof LibTemplateAjax)\n $checkXml->loadXML($this->compiled);\n else\n $checkXml->loadHTML($this->compiled);\n\n $errors = ob_get_contents();\n ob_end_clean();\n\n // nur im fehlerfall loggen\n if ('' !== trim($errors)) {\n\n $this->getResponse()->addWarning('Invalid XML response');\n\n SFiles::write(PATH_GW.'log/tpl_xml_errors.html', $errors.'<pre>'.htmlentities($this->compiled).'</pre>');\n SFiles::write(PATH_GW.'log/tpl_xml_errors_'.date('Y-md-H-i_s').'.html', $errors.'<pre>'.htmlentities($this->compiled).'</pre>');\n }\n }\n\n if ($this->keyCachePage) {\n $this->writeCachedPage($this->keyCachePage , $this->compiled);\n }\n\n $this->output = $this->compiled;\n\n\n }", "public function GetCompiled ();", "public function compile($path)\n {\n $file = $this->files->get($path);\n $contents = Template::compile($file);\n\n if (!is_null($this->cachePath))\n {\n $compiledPath = $this->getCompiledPath($path);\n\n $this->files->put($compiledPath, $contents);\n }\n }", "public function flush() {\n\n\t\tif ( !yourfitness_post( 'yourfitness_flush_compiler_cache' ) )\n\t\t\treturn;\n\n\t\tyourfitness_remove_dir( yourfitness_get_compiler_dir() );\n\n\t}", "public static function buildCompilerCache()\n {\n return \\Kohana::$environment === \\Kohana::DEVELOPMENT ? new ArrayCache : new ApcuCache;\n }", "function compile ($src);", "abstract function cache_output();", "public function compile() { \n if (!count($this->loadedFiles)) return; \n $outputFile = $this->_options['includeFile']; \n $fp = fopen($outputFile, \"a+\"); \n if (flock($fp, LOCK_EX)) { \n if ($filesize = filesize($outputFile)) { \n fseek($fp, 0); \n $currentFile = fread($fp, $filesize); \n } else $currentFile = ''; \n \n if (!$currentFile) { \n $appendSource = \"<?php\\n\"; \n $existingClasses = array(); \n } else { \n $appendSource = ''; \n $existingClasses = $this->getClassesFromSource($currentFile); \n } \n \n for ($i = 0; $i < count($this->loadedFiles); $i++) { \n $filename = $this->loadedFiles[$i]; \n \n $f = @fopen($filename, \"r\", true); \n $fstat = fstat($f); \n $file = fread($f, $fstat['size']); \n fclose($f); \n $classes = $this->getClassesFromSource($file); \n \n if (!count(array_intersect($existingClasses, $classes))) { \n if (strpos($file, '__FILE__') === false) { \n $endFile = substr($file, -2) == '?>' ? -2 : null; \n $appendSource .= ($endFile === null ? substr($file, 5) : substr($file, 5, -2)); \n } else { \n $filePath = $this->realPath($filename); \n if ($filePath) { \n $file = str_replace('__FILE__', \"'$filePath'\", $file); \n $endFile = substr($file, -2) == '?>' ? -2 : null; \n $appendSource .= ($endFile === null ? substr($file, 5) : substr($file, 5, -2)); \n } \n } \n } else { \n $appendSource = ''; \n break; \n } \n } \n if ($appendSource) { \n fseek($fp, 0, SEEK_END); \n fwrite($fp, $appendSource); \n } \n flock($fp, LOCK_UN); \n } \n fclose($fp); \n }", "public function compile ();", "protected function compileAndCache(CompilerInterface $compiler, $path, $inputFile)\n {\n return $this->cacheFileContents($path, $compiler->compileFile($inputFile), $compiler->getCurrentImportPaths());\n }", "public function compile() {\r\n\t\tif(file_exists($this->result_file)) {\r\n\t\t\tunlink($this->result_file);\r\n\t\t\tclearstatcache();\r\n\t\t\tif(file_exists($this->result_file)) {\r\n\t\t\t\tthrow new exceptions\\filecompile(\"Failed to delete older compiled file during compilation\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tswitch($this->type) {\r\n\t\t\tcase self::TYPE_CSS:\r\n\t\t\t\t$this->compileCss();\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::TYPE_JS:\r\n\t\t\t\t$this->compileJs();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new exceptions\\source(\"Failed to compile resources: unknown resource type\");\r\n\t\t}\r\n\t\tclearstatcache();\r\n\t\treturn file_exists($this->result_file);\r\n\t}", "public function compile($in, $out, $cache, array $params = array())\n {\n $timer = sfTimerManager::getTimer('Sass compilation');\n $this->createFolderIfNeeded($out);\n if (!empty($cache))\n {\n $this->createFolderIfNeeded($cache);\n }\n\n $this->driver->compile($in, $out, $params);\n\n $this->fixPermissions($out);\n if (!empty($cache))\n {\n $this->fixPermissions($cache);\n }\n $timer->addTime();\n }", "public function rebuildCache()\r\n {\r\n $themes = $this->scanJsonFiles();\r\n // file_put_contents($this->cachePath, json_encode($themes, JSON_PRETTY_PRINT));\r\n\r\n $stub = file_get_contents(__DIR__ . '/stubs/cache.stub');\r\n $contents = str_replace('[CACHE]', var_export($themes, true), $stub);\r\n file_put_contents($this->cachePath, $contents);\r\n }", "protected function compileAssets()\n {\n if ($this->config->assets->live) {\n $classMap = Compiler::$classMap;\n\n // We don't want to compile pages here\n unset($classMap['pages']);\n\n foreach ($classMap as $scope => $scopeClass) {\n $config = $this->config->assets->{$scope};\n\n if ($config) {\n $config->clean = $this->config->assets->clean;\n $compiler = new $scopeClass($config);\n $compiler->compile();\n }\n }\n }\n }", "function cache();", "function loadFromCache (CachingFileCompiler $cache, $sourceFile);", "public function minify() {\n\t\tif (!$this->cacheFolder()) {\n\t\t\t$this->modx->log(modX::LOG_LEVEL_ERROR, '[MinifyX] Could not create cache dir \"'.$this->config['cacheFolder'].'\"');\n\t\t\treturn;\n\t\t}\n\n\t\t$cacheFolderUrl = DIRECTORY_SEPARATOR . str_replace(MODX_BASE_PATH, '', $this->config['cacheFolder']);\n\t\t$time = time();\n\n\t\tif ($js = $this->prepareFiles($this->config['jsSources'], 'js')) {\n\t\t\t$js = $this->Munee($js, array(\n\t\t\t\t'minify' => $this->config['minifyJs'] ? 'true' : 'false',\n\t\t\t));\n\n\t\t\tif (!empty($js)) {\n\t\t\t\t$file = $this->config['jsFilename'] . '_' . $time . $this->config['jsExt'];\n\t\t\t\tfile_put_contents($this->config['cacheFolder'] . $file, $js);\n\t\t\t}\n\t\t\telseif (count($this->current['js'])) {\n\t\t\t\t$tmp = array_pop($this->current['js']);\n\t\t\t\t$file = $tmp['file'];\n\t\t\t}\n\n\t\t\tif (!empty($file)) {\n\t\t\t\tif ($this->config['registerJs'] == 'placeholder' && !empty($this->config['jsPlaceholder'])) {\n\t\t\t\t\t$this->modx->setPlaceholder(\n\t\t\t\t\t\t$this->config['jsPlaceholder'],\n\t\t\t\t\t\t'<script type=\"text/javascript\" src=\"' . $cacheFolderUrl . $file . '\"></script>'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telseif ($this->config['registerJs'] == 'startup') {\n\t\t\t\t\t$this->modx->regClientStartupScript($cacheFolderUrl . $file);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->modx->regClientScript($cacheFolderUrl . $file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($css = $this->prepareFiles($this->config['cssSources'], 'css')) {\n\t\t\t$css = $this->Munee($css, array(\n\t\t\t\t'minify' => $this->config['minifyCss'] ? 'true' : 'false',\n\t\t\t));\n\n\t\t\tif (!empty($css)) {\n\t\t\t\t$file = $this->config['cssFilename'] . '_' . $time . $this->config['cssExt'];\n\t\t\t\tfile_put_contents($this->config['cacheFolder'] . $file, $css);\n\t\t\t}\n\t\t\telseif (count($this->current['css'])) {\n\t\t\t\t$tmp = array_pop($this->current['css']);\n\t\t\t\t$file = $tmp['file'];\n\t\t\t}\n\n\t\t\tif (!empty($file)) {\n\t\t\t\tif ($this->config['registerCss'] == 'placeholder' && !empty($this->config['cssPlaceholder'])) {\n\t\t\t\t\t$this->modx->setPlaceholder(\n\t\t\t\t\t\t$this->config['cssPlaceholder'],\n\t\t\t\t\t\t'<link rel=\"stylesheet\" href=\"' . $cacheFolderUrl . $file . '\" type=\"text/css\" />'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->modx->regClientCSS($cacheFolderUrl . $file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ($this->current as $tmp) {\n\t\t\tforeach ($tmp as $tmp2) {\n\t\t\t\tunlink($this->config['cacheFolder'] . $tmp2['file']);\n\t\t\t}\n\t\t}\n\n\t\treturn;\n\t}", "public function PreparerMiseEnCache()\n\t\t{\n\t\t\tob_start();\n\t\t}", "public function compile() {\n try {\n $dest = $this->paths->get('css.out');\n $compile = $this->frequency;\n\n $changed = (bool)$this->isCssUpdated();\n\n JLog::add('CSS cache changed: '.((bool)$changed ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n\n $changed = (bool)(($compile == 2) || ($compile == 1 && $changed));\n\n $doCompile = (!JFile::exists($dest) || $changed);\n\n JLog::add('Force CSS compilation: '.($compile == 2 ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n JLog::add('CSS file exists: '.((bool)JFile::exists($dest) ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n JLog::add('Compiling CSS: '.((bool)$doCompile ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n\n if ($doCompile) {\n if ($this->compiler == 'less') {\n $generateSourceMap = $this->params->get('generate_css_sourcemap', false);\n\n JLog::add('Generate CSS sourcemap: '.((bool)$generateSourceMap ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n\n $options = array('compress'=>true);\n\n $cssSourceMapUri = str_replace(JPATH_ROOT, JURI::base(), $this->paths->get('css.sourcemap'));\n\n // Build source map with minified code.\n if ($this->params->get('generate_css_sourcemap', false)) {\n $options['sourceMap'] = true;\n $options['sourceMapWriteTo'] = $this->paths->get('css.sourcemap');\n $options['sourceMapURL'] = $cssSourceMapUri;\n $options['sourceMapBasepath'] = JPATH_ROOT;\n $options['sourceMapRootpath'] = JUri::base();\n } else {\n JFile::delete($this->paths->get('css.sourcemap'));\n }\n\n $less = new Less_Parser($options);\n $less->parseFile($this->paths->get('css.in'), JUri::base());\n $css = $less->getCss();\n $files = $less->allParsedFiles();\n } else {\n $formatter = \"Leafo\\ScssPhp\\Formatter\\\\\".$this->formatting;\n $this->cache->store($this->formatting, self::CACHEKEY.'.scss.formatter');\n\n $scss = new Compiler();\n $scss->setFormatter($formatter);\n $css = $scss->compile('@import \"'.$this->paths->get('css.in').'\";');\n\n $files = array_keys($scss->getParsedFiles());\n }\n\n JLog::add('Writing CSS to: '.$dest, JLog::DEBUG, self::LOGGER);\n JFile::write($dest, $css);\n\n // update cache.\n $this->updateCache(self::CACHEKEY.'.files.css', $files);\n $this->cache->store($this->compiler, self::CACHEKEY.'.compiler');\n }\n } catch (Exception $e) {\n JLog::add($e->getMessage(), JLog::ERROR, self::LOGGER);\n return false;\n }\n }", "protected function compileJs() {\r\n\t\tif(count($this->source_files) == 0) {\r\n\t\t\tfile_put_contents($this->result_file, \"\", FILE_APPEND);\r\n\t\t} else {\r\n\t\t\tforeach($this->source_files as $src_file) {\r\n\t\t\t\tfile_put_contents($this->result_file, file_get_contents($src_file) . PHP_EOL, FILE_APPEND);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function compile()\n {\n $this->addImageToTemplate($this->Template, $this->arrData);\n }", "public function compileCacheFile($path, $options)\n {\n if (! property_exists($this, 'filesystem')) {\n $this->filesystem = new Filesystem;\n }\n $this->filesystem->put($path, '<?php return '.var_export($options, true).';'.PHP_EOL);\n }", "protected static function cacheAndLoad($class, $code)\n {\n if (!isset(self::$cachePath)) return false;\n \n $filename = self::$cachePath . '/' . strtr($class, '\\\\_', '//') . '.php';\n\n if (!file_exists(dirname($filename))) mkdir(dirname($filename), 0777, true);\n if (!file_put_contents($filename, $code)) return false;\n \n include $filename;\n return true;\n }", "function yy_r8(){$this->compiler->tag_nocache = true; $this->_retvalue = $this->cacher->processNocacheCode(\"<?php echo '?>';?>\\n\", $this->compiler, true); }", "function compiled($file=null)\n { \n if ($file) {\n return $this->_methodWrapper($file,'compiled');\n }\n return $this->_objectPool[$this->_lastUsedObjectKey]->compiled();\n }", "public function generateInternalCache()\n\t{\n\t\t// Purge\n\t\t$this->purgeInternalCache();\n\n\t\t// Rebuild\n\t\t$this->generateConfigCache();\n\t\t$this->generateDcaCache();\n\t\t$this->generateLanguageCache();\n\t\t$this->generateDcaExtracts();\n\t}", "function yy_r9(){$this->_retvalue = $this->cacher->processNocacheCode($this->yystack[$this->yyidx + 0]->minor, $this->compiler,false); }", "function &createCache() {}", "public function build()\n\t{\n\t\t// Get our output filename\n\t\t$this->name = $this->hashName();\n\t\t\n\t\t// Save the source if it doesn't already exist\n\t\t$output = $this->path.$this->name;\n\t\tif ( ! file_exists($output) ) {\n\n\t\t\t// Load our asset sources\n\t\t\tforeach ($this->files as $asset) {\n\t\t\t\tif (file_exists($asset)) {\n\t\t\t\t\t$this->source .= file_get_contents($asset);\n\t\t\t\t\tif (!$this->minified) { $this->source .= \"\\n\\n\"; }\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Minify the source if needed\n\t\t\tif ($this->minified) {\n\t\t\t\t$this->source = Minify::minify($this->source);\n\t\t\t}\n\n\t\t\t// Output the file\n\t\t\tfile_put_contents($output, $this->source);\n\t\t}\n\t}", "public function compileStoreDat() {}", "public function compile($force = false)\n\t{\n\t\t// If the compile path does not exist, attempt to create it.\n\t\tif ( ! file_exists($this->compilePath))\n\t\t{\n\t\t\tmkdir($this->compilePath, 0777, false);\n\t\t}\n\n\t\t// Filename for compiled file\n\t\t$path = $this->compilePath.$this->getCompiledName();\n\t\t\n\t\t// If compiled file doesn't exist yet or an asset file has been changed since file was\n\t\t// originally compiled, create new file\n\t\tif (! file_exists($path) && @filemtime($path) < $this->collection->getLastModified() && ! $force)\n\t\t{\n\t\t\tfile_put_contents($path, $this->collection->dump(), LOCK_EX);\n\t\t}\n\t}", "private function getCache() {\n // cache for single run\n // so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache)\n if (isset($this->parsed)) {\n return $this->parsed;\n }\n\n // check from cache first\n $cache = null;\n $cacheId = $this->getCacheId();\n if ($this->cache->isValid($cacheId, 0)) {\n if ($cache = $this->cache->fetch($cacheId)) {\n $cache = unserialize($cache);\n }\n }\n\n $less = $this->getCompiler();\n $input = $cache ? $cache : $this->filepath;\n $cache = $less->cachedCompile($input);\n\n if (!is_array($input) || $cache['updated'] > $input['updated']) {\n $this->cache->store($cacheId, serialize($cache));\n }\n\n return $this->parsed = $cache;\n }", "public function testIsCachedPrepare()\n {\n $this->smarty->caching = true;\n $this->smarty->cache_lifetime = 1000;\n $tpl = $this->smarty->createTemplate('helloworld.tpl');\n // clean up for next tests\n $this->smarty->clearCompiledTemplate();\n $this->smarty->clearAllCache();\n // compile and cache\n $this->smarty->fetch($tpl);\n }", "private function write_cache() {\n if (!file_exists(CACHE_DIR))\n mkdir(CACHE_DIR, 0755, TRUE);\n\n if (is_dir(CACHE_DIR) && is_writable(CACHE_DIR)) {\n if (function_exists(\"sem_get\") && ($mutex = @sem_get(2013, 1, 0644 | IPC_CREAT, 1)) && @sem_acquire($mutex))\n file_put_contents($this->cache_file, $this->html . $this->debug) . sem_release($mutex);\n /**/\n else if (($mutex = @fopen($this->cachefile, \"w\")) && @flock($mutex, LOCK_EX))\n file_put_contents($this->cache_file, $this->html . $this->debug) . flock($mutex, LOCK_UN);\n /**/\n }\n }", "function betterEval($code) {\n $result = [];\n $tmp = tmpfile ();//file resource\n //we'll need to uri to include the file:\n $tmpMeta = stream_get_meta_data ( $tmp );\n $uri = $tmpMeta ['uri'];\n fwrite ( $tmp, $code );\n \n ob_start();\n $start = microtime(true);\n //anonymously, so our scope will not be polluted (very optimistic here, ofc)\n call_user_func(function() use ($uri) {\n include ($uri);\n }); \n \n $result['time'] = microtime(true) - $start;\n $result['output'] = ob_get_clean(); \n $result['length'] = strlen($result['output']);\n $result['lengthCharacters'] = mb_strlen($result['output']);\n $result['dbg'] = [\n 'fileUri' => $uri\n ];\n fclose ( $tmp );\n return $result;\n}", "function add_to_cache($className, $path)\n{\n global $cache_map, $cache_file;\n\n if(!empty($className))\n {\n if(!$cache_map)\n $cache_map = array();\n\n $cache_map[$className] = $path;\n\n file_put_contents($cache_file, '<?php ' . \"\\n\" . '$cache_map = ' .\"\\n\" . var_export($cache_map, true) . ';' );\n\n }\n}", "public function isCompiled(){\n\t\treturn $this->isCompiled;\n\t}", "function _write_cache($output){\n return false;\n\n return parent::_write_cache($output);\n }", "public function run()\n\t{\n\t\tapp('log')->debug(\"[ASSETS] Compiling collection '\".$this->collection->id.\"'\");\n\n\t\t// Collection contents\n\t\t$this->collection->contents = '';\n\n\t\tforeach ($this->collection->assets() as $asset)\n\t\t{\n\t\t\tif ($asset->type == 'css')\n\t\t\t{\n\t\t\t\t// Rewrite relative URL's\n\t\t\t\t$rewriteFilter = new \\Creolab\\Assets\\Filters\\CSSRewriteFilter($asset);\n\n\t\t\t\t// Dump contents\n\t\t\t\t$contents = $rewriteFilter->dump($asset);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Dump contents\n\t\t\t\t$contents = $asset->contents();\n\t\t\t}\n\n\t\t\t// Assign to contents\n\t\t\t$this->collection->contents .= PHP_EOL . $asset->contents();\n\t\t\t$asset->contents = null;\n\t\t}\n\n\t\t// Filters\n\t\t$filters = array();\n\n\t\tforeach ($this->collection->filters() as $filter)\n\t\t{\n\t\t\t$filterClass = app('config')->get('assets::filters.' . $filter);\n\n\t\t\tif (class_exists($filterClass))\n\t\t\t{\n\t\t\t\t$filters[] = new $filterClass();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tapp('log')->error('[ASSETS] Problem with filter \"'.$filter.'\". The associated class \"'.$filterClass.'\" was not found.', array('package' => 'ASSETS', 'module' => 'Compiler'));\n\t\t\t}\n\t\t}\n\n\t\t// Create the collection in Assetic\n\t\ttry\n\t\t{\n\t\t\t// Clear the cache\n\t\t\tapp('assets')->clearCache($this->collection->id);\n\n\t\t\t// Create string asset\n\t\t\t$asset = new StringAsset($this->collection->contents, $filters);\n\n\t\t\t// Directory\n\t\t\t$cachePath = public_path() . '/' . app('config')->get('assets::cache_path');\n\t\t\tif ( ! app('files')->exists($cachePath)) app('files')->makeDirectory($cachePath, 0777, true);\n\n\t\t\t// And write contents\n\t\t\tif ($this->collection->cacheFilePath) app('files')->put($this->collection->cacheFilePath, $asset->dump());\n\n\t\t\t$this->collection->contents = null;\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t// echo '<pre>'; print_r($e->getMessage()); echo '</pre>';\n\t\t\t// app('files')->put($this->collection->cacheFilePath, $this->collection->contents());\n\t\t}\n\n\t\t// Finished\n\t\tapp('events')->fire('assets.compiled');\n\t\tapp('log')->debug(\"[ASSETS] Collection finished compiling '\".$this->collection->id.\"'\");\n\n\t\treturn $this->collection->contents;\n\t}", "protected function saveToPackageCache() {}", "protected function compile()\n\t{\n#\t\t$objArchive = new \\ZipWriter('system/tmp/'. $strTmp);\n\t\tif(\\Input::Get('download') && FE_USER_LOGGED_IN)\n\t\t{\n\t\t\t$objDownload = $this->Database->prepare(\"SELECT * FROM tl_download_item WHERE id=?\")->execute(\\Input::Get('download'));\n\t\t\t$objFile = \\FilesModel::findByUuid($objDownload->fileSRC);\n\n\t\t\t$this->sendFileToBrowser($objFile->path);\n\t\t}\n\n\t\t$objPage = \\PageModel::findById($GLOBALS['objPage']->id);\n\t\t$strUrl = $this->generateFrontendUrl($objPage->row(), '/download/%s');\n\n\t\t$objCategory = $this->Database->prepare(\"SELECT * FROM tl_download_category WHERE alias=?\")->execute(\\Input::Get('category'));\n\t\t$objArchiv = $this->Database->prepare(\"SELECT * FROM tl_download_archiv WHERE id=?\")->execute($objCategory->pid);\n\n\t\t$objData = $this->Database->prepare(\"SELECT * FROM tl_download_item WHERE pid=? && published=1 ORDER BY sorting ASC\")->execute($objCategory->id);\n\t\twhile($objData->next())\n\t\t{\n\t\t\t$objItem = (object) $objData->row();\n\n#\t\t\t$objItem->archiv = $objArchiv->title;\n#\n#\t\t\tif($objCategory->singleSRC)\n#\t\t\t{\n#\t\t\t\t$objItem->archivIcon = \\FilesModel::findByUuid($objCategory->singleSRC)->path;\n#\t\t\t}\n#\n#\t\t\t$objItem->category = $objCategory->title;\n#\t\t\t$objItem->singleSRC = deserialize($objItem->singleSRC);\n#\n#\t\t\t$arrImages = array();\n#\t\t\tif(is_array($objItem->singleSRC))\n#\t\t\t{\n#\t\t\t\tforeach($objItem->singleSRC as $image)\n#\t\t\t\t{\n#\t\t\t\t\t$arrImages[] = (object) array\n#\t\t\t\t\t(\n#\t\t\t\t\t\t'css' => '',\n#\t\t\t\t\t\t'path' => \\FilesModel::findByUuid($image)->path\n#\t\t\t\t\t);\n#\t\t\t\t}\n#\n#\t\t\t\t$arrImages[0]->css = 'first';\n#\t\t\t}\n#\n#\n#\t\t\tif(FE_USER_LOGGED_IN)\n#\t\t\t{\n#\t\t\t\t$objItem->url = sprintf($strUrl, $objItem->id);\n#\t\t\t\t$objItem->css = 'active';\n#\t\t\t\t$objItem->preview = $arrImages;\n#\t\t\t}\n#\t\t\telse\n#\t\t\t{\n#\t\t\t\t$objItem->css = 'inactive';\n#\t\t\t\t$objItem->preview = array($arrImages[0]);\n#\n#\t\t\t}\n\n\t\t\t$arrData[] = $objItem;\n\t\t}\n\n#\t\tif(!count($arrDaata)) { $arrData = array(); }\n\n\t\t$this->Template->items = $arrData;\n\t}", "public function setIsCompiled($isCompiled);", "public function compile($path): void\n {\n $this->compileWith($path);\n }", "protected function update_cache(){\r\n\t\t$html = file_get_contents($this->_cfg->get('sfbaseurl'));\r\n\t\tif($html === false || !trim($html))\r\n\t\t\tthrow new Exception('Could not read SourceForge website');\r\n\t\t$mtch = null;\r\n\t\tif(!preg_match('/lazarus-(\\\\d+.\\\\d+.\\\\d+)-fpc-(\\\\d+.\\\\d+.\\\\d+)-/', $html, $mtch))\r\n\t\t\tthrow new Exception('Could not parse version from SourceForge');\r\n\t\t$data = array(\r\n\t\t\t'laz' => $mtch[1],\r\n\t\t\t'fpc' => $mtch[2],\r\n\t\t);\r\n\t\t$data = '<'.'?php return '.var_export($data, true).'; ?>';\r\n\t\tfile_put_contents($this->get_cache(), $data);\r\n\t}", "public function cacheFile()\n\t{\n\t\t$data[] = \"<?php\";\n\t\t$data[] = \"defined('LUNA_SYSTEM') or die('Hacking attempt!');\\n\";\n\n\t\t$routes = Route::orderBy('type')->orderBy('controller')->get()->toArray();\n\n\t\tif (!empty($routes)) {\n\t\t\tforeach ($routes as $route) {\n\t\t\t\t$call_back = isset($route['action']) ? $route['controller'] . \":\" . $route['action'] : $route['controller'];\n\t\t\t\tif (!isset($route['method'])) {\n\t\t\t\t\t$data[] = '$app->get(\"' . $route['route'] . '\", \"' . $call_back . '\");';\n\t\t\t\t} else {\n\t\t\t\t\t$methods = explode(',', preg_replace('/\\s+/', '', $route['method']));\n\t\t\t\t\tforeach ($methods as $method) {\n\t\t\t\t\t\t$data[] = '$app->' . strtolower($method) . '(\"' . $route['route'] . '\", \"' . $call_back . '\");';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$output = implode(\"\\n\", $data);\n\n\t\twrite_file(LUNA_CACHEPATH . \"/data/routes.php\", $output);\n\t}", "function include_caching($file) {\r\n $cachefile = SITE_CACHES_FILES . $file;\r\n $cachetime = 5 * 60; //secondes\r\n if (file_exists($cachefile) && (time() - $cachetime < filemtime($cachefile))) {\r\n include($cachefile);\r\n } else {\r\n $fp = fopen($cachefile, 'w');\r\n fwrite($fp, ob_get_contents());\r\n fclose($fp);\r\n ob_end_flush();\r\n }\r\n}", "public function generateConfigCache()\n\t{\n\t\t// Generate the class/template laoder cache file\n\t\t$objCacheFile = new \\File('system/cache/config/autoload.php', true);\n\t\t$objCacheFile->write('<?php '); // add one space to prevent the \"unexpected $end\" error\n\n\t\tforeach (\\ModuleLoader::getActive() as $strModule)\n\t\t{\n\t\t\t$strFile = 'system/modules/' . $strModule . '/config/autoload.php';\n\n\t\t\tif (file_exists(TL_ROOT . '/' . $strFile))\n\t\t\t{\n\t\t\t\t$objCacheFile->append(static::readPhpFileWithoutTags($strFile));\n\t\t\t}\n\t\t}\n\n\t\t// Close the file (moves it to its final destination)\n\t\t$objCacheFile->close();\n\n\t\t// Generate the module loader cache file\n\t\t$objCacheFile = new \\File('system/cache/config/modules.php', true);\n\t\t$objCacheFile->write(\"<?php\\n\\n\");\n\n\t\t$objCacheFile->append(sprintf(\"static::\\$active = %s;\\n\", var_export(\\ModuleLoader::getActive(), true)));\n\t\t$objCacheFile->append(sprintf(\"static::\\$disabled = %s;\", var_export(\\ModuleLoader::getDisabled(), true)));\n\n\t\t// Close the file (moves it to its final destination)\n\t\t$objCacheFile->close();\n\n\t\t// Generate the config cache file\n\t\t$objCacheFile = new \\File('system/cache/config/config.php', true);\n\t\t$objCacheFile->write('<?php '); // add one space to prevent the \"unexpected $end\" error\n\n\t\tforeach (\\ModuleLoader::getActive() as $strModule)\n\t\t{\n\t\t\t$strFile = 'system/modules/' . $strModule . '/config/config.php';\n\n\t\t\tif (file_exists(TL_ROOT . '/' . $strFile))\n\t\t\t{\n\t\t\t\t$objCacheFile->append(static::readPhpFileWithoutTags($strFile));\n\t\t\t}\n\t\t}\n\n\t\t// Close the file (moves it to its final destination)\n\t\t$objCacheFile->close();\n\n\t\t// Generate the page mapping array\n\t\t$arrMapper = array();\n\t\t$objPages = \\PageModel::findPublishedRootPages();\n\n\t\tif ($objPages !== null)\n\t\t{\n\t\t\twhile ($objPages->next())\n\t\t\t{\n\t\t\t\t$strBase = ($objPages->dns ?: '*');\n\n\t\t\t\tif ($objPages->fallback)\n\t\t\t\t{\n\t\t\t\t\t$arrMapper[$strBase . '/empty.fallback'] = $strBase . '/empty.' . $objPages->language;\n\t\t\t\t}\n\n\t\t\t\t$arrMapper[$strBase . '/empty.' . $objPages->language] = $strBase . '/empty.' . $objPages->language;\n\t\t\t}\n\t\t}\n\n\t\t// Generate the page mapper file\n\t\t$objCacheFile = new \\File('system/cache/config/mapping.php', true);\n\t\t$objCacheFile->write(sprintf(\"<?php\\n\\nreturn %s;\\n\", var_export($arrMapper, true)));\n\t\t$objCacheFile->close();\n\n\t\t// Add a log entry\n\t\t$this->log('Generated the config cache', __METHOD__, TL_CRON);\n\t}", "private static function _createCacheFile() {\r\n $paths = array();\r\n $paths['apps'] = File::getDirectoriesNames(ZEEYE_APPS_PATH);\r\n $paths['libs'] = File::getDirectoriesNames(ZEEYE_LIBS_PATH);\r\n File::write(ZEEYE_TMP_PATH . self::CACHE_FILE_PATH, '<?php ' . PHP_EOL . '$paths = ' . var_export($paths, true) . ';');\r\n self::$_hasCacheFile = true;\r\n }", "public function testProcedureIsLoadedFromCacheIfCacheIsEnabled()\n {\n $procedure1 = $this->getProcedure('http_default');\n $procedure2 = $this->getProcedure('http_default');\n\n $request = $this->getRequest();\n $request->setUrl('http://test.com');\n\n $renderer = $this->getMockBuilder('\\JonnyW\\PhantomJs\\Template\\TemplateRendererInterface')->getMock();\n $renderer->expects($this->exactly(1))\n ->method('render')\n ->will($this->returnValue('var test=1; phantom.exit(1);'));\n\n $serviceContainer = ServiceContainer::getInstance();\n\n $compiler = new ProcedureCompiler(\n $serviceContainer->get('phantomjs.procedure.chain_loader'),\n $serviceContainer->get('phantomjs.procedure.procedure_validator'),\n $serviceContainer->get('phantomjs.cache.file_cache'),\n $renderer\n );\n\n $compiler->enableCache();\n $compiler->compile($procedure1, $request);\n $compiler->compile($procedure2, $request);\n }", "private static function prep() {\n\t\tif (!isset(F3::$global['CACHE'])) {\n\t\t\t// Extensions usable as cache back-ends\n\t\t\t$_exts=array_intersect(\n\t\t\t\texplode('|','apc|xcache'),get_loaded_extensions()\n\t\t\t);\n\t\t\tforeach (array_keys($_exts,'') as $_null)\n\t\t\t\tunset($_exts[$_null]);\n\t\t\t$_exts=array_merge($_exts,array());\n\t\t\tF3::$global['CACHE']=$_exts[0]?:\n\t\t\t\t('folder='.F3::$global['BASE'].'cache/');\n\t\t}\n\t\tif (preg_match(\n\t\t\t'/^(?:(folder)\\=(.+\\/)|(apc)|(memcache)=(.+))|(xcache)/i',\n\t\t\tF3::$global['CACHE'],$_match)) {\n\t\t\tif ($_match[1]) {\n\t\t\t\tif (!file_exists($_match[2])) {\n\t\t\t\t\tif (!is_writable(dirname($_match[2])) &&\n\t\t\t\t\t\tfunction_exists('posix_getpwuid')) {\n\t\t\t\t\t\t\t$_uid=posix_getpwuid(posix_geteuid());\n\t\t\t\t\t\t\tF3::$global['CONTEXT']=array(\n\t\t\t\t\t\t\t\t$_uid['name'],realpath(dirname($_match[2]))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\ttrigger_error(F3::TEXT_Write);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// Create the framework's cache folder\n\t\t\t\t\tmkdir($_match[2],0755);\n\t\t\t\t}\n\t\t\t\t// File system\n\t\t\t\tself::$l1cache=array('type'=>'folder','id'=>$_match[2]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$_ext=strtolower($_match[3]?:($_match[4]?:$_match[6]));\n\t\t\t\tif (!extension_loaded($_ext)) {\n\t\t\t\t\tF3::$global['CONTEXT']=$_ext;\n\t\t\t\t\ttrigger_error(F3::TEXT_PHPExt);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ($_match[4]) {\n\t\t\t\t\t// Open persistent MemCache connection(s)\n\t\t\t\t\t// Multiple servers separated by semi-colon\n\t\t\t\t\t$_pool=explode(';',$_match[5]);\n\t\t\t\t\t$_mcache=NULL;\n\t\t\t\t\tforeach ($_pool as $_server) {\n\t\t\t\t\t\t// Hostname:port\n\t\t\t\t\t\tlist($_host,$_port)=explode(':',$_server);\n\t\t\t\t\t\tif (is_null($_port))\n\t\t\t\t\t\t\t// Use default port\n\t\t\t\t\t\t\t$_port=11211;\n\t\t\t\t\t\t// Connect to each server\n\t\t\t\t\t\tif (is_null($_mcache))\n\t\t\t\t\t\t\t$_mcache=memcache_pconnect($_host,$_port);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmemcache_add_server($_mcache,$_host,$_port);\n\t\t\t\t\t}\n\t\t\t\t\t// MemCache\n\t\t\t\t\tself::$l1cache=array('type'=>$_ext,'id'=>$_mcache);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t// APC and XCache\n\t\t\t\t\tself::$l1cache=array('type'=>$_ext);\n\t\t\t}\n\t\t\tself::$l1cache['current']=FALSE;\n\t\t\treturn TRUE;\n\t\t}\n\t\t// Unknown back-end\n\t\ttrigger_error(self::TEXT_Backend);\n\t\treturn FALSE;\n\t}", "public function testIsCachedTouchedSourcePrepare()\n {\n $tpl = $this->smarty->createTemplate('helloworld.tpl');\n sleep(1);\n touch ($tpl->source->filepath);\n }", "private function compile($content) { //was display function here\r\n\t\r\n\t\t\t//loop \r\n\t\t\t$content = preg_replace_callback('#{loop[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)(.*?)\\}(.*?){\\/loop\\}#is',array(&$this,'loop_bt'), $content);\r\n\t\t\t//if and her sisters\r\n\t\t\t$content = preg_replace_callback('#{(if|elseif)[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)[^>]([a-zA-Z\\=\\!\\>\\%\\&\\|\\</]{1,3})[^>](.*?)\\}#i',array(&$this,'if_expr'), $content);\r\n\r\n\t\t\t//matchs ..\r\n\t\t\t$matchs\t= array(\r\n\t\t\t\t\t\t\t\t'#{include_tpl[^>](.*?)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{include_script[^>](.*?)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{if[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{elseif[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{else\\}#i',\r\n\t\t\t\t\t\t\t\t'#{\\/if\\}#i',\r\n\t\t\t\t\t\t\t\t($this->php_compile == 'on') ? '#{php\\}(.*?){\\/php\\}#is' : '##',\r\n\t\t\t\t\t\t\t\t($this->global_vars == 'on') ? '#{([a-zA-Z0-9\\_\\-\\+\\./]+)}#' : '##',\r\n\t\t\t\t\t\t\t\t'#{assets[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)}#is',\r\n\t\t\t\t\t\t\t);\r\n\t\t\t//replaces\t\t\t\t\r\n\t\t\t$replaces = array ( \r\n\t\t\t\t\t\t\t\t\t'<?php $this->include_tpl(\\'\\\\1\\'); ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php include(\\'\\\\1\\'); ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php if($this->vars[\\'\\\\1\\']){ ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php } elseif(\\\\1){?>',\r\n\t\t\t\t\t\t\t\t\t'<?php } else { ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php } ?>',\r\n\t\t\t\t\t\t\t\t\t($this->php_compile == 'on') ? '<?php \\\\1 ?>' : '',\r\n\t\t\t\t\t\t\t\t\t($this->global_vars == 'on') ? '<?php print $this->vars[\\'\\\\1\\'];?>' : '',\r\n\t\t\t\t\t\t\t\t\t'<?php echo $this->assets(\\'\\\\1\\'); ?>',\r\n\t\t\t\t\t\t\t\t);\r\n\t\t//show time ..\r\n\t\t$content = preg_replace($matchs,$replaces, $content);\r\n\t\t\r\n\t\tif($this->global_vars != 'on'){ \r\n\t\t\t$content = preg_replace_callback('#{([a-zA-Z0-9\\_\\-\\+\\./]+)}#',array(&$this,'assign_if_global_off'), $content);\r\n\t\t}\r\n\t\t\r\n\t\treturn $content; \r\n }", "protected function saveToCache() {}", "public function compileAll()\n {\n $this->emptyCompileDir();\n \n $this->compileOtherFiles();\n \n $manifestNames = $this->config()->precompile;\n \n foreach ($manifestNames as $manifest) {\n $ext = pathinfo($manifest, PATHINFO_EXTENSION);\n $paths = $this->findAllFiles($manifest);\n foreach ($paths as $path) {\n $this->compileFile(new File($ext, $path));\n }\n }\n }", "private function _compile_css(){\n\t\t$compiled_css = \"\";\n\t\tforeach($this->css as $css_file){\n\t\t\t$compiled_css .= \"\\t<link rel=\\\"stylesheet\\\" href=\\\"\".$this->assets_url('css').\"/{$css_file}.css\\\" />\\n\";\n\t\t}\n\t\t\n\t\tif ($compiled_css == \"\") return \"\";\n\n\t\treturn \"<!-- START Compiled CSS -->\\n\".$compiled_css.\"\\t<!-- END Compiled CSS -->\\n\";\n\t}", "public function testIsCachedForceCompile()\n {\n $this->smarty->caching = true;\n $this->smarty->cache_lifetime = 1000;\n $this->smarty->force_compile = true;\n $tpl = $this->smarty->createTemplate('helloworld.tpl');\n $this->assertFalse($tpl->isCached());\n }", "protected function compile()\n {\n $arrModules = $this->Config->getActiveModules();\n\n if ($this->Input->get('act') == 'generate') {\n $strModule = $this->Input->get('module');\n $strComp = $this->Input->get('comp');\n $strLanguage = $this->Input->get('language');\n\n $strSourceFile = sprintf('system/modules/%s/languages/%s/%s.php',\n $strModule,\n $strLanguage,\n $strComp);\n $strTargetFile = sprintf('system/modules/%s/languages/%s/%s.xlf',\n $strModule,\n $strLanguage,\n $strComp);\n\n if (!file_exists(TL_ROOT . '/' . $strSourceFile)) {\n $_SESSION['TL_ERROR'][] = 'Missing source file ' . $strSourceFile . '!';\n }\n\n else {\n unset($GLOBALS['TL_LANG']);\n require(TL_ROOT . '/' . $strSourceFile);\n $arrSourceLanguage = deserialize(serialize($GLOBALS['TL_LANG']));\n\n $doc = Xliff::getInstance()->generateXliff(\n $strSourceFile,\n 'php',\n filemtime(TL_ROOT . '/' . $strSourceFile),\n '',\n $strLanguage,\n $arrSourceLanguage,\n $strLanguage\n );\n\n // output should formated\n $doc->formatOutput = true;\n\n // generate the xml for output\n $xml = $doc->saveXML();\n\n // generate directories\n $this->mkdirs(dirname($strTargetFile));\n\n // write the file\n $objFile = new File($strTargetFile);\n $objFile->write($xml);\n $objFile->close();\n\n $_SESSION['TL_INFO'][] = sprintf('Create new file %s.', $strTargetFile);\n }\n\n $this->redirect('contao/main.php?do=xliff');\n }\n\n $GLOBALS['TL_CSS']['xliff'] = 'system/modules/xliff/public/backend.css';\n $GLOBALS['TL_JAVASCRIPT']['xliff'] = 'system/modules/xliff/public/backend.js';\n\n $arrFiles = array();\n $arrLanguages = array();\n foreach ($arrModules as $strModule) {\n if (in_array($strModule, array('calendar', 'comments', 'core', 'devtools', 'faq', 'listing', 'news', 'newsletter', 'repository'))) {\n continue;\n }\n\n $strLanguagesPath = TL_ROOT . '/system/modules/' . $strModule . '/languages';\n if (is_dir($strLanguagesPath)) {\n $arrModuleLanguages = scan($strLanguagesPath);\n\n foreach ($arrModuleLanguages as $strLanguage) {\n $arrLanguages[] = $strLanguage;\n\n $strLanguagePath = $strLanguagesPath . '/' . $strLanguage;\n\n if (is_dir($strLanguagePath)) {\n $arrLanguageFiles = scan($strLanguagePath);\n\n foreach ($arrLanguageFiles as $strLanguageFile) {\n // absolute path to the php file\n $strLanguageFile = $strLanguagePath . '/' . $strLanguageFile;\n\n if (preg_match('#\\.(xlf|php)$#', $strLanguageFile, $arrMatch)\n ) {\n // extract the language key (first part of the TL_LANG array\n $strLanguageKey = basename($strLanguageFile, '.' . $arrMatch[1]);\n\n // store the php file timestamp\n $arrFiles[$strModule][$strLanguageKey][$strLanguage][$arrMatch[1]]['mtime'] = filemtime($strLanguageFile);\n }\n }\n }\n }\n }\n }\n\n natcasesort($arrModules);\n ksort($arrFiles);\n $arrLanguages = array_unique(array_filter(array_values($arrLanguages)));\n natcasesort($arrLanguages);\n\n $this->Template->modules = $arrModules;\n $this->Template->files = $arrFiles;\n $this->Template->languages = $arrLanguages;\n }", "function compile($code, $do_not_echo = false, $retvar = '')\n\t{\n\t\t$code = ' ?' . '>' . $this->compile_code('', $code, true) . '<' . '?php' . \"\\n\";\n\t\tif($do_not_echo)\n\t\t{\n\t\t\t$code = \"ob_start();\\n\". $code. \"\\n\\${$retvar} = ob_get_contents();\\nob_end_clean();\\n\";\n\t\t}\n\t\treturn $code;\n\t}", "public static function compile($path = null)\n {\n }", "function yy_r7(){ $this->compiler->tag_nocache = true; $this->_retvalue = $this->cacher->processNocacheCode(\"<?php echo '<?xml';?>\", $this->compiler, true); }", "function run()\n\t{\n\t\tif ((get_param('keep_lang',NULL)===NULL) || (get_param('keep_theme',NULL)===NULL))\n\t\t{\n\t\t\t// We need to run this for each language and for each theme\n\t\t\t$langs=find_all_langs();\n\t\t\trequire_code('themes2');\n\t\t\t$themes=find_all_themes();\n\t\t\tforeach (array_keys($langs) as $lang)\n\t\t\t{\n\t\t\t\tforeach (array_keys($themes) as $theme)\n\t\t\t\t{\n\t\t\t\t\tif (($theme=='default') || (has_category_access(get_member(),'theme',$theme)))\n\t\t\t\t\t{\n\t\t\t\t\t\t$where=array('c_theme'=>$theme,'c_lang'=>$lang);\n\t\t\t\t\t\t$count=$GLOBALS['SITE_DB']->query_value('cron_caching_requests','COUNT(*)',$where);\n\t\t\t\t\t\tif ($count>0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$url=get_base_url().'/data/cron_bridge.php?limit_hook=block_caching&keep_lang='.urlencode($lang).'&keep_theme='.urlencode($theme);\n\t\t\t\t\t\t\thttp_download_file($url,NULL,false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Force re-loading of values that we use to mark progress (as above calls probably resulted in changes happening)\n\t\t\tglobal $VALUES;\n\t\t\t$VALUES=$GLOBALS['SITE_DB']->query_select('values',array('*'));\n\t\t\t$VALUES=list_to_map('the_name',$VALUES);\n\n\t\t\treturn;\n\t\t}\n\n\t\t$where=array('c_theme'=>$GLOBALS['FORUM_DRIVER']->get_theme(),'c_lang'=>user_lang());\n\t\t$requests=$GLOBALS['SITE_DB']->query_select('cron_caching_requests',array('id','c_codename','c_map','c_timezone','c_is_bot','c_in_panel','c_interlock','c_store_as_tempcode'),$where);\n\t\tforeach ($requests as $request)\n\t\t{\n\t\t\t$GLOBALS['NO_QUERY_LIMIT']=true;\n\n\t\t\t$codename=$request['c_codename'];\n\t\t\t$map=unserialize($request['c_map']);\n\n\t\t\t$object=do_block_hunt_file($codename,$map);\n\t\t\tif (is_object($object))\n\t\t\t{\n\t\t\t\tglobal $LANGS_REQUESTED,$JAVASCRIPTS,$CSSS,$LANGS_REQUESTED,$DO_NOT_CACHE_THIS,$TIMEZONE_MEMBER_CACHE;\n\n\t\t\t\t$backup_langs_requested=$LANGS_REQUESTED;\n\t\t\t\t$backup_javascripts=$JAVASCRIPTS;\n\t\t\t\t$backup_csss=$CSSS;\n\t\t\t\tget_users_timezone();\n\t\t\t\t$backup_timezone=$TIMEZONE_MEMBER_CACHE[get_member()];\n\t\t\t\t$LANGS_REQUESTED=array();\n\t\t\t\t$JAVASCRIPTS=array('javascript'=>1,'javascript_thumbnails'=>1);\n\t\t\t\t$CSSS=array('no_cache'=>1,'global'=>1);\n\t\t\t\t$cache=$object->run($map);\n\t\t\t\t$TIMEZONE_MEMBER_CACHE[get_member()]=$backup_timezone;\n\t\t\t\t$cache->handle_symbol_preprocessing();\n\t\t\t\tif (!$DO_NOT_CACHE_THIS)\n\t\t\t\t{\n\t\t\t\t\tif (method_exists($object,'cacheing_environment'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$info=$object->cacheing_environment();\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$info=array();\n\t\t\t\t\t\t$info['cache_on']='array($map,$GLOBALS[\\'FORUM_DRIVER\\']->get_members_groups(get_member()))';\n\t\t\t\t\t\t$info['ttl']=60*24;\n\t\t\t\t\t}\n\t\t\t\t\t$ttl=$info['ttl'];\n\n\t\t\t\t\t$_cache_identifier=array();\n\t\t\t\t\t$cache_on=$info['cache_on'];\n\t\t\t\t\tif (is_array($cache_on))\n\t\t\t\t\t{\n\t\t\t\t\t\t$_cache_identifier=call_user_func($cache_on[0],$map);\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tif (($cache_on!='') && (!defined('HIPHOP_PHP')))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_cache_on=eval('return '.$cache_on.';'); // NB: This uses $map, as $map is referenced inside $cache_on\n\t\t\t\t\t\t\tif (is_null($_cache_on)) return NULL;\n\t\t\t\t\t\t\tforeach ($_cache_on as $on)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_cache_identifier[]=$on;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif (defined('HIPHOP_PHP')) return NULL;\n\t\t\t\t\t}\n\t\t\t\t\t$_cache_identifier[]=$request['c_timezone'];\n\t\t\t\t\t$_cache_identifier[]=$request['c_is_bot']==0;\n\t\t\t\t\t$_cache_identifier[]=strval($request['c_in_panel']);\n\t\t\t\t\t$_cache_identifier[]=strval($request['c_interlock']);\n\t\t\t\t\t$cache_identifier=serialize($_cache_identifier);\n\n\t\t\t\t\trequire_code('caches2');\n\t\t\t\t\tif ($request['c_store_as_tempcode']==1) $cache=make_string_tempcode($cache->evaluate());\n\t\t\t\t\tput_into_cache($codename,$ttl,$cache_identifier,$cache,array_keys($LANGS_REQUESTED),array_keys($JAVASCRIPTS),array_keys($CSSS),true);\n\t\t\t\t}\n\t\t\t\t$LANGS_REQUESTED+=$backup_langs_requested;\n\t\t\t\t$JAVASCRIPTS+=$backup_javascripts;\n\t\t\t\t$CSSS+=$backup_csss;\n\t\t\t}\n\n\t\t\t$GLOBALS['SITE_DB']->query_delete('cron_caching_requests',$request);\n\t\t}\n\t}", "protected function compile()\n\t{\n\n\t\t$this->Template->tweetcontainer = $this->html;\n\n\t}", "protected function compile(ClassMapping $map) {\n Veval::execute($map->recompile());\n }", "private function _compile_data()\n {\n $this->_set_platform();\n\n foreach (array('_set_robot', '_set_browser', '_set_mobile') as $function)\n {\n if ($this->$function() === TRUE)\n {\n break;\n }\n }\n }", "public function evalFile(string $src): CompiledFile;", "protected function compile(): void\n {\n if (System::getContainer()->get('contao.routing.scope_matcher')->isBackendRequest(System::getContainer()->get('request_stack')->getCurrentRequest() ?? Request::create(''))) {\n $this->strTemplate = 'be_wildcard';\n $this->Template = new BackendTemplate($this->strTemplate);\n }\n\n $this->Template->tabsElement = $this->tabs_element;\n }", "public function actionRebuildCache()\n {\n foreach (Yii::app()->Modules as $id => $params)\n $this->actionDb2php(array('module' => $id));\n\n }", "private function get_cache() {\n exit(file_get_contents($this->cache_file));\n }", "public function process(): void {\n if($this->shouldCache() && $this->hasCache()) {\n $this->restoreCache();\n\n return;\n }\n\n $folders = [];\n foreach($this->sources_to_parse as $source_to_parse) {\n $folder = $source_to_parse->getFolderToParse();\n if(!isset($folders[$folder])) {\n $folders[$folder] = [\n 'extensions' => [],\n 'flags' => [],\n ];\n }\n $folders[$folder]['extensions'] = [...$folders[$folder]['extensions'], ...$source_to_parse->getExtensions()];\n $folders[$folder]['flags'] = [...$folders[$folder]['flags'], ...$source_to_parse->getFlags()];\n }\n\n foreach($folders as $folder => $folder_sources) {\n $folder_sources['extensions'] = array_values(array_unique($folder_sources['extensions']));\n $folder_sources['flags'] = array_values(array_unique($folder_sources['flags']));\n $code_data = $this->analyzer->parseFolder($folder, $folder_sources);\n $this->info_data[] = $code_data;\n $i = count($this->info_data) - 1;\n foreach($folder_sources['flags'] as $flag) {\n if(!isset($this->info_data_flag_refs[$flag])) {\n $this->info_data_flag_refs[$flag] = [];\n }\n $this->info_data_flag_refs[$flag][] = $i;\n }\n $this->flags = [...$this->flags, ...$folder_sources['flags']];\n }\n $this->flags = array_values(array_unique($this->flags));\n\n if($this->shouldCache()) {\n file_put_contents(\n $this->file_cache,\n \"<?php\\n\\nreturn \" .\n var_export([\n 'info_data' => $this->info_data,\n 'info_data_flag_refs' => $this->info_data_flag_refs,\n ], true) . ';',\n );\n }\n }", "public function build()\n {\n\n $this->buildPage();\n\n return $this->compiled;\n\n }", "public function preCacheUpdate()\n\t{\n\t\t$this->template->assign('updateCache', true);\n\t}", "function splurgh_master_build($key_name,$map,$url_stub,$_cache_file,$last_change_time,$first_id=NULL)\n{\n\tif (is_null($first_id)) $first_id=db_get_first_id();\n\n\tif (!array_key_exists($first_id,$map)) return '';\n\n\tif (!has_js()) warn_exit(do_lang_tempcode('MSG_JS_NEEDED'));\n\n\trequire_javascript('javascript_splurgh');\n\n\tif (is_browser_decacheing())\n\t\t$last_change_time=time();\n\n\t$cache_file=zone_black_magic_filterer(get_custom_file_base().'/'.get_zone_name().'/pages/html_custom/'.filter_naughty(user_lang()).'/'.filter_naughty($_cache_file).'.htm');\n\n\tif ((!file_exists($cache_file)) || (is_browser_decacheing()) || (filesize($cache_file)==0) || ($last_change_time>filemtime($cache_file)))\n\t{\n\t\t$myfile=@fopen($cache_file,'wt');\n\t\tif ($myfile===false) intelligent_write_error($cache_file);\n\t\t$fulltable=array();\n\t\t$splurgh=_splurgh_do_node($map,$first_id,'',$fulltable,0);\n\t\t$page=do_template('SPLURGH',array('_GUID'=>'8775edfc5a386fdf2cec69b0fc889952','KEY_NAME'=>$key_name,'URL_STUB'=>$url_stub,'SPLURGH'=>str_replace('\"','\\'',$splurgh)));\n\t\t$ev=$page->evaluate();\n\t\tif (fwrite($myfile,$ev)<strlen($ev)) warn_exit(do_lang_tempcode('COULD_NOT_SAVE_FILE'));\n\t\tfclose($myfile);\n\t\tfix_permissions($cache_file);\n\t\tsync_file($cache_file);\n\n\t\treturn $ev;\n\t}\n\n\treturn file_get_contents($cache_file,FILE_TEXT);\n}", "public function cacheCheck(){\n \n if(file_exists($this->cacheName)){\n\t \n $cTime = intval(filemtime($this->cacheName));\n \n if( $cTime + $this->cacheTime > time() ) {\n\t \n echo file_get_contents( $this->cacheName );\n \n ob_end_flush();\n \n exit;}\t\t\t\t\t\n \n \t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n return false;\n \n}", "public function compile() {\n\t\t// ensure the directory exists\n\t\t$this -> ensureDirectory();\n\n\t\t// create the lockfile (or return)\n\t\tif (!$this -> lock()) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t// clean\n\t\t\t$this -> clean();\n\n\t\t\t// get the text and save it \n\t\t\t$this -> writeTextToFile();\n\n\t\t\t// call latexmk\n\t\t\t$this -> callLatexMk();\n\t\t} catch (Exception $e) {\n\t\t\tthrow $e;\n\t\t} finally {\n\t\t\t$this -> unlock();\n\t\t}\n\n\t\treturn true;\n\t}", "protected function compile()\n\t{\n\t\tif (TL_MODE == 'BE')\n\t\t{\n\t\t\t$this->strTemplate = 'be_wildcard';\n\t\t\t$this->Template = new \\BackendTemplate($this->strTemplate);\n\t\t}\n\t}", "public function startCache() {}", "abstract protected function cacheData();", "public function cache() {\r\n\t\t$key = $this->cacher.'.' . $this->hash();\r\n\t\tif (($content = pzk_store($key)) === NULL) {\r\n\t\t\t$content = $this->getContent();\r\n\t\t\tpzk_store($key, $content);\r\n\t\t}\r\n\t\techo $content;\r\n\t}", "function compile($name, $code = false)\n {\n\t\tif (!$code)\n\t\t{\n\t\t\t$code = file_get_contents($this->template_dir.$name);\n\t\n\t\t\tif ($code === false)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpreg_match_all('/\\<!--[ ]*(.*?) (.*?)?[ ]*--\\>/', $code, $tag_blocks);\n\t\t$content_blocks = preg_split('/\\<!--[ ]*(.*?) (.*?)?[ ]*--\\>/', $code);\n\n\t\t$size = count($content_blocks);\n\n\t\t$parse_content = $compile = true;\n\t\t$tag_holding = array();\n\t\t$line = 1;\n\r\n\t\tfor ($loop = 0; $loop < $size; $loop++)\r\n\t\t{\n\t\t\t$line += substr_count($content_blocks[$loop], \"\\n\");\n\n\t\t\tif (!$compile)\n\t\t\t{\n\t\t\t\tif (strtoupper(trim($tag_blocks[1][$loop])) == 'ENDIGNORE')\n\t\t\t\t{\n\t\t\t\t\t$compile = true;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($parse_content)\n\t\t\t{\n\t\t\t\t$content_blocks[$loop] = $this->_parse_content($content_blocks[$loop]);\n\t\t\t}\n\n\t\t\tif (empty($tag_blocks[1][$loop]))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (strtoupper(trim($tag_blocks[1][$loop])))\r\n\t\t\t{\n\t\t\t\tcase 'IF':\n\t\t\t\t\t$this->_tag_holding_add('IF', $line);\n\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_if($tag_blocks[2][$loop]);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ELSE':\n\t\t\t\t\t$last_tag = $this->_tag_holding_view();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'IF')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\r\n\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php } else { ?>';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ELSEIF':\n\t\t\t\t\t$last_tag = $this->_tag_holding_view();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'IF')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\r\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_if($tag_blocks[2][$loop], true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ENDIF':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'IF')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\r\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php } ?>';\r\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'LOOP':\n\t\t\t\t\t$this->_tag_holding_add('LOOP', $line);\n\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_loop($tag_blocks[2][$loop]);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'LOOPELSE':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'LOOP')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->_tag_holding_add('LOOPELSE', $line);\n\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php } } else { ?>';\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'ENDLOOP':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != ('LOOP' || 'LOOPELSE'))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_endloop($tag_blocks[2][$loop], $last_tag['name']);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'PHP':\n\t\t\t\t\t$this->_tag_holding_add('PHP', $line);\n\n\t\t\t\t\t$parse_content = false;\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php ';\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'ENDPHP':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\t\t\t\t\t\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'PHP')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\n\t\t\t\t\t$parse_content = true;\n\t\t\t\t\t$tag_blocks[0][$loop] = ' ?>';\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'INCLUDE':\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_include($tag_blocks[2][$loop]);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'DISPLAY_HEADER':\n\t\t\t\t\t$tag_blocks[0][$loop] = \"<?php echo \\$_CLASS['core_display']->display_header(); ?>\";\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'DISPLAY_FOOTER':\n\t\t\t\t\t$tag_blocks[0][$loop] = \"<?php echo \\$_CLASS['core_display']->display_footer(); ?>\";\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'IGNORE':\n\t\t\t\t\t$compile = false;\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'DEFINE':\r\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_define($tag_blocks[2][$loop]);\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'AREA':\r\n\t\t\t\t\t//$tag_blocks[0][$loop] = $this->_compile_tag_area($tag_blocks[2][$loop]);\r\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t//$tag_blocks[0][$loop] = '<!-- '.$tag_blocks[1][$loop].' '.$tag_blocks[2][$loop].' -->';\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\n\n\t\t$this->_compiled_code = '';\n\t\t$size = count($content_blocks);\n\n\t\tfor ($loop = 0; $loop < $size; $loop++)\n\t\t{\r\n\t\t\t$this->_compiled_code .= $content_blocks[$loop] . (isset($tag_blocks[0][$loop]) ? $tag_blocks[0][$loop] : '');\r\n\t\t}\n\n\t\treturn true;\n }", "function wp_cache_flush_runtime()\n {\n }", "public function isCompiled()\n {\n return $this->compilerExecuted;\n }", "public function compile() {\n\t\t$file = new CompiledFile();\n\t\treturn array($file);\n\t}", "public static function getCompiledPath($path)\n {\n }", "protected function compile()\n {\n if (TL_MODE == 'BE')\n {\n $this->strTemplate = 'be_wildcard';\n $this->Template = new \\BackendTemplate($this->strTemplate);\n }\n\n if (empty(self::$wrappers))\n {\n return;\n }\n\n foreach (array_pop(self::$wrappers) as $key => $value)\n {\n $this->Template->{$key} = $value;\n }\n }", "public function compileString($templateName, $templateBasedir, $templateFilepath, $parsedTemplateFilepath, $code) {\n\n // open the template\n $fp = fopen($parsedTemplateFilepath, \"w\");\n\n // lock the file\n if (flock($fp, LOCK_SH)) {\n\n // xml substitution\n $code = preg_replace(\"/<\\?xml(.*?)\\?>/s\", \"##XML\\\\1XML##\", $code);\n\n // disable php tag\n if (!$this->php_enabled)\n $code = str_replace(array(\"<?\", \"?>\"), array(\"&lt;?\", \"?&gt;\"), $code);\n\n // xml re-substitution\n $code = preg_replace_callback(\"/##XML(.*?)XML##/s\", function( $match ) {\n return \"<?php echo '<?xml \" . stripslashes($match[1]) . \" ?>'; ?>\";\n }, $code);\n\n $parsedCode = $this->compileTemplate($code, $isString = true, $templateBasedir, $templateDirectory = null, $templateFilepath);\n/* $parsedCode = \"<?php if(!class_exists('\\\\core\\\\rtpl\\\\RainbowTemplate')){exit;}?>\" . $parsedCode; */\n\n // fix the php-eating-newline-after-closing-tag-problem\n $parsedCode = str_replace(\"?>\\n\", \"?>\\n\\n\", $parsedCode);\n\n // create directories\n#ä if (!is_dir($this->config['cache_dir']))\n#ä mkdir($this->config['cache_dir'], 0755, true);\n\n // check if the cache is writable\n if (!is_writable($this->cache->getCacheDir()))\n throw new \\core\\exceptions\\OperationNotPermittedException('Cache directory ' . $this->cache->getCacheDir() . 'doesn\\'t have write permission. Set write permission or set RAINTPL_CHECK_TEMPLATE_UPDATE to false. More details on http://www.raintpl.com/Documentation/Documentation-for-PHP-developers/Configuration/');\n\n // write compiled file\n fwrite($fp, $parsedCode);\n\n // release the file lock\n flock($fp, LOCK_UN);\n }\n\n // close the file\n fclose($fp);\n }", "public function plxMinifyCacheList(){\n\t\tfunction real($i,$a){$a=explode(' ',$a);return $a[$i];}# found url & more in last comment in cached source\n\t\t$cache_size = 0;\n\t\t$filesCache = array();\n\t\tif (extension_loaded('glob')){\n\t\t\t$cached = glob(PLX_CACHE.\"*.php\");\n\t\t\tforeach ($cached as $file){\n\t\t\t\t$cache_size += filesize(PLX_CACHE.$file);\n\t\t\t\t$filesCache [$this->get_time($file)] = array((basename($file)), $this->get_info($file), $this->get_info($file,'url'));\n\t\t\t}\n\t\t\tunset($cached);\n\t\t}\n\t\telse{\n\t\t\tif($cached = opendir(PLX_CACHE)){\n\t\t\t\twhile(($file = readdir($cached))!== false){\n\t\t\t\t\tif( $file == '.' || $file == '..' )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif(strtolower(strrchr($file,'.')==\".php\")){\n\t\t\t\t\t\t$cache_size += filesize(PLX_CACHE.$file);\n\t\t\t\t\t\t$filesCache [$this->get_time($file)] = array((basename($file)), $this->get_info($file), $this->get_info($file,'url'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclosedir($cached);\n\t\t\t}\n\t\t}\n\t\tkrsort($filesCache);\n\t\t$expire = ($this->getParam(\"freeze\")?0:time() - $this->getParam(\"delay\"));\n\t\techo '<img id=\"mc_mode\" class=\"icon_pmc\" src=\"'.PLX_PLUGINS.'plxMinifyCache/img/'.($this->getParam(\"freeze\")?'':'un').'lock.png\" title=\"Mode : '.($this->getParam(\"freeze\")?'Frozen':'Normal').'\" alt=\"Freeze Mode\" />&nbsp;';\n\t\techo $this->getLang('L_CACHE_LIST').' ('.count($filesCache).') : '.date('Y-m-d H:i:s').' - '.$this->getLang('L_TOT').' : '.$this->size_readable($cache_size, $decimals = 2).'<hr /><pre id=\"CacheList\" class=\"brush_bash\">';\n\t\tforeach($filesCache as $ts => $name)#findicons.com free\n\t\t\techo '<a class=\"hide\" title=\"'.L_DELETE.' '.$name[0].'\" href=\"javascript:clean(\\''.$name[0].'\\');\"><img class=\"icon_pmc del_file\" src=\"'.PLX_PLUGINS.'plxMinifyCache/img/del.png\" title=\"'.L_DELETE.'\" alt=\"del\" /></a><b style=\"color:'.($ts < $expire?'red\" title=\"expired\">':'green\">').' <a title=\"'.$name[0].PHP_EOL.$name[2].'\" target=\"_blank\" style=\"color:unset;\" href=\"'.PLX_ROOT.'cache/'.$name[0].'\">'.date('Y-m-d H:i:s',$ts).'<i class=\"mc-sml-hide\"> : '.$name[0].'</i></a></b> : <a title=\"'.real(2,$name[2]).PHP_EOL.real(1,$name[2]).'\" target=\"_blank\" href=\"'.PLX_ROOT.real(1,$name[2]).'\">'.$name[1].'</a><br />';\n\t\techo '<br /></pre>';\n\t}", "public function cache($output)\n\t{\n\t\t$name = Kohana::config($this->type.'.cache_folder').'/'.md5($this->file).EXT;\n\t\t// add offset to cache file if using load() if not nested don't indent\n\t\tfile_put_contents($name, $output);\n\t\tunset($output);\n\t}", "public function generateDcaCache()\n\t{\n\t\t$arrFiles = array();\n\n\t\t// Parse all active modules\n\t\tforeach (\\ModuleLoader::getActive() as $strModule)\n\t\t{\n\t\t\t$strDir = 'system/modules/' . $strModule . '/dca';\n\n\t\t\tif (!is_dir(TL_ROOT . '/' . $strDir))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach (scan(TL_ROOT . '/' . $strDir) as $strFile)\n\t\t\t{\n\t\t\t\tif (strncmp($strFile, '.', 1) !== 0 && substr($strFile, -4) == '.php')\n\t\t\t\t{\n\t\t\t\t\t$arrFiles[] = substr($strFile, 0, -4);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$arrFiles = array_values(array_unique($arrFiles));\n\n\t\t// Create one file per table\n\t\tforeach ($arrFiles as $strName)\n\t\t{\n\t\t\t// Generate the cache file\n\t\t\t$objCacheFile = new \\File('system/cache/dca/' . $strName . '.php', true);\n\t\t\t$objCacheFile->write('<?php '); // add one space to prevent the \"unexpected $end\" error\n\n\t\t\t// Parse all active modules\n\t\t\tforeach (\\ModuleLoader::getActive() as $strModule)\n\t\t\t{\n\t\t\t\t$strFile = 'system/modules/' . $strModule . '/dca/' . $strName . '.php';\n\n\t\t\t\tif (file_exists(TL_ROOT . '/' . $strFile))\n\t\t\t\t{\n\t\t\t\t\t$objCacheFile->append(static::readPhpFileWithoutTags($strFile));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Close the file (moves it to its final destination)\n\t\t\t$objCacheFile->close();\n\t\t}\n\n\t\t// Add a log entry\n\t\t$this->log('Generated the DCA cache', __METHOD__, TL_CRON);\n\t}", "public function compile($path = null)\n {\n if ($path) {\n $this->setPath($path);\n }\n\n $templateTokens = $this->tokenize($this->getFileSource($this->getPath()));\n\n $this->root = new Document(null, $templateTokens, $this);\n\n if($this->isExpired($path)) {\n $this->files->put($this->getCompiledPath($this->getPath()), serialize($this->root));\n }\n }" ]
[ "0.6808728", "0.67553514", "0.66700286", "0.66240984", "0.6511972", "0.6392678", "0.6386782", "0.63461745", "0.6343253", "0.63414276", "0.63107276", "0.62890506", "0.6272925", "0.62554634", "0.6238781", "0.6230537", "0.62223566", "0.61921704", "0.6151802", "0.6141674", "0.61033803", "0.6083859", "0.5999028", "0.5938427", "0.5935753", "0.5934172", "0.5911306", "0.5909943", "0.5902465", "0.58575374", "0.5794236", "0.5783246", "0.5737065", "0.5724123", "0.57200676", "0.57192403", "0.5710646", "0.56982017", "0.56755525", "0.5671666", "0.56535167", "0.5610556", "0.5588968", "0.5584084", "0.55411804", "0.55377334", "0.55345964", "0.5511703", "0.5498089", "0.5492591", "0.54839975", "0.5469008", "0.54654586", "0.5463312", "0.5459671", "0.5459496", "0.54460657", "0.5443157", "0.5439527", "0.5431528", "0.5426515", "0.5425688", "0.5424901", "0.54050565", "0.53983057", "0.53940296", "0.5393442", "0.5390235", "0.5388203", "0.5386746", "0.53818774", "0.5363945", "0.5357119", "0.53569645", "0.5341009", "0.5331365", "0.5330209", "0.5327112", "0.5326422", "0.5323227", "0.5318924", "0.5312368", "0.5310588", "0.5299717", "0.5295582", "0.5284279", "0.5276112", "0.52577096", "0.5255929", "0.5255072", "0.5250355", "0.5230807", "0.5224362", "0.5215959", "0.5215174", "0.52072924", "0.52015203", "0.51994705", "0.51994467", "0.51993513" ]
0.6836335
0
Compiles the given string of code, and returns the result in a string. If "do_not_echo" is true, the returned code will not be directly executable, but can be used as part of a variable assignment for use in assign_code_from_handle(). This function isn't used and kept only for compatibility with original template.php
function compile($code, $do_not_echo = false, $retvar = '') { $code = ' ?' . '>' . $this->compile_code('', $code, true) . '<' . '?php' . "\n"; if($do_not_echo) { $code = "ob_start();\n". $code. "\n\${$retvar} = ob_get_contents();\nob_end_clean();\n"; } return $code; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compile($code, $do_not_echo = false, $retvar = '')\n\t{\n\t\t$code = str_replace('\\\\', '\\\\\\\\', $code);\n\t\t$code = str_replace('\\'', '\\\\\\'', $code);\n\n\t\t// change template varrefs into PHP varrefs\n\n\t\t// This one will handle varrefs WITH namespaces\n\t\t$varrefs = array();\n\t\tpreg_match_all('#\\{(([a-z0-9\\-_]+?\\.)+?)([a-z0-9\\-_]+?)\\}#is', $code, $varrefs);\n\t\t$varcount = sizeof($varrefs[1]);\n\t\tfor ($i = 0; $i < $varcount; $i++)\n\t\t{\n\t\t\t$namespace = $varrefs[1][$i];\n\t\t\t$varname = $varrefs[3][$i];\n\t\t\t$new = $this->generate_block_varref($namespace, $varname);\n\n\t\t\t$code = str_replace($varrefs[0][$i], $new, $code);\n\t\t}\n\n\t\t// This will handle the remaining root-level varrefs\n\t\t$code = preg_replace('#\\{([a-z0-9\\-_]*?)\\}#is', '\\' . ( ( isset($this->_tpldata[\\'.\\'][0][\\'\\1\\']) ) ? $this->_tpldata[\\'.\\'][0][\\'\\1\\'] : \\'\\' ) . \\'', $code);\n\n\t\t// Break it up into lines.\n\t\t$code_lines = explode(\"\\n\", $code);\n\n\t\t$block_nesting_level = 0;\n\t\t$block_names = array();\n\t\t$block_names[0] = \".\";\n\n\t\t// Second: prepend echo ', append ' . \"\\n\"; to each line.\n\t\t$line_count = sizeof($code_lines);\n\t\tfor ($i = 0; $i < $line_count; $i++)\n\t\t{\n\t\t\t$code_lines[$i] = chop($code_lines[$i]);\n\t\t\tif (preg_match('#<!-- BEGIN (.*?) -->#', $code_lines[$i], $m))\n\t\t\t{\n\t\t\t\t$n[0] = $m[0];\n\t\t\t\t$n[1] = $m[1];\n\n\t\t\t\t// Added: dougk_ff7-Keeps templates from bombing if begin is on the same line as end.. I think. :)\n\t\t\t\tif ( preg_match('#<!-- END (.*?) -->#', $code_lines[$i], $n) )\n\t\t\t\t{\n\t\t\t\t\t$block_nesting_level++;\n\t\t\t\t\t$block_names[$block_nesting_level] = $m[1];\n\t\t\t\t\tif ($block_nesting_level < 2)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Block is not nested.\n\t\t\t\t\t\t$code_lines[$i] = '$_' . $n[1] . '_count = ( isset($this->_tpldata[\\'' . $n[1] . '.\\']) ) ? sizeof($this->_tpldata[\\'' . $n[1] . '.\\']) : 0;';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . '{';\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// This block is nested.\n\n\t\t\t\t\t\t// Generate a namespace string for this block.\n\t\t\t\t\t\t$namespace = implode('.', $block_names);\n\t\t\t\t\t\t// strip leading period from root level..\n\t\t\t\t\t\t$namespace = substr($namespace, 2);\n\t\t\t\t\t\t// Get a reference to the data array for this block that depends on the\n\t\t\t\t\t\t// current indices of all parent blocks.\n\t\t\t\t\t\t$varref = $this->generate_block_data_ref($namespace, false);\n\t\t\t\t\t\t// Create the for loop code to iterate over this block.\n\t\t\t\t\t\t$code_lines[$i] = '$_' . $n[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref . ') : 0;';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . '{';\n\t\t\t\t\t}\n\n\t\t\t\t\t// We have the end of a block.\n\t\t\t\t\tunset($block_names[$block_nesting_level]);\n\t\t\t\t\t$block_nesting_level--;\n\t\t\t\t\t$code_lines[$i] .= '} // END ' . $n[1];\n\t\t\t\t\t$m[0] = $n[0];\n\t\t\t\t\t$m[1] = $n[1];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// We have the start of a block.\n\t\t\t\t\t$block_nesting_level++;\n\t\t\t\t\t$block_names[$block_nesting_level] = $m[1];\n\t\t\t\t\tif ($block_nesting_level < 2)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Block is not nested.\n\t\t\t\t\t\t$code_lines[$i] = '$_' . $m[1] . '_count = ( isset($this->_tpldata[\\'' . $m[1] . '.\\']) ) ? sizeof($this->_tpldata[\\'' . $m[1] . '.\\']) : 0;';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . '{';\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// This block is nested.\n\n\t\t\t\t\t\t// Generate a namespace string for this block.\n\t\t\t\t\t\t$namespace = implode('.', $block_names);\n\t\t\t\t\t\t// strip leading period from root level..\n\t\t\t\t\t\t$namespace = substr($namespace, 2);\n\t\t\t\t\t\t// Get a reference to the data array for this block that depends on the\n\t\t\t\t\t\t// current indices of all parent blocks.\n\t\t\t\t\t\t$varref = $this->generate_block_data_ref($namespace, false);\n\t\t\t\t\t\t// Create the for loop code to iterate over this block.\n\t\t\t\t\t\t$code_lines[$i] = '$_' . $m[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref . ') : 0;';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . '{';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (preg_match('#<!-- END (.*?) -->#', $code_lines[$i], $m))\n\t\t\t{\n\t\t\t\t// We have the end of a block.\n\t\t\t\tunset($block_names[$block_nesting_level]);\n\t\t\t\t$block_nesting_level--;\n\t\t\t\t$code_lines[$i] = '} // END ' . $m[1];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// We have an ordinary line of code.\n\t\t\t\tif (!$do_not_echo)\n\t\t\t\t{\n\t\t\t\t\t$code_lines[$i] = 'echo \\'' . $code_lines[$i] . '\\' . \"\\\\n\";';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$code_lines[$i] = '$' . $retvar . '.= \\'' . $code_lines[$i] . '\\' . \"\\\\n\";'; \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Bring it back into a single string of lines of code.\n\t\t$code = implode(\"\\n\", $code_lines);\n\t\treturn $code\t;\n\n\t}", "public function getCompiledCode(bool $force = false): string\n {\n return $this->checkCompileState() || $force ? $this->compile() : $this->getFileContent($this->outputFile);\n }", "function compile($name, $code = false)\n {\n\t\tif (!$code)\n\t\t{\n\t\t\t$code = file_get_contents($this->template_dir.$name);\n\t\n\t\t\tif ($code === false)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpreg_match_all('/\\<!--[ ]*(.*?) (.*?)?[ ]*--\\>/', $code, $tag_blocks);\n\t\t$content_blocks = preg_split('/\\<!--[ ]*(.*?) (.*?)?[ ]*--\\>/', $code);\n\n\t\t$size = count($content_blocks);\n\n\t\t$parse_content = $compile = true;\n\t\t$tag_holding = array();\n\t\t$line = 1;\n\r\n\t\tfor ($loop = 0; $loop < $size; $loop++)\r\n\t\t{\n\t\t\t$line += substr_count($content_blocks[$loop], \"\\n\");\n\n\t\t\tif (!$compile)\n\t\t\t{\n\t\t\t\tif (strtoupper(trim($tag_blocks[1][$loop])) == 'ENDIGNORE')\n\t\t\t\t{\n\t\t\t\t\t$compile = true;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($parse_content)\n\t\t\t{\n\t\t\t\t$content_blocks[$loop] = $this->_parse_content($content_blocks[$loop]);\n\t\t\t}\n\n\t\t\tif (empty($tag_blocks[1][$loop]))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (strtoupper(trim($tag_blocks[1][$loop])))\r\n\t\t\t{\n\t\t\t\tcase 'IF':\n\t\t\t\t\t$this->_tag_holding_add('IF', $line);\n\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_if($tag_blocks[2][$loop]);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ELSE':\n\t\t\t\t\t$last_tag = $this->_tag_holding_view();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'IF')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\r\n\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php } else { ?>';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ELSEIF':\n\t\t\t\t\t$last_tag = $this->_tag_holding_view();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'IF')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\r\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_if($tag_blocks[2][$loop], true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ENDIF':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'IF')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\r\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php } ?>';\r\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'LOOP':\n\t\t\t\t\t$this->_tag_holding_add('LOOP', $line);\n\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_loop($tag_blocks[2][$loop]);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'LOOPELSE':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'LOOP')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->_tag_holding_add('LOOPELSE', $line);\n\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php } } else { ?>';\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'ENDLOOP':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != ('LOOP' || 'LOOPELSE'))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_endloop($tag_blocks[2][$loop], $last_tag['name']);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'PHP':\n\t\t\t\t\t$this->_tag_holding_add('PHP', $line);\n\n\t\t\t\t\t$parse_content = false;\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php ';\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'ENDPHP':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\t\t\t\t\t\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'PHP')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\n\t\t\t\t\t$parse_content = true;\n\t\t\t\t\t$tag_blocks[0][$loop] = ' ?>';\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'INCLUDE':\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_include($tag_blocks[2][$loop]);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'DISPLAY_HEADER':\n\t\t\t\t\t$tag_blocks[0][$loop] = \"<?php echo \\$_CLASS['core_display']->display_header(); ?>\";\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'DISPLAY_FOOTER':\n\t\t\t\t\t$tag_blocks[0][$loop] = \"<?php echo \\$_CLASS['core_display']->display_footer(); ?>\";\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'IGNORE':\n\t\t\t\t\t$compile = false;\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'DEFINE':\r\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_define($tag_blocks[2][$loop]);\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'AREA':\r\n\t\t\t\t\t//$tag_blocks[0][$loop] = $this->_compile_tag_area($tag_blocks[2][$loop]);\r\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t//$tag_blocks[0][$loop] = '<!-- '.$tag_blocks[1][$loop].' '.$tag_blocks[2][$loop].' -->';\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\n\n\t\t$this->_compiled_code = '';\n\t\t$size = count($content_blocks);\n\n\t\tfor ($loop = 0; $loop < $size; $loop++)\n\t\t{\r\n\t\t\t$this->_compiled_code .= $content_blocks[$loop] . (isset($tag_blocks[0][$loop]) ? $tag_blocks[0][$loop] : '');\r\n\t\t}\n\n\t\treturn true;\n }", "function _compile_text($code, $use_isset)\n\t{\n\t\tif(strlen($code) < 3)\n\t\t{\n\t\t\treturn $code;\n\t\t}\n\t\t// change template varrefs into PHP varrefs\n\t\t// This one will handle varrefs WITH namespaces\n\t\t$varrefs = array();\n\t\tpreg_match_all('#\\{(([a-z0-9\\-_]+?\\.)+?)([a-z0-9\\-_]+?)\\}#is', $code, $varrefs);\n\t\t$varcount = sizeof($varrefs[1]);\n\t\t$search = array();\n\t\t$replace = array();\n\t\tfor ($i = 0; $i < $varcount; $i++)\n\t\t{\n\t\t\t$namespace = $varrefs[1][$i];\n\t\t\t$varname = $varrefs[3][$i];\n\t\t\t$new = $this->generate_block_varref($namespace, $varname, $use_isset);\n\t\t\t$search[] = $varrefs[0][$i];\n\t\t\t$replace[] = $new;\n\t\t}\n\t\tif(sizeof($search) > 0)\n\t\t{\n\t\t\t$code = str_replace($search, $replace, $code);\n\t\t}\n\t\t// This will handle the remaining root-level varrefs\n\t\t$code = preg_replace('#\\{([a-z0-9\\-_]*?)\\}#is', '<'.'?php echo isset($this->vars[\\'\\1\\']) ? $this->vars[\\'\\1\\'] : $this->lang(\\'\\1\\'); ?'.'>', $code);\n\t\t$code = preg_replace('#\\{\\$([a-z0-9\\-_]*?)\\}#is', '<'.'?php echo isset($this->_tpldata[\\'DEFINE\\'][\\'.\\'][\\'\\\\1\\']) ? $this->_tpldata[\\'DEFINE\\'][\\'.\\'][\\'\\\\1\\'] : \\'\\'; ?'.'>', $code);\n\t\treturn $code;\n\t}", "public function compileString($string, $templateName = \"\", $includeDebuggingComments = false, $topTemplate = true)\n {\n $code = parent::compileString($string, $templateName, $includeDebuggingComments, $topTemplate);\n \n // Minify HTML code from templates. Ignores content from WYSIWYG editors etc.\n $minified = preg_replace_callback(\"/(\\\\\\$val \\.= ')((?:\\\\\\'|[\\s\\t\\r\\n]|[^'])*)(';)/\", function($matches) {\n // Double preg_replace used to make sure we only replace whitespace within the html.\n $matches[2] = preg_replace('/[\\s\\t\\r\\n]+/', ' ', $matches[2]);\n return $matches[1] . $matches[2] . $matches[3];\n }, $code) ?: preg_replace('/[\\s\\t\\r\\n]+/', ' ', $code); // Fall back when preg_replace_callback returns an empty string.\n \n // Fall back in case preg_replace also returns an empty string.\n return $minified ?: $code;\n }", "function compile2($code, $handle, $cache_file)\n\t{\n\t\t$code = $this->compile_code('', $code, XS_USE_ISSET);\n\t\tif($cache_file && !empty($this->use_cache) && !empty($this->auto_compile))\n\t\t{\n\t\t\t$res = $this->write_cache($cache_file, $code);\n\t\t\tif($handle && $res)\n\t\t\t{\n\t\t\t\t$this->files_cache[$handle] = $cache_file;\n\t\t\t}\n\t\t}\n\t\t$code = '?' . '>' . $code . '<' . '?php' . \"\\n\";\n\t\treturn $code;\n\t}", "public function blader($str, $data = array(), $phpCompile = true)\n {\n if ($phpCompile == false) {\n $patterns = array('|<\\?|', '|<\\?php|', '|<\\%|', '|\\?>|', '|\\%>|');\n $replacements = array('&lt;?', '&lt;php', '&lt;%', '?&gt;', '%&gt;');\n\n $str = preg_replace($patterns, $replacements, $str);\n }\n\n // Get blade compiler.\n $parsed = $this->getCompiler('blade')->compileString($str);\n\n ob_start() and extract($data, EXTR_SKIP);\n\n try {\n eval('?>'.$parsed);\n } catch (\\Exception $e) {\n ob_end_clean(); throw $e;\n }\n\n $str = ob_get_contents();\n ob_end_clean();\n\n return $str;\n }", "public function compileWiths($value, array $args = array())\n {\n $generated = parent::compileString($value);\n\n ob_start() and extract($args, EXTR_SKIP);\n\n // We'll include the view contents for parsing within a catcher\n // so we can avoid any WSOD errors. If an exception occurs we\n // will throw it out to the exception handler.\n try\n {\n eval('?>'.$generated);\n }\n\n // If we caught an exception, we'll silently flush the output\n // buffer so that no partially rendered views get thrown out\n // to the client and confuse the user with junk.\n catch (\\Exception $e)\n {\n ob_get_clean(); throw $e;\n }\n\n $content = ob_get_clean();\n\n return $content;\n }", "private function compile($contents, $autoEscape = true)\n {\n $contents = preg_replace(\n array(\n \"/{{/\",\n \"/}}\\n/\",\n \"/}}/\",\n \"/\\[\\[/\",\n \"/\\]\\]/\",\n '/^\\s*@(.*)$/m',\n '/{%\\s*block\\s(.*)\\s*%}(.*){%\\s*endblock\\s*%}/Usm',\n ),\n array(\n $autoEscape ? \"<?php echo(htmlspecialchars(\" : \"<?php echo(\",\n $autoEscape ? \")); ?>\\n\\n\" : \"); ?>\\n\\n\",\n $autoEscape ? \")); ?>\" : \"); ?>\",\n \"<?php \",\n \" ?>\",\n \"<?php \\\\1 ?>\",\n \"<?php if (array_key_exists('\\\\1', \\$this->inheritBlocks)) { echo \\$this->inheritBlocks['\\\\1']; } else if (\\$this->inheritFrom === NULL) { ?>\\\\2<?php } else { ob_start(); ?>\\\\2<?php \\$this->inheritBlocks['\\\\1'] = ob_get_contents(); ob_end_clean(); } ?>\",\n ),\n $contents\n );\n\n return $contents;\n }", "public function generateCode() {\n $content = \"\";\n foreach ($this->arrTemplates as $template) {\n if (!file_exists($template)) {\n //Template not found\n continue;\n }\n $content .= file_get_contents($template);\n }\n \n foreach ($this->attributes as $key => $val) {\n $content = str_replace($this->placeHolderStart.$key.$this->placeHolderEnd, $val, $content);\n }\n return $content;\n }", "function lapa_compiler_php_code($act, $parser)\n{\n if ($act == 1) {\n $buff = '';\n if (!isset(LapaEngineParser::$_plugins_property['php_code'])) {\n LapaEngineParser::$_plugins_property['php_code'] = array();\n }\n $attr = $parser->parseDirectiveAttributes();\n $name = isset($attr['name']) ? $attr['name']: 'default';\n $parser->newStackCommand(array('php_code', $name));\n $parser->_outputNew();\n }else {\n if ( (!$stack_commands = $parser->getStackCommand() ) || $stack_commands[0] != 'php_code' ) {\n throw new LapaEngineException('Неверный вызов \"/php_code\" cтрока %s.', $parser->templateLine());\n }\n /* вырезали буффер php кода, его надо еще вернуть */\n $buff = $parser->_outputGet();\n /* создаем переменную с значением */ \n LapaEngineParser::$_plugins_property['php_code'][$stack_commands[1]] = $stack_commands[1];\n $buff .= \"\\$_var_php_code['{$stack_commands[1]}'] = '\" . preg_replace(\"/(?!\\\\\\\\)\\\\'/\", '\\\\\\'','<?php ' . str_replace('\\\\', '\\\\\\\\',$buff) . ' ?>') . \"';\"; \n $parser->removeStackCommand(); \n LapaEngineParser::$_plugins_property['php_code'][$stack_commands[1]] = $stack_commands[1];\n }\n return $buff;\n}", "function execute($filename, $code, $handle)\n\t{\n\t\tglobal $lang, $theme, $config;\n\t\t$template = $theme['template_name'];\n\t\tglobal ${$template};\n\t\t$theme_info = &${$template};\n\t\t$exclude_tpl_array = array('def_tree_def.tpl', 'rss_body.tpl');\n\t\t//die(basename($this->files[$handle]));\n\t\tif($config['xs_add_comments'] && $handle && !in_array(basename($this->files[$handle]), $exclude_tpl_array))\n\t\t{\n\t\t\techo '<!-- template ', $this->files[$handle], ' start -->';\n\t\t}\n\t\tif($filename)\n\t\t{\n\t\t\tinclude($filename);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/*\n\t\t\tdie($this->files[$handle]);\n\t\t\tdie($code);\n\t\t\t*/\n\t\t\teval($code);\n\t\t}\n\t\tif($config['xs_add_comments'] && $handle && !in_array(basename($this->files[$handle]), $exclude_tpl_array))\n\t\t{\n\t\t\techo '<!-- template ', $this->files[$handle], ' end -->';\n\t\t}\n\t\treturn true;\n\t}", "public static function compileString($value){\n return \\Illuminate\\View\\Compilers\\BladeCompiler::compileString($value);\n }", "private function compile($content) { //was display function here\r\n\t\r\n\t\t\t//loop \r\n\t\t\t$content = preg_replace_callback('#{loop[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)(.*?)\\}(.*?){\\/loop\\}#is',array(&$this,'loop_bt'), $content);\r\n\t\t\t//if and her sisters\r\n\t\t\t$content = preg_replace_callback('#{(if|elseif)[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)[^>]([a-zA-Z\\=\\!\\>\\%\\&\\|\\</]{1,3})[^>](.*?)\\}#i',array(&$this,'if_expr'), $content);\r\n\r\n\t\t\t//matchs ..\r\n\t\t\t$matchs\t= array(\r\n\t\t\t\t\t\t\t\t'#{include_tpl[^>](.*?)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{include_script[^>](.*?)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{if[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{elseif[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{else\\}#i',\r\n\t\t\t\t\t\t\t\t'#{\\/if\\}#i',\r\n\t\t\t\t\t\t\t\t($this->php_compile == 'on') ? '#{php\\}(.*?){\\/php\\}#is' : '##',\r\n\t\t\t\t\t\t\t\t($this->global_vars == 'on') ? '#{([a-zA-Z0-9\\_\\-\\+\\./]+)}#' : '##',\r\n\t\t\t\t\t\t\t\t'#{assets[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)}#is',\r\n\t\t\t\t\t\t\t);\r\n\t\t\t//replaces\t\t\t\t\r\n\t\t\t$replaces = array ( \r\n\t\t\t\t\t\t\t\t\t'<?php $this->include_tpl(\\'\\\\1\\'); ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php include(\\'\\\\1\\'); ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php if($this->vars[\\'\\\\1\\']){ ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php } elseif(\\\\1){?>',\r\n\t\t\t\t\t\t\t\t\t'<?php } else { ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php } ?>',\r\n\t\t\t\t\t\t\t\t\t($this->php_compile == 'on') ? '<?php \\\\1 ?>' : '',\r\n\t\t\t\t\t\t\t\t\t($this->global_vars == 'on') ? '<?php print $this->vars[\\'\\\\1\\'];?>' : '',\r\n\t\t\t\t\t\t\t\t\t'<?php echo $this->assets(\\'\\\\1\\'); ?>',\r\n\t\t\t\t\t\t\t\t);\r\n\t\t//show time ..\r\n\t\t$content = preg_replace($matchs,$replaces, $content);\r\n\t\t\r\n\t\tif($this->global_vars != 'on'){ \r\n\t\t\t$content = preg_replace_callback('#{([a-zA-Z0-9\\_\\-\\+\\./]+)}#',array(&$this,'assign_if_global_off'), $content);\r\n\t\t}\r\n\t\t\r\n\t\treturn $content; \r\n }", "function php_render($str, $info = null)\n\t{\n\t\tob_start();\n\t\teval('?>' . $str);\n\t\t$str = ob_get_contents();\n\t\tob_end_clean();\n\n\t\t$error_pattern = \"`^<br />\\n(<b>.* in <b>)/.*(</b> on line <b>[0-9]+</b>)<br />`\";\n\t\tif(preg_match($error_pattern, $str, $error)) {\n\t\t\t$str = substr(preg_replace($error_pattern, '', $str), 7);\n\t\t\tif($this->user->rank)\n\t\t\t\t$this->infos .= $this->admin_msg('php', 'error', '<p>'.$error[1].$info.$error[2].'</p>');\n\t\t\tthrow new Exception();\n\t\t}\n\t\treturn $str;\n\t}", "static function php_compiler ($space, $html)\n {\n return \"<?php\\n$space$html?>\";\n }", "public function getCodeSample()\n {\n $code = <<< 'CODE'\n namespace KEINOS\\AutoMailReply;\n require_once('./src/constants.php');\n require_once('./src/functions.php');\n echo (isModeDebug() === true) ? 'true' : 'false';\nCODE;\n $code = \\str_replace(PHP_EOL, '', $code);\n\n return $code;\n }", "function compile ($src);", "protected function codeToModify()\n {\n return '\n if (is_callable(array($this->metaclass, func_get_arg(0)))) {\n try {\n return call_user_func_array(array($this->metaclass, ' .\n 'func_get_arg(0)), func_get_arg(1));\n } catch (BadMethodCallException $e) {\n %s\n }\n }\n ';\n }", "public function compileString($value)\n {\n $result = '';\n $this->footer = array();\n\n // Here we will loop through all of the tokens returned by the Zend lexer and\n // parse each one into the corresponding valid PHP. We will then have this\n // template as the correctly rendered PHP that can be rendered natively.\n foreach (token_get_all($value) as $token) {\n $result .= is_array($token) ? $this->parseToken($token) : $token;\n }\n\n // If there are any footer lines that need to get added to a template we will\n // add them here at the end of the template. This gets used mainly for the\n // template inheritance via the extends keyword that should be appended.\n if (count($this->footer) > 0) {\n $result = ltrim($result, PHP_EOL)\n .PHP_EOL.implode(PHP_EOL, array_reverse($this->footer));\n }\n\n return $result;\n }", "public function getTemplate($namespace, $useStatements, $comments, $code)\n {\n return '<?php'.PHP_EOL.\n $this->topComment.\n $namespace.PHP_EOL.\n $useStatements.PHP_EOL.PHP_EOL.\n $comments.PHP_EOL.\n $code.PHP_EOL;\n }", "public function compile ();", "protected function compile()\n {\n // Backend mode\n if (TL_MODE == 'BE') {\n return $this->compileBackend('### Showcase Overview ###');\n }\n\n // Add folder navigation\n \\Input::setGet('showcase', \\Input::get('showcase'));\n\n if (!empty(\\Input::get('showcase'))) {\n return '';\n }\n\n // Add isotope JS library\n $GLOBALS['TL_JAVASCRIPT'][] = Environment::get('path').'/bundles/comoloshowcase/js/isotope.pkgd.min.js|static';\n $GLOBALS['TL_JAVASCRIPT'][] = Environment::get('path').'/bundles/comoloshowcase/js/isotope-script.js|static';\n\n $this->Template->categories = ShowcaseCategoryModel::findBy('pid', $this->showcase, ['order' => 'sorting ASC']);\n $this->Template->strShowcases = $this->parseShowcases();\n }", "static private function optimizeOutput(&$output) {\n\t\tif (!isset($_GET['no_opti'])) {\n\t\t\t$preserved_tags = array('textarea', 'pre', 'script', 'style', 'code');\n\t\t\t$preserved_blocks = array();\n\t\t\t$preserved_boundry = '@@PRESERVEDTAG@@';\n\t\t\t$cdata_blocks = array();\n\t\t\t$cdata_boundry = '@@CDATA@@';\n\t\t\t$conditional_boundries = array('@@IECOND-OPEN@@', '@@IECOND-CLOSE@@');\n\n\t\t\t$output = str_replace(array('<!--[if', '<!--<![endif]-->'), $conditional_boundries, $output);\n\t\t\t$output = preg_replace('/<!--(.|\\s)*?-->/', '', $output);\n\t\t\t$output = str_replace($conditional_boundries, array('<!--[if', '<!--<![endif]-->'), $output);\n\n\t\t\t$tag_string = implode('|', $preserved_tags);\n\t\t\tpreg_match_all('!<(' . $tag_string . ')[^>]*>.*?</(' . $tag_string . ')>!is', $output, $preserved_blocks);\n\t\t\t$preserved_blocks = $preserved_blocks[0];\n\t\t\t$output = preg_replace('!<(' . $tag_string . ')[^>]*>.*?</(' . $tag_string . ')>!is', $preserved_boundry, $output);\n\n\t\t\tpreg_match_all('/<!\\[CDATA\\[.*?\\]\\]>/is', $output, $cdata_blocks);\n\t\t\t$cdata_blocks = $cdata_blocks[0];\n\t\t\t$output = preg_replace('/<!\\[CDATA\\[.*?\\]\\]>/is', $cdata_boundry, $output);\n\n\t\t\t$output = preg_replace('/[\\t\\s\\n\\r]+/m', ' ', $output);\n\t\t\t$output = str_replace('> <', '><', $output);\n\n\t\t\tforeach($preserved_blocks as $curr_block) {\n\t\t\t\t$output = preg_replace('!' . $preserved_boundry . '!', $curr_block, $output, 1);\n\t\t\t}\n\n\t\t\tforeach($cdata_blocks as $curr_block) {\n\t\t\t\t$output = preg_replace('!' . $cdata_boundry . '!', $curr_block, $output, 1);\n\t\t\t}\n\n\t\t\t$output = trim($output);\n\t\t}\n\t}", "public static function compileBlade($str, $data = [])\n {\n if (view()->exists($str)) {\n /** @var view-string $str */\n return view($str, $data)->render();\n }\n\n ob_start() && extract($data, EXTR_SKIP);\n eval('?>'.app('blade.compiler')->compileString($str));\n $str = ob_get_contents();\n ob_end_clean();\n\n return $str;\n }", "function compile_template($template)\n {\n $template = preg_replace('/<\\?xml/i', \"<?php echo '<?xml'; ?>\", $template);\n\n // Compile variables in PHP code\n preg_match_all(\n \"/<[\\?|%]+(php|=)?(.*)[\\?|%]+>/siU\",\n $template,\n $regs,\n PREG_SET_ORDER\n );\n\n for ($i = 0; isset($regs[$i]); $i++) {\n // Fix single quotes\n $parsed = preg_replace_callback(\n \"/=\\s*'(.*)\".preg_quote($this->start).\"([A-Z0-9_]+)\".preg_quote($this->end).\"(.*)';/Usi\",\n array(&$this, '_fix_php_quotes'),\n $regs[$i][0]\n );\n\n $parsed = preg_replace_callback(\n '='.preg_quote($this->start).'([A-Z0-9_]+)'.preg_quote($this->end).'=Usi',\n array(&$this, '_compile_php_var'),\n $parsed\n );\n\n $template = str_replace($regs[$i][0], $parsed, $template);\n }\n\n // Compile variables\n $template = preg_replace_callback(\n '='.preg_quote($this->start).'([A-Z0-9_]+)'.preg_quote($this->end).'=Usi',\n array(&$this, '_compile_var'),\n $template\n );\n\n // Compile condition tags\n $template = preg_replace_callback(\n '='.preg_quote($this->start).'if(not?)?\\s+([A-Z0-9_]+)'.preg_quote($this->end).'=Usi',\n array(&$this, '_compile_condition_start'),\n $template\n );\n\n $template = preg_replace_callback(\n '='.preg_quote($this->start).'endif(not?)?\\s+([A-Z0-9_]+)'.preg_quote($this->end).'=Usi',\n array(&$this, '_compile_condition_end'),\n $template\n );\n\n return $template;\n }", "public function compile()\n {\n\n $this->buildPage();\n\n if (defined('DEBUG_MARKUP') && DEBUG_MARKUP) {\n ob_start();\n $checkXml = new DOMDocument();\n\n if ($this instanceof LibTemplateAjax)\n $checkXml->loadXML($this->compiled);\n else\n $checkXml->loadHTML($this->compiled);\n\n $errors = ob_get_contents();\n ob_end_clean();\n\n // nur im fehlerfall loggen\n if ('' !== trim($errors)) {\n\n $this->getResponse()->addWarning('Invalid XML response');\n\n SFiles::write(PATH_GW.'log/tpl_xml_errors.html', $errors.'<pre>'.htmlentities($this->compiled).'</pre>');\n SFiles::write(PATH_GW.'log/tpl_xml_errors_'.date('Y-md-H-i_s').'.html', $errors.'<pre>'.htmlentities($this->compiled).'</pre>');\n }\n }\n\n if ($this->keyCachePage) {\n $this->writeCachedPage($this->keyCachePage , $this->compiled);\n }\n\n $this->output = $this->compiled;\n\n\n }", "public function usesCompiler()\n {\n // does not use compiler, template is PHP\n return false;\n }", "protected function compileRaw($expression)\n {\n if (Str::startsWith($expression, '(')) {\n $expression = substr($expression, 1, -1);\n }\n\n return \"<?php echo \\$__env->make($expression, ['raw' => true], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>\";\n }", "protected function compile() {\n if (TL_MODE == 'BE') {\n $this->genBeOutput();\n } else {\n $this->genFeOutput();\n }\n }", "public function build( $output=true ) {\n\t\t$source = $this->getTemplate()->build( $output );\n\t\tif( $output )\n\t\t\techo $source;\n\t\telse\n\t\t\treturn $source;\n\t}", "function betterEval($code) {\n $result = [];\n $tmp = tmpfile ();//file resource\n //we'll need to uri to include the file:\n $tmpMeta = stream_get_meta_data ( $tmp );\n $uri = $tmpMeta ['uri'];\n fwrite ( $tmp, $code );\n \n ob_start();\n $start = microtime(true);\n //anonymously, so our scope will not be polluted (very optimistic here, ofc)\n call_user_func(function() use ($uri) {\n include ($uri);\n }); \n \n $result['time'] = microtime(true) - $start;\n $result['output'] = ob_get_clean(); \n $result['length'] = strlen($result['output']);\n $result['lengthCharacters'] = mb_strlen($result['output']);\n $result['dbg'] = [\n 'fileUri' => $uri\n ];\n fclose ( $tmp );\n return $result;\n}", "function Code($Code,$Vars){\n\t\t$Code=substr($Code,1,-1);\n\t\treturn (isset($Vars[$Code]) )?$Vars[$Code]:\"[\".$Code.\"]\"; // If no variable exists return the code back to the template\n\t}", "function eval_inline_php($myContent,$onlyEval=false)\n// *************************************************\n{\n\t$rVal = \"\";\n\n\t// PHP INCLUDES\n\t$pos1 = strpos($myContent,\"<?php\");\n\n\tif (!($pos1===false))\n\t{\n\t\t$pos2 = strpos($myContent,\"?>\",$pos1);\n\n\t\t$rVal .= substr($myContent,0,$pos1);\n\n\t\t// BLOCK AUSWERTEN\n\t\t$evalTxt = substr($myContent,$pos1+5,($pos2)-($pos1+5));\n\t\teval($evalTxt);\n\n\t\t// RUECKGABE BLOCK DAVOR UND DANACH\n\t\tif (!$onlyEval) return $rVal.substr($myContent,$pos2+2);\n\t}\n\telse\n\t\treturn $myContent;\n\n\treturn \"\";\n}", "private function executePHP($string) {\n\t\t$string = $this->cleanString($string);\n\t\t$string = '$string = ' . $string;\n\t\teval($string);\n\n\t\treturn $string;\n\t}", "public function & SetCompiled ($compiled = '');", "function runphp($data, $filename) { \r\n\tglobal $config;\r\n\t$return=\"\";\r\n\t$reporting=error_reporting();\r\n\tif($config['debug']===false)\r\n\t\terror_reporting(0);\r\n\tif($config['writecodetofile']===true){\r\n\t\t@ob_start();\r\n\t\t//$filename = 'cache/tmp.inc.php';\r\n\t\t@unlink($filename);\r\n\t\twritetofile($filename,'w',$data);\t\t\t\t\r\n\t\tinclude($filename);\r\n\t\t@unlink($filename);\r\n\t\t$return=@ob_get_clean();\r\n\t} else {\r\n\t\t$offset=0;\r\n\t\t$pos=stripos($data,\"<?php\");\r\n\t\twhile ($pos>-1) {\t\r\n\t\t\t$return.=substr($data,$offset,$pos-$offset);\r\n\t\t\t$offset=stripos($data,\"?>\",$pos)+2;\r\n\t\t\t$php=substr($data,$pos+2,3);\r\n\t\t\t$code=substr($data,$pos+5);\r\n\t\t\tif(!($pos>-1)) { break; }\r\n\t\t\t$code=substr($code,0,stripos($code,\"?>\"));\r\n\t\t\t@ob_start();\r\n\t\t\tif($config['debug'])\r\n\t\t\t\teval($code);\r\n\t\t\telse\r\n\t\t\t\t@eval($code);\r\n\t\t\t$replace=@ob_get_clean();\r\n\t\t\t$return.= $replace;\r\n\t\t\t$pos=stripos($data,\"<?php\",$offset);\r\n\t\t}\t\r\n\t\t$return.=substr($data,$offset);\r\n\t}\r\n\terror_reporting($reporting);\r\n\treturn $return;\r\n}", "public function compile($value);", "public static function compileString($value)\n {\n }", "abstract function getCompiler($options=false);", "function wrap($code=NULL, $file=NULL, $type=NULL) {\n\t\tif ($type === NULL) {\n\t\t\t$type = $this->type;\n\t\t}\n\t\tif ($type == self::TYPE_JAVASCRIPT) {\n\t\t\tif ($file) {\n\t\t\t\treturn \"<script type='text/javascript' src='{$file}'></script>\";\n\t\t\t} else {\n\t\t\t\treturn \"<script type='text/javascript'>\\n{$code}\\n</script>\";\n\t\t\t}\n\t\t} else if ($type == self::TYPE_STYLESHEET) {\n\t\t\tif ($file) {\n\t\t\t\treturn \"<link rel='stylesheet' type='text/css' href='{$file}' />\";\n\t\t\t} else {\n\t\t\t\treturn \"<style type='text/css'>\\n{$code}\\n</style>\";\n\t\t\t}\n\t\t} else {\n\t\t\treturn $code;\n\t\t}\n\t}", "public function compileString($string, array $vars = []);", "function compile_retour($code, $avant, $apres, $altern, $tab, $n)\n{\n\tif ($avant == \"''\") $avant = '';\n\tif ($apres == \"''\") $apres = '';\n\tif (!$avant AND !$apres AND ($altern===\"''\")) return $code;\n\n\tif (preg_match(_REGEXP_CONCAT_NON_VIDE, $code)) {\n\t\t$t = $code;\n\t\t$cond = '';\n\t} elseif (preg_match(_REGEXP_COND_VIDE_NONVIDE,$code, $r)) {\n\t\t$t = $r[2];\n\t\t$cond = '!' . $r[1];\n\t} else if (preg_match(_REGEXP_COND_NONVIDE_VIDE,$code, $r)) {\n\t\t$t = $r[2];\n\t\t$cond = $r[1];\n\t} else {\n\t\t$t = '$t' . $n;\n\t\t$cond = \"($t = $code)!==''\";\n\t}\n\n\t$res = (!$avant ? \"\" : \"$avant . \") . \n\t\t$t .\n\t\t(!$apres ? \"\" : \" . $apres\");\n\n\tif ($res !== $t) $res = \"($res)\";\n\treturn !$cond ? $res : \"($cond ?\\n\\t$tab$res :\\n\\t$tab$altern)\";\n}", "public function getCompiledText()\n {\n return $this->owner->compileText($this->getType(), $this->getData());\n }", "function comment2Code($comment)\n\t{\n\t\t$comment = trim($comment);\n\t\t$comment = stripslashes($comment);\n /* ENT_QUOTES convers both ' and \" */\n\t\t$comment = htmlspecialchars($comment, ENT_QUOTES);\n\n\t\t/* Check to see if text exists before first ``` */\n\t\tif(strpos($comment, \"```\") !== 0)\n\t\t\t$comment = \"<p class='text-white'>\" . $comment;\n\n\t\t/* Check for opening ``` and closing ``` */\n\t\tif(checkBackticks($comment))\n {\n\t\t\t/* Comment/Code wrapper */\n\t\t\t$exCodeStart = \"<div class='exBoxComment mb-3 mt-2'>\"\n\t\t\t\t\t\t .\"<figure class='code'>\"\n\t\t\t\t\t\t .\"<pre><table class='table borderless my-auto'>\"\n\t\t\t\t\t\t .\"<tr><td><pre class='co-g'>\";\n\t\t\t$exCodeEnd = \"</pre></td></tr></table></pre></figure></div>\";\n\n\t\t\t/* Insert </p> before <div> */\n\t\t\t/* Encapsulate code with appropriate HTML tags in place of ``` */\n\t\t\t$openOrClose = 0;\n\t\t\twhile(($pos = strpos($comment, \"```\")) !== FALSE)\n {\n\t\t\t\t/* Opening ``` */\n\t\t\t\tif($openOrClose % 2 === 0)\n {\n\t\t\t\t\t/*\n\t\t\t\t\t\tThere is text before the code section\n\t\t\t\t\t\tHowever, in the case of two code sections back to back, there\n\t\t\t\t\t\twill be an empty <p class='text-white'></p> between them\n\t\t\t\t\t*/\n\t\t\t\t\tif($pos !== 0)\n\t\t\t\t\t\t$comment = substr_replace($comment, \"</p>\", $pos, 0);\n\t\t\t\t\t$comment = substr_replace($comment, $exCodeStart, strpos($comment, \"```\"), 3);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$comment = substr_replace($comment, $exCodeEnd, strpos($comment, \"```\"), 3);\n\t\t\t\t++$openOrClose;\n\t\t\t}\n\n\t\t\t/* Indicate how many code sections there are (will be a multiple of 2) */\n\t\t\t$openOrClose = $openOrClose / 2;\n\n\t\t\t/* Insert <p class='text-white'> after </div> to match with above </p> */\n\t\t\t$pos = 0;\n\t\t\twhile($openOrClose-- > 0)\n {\n\t\t\t\t$pos = strpos($comment, \"</div>\", $pos+1);\n\t\t\t\t$comment = substr_replace($comment, \"<p class='text-white'>\", $pos + 6, 0);\n\t\t\t}\n\t\t\t$comment .= \"</p>\";\n\n\t\t\t/* Remove trailing <p class='text-white'> </p> if no text after last code section */\n\t\t\tif(preg_match(\"/^[\\s\\S]+<p class='text-white'>[\\s]*<\\/p>$/m\", $comment))\n {\n\t\t\t\t$comment = substr($comment, 0, strrpos($comment, \"<p\"));\n\t\t\t}\n\n\t\t\treturn $comment;\n\t\t}\n\t\telse\n\t\t\treturn $comment . \"</p>\";\n\t}", "protected function replaceInlineCode($string)\n\t{\n\t\t// For closures\n\t\t$obj = $this;\n\t\treturn preg_replace_callback('/(`+)[ \\t]*(.+?)[ \\t]*(?<!`)\\1(?!`)/s', function($match) use ($obj)\n\t\t{\n\t\t\treturn '<code>'. $obj->encodeSpecial($match[2]) .'</code>';\n\t\t}, $string);\n\t}", "static function code ($in = '', $data = []) {\n\t\treturn static::textarea_common($in, $data, __FUNCTION__);\n\t}", "function php($php, $return = FALSE) {\n if (!$return) {\n echo '<?php ' . $php . ' ?>';\n } else {\n return '<?php ' . $php . ' ?>';\n }\n }", "function parse_php($string) {\n ob_start();\n eval('?>'.$string);\n $string = ob_get_contents();\n ob_end_clean();\n return $string;\n}", "public function compile(Twig_Compiler $compiler);", "function Generate($noprint=false) {\n\t\t\n\t if ($noprint) {\n\t \t return $this->getOutputCode();\n\t } else {\n\t \t echo $this->getOutputCode();\n\t }\n\t \n\t}", "protected function compile()\n\t{\n\t\tif (TL_MODE == 'BE')\n\t\t{\n\t\t\t$this->strTemplate = 'be_wildcard';\n\t\t\t$this->Template = new \\BackendTemplate($this->strTemplate);\n\t\t}\n\t}", "protected\n function transclude_code( $code, $post_object )\n {\n if ( author_can($post_object, EnzymesCapabilities::create_static_custom_fields) &&\n ($this->injection_author_owns($post_object) ||\n author_can($post_object, EnzymesCapabilities::share_static_custom_fields) &&\n $this->injection_author_can(EnzymesCapabilities::use_others_custom_fields))\n ) {\n $result = $code;\n } else {\n $result = '';\n }\n return $result;\n }", "public function getCompiledHtml();", "static public function code($content, $attributes=array()) {\n return self::content('code', $content, $attributes);\n }", "function code ( $arguments = \"\" ) {\n $arguments = func_get_args ();\n $rc = new ReflectionClass('tcode');\n return $rc->newInstanceArgs ( $arguments );\n}", "function yy_r168()\n {\n if (empty($this->db_quote_code_buffer)) {\n $this->_retvalue = '(string)(' . $this->yystack[$this->yyidx + - 1]->minor . ')';\n } else {\n $this->db_quote_code_buffer .= 'echo (string)(' . $this->yystack[$this->yyidx + - 1]->minor . ');';\n $this->_retvalue = false;\n }\n }", "protected function compile()\n {\n if (TL_MODE == 'BE')\n {\n $this->strTemplate = 'be_wildcard';\n $this->Template = new \\BackendTemplate($this->strTemplate);\n }\n\n if (empty(self::$wrappers))\n {\n return;\n }\n\n foreach (array_pop(self::$wrappers) as $key => $value)\n {\n $this->Template->{$key} = $value;\n }\n }", "public function compile($content): CompilationResult|string\n {\n // Create compiler\n $objCompiler = new Compiler();\n\n // Set compiler formatter\n $objCompiler->setOutputStyle((Config::get('debugMode') ? OutputStyle::EXPANDED : OutputStyle::COMPRESSED));\n\n // Set import paths\n if ($this->importPaths !== null)\n {\n $objCompiler->setImportPaths($this->importPaths);\n }\n\n if ($this->configFiles !== null)\n {\n $tableConfigContent = '';\n $scssConfigContent = '';\n\n // Use config file\n if ($this->config)\n {\n $tableConfigContent = $this->config;\n }\n\n foreach ($this->configFiles as $configFile)\n {\n $scssConfigContent .= $this->getFileContent($configFile);\n }\n\n // First the default configuration is added, then the theme configuration\n // which can override the defaults, and then all other files are added.\n $content = $scssConfigContent .\n $tableConfigContent .\n $content;\n }\n else\n {\n // Use global config variables\n $arrVars = StringUtil::deserialize($this->objTheme->vars);\n $globalVars = null;\n\n foreach ($arrVars as $var)\n {\n $globalVars[ $var['key'] ] = $var['value'];\n }\n\n if ($globalVars !== null)\n {\n $objCompiler->addVariables($globalVars);\n }\n\n //$objCompiler->getVariables();\n }\n\n try\n {\n $content = $objCompiler->compileString($content);\n }\n catch (Exception|SassException $e)\n {\n trigger_error($e->getMessage(), E_USER_ERROR);\n }\n\n return $content;\n }", "public function compile($stack)\r\n\t{\r\n\t\tif(empty($stack))\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\telseif(is_array($stack) && isset($stack['name']))\r\n\t\t{\r\n\t\t\t$stack = array($stack);\r\n\t\t}\r\n\t\t\r\n\t\t$str = '';\r\n\t\tforeach((Array) $stack as $element)\r\n\t\t{\r\n\t\t\tif(is_string($element))\r\n\t\t\t{\r\n\t\t\t\t$str .= $this->parse_individual($element);\r\n\t\t\t}\r\n\t\t\telseif( ! empty($element))\r\n\t\t\t{\r\n\t\t\t\t$str .= $this->context->render_tag($element['name'], $element['args'], $element['content']);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $str;\r\n\t}", "function php($text, $wrapper = 'code') {\n global $conf;\n\n if($conf['phpok']) {\n ob_start();\n eval($text);\n $this->doc .= ob_get_contents();\n ob_end_clean();\n } else {\n $this->doc .= p_xhtml_cached_geshi($text, 'php', $wrapper);\n }\n }", "private static function compile(string $path, array $data): string\n {\n extract($data);\n\n ob_start();\n\n $path = str_replace('.', '/', $path);\n\n include sprintf('%s/../../resources/views/%s.php', __DIR__, $path);\n\n $contents = ob_get_contents();\n\n ob_clean();\n\n return (string) $contents;\n }", "public function compile($data){\n \treturn $this->less->compile($data);\n }", "public function getContent()\n {\n $source_code = '';\n $_components = array_reverse($this->components);\n $_last = end($_components);\n\n foreach ($_components as $_component) {\n if ($_component != $_last) {\n $source_code .= \"{$this->tpl_obj->left_delimiter}private_inheritancetpl_obj file='$_component->filepath' child--{$this->tpl_obj->right_delimiter}\\n\";\n } else {\n $source_code .= \"{$this->tpl_obj->left_delimiter}private_inheritancetpl_obj file='$_component->filepath'--{$this->tpl_obj->right_delimiter}\\n\";\n }\n }\n\n return $source_code;\n }", "function parseTemplateText()\r\n\t{\r\n\t\t$buf = '';\r\n\t\t// we only need this if we are going to use JSP tags for wrapping\r\n\t\t// scriptlet blocks\r\n\t\t//if ($this->reader->matches('<' . '\\\\%'))\r\n\t\t//{\r\n\t\t//\t$buf .= '<' . '%';\r\n\t\t//}\r\n\r\n\t\t$buf .= $this->reader->nextContent();\r\n\r\n\t\t// don't output meaningless whitespace\r\n\t\tif (trim($buf) == '')\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\telseif ($this->ctxt->options->isElIgnored() || strpos($buf, '${') === false)\r\n\t\t{\r\n\t\t\treturn $buf;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn '<?php echo $pageContext->evaluateTemplateText(' . StringUtils::quote($buf) . ');?>';\r\n\t\t}\r\n\t}", "public static function Process($string, $doBbcode = true) {\r\n \r\n if (!$doBbcode) {\r\n return $string;\r\n }\r\n \r\n $timer = Debug::getTimer(); \r\n \r\n /**\r\n * Pre-process the string before we send it through the BBCode parser\r\n */\r\n \r\n $string = self::preProcessBBCodeUIDs($string);\r\n \r\n $parser = new Decoda($string); \r\n $parser->addPath(__DIR__ . DIRECTORY_SEPARATOR . 'BbcodeEtc' . DIRECTORY_SEPARATOR);\r\n \r\n $emoticonConfig = [ \r\n 'path' => '//static.railpage.com.au/images/smiles/',\r\n 'extension' => 'gif'\r\n ];\r\n \r\n $engine = new DecodaPhpEngine;\r\n $engine->addPath(__DIR__ . DIRECTORY_SEPARATOR . 'BbcodeEtc' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR);\r\n \r\n $parser->setEngine($engine);\r\n \r\n $parser->defaults(); \r\n $parser->setStrict(false); \r\n $parser->setLineBreaks(false);\r\n $parser->removeHook('Emoticon');\r\n $parser->addFilter(new RailpageImageFilter); \r\n \r\n $string = $parser->parse();\r\n $string = html_entity_decode($string); // Fix: if I set escapeHtml in the Decoda options, it fails to auto linkify links\r\n //$string = wpautop($string);\r\n \r\n Debug::LogEvent(__METHOD__, $timer); \r\n \r\n return $string;\r\n\r\n }", "public function compileString($templateName, $templateBasedir, $templateFilepath, $parsedTemplateFilepath, $code) {\n\n // open the template\n $fp = fopen($parsedTemplateFilepath, \"w\");\n\n // lock the file\n if (flock($fp, LOCK_SH)) {\n\n // xml substitution\n $code = preg_replace(\"/<\\?xml(.*?)\\?>/s\", \"##XML\\\\1XML##\", $code);\n\n // disable php tag\n if (!$this->php_enabled)\n $code = str_replace(array(\"<?\", \"?>\"), array(\"&lt;?\", \"?&gt;\"), $code);\n\n // xml re-substitution\n $code = preg_replace_callback(\"/##XML(.*?)XML##/s\", function( $match ) {\n return \"<?php echo '<?xml \" . stripslashes($match[1]) . \" ?>'; ?>\";\n }, $code);\n\n $parsedCode = $this->compileTemplate($code, $isString = true, $templateBasedir, $templateDirectory = null, $templateFilepath);\n/* $parsedCode = \"<?php if(!class_exists('\\\\core\\\\rtpl\\\\RainbowTemplate')){exit;}?>\" . $parsedCode; */\n\n // fix the php-eating-newline-after-closing-tag-problem\n $parsedCode = str_replace(\"?>\\n\", \"?>\\n\\n\", $parsedCode);\n\n // create directories\n#ä if (!is_dir($this->config['cache_dir']))\n#ä mkdir($this->config['cache_dir'], 0755, true);\n\n // check if the cache is writable\n if (!is_writable($this->cache->getCacheDir()))\n throw new \\core\\exceptions\\OperationNotPermittedException('Cache directory ' . $this->cache->getCacheDir() . 'doesn\\'t have write permission. Set write permission or set RAINTPL_CHECK_TEMPLATE_UPDATE to false. More details on http://www.raintpl.com/Documentation/Documentation-for-PHP-developers/Configuration/');\n\n // write compiled file\n fwrite($fp, $parsedCode);\n\n // release the file lock\n flock($fp, LOCK_UN);\n }\n\n // close the file\n fclose($fp);\n }", "public function make($code);", "function _phpCodeHandler($data)\r\n {\r\n if (preg_match('/\\s*^php:(.+)/', $data, $matches)) {\r\n $keys = array_keys($GLOBALS);\r\n foreach ($keys as $key) {\r\n $$key =& $GLOBALS[$key];\r\n }\r\n return (string) eval($matches[1].';');\r\n }\r\n return $data;\r\n }", "public function compile()\n\t{\n\t\tif ($this->dirty() and $this->compile)\n\t\t{\n\t\t\t$compiler = new Compiler($this, $this->app);\n\t\t\t$this->contents = $compiler->run();\n\t\t}\n\t}", "function render_sc_myShortcode( $context ) {\n\tob_start();\n\t?>\n<div>Some: <?=$context['disp1']?></div>\n<div>Another: <?=$context['disp2']?></div>\n<?php\n\treturn ob_get_clean();\n}", "function yy_r167()\n {\n if (empty($this->db_quote_code_buffer)) {\n $this->_retvalue = '(string)' . $this->yystack[$this->yyidx + - 1]->minor;\n } else {\n $this->db_quote_code_buffer .= 'echo (string)' . $this->yystack[$this->yyidx + - 1]->minor . ';';\n $this->_retvalue = false;\n }\n }", "public function process_template_from_data( $data )\n\t{\n\t\t$smarty = cms_smarty();\n\t\t$smarty->_compile_source('temporary template', $data, $_compiled );\n\t\t@ob_start();\n\t\t$smarty->_eval('?>' . $_compiled);\n\t\t$_contents = @ob_get_contents();\n\t\t@ob_end_clean();\n\t\treturn $_contents;\n\t}", "public function asCompiled();", "protected function generateBeforeCode($injectNeeded, FunctionDefinition $functionDefinition)\n {\n $suffix = PBC_ORIGINAL_FUNCTION_SUFFIX . str_replace('.', '', microtime(true));\n\n $code = PBC_CONTRACT_CONTEXT . ' = \\TechDivision\\PBC\\ContractContext::open();';\n\n // Invariant is not needed in private or static functions.\n // Also make sure that there is none in front of the constructor check\n if ($functionDefinition->getVisibility() !== 'private' &&\n !$functionDefinition->getIsStatic() && $functionDefinition->getName() !== '__construct'\n ) {\n\n $code .= PBC_INVARIANT_PLACEHOLDER . PBC_PLACEHOLDER_CLOSE;\n }\n\n $code .= PBC_PRECONDITION_PLACEHOLDER . $functionDefinition->getName() . PBC_PLACEHOLDER_CLOSE .\n PBC_OLD_SETUP_PLACEHOLDER . $functionDefinition->getName() . PBC_PLACEHOLDER_CLOSE;\n\n // If we inject something we might need a try ... catch around the original call.\n if ($injectNeeded === true) {\n\n $code .= 'try {';\n }\n\n // Build up the call to the original function.\n $code .= PBC_KEYWORD_RESULT . ' = ' . $functionDefinition->getHeader('call', $suffix) . ';';\n\n // Finish the try ... catch and place the inject marker\n if ($injectNeeded === true) {\n\n $code .= '} catch (\\Exception $e) {}' . PBC_METHOD_INJECT_PLACEHOLDER .\n $functionDefinition->getName() . PBC_PLACEHOLDER_CLOSE;\n }\n\n // No just place all the other placeholder for other filters to come\n $code .= PBC_POSTCONDITION_PLACEHOLDER . $functionDefinition->getName() . PBC_PLACEHOLDER_CLOSE;\n\n // Invariant is not needed in private or static functions\n if ($functionDefinition->getVisibility() !== 'private' && !$functionDefinition->getIsStatic()) {\n\n $code .= PBC_INVARIANT_PLACEHOLDER . PBC_PLACEHOLDER_CLOSE;\n }\n\n $code .= 'if (' . PBC_CONTRACT_CONTEXT . ') {\\TechDivision\\PBC\\ContractContext::close();}\n return ' . PBC_KEYWORD_RESULT . ';}';\n\n $code .= $functionDefinition->getHeader('definition', $suffix, true) . '{';\n\n return $code;\n }", "function comcode_text_to_tempcode($comcode,$source_member,$as_admin,$wrap_pos,$pass_id,$connection,$semiparse_mode,$preparse_mode,$is_all_semihtml,$structure_sweep,$check_only,$highlight_bits=NULL,$on_behalf_of_member=NULL)\n{\n\tglobal $ADVERTISING_BANNERS,$ALLOWED_ENTITIES,$POTENTIALLY_EMPTY_TAGS,$CODE_TAGS,$REVERSABLE_TAGS,$PUREHTML_TAGS,$DANGEROUS_TAGS,$VALID_COMCODE_TAGS,$BLOCK_TAGS,$POTENTIAL_JS_NAUGHTY_ARRAY,$TEXTUAL_TAGS,$LEET_FILTER,$IMPORTED_CUSTOM_COMCODE,$REPLACE_TARGETS;\n\n\t$wml=false; // removed feature from ocPortal now\n\t$print_mode=get_param_integer('wide_print',0)==1;\n\n\t$len=strlen($comcode);\n\n\tif ((function_exists('set_time_limit')) && (ini_get('max_execution_time')!='0')) @set_time_limit(300);\n\n\t$allowed_html_seqs=array('<table>','<table class=\"[^\"]*\">','<table class=\"[^\"]*\" summary=\"[^\"]*\">','<table summary=\"[^\"]*\">','</table>','<tr>','</tr>','<td>','</td>','<th>','</th>','<pre>','</pre>','<br />','<br/>','<br >','<br>','<p>','</p>','<p />','<b>','</b>','<u>','</u>','<i>','</i>','<em>','</em>','<strong>','</strong>','<li>','</li>','<ul>','</ul>','<ol>','</ol>','<del>','</del>','<dir>','</dir>','<s>','</s>','</a>','</font>','<!--','<h1 id=\"main_page_title\">','<h1 class=\"main_page_title\">','<h1 id=\"main_page_title\" class=\"main_page_title\">','</h1>','<img (class=\"inline_image\" )?alt=\"[^\"]*\" src=\"[^\"]*\" (complete=\"true\" )*/>','<img src=[\"\\'][^\"\\'<>]*[\"\\']( border=[\"\\'][^\"\\'<>]*[\"\\'])?( alt=[\"\\'][^\"\\'<>]*[\"\\'])?( )?(/)?'.'>','<a href=[\"\\'][^\"\\'<>]*[\"\\']( target=[\"\\'][^\"\\'<>]*[\"\\'])?'.'>'); // HTML tag may actually be used in very limited conditions: only the following HTML seqs will come out as HTML. This is, unless the blacklist filter is used instead.\n\tif ($as_admin)\n\t{\n\t\t$comcode_dangerous=true;\n\t\t$comcode_dangerous_html=true;\n\t} else\n\t{\n\t\t$comcode_dangerous=($GLOBALS['MICRO_BOOTUP']==0) && (has_specific_permission($source_member,'comcode_dangerous'));\n\t\t$comcode_dangerous_html=false;\n\t\tif ((has_specific_permission($source_member,'allow_html')) && (($is_all_semihtml) || (strpos($comcode,'[html')!==false) || (strpos($comcode,'[semihtml')!==false)))\n\t\t{\n\t\t\t$comcode_dangerous_html=true;\n\t\t\t/*foreach (array_keys($POTENTIALLY_EMPTY_TAGS) as $tag) // Find whether we really need to enable the computational-expensive filtering. Code disabled, not sure why this would have ever worked!\n\t\t\t{\n\t\t\t\tif (($tag!='html') && ($tag!='semihtml') && (strpos($comcode,'['.$tag)!==false))\n\t\t\t\t{\n\t\t\t\t\t$comcode_dangerous_html=false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}*/\n\t\t}\n\t}\n\tif (is_null($pass_id)) $pass_id=strval(mt_rand(0,32000)); // This is a unique ID that refers to this specific piece of comcode\n\tglobal $COMCODE_ATTACHMENTS;\n\tif (!array_key_exists($pass_id,$COMCODE_ATTACHMENTS)) $COMCODE_ATTACHMENTS[$pass_id]=array();\n\n\t// Tag level\n\t$current_tag='';\n\t$attribute_map=array();\n\t$tag_output=new ocp_tempcode();\n\t$continuation='';\n\t$close=mixed();\n\n\t// Properties that come from our tag\n\t$white_space_area=true;\n\t$textual_area=true;\n\t$formatting_allowed=true;\n\t$in_html=false;\n\t$in_semihtml=$is_all_semihtml;\n\t$in_separate_parse_section=false; // Not escaped because it has to be passed to a secondary filter\n\t$in_code_tag=false;\n\t$code_nest_stack=0;\n\n\t// Our state\n\t$status=CCP_NO_MANS_LAND;\n\t$lax=$GLOBALS['LAX_COMCODE'] || function_exists('get_member') && $source_member!=get_member() || count($_POST)==0; // if we don't want to produce errors for technically invalid Comcode\n\t$tag_stack=array();\n\t$pos=0;\n\t$line_starting=true;\n\t$just_ended=false;\n\t$none_wrap_length=0;\n\t$just_new_line=true; // So we can detect lists starting right away\n\t$just_title=false;\n\tglobal $NUM_LINES;\n\t$NUM_LINES=0;\n\t$queued_tempcode=new ocp_tempcode();\n\t$mindless_mode=false; // If we're doing a semi parse mode and going over a tag we don't actually process\n\t$tag_raw='';\n\n\tif ((!is_null($wrap_pos)) && (strtolower(get_charset())=='utf-8'))\n\t\t$wrap_pos*=2;\n\n\t$b_all=(get_option('admin_banners',true)==='1');\n\n\t$stupidity_mode=get_value('stupidity_mode'); // bork or leet\n\tif ($comcode_dangerous) $stupidity_mode=get_param('stupidity_mode','');\n\tif ($stupidity_mode=='leet')\n\t{\n\t\t$LEET_FILTER=array(\n\t\t'B'=>'8',\n\t\t'C'=>'(',\n\t\t'E'=>'3',\n\t\t'G'=>'9',\n\t\t'I'=>'1',\n\t\t'L'=>'1',\n\t\t'O'=>'0',\n\t\t'P'=>'9',\n\t\t'S'=>'5',\n\t\t'U'=>'0',\n\t\t'V'=>'\\/',\n\t\t'Z'=>'2'\n\t\t);\n\t}\n\n\t$smilies=$GLOBALS['FORUM_DRIVER']->find_emoticons(); // We'll be needing the smiley array\n\t$shortcuts=array('(EUR-)'=>'&euro;','{f.}'=>'&fnof;','-|-'=>'&dagger;','=|='=>'&Dagger;','{%o}'=>'&permil;','{~S}'=>'&Scaron;','{~Z}'=>'&#x17D;','(TM)'=>'&trade;','{~s}'=>'&scaron;','{~z}'=>'&#x17E;','{.Y.}'=>'&Yuml;','(c)'=>'&copy;','(r)'=>'&reg;','---'=>'&mdash;','--'=>'&ndash;','...'=>'&hellip;','-->'=>'&rarr;','<--'=>'&larr;');\n\n\t// Text syntax possibilities, that get maintained as our cursor moves through the text block\n\t$list_indent=0;\n\t$list_type='ul';\n\n\tif ($is_all_semihtml) filter_html($as_admin,$source_member,$pos,$len,$comcode,false,false); // Pre-filter the whole lot (note that this means during general output we do no additional filtering)\n\n\twhile ($pos<$len)\n\t{\n\t\t$next=$comcode[$pos];\n\t\t++$pos;\n\n\t\t// State machine\n\t\tswitch ($status)\n\t\t{\n\t\t\tcase CCP_NO_MANS_LAND:\n\t\t\t\tif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\t// Look ahead to make sure it's a valid tag. If it's not then it's considered normal user input, not a tag at all\n\t\t\t\t\t$dif=(($pos<$len) && ($comcode[$pos]=='/'))?1:0;\n\t\t\t\t\t$ahead=substr($comcode,$pos+$dif,MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH);\n\t\t\t\t\t$equal_pos=strpos($ahead,'=');\n\t\t\t\t\t$space_pos=strpos($ahead,' ');\n\t\t\t\t\t$end_pos=strpos($ahead,']');\n\t\t\t\t\t$lax_end_pos=strpos($ahead,'[');\n\t\t\t\t\t$cl_pos=strpos($ahead,chr(10));\n\t\t\t\t\tif ($equal_pos===false) $equal_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($space_pos===false) $space_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($end_pos===false) $end_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($lax_end_pos===false) $lax_end_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($cl_pos===false) $cl_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\t$use_pos=min($equal_pos,$space_pos,$end_pos,$lax_end_pos,$cl_pos);\n\n\t\t\t\t\t$potential_tag=strtolower(substr($ahead,0,$use_pos));\n\t\t\t\t\tif (($use_pos!=22) && ((!$in_semihtml) || ($dif==1) || (($potential_tag!='html') && ($potential_tag!='semihtml'))) && ((!$in_html) || (($dif==1) && ($potential_tag=='html'))) && ((!$in_code_tag) || ((isset($CODE_TAGS[$potential_tag])) && ($potential_tag==$current_tag))) && ((!$structure_sweep) || ($potential_tag!='contents')))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($in_code_tag)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($dif==1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$code_nest_stack--;\n\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$code_nest_stack++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$ok=($code_nest_stack==-1);\n\t\t\t\t\t\t} else $ok=true;\n\n\t\t\t\t\t\tif ($ok)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!isset($VALID_COMCODE_TAGS[$potential_tag]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!$IMPORTED_CUSTOM_COMCODE)\n\t\t\t\t\t\t\t\t\t_custom_comcode_import($connection);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ((isset($VALID_COMCODE_TAGS[$potential_tag])) && (strtolower(substr($ahead,0,2))!='i ')) // The \"i\" bit is just there to block a common annoyance: [i] doesn't take parameters and we don't want \"[i think]\" (for example) being parsed.\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($comcode[$pos]!='/') || (count($tag_stack)==0))\n\t\t\t\t\t\t\t\t\t$mindless_mode=($semiparse_mode) && /*(!isset($CODE_TAGS[$potential_tag])) && */((!isset($REVERSABLE_TAGS[$potential_tag])) || ((is_string($REVERSABLE_TAGS[$potential_tag])) && (preg_match($REVERSABLE_TAGS[$potential_tag],substr($comcode,$pos,100))!=0))) && (!isset($PUREHTML_TAGS[$potential_tag]));\n\t\t\t\t\t\t\t\telse $mindless_mode=$tag_stack[count($tag_stack)-1][7];\n\n\t\t\t\t\t\t\t\t$close=false;\n\t\t\t\t\t\t\t\t$current_tag='';\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\tif ((/*(($potential_tag=='html') || ($potential_tag=='semihtml')) && */($just_new_line)) || (isset($BLOCK_TAGS[$potential_tag])))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$status=CCP_STARTING_TAG;\n\t\t\t\t\t\t\t\tif ($mindless_mode)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($comcode[$pos]!='/')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (array_key_exists($potential_tag,$BLOCK_TAGS))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$tag_raw='&#8203;<kbd title=\"'.escape_html($potential_tag).'\" class=\"ocp_keep_block\">[';\n\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$tag_raw='&#8203;<kbd title=\"'.escape_html($potential_tag).'\" class=\"ocp_keep\">[';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$tag_raw='[';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$tag_raw='';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tif (($use_pos!=22) && ((($in_semihtml) || ($in_html)) && (($potential_tag=='html') || ($potential_tag=='semihtml'))) && (!$in_code_tag))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ahc=strpos($ahead,']');\n\t\t\t\t\t\t\tif ($ahc!==false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$pos+=$ahc+1;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((($in_html) || ((($in_semihtml) && (!$in_code_tag)) && (($next=='<') || ($next=='>') || ($next=='\"')))))\n\t\t\t\t{\n\t\t\t\t\tif ($next==chr(10)) ++$NUM_LINES;\n\n\t\t\t\t\tif ((!$comcode_dangerous_html) && ($next=='<')) // Special filtering required\n\t\t\t\t\t{\n\t\t\t\t\t\t$close=strpos($comcode,'>',$pos-1);\n\t\t\t\t\t\t$portion=substr($comcode,$pos-1,$close-$pos+2);\n\t\t\t\t\t\t$seq_ok=false;\n\t\t\t\t\t\tforeach ($allowed_html_seqs as $allowed_html_seq)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (preg_match('#^'.$allowed_html_seq.'$#',$portion)!=0) $seq_ok=true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!$seq_ok)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// $next='&lt;'; //OLD STYLE\n\t\t\t\t\t\t\tif ($close!==false) $pos=$close+1; // NEW STYLE\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\tif (substr($comcode,$pos-1,4)=='<!--') // To stop shortcut interpretation\n\t\t\t\t\t{\n\t\t\t\t\t\t$continuation.='<!--';\n\t\t\t\t\t\t$pos+=3;\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$continuation.=($mindless_mode && $in_code_tag)?escape_html($next):$next;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse // Not in HTML\n\t\t\t\t{\n\t\t\t\t\t// Text-format possibilities\n\t\t\t\t\tif (($just_new_line) && ($formatting_allowed) && (!$wml))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($continuation!='')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// List\n\t\t\t\t\t\t$found_list=false;\n\t\t\t\t\t\t$old_list_indent=$list_indent;\n\t\t\t\t\t\tif (($pos+2<$len) && (is_numeric($next)) && (((is_numeric($comcode[$pos])) && ($comcode[$pos+1]==')') && ($comcode[$pos+2]==' ')) || (($comcode[$pos]==')') && ($comcode[$pos+1]==' '))) && ((($list_type=='1') && ($list_indent!=0)) || (preg_match('#^[^\\n]*\\n\\d+\\) #',substr($comcode,$pos+1))!=0)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($list_indent!=0) && ($list_type!='1'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlist($temp_tpl,$old_list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$list_indent=1;\n\t\t\t\t\t\t\t$found_list=true;\n\t\t\t\t\t\t\t$scan_pos=$pos;\n\t\t\t\t\t\t\t$list_type='1';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (($pos+2<$len) && (ord($next)>=ord('a')) && (ord($next)<=ord('z')) && ($comcode[$pos]==')') && ($comcode[$pos+1]==' ') && ((($list_type=='a') && ($list_indent!=0)) || (preg_match('#^[^\\n]*\\n[a-z]+\\) #',substr($comcode,$pos+1))!=0)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($list_indent!=0) && ($list_type!='a'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlist($temp_tpl,$old_list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$list_indent=1;\n\t\t\t\t\t\t\t$found_list=true;\n\t\t\t\t\t\t\t$scan_pos=$pos;\n\t\t\t\t\t\t\t$list_type='a';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($next==' ')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($old_list_indent!=0) && ($list_type!='ul'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlist($temp_tpl,$old_list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$scan_pos=$pos-1;\n\t\t\t\t\t\t\t$list_indent=0;\n\t\t\t\t\t\t\twhile ($scan_pos<$len)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$scan_next=$comcode[$scan_pos];\n\t\t\t\t\t\t\t\tif (($scan_next=='-') && ($scan_pos+1<$len) && ($comcode[$scan_pos+1]==' '))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$found_list=true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($scan_next==' ') ++$list_indent; else break;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t++$scan_pos;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!$found_list) $list_indent=0; else $list_type='ul';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Rule?\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t\t$old_list_indent=0;\n\n\t\t\t\t\t\t\tif (($next=='-') && (!$just_title))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$scan_pos=$pos;\n\t\t\t\t\t\t\t\t$found_rule=true;\n\t\t\t\t\t\t\t\twhile ($scan_pos<$len)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$scan_next=$comcode[$scan_pos];\n\t\t\t\t\t\t\t\t\tif ($scan_next!='-')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($scan_next==chr(10))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t++$NUM_LINES;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t} else $found_rule=false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t++$scan_pos;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($found_rule)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$_temp_tpl=do_template('COMCODE_TEXTCODE_LINE');\n\t\t\t\t\t\t\t\t\t$tag_output->attach($_temp_tpl);\n\t\t\t\t\t\t\t\t\t$pos=$scan_pos+1;\n\t\t\t\t\t\t\t\t\t$just_ended=true;\n\t\t\t\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// List handling\n\t\t\t\t\t\tif (($list_indent==$old_list_indent) && ($old_list_indent!=0))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='</li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor ($i=$list_indent;$i<$old_list_indent;++$i) // Close any ended\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='</li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t$temp_tpl=($list_type=='ul')?'</ul>':'</ol>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (($list_indent<$old_list_indent) && ($list_indent!=0)) // Go down one final level, because the list tag must have been nested within an li tag (we closed open li tags recursively except for the final one)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='</li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($found_list)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ((($list_indent-$old_list_indent)>1) && (!$lax))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_LIST_JUMPYNESS'),$pos,$comcode,$check_only);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor ($i=$old_list_indent;$i<$list_indent;++$i) // Or open any started\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tswitch ($list_type)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcase 'ul':\n\t\t\t\t\t\t\t\t\t\tif ($i<$list_indent-1) $temp_tpl='<ul><li>'; else $temp_tpl='<ul>';\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase '1':\n\t\t\t\t\t\t\t\t\t\tif ($i<$list_indent-1) $temp_tpl='<ol type=\"1\"><li>'; else $temp_tpl='<ol type=\"1\">';\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 'a':\n\t\t\t\t\t\t\t\t\t\tif ($i<$list_indent-1) $temp_tpl='<ol type=\"a\"><li>'; else $temp_tpl='<ol type=\"a\">';\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t\tbreak;\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$temp_tpl='<li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t$just_ended=true;\n\t\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\t\t$next='';\n\t\t\t\t\t\t\t$pos=$scan_pos+2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (($next==chr(10)) && ($white_space_area) && ($print_mode) && ($list_indent==0)) // We might need to put some queued up stuff here: when we print, we can't float thumbnails\n\t\t\t\t\t{\n\t\t\t\t\t\t$tag_output->attach($queued_tempcode);\n\t\t\t\t\t\t$queued_tempcode=new ocp_tempcode();\n\t\t\t\t\t}\n\t\t\t\t\tif (($next==chr(10)) && ($white_space_area) && (!$in_semihtml) && ((!$just_ended) || ($semiparse_mode) || (substr($comcode,$pos,3)==' - '))) // Hard-new-lines\n\t\t\t\t\t{\n\t\t\t\t\t\t++$NUM_LINES;\n\t\t\t\t\t\t$line_starting=true;\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t$just_new_line=true;\n\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\tif (($list_indent==0) && (!$just_ended))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='<br />';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\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{\n\t\t\t\t\t\t$just_new_line=false;\n\n\t\t\t\t\t\tif (($next==' ') && ($white_space_area) && (!$in_semihtml))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($line_starting) || (($pos>1) && ($comcode[$pos-2]==' '))) // Hard spaces\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$next='&nbsp;';\n\t\t\t\t\t\t\t\t++$none_wrap_length;\n\t\t\t\t\t\t\t} else $none_wrap_length=0;\n\t\t\t\t\t\t\t$continuation.=($mindless_mode && $in_code_tag)?escape_html($next):$next;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (($next==\"\\t\") && ($white_space_area) && (!$in_semihtml))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t$tab_tpl=do_template('COMCODE_TEXTCODE_TAB');\n\t\t\t\t\t\t\t$_tab_tpl=$tab_tpl->evaluate();\n\t\t\t\t\t\t\t$none_wrap_length+=strlen($_tab_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($tab_tpl);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($next==' ') || ($next==\"\\t\") || ($just_ended)) $none_wrap_length=0; else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ((!is_null($wrap_pos)) && ($none_wrap_length>=$wrap_pos) && ((strtolower(get_charset())!='utf-8') || (preg_replace(array('#[\\x09\\x0A\\x0D\\x20-\\x7E]#','#[\\xC2-\\xDF][\\x80-\\xBF]#','#\\xE0[\\xA0-\\xBF][\\x80-\\xBF]#','#[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}#','#\\xED[\\x80-\\x9F][\\x80-\\xBF]#','#\\xF0[\\x90-\\xBF][\\x80-\\xBF]{2}#','#[\\xF1-\\xF3][\\x80-\\xBF]{3}#','#\\xF4[\\x80-\\x8F][\\x80-\\xBF]{2}#'),array('','','','','','','',''),$continuation)=='')) && ($textual_area) && (!$in_semihtml))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t$temp_tpl='<br />';\n\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\t\t\t} elseif ($textual_area) ++$none_wrap_length;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$line_starting=false;\n\t\t\t\t\t\t\t$just_ended=false;\n\n\t\t\t\t\t\t\t$differented=false; // If somehow via lookahead we've changed this to HTML and thus won't use it in raw form\n\n\t\t\t\t\t\t\t// Variable lookahead\n\t\t\t\t\t\t\tif ((!$in_code_tag) && (($next=='{') && (isset($comcode[$pos])) && (($comcode[$pos]=='$') || ($comcode[$pos]=='+') || ($comcode[$pos]=='!'))))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($comcode_dangerous)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ((!$in_code_tag) && ((!$semiparse_mode) || (in_tag_stack($tag_stack,array('url','img','flash')))))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\tif ($comcode[$pos]=='+')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$p_end=$pos+5;\n\t\t\t\t\t\t\t\t\t\t\twhile ($p_end<$len)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$p_portion=substr($comcode,$pos-1,$p_end-($pos-1)+5);\n\t\t\t\t\t\t\t\t\t\t\t\tif (substr_count($p_portion,'{+START')==substr_count($p_portion,'{+END')) break;\n\t\t\t\t\t\t\t\t\t\t\t\t$p_end++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$p_len=1;\n\t\t\t\t\t\t\t\t\t\t\twhile ($pos+$p_len<$len)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$p_portion=substr($comcode,$pos-1,$p_len);\n\t\t\t\t\t\t\t\t\t\t\t\tif (substr_count(str_replace('{',' { ',$p_portion),'{')==substr_count(str_replace('}',' } ',$p_portion),'}')) break; // str_replace is to workaround a Quercus bug #4494\n\t\t\t\t\t\t\t\t\t\t\t\t$p_len++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$p_len--;\n\t\t\t\t\t\t\t\t\t\t\t$p_portion=substr($comcode,$pos+$p_len,$p_end-($pos+$p_len));\n\t\t\t\t\t\t\t\t\t\t\trequire_code('tempcode_compiler');\n\t\t\t\t\t\t\t\t\t\t\t$ret=template_to_tempcode(substr($comcode,$pos-1,$p_len+1).'{DIRECTIVE_EMBEDMENT}'.substr($comcode,$p_end,6));\n\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t$ret->singular_bind('DIRECTIVE_EMBEDMENT',comcode_text_to_tempcode($p_portion,$source_member,$as_admin,$wrap_pos,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member));\n\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=$pos+$p_len;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$pos=$p_end+6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif ($comcode[$pos]=='!')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$p_len=$pos;\n\t\t\t\t\t\t\t\t\t\t\t$balance=1;\n\t\t\t\t\t\t\t\t\t\t\twhile (($p_len<$len) && ($balance!=0))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($comcode[$p_len]=='{') $balance++; elseif ($comcode[$p_len]=='}') $balance--;\n\t\t\t\t\t\t\t\t\t\t\t\t$p_len++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$ret=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\t$less_pos=$pos-1;\n\t\t\t\t\t\t\t\t\t\t\t$ret->parse_from($comcode,$less_pos,$p_len);\n\t\t\t\t\t\t\t\t\t\t\t$pos=$p_len;\n\t\t\t\t\t\t\t\t\t\t\tif (($ret->parameterless(0)) && ($pos<$len)) // We want to take the lang string reference as Comcode if it's a simple lang string reference with no parameters\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#\\{\\!([\\w\\d\\_\\:]+)(\\}|$)#U',substr($comcode,$less_pos,$p_len-$less_pos),$matches)!=0) // Hacky code to extract the lang string name\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$temp_lang_string=$matches[1];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ret=comcode_lang_string($temp_lang_string); // Recreate as a Comcode lang string\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$p_len=$pos;\n\t\t\t\t\t\t\t\t\t\t\t$balance=1;\n\t\t\t\t\t\t\t\t\t\t\twhile (($p_len<$len) && ($balance!=0))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($comcode[$p_len]=='{') $balance++; elseif ($comcode[$p_len]=='}') $balance--;\n\t\t\t\t\t\t\t\t\t\t\t\t$p_len++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$ret=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\t$less_pos=$pos-1;\n\t\t\t\t\t\t\t\t\t\t\t$ret->parse_from($comcode,$less_pos,$p_len);\n\t\t\t\t\t\t\t\t\t\t\t$pos=$p_len;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\tif (($pos<=$len) || (!$lax))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($ret);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($comcode[$pos]=='$') && ($pos<$len-2) && ($comcode[$pos+1]==',') && (strpos($comcode,'}',$pos)!==false))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$pos=strpos($comcode,'}',$pos)+1;\n\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\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}\n\n\t\t\t\t\t\t\t// Escaping of comcode tag starts lookahead\n\t\t\t\t\t\t\tif (($next=='\\\\') && (!$in_code_tag)) // We are changing \\[ to [ with the side-effect of blocking a tag start. To get \\[ literal, we need the symbols \\\\[... and add extra \\-pairs as needed. We are only dealing with \\ and [ (update: and now {) here, it's not a further extended means of escaping.\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($pos!=$len) && (($comcode[$pos]=='\"') || (substr($comcode,$pos-1,6)=='&quot;')))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\tif ($comcode[$pos]=='\"')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.=$mindless_mode?'&quot;':'\"';\n\t\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.='&quot;';\n\t\t\t\t\t\t\t\t\t\t$pos+=6;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif (($pos!=$len) && ($comcode[$pos]=='['))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t$continuation.='[';\n\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif (($pos!=$len) && ($comcode[$pos]=='{'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t$continuation.='{';\n\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif (($pos==$len) || ($comcode[$pos]=='\\\\'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t$continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ((($textual_area) || ($in_semihtml)) && (trim($next)!='') && (!$wml))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Emoticon lookahead\n\t\t\t\t\t\t\t\t\tforeach ($smilies as $smiley=>$imgcode)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($in_semihtml) $smiley=' '.$smiley.' ';\n\n\t\t\t\t\t\t\t\t\t\tif ($next==$smiley[0]) // optimisation\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (substr($comcode,$pos-1,strlen($smiley))==$smiley)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($smiley)-1;\n\t\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_emoticon($imgcode));\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\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\tif ((trim($next)!='') && (!$in_code_tag) && (!$differented))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// CEDI pages\n\t\t\t\t\t\t\t\tif (($pos<$len) && ($next=='[') && ($pos+1<$len) && ($comcode[$pos]=='[') && (!$semiparse_mode) && (addon_installed('cedi')))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\tif (preg_match('#^\\[([^\\[\\]]*)\\]\\]#',substr($comcode,$pos,200),$matches)!=0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$cedi_page_name=$matches[1];\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t$hash_pos=strpos($cedi_page_name,'#');\n\t\t\t\t\t\t\t\t\t\tif ($hash_pos!==false)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$jump_to=substr($cedi_page_name,$hash_pos+1);\n\t\t\t\t\t\t\t\t\t\t\t$cedi_page_name=substr($cedi_page_name,0,$hash_pos);\n\t\t\t\t\t\t\t\t\t\t} else $jump_to='';\n\t\t\t\t\t\t\t\t\t\t$cedi_page_url=build_url(array('page'=>'cedi','type'=>'misc','find'=>$cedi_page_name),get_module_zone('cedi'));\n\t\t\t\t\t\t\t\t\t\tif ($jump_to!='')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$cedi_page_url->attach('#'.$jump_to);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_CEDI_LINK',array('_GUID'=>'ebcd7ba5290c5b2513272a53b4d666e5','URL'=>$cedi_page_url,'TEXT'=>$cedi_page_name)));\n\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[1])+3;\n\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Usernames\n\t\t\t\t\t\t\t\tif (($pos<$len) && ($next=='{') && ($pos+1<$len) && ($comcode[$pos]=='{') && (!$in_code_tag) && (!$semiparse_mode))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\tif (preg_match('#^\\{([^\"{}&\\'\\$<>]+)\\}\\}#',substr($comcode,$pos,80),$matches)!=0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$username=$matches[1];\n\n\t\t\t\t\t\t\t\t\t\tif ($username[0]=='?')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$username_info=true;\n\t\t\t\t\t\t\t\t\t\t\t$username=substr($username,1);\n\t\t\t\t\t\t\t\t\t\t} else $username_info=false;\n\t\t\t\t\t\t\t\t\t\t$this_member_id=$GLOBALS['FORUM_DRIVER']->get_member_from_username($username);\n\t\t\t\t\t\t\t\t\t\tif ((!is_null($this_member_id)) && (!is_guest($this_member_id)))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\n\t\t\t\t\t\t\t\t\t\t\t$poster_url=$GLOBALS['FORUM_DRIVER']->member_profile_url($this_member_id,false,true);\n\t\t\t\t\t\t\t\t\t\t\tif ((get_forum_type()=='ocf') && ($username_info))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\trequire_lang('ocf');\n\t\t\t\t\t\t\t\t\t\t\t\trequire_code('ocf_members2');\n\t\t\t\t\t\t\t\t\t\t\t\t$details=ocf_show_member_box($this_member_id);\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('HYPERLINK_TOOLTIP',array('_GUID'=>'d8f4f4ac70bd52b3ef9ee74ae9c5e085','TOOLTIP'=>$details,'CAPTION'=>$username,'URL'=>$poster_url,'NEW_WINDOW'=>false)));\n\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(hyperlink($poster_url,$username));\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[1])+3;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\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}\n\n\t\t\t\t\t\t\tif (($textual_area) && (!$in_code_tag) && (trim($next)!='') && (!$differented))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Shortcut lookahead\n\t\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($in_semihtml) && (substr($comcode,$pos-1,3)=='-->')) // To stop shortcut interpretation\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.='-->';\n\t\t\t\t\t\t\t\t\t\t$pos+=2;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tforeach ($shortcuts as $code=>$replacement)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (($next==$code[0]) && (substr($comcode,$pos-1,strlen($code))==$code))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($code)-1;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($replacement);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($replacement);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\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}\n\n\t\t\t\t\t\t\tif (($textual_area) && (!$in_code_tag) && (trim($next)!='') && (!$differented))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Table syntax\n\t\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($pos<$len) && ($comcode[$pos]=='|'))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$end_tbl=strpos($comcode,chr(10).'|}',$pos);\n\t\t\t\t\t\t\t\t\t\tif ($end_tbl!==false)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$end_fst_line_pos=strpos($comcode,chr(10),$pos);\n\t\t\t\t\t\t\t\t\t\t\t$caption=substr($comcode,$pos+2,max($end_fst_line_pos-$pos-2,0));\n\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($caption)+1;\n\n\t\t\t\t\t\t\t\t\t\t\t$rows=preg_split('#(\\|-|\\|\\})#Um',substr($comcode,$pos,$end_tbl-$pos));\n\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)floats($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$caption=preg_replace('#(^|\\s)floats($|\\s)#','',$caption);\n\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios=array();\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios_matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)([\\d\\.]+%(:[\\d\\.]+%)*)($|\\s)#',$caption,$ratios_matches)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ratios=explode(':',$ratios_matches[2]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$caption=str_replace($ratios_matches[0],'',$caption);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $h=>$row)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($h!=0) $tag_output->attach(do_template('BLOCK_SEPARATOR'));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cells=preg_split('/(\\n\\! | \\!\\! |\\n\\| | \\|\\| )/',$row,-1,PREG_SPLIT_DELIM_CAPTURE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray_shift($cells); // First one is non-existant empty\n\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$num_cells_in_row=count($cells)/2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$inter_padding=3.0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$total_box_width=(100.0-$inter_padding*($num_cells_in_row-1));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Find which to float\n\t\t\t\t\t\t\t\t\t\t\t\t\t$to_float=NULL;\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($cells as $i=>$cell)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!$spec)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ((strpos($cell,'!')!==false) || (is_null($to_float))) $to_float=$i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=!$spec;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WRAP_START'));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Do floated one\n\t\t\t\t\t\t\t\t\t\t\t\t\t$i_dir_1=(($to_float==1)?'left':'right');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$i_dir_2=(($to_float!=1)?'left':'right');\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($num_cells_in_row===1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$padding_amount='0';\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$padding_amount=float_to_raw_string($inter_padding,2);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)wide($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i=($to_float===1)?0:(count($cells)-1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (array_key_exists($cell_i,$ratios))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=$ratios[$cell_i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=float_to_raw_string($total_box_width/$num_cells_in_row,2).'%';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WIDE_START',array('_GUID'=>'ced8c3a142f74296a464b085ba6891c9','WIDTH'=>$width,'FLOAT'=>$i_dir_1,'PADDING'=>($to_float==1)?'':'-left','PADDING_AMOUNT'=>$padding_amount)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_START',array('_GUID'=>'90be72fcbb6b9d8a312da0bee5b86cb3','WIDTH'=>array_key_exists($to_float,$ratios)?$ratios[$to_float]:'','FLOAT'=>$i_dir_1,'PADDING'=>($to_float==1)?'':'-left','PADDING_AMOUNT'=>$padding_amount)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(comcode_text_to_tempcode(isset($cells[$to_float])?rtrim($cells[$to_float]):'',$source_member,$as_admin,60,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member));\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=strpos($comcode,$cells[$to_float],$pos);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Do non-floated ones\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($cells as $i=>$cell)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($i%2==1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($i!=$to_float)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$padding_amount=float_to_raw_string($inter_padding,2);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (array_key_exists($cell_i,$ratios))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=$ratios[$cell_i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=float_to_raw_string($total_box_width/$num_cells_in_row,2).'%';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)wide($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WIDE2_START',array('_GUID'=>'9bac42a1b62c5c9a2f758639fcb3bb2f','WIDTH'=>$width,'PADDING_AMOUNT'=>$padding_amount,'FLOAT'=>$i_dir_1,'PADDING'=>(($to_float==1)||($cell_i!=0))?'-left':'')));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_2_START',array('_GUID'=>'0f15f9d5554635ed7ac154c9dc5c72b8','WIDTH'=>array_key_exists($cell_i,$ratios)?$ratios[$cell_i]:'','FLOAT'=>$i_dir_1,'PADDING'=>(($to_float==1)||($cell_i!=0))?'-left':'','PADDING_AMOUNT'=>$padding_amount)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(comcode_text_to_tempcode(rtrim($cell),$source_member,$as_admin,60,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=strpos($comcode,$cell,$pos);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WRAP_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios=array();\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios_matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)([\\d\\.]+%(:[\\d\\.]+%)*)($|\\s)#',$caption,$ratios_matches)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ratios=explode(':',$ratios_matches[2]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$caption=str_replace($ratios_matches[0],'',$caption);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)wide($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_START',array('SUMMARY'=>preg_replace('#(^|\\s)wide($|\\s)#','',$caption))));\n\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_START_SUMMARY',array('_GUID'=>'0c5674fba61ba14b4b9fa39ea31ff54f','CAPTION'=>$caption)));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $table_row)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_ROW_START'));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cells=preg_split('/(\\n\\! | \\!\\! |\\n\\| | \\|\\| )/',$table_row,-1,PREG_SPLIT_DELIM_CAPTURE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray_shift($cells); // First one is non-existant empty\n\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$c_type='';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($cells as $i=>$cell)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($spec)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$c_type=(strpos($cell,'!')!==false)?'th':'td';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$_mid=comcode_text_to_tempcode(rtrim($cell),$source_member,$as_admin,60,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=strpos($comcode,$cell,$pos);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_CELL',array('_GUID'=>'6640df8b503f65e3d36f595b0acf7600','WIDTH'=>array_key_exists($cell_i,$ratios)?$ratios[$cell_i]:'','C_TYPE'=>$c_type,'MID'=>$_mid,'PADDING'=>($cell_i==0)?'':'-left','PADDING_AMOUNT'=>(count($cells)==2)?'0':float_to_raw_string(5.0/(floatval(count($cells)-2)/2.0),2))));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=!$spec;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_ROW_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_END'));\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$pos=$end_tbl+3;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Advertising\n\t\t\t\t\t\t\t\tif ((!$differented) && (!$semiparse_mode) && (!$in_code_tag) && (addon_installed('banners')) && (($b_all) || (!has_specific_permission($source_member,'banner_free'))))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Pick up correctly, including permission filtering\n\t\t\t\t\t\t\t\t\tif (is_null($ADVERTISING_BANNERS))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$ADVERTISING_BANNERS=array();\n\n\t\t\t\t\t\t\t\t\t\t$rows=$GLOBALS['SITE_DB']->query('SELECT * FROM '.get_table_prefix().'banners b LEFT JOIN '.get_table_prefix().'banner_types t ON b.b_type=t.id WHERE t_comcode_inline=1 AND '.db_string_not_equal_to('b_title_text',''),NULL,NULL,true);\n\t\t\t\t\t\t\t\t\t\tif (!is_null($rows))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// Filter out what we don't have permission for\n\t\t\t\t\t\t\t\t\t\t\tif (get_option('use_banner_permissions',true)=='1')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\trequire_code('permissions');\n\t\t\t\t\t\t\t\t\t\t\t\t$groups=_get_where_clause_groups($source_member);\n\t\t\t\t\t\t\t\t\t\t\t\tif (!is_null($groups))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$perhaps=collapse_1d_complexity('category_name',$GLOBALS['SITE_DB']->query('SELECT category_name FROM '.get_table_prefix().'group_category_access WHERE '.db_string_equal_to('module_the_name','banners').' AND ('.$groups.')'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t$new_rows=array();\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $row)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (in_array($row['name'],$perhaps)) $new_rows[]=$row;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t$rows=$new_rows;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $row)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$trigger_text=$row['b_title_text'];\n\t\t\t\t\t\t\t\t\t\t\t\tforeach (explode(',',$trigger_text) as $t)\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (trim($t)!='') $ADVERTISING_BANNERS[trim($t)]=$row;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Apply\n\t\t\t\t\t\t\t\t\tif (!is_null($ADVERTISING_BANNERS))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($ADVERTISING_BANNERS as $ad_trigger=>$ad_bits)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (strtolower($next)==strtolower($ad_trigger[0])) // optimisation\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (strtolower(substr($comcode,$pos-1,strlen($ad_trigger)))==strtolower($ad_trigger))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\trequire_code('banners');\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ad_text=show_banner($ad_bits['name'],$ad_bits['b_title_text'],get_translated_tempcode($ad_bits['caption']),$ad_bits['img_url'],'',$ad_bits['site_url'],$ad_bits['b_type']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('tooltip',array('param'=>$ad_text,'url'=>(url_is_local($ad_bits['site_url']) && ($ad_bits['site_url']!=''))?(get_custom_base_url().'/'.$ad_bits['site_url']):$ad_bits['site_url']),substr($comcode,$pos-1,strlen($ad_trigger)),$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($ad_trigger)-1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Search highlighting lookahead\n\t\t\t\t\t\t\t\tif ((!$differented) && (!is_null($highlight_bits)))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach ($highlight_bits as $highlight_bit)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (strtolower($next)==strtolower($highlight_bit[0])) // optimisation\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (strtolower(substr($comcode,$pos-1,strlen($highlight_bit)))==strtolower($highlight_bit))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('highlight',array(),escape_html(substr($comcode,$pos-1,strlen($highlight_bit))),$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($highlight_bit)-1;\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Link lookahead\n\t\t\t\t\t\t\t\tif ((!$differented) && (!$in_code_tag))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ((!$in_semihtml) && ($next=='h') && ((substr($comcode,$pos-1,strlen('http://'))=='http://') || (substr($comcode,$pos-1,strlen('https://'))=='https://') || (substr($comcode,$pos-1,strlen('ftp://'))=='ftp://')))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$link_end_pos=strpos($comcode,' ',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_2=strpos($comcode,chr(10),$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_3=strpos($comcode,'[',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_4=strpos($comcode,')',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_5=strpos($comcode,'\"',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_6=strpos($comcode,'>',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_7=strpos($comcode,'<',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_8=strpos($comcode,'.'.chr(10),$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_9=strpos($comcode,', ',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_10=strpos($comcode,'. ',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_11=strpos($comcode,\"'\",$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_12=strpos($comcode,'&nbsp;',$pos-1);\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_2!==false) && (($link_end_pos===false) || ($link_end_pos_2<$link_end_pos))) $link_end_pos=$link_end_pos_2;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_3!==false) && (($link_end_pos===false) || ($link_end_pos_3<$link_end_pos))) $link_end_pos=$link_end_pos_3;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_4!==false) && (($link_end_pos===false) || ($link_end_pos_4<$link_end_pos))) $link_end_pos=$link_end_pos_4;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_5!==false) && (($link_end_pos===false) || ($link_end_pos_5<$link_end_pos))) $link_end_pos=$link_end_pos_5;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_6!==false) && (($link_end_pos===false) || ($link_end_pos_6<$link_end_pos))) $link_end_pos=$link_end_pos_6;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_7!==false) && (($link_end_pos===false) || ($link_end_pos_7<$link_end_pos))) $link_end_pos=$link_end_pos_7;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_8!==false) && (($link_end_pos===false) || ($link_end_pos_8<$link_end_pos))) $link_end_pos=$link_end_pos_8;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_9!==false) && (($link_end_pos===false) || ($link_end_pos_9<$link_end_pos))) $link_end_pos=$link_end_pos_9;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_10!==false) && (($link_end_pos===false) || ($link_end_pos_10<$link_end_pos))) $link_end_pos=$link_end_pos_10;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_11!==false) && (($link_end_pos===false) || ($link_end_pos_11<$link_end_pos))) $link_end_pos=$link_end_pos_11;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_12!==false) && (($link_end_pos===false) || ($link_end_pos_12<$link_end_pos))) $link_end_pos=$link_end_pos_12;\n\t\t\t\t\t\t\t\t\t\tif ($link_end_pos===false) $link_end_pos=strlen($comcode);\n\t\t\t\t\t\t\t\t\t\t$auto_link=preg_replace('#(keep|for)_session=[\\d\\w]*#','filtered=1',substr($comcode,$pos-1,$link_end_pos-$pos+1));\n\t\t\t\t\t\t\t\t\t\tif (substr($auto_link,-3)!='://')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (substr($auto_link,-1)=='.')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$auto_link=substr($auto_link,0,strlen($auto_link)-1);\n\t\t\t\t\t\t\t\t\t\t\t\t$link_end_pos--;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$auto_link_tempcode=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\t$auto_link_tempcode->attach($auto_link);\n\t\t\t\t\t\t\t\t\t\t\tif (!$check_only)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=$GLOBALS['SITE_DB']->query_value_null_ok('url_title_cache','t_title',array('t_url'=>$auto_link));\n\n\t\t\t\t\t\t\t\t\t\t\t\tif ((is_null($link_captions_title)) || (substr($link_captions_title,0,1)=='!'))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$GLOBALS['COMCODE_PARSE_URLS_CHECKED']++;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (($GLOBALS['NO_LINK_TITLES']) || ($GLOBALS['COMCODE_PARSE_URLS_CHECKED']>=MAX_URLS_TO_READ))\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=$auto_link;\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title='';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$downloaded_at_link=http_download_file($auto_link,3000,false);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ((is_string($downloaded_at_link)) && ($GLOBALS['HTTP_DOWNLOAD_MIME_TYPE']!==NULL) && (strpos($GLOBALS['HTTP_DOWNLOAD_MIME_TYPE'],'html')!==false) && ($GLOBALS['HTTP_MESSAGE']=='200'))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#\\s*<title[^>]*\\s*>\\s*(.*)\\s*\\s*<\\s*/title\\s*>#miU',$downloaded_at_link,$matches)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trequire_code('character_sets');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=trim(str_replace('&ndash;','-',str_replace('&mdash;','-',@html_entity_decode(convert_to_internal_encoding($matches[1]),ENT_QUOTES,get_charset()))));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (((strpos(strtolower($link_captions_title),'login')!==false) || (strpos(strtolower($link_captions_title),'log in')!==false)) && (substr($auto_link,0,strlen(get_base_url()))==get_base_url()))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=''; // don't show login screen titles for our own website. Better to see the link verbatim\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$GLOBALS['SITE_DB']->query_insert('url_title_cache',array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t't_url'=>substr($auto_link,0,255),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t't_title'=>substr($link_captions_title,0,255),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),false,true); // To stop weird race-like conditions\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=mixed();\n\t\t\t\t\t\t\t\t\t\t\t\t$link_handlers=find_all_hooks('systems','comcode_link_handlers');\n\t\t\t\t\t\t\t\t\t\t\t\tforeach (array_keys($link_handlers) as $link_handler)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\trequire_code('hooks/systems/comcode_link_handlers/'.$link_handler);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$link_handler_ob=object_factory('Hook_comcode_link_handler_'.$link_handler,true);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (is_null($link_handler_ob)) continue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=$link_handler_ob->bind($auto_link,$link_captions_title,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!is_null($embed_output)) break;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif (is_null($embed_output))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$page_link=url_to_pagelink($auto_link,true);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($link_captions_title=='') $link_captions_title=$auto_link;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($page_link!='')\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('page',array('param'=>$page_link),make_string_tempcode(escape_html($link_captions_title)),$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('url',array('param'=>$link_captions_title),$auto_link_tempcode,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else $embed_output=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t\t\t$pos+=$link_end_pos-$pos;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\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}\n\n\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($stupidity_mode!='') && ($textual_area))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($stupidity_mode=='leet') && (mt_rand(0,1)==1))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (array_key_exists(strtoupper($next),$LEET_FILTER)) $next=$LEET_FILTER[strtoupper($next)];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telseif (($stupidity_mode=='bork') && (mt_rand(0,60)==1))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$next.='-bork-bork-bork-';\n\t\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\tif ((!$in_separate_parse_section) && ((!$in_semihtml) || ((!$comcode_dangerous_html)/*If we don't support HTML and we haven't done the all_semihtml pre-filter at the top*/ && (!$is_all_semihtml)))) // Display char. We try and support entities\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($next=='&')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$ahead=substr($comcode,$pos,20);\n\t\t\t\t\t\t\t\t\t\t$ahead_lower=strtolower($ahead);\n\t\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\t\t$entity=preg_match('#^(\\#)?([\\w]*);#',$ahead_lower,$matches)!=0; // If it is a SAFE entity, use it\n\n\t\t\t\t\t\t\t\t\t\tif (($entity) && (!$in_code_tag))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (($matches[1]=='') && (($in_semihtml) || (isset($ALLOWED_ENTITIES[$matches[2]]))))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[2])+1;\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation.='&'.$matches[2].';';\n\t\t\t\t\t\t\t\t\t\t\t} elseif ((is_numeric($matches[2])) && ($matches[1]=='#'))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$matched_entity=intval(base_convert($matches[2],16,10));\n\t\t\t\t\t\t\t\t\t\t\t\tif (($matched_entity<127) && (array_key_exists(chr($matched_entity),$POTENTIAL_JS_NAUGHTY_ARRAY)))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$continuation.=escape_html($next);\n\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[2])+2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$continuation.='&#'.$matches[2].';';\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation.='&amp;';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$continuation.='&amp;';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.=escape_html($next);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$continuation.=$next;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_NAME:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='=')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT;\n\t\t\t\t\t$current_attribute_name='param';\n\t\t\t\t}\n\t\t\t\telseif (trim($next)=='')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t}\n\t\t\t\telseif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$next=']';\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\tif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif ($close)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($formatting_allowed)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count($tag_stack)==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($lax)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_NO_CLOSE',$current_tag),strrpos(substr($comcode,0,$pos),'['),$comcode,$check_only);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$has_it=false;\n\t\t\t\t\t\tforeach (array_reverse($tag_stack) as $t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($t[0]==$current_tag)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$has_it=true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (($in_semihtml) && (($current_tag=='html') || ($current_tag=='semihtml'))) // Only search one level for this\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($has_it)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t\t\t\tif ($_last[0]!=$current_tag)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!$lax)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_NO_CLOSE_MATCH',$current_tag,$_last[0]),$pos,$comcode,$check_only);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode($_last[0],$_last[1],$tag_output,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,NULL,NULL,$in_semihtml,$is_all_semihtml);\n\t\t\t\t\t\t\t\t\t$in_code_tag=false;\n\t\t\t\t\t\t\t\t\t$white_space_area=$_last[3];\n\t\t\t\t\t\t\t\t\t$in_separate_parse_section=$_last[4];\n\t\t\t\t\t\t\t\t\t$formatting_allowed=$_last[5];\n\t\t\t\t\t\t\t\t\t$textual_area=$_last[6];\n\t\t\t\t\t\t\t\t\t$tag_output=$_last[2];\n\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t$mindless_mode=$_last[7];\n\t\t\t\t\t\t\t\t\t$comcode_dangerous=$_last[8];\n\t\t\t\t\t\t\t\t\t$comcode_dangerous_html=$_last[9];\n\n\t\t\t\t\t\t\t\t\tif (count($tag_stack)==0) // Hmm, it was never open. So let's pretend this tag close never happened\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twhile ($_last[0]!=$current_tag);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$extraneous_semihtml=((!$is_all_semihtml) && (!$in_semihtml)) || (($current_tag!='html') && ($current_tag!='semihtml'));\n\t\t\t\t\t\t\tif ((!$lax) && ($extraneous_semihtml))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_NO_CLOSE_MATCH',$current_tag,$_last[0]),$pos,$comcode,$check_only);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Do the comcode for this tag\n\t\t\t\t\t\tif ($in_semihtml) // We need to perform some magic to clean up the Comcode sections\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($_last[1] as $index=>$conv)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_last[1][$index]=@html_entity_decode(str_replace('<br />',chr(10),$conv),ENT_QUOTES,get_charset());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$mindless_mode=$_last[7];\n\n\t\t\t\t\t\tif ($mindless_mode)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$embed_output=$tag_output;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (!$check_only)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_structure_sweep=false;\n\t\t\t\t\t\t\tif ($structure_sweep)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_structure_sweep=!in_tag_stack($tag_stack,array('title'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$embed_output=_do_tags_comcode($_last[0],$_last[1],$tag_output,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$_structure_sweep,$semiparse_mode,$highlight_bits,NULL,$in_semihtml,$is_all_semihtml);\n\t\t\t\t\t\t} else $embed_output=new ocp_tempcode();\n\n\t\t\t\t\t\t$in_code_tag=false;\n\t\t\t\t\t\t$white_space_area=$_last[3];\n\t\t\t\t\t\t$in_separate_parse_section=$_last[4];\n\t\t\t\t\t\t$formatting_allowed=$_last[5];\n\t\t\t\t\t\t$textual_area=$_last[6];\n\t\t\t\t\t\t$tag_output=$_last[2];\n\t\t\t\t\t\t$comcode_dangerous=$_last[8];\n\t\t\t\t\t\t$comcode_dangerous_html=$_last[9];\n\t\t\t\t\t\tif (($print_mode) && ($_last[0]=='exp_thumb'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$queued_tempcode->attach($embed_output);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$just_ended=isset($BLOCK_TAGS[$current_tag]);\n\n\t\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ((strlen($comcode)>$pos+1) && ($comcode[$pos]==chr(10)) && ($comcode[$pos+1]==chr(10))) // Linux newline\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$NUM_LINES+=2;\n\t\t\t\t\t\t\t\t$pos+=2;\n\t\t\t\t\t\t\t\t$just_new_line=true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($current_tag=='html') $in_html=false;\n\t\t\t\t\t\telseif ($current_tag=='semihtml') $in_semihtml=false;\n\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\t\t\t\t\t}\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\n\t\t\t\t\tif (($close) && ($mindless_mode))\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp_tpl='</kbd>&#8203;';\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($status==CCP_IN_TAG_NAME) $current_tag.=strtolower($next);\n\t\t\t\tbreak;\n\t\t\tcase CCP_STARTING_TAG:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='[') // Can't actually occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif ($next==']') // Can't actual occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_CLOSE_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t}\n\t\t\t\telseif ($next=='/')\n\t\t\t\t{\n\t\t\t\t\t$close=true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$current_tag.=strtolower($next);\n\t\t\t\t\t$status=CCP_IN_TAG_NAME;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_BETWEEN_ATTRIBUTES:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t{\n\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\t\t\t\t}\n\t\t\t\telseif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t{\n\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif (trim($next)!='')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_ATTRIBUTE_NAME;\n\t\t\t\t\t$current_attribute_name=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_ATTRIBUTE_NAME:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t$pos--;\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t{\n\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\t\t\t\t}\n\t\t\t\telseif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif (($attribute_map==array()) && (!$lax))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_TAG_CLOSE_ANOMALY'),$pos,$comcode,$check_only);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($attribute_map!=array())\n\t\t\t\t\t{\n\t\t\t\t\t\t$at_map_keys=array_keys($attribute_map);\n\t\t\t\t\t\t$old_attribute_name=$at_map_keys[count($at_map_keys)-1];\n\t\t\t\t\t\t$attribute_map[$old_attribute_name].=' '.$current_attribute_name;\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\t\t\t\t}\n\t\t\t\telseif ($next=='=') $status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT;\n\t\t\t\telseif ($next!=' ') $current_attribute_name.=strtolower($next);\n\t\t\t\telse $status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_LEFT;\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_LEFT:\n\t\t\t\tif (($mindless_mode) && ($next!='[') && ($next!=']')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='=') $status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT;\n\t\t\t\telseif (trim($next)!='')\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_ATTRIBUTE_ERROR',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\n\t\t\t\t\tif ($next=='[')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t\t$pos--;\n\t\t\t\t\t}\n\t\t\t\t\telseif ($next==']')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t\t$pos--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT:\n\t\t\t\tif (($mindless_mode) && ($next!='[') && ($next!=']')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='[') // Can't actually occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif ($next==']') // Can't actually occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_CLOSE_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif ((($next=='\"')/* && (!$in_semihtml)*/) || (($in_semihtml) && (substr($comcode,$pos-1,6)=='&quot;')))\n\t\t\t\t{\n\t\t\t\t\tif ($next!='\"')\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos+=5;\n\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='quot;';\n\t\t\t\t\t}\n\t\t\t\t\t$status=CCP_IN_TAG_ATTRIBUTE_VALUE;\n\t\t\t\t\t$current_attribute_value='';\n\t\t\t\t}\n\t\t\t\telseif ($next!='')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_ATTRIBUTE_VALUE_NO_QUOTE;\n\t\t\t\t\t$current_attribute_value=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_ATTRIBUTE_VALUE_NO_QUOTE:\n\t\t\t\tif (($mindless_mode) && ($next!=']')) $tag_raw.=($next);\n\n\t\t\t\tif ($next==' ')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\tif ((isset($attribute_map[$current_attribute_name])) && (!$lax)) return comcode_parse_error($preparse_mode,array('CCP_DUPLICATE_ATTRIBUTES',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\t\t\t\t\t$attribute_map[$current_attribute_name]=$current_attribute_value;\n\t\t\t\t}\n\t\t\t\telseif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif ((isset($attribute_map[$current_attribute_name])) && (!$lax)) return comcode_parse_error($preparse_mode,array('CCP_DUPLICATE_ATTRIBUTES',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t$attribute_map[$current_attribute_name]=$current_attribute_value;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$current_attribute_value.=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_ATTRIBUTE_VALUE:\n\t\t\t\tif ($mindless_mode) $tag_raw.=($next);\n\n\t\t\t\tif ((($next=='\"')/* && (!$in_semihtml)*/) || (($in_semihtml) && (substr($comcode,$pos-1,6)=='&quot;')))\n\t\t\t\t{\n\t\t\t\t\tif ($next!='\"')\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos+=5;\n\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='quot;';\n\t\t\t\t\t}\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\tif ((isset($attribute_map[$current_attribute_name])) && (!$lax)) return comcode_parse_error($preparse_mode,array('CCP_DUPLICATE_ATTRIBUTES',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\t\t\t\t\t$attribute_map[$current_attribute_name]=$current_attribute_value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($next=='\\\\')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($comcode[$pos]=='\"')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='&quot;';\n\t\t\t\t\t\t\t$current_attribute_value.='\"';\n\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t} elseif (substr($comcode,$pos-1,6)=='&quot;')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='&quot;';\n\t\t\t\t\t\t\t$current_attribute_value.='&quot;';\n\t\t\t\t\t\t\t$pos+=6;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($comcode[$pos]=='\\\\')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='\\\\';\n\t\t\t\t\t\t\t$current_attribute_value.='\\\\';\n\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t} else $current_attribute_value.=$next;\n\t\t\t\t\t} else $current_attribute_value.=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t$tag_output->attach($continuation);\n\t$continuation='';\n\n\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t$tag_output->attach($close_list);\n\n\tif (($status!=CCP_NO_MANS_LAND) || (count($tag_stack)!=0))\n\t{\n\t\tif (!$lax)\n\t\t{\n\t\t\t$stack_top=array_pop($tag_stack);\n\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_BROKEN_END',is_null($stack_top)?$current_tag:$stack_top[0]),$pos,$comcode,$check_only);\n\t\t} else\n\t\t{\n\t\t\twhile (count($tag_stack)>0)\n\t\t\t{\n\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t/*if ($_last[0]=='title') Not sure about this\n\t\t\t\t{\n\t\t\t\t\t$_structure_sweep=false;\n\t\t\t\t\tbreak;\n\t\t\t\t}*/\n\t\t\t\t$embed_output=_do_tags_comcode($_last[0],$_last[1],$tag_output,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,NULL,NULL,$in_semihtml,$is_all_semihtml);\n\t\t\t\t$in_code_tag=false;\n\t\t\t\t$white_space_area=$_last[3];\n\t\t\t\t$in_separate_parse_section=$_last[4];\n\t\t\t\t$formatting_allowed=$_last[5];\n\t\t\t\t$textual_area=$_last[6];\n\t\t\t\t$tag_output=$_last[2];\n\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t$mindless_mode=$_last[7];\n\t\t\t\t$comcode_dangerous=$_last[8];\n\t\t\t\t$comcode_dangerous_html=$_last[9];\n\t\t\t}\n\t\t}\n\t}\n\n//\t$tag_output->left_attach('<div class=\"xhtml_validator_off\">');\n//\t$tag_output->attach('</div>');\n\n\treturn $tag_output;\n}", "function yy_r8(){$this->compiler->tag_nocache = true; $this->_retvalue = $this->cacher->processNocacheCode(\"<?php echo '?>';?>\\n\", $this->compiler, true); }", "public function compile()\n\t{\n\t\t$value = $this->value();\n\n\t\tif ( ! empty($this->parameters))\n\t\t{\n\t\t\t$params = $this->parameters;\n\t\t\t$value = strtr($value, $params);\n\t\t}\n\n\t\treturn $value;\n\t}", "protected static function buildCode(\n string $type,\n string $preparedClassName,\n string $preparedNamespace,\n string $preparedExtends\n ) {\n $code = [];\n if ($preparedNamespace) {\n $code[] = \"namespace $preparedNamespace;\";\n }\n $code[] = \"$type $preparedClassName\";\n if ($preparedExtends) {\n $code[] = \"extends \\\\$preparedExtends\";\n }\n $code[] = '{}';\n\n // echo PHP_EOL . '------------------------------------------------------------------' . PHP_EOL;\n // echo(implode(' ', $code));\n // echo PHP_EOL . '------------------------------------------------------------------' . PHP_EOL;\n\n eval(implode(' ', $code));\n }", "public function doCommand() {\n $basePath = $this->param('basePath');\n \n $tpl = $basePath . $this->param('template');\n \n if ($this->param('includeContext')) {\n $c = $this->context->toArray();\n extract($c);\n }\n \n if (is_readable($tpl) && is_file($tpl)) {\n // Do we need ob_flush()?\n ob_start();\n include $tpl;\n $str = ob_get_contents();\n ob_end_clean();\n return $str;\n }\n \n return 'Could not read template';\n }", "function smarty_postfilter_strip($compiled, &$smarty)\n{\n\treturn preg_replace('/<\\?php\\s+\\?>/', '', $compiled);\n}", "protected function template() {\n\n\t\t$template = \"<?php \n\n/**\n *\n * PHP version 7.\n *\n * Generated with cli-builder gen.php\n *\n * Created: \" . date( 'm-d-Y' ) . \"\n *\n *\n * @author Your Name <email>\n * @copyright (c) \" . date( 'Y' ) . \"\n * @package $this->_namespace - {$this->_command_name}.php\n * @license\n * @version 0.0.1\n *\n */\n\n\";\n\t\tif ( ! empty( $this->_namespace ) ) {\n\t\t\t$template .= \"namespace cli_builder\\\\commands\\\\$this->_namespace;\";\n\t\t} else {\n\t\t\t$template .= \"namespace cli_builder\\\\commands;\";\n\t\t}\n\n\t\t$template .= \"\n\nuse cli_builder\\\\cli;\nuse cli_builder\\\\command\\\\builder;\nuse cli_builder\\command\\command;\nuse cli_builder\\\\command\\\\command_interface;\nuse cli_builder\\\\command\\\\receiver;\n\n/**\n * This concrete command calls \\\"print\\\" on the receiver, but an external.\n * invoker just knows that it can call \\\"execute\\\"\n */\nclass {$this->_command_name} extends command implements command_interface {\n\n\t\n\t/**\n\t * Each concrete command is built with different receivers.\n\t * There can be one, many or completely no receivers, but there can be other commands in the parameters.\n\t *\n\t * @param receiver \\$console\n\t * @param builder \\$builder\n\t * @param cli \\$cli\n\t */\n\tpublic function __construct( receiver \\$console, builder \\$builder, cli \\$cli ) {\n\t\tparent::__construct( \\$console, \\$builder, \\$cli );\n\t\t\n\t\t// Add the help lines.\n\t\t\\$this->_help_lines();\n\t\t\n\t\tif ( in_array( 'h', \\$this->_flags ) || isset( \\$this->_options['help'] ) ) {\n\t\t\t\\$this->help();\n\t\t\t\\$this->_help_request = true;\n\t\t} else {\n\t\t\t// Any setup you need.\n\t\t\t\n\t\t}\n\t}\n\n\n\t/**\n\t * Execute and output \\\"$this->_command_name\\\".\n\t *\n\t * @return mixed|void\n\t */\n\tpublic function execute() {\n\t\n\t\tif ( \\$this->_help_request ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get the args that were used in the command line input.\n\t\t\\$args = \\$this->_cli->get_args();\n\t\t\\$args = \\$this->_args;\n\t\t\n\t\t// Create the build directory tree. It will be 'build/' if \\$receiver->set_build_path() is not set in your root cli.php.\n\t\tif ( ! is_dir( \\$this->_command->build_path ) ) {\n\t\t\t\\$this->_builder->create_directory( \\$this->_command->build_path );\n\t\t}\n\n\t\t\\$this->_cli->pretty_dump( \\$args );\n\n\t\t\n\t\t// Will output all content sent to the write method at the end even if it was set in the beginning.\n\t\t\\$this->_command->write( __CLASS__ . ' completed run.' );\n\n\t\t// Adding completion of the command run to the log.\n\t\t\\$this->_command->log(__CLASS__ . ' completed run.');\n\t}\n\t\n\tprivate function _help_lines() {\n\t\t// Example\n\t\t//\\$this->add_help_line('-h, --help', 'Output this commands help info.');\n\n\t}\n\t\n\t/**\n\t * Help output for \\\"$this->_command_name\\\".\n\t *\n\t * @return string\n\t */\n\tpublic function help() {\n\t\n\t\t// You can comment this call out once you add help.\n\t\t// Outputs a reminder to add help.\n\t\tparent::help();\n\t\t\n\t\t//\\$help = \\$this->get_help();\n\n\t\t// Work with the array\n\t\t//print_r( \\$help );\n\t\t// Or output a table\n\t\t//\\$this->help_table();\n\t}\n}\n\";\n\n\t\treturn $template;\n\t}", "public function process($data = array()): string\n {\n return $this->template->render($data);\n }", "public function compile(\\Twig\\Compiler $compiler)\n\t{\n\t\t$compiler\n\t\t\t->addDebugInfo($this)\n\t\t\t->write('return ');\n\t\t// check for an expression to return.\n\t\tif ($this->hasNode('expr')) {\n\t\t\t$compiler->subcompile($this->getNode('expr'));\n\t\t}\n\t\telse // Return '' if there isn't one\n\t\t{\n\t\t\t$compiler->raw('\"\"');\n\t\t}\n\n\t\t$compiler->raw(\";\\n\");\n\t}", "public function compile(Twig_Compiler $compiler)\n {\n \tif ('_self' === $this->getAttribute('name')) {\n //$compiler->raw('$this');\n } elseif ('_context' === $this->getAttribute('name')) {\n // $compiler->raw('$context');\n } elseif ('_charset' === $this->getAttribute('name')) {\n // $compiler->raw('$this->env->getCharset()');\n } else {\n $compiler\n \t->write(sprintf('$context[\\'%s\\'] = (isset($context[\\'%s\\']) ? $context[\\'%s\\'] : new %s())', $this->getAttribute('name'), $this->getAttribute('name'), $this->getAttribute('name'), $this->getAttribute('name')))\n \t\t->raw(\";\\n\");\n }\n \t\n \t$compiler ->write('echo ')\n ->subcompile($this->getNode('names')->getNode(0))\n ->raw(\"\\n\");\n \n $compiler->raw(\";\\n\");\n }", "function chekString($value)\r\n{\r\n\r\n $temp = '<code style=\"font_size: 10px\">strint </code>';\r\n\r\n $temp .= \"<code style='font_size: 9px ; color:red '>\" . PHP_EOL;\r\n\r\n $temp .= \"'{$value}'\" . PHP_EOL;\r\n\r\n $temp .= \"</code>\";\r\n\r\n $temp .= '<code style=\"font_size: 10px\">' . PHP_EOL;\r\n\r\n $temp .= '(length=' . strlen($value) . ')' . PHP_EOL;\r\n\r\n $temp .= \"</code>\" . PHP_EOL;\r\n\r\n return $temp ;\r\n\r\n}", "public static function load($code, $includeId, $useDefault = true)\n {\n $file = self::getContentFile($code, $includeId);\n $content = '';\n if (file_exists($file))\n $content = file_get_contents($file);\n else if ($useDefault) {\n $defaultFile = self::getContentFile(self::DEFAULT_CONTENT_FILENAME, $includeId);\n if (file_exists($defaultFile))\n $content = file_get_contents($defaultFile);\n }\n return $content;\n }", "private function exec() {\n extract($this->data);\n\n ob_start();\n $error = eval(' ?>' . $this->file .'<?php ');\n if($error === false) {\n ob_end_clean();\n throw new \\Exception('Error en la plantilla');\n }\n return ob_get_clean();\n }", "public function compile($minify = true)\n {\n $this->loadRaw();\n\n $compiled = $this->compiler->compile($this->raw);\n\n if ($minify && $this->minifier) {\n $compiled = $this->minifier->minify($compiled);\n }\n\n $this->compiled = $compiled;\n\n $this->compilerExecuted = true;\n\n return $compiled;\n }", "public function insert_code( $output = true ) {\n\t\t//If $output is not a boolean false, set it to true (default)\n\t\t$output = ($output !== false);\n\n\t\t$tracking_id = $this->_get_options( 'code' );\n\t\tif ( empty( $tracking_id ) )\n\t\t\treturn $this->_output_or_return( '<!-- Your Google Analytics Plugin is missing the tracking ID -->', $output );\n\n\t\t//get our plugin options\n\t\t$wga = $this->_get_options();\n\t\t//If the user's role has wga_no_track set to true, return without inserting code\n\t\tif ( is_user_logged_in() ) {\n\t\t\t$current_user = wp_get_current_user();\n\t\t\t$role = array_shift( $current_user->roles );\n\t\t\tif ( 'true' == $this->_get_options( 'ignore_role_' . $role ) )\n\t\t\t\treturn $this->_output_or_return( \"<!-- Google Analytics Plugin is set to ignore your user role -->\", $output );\n\t\t}\n\n\t\t//If $admin is true (we're in the admin_area), and we've been told to ignore_admin_area, return without inserting code\n\t\tif (is_admin() && (!isset($wga['ignore_admin_area']) || $wga['ignore_admin_area'] != 'false'))\n\t\t\treturn $this->_output_or_return( \"<!-- Your Google Analytics Plugin is set to ignore Admin area -->\", $output );\n\n\t\t$custom_vars = array(\n\t\t\t\"_gaq.push(['_setAccount', '{$tracking_id}']);\",\n\t\t);\n\n\t\t// Add custom variables specified by the user\n\t\tforeach( $this->_get_options( 'custom_vars', array() ) as $i => $custom_var ) {\n\t\t\tif ( empty( $custom_var['name'] ) || empty( $custom_var['value'] ) )\n\t\t\t\tcontinue;\n\n\t\t\t// Check whether a token was used with this custom var, and replace with value if so\n\t\t\t$all_tokens = wp_list_pluck( $this->tokens, 'token' );\n\t\t\tif ( in_array( $custom_var['value'], $all_tokens ) ) {\n\t\t\t\t$token = array_pop( wp_filter_object_list( $this->tokens, array( 'token' => $custom_var['value'] ) ) );\n\n\t\t\t\t// Allow tokens to return empty values for specific contexts\n\t\t\t\t$ignore = false;\n\t\t\t\tif ( ! empty( $token['ignore_when'] ) ) {\n\t\t\t\t\tforeach( (array)$token['ignore_when'] as $conditional ) {\n\t\t\t\t\t\tif ( is_callable( $conditional ) ) {\n\t\t\t\t\t\t\t$ignore = call_user_func( $conditional );\n\t\t\t\t\t\t\tif ( $ignore )\n\t\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}\n\n\t\t\t\t// If we aren't set to ignore this context, possibly execute the callback\n\t\t\t\tif ( ! $ignore && ! empty( $token['callback'] ) && is_callable( $token['callback'] ) )\n\t\t\t\t\t$replace = call_user_func( $token['callback'] );\n\t\t\t\telse\n\t\t\t\t\t$replace = '';\n\n\t\t\t\tif ( ! empty( $token['callback_returns'] ) && 'bool' == $token['callback_returns'] )\n\t\t\t\t\t$replace = ( $replace ) ? 'true' : 'false';\n\n\t\t\t\t// Replace our token with the value\n\t\t\t\t$custom_var['value'] = str_replace( $custom_var['value'], $replace, $custom_var['value'] );\n\t\t\t}\n\n\t\t\t$atts = array(\n\t\t\t\t\t\"'_setCustomVar'\",\n\t\t\t\t\tintval( $i ),\n\t\t\t\t\t\"'\" . esc_js( $custom_var['name'] ) . \"'\",\n\t\t\t\t\t\"'\" . esc_js( $custom_var['value'] ) . \"'\",\n\t\t\t\t);\n\t\t\tif ( $custom_var['scope'] )\n\t\t\t\t$atts[] = intval( $custom_var['scope'] );\n\t\t\t$custom_vars[] = \"_gaq.push([\" . implode( ', ', $atts ) . \"]);\";\n\t\t}\n\n\t\t$track = array();\n\t\tif (is_404() && (!isset($wga['log_404s']) || $wga['log_404s'] != 'false')) {\n\t\t\t// This is a 404 and we are supposed to track them\n\t\t\t$custom_vars[] = \"_gaq.push( [ '_trackEvent', '404', document.location.href, document.referrer ] );\";\n\t\t} elseif (is_search() && (!isset($wga['log_searches']) || $wga['log_searches'] != 'false')) {\n\t\t\t//Set track for searches, if it's a search, and we are supposed to\n\t\t\t$track['data'] = $_REQUEST['s'];\n\t\t\t$track['code'] = \"search\";\n\t\t}\n\n\t\tif ( ! empty( $track ) ) {\n\t\t\t$track['url'] = $this->_get_url( $track );\n\t\t\t//adjust the code that we output, account for both types of tracking\n\t\t\t$track['url'] = esc_js( str_replace( '&', '&amp;', $track['url'] ) );\n\t\t\t$custom_vars[] = \"_gaq.push(['_trackPageview','{$track['url']}']);\";\n\t\t} else {\n\t\t\t$custom_vars[] = \"_gaq.push(['_trackPageview']);\";\n\t\t}\n\n\t\t$async_code = \"<script type='text/javascript'>\n\tvar _gaq = _gaq || [];\n\t%custom_vars%\n\n\t(function() {\n\t\tvar ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n\t\tga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n\t\tvar s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n\t})();\n</script>\";\n\t\t$custom_vars_string = implode( \"\\r\\n\", $custom_vars );\n\t\t$async_code = str_replace( '%custom_vars%', $custom_vars_string, $async_code );\n\n\t\treturn $this->_output_or_return( $async_code, $output );\n\n\t}", "public function m4() {\n $project = $this->project;\n $sources = implode(\" \", $this->sources);\n $date = date(\"Y-m-d H:i:s\");\n $m4_alias = str_replace('_', '-', $this->code);\n ob_start();\n echo <<<M4\ndnl Koda compiler, {$date}.\n\nPHP_ARG_WITH({$this->code}, for {$project->name} support,\n[ --with-{$m4_alias} Include {$project->name} support])\nPHP_ARG_ENABLE({$m4_alias}-debug, whether to enable debugging support in {$project->name},\n[ --enable-{$m4_alias}-debug Enable debugging support in {$project->name}], no, no)\n\nif test \"\\$PHP_{$this->CODE}_DEBUG\" != \"no\"; then\n AC_DEFINE({$this->CODE}_DEBUG, 1, [Include debugging support in {$project->name}])\n AC_DEFINE(KODA_DEBUG, 1, [Include koda debugging])\n CFLAGS=\"\\$CFLAGS -Wall -g3 -ggdb -O0\"\nelse\ndnl todo: remove this\n CFLAGS=\"\\$CFLAGS -Wall -g3 -ggdb -O0\"\nfi\n\nif test \"\\$PHP_{$this->CODE}\" != \"no\"; then\n PHP_ADD_INCLUDE(.)\n PHP_SUBST({$this->CODE}_SHARED_LIBADD)\n PHP_NEW_EXTENSION({$this->code}, {$sources}, \\$ext_shared,, \\$CFLAGS)\nfi\nM4;\n return ob_get_clean();\n }", "public static function getCode(string $hook, string $repoPath, string $vendorPath, string $configPath) : string\n {\n $tplVendorPath = self::getTplTargetPath($repoPath, $vendorPath);\n $tplConfigPath = self::getTplTargetPath($repoPath, $configPath);\n\n return '#!/usr/bin/env php' . PHP_EOL .\n '<?php' . PHP_EOL .\n '$autoLoader = ' . $tplVendorPath . '/autoload.php\\';' . PHP_EOL . PHP_EOL .\n 'if (!file_exists($autoLoader)) {' . PHP_EOL .\n ' fwrite(STDERR,' . PHP_EOL .\n ' \\'Composer autoload.php could not be found\\' . PHP_EOL .' . PHP_EOL .\n ' \\'Please re-install the hook with:\\' . PHP_EOL .' . PHP_EOL .\n ' \\'$ captainhook install --composer-vendor-path=...\\' . PHP_EOL' . PHP_EOL .\n ' );' . PHP_EOL .\n ' exit(1);' . PHP_EOL .\n '}' . PHP_EOL .\n 'require $autoLoader;' . PHP_EOL .\n '$config = realpath(' . $tplConfigPath . '\\');' . PHP_EOL .\n '$app = new CaptainHook\\App\\Console\\Application\\Hook();' . PHP_EOL .\n '$app->setHook(\\'' . $hook . '\\');' . PHP_EOL .\n '$app->setConfigFile($config);' . PHP_EOL .\n '$app->run();' . PHP_EOL . PHP_EOL;\n }", "public function bladerWithOutServerScript($str, $data = array())\n {\n return $this->blader($str, $data, false);\n }", "protected function compile()\n\t{\n\t\t$lexer = new Lexer($this->template->getEnvironment());\n\t\t$stream = $lexer->tokenize(file_get_contents($this->filename), basename($this->filename));\n\n\t\t// unique class based on the filename\n\t\t// @todo fix problem with '-' in classes\n\t\t$class = $this->template->getEnvironment()->getCacheFilename($this->filename);\n\t\t$class = 'S' . substr($class, 0, -8) . '_Template';\n\n\t\t// writer object which contains the parsed PHP code\n\t\t$writer = new Writer();\n\t\t$writer->write(\"<?php\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('namespace Spoon\\Template;' . \"\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('/* ' . $this->filename . ' */' . \"\\n\");\n\t\t$writer->write(\"class $class extends Renderer\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\t\t$writer->write('protected function display(array $context)' . \"\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\n\t\t$tags = $this->template->getEnvironment()->getTags();\n\n\t\t$token = $stream->getCurrent();\n\t\twhile(!$stream->isEof())\n\t\t{\n\t\t\tswitch($token->getType())\n\t\t\t{\n\t\t\t\tcase Token::TEXT:\n\t\t\t\t\t$text = new TextNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$text->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::VAR_START:\n\t\t\t\t\t$stream->next();\n\t\t\t\t\t$variable = new VariableNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$variable->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::BLOCK_START:\n\t\t\t\t\t$token = $stream->next();\n\n\t\t\t\t\t// validate tag existence\n\t\t\t\t\tif(!isset($tags[$token->getValue()]))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\tsprintf('There is no such template tag \"%s\"', $token->getValue()),\n\t\t\t\t\t\t\t$token->getLine(),\n\t\t\t\t\t\t\t$this->filename\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$node = new $tags[$token->getValue()]($stream, $this->template->getEnvironment());\n\t\t\t\t\t$node->compile($writer);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif($token->getType() !== Token::EOF)\n\t\t\t{\n\t\t\t\t$token = $stream->next();\n\t\t\t}\n\n\t\t\telse break;\n\t\t}\n\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\treturn $writer->getSource();\n\t}", "public static function compileString($value) {\n\t\t$value = str_replace(chr(39), chr(92) . chr(39), $value);\n\t\treturn \"'{$value}'\";\n\t}", "function modifiercompiler_escape($params, $compiler)\n{\n static $_double_encode = null;\n static $is_loaded = false;\n $compiler->template->_checkPlugins(\n array(\n array(\n 'function' => 'literal_compiler_param',\n 'file' => 'shared.literal_compiler_param.php'\n )\n )\n );\n if ($_double_encode === null) {\n $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');\n }\n \n $esc_type = literal_compiler_param($params, 1, 'html');\n $char_set = literal_compiler_param($params, 2, $_CHARSET);\n $double_encode = literal_compiler_param($params, 3, true);\n if (!$char_set) {\n $char_set = $_CHARSET;\n }\n switch ($esc_type) {\n case 'html':\n if ($_double_encode) {\n return 'htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' .\n var_export($double_encode, true) . ')';\n } elseif ($double_encode) {\n return 'htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ')';\n } else {\n // fall back to modifier.escape.php\n }\n // no break\n case 'htmlall':\n if ($_MBSTRING) {\n if ($_double_encode) {\n // php >=5.2.3 - go native\n return 'mb_convert_encoding(htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' .\n var_export($char_set, true) . ', ' . var_export($double_encode, true) .\n '), \"HTML-ENTITIES\", ' . var_export($char_set, true) . ')';\n } elseif ($double_encode) {\n // php <5.2.3 - only handle double encoding\n return 'mb_convert_encoding(htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' .\n var_export($char_set, true) . '), \"HTML-ENTITIES\", ' . var_export($char_set, true) . ')';\n } else {\n // fall back to modifier.escape.php\n }\n }\n // no MBString fallback\n if ($_double_encode) {\n // php >=5.2.3 - go native\n return 'htmlentities(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' .\n var_export($double_encode, true) . ')';\n } elseif ($double_encode) {\n // php <5.2.3 - only handle double encoding\n return 'htmlentities(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ')';\n } else {\n // fall back to modifier.escape.php\n }\n // no break\n case 'url':\n return 'rawurlencode(' . $params[ 0 ] . ')';\n case 'urlpathinfo':\n return 'str_replace(\"%2F\", \"/\", rawurlencode(' . $params[ 0 ] . '))';\n case 'quotes':\n // escape unescaped single quotes\n return 'preg_replace(\"%(?<!\\\\\\\\\\\\\\\\)\\'%\", \"\\\\\\'\",' . $params[ 0 ] . ')';\n case 'javascript':\n // escape quotes and backslashes, newlines, etc.\n return 'strtr(' .\n $params[ 0 ] .\n ', array(\"\\\\\\\\\" => \"\\\\\\\\\\\\\\\\\", \"\\'\" => \"\\\\\\\\\\'\", \"\\\"\" => \"\\\\\\\\\\\"\", \"\\\\r\" => \"\\\\\\\\r\", \"\\\\n\" => \"\\\\\\n\", \"</\" => \"<\\/\" ))';\n }\n \n // could not optimize |escape call, so fallback to regular plugin\n if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) {\n $compiler->required_plugins[ 'nocache' ][ 'escape' ][ 'modifier' ][ 'file' ] =\n 'modifier.escape.php';\n $compiler->required_plugins[ 'nocache' ][ 'escape' ][ 'modifier' ][ 'function' ] =\n 'modifier_escape';\n } else {\n $compiler->required_plugins[ 'compiled' ][ 'escape' ][ 'modifier' ][ 'file' ] =\n 'modifier.escape.php';\n $compiler->required_plugins[ 'compiled' ][ 'escape' ][ 'modifier' ][ 'function' ] =\n 'modifier_escape';\n }\n return 'modifier_escape(' . join(', ', $params) . ')';\n }", "protected function compile()\n\t{\n\n\t\t$this->Template->tweetcontainer = $this->html;\n\n\t}", "protected function wpEval($alias, $code, $skipWordPress = false)\n {\n $code = escapeshellarg($code);\n $skipWordPress = $skipWordPress ? '--skip-wordpress' : '';\n return $this->wp($alias, \"eval $code $skipWordPress\");\n }", "public function interpret( int $code ): string;", "function execute( string $contents ): string;" ]
[ "0.7289979", "0.61867577", "0.5943419", "0.59426916", "0.59412587", "0.59225106", "0.5750385", "0.566643", "0.5653045", "0.5638804", "0.5593859", "0.5531053", "0.5521349", "0.546036", "0.5449928", "0.54303336", "0.54211974", "0.5399455", "0.53897816", "0.53749055", "0.53564763", "0.5349011", "0.53189915", "0.52900696", "0.52871466", "0.5281246", "0.5277902", "0.52737325", "0.5255924", "0.52436817", "0.5229482", "0.522322", "0.5182162", "0.51632947", "0.51502156", "0.5149366", "0.5140936", "0.51390195", "0.5130448", "0.51230615", "0.51157194", "0.51101005", "0.51034194", "0.50674736", "0.50606734", "0.50576955", "0.5028986", "0.50286436", "0.50269765", "0.50247914", "0.5021182", "0.4998449", "0.4997005", "0.4981793", "0.49784285", "0.49770188", "0.49485785", "0.49370012", "0.49301124", "0.49258465", "0.492541", "0.49246326", "0.48842904", "0.4881996", "0.4874598", "0.48737422", "0.48724133", "0.4859121", "0.48508388", "0.48469034", "0.48430118", "0.48287192", "0.48253", "0.48225188", "0.4815914", "0.48149034", "0.48111486", "0.47998723", "0.4796952", "0.4794471", "0.47874254", "0.4778527", "0.47735906", "0.47722447", "0.47709092", "0.47663692", "0.47660527", "0.47646946", "0.4757968", "0.47527355", "0.4749279", "0.4749012", "0.47457692", "0.47276816", "0.47160852", "0.4707872", "0.46936196", "0.46891457", "0.4688972", "0.4688574" ]
0.809234
0
Write cache to disk
function write_cache($filename, $code) { // check if cache is writable if(!$this->cache_writable) { return false; } // check if filename is valid if(substr($filename, 0, strlen($this->cachedir)) !== $this->cachedir) { return false; } // try to open file $file = @fopen($filename, 'w'); if(!$file) { // try to create directories $dir = substr($filename, strlen($this->cachedir), strlen($filename)); $dirs = explode('/', $dir); $path = $this->cachedir; @umask(0); if(!@is_dir($path)) { if(!@mkdir($path)) { $this->cache_writable = 0; return false; } else { @chmod($path, 0777); } } $count = sizeof($dirs); if($count > 0) for($i = 0; $i < ($count - 1); $i++) { if($i > 0) { $path .= '/'; } $path .= $dirs[$i]; if(!@is_dir($path)) { if(!@mkdir($path)) { $this->cache_writable = 0; return false; } else { @chmod($path, 0777); } } } // try to open file again after directories were created $file = @fopen($filename, 'w'); } if(!$file) { $this->cache_writable = 0; return false; } $data = '<' . '?php' . "\n\n// eXtreme Styles mod cache. Generated on " . gmdate('r') . " (time = " . time() . ")\n\n" . "if (!defined('IN_ICYPHOENIX')) exit;\n\n" . '?' . '>' . $code; @flock($file, LOCK_EX); @fwrite ($file, $data); @flock($file, LOCK_UN); @fclose($file); @chmod($filename, 0777); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function write_cache() {\n if (!file_exists(CACHE_DIR))\n mkdir(CACHE_DIR, 0755, TRUE);\n\n if (is_dir(CACHE_DIR) && is_writable(CACHE_DIR)) {\n if (function_exists(\"sem_get\") && ($mutex = @sem_get(2013, 1, 0644 | IPC_CREAT, 1)) && @sem_acquire($mutex))\n file_put_contents($this->cache_file, $this->html . $this->debug) . sem_release($mutex);\n /**/\n else if (($mutex = @fopen($this->cachefile, \"w\")) && @flock($mutex, LOCK_EX))\n file_put_contents($this->cache_file, $this->html . $this->debug) . flock($mutex, LOCK_UN);\n /**/\n }\n }", "public function saveCache()\n {\n if($this->isCacheExists()){\n if($this->isUpdateRequired()){\n $this->updateCache();\n }\n } else {\n $this->packData()->writeFile();\n }\n }", "public function save()\n {\n $this->readCache();\n\n file_put_contents($this->filePath, json_encode($this->cacheContents));\n }", "protected function writeCache(): void\n {\n $chunkSize = 1024 * 8;\n\n // open remote file\n $arrContextOptions = [\n 'ssl' => [\n 'verify_peer' => false,\n 'verify_peer_name' => false,\n ],\n ];\n $remoteFile = fopen(\n $this->pathFile,\n 'rb',\n false,\n stream_context_create($arrContextOptions)\n );\n if (!$remoteFile) {\n throw new \\RuntimeException(\n sprintf(\n \"Couldn't open file at %s\",\n $this->pathFile\n )\n );\n }\n\n // open cache file\n $cacheFile = fopen($this->pathCache, 'wb');\n if (!$cacheFile) {\n fclose($remoteFile);\n\n throw new \\RuntimeException(\n sprintf(\n \"Couldn't open cache file at %s\",\n $this->pathCache\n )\n );\n }\n\n // write file to cache\n while (!feof($remoteFile)) {\n fwrite(\n $cacheFile,\n fread($remoteFile, $chunkSize),\n $chunkSize\n );\n }\n\n // close cache file\n fclose($cacheFile);\n\n // close remote file\n fclose($remoteFile);\n }", "private function write_cache($content)\r\n\t{\r\n\t\tfile_put_contents($this->cache_file, $content);\r\n\t}", "public static function save_cache() {\n if (self::$_cache_invalid) {\n if (@file_put_contents(self::$_path_cache_file\n , serialize(self::$_abs_file_paths))) {\n error_log('failed to write absolute file path cache to: ' . self::$_path_cache_file);\n }\n }\n }", "public function write()\n\t{\n\t\t$source = $this->compile();\n\n\t\t// file location\n\t\t$file = $this->template->getEnvironment()->getCache() . '/';\n\t\t$file .= $this->template->getEnvironment()->getCacheFilename($this->filename);\n\n\t\t// attempt to create the directory if needed\n\t\tif(!is_dir(dirname($file)))\n\t\t{\n\t\t\tmkdir(dirname($file), 0777, true);\n\t\t}\n\n\t\t// write to tempfile and rename\n\t\t$tmpFile = tempnam(dirname($file), basename($file));\n\t\tif(@file_put_contents($tmpFile, $source) !== false)\n\t\t{\n\t\t\tif(@rename($tmpFile, $file))\n\t\t\t{\n\t\t\t\tchmod($file, 0644);\n\t\t\t}\n\t\t}\n\t}", "public function storeCache() {\n\t\tif ($this->cacheFilePath) {\n\t\t\tfile_put_contents($this->cacheFilePath, serialize($this->classFileIndex));\n\t\t}\n\t}", "private function writeCookieFileCache()\n {\n $timeLive = Carbon::now()->addMinutes(480);\n Cache::put('AuthApiBpmCookie', $this->cookies, $timeLive);\n Log::info('Получены новые куки'.$this->cookies);\n }", "function write_cache(&$var, $filename) {\n $filename = DIR_FS_CACHE . $filename;\n $success = false;\n\n// try to open the file\n if ($fp = @fopen($filename, 'w')) {\n// obtain a file lock to stop corruptions occuring\n flock($fp, 2); // LOCK_EX\n// write serialized data\n fputs($fp, serialize($var));\n// release the file lock\n flock($fp, 3); // LOCK_UN\n fclose($fp);\n $success = true;\n }\n\n return $success;\n }", "public function writeCache($cacheFile)\n {\n if (self::$_writeCache) {\n file_put_contents($cacheFile, ob_get_contents());\n }\n }", "protected function saveToCache() {}", "public function cacheWrite( $name, $value ) {\n\t\tif ( ZC_CACHE == 'none' || $this->isAdmin() ) return;\n\t\t$name = $this->_cacheName( $name );\n\t\tif ( ZC_CACHE == 'apc' ) {\n\t\t\tapc_store( ZC_CACHE_PREFIX. $name, $value );\n\t\t}\n\t\telse {\n\t\t\t$file = ZC_CACHE_DIR . '/'. $name. '.cache';\n\t\t\tfile_put_contents( $file, serialize( $value ) );\n\t\t}\n\t}", "private function writeCache($object)\r\n {\r\n $fp = fopen(WEMO_CACHE, 'w');\r\n fwrite($fp, json_encode($object));\r\n fclose($fp);\r\n }", "public function saveToCacheForever();", "protected function write()\n {\n if (!is_dir($this->path)) {\n mkdir($this->path);\n }\n\n file_put_contents($this->file, json_encode([\n 'network' => $this->network,\n 'epoch' => static::$epoch,\n 'iteration' => static::$iteration,\n 'a' => $this->a,\n 'e' => $this->e\n ]));\n }", "protected function SaveKeysCache()\n\t{\n\t\tif (!is_dir(APPROOT.'data'))\n\t\t{\n\t\t\tmkdir(APPROOT.'data');\n\t\t}\n\t\t$hFile = @fopen($this->m_sCacheFileName, 'w');\n\t\tif ($hFile !== false)\n\t\t{\n\t\t\t$sData = serialize( array('keys' => $this->m_aKeys,\n\t\t\t\t\t\t\t\t\t'objects' => $this->m_aObjectsCache,\n\t\t\t\t\t\t\t\t\t'change' => $this->m_oChange,\n\t\t\t\t\t\t\t\t\t'errors' => $this->m_aErrors,\n\t\t\t\t\t\t\t\t\t'warnings' => $this->m_aWarnings,\n\t\t\t\t\t\t\t\t\t));\n\t\t\tfwrite($hFile, $sData);\n\t\t\tfclose($hFile);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception(\"Cannot write to file: '{$this->m_sCacheFileName}'\");\n\t\t}\n\t}", "function InPlaceCache_writeCache(/* $hash, */ $path, &$data)\r\n{\r\n//\t$path = InPlaceCache_checkCache($hash);\r\n\t\r\n\tif($path[0] === false)\r\n\t{\r\n\t\tif(!is_dir($path[3]))\r\n\t\t\tmkdir($path[3]);\r\n\t\tif(!is_dir($path[2]))\r\n\t\t\tmkdir($path[2]);\r\n\t}\r\n\r\n\tfile_put_contents($path[1], serialize(&$data));\r\n}", "public function saveCache($data) {\n\t\t$data = serialize($data);\n\t\ttry {\n\t\t\t$old = umask(0);\n\t\t\tumask(0);\n\t\t\tfile_put_contents($this->path, $data);\n\t\t\tchmod($this->path, 0755);\n\t\t\tumask($old);\n\t\t} catch (Exception $e) {\n\t\t\tutils::log('Err on saving data to file \"' . $this->path . '\": ' . $e->getMessage(), \"cache-err\");\n\t\t}\n\t}", "private function writeCache($contentOutput, $cacheFile) {\n\t\t// open file for writing\n\t\t$cacheFile = fopen($cacheFile, 'w');\n\t\t// write file\n\t\tfwrite($cacheFile, $contentOutput);\n\t\t// close file\n\t\tfclose($cacheFile);\n\t}", "function StoreToCache($content)\n {\n File::CreateWithText($this->file, $content);\n }", "static function cacheWrite($name,$rows) {\n if (Caching::$compressJson) \n file_put_contents(Caching::getCachePath() . \"$name.json\",gzcompress(json_encode($rows)));\n else \n file_put_contents(Caching::getCachePath() . \"$name.json\",json_encode($rows));\n }", "protected function writeCache($url, $result)\n {\n $filename = $this->getCacheFilename($url);\n $cache_dir = dirname($filename);\n if (!@mkdir($cache_dir) && !is_dir($cache_dir)) {\n // TODO log error or throw exception\n return;\n }\n file_put_contents($filename, $result);\n }", "protected function _writeCache($data, $url) {\n\t\t$file = sha1(serialize($data)).'.png';\n\n\t\tif (is_writable($this->cachePath)) {\n\t\t\t$contents = file_get_contents($url);\n\n\t\t\t$fp = fopen($this->cachePath.$file, 'w');\n\t\t\tfwrite($fp, $contents);\n\t\t\tfclose($fp);\n\n\t\t\tif (!is_file($this->cachePath.$file)) {\n\t\t\t\t$this->__errors[] = __d('google', 'Could not create the cache file');\n\t\t\t}\n\t\t}\n\t}", "private function _saveCache($buffer)\r\n {\r\n // build the hash for this object\r\n $hash = md5($buffer);\r\n \r\n // save to the cache\r\n file_put_contents(\"{$this->_config['paths']['cache']}/{$hash}\", $buffer);\r\n }", "public function write( $key, $value ) {\n\t\treturn file_put_contents( $this->get_cache_file_path( $key ), serialize( $value ) );\n\t}", "public function cache($output)\n\t{\n\t\t$name = Kohana::config($this->type.'.cache_folder').'/'.md5($this->file).EXT;\n\t\t// add offset to cache file if using load() if not nested don't indent\n\t\tfile_put_contents($name, $output);\n\t\tunset($output);\n\t}", "function saveAndFlushCalculationCaches() {\n\n $this->saveToFile();\n\n $file = $this->getExtractedFile();\n\n $this->flushFileCachedValues();\n\n $this->saveToFile();\n }", "function write($filename)\n\t{\n\t\t// open, but do not truncate leaving data in place for others\n\t\t$fp = fopen($this->folder . $filename . '.html', 'c'); \n\t\tif ($fp === false) \n\t\t{\n error_log(\"Couldn't open \" . $filename . ' cache for updating!');\n }\n\t\t// exclusive lock, but don't block it so others can still read\n\t\tflock($fp, LOCK_EX | LOCK_NB); \n // truncate it now we've got our exclusive lock\n\t\tftruncate($fp, 0);\n\t\tfwrite($fp, ob_get_contents());\n\t\tflock($fp, LOCK_UN); // release lock\n\t\tfclose($fp);\n\t\t// finally send browser output\n\t\tob_end_flush();\n\t}", "private function saveCache(): void\n {\n //====================================================================//\n // Safety Check\n if (!isset($this->cacheItem) || !isset($this->cache) || empty($this->cache)) {\n return;\n }\n //====================================================================//\n // Save Links are In Cache\n $this->cacheItem->set($this->cache);\n $this->cacheAdapter->save($this->cacheItem);\n }", "private function _createCacheFile($data, $key)\n\t{\n\t\t$cache_path = APPPATH.'cache/' . __CLASS__;\n\t\t$filepath = $cache_path .\"/\". $key . \".xml\";\n\t\n\t\tif (! is_dir($cache_path))\n\t\t\tmkdir($cache_path . \"\", 0777, TRUE);\n\t\t\n\t\tif(! is_really_writable($cache_path))\n\t\t\treturn;\n\n\t\tif ( ! $fp = fopen($filepath, FOPEN_WRITE_CREATE_DESTRUCTIVE))\n\t\t{\n\t\t\t// print(\"<!-- Unable to write cache file: \".$filepath.\" -->\\n\");\n\t\t\tlog_message('error', \"Unable to write cache file: \".$filepath);\n\t\t\treturn;\n\t\t}\n\n\t\tflock($fp, LOCK_EX);\n\t\tfwrite($fp, $data);\n\t\tflock($fp, LOCK_UN);\n\t\tfclose($fp);\n\t\tchmod($filepath, DIR_WRITE_MODE);\n\n\t\t// print(\"<!-- Cache file written: \" . $filepath . \" -->\\n\");\n\t\tlog_message('debug', \"Cache file written: \" . $filepath);\n\t}", "public function saveToCache(){\r\n\t\t$n = \"hotspot_\" . $this->id;\r\n\r\n\t\t\\CacheHandler::setToCache($n,$this,20*60);\r\n\t}", "private static function _createCacheFile() {\r\n $paths = array();\r\n $paths['apps'] = File::getDirectoriesNames(ZEEYE_APPS_PATH);\r\n $paths['libs'] = File::getDirectoriesNames(ZEEYE_LIBS_PATH);\r\n File::write(ZEEYE_TMP_PATH . self::CACHE_FILE_PATH, '<?php ' . PHP_EOL . '$paths = ' . var_export($paths, true) . ';');\r\n self::$_hasCacheFile = true;\r\n }", "private function persistCache(array $cache) {\r\n\t\t$cacheFolder = $this->getCacheFolder ();\r\n\t\tif (! is_dir ( $cacheFolder )) {\r\n GeneralUtility::mkdir ( $cacheFolder );\r\n\t\t}\r\n GeneralUtility::writeFile ( $this->getCacheFilePath (), serialize ( $cache ) );\r\n\t}", "protected function saveToPackageCache() {}", "function cacheFile($dir, $file, $data)\n{\n if (!Config::Caching)\n return;\n\n debug('Cache', \"Saving $file to $dir local storage\");\n\n $path = pathJoin([$dir, $file]);\n file_put_contents($path, $data);\n chmod($path, 0666);\n}", "function writeCacheObject ($contents)\n {\n $fp = fopen ($this->cacheObjectId, 'w');\n if ($fp != FALSE) {\n if (fputs ($fp, $contents)) {\n fclose($fp);\n $return = TRUE;\n } else {\n $return = FALSE;\n }\n } else {\n $return = FALSE;\n }\n\n return $return;\n }", "protected function createCacheFile()\n {\n $this->createCacheDir();\n\n $cacheFilePath = $this->getCacheFile();\n\n if ( ! file_exists($cacheFilePath)) {\n touch($cacheFilePath);\n }\n }", "public function save()\r\n\t{\r\n\t\t$this->getCache()->save($this->key, ob_get_flush(), $this->frame);\r\n\t\t$this->key = $this->frame = NULL;\r\n\t}", "protected function cacheSave() {\n $data = array();\n foreach ($this->properties as $prop) {\n $data[$prop] = $this->$prop;\n }\n //cache_set($this->id, $data, 'cache');\n }", "function _write_cache($output){\n return false;\n\n return parent::_write_cache($output);\n }", "public function cache()\n {\n\n $route = Route::requireRoueFiiles();\n if (file_put_contents($this->cacheFile, serialize($route))) {\n echo 'OK';\n } else {\n echo 'ERROR';\n }\n }", "public function cache() {\r\n\t\t$key = $this->cacher.'.' . $this->hash();\r\n\t\tif (($content = pzk_store($key)) === NULL) {\r\n\t\t\t$content = $this->getContent();\r\n\t\t\tpzk_store($key, $content);\r\n\t\t}\r\n\t\techo $content;\r\n\t}", "public function flushCache();", "public function saveElement(CacheElement $element)\n {\n $path = $element->getPath() . '/index.' . $element->getType(); //Type contains extension\n\n return $this->finder->writeFile($path, $element->getContent());\n }", "public function cacheModuleToFile() {\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->order = 'name ASC';\n\t\t$modules = ComModules::model()->findAll($criteria);\n\t\t$arrayModule = '';\n\n\t\tforeach($modules as $module) {\n\t\t\t$arrayModule .= $module->name . \"\\n\";\n\t\t}\n\t\t$filePath = Yii::getPathOfAlias('application.config');\n\t\t$fileHandle = fopen($filePath.'/cache_module.php', 'w');\n\t\tfwrite($fileHandle, $arrayModule);\n\t\tfclose($fileHandle);\n\t}", "function cache($type, $parameters, $data)\n{\n if($type == 'browse')\n $filename = CACHE.'/browse.'.$parameters['browsenode'].'.'.$parameters['page'].'.'.$parameters['mode'].'.dat';\n if($type == 'search')\n $filename = CACHE.'/search.'.$parameters['search'].'.'.$parameters['page'].'.'.$parameters['mode'].'.dat';\n if($type == 'asin')\n $filename = CACHE.'/asin.'.$parameters['asin'].'.'.$parameters['mode'].'.dat';\n \n $data = serialize($data);\n \n $fp = fopen($filename, 'wb');\n if(!$fp||(fwrite($fp, $data)==-1))\n {\n echo ('<p>Error, could not store cache file');\n }\n fclose($fp);\n}", "public function flush()\n {\n if (file_exists($this->CacheFolder . \"/\" . $this->CacheIndex)) {\n unlink($this->CacheFolder . \"/\" . $this->CacheIndex);\n touch($this->CacheFolder . \"/\" . $this->CacheIndex);\n }\n if (file_exists($this->CacheFolder . \"/\" . $this->CacheDB)) {\n unlink($this->CacheFolder . \"/\" . $this->CacheDB);\n touch($this->CacheFolder . \"/\" . $this->CacheDB);\n }\n }", "private function flush_maps()\r\n {\r\n $fp = fopen(Mapprovider::MAP_STORAGE, \"w\");\r\n fwrite($fp, serialize($this->maps));\r\n fclose($fp);\r\n }", "protected function setCache()\n {\n if ($this->cache) {\n $cacheFile = $this->getCacheFile();\n $this->setupCachePath($cacheFile);\n file_put_contents($cacheFile, $this->templateOutput);\n }\n }", "protected function writeTypes() {\n foreach ($this->cache as $type => $cache) {\n $file = $this->getTypeFile($type);\n\n if (empty($cache)) {\n if ($file->exists()) {\n $file->delete();\n }\n\n continue;\n }\n\n $output = serialize($cache);\n\n $file->write($output);\n }\n }", "public static function internal_cache_save()\n {\n if (! is_array(self::$write_cache)) {\n return false;\n }\n\n // Get internal cache names\n $caches = array_keys(self::$write_cache);\n\n // Nothing written\n $written = false;\n\n foreach ($caches as $cache) {\n if (isset(self::$internal_cache[$cache])) {\n // Write the cache file\n self::cache_save($cache, self::$internal_cache[$cache], self::$configuration['core']['internal_cache']);\n\n // A cache has been written\n $written = true;\n }\n }\n\n return $written;\n }", "private static function writeCacheFile($file, $content)\n {\n $dir = dirname($file);\n if (!is_writable($dir)) {\n throw new \\RuntimeException(sprintf('Cache directory \"%s\" is not writable.', $dir));\n }\n\n $tmpFile = tempnam($dir, basename($file));\n\n if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) {\n @chmod($file, 0666 & ~umask());\n\n return;\n }\n\n throw new \\RuntimeException(sprintf('Failed to write cache file \"%s\".', $file));\n }", "private function writeAppData()\n {\n $fileName = \"{$this->storeDirectory}/appData.json\";\n $data = json_encode([\n 'default-counter' => $this->defaultCounter,\n ]);\n file_put_contents($fileName, $data, JSON_PRETTY_PRINT);\n }", "public function store()\n {\n $classes = [];\n\n foreach ($this->classes as $class) {\n $classes[] = $class['input_file'];\n }\n\n $json_classes = json_encode($classes);\n\n $this->filesystem->put(config('larinterface.cache_directory') . '/larinterface.json', $json_classes);\n }", "private static function writeCacheFile (FilePath $cacheFile) {\r\n // Let me 'touch' you before, just to check permissions;\r\n if ($cacheFile->touchPath ()) {\r\n // Just dump the content, use file_put_contents, because it's faster;\r\n $cacheFile->putToFile (self::getContentFromOutputStream ());\r\n return new B (TRUE);\r\n } else {\r\n self::renderScreenOfDeath (new S (__CLASS__),\r\n new S (CANNOT_WRITE_CACHE_FILE),\r\n new S (CANNOT_WRITE_CACHE_FILE_FIX));\r\n }\r\n }", "public function write($key, $data) {\n $cache = Zend_Registry::get('CacheFrontend');\n // include the current version in the cached results\n $version = (int)$cache->load($this->_versionKey);\n // save the data to cache but include the version number\n return $cache->save(\n array(\n 'data' => $data,\n 'version' => $version\n ),\n $key\n );\n }", "function _cache_put ($cache_name = \"\", $data = null) {\n\t\tif (is_null($data)) {\n\t\t\t$data = [];\n\t\t}\n\t\t$cache_file_path = $this->_prepare_cache_path($cache_name);\n\t\t$this->_put_cache_file($data, $cache_file_path, $data);\n\t}", "public function write(string $key, $value): bool\n {\n if ($value === '') {\n return false;\n }\n if ($this->config['serialize'] === true) {\n $value = serialize($value);\n }\n\n $cacheFile = $this->config['path'] . '/' . $this->key($key);\n $exists = file_exists($cacheFile);\n \n $result = (bool) file_put_contents($cacheFile, $value, LOCK_EX);\n\n if (! $exists) {\n $this->applyPermissions($cacheFile);\n }\n \n return $result;\n }", "public function write();", "public function write();", "public function save($cache_name, $cache_data, $expires);", "private function save_cache() : bool {\n\t\tif ($this->use_cache) {\n\t\t\tif (!$this->cache_path) {\n\t\t\t\tthrow new Exception('Cannot save cache when $cache_path is not set.');\n\t\t\t}\n\n\t\t\tfile_put_contents($this->cache_path, json_encode($this->posts, JSON_UNESCAPED_UNICODE));\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function writeToCache(CacheObject $object) {\n $type = $object->getType();\n $id = $object->getId();\n\n $this->readType($type);\n\n if (!array_key_exists($type, $this->cache)) {\n $this->cache[$type] = array();\n }\n\n $this->cache[$type][$id] = $object;\n }", "public function cache($key, $value) {\n\t\t$file = new File($this->getCacheFile($key));\n\t\t$file->setChmod(0755);\n\t\t$file->setContent($value);\n\t\t$success = $file->write();\n\t\tif(!$success) {\n\t\t\tthrow new BaseException('Cannot cache content in \"'.$file->getFullname().'\" : file is not writeable');\n\t\t}\n\t}", "public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\t$dest = $this->getStorageFile();\n\t\t\t\n\t\t\tif(file_exists($dest) and is_writable($dest)===false)\n\t\t\t{\n\t\t\t\t@chmod($dest,0777);\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dest,$this->mode);\n\t\t\tfwrite($fp,$this->data);\n\t\t\tfclose($fp);\n\t\t\t$this->afterSave();\n\t\t}\n\t}", "function update_cache($cache_url, $cache_data){\n\t\t$fh = fopen($cache_url, 'w')or die(\"Error opening output file\");\n\t\tfwrite($fh, json_encode($cache_data,JSON_UNESCAPED_UNICODE));\n\t\tfclose($fh);\n\t}", "public function save(): void\n {\n foreach ($this->getChunks() as $chunk) {\n $this->getFile()->seek(0, SeekType::SEEK_END);\n $chunk->setOffset($this->getFile()->tell() / 4096);\n $chunkData = $chunk->getChunkData();\n $this->getFile()->write($chunkData);\n $this->getFile()->seek($this->calcOffset($chunk->getCoordinates()),\n SeekType::SEEK_SET\n );\n $chunkLocation = $chunk->getLocation();\n $this->getFile()->write($chunkLocation);\n }\n }", "public function flushCaches() {}", "abstract function cache_output();", "private function saveFileToCache(FileInterface $file)\n {\n $cachedPath = \\sys_get_temp_dir() . self::CACHE_DIR . $file->getRelativePath();\n\n if (!\\is_dir(\\dirname($cachedPath))) {\n \\mkdir(\\dirname($cachedPath), 0700, true);\n }\n\n $cmd = \\sprintf('git show :%s > %s', $file->getRelativePath(), $cachedPath);\n $process = new Process($cmd);\n $process->run();\n\n $file->setCachedPath($cachedPath);\n\n return $file;\n }", "protected function saveToCache($data)\r\n {\r\n if(extension_loaded('apc') && ini_get('apc.enabled')) {\r\n apc_store($this->getCacheKey(), $data, 0);\r\n }\r\n }", "public function WriteCache($siteId, $content)\n\t{\n\t\t$name = $this->cacheBaseDir . '/ebaydetails_' . $siteId . '.xml';\n\n\t\tif (!is_dir($this->cacheBaseDir)) {\n\t\t\tif (!isc_mkdir($this->cacheBaseDir)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (!$this->fileHandler->CheckDirWritable($this->cacheBaseDir)) {\n\t\t\tisc_chmod($this->cacheBaseDir, ISC_WRITEABLE_DIR_PERM);\n\t\t}\n\n\t\t// Create a file if it's not exist\n\t\tif (!is_file($name)) {\n\t\t\ttouch($name);\n\t\t}\n\t\treturn $this->fileHandler->WriteToFile($content, $name);\n\t}", "private function generate_solr_cache()\r\n\t{\r\n\t\tfile_put_contents($this->solr_cache_file, $this->solr_stream);\r\n\t}", "public function pf_writeToCache($strCacheName, $strCacheKey, $vCacheMe)\r\n\t{\r\n\t\tif ($this->isDisabled)\r\n\t\t{\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\t\r\n\t\t$strFile = $this->pf_getCacheFileName($strCacheName, $strCacheKey);\r\n\t\t$strDir = dirname($strFile);\r\n\t\tif (!is_dir($strDir) && !mkdir($strDir, 0777, true))\r\n\t\t{\r\n\t\t\ttrigger_error(\"writeToCache failed upon creating directory for $strCacheName[$strCacheKey]\");\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif (!file_put_contents($strFile ,\"<?php\\n\\$vCachedValued = \\n\".var_export ($vCacheMe, true).\";\\n?>\"))\r\n\t\t{\r\n\t\t\ttrigger_error(\"writeToCache failed for $strCacheName[$strCacheKey]\");\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn 1;\r\n\t}", "public function save() {\n $tmpHandle = new \\SplFileObject('php://temp', 'w+');\n $tmpData = '';\n\n $tmpHandle->fputcsv($this->model->columns());\n\n foreach($this->all() as $record) {\n $tmpHandle->fputcsv($record->toArray());\n $record->exists = true;\n }\n\n $tmpHandle->rewind();\n\n while ( ! $tmpHandle->eof()) {\n $tmpData .= $tmpHandle->fgets();\n }\n\n $this->file->flock(\\LOCK_EX | \\LOCK_NB);\n $this->file->ftruncate(0);\n $this->file->rewind();\n $this->file->fwrite($tmpData);\n $this->file->flock(\\LOCK_UN);\n }", "function _put_cache_file ($data = [], $cache_file = \"\") {\n\t\tif (empty($cache_file)) {\n\t\t\treturn false;\n\t\t}\n\t\tif ($this->USE_MEMCACHED) {\n// TODO\n//\t\t\t$cache_key = basename($cache_file);\n//\t\t\t$this->MC_OBJ->put($cache_key, $data, $this->CACHE_TTL);\n\t\t// Common (files-based) cache code\n\t\t} else {\n\t\t\tforeach ((array)$data as $k => $v) {\n\t\t\t\t$file_text .= \"\\t'\".$this->_put_safe_slashes($k).\"' => \";\n\t\t\t\t$file_text .= is_array($v) ? $this->_create_array_code($v) : \"'\".$this->_put_safe_slashes($v).\"',\";\n\t\t\t\t$file_text .= \"\\r\\n\";\n\t\t\t}\n\t\t\tfile_put_contents($cache_file, $this->_auto_header. \"\\$data = array(\\r\\n\".$file_text.\");\". $this->_auto_footer);\n\t\t}\n\t}", "public function saveData($datas){\n\t\t// large input data.\n\t\t$writeStream = file_put_contents($this->getCacheFile(), serialize($datas));\n\n\t\tif($writeStream === false) {\n\t\t\tthrow new \\Exception('Cannot write the cache... Do you have the right permissions ?');\n\t\t}\n\n\t\treturn $this;\n\t}", "private function CacheSave($image, $file)\n {\n switch($this->saveAs) {\n case 'jpeg':\n case 'jpg':\n if($this->verbose) { self::verbose(\"Saving image as JPEG to cache using quality = {$this->quality}.\"); }\n imagejpeg($image, $file, $this->quality);\n break;\n\n case 'png':\n if($this->verbose) { self::verbose(\"Saving image as PNG to cache.\"); }\n // Turn off alpha blending and set alpha flag\n imagealphablending($image, false);\n imagesavealpha($image, true);\n imagepng($image, $file);\n break;\n\n default:\n self::errorMessage('No support to save as this file extension.');\n break;\n }\n if($this->verbose) {\n clearstatcache();\n $cacheFilesize = filesize($file);\n self::verbose(\"File size of cached file: {$cacheFilesize} bytes.\");\n $filesize = $this->imgInfo['filesize'];\n self::verbose(\"Cache file has a file size of \" . round($cacheFilesize/$filesize*100) . \"% of the original size.\");\n }\n }", "public function write()\n {\n if (!$this->fileExists) {\n throw new AccessLayerException(sprintf(\"Table file %s does not exists!\", $this->path));\n }\n\n file_put_contents($this->path, $this->data->write());\n }", "public function cache() {\r\n\t\t$this->resource->cache();\r\n\t}", "function write() {\n\t\t$this->readychk();\n\t\tif (!is_dir($this->dir_path)) { mkdir($this->dir_path); }\n\t\tif (!is_dir($this->asset_path)) { mkdir($this->asset_path); }\n\n\t\t$cstr = json_encode($this->export(TRUE, TRUE));\n\t\tif (\n\t\t\t$cstr === FALSE &&\n\t\t\tjson_last_error() !== JSON_ERROR_NONE\n\t\t) { throw new IntException(\"Slide config encoding failed.\"); }\n\t\tfile_lock_and_put($this->conf_path, $cstr);\n\t}", "function set($name,$content=''){\n $name = md5($name);\n $file = $this->_tmp_path.$this->_type.$name.'.cache';\n $u = umask(0);\n $fh = fopen($file, 'w') or die(\"impossível obter a cache $name. Permissões não definidas\");\n @fwrite($fh, serialize($content));\n fclose($fh);\n umask($u);\n }", "public static function flush()\n\t\t{\n\t\t\tself::getCache()->flush();\n\t\t}", "protected function _write() {}", "public function write() {\n\n try {\n $this->open();\n $sessionData = session_encode(); // Returns an encoded string containing the session data.\n $fileHandle = fopen(self::FILEPATH, \"w+\"); // Open the file\n fwrite($fileHandle, $sessionData); // Write the session data to file\n fclose($fileHandle);\n }\n catch(SessionException $e) {\n echo \"Error writing session to file: \" . $e->getMessage();\n }\n }", "public function writeToCache($ID, Image $pChartObject)\n {\n /* Compute the paths */\n $TemporaryFile = tempnam($this->CacheFolder, \"tmp_\");\n $Database = $this->CacheFolder . \"/\" . $this->CacheDB;\n $Index = $this->CacheFolder . \"/\" . $this->CacheIndex;\n /* Flush the picture to a temporary file */\n imagepng($pChartObject->Picture, $TemporaryFile);\n\n /* Retrieve the files size */\n $PictureSize = filesize($TemporaryFile);\n $DBSize = filesize($Database);\n\n /* Save the index */\n $Handle = fopen($Index, \"a\");\n fwrite($Handle, $ID . \",\" . $DBSize . \",\" . $PictureSize . \",\" . time() . \",0\\r\\n\");\n fclose($Handle);\n\n /* Get the picture raw contents */\n $Handle = fopen($TemporaryFile, \"r\");\n $Raw = fread($Handle, $PictureSize);\n fclose($Handle);\n\n /* Save the picture in the solid database file */\n $Handle = fopen($Database, \"a\");\n fwrite($Handle, $Raw);\n fclose($Handle);\n\n /* Remove temporary file */\n unlink($TemporaryFile);\n }", "public function write($path, $data);", "protected function writeSitemap()\n {\n $this->mOutput->writeln(__METHOD__);\n\n //generate the other sitemaps\n $lRenderParams = array();\n $lRenderParams[\"urls\"] = $this->mCurrentSitemap;\n $lRenderParams[\"serverName\"] = \"http://\" . $this->mServerName;\n $lResult = $this->getContainer()->get('templating')->render('WegeooWebsiteBundle:Default:sitemap.xml.twig', $lRenderParams);\n //$output->writeln($lResult);\n\n $lSitemapPath = sprintf(\"%s/sitemap%s.xml\" , self::SITEMAP_DIRECTORY , $this->mNumSitemaps++);\n $lSuccess = file_put_contents($lSitemapPath , $lResult);\n if ( $lSuccess !== FALSE)\n {\n $this->mOutput->writeln(sprintf(\"Sitemap '%s' Successfully Created\" , basename($lSitemapPath)));\n }else{\n $this->mOutput->writeln(\"ERROR: Sitemapindex '%s' not Created\" , basename($lSitemapPath));\n }\n }", "protected function writefile($file){\n if(!is_writable($this->cache)){\n throw new \\RuntimeException(\"$this->cache no is writable dir\");\n }\n $text = \"<?php\\nreturn \".var_export($this->_conf[$file], TRUE).\";\\n?>\";\n return file_put_contents($this->cacheName($file), $text);\n }", "public function store($data)\n {\n $filename = $this->_absolutePath;\n //Create your own folder in the cache directory\n $fs = new Filesystem();\n try {\n $fs->dumpFile($filename, $this->_encrypt($data));\n } catch (IOException $e) {\n echo \"An error occured while creating your directory\";\n }\n\n return $data;\n }", "private function storeCacheSetting()\n {\n Cache::forever('setting', $this->setting->getKeyValueToStoreCache());\n }", "public function rebuildCache()\r\n {\r\n $themes = $this->scanJsonFiles();\r\n // file_put_contents($this->cachePath, json_encode($themes, JSON_PRETTY_PRINT));\r\n\r\n $stub = file_get_contents(__DIR__ . '/stubs/cache.stub');\r\n $contents = str_replace('[CACHE]', var_export($themes, true), $stub);\r\n file_put_contents($this->cachePath, $contents);\r\n }", "public function save()\n {\n if ($this->createDirectoryStructure($this->getPath())) {\n $content = $this->generateContents();\n file_put_contents($this->getPathname(), $content);\n }\n }", "public function saveToCache($minutes);", "protected function writeControllerCache( $controller, & $content, $controllername )\n {\n $_cache_expire = $controller->getCacheExpire( $controllername );\n // write view content to cache if cache enabled\n if($_cache_expire != 0)\n {\n $this->cache->cacheWrite( $content );\n }\n }", "public function writeCache($sCacheData = false) {\n\t\tif(isset($sCacheData) && strlen($sCacheData) > 0) {\n\t\t\tif(file_put_contents($this -> sCacheDir . $this -> sCacheFile, $sCacheData)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function cacheFile()\n\t{\n\t\t$data[] = \"<?php\";\n\t\t$data[] = \"defined('LUNA_SYSTEM') or die('Hacking attempt!');\\n\";\n\n\t\t$routes = Route::orderBy('type')->orderBy('controller')->get()->toArray();\n\n\t\tif (!empty($routes)) {\n\t\t\tforeach ($routes as $route) {\n\t\t\t\t$call_back = isset($route['action']) ? $route['controller'] . \":\" . $route['action'] : $route['controller'];\n\t\t\t\tif (!isset($route['method'])) {\n\t\t\t\t\t$data[] = '$app->get(\"' . $route['route'] . '\", \"' . $call_back . '\");';\n\t\t\t\t} else {\n\t\t\t\t\t$methods = explode(',', preg_replace('/\\s+/', '', $route['method']));\n\t\t\t\t\tforeach ($methods as $method) {\n\t\t\t\t\t\t$data[] = '$app->' . strtolower($method) . '(\"' . $route['route'] . '\", \"' . $call_back . '\");';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$output = implode(\"\\n\", $data);\n\n\t\twrite_file(LUNA_CACHEPATH . \"/data/routes.php\", $output);\n\t}", "protected function build_sitemap_root_cache_file() {\n\n\t\t$sitemap_content = $this->build_sitemap_root();\n\n\t\t\\file_put_contents( // phpcs:ignore\n\t\t\t$this->get_sitemap_root_cache_file_path(),\n\t\t\t$sitemap_content\n\t\t);\n\n\t}", "protected function store()\n\t{\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\n\t\t//throw new Exception(\"Not yet implemented!\");\n\t\t\t\t//---------------------\n\n $domDoc = new DOMDocument;\n $rootElt = $domDoc->createElement('items');\n $rootNode = $domDoc->appendChild($rootElt);\n\n foreach($this->_data AS $row) {\n $rowElement = $domDoc->createElement('item');\n\n foreach($row AS $key => $value) {\n\n $element = $domDoc->createElement($key);\n $element->appendChild($domDoc->createTextNode($value));\n\n $rowElement->appendChild($element);\n }\n $rootNode->appendChild($rowElement);\n\n }\n\n $data = $domDoc->saveXML();\n\n //var_dump($data);\n\n file_put_contents($this->_origin, $data);\n\n\t\t// --------------------\n\t}" ]
[ "0.793286", "0.7824172", "0.7446897", "0.7433242", "0.7356845", "0.7089082", "0.70800936", "0.70722455", "0.7057314", "0.7010803", "0.69388497", "0.6926107", "0.68939644", "0.6783644", "0.6781111", "0.6760235", "0.6728319", "0.6723056", "0.6682405", "0.66091603", "0.65353763", "0.65007144", "0.64862233", "0.6485734", "0.64808524", "0.6479487", "0.64662963", "0.6419254", "0.6394904", "0.6324179", "0.6297769", "0.6289546", "0.6275479", "0.6221616", "0.62092865", "0.6188811", "0.6118721", "0.61136067", "0.6085071", "0.6058842", "0.6022813", "0.60168475", "0.5991915", "0.599031", "0.5978901", "0.5973441", "0.5972225", "0.59558386", "0.5952831", "0.5935687", "0.59293157", "0.590528", "0.5901747", "0.5894921", "0.5885092", "0.587967", "0.5853625", "0.58479905", "0.5812892", "0.58117944", "0.58117944", "0.5803441", "0.57961625", "0.5778623", "0.57602257", "0.5754796", "0.57412004", "0.57400244", "0.57269794", "0.57207996", "0.5714561", "0.5686026", "0.56799906", "0.5675368", "0.56752676", "0.5666625", "0.56525344", "0.56468755", "0.5641656", "0.5637427", "0.5634718", "0.56234723", "0.5621437", "0.5615311", "0.5607827", "0.5601436", "0.5594113", "0.5542575", "0.55335325", "0.5532361", "0.5528282", "0.55185187", "0.55090183", "0.5502707", "0.5501006", "0.54920125", "0.5490341", "0.5483932", "0.5471926", "0.5470212" ]
0.6271228
33
Checks for empty variable and shows language variable if possible.
function lang($var) { global $lang; if(substr($var, 0, 2) === 'L_') { $var = substr($var, 2); // check variable as it is if(isset($lang[$var])) { return $lang[$var]; } // check variable in lower case if(isset($lang[strtolower($var)])) { return $lang[strtolower($var)]; } // check variable with first letter in upper case $str = ucfirst(strtolower($var)); if(isset($lang[$str])) { return $lang[$str]; } return ''; //str_replace('_', ' ', $var); } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function locale_variable_language_default_format($variable, $options = array()) {\n return !empty($variable['value']) ? check_plain($variable['value']->name) : t('None');\n}", "function lang($variable, $default_text, $lang=''){\n\t\t\t\tglobal $eventon_rs;\n\t\t\t\treturn $eventon_rs->lang($variable, $default_text, $lang);\n\t\t\t}", "public function isVariableTexto(){ return false; }", "function __($phrase){\n\tglobal $lg_contenidos;\n\t\n\t// Chequea que exista la frase en el array\n\tif(isset($lg_contenidos[$phrase])) { echo $lg_contenidos[$phrase]; }\n\telse {\n\t\tif (DEVELOPE) { echo '???'; }\n\t}\n\t\n}", "public function getLanguageInfoEmpty(): ?string {\n\t\treturn (string)$this->_getConfig('language.infoEmpty');\n\t}", "function final_status_hook() {\n\t$missing = '';\n\tif (isset($_SESSION['exp_missing_titles']) and is_array($_SESSION['exp_missing_titles'])) {\n\t\tforeach ($_SESSION['exp_missing_titles'] as $title => $is_missing) {\n\t\t\tif (!$is_missing)\n\t\t\t\tcontinue;\n\n\t\t\t$missing .= '<li>“' . $title . \"”</li>\\n\";\n\t\t}\n\t}\n\n\tif ($missing)\n\t\treturn <<<EOM\nThe following document titles were not translated in every language.<br/>\nThey may be untranslatable:\n<ul>\n$missing</ul>\nEOM;\n\n\treturn '';\n}", "function variable_check($var) {\n\t\t\n\t\t// is variable set?\n\n\t\tif (isset($var)) {\n\t\t\treturn \"$var is set \\n\";\n\t\t}\n\t\t\n\t\telseif (empty($var)) {\n\t\t\treturn \"$var is not set \\n\";\n\t\t}\n\t\n\n}", "protected function checkIfLanguagesExist() {}", "function us_wpml_tr_current_language ( $empty_value = NULL ) {\r\n\t\treturn apply_filters( 'wpml_current_language', NULL );\r\n\t}", "function locale_variable_language_element_validate($element, &$form_state, $form) {\n $languages = language_list();\n $language = $languages[$element['#value']];\n form_set_value($element, $language, $form_state);\n}", "function show_error ()\n {\n global $errormessage;\n global $lang;\n global $ts_template;\n if (!empty ($errormessage))\n {\n eval ($ts_template['show_error']);\n }\n\n }", "function us_wpml_tr_default_language ( $empty_value = NULL ) {\r\n\t\treturn apply_filters( 'wpml_default_language', NULL );\r\n\t}", "function make_lang_var()\n\t{\n\t\t// Pfad einbinden\n\t\tglobal $pfad;\n\n\t\t// Backend Sprache\n\t}", "function lang($key = '')\r\n{\r\n\t$CI =& get_instance();\r\n\t$line = $CI->lang->line($key);\r\n\t$line = ($line == '') ? $key : $line;\r\n\treturn $line;\r\n}", "function load_lang() {\n\tglobal $mybb, $lang;\n\t\n\t// prevent non existing language file\n\t$lang->hideforums = 'Hide Forums';\n\t$lang->load('hideforums',false,true);\n}", "public function hasLang() {\n return $this->_has(1);\n }", "public function hasVariableLabel() {\n return $this->_has(8);\n }", "public function getOnEmptyText()\n {\n return sprintf($this->_('No %s found...'), $this->getTopic(0));\n }", "public function incLocalLang() {}", "public function getEmptyText() {\n\t\t$result = $this->ViewExtension->showEmpty('');\n\n\t\treturn $result;\n\t}", "public function getText(string $variable, string $default = '', bool $jsProtect = false) : string\n {\n static $json_lang=array();\n\n if ($json_lang === array()) {\n $aeFiles = \\MarkNotes\\Files::getInstance();\n\n // Load, always, the file in English\n $fname = $this->getFolderAppRoot().'languages/marknotes-'.DEFAULT_LANGUAGE.'.json';\n $json_lang = json_decode($aeFiles->getContent($fname), true);\n\n // Now, if present, load the second file, the\n // selected language (for instance French).\n $lang = $this->getLanguage();\n\n if ($lang!==DEFAULT_LANGUAGE) {\n $fname = $this->getFolderAppRoot().'languages/marknotes-'.$lang.'.json';\n\n if ($aeFiles->exists($fname)) {\n // array_replace_recursive so keys in\n // marknotes-en.json\n // and not in the second file\n // (marknotes-fr.json) are\n // keep and not override. Doing this will\n // allow to be able\n // to show text in english even if not yet\n // translated\n $arr = json_decode($aeFiles->getContent($fname), true);\n $json_lang = array_replace_recursive($json_lang, $arr);\n }\n }\n } // if ($json_lang === array())\n\n $return = isset($json_lang[$variable]) ? $json_lang[$variable] : trim($default);\n\n if ($jsProtect) {\n $return = str_replace(\"'\", \"\\'\", @html_entity_decode($return));\n }\n\n /*<!-- build:debug -->*/\n if (($return==null) && (self::getDebugMode())) {\n $aeDebug = \\MarkNotes\\Debug::getInstance();\n\n $sMsg = \"Translation for \".$variable.\" is missing\";\n $aeDebug->log($sMsg, \"debug\");\n\n if ($aeDebug->getDevMode()) {\n $aeDebug->here(DEV_MODE_PREFIX.$sMsg, 1);\n }\n }\n /*<!-- endbuild -->*/\n\n // In case of null (i.e. the translation wasn't found,\n // return at least the name of the variable)\n return ($return === null?$variable:$return);\n }", "function show_common_vars()\n\t\t{\n\t\t\t$this->message[] = $this->GUI->get_error(false, _DEBUG);\n\t\t\t$this->message[] = $this->runtime->get_error(false, _DEBUG);\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'wf_message'\t=> implode('<br />',array_filter($this->message)),\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function label(): ?ValueLanguage\n {\n return null;\n }", "public function hasLang() {\n return $this->_has(5);\n }", "function locale_variable_options_language($variable, $options) {\n return locale_language_list('name', TRUE);\n}", "public function isVariableCualitativa(){ return false; }", "public function hasLanguage() : bool;", "private function _makeSureThereIsALanguageID()\n {\n if (empty(Session::get('languageID'))) {\n if (strstr(URL::getDomainExtension(), 'localhost')\n || strstr(URL::getDomainExtension(), 'nl')\n ) {\n Session::save('languageID', 1);\n } elseif (strstr(URL::getDomainExtension(), 'com')) {\n Session::save('languageID', 2);\n }\n }\n }", "protected function generateLocalLang() {}", "function display_edit_field() {\n data_field_admin::check_lang_strings($this);\n parent::display_edit_field();\n }", "function lang($key){\n\tglobal $lang;\n\treturn isset($lang[$key])?$lang[$key]:$key;\n}", "public function blank($lang='english')\r\n\t{\r\n\t\t$this->_lang_set($lang);\r\n\t\t$this->load->view('blank');\r\n\t}", "function lang($key)\n{\n\tglobal $lang;\n\t\n\t// Make sure the key is uppercase\n\t$key = strtoupper($key);\n\t\n\t// Does that key exist?\n\tif(!$lang[$key])\n\t{\n\t\t// So we know it needs to be translated.\n\t\treturn '{' . $key . '}';\n\t}\n\telse\n\t{\n\t\treturn $lang[$key];\n\t}\n}", "function L($key)\n{\n global $language;\n if (empty($key)) {\n return '';\n }\n if (isset($language[$key])) {\n return $language[$key];\n }\n return \"[[$key]]\";\n}", "function __($word) {\n global $cfg;\n if (isset($_GET['lang'])) {\n include(\"langs/\".$_GET['lang'].\".php\");\n } else include(\"langs/\".$cfg[\"default_language\"].\".php\"); \n\n return isset($translations[$word]) ? $translations[$word] : $word;\n}", "private function msg($k){\r\n global $language;\r\n\r\n return $language[$k];\r\n\r\n\r\n }", "function AddDetailsForDefaultLang()\n\t{\t$this->AddDetailsForLang($this->def_lang);\n\t}", "function get($key)\r\n\t\t{\r\n\t\t\treturn @$this->lang[$key];\r\n\t\t}", "function getvar($varname){\n\t\t// for example, getvar('name') will return 'name_fr' (provided it exists and is non-empty) in a french context\n\t\t$locname = $varname.'_'.CURLANG;\n\t\t$otherlang = $varname.'_'.(CURLANG=='fr'?'de':'fr');\n\t\tif(isset($this->$locname)){\n\t\t\tif($this->$locname == '' && $this->$otherlang != ''){\n\t\t\t\t// if the current language variable is empty, return the other language's value\n\t\t\t\treturn $this->$otherlang;\n\t\t\t}else{\n\t\t\t\treturn $this->$locname;\n\t\t\t}\n\t\t}elseif(isset($this->$varname)){\n\t\t\treturn $this->$varname;\n\t\t}\n\t\treturn false;\n\t}", "function set_or_empty($a)\n{\n\tif (isset($a)) {\n\t\techo \"Variable is set\" . PHP_EOL;\n\t} else {\n\t\techo \"Variable is empty\" . PHP_EOL;\n\t}\n\treturn;\n}", "function print_lang($name) {\n global $lang;\n echo $lang->get_phrase($name);\n}", "public function globalVarConditionMatchesOnEmptyExpressionWithNoValueSet() {}", "function __($section, $key, $default = null) {\n return LanguageManager::getValue($section, $key, $default);\n}", "public function globalVarConditionMatchesOnEmptyExpressionWithNoValueSet() {}", "public function language();", "public function language();", "function store_lang_exists($key)\n {\n return isset(ee()->lang->language[$key]);\n }", "public function hasText() {\n return !empty($this->text[\\App::getLocale()]);\n }", "function echo_var($var, $type='str')\n\t{\n\t\tif(exists($var))\n\t\t\techo $var;\n\t\telse\n\t\t\tswitch($type)\n\t\t\t{\n\t\t\t\tcase 'str':\n\t\t\t\t\techo '';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'num':\n\t\t\t\t\techo 0; \n\t\t\t\t\tbreak;\n\t\t\t}\t\n\t}", "function line($line = '')\n\t{\n\t\treturn ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line];\n\t}", "public function load() {\n if(isset($_SESSION[Strings::$message]))\n {\n $ret = $_SESSION[Strings::$message];\n\n }\n else\n {\n $ret = Strings::$emptyString;\n }\n\n $_SESSION[Strings::$message] = Strings::$emptyString;\n\n return $ret;\n }", "private function altTextUndefined(): string\n {\n if (function_exists('apply_filters')) {\n return apply_filters($this->createFilterName($this) . '/' . ucfirst(__FUNCTION__), $this->altTextUndefined);\n }\n return $this->altTextUndefined;\n }", "public function formatVariable(){\r\n\t\t\r\n\t\tforeach($this->template as $k=>$v){\r\n\t\t\tif(preg_match('/{\\s+\\$(\\w+)}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'{\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\$(\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\s+\\$(\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'{}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function pnUserGetLang()\r\n{\r\n $lang = pnSessionGetVar('lang');\r\n if (!empty($lang)) {\r\n return $lang;\r\n } else {\r\n return pnConfigGetVar('language');\r\n }\r\n}", "function locale_variable_language_default_element($variable, $options) {\n $element = variable_form_element_options($variable, $options);\n // Default needs to be language code for the radios to work.\n $element['#default_value'] = $element['#default_value']->language;\n // Since 'value callback' is useless as it is run before validation, we use validate\n // callback to transform language code into an object.\n $element['#element_validate'][] = 'locale_variable_language_element_validate';\n return $element;\n}", "function isUnknown( $var );", "function ctools_node_language_ctools_acesss_summary($conf, $context) {\n $languages = array(\n 'current' => t('Current site language'),\n 'default' => t('Default site language'),\n 'no_language' => t('No language'),\n );\n $languages = array_merge($languages, locale_language_list());\n\n if (!isset($conf['language'])) {\n $conf['language'] = array();\n }\n\n $names = array();\n foreach (array_filter($conf['language']) as $language) {\n $names[] = $languages[$language];\n }\n\n if (empty($names)) {\n return t('@identifier is in any language', array('@identifier' => $context->identifier));\n }\n\n return format_plural(count($names), '@identifier language is \"@languages\"', '@identifier language is one of \"@languages\"', array('@languages' => implode(', ', $names), '@identifier' => $context->identifier));\n}", "function common_current_language(){\r\n\tif($_SESSION['lang'] == 'id'){\r\n\t\treturn 'Bahasa Indonesia';\r\n\t}\r\n\telse if($_SESSION['lang'] == 'en'){\r\n\t\treturn 'English';\r\n\t}\r\n}", "function gettitle() {\n\n\t\tglobal $pagetiltle;\n\n\t\tif (isset($pagetiltle)) {\n\n\t\t\techo $pagetiltle;\n\t\t} else {\n\n\t\t\techo lang('DEFAULT');\n\t\t}\n\t}", "public function lang(): string;", "function l(){\n\tglobal $_LOCALE;\n\t\n\t$entry = $_LOCALE;\n\t$args = func_get_args();\n\t\n\tfor($i = 0; $i < count($args); $i++){\n\t\t$key = $args[$i];\n\t\tif ( array_key_exists($key, $entry) ) {\n\t\t\t$entry = $entry[$key];\n\t\t\tif ( ! is_array($entry) )\n\t\t\t\tbreak;\n\t\t} else {\n\t\t\t$entry = 'Missing entry in language file: ' . join(' → ', array_slice($args, 0, $i + 1));\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t$format_args = array_slice($args, $i + 1);\n\treturn (is_string($entry) and count($format_args) > 0) ? vsprintf($entry, $format_args) : $entry;\n}", "function showEmptyListMessage()\n {\n // TRANS: Empty list message for user directory.\n $this->element('p', 'error', _m('Sin resultados.'));\n // TRANS: Standard search suggestions shown when a search does not give any results.\n $message = _m(\"* Vuelve a intentarlo cambiando los criterios de búsqueda.\");\n $message .= \"\\n\";\n\n $this->elementStart('div', 'help instructions');\n $this->raw(common_markup_to_html($message));\n $this->elementEnd('div');\n \n }", "public function getDefaultLanguage() : ?string;", "function isEmpty($record)\n {\n $languages = $this->getLanguages();\n for ($i=0,$_i=count($languages);$i<$_i;$i++)\n {\n if(isset($record[$this->fieldName()][$languages[$i]])) return 0;\n }\n\n return 1;\n }", "protected function getLanguageParameter() {}", "function lang($key,$markers = NULL) // this is everywhere\r\n// key would be something like ACCOUNT_USER_OR_PASS_INVALID => Username or password is invalid\r\n{ \r\n\r\n\tglobal $lang;\r\n\r\n\tif($markers == NULL)\r\n\r\n\t{\r\n\r\n\t\t$str = $lang[$key]; // this would be something like \"Permission level name changed to `%m1%`\"\r\n\r\n\t}\r\n\r\n\telse // markers is not NULL\r\n\r\n\t{\r\n\r\n\t\t//Replace any dynamic markers\r\n\r\n\t\t$str = $lang[$key]; // this would be something like \"Permission level name changed to `%m1%`\"\r\n\r\n\t\t$iteration = 1;\r\n\r\n\t\tforeach($markers as $marker)\r\n\r\n\t\t{\r\n\r\n\t\t\t$str = str_replace(\"%m\".$iteration.\"%\",$marker,$str);\r\n\r\n\t\t\t$iteration++;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//Ensure we have something to return\r\n\r\n\tif($str == \"\")\r\n\r\n\t{\r\n\r\n\t\treturn (\"No language key found\");\r\n\r\n\t}\r\n\r\n\telse\r\n\r\n\t{\r\n\r\n\t\treturn $str;\r\n\r\n\t}\r\n\r\n}", "function translate_variable( $tag )\n{\n global $wgParser, $wgUser;\n \n switch ( strtoupper($tag) ) {\n \n case 'USERGROUPS': // @@USERGROUPS@@ pseudo-variable: Groups this user belongs to\n $wgParser->disableCache(); // Mark this content as uncacheable\n return( implode( \",\", $wgUser->getGroups() ) );\n \n case 'USERID': // @@USERID@@ pseudo-variable: User Name, blank if anonymous\n $wgParser->disableCache(); // Mark this content as uncacheable\n # getName() returns IP for anonymous users, so check if logged in first\n return( $wgUser->isLoggedIn() ? $wgUser->getName() : '' );\n \n }\n}", "function show_ProductVariables($product_id)\n\t\t{\n\t\t\tglobal $db,$ecom_siteid;\n\t\t\t//$_REQUEST['product_id'] = $product_id;\n\t\t\t// ######################################################\n\t\t\t// Check whether any variables exists for current product\n\t\t\t// ######################################################\n\t\t\t$sql_var = \"SELECT var_id,var_name,var_value_exists, var_price \n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\tproduct_variables \n\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\tproducts_product_id = \".$product_id.\" \n\t\t\t\t\t\t\tAND var_hide= 0\n\t\t\t\t\t\tORDER BY \n\t\t\t\t\t\t\tvar_order\";\n\t\t\t$ret_var = $db->query($sql_var);\n\t\n\t\t\t\n\t\t\tif ($db->num_rows($ret_var))\n\t\t\t{\n\t\t\t\t\n\t\t ?>\n\t\t\t\t\n\t\t\t\t<?php\n\t\t\t\t\t// Case of variables\n\t\t\t\t\tif ($db->num_rows($ret_var) or $db->num_rows($ret_msg))\n\t\t\t\t\t{\n\t\t\t\t\t\twhile ($row_var = $db->fetch_array($ret_var))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($row_var['var_value_exists']==1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// check whether values exists current variable\n\t\t\t\t\t\t\t\t$sql_vals = \"SELECT var_value_id, var_addprice,var_value \n\t\t\t\t\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\t\t\tproduct_variable_data \n\t\t\t\t\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\t\t\t\tproduct_variables_var_id =\".$row_var['var_id'].\" \n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY \n\t\t\t\t\t\t\t\t\t\t\t\t\tvar_order\";\n\t\t\t\t\t\t\t\t$ret_vals = $db->query($sql_vals);\n\t\t\t\t\t\t\t\tif ($db->num_rows($ret_vals))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$var_Proceed = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$var_Proceed = true;\n\t\t\t\t\t\t\tif ($var_Proceed)// Show the variable if it is valid to show\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($row_var['var_value_exists']==1)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$var_vals='';\n\t\t\t\t\t?>\n\t\t\t\t\t\t\t <span style=\"display:block\"><strong><?php echo stripslashes($row_var['var_name'])?>:</strong>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\twhile ($row_vals = $db->fetch_array($ret_vals))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t//echo stripslashes($row_vals['var_value']).\",\";\n\t\t\t\t\t\t\t\t\t\t\t\tif($var_vals!='')\n\t\t\t\t\t\t\t\t\t\t\t\t$var_vals .= \",\".$row_vals['var_value'];\n\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t$var_vals = $row_vals['var_value'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\techo $var_vals;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t/*?>\n\t\t\t\t\t\t\t\t\t\t\t<select name=\"var_<?php echo $row_var['var_id']?>\">\n\t\t\t\t\t\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\t\t\t\t\t\twhile ($row_vals = $db->fetch_array($ret_vals))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo $row_vals['var_value_id']?>\"><?php echo stripslashes($row_vals['var_value'])?><?php echo Show_Variable_Additional_Price($row_vals['var_addprice'])?></option>\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t</select>\t\t\t*/\t?>\t</span>\t\t\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t?> \n\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t// ######################################################\n\t\t\t\t// End of variables section\n\t\t\t\t// ######################################################\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t?>\t\n\t\t\t\n\t\t\t<?php\n\t\t\t\t\n\t\t\t}\n\t\t}", "function lixgetlang() {\n $lang = 'rus';\n \n if ($_GET[lang] != 'rus' && $_GET[lang] != 'eng' && $_GET[lang] != 'deu') {\n if (lixlpixel_detect_lang() != 'ru') { $lang = 'eng'; }\n else { $lang = 'rus'; }\n } else {\n $lang = $_GET[lang];\n }\n \n return $lang;\n}", "function get_avdelningar_utmanare($lang, $empty=\"\")\t{\r\n\t\t\r\n\t\t$utmanare = array(\"\", \"\", \"\", \"\", \"Seniorerna\", \"\", \"\");\r\n\t\t\r\n\t\tif ('empty'==$empty)\t{\r\n\t\t\t$utmanare = scoutnet_remove_empty_elements($utmanare);\r\n\t\t}\r\n\t\t\r\n\t\tif ('english'==$lang)\t{\r\n\t\t\t$utmanare = scoutnet_convert_array_to_english_letters($utmanare);\r\n\t\t}\t\t\r\n\t\treturn \t$utmanare;\r\n\t}", "function language_select() {\n echo '<select name=\"language\">';\n foreach (Translate::$Languages as $lang => $details) {\n // Print the option\n echo '<option value=\"'.html_entities($lang).'\"';\n if ($_SESSION['language'] == $lang)\n echo ' SELECTED';\n echo '>'.$details[0].'</option>';\n }\n echo '</select>';\n }", "function palabra_largo($variable,$largo){\n\tif (strlen($variable) < $largo) { \n \t\t\t$var\t = 'El dato ingresado debe tener al menos '.$largo.' caracteres';\n\t\t\treturn $var;\n\t}\n}", "function acf_not_empty($var)\n{\n}", "protected function lang($key)\n {\n }", "function whatThat($yourVar){\n if(isset($yourVar)){\n echo 'Exist ';\n if(!empty($yourVar)){\n echo 'Something inside : ';\n if(is_dir($yourVar)){\n echo 'Folder.';\n }if(is_file($yourVar)){\n echo 'File.';\n }if(is_int($yourVar)){\n echo 'Numeric.';\n }if(is_float ($yourVar)){\n echo 'Decimal Number.';\n }if(is_string($yourVar)){\n echo 'String.';\n }if(is_object($yourVar)){\n echo 'Objet.';\n }if(is_array($yourVar)){\n echo 'Array.';\n }if(is_bool($yourVar)){\n echo 'Booléen.';\n }\n }else{\n echo 'Nothing inside.';\n }\n }else{\n echo 'Not Exist.';\n }\n}", "protected function getLocalePlaceholder()\n {\n return TranslationLocaleHelper::VALIDATION_LOCALE_PLACEHOLDER;\n }", "function acf_is_empty($var)\n{\n}", "function lang()\n\t{\n\t\t$args = func_get_args();\n\t\t$key = $args[0];\n\n\t\t$context_vars = $this->context->get_root_ref();\n\n\t\tif (isset($context_vars['L_' . $key]))\n\t\t{\n\t\t\treturn $context_vars['L_' . $key];\n\t\t}\n\n\t\t// LA_ is transformed into lang(\\'$1\\')|escape('js'), so we should not\n\t\t// need to check for it\n\n\t\treturn call_user_func_array(array($this->language, 'lang'), $args);\n\t}", "function __ ($var, $rpl = null)\n{\n global $main;\n if (array_key_exists ($var, $main->template->vars_l))\n {\n if (is_array ($rpl))\n $cnt = vsprintf ($main->template->vars_l[$var], $rpl);\n else\n $cnt = $main->template->vars_l[$var];\n echo $cnt;\n }\n}", "function errorMsg($keyName, $label) {\n\n // PHP checks whether certain keys have been returned with values in the GET Global Super Array, if it has then echo the value into the input field\n if(isset($_GET[$keyName]) && $_GET[$keyName] === '') {\n\n return \"<div class='warning_msg'>Please enter \" . $label . \".</div>\";\n\n } //end if statement\n\n}", "function getEmptyResultLabel(){\n\t\treturn null;\n\t}", "function in_vars($name){ // check the template variable\n\treturn array_key_exists($name, $this->vars);\n}", "function greet(string $name, int $age, string $language = 'malay') // default value\n{\n if ($language == 'english') {\n echo 'Hello, Welcome ' . $name . '!<br />';\n echo 'Your age is ' . $age . '<br />';\n } elseif ($language == 'malay') {\n echo 'Hello, Selamat Datang ' . $name . '!<br />';\n echo 'Umur anda adalah ' . $age . '<br />';\n }\n}", "function required($blurb = '')\n{\n if ($blurb != '') {\n $blurb = lang($blurb);\n }\n\n return \"<em class='required'>* </em>\" . $blurb . \"\\n\";\n}", "function positive_panels_lang(){\n\tload_textdomain('positive-panels', 'lang/positive-panels.mo');\n}", "function userpage_lang($id)\r\n{\r\n\tglobal $AVE_Template;\r\n\r\n\techo $AVE_Template->get_config_vars($id);\r\n}", "static private function CreateLanguageMessage() {\n\t\tif (!IllaUser::loggedIn()) {\n\t\t\t$german_browser = (ereg('de', $_SERVER['HTTP_ACCEPT_LANGUAGE']) ? true : false);\n\t\t}else {\n\t\t\t$german_browser = IllaUser::german();\n\t\t}\n\t\tif (($german_browser && self::isEnglish()) || (!$german_browser && self::isGerman())) {\n\t\t\t$short_filename = substr_replace(basename($_SERVER['PHP_SELF']), '', 0, 2);\n\t\t\t$path = str_replace($short_filename, '', $_SERVER['PHP_SELF']);\n\t\t\t$path = substr_replace($path, '', - 2, 2);\n\n\t\t\tif (count($_GET) > 0) {\n\t\t\t\t$getparams = array();\n\t\t\t\tforeach ($_GET as $key => $value) {\n\t\t\t\t\t$getparams[] = htmlentities($key) . '=' . htmlentities($value);\n\t\t\t\t}\n\t\t\t\t$getparams = '?' . implode('&amp;', $getparams);\n\t\t\t}else {\n\t\t\t\t$getparams = '';\n\t\t\t}\n\n\t\t\tif (self::isEnglish() && file_exists('de' . $short_filename)) {\n\t\t\t\tMessages::add('<a href=\"' . $path . 'de' . $short_filename . $getparams . '\" hreflang=\"de\">Deine bevorzugte Sprache scheint Deutsch zu sein. Klick hier um zur deutschen Fassung dieser Seite zu wechseln.</a>', 'note');\n\t\t\t\tMessages::add('<a href=\"' . $path . 'de' . $short_filename . $getparams . '\" hreflang=\"de\">Your favoured language seems to be German. Click here to view the German version of this page.</a>', 'note');\n\t\t\t} elseif (self::isGerman() && file_exists('us' . $short_filename)) {\n\t\t\t\tMessages::add('<a href=\"' . $path . 'us' . $short_filename . $getparams . '\" hreflang=\"us\">Deine bevorzugte Sprache scheint Englisch zu sein. Klick hier um zur englischen Fassung dieser Seite zu wechseln.</a>', 'note');\n\t\t\t\tMessages::add('<a href=\"' . $path . 'us' . $short_filename . $getparams . '\" hreflang=\"us\">Your favoured language seems to be English. Click here to view the English version of this page.</a>', 'note');\n\t\t\t}\n\t\t}\n\t}", "private function varIsNULL(): void {\r\n\t\t$nullTable = '<table class=\"dBug_table dBug_null\">';\r\n\t\t$nullTable .= '<tr><td class=\"dBug_nullHeader\">NULL Variable</td></tr>'.\"\\n\".'<tr>'.\"\\n\";\r\n\t\t$nullTable .= '</table>'.\"\\n\";\r\n\t\techo $nullTable;\r\n\t}", "function no_items() {\n _e('No template found.');\n }", "function show_untitled_items($title)\n{\n // is empty.\n $prepTitle = trim(strip_formatting($title));\n if (empty($prepTitle)) {\n return __('[Untitled]');\n }\n return $title;\n}", "public function testPreferredEmpty() {\n\t\t$available = ['fr', 'de'];\n\n\t\t$request = new ActionRequest([\n\t\t\t'env' => ['HTTP_ACCEPT_LANGUAGE' => '']\n\t\t]);\n\t\t$result = Locale::preferred($request, $available);\n\t\t$this->assertNull($result);\n\t}", "function __($string) {\n global $LANG;\n return empty($LANG['def'][$string]) ? $string : $LANG['def'][$string];\n}", "function l ($str) {\r\n\t$reval \t= $str;\r\n\t$path \t= PATH_THEME . 'lang/' . $GLOBALS['cfg']['def_lang'] . '.php';\r\n\tif (file_exists($path)) {\r\n\t\trequire $path;\r\n\t\tif (isset($lang[$str])) {\r\n\t\t\tif ( $lang[$str] != '' ) {\r\n\t\t\t\t$reval = $lang[$str];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $reval;\r\n}", "function langEcho($string, $language = '', $lower = false, $replace = array(), $deleteEnters = false){\n\tGLOBAL $LANG;\n\tGLOBAL $DEFAULTLANG;\n\t$langToUse = $LANG;\n\tif ($language && ($language != getLanguage()) && languageEnabled($language)) {\n\t\t$langToUse = includeLanguage($language);\n\t}\n\t$key = $string;\n\tif($lower){\n\t\t$key = strtolower($string);\n\t}\n\tif($langToUse && array_key_exists($key, $langToUse)){\n\t\t$string = $langToUse[$key];\n \t}\n\telse if (array_key_exists($key, $DEFAULTLANG)){\n \t\t$string = $DEFAULTLANG[$key];\n \t}\n\n \tif($replace){\n \t\t$matches = array();\n \t\tpreg_match_all(\"/{_([^}]*)_}/\", $string, $matches);\n\n \t\t$valuesToSearch = array();\n \t\tforeach($matches[1] as $match){\n \t\t\t$parts = explode(\".\", $match);\n \t\t\t$entity = \"\";\n \t\t\t$attribute = \"\";\n\n \t\t\tif(count($parts) > 1){\n \t\t\t\t$entity = $parts[0];\n \t\t\t\t$attribute = $parts[1];\n \t\t\t}else{\n \t\t\t\t$entity = \"custom_variables_without_entity\";\n \t\t\t\t$attribute = $parts[0];\n \t\t\t}\n\n \t\t\tif(!array_key_exists($entity, $valuesToSearch)){\n \t\t\t\t$valuesToSearch[$entity] = array();\n \t\t\t}\n \t\t\t$valuesToSearch[$entity][] = $attribute;\n \t\t}\n\n \t\tforeach($valuesToSearch as $entity => $attributes){\n\n \t\t\t$replaceEntity = null;\n \t\t\tif($entity == \"custom_variables_without_entity\"){\n \t\t\t\tforeach($attributes as $attribute){\n\t \t\t\t\tif(array_key_exists($attribute, $replace)){\n\t \t\t\t\t\t$string = str_replace(\"{_\" . $attribute . \"_}\", $replace[$attribute], $string);\n\t \t\t\t\t}\n \t\t\t\t}\n \t\t\t}else if(array_key_exists($entity, $replace)){\n \t\t\t\t$replaceEntity = $replace[$entity];\n \t\t\t}else{\n\t \t\t\tforeach($replace as $object){\n\t \t\t\t\tif(strtolower(get_class($object)) == strtolower($entity)){\n\t \t\t\t\t\t$replaceEntity = $object;\n\t \t\t\t\t\tbreak;\n\t \t\t\t\t}\n\t \t\t\t}\n \t\t\t}\n\n \t\t\tif($replaceEntity){\n \t\t\t\tif(is_array($replaceEntity)){\n \t\t\t\t\tforeach($attributes as $attribute){\n \t\t\t\t\t\tif(array_key_exists($attribute, $replaceEntity)){\n \t\t\t\t\t\t\t$string = str_replace(\"{_\" . $entity . \".\" . $attribute . \"_}\", $replaceEntity[$attribute], $string);\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}else{\n \t\t\t\t\tforeach($attributes as $attribute){\n \t\t\t\t\t\tif(isset($replaceEntity->$attribute)){\n \t\t\t\t\t\t\t$string = str_replace(\"{_\" . $entity . \".\" . $attribute . \"_}\", $replaceEntity->$attribute, $string);\n \t\t\t\t\t\t}else{\n \t\t\t\t\t\t\tif($replaceEntity->attributes && isset($replaceEntity->attributes->$attribute)){\n \t\t\t\t\t\t\t\t$string = str_replace(\"{_\" . $entity . \".\" . $attribute . \"_}\", $replaceEntity->attributes->$attribute, $string);\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n\n \tif ($deleteEnters){\n \t\t$string = str_replace(\"\\n\", \"\", $string);\n \t}\n\treturn $string;\n}", "private function clear_variable()\n\t\t{\n\t\t\t$this->count_item_found = 'none';\t\t\t\t\t\t\t\t\t// No item found\n\t\t\t$this->fulllistexpand = Array();\t\t\t\t\t\t\t\t\t// No item list to expand\n\t\t\t$this->sqllistinvolved = '';\t\t\t\t\t\t\t\t\t\t// ??? TODO\n\t\t\t$this->listinvolved = Array();\n\t\t\t$this->html_result = '';\n\t\t}", "function PageVariableValue($variableName, $value = UNDEFINED);", "function checkVariable ( $pagenum, $varnum, $checks, $selectedValue )\n\t{\n\t\t$return= true;\n\t\t// Wenn Checks verfuegbar\n\t\tif ( is_array ( $checks ) )\n\t\t{\n\t\t\t// Wenn Variable keine \"Nur-Anzeige\"-Variable\n\t\t\tif ( $this->config['pages'][$pagenum]['data'][$varnum]['formtype'] != 'box'\n\t\t\t\t&& $this->config['pages'][$pagenum]['data'][$varnum]['formtype'] != 'html' )\n\t\t\t{\n\t\t\t\t$this->_setError( DEBUGINFO, $pagenum, 0, __CLASS__ . \"::\" . __FUNCTION__ . \" \" . \"$pagenum, $varnum, $selectedValue\" );\n\t\t\t\t// Alle Checks durchlaufen\n\t\t\t\tforeach ( $checks as $check )\n\t\t\t\t{\n\t\t\t\t\t$value\t\t= \"\";\n\t\t\t\t\t$evalcode\t= \"\\$return = \\$this->config['extension'] -> \" \n\t\t\t\t\t\t. $this->parseItem ( $check['action'] );\n\t\t\t\t\t$this->_setError ( DEBUGINFO, $pagenum, $varnum, __CLASS__ . \"::\" . __FUNCTION__ . \" \" . \"execute $evalcode\" );\n\t\t\t\t\t$return\t\t= $this->execute ( $evalcode, $pagenum, $varnum );\n\t\t\t\t\t$value\t\t= $return['value'];\n\t\t\t\t\t$ok\t\t\t= $return['isset'];\n\t\t\t\t\tif ( $this->config['system']['debug'] >= 5 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->lang ( $check['errormessage'] );\n\t\t\t\t\t}\n\t\t\t\t\t// Wenn Prüfung nicht OK\n\t\t\t\t\tif (!$ok)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_setError ( DEBUGINFO, $pagenum, $varnum, __CLASS__ . \"::\" . __FUNCTION__ . \" \" . \"checkVariable: check false\" );\n\t\t\t\t\t\tif ( $check['required'] == 1 )\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t$return\t\t= false;\n\t\t\t\t\t\t\t$this\t\t->setError ( $pagenum, $varnum, \"checkVariable: \" . $check['errormessage'] );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->_setError ( DEBUGINFO, $pagenum, $varnum, __CLASS__ . \"::\" . __FUNCTION__ . \" \" . \"... but its ok\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->_setError ( DEBUGINFO, $pagenum, $varnum, __CLASS__ . \"::\" . __FUNCTION__ . \" \" . \"check true\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}", "function dump($variable)\n {\n // dump variable using some quick and dirty (albeit invalid) XHTML\n if (!$variable && !is_numeric($variable))\n print(\"Variable is empty, null, or not even set.\");\n else\n print(\"<pre>\" . print_r($variable, true) . \"</pre>\");\n\n // exit immediately so that we can see what we printed\n exit;\n }", "protected function lang($key)\n {\n if (count($this->language) < 1) {\n $this->setLanguage('en'); // set the default language\n }\n\n if (array_key_exists($key, $this->language)) {\n if ($key == 'smtp_connect_failed') {\n //Include a link to troubleshooting docs on SMTP connection failure\n //this is by far the biggest cause of support questions\n //but it's usually not PHPMailer's fault.\n return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';\n }\n return $this->language[$key];\n } else {\n //Return the key as a fallback\n return $key;\n }\n }", "public function has_language() {\r\n\t\treturn (is_lang($this->language));\r\n\t}" ]
[ "0.6800874", "0.6193395", "0.60116297", "0.5969346", "0.5900965", "0.5883561", "0.5879308", "0.5874816", "0.5819969", "0.57453877", "0.57241976", "0.56680036", "0.56388736", "0.5632147", "0.56253666", "0.5622013", "0.5562423", "0.5516588", "0.55095017", "0.5492203", "0.5491663", "0.5483126", "0.5465064", "0.5464109", "0.545846", "0.5455479", "0.5451381", "0.5426122", "0.54209375", "0.5402445", "0.5398198", "0.5398052", "0.53953046", "0.53918046", "0.538534", "0.53738296", "0.5371572", "0.5357217", "0.5341691", "0.53329855", "0.5305506", "0.52849865", "0.52837515", "0.5283293", "0.52806187", "0.52806187", "0.52744126", "0.52704316", "0.52680767", "0.5257918", "0.5252562", "0.5251444", "0.52309984", "0.5230792", "0.5216055", "0.520757", "0.5181726", "0.5165439", "0.5161255", "0.51571894", "0.5147029", "0.514434", "0.5142987", "0.51413685", "0.5139823", "0.51350266", "0.5129602", "0.5129459", "0.512479", "0.5123797", "0.5123459", "0.5116074", "0.5110351", "0.5108609", "0.5104353", "0.51036733", "0.51019484", "0.5101239", "0.5100494", "0.5091796", "0.508261", "0.50763863", "0.50722057", "0.5069703", "0.50695133", "0.50689036", "0.5066752", "0.50636744", "0.505969", "0.5045893", "0.5045671", "0.50452137", "0.50401485", "0.5036777", "0.5028621", "0.50232977", "0.5015964", "0.50149155", "0.5012878", "0.50107557" ]
0.547744
22
Functions added for USERGROUP MOD (optimized)
function append_var_from_handle_to_block($blockname, $varname, $handle) { $this->assign_var_from_handle('_tmp', $handle); // assign the value of the generated variable to the given varname. $this->append_block_vars($blockname, array($varname => $this->vars['_tmp'])); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function getUserGroups(){\n \n }", "function secGroups($function, $group=NULL) {\n $g=array(\n\t 'setbackuid'=>array('none','admin'),\n\t 'editPref'=>array('admin'),\n\t 'setuid'=>array('admin'),\n\t 'getBookmarks'=>array('none','admin'),\n\t 'getBookmark'=>array('none','admin'),\n\t 'insertBookmark'=>array('none','admin'),\n\t 'procInsertBookmark'=>array('none','admin'),\n\t 'editBookmark'=>array('none','admin'),\n\t 'delBookmark'=>array('none','admin'),\n\t 'procEditBookmark'=>array('none','admin'),\n\t 'procEditPref'=>array('admin'),\n 'sendPasswords'=>array('rw','rwv','admin'),\n\t 'browseSelection'=>array('none','list','ro','rw','rwv','admin'),\n\t 'myAccount'=>array('none','list','ro','rw','rwv','admin'),\n\t 'procEditMyAccount'=>array('none','list','ro','rw','rwv','admin'),\n\t 'getPreferences'=>array('none','list','ro','rw','rwv','admin'),\n\t 'requestAnAccount'=>array('none'),\n\t 'procRequestAnAccount'=>array('none'),\n );\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n return $g[$function];\n }\n return parent::secGroups($function,$group);\n }", "function system_mod_group($paramvect)\n{\n}", "function secGroups($function, $group=NULL) {\n $g=array();\n $g['index']=array('ro','rw','rwv','admin');\n $g['clearStats']=array('admin');\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n return $g[$function];\n }\n return parent::secGroups($function,$group);\n }", "public function getUsergroup() {}", "function secGroups($function, $group=NULL) {\n $g=array();\n $g['preDel']=array('rw','rwv','admin');\n $g['dashboard']=array('ro','rw','rwv','admin');\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n return $g[$function];\n }\n return parent::secGroups($function,$group);\n }", "function set_user_groups(){\r\n $groups = _get_user_groups();\r\n $user_name = server(get_sso_option('user_name'));\r\n $user = get_userdatabylogin($user_name);\r\n $inherited_groups = get_usermeta($user->ID, 'wp_capabilities');\r\n $end_groups = $inherited_groups;\r\n $update = FALSE;\r\n for($i=0; $i<count($groups); $i++){\r\n if(!isset($inhereted_groups[$groups[$i]]) OR $inhereted_groups[$groups[$i]] != $end_groups[$groups[$i]]) $update = TRUE;\r\n $end_groups[$groups[$i]] = TRUE;\r\n }\r\n if($update) update_usermeta($user->ID, 'wp_capabilities', $end_groups);\r\n}", "function groups_with_module_access()\n {\n \tif ( ! isset($this->cache['member_groups_with_access'] ))\n\t\t{\n\t\t\t$r = array();\n\n\t\t\tee()->db->select( 'modules.module_id, module_member_groups.group_id' );\n\t\t\tee()->db->where( 'LOWER('.ee()->db->dbprefix.'modules.module_name)', TAXONOMY_SHORT_NAME );\n\t\t\tee()->db->join( 'module_member_groups', 'module_member_groups.module_id = modules.module_id' );\n\t\t\t$groups = ee()->db->get('modules')->result_array();\n\n\t\t\tforeach ($groups as $group)\n\t\t\t{\n\t\t\t\t$r[] = $group['group_id'];\n\t\t\t}\n\n\t\t\t$this->cache['member_groups_with_access'] = $r;\n\n\t\t}\n\n\t\treturn $this->cache['member_groups_with_access'];\n }", "function update_group_memberships()\n {\n if (! is_null($this->group_id))\n {\n $group_users_arr = $this->viewer->get_group_users($this->group_id);\n $group_users = array();\n \n foreach ($group_users_arr as $user)\n {\n $group_users[$user->get_id()] = $user->get_id();\n }\n \n $values = $this->exportValue(Manager::PARAM_GROUP_USERS);\n \n foreach ($values as $type => $elements)\n {\n foreach ($elements as $id)\n {\n if ($type == self::PARAM_USER)\n {\n // type = user\n if (! in_array($id, $group_users))\n {\n if (! $this->viewer->user_is_enrolled_in_group($id))\n {\n $this->viewer->add_user_to_group($id, $this->group_id); // user can be enrolled in one\n // PA-group/publication\n }\n else\n {\n $user = \\Chamilo\\Core\\User\\Storage\\DataManager::retrieve_by_id(\n \\Chamilo\\Core\\User\\Storage\\DataClass\\User::class_name(), \n $id);\n $already_enrolled[] = $user->get_firstname() . ' ' . $user->get_lastname();\n }\n }\n else\n {\n unset($group_users[$id]);\n }\n }\n // type = group\n elseif ($type == self::PARAM_GROUP)\n {\n $context_group_users = $this->viewer->get_context_group_users($id);\n \n foreach ($context_group_users as $user)\n {\n if (! in_array($user->get_id(), $group_users))\n {\n if (! $this->viewer->user_is_enrolled_in_group($user->get_id()))\n {\n $this->viewer->add_user_to_group($user->get_id(), $this->group_id); // user can be\n // enrolled in\n // one\n // PA-group/publication\n }\n else\n {\n $already_enrolled[] = $user->get_firstname() . ' ' . $user->get_lastname();\n }\n }\n else\n {\n unset($group_users[$id]);\n }\n }\n }\n }\n }\n \n // remove remaining users\n foreach ($group_users as $user_id)\n {\n $this->viewer->remove_user_from_group($user_id, $this->group_id);\n }\n }\n \n if (count($already_enrolled) > 0)\n $this->enroll_errors = implode(',', $already_enrolled) . ' ' . Translation::get('AlreadyEnrolled');\n }", "function group_prepare_usergroups_for_display($groups, $returnto='mygroups') {\n if (!$groups) {\n return;\n }\n\n // Retrieve a list of all the group admins, for placing in each $group object\n $groupadmins = array();\n $groupids = array_map(create_function('$a', 'return $a->id;'), $groups);\n if ($groupids) {\n $groupadmins = get_records_sql_array('SELECT \"group\", member\n FROM {group_member}\n WHERE \"group\" IN (' . implode(',', db_array_to_ph($groupids)) . \")\n AND role = 'admin'\", $groupids);\n\t\t\t\n if (!$groupadmins) {\n $groupadmins = array();\n }\n }\n\n $i = 0;\n foreach ($groups as $group) {\n $group->admins = array();\n foreach ($groupadmins as $admin) {\n if ($admin->group == $group->id) {\n $group->admins[] = $admin->member;\n }\n }\n $group->description = str_shorten_html($group->description, 100, true);\n if ($group->membershiptype == 'member') {\n $group->canleave = group_user_can_leave($group->id);\n }\n else if ($group->jointype == 'open') {\n $group->groupjoin = group_get_join_form('joingroup' . $i++, $group->id);\n }\n else if ($group->membershiptype == 'invite') {\n $group->invite = group_get_accept_form('invite' . $i++, $group->id, $returnto);\n }\n }\n}", "function secGroups($function, $group=NULL) {\n $g=array();\n $g['clean_cache']=array('admin');\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n else return $g[$function];\n }\n return false;\n }", "function check_module_access($m) {\r\n /*\r\n @level: int\r\n -2 available even when not authenticated,\r\n -1 always available when authenticated,\r\n 1 highest level of permission,\r\n 2+ lower and lower permission\r\n */\r\n global $user_access; # setted at useraccess.inc.php, then index.php\r\n\r\n if ($_SESSION['login_ok'] != 1 and $level != -2) return;\r\n if ($_SESSION['login_ok'] == 1 and $level != -1 and $_SESSION['login_level'] > $level) return; # level permission, allow if login_level is smaller\r\n if ($_SESSION['login_level'] != 0 and $_SESSION['login_level'] == $level and $group != '') { # check group permission if not '' or empty array\r\n if (is_array($group)) {\r\n $pass = False;\r\n foreach ($group as $grp) {\r\n if ($grp == $_SESSION['login_group']) {\r\n $pass = True;\r\n break;\r\n }\r\n }\r\n if (!$pass) return;\r\n }\r\n elseif ($group != $_SESSION['login_group']) return;\r\n }\r\n\r\n}", "function check_userGroup($data, $op){\n $error = \"\";\n $id = $data['id'];\n\n if($op){\n if($id == 0){\n $error = \"Id cannot be 0!\";\n return $error;\n }\n\n if(strlen($data['username']) < 6 || strlen($data['username']) > 24 || strlen($data['password']) < 8 || strlen($data['password']) > 24){\n $error = \"Username and password must be at least 8 characters length and up to 24.\";\n return $error;\n }\n\n $username = $data['username'];\n $DB_check = selectQuery(TAB_USERS, \"id = $id OR username = '$username' OR email = '$email'\", \"\");\n if(count($DB_check) > 0){\n $error = \"User already exist!\";\n return $error;\n }\n\n }else{\n if(strlen($data['username']) < 6 || strlen($data['username']) > 24){\n $error = \"Username must be at least 6 characters length and up to 24.\";\n return $error;\n }\n\n if($data['password'] == \"\"){ // Password not modified\n $data['password'] = selectRecord(TAB_USERS, \"id = $id\")['password'];\n }else{\n if(strlen($data['password']) < 8 || strlen($data['password']) > 24){\n $error = \"Password must be at least 8 characters length and up to 24.\";\n return $error;\n }\n }\n }\n\n if(!(field_validation($data['username']) && field_validation($data['password'])) ){ // check the special characters\n $error = \"Username and password can not contain special characters or blank spaces\";\n return $error;\n }\n\n if(filter_var($data['email'], FILTER_VALIDATE_EMAIL)){\n $email = $data['email'];\n }else{\n $error = \"Email format is invalid.\";\n return $error;\n }\n\n return $data;\n}", "function sf_setup_usergroup_data($membergroup, $moderatorgroup, $upgrade, $keys)\n{\n\tglobal $wpdb, $current_user;\n\n\t# if upgrade check if any moderators\n\t$modusers = '';\n\tif($upgrade) $modusers = get_option('sfmodusers');\n\tif(!empty($modusers))\n\t{\n\t\t$modusers = explode(';',get_option('sfmodusers'));\n\t}\n\n\t# get the list of users and do the stuff\n\t$userlist = $wpdb->get_results(\"SELECT ID FROM \".SFUSERS.\" ORDER BY display_name ASC;\");\n\tif($userlist)\n\t{\n\t\tforeach($userlist as $user)\n\t\t{\n\t\t\t# check it's not the admin\n\t\t\tif($user->ID != $current_user->ID)\n\t\t\t{\n\t\t\t\t$target = $membergroup;\n\t\t\t\t# is user a moderator?\n\t\t\t\tif(!empty($modusers))\n\t\t\t\t{\n\t\t\t\t\tif(in_array($user->ID, $modusers)) $target = $moderatorgroup;\n\t\t\t\t}\n\t\t\t\t$memberships = get_usermeta($user->ID, 'sfusergroup');\n\t\t\t\t$memberships[] = $target;\n\t\t\t\tupdate_usermeta($user->ID, 'sfusergroup', $memberships);\n\t\t\t}\n\t\t}\n\t}\n\n\t# Now to assign all 3 default usergroups to all forums\n\tif(($keys) && ($upgrade))\n\t{\n\t\t$forums = $wpdb->get_results(\"SELECT forum_id FROM \".SFFORUMS.\";\");\n\t\tif($forums)\n\t\t{\n\t\t\tforeach($forums as $forum)\n\t\t\t{\n\t\t\t\tfor($x=0; $x<count($keys); $x++)\n\t\t\t\t{\n\t\t\t\t\t$group = $keys[$x]['usergroup'];\n\t\t\t\t\t$perm = $keys[$x]['permission'];\n\n\t\t\t\t\t$sql =\"INSERT INTO \".SFPERMISSIONS.\" (forum_id, usergroup_id, permission_role) \";\n\t\t\t\t\t$sql.=\"VALUES (\".$forum->forum_id.\", \".$group.\", \".$perm.\");\";\n\t\t\t\t\t$wpdb->query($sql);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn;\n}", "function egsr_group_admin_cap(){\n return Array ( \n 'add_users' => true,\n 'create_users' => true,\n 'delete_users' => true,\n 'delete_others_pages' => true,\n 'delete_others_posts' => true,\n 'delete_pages' => true,\n 'delete_posts' => true,\n 'delete_private_pages' => true,\n 'delete_private_posts' => true,\n 'delete_published_pages' => true,\n 'delete_published_posts' => true,\n 'edit_others_pages' => true,\n 'edit_others_posts' => true,\n 'edit_pages' => true,\n 'edit_posts' => true,\n 'edit_private_pages' => true,\n 'edit_private_posts' => true,\n 'edit_published_pages' => true,\n 'edit_published_posts' => true,\n 'edit_users' => true,\n 'list_users' => true,\n 'manage_categories' => true,\n 'manage_links' => true,\n 'moderate_comments' => true,\n 'publish_pages' => true,\n 'publish_posts' => true,\n 'read' => true,\n 'read_private_pages' => true,\n 'read_private_posts' => true,\n 'unfiltered_html' => true,\n 'upload_files' => true,\n );\n}", "function secGroups($function, $group=NULL) {\n $g=array();\n if (true || $_SERVER['REMOTE_ADDR'] == '80.13.99.120' || $_SERVER['REMOTE_ADDR'] == '78.231.77.57'){\n $g['tests'] = array('none');\n }\n $g['wtsCheckLine'] = array('none');\n $g['ajaxMotDePasse'] = array('none');\n $g['wtsLireOffres'] = array('none');\n $g['viewOffre'] = array('none');\n $g['wtscommande']=array('none');\n $g['wtssaisieforfaits']=array('none');\n $g['wtsCtrlSaisieForfaits'] = array('none');\n $g['wtsCaddieDisp']=array('none');\n $g['wtsAjaxCaddieDisp'] = array('none');\n $g['wtsadd2caddie']=array('none');\n $g['wtsCaddieSuppr']=array('none');\n $g['wtsCaddieToggleLine']=array('none');\n $g['wtsCaddieSupprPack']=array('none'); // a tester\n $g['wtsPreValidateOrder'] = array('none');\n $g['wtsDevis'] = array('none');\n $g['wtsCtrlValidateOrder'] = array('none');\n $g['wtsValidateOrder'] = array('none');\n $g['wtsCtrlValidateCustomerCreation'] = array('none');\n $g['wtsValidateCustomerCreation'] = array('none');\n $g['wtsPrePaiement'] = array('none');\n $g['wtsDisplayOrder'] = array('none');\n $g['wtsCheckWTP'] = array('none');\n $g['wtsAddCard'] = array('none');\n $g['wtsPaiementZero'] = array('none');\n $g['wtsPaiementCheque'] = array('none');\n $g['wtsAdhesion'] = array('none');\n $g['wtsUseReduction'] = array('none');\n \n $g['checkStructures'] = array('admin');\n $g['repairStructures'] = array('admin');\n $g['repairOneStructure'] = array('admin');\n $g['checkSets'] = array('admin');\n $g['verifgrps'] = array('admin');\n $g['verifVentePro'] = array('admin');\n $g['checkEPLProducts'] = array('admin');\n\n $g['getCaddie'] = array('none');\n \n $g['procAuthGroup'] = array('none');\n $g['closeAuthGroup'] = array('none');\n $g['ajaxProcAuthMembre'] = array('none'); // non ecrite\n $g['initCurrentUser'] = array('none');\n $g['closeAuthMembre'] = array('none');\n\n // fonctions de la vente pro\n $g['wtsprolistewtp'] = array('none'); // ro normalement\n $g['wtsproadd2caddie'] = array('none'); // ro normalement\n $g['wtsProPaiement'] = array('none');\n $g['wtsProCancelOrder'] = array('none');\n $g['proAccount'] = array('none');\n // fonctions de la gestion des comtpes clients\n $g['myAccount'] = array('none');\n $g['procCreateMyAccount'] = array('none');\n $g['procEditMyAccount'] = array('none');\n $g['procEditProAccount'] = array('none');\n\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n return $g[$function];\n }\n return parent::secGroups($function, $group);\n }", "function get_group_info($user)\n{\n global $group_names, $group_colors, $special_ids;\n\n // get data from group string\n @list($group, $suppl) = @explode(',', make_group_str($user));\n\n // data validation\n $group_default = $group == 2 ? 2 : 0;\n if (is_null($suppl)) {\n $suppl = $group_default;\n }\n $group = $group > count($group_names) - 1 ? 0 : max(0, (int) $group);\n $suppl = $suppl > count($group_names[$group]) - 1 ? $group_default : max(0, (int) $suppl);\n\n // special\n $special_user = in_array(@$user->user_id, $special_ids);\n\n // return data\n $ret = new stdClass();\n $ret->num = $group;\n $ret->num2 = !$special_user ? $suppl : '*';\n $ret->name = $group_names[$group][$suppl];\n $ret->color = !$special_user ? $group_colors[$group][$suppl] : '83C141';\n $ret->str = \"$group,$ret->num2\";\n return $ret;\n}", "function make_all_group_leaders_in_a_group () {\n if ( current_user_can ( 'group_leader' ) ) {\n $user_ID = get_current_user_id ();\n update_user_meta ( $user_ID, 'learndash_group_users_2186', '2186' );\n }\n}", "function userInGroup($user_id, $group_id){\n try {\n global $db_table_prefix;\n\n $db = pdoConnect();\n\n $sqlVars = array();\n\n $query =\"SELECT id\n\t\t\tFROM \".$db_table_prefix.\"user_group_matches\n\t\t\tWHERE user_id = :user_id\n\t\t\tAND group_id = :group_id\n\t\t\tLIMIT 1\n\t\t\t\";\n\n $stmt = $db->prepare($query);\n\n $sqlVars[':user_id'] = $user_id;\n $sqlVars[':group_id'] = $group_id;\n\n if (!$stmt->execute($sqlVars)){\n // Error\n return false;\n }\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n if ($row)\n return true;\n else\n return false;\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n }\n}", "function secGroups($function, $group=NULL) {\n $g=array();\n $g['preConvertCoords']=array('ro', 'rw', 'rwv', 'admin');\n $g['procConvertCoords']=array('ro', 'rw', 'rwv', 'admin');\n $g['convertCoords']=array('none', 'ro', 'rw', 'rwv', 'admin');\n $g['geoSearch']=array('ro', 'rw','rwv','admin');\n $g['simpleLayerKML']=array('none', 'list', 'ro', 'rw', 'rwv', 'admin');\n $g['rawLayer']=array('none', 'list', 'ro', 'rw', 'rwv', 'admin');\n $g['geoCodeAuto']=array('admin');\n $g['procStat']=array('ro', 'rw', 'rwv', 'admin');\n $g['simpleMap'] = array('none', 'list', 'ro', 'rw', 'rwv', 'admin');\n $g['simpleMap2'] = array('none', 'list', 'ro', 'rw', 'rwv', 'admin');\n $g['xPoiList'] = array('ro', 'rw', 'rwv', 'admin');\n $g['xDisplayMarker'] = array('none', 'ro', 'rw', 'rwv', 'admin');\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n return $g[$function];\n }\n return parent::secGroups($function,$group);\n }", "public function initUserGroups() {}", "function sumo_add_user_grouplevel($form_name='', $group_exist=array())\n{\n\tGLOBAL $SUMO;\n\t\n\t$groups_array = sumo_get_grouplevel(sumo_get_user_available_group($SUMO['user']['user']));\n\t$groups_name = array_keys($groups_array);\n\t$form_name = $form_name ? $form_name : ucfirst($_SESSION['action']).ucfirst($_SESSION['module']);\n\t$available = FALSE;\n\t$script \t = \"\";\n\t$change = \"n=document.forms['$form_name'].group;\\n\"\n\t\t\t .\"l=document.forms['$form_name'].newgroup;\\n\"\n\t\t\t .\"gr=n.options[n.selectedIndex].value;\\n\"\n\t\t\t .\"ls=g[gr];l.options.length=0;if(!gr)return;\\n\"\n\t\t\t .\"for(i=0;i<ls.length;i+=2){l.options[i/2]=new Option(ls[i],ls[i+1]);}\\n\";\n\n\t$list = \"<select name='group' onchange=\\\"\".$change.\"\\\">\\n<option></option>\\n\";\n\n\tfor($g=0; $g<count($groups_name); $g++)\n\t{\n\t\t// ...administrator can add all groups\n\t\tif($groups_name[$g] == 'sumo')\n\t\t{\n\t\t\t$available_group = sumo_get_available_group();\n\n\t\t\t// ...to display 'sumo' group on top\n\t\t\t//if(!in_array('sumo', $group_exist))\n\t\t\t//\t$list .= \" <option value='sumo' style='color:#BB0000'>sumo</option>\\n\";\n\n\t\t\tfor($g=0; $g<count($available_group); $g++)\n\t\t\t{\n\t\t\t\t// create levels\n\t\t\t\tfor($l=1; $l<=7; $l++)\n\t\t\t\t{\n\t\t\t\t\t$value[$l] = $l.\",'\".$available_group[$g].\":\".$l.\"'\";\n\n\t\t\t\t\tif($available_group[$g] == 'sumo' && $SUMO['user']['group_level']['sumo'] <= $l) break;\n\t\t\t\t}\n\t\t\t\t$script .= \"g['\".$available_group[$g].\"']=new Array(\".implode(',',$value).\");\\n\";\n\t\t\t\t//\n\n\t\t\t\tif(!in_array($available_group[$g], $group_exist))\n\t\t\t\t{\n\t\t\t\t\t$list .= \" <option value='\".$available_group[$g].\"'>\"\n\t\t\t\t\t\t\t .$available_group[$g]\n\t\t\t\t\t\t\t .\"</option>\\n\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$available = TRUE;\n\n\t\t\tbreak;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// create levels\n\t\t\tfor($l=1; $l<=$groups_array[$groups_name[$g]]; $l++)\n\t\t\t{\n\t\t\t\t$value[$l] = $l.\",'\".$groups_name[$g].\":\".$l.\"'\";\n\t\t\t}\n\t\t\t$script .= \"g['\".$groups_name[$g].\"']=new Array(\".implode(',',$value).\");\";\n\t\t\t//\n\n\t\t\tif(!in_array($groups_name[$g], $group_exist))\n\t\t\t{\n\t\t\t\t$list .= \" <option value='\".$groups_name[$g].\"'>\".$groups_name[$g].\"</option>\\n\";\n\n\t\t\t\t$available = TRUE;\n\t\t\t}\n\t\t}\n\t}\n\n\t$list .= \"</select>&nbsp;:&nbsp;<select name='newgroup'></select>\";\n\n\t$list = str_replace(\"onchange=\\\"\", \"onchange=\\\"g=new Array();\".$script, $list);\n\n\treturn ($available) ? $list : '';\n}", "function get_second_group($user)\n{\n $group = (int) (isset($user->group) ? $user->group : $user->power);\n if ($group === 1) {\n return (int) $user->ca;\n } elseif ($group === 2) {\n if (isset($user->temp_mod) && $user->temp_mod) {\n return 0;\n } elseif ((bool) (int) $user->trial_mod) {\n return 1;\n } else {\n return 2;\n }\n }\n return -1;\n}", "public function changeUserGroup()\n {\n $userId = $this->request->variable('user_id',0);\n $groupId = $this->request->variable('group_id',9999);\n\n if($userId === 0 || $groupId === 9999)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => ['User ID was not supplied']\n ]);\n }\n\n /**\n * Group IDs\n * 5 - ADMIN\n * 4 - GLOBAL MOD\n * 2 - REGISTERED\n */\n $arrGroups = group_memberships(false, [$userId]);\n\n $arrCurrentGroupIds = [];\n\n // Get the user's current groups\n foreach($arrGroups as $group)\n {\n $arrCurrentGroupIds[$group['group_id']] = $group['group_id'];\n }\n\n // If the new group is 'registered user' we need to remove the user from\n // any admin or moderator groups they were previously in\n if($groupId < 4)\n {\n // User was an admin - remove them from the admin group\n if(in_array(5,$arrCurrentGroupIds))\n {\n group_user_del(5,[$userId]);\n }\n\n // User was a global mod - remove them from the global mod group\n if(in_array(4,$arrCurrentGroupIds))\n {\n group_user_del(4,[$userId]);\n }\n }\n\n // If the user is being made an admin, make sure they are a global mod too\n if($groupId == 5 AND !in_array(4,$arrCurrentGroupIds))\n {\n group_user_add(4, [$userId],false, false, false);\n }\n\n // User could already have the group they need if they are\n // being downgraded. Check if they have the group and\n // if not, add them. If they were, then make it the default\n if(!in_array($groupId,$arrCurrentGroupIds))\n {\n group_user_add($groupId, [$userId],false, false, true);\n }\n else\n {\n group_set_user_default($groupId,[$userId]);\n }\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user\\'s group was updated',\n 'data' => [\n 'user_id' => $userId,\n 'group_id' => $groupId\n ]\n ]);\n }", "function lobby_membersapi_add($args)\r\n{\r\n\t$uid = (int)$args['uid'];\r\n\t$gid = (int)$args['gid'];\r\n\t$text = $args['text'];\r\n\tif (!($uid > 1) || !($gid > 0)) {\r\n \t \tLogUtil::registerError(_LOBBY_GROUP_ADDMEMBER_FAILURE);\r\n\t\treturn false;\r\n\t} else {\r\n\t \t// get Group\r\n\t \t$group = pnModAPIFunc('lobby','groups','get',array('id' => $gid));\r\n \t\t$groupOwner = (($group['uid'] == pnUserGetVar('uid')) || (SecurityUtil::checkPermission('lobby::'.$id, '::', ACCESS_ADMIN)));\r\n\t \tif ($group['id'] != $gid) {\r\n\t \t \t// Something went wrong, groups not existent or something like that\r\n\t \t \tLogUtil::registerError(_LOBBY_GROUP_ADDMEMBER_FAILURE);\r\n\t\t return false;\r\n\t\t} else {\r\n\t\t\t$obj = array(\r\n\t\t\t\t'gid' \t=> $gid, \r\n\t\t\t\t'uid' \t=> $uid,\r\n\t\t\t\t'text'\t=> $text,\r\n\t\t\t\t'date'\t=> date(\"Y-m-d H:i:s\",time())\r\n\t\t\t\t);\r\n\t\t\tif (($group['moderated'] == 1) && ($group['uid'] != $uid)) {\r\n\t\t\t \t// is the member already member or pending?\r\n\t\t\t \t$table = pnDBGetTables();\r\n\t\t\t \t$column_pending = $table['lobby_members_pending_column'];\r\n\t\t\t \t$column_members = $table['lobby_members_column'];\r\n\t\t\t \t$where_pending = $column_pending['uid'].\" = \".$uid.\" AND \".$column_pending['gid'].\" = \".$gid;\r\n\t\t\t \t$where_members = $column_members['uid'].\" = \".$uid.\" AND \".$column_members['gid'].\" = \".$gid;\r\n\t\t\t \t$pending_count = (int)DBUtil::selectObjectCount('lobby_members_pending',$where_pending);\r\n\t\t\t \t$members_count = (int)DBUtil::selectObjectCount('lobby_members',$where_members);\r\n\t\t\t \tif ($pending_count > 0) {\r\n\t\t\t \t \t// if the call was done by the group owner we will move the contact from pending status\r\n\t\t\t \t \tif ($groupOwner) {\r\n\t\t\t \t \t \t// get object, add it into member table and delete delte it from pending table\r\n\t\t\t\t\t\t$pending = DBUtil::selectObject('lobby_members_pending',$where_pending);\r\n\t\t\t\t\t\t$result = DBUtil::deleteObject($pending,'lobby_members_pending');\r\n\t\t\t\t\t\tif (!$result) {\r\n\t\t\t\t\t\t\treturn LogUtil::registerError('_LOBBY_GROUP_PENDING_ACCEPT_ERROR');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($members_count == 0) {\r\n\t\t\t\t\t\t \tif (!$result) {\r\n\t\t\t\t\t\t\t\treturn LogUtil::registerError('_LOBBY_GROUP_PENDING_ACCEPT_ERROR');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\treturn LogUtil::registerError(_LOBBY_GROUP_ADD_ALREDY_MEMBER);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn LogUtil::registerError(_LOBBY_GROUP_ADD_ALREDY_PENDING);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if ($members_count > 0) {\r\n\t\t\t\t return LogUtil::registerError(_LOBBY_GROUP_ADD_ALREDY_MEMBER);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$result = DBUtil::insertObject($obj,'lobby_members_pending');\r\n\t\t\t\t\tif ($result) {\r\n\t\t\t\t\t\treturn LogUtil::registerStatus(_LOBBY_GROUP_REQUESTSENT);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\treturn LogUtil::registerError(_LOBBY_GROUP_JOINERROR);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t \t// Insert Member now into database\r\n\t\t\t$result = DBUtil::insertObject($obj,'lobby_members');\r\n\t\t\t// Set message\r\n\t\t\tif ($result) {\r\n\t\t\t\tLogUtil::registerStatus(str_replace('%member%',pnUserGetVar('uname', $uid),_LOBBY_GROUPS_MEMBERADDED));\r\n\t\t\t} else {\r\n\t\t\t \tLogUtil::registerError(_LOBBY_GROUPS_ADDERROR);\r\n\t\t\t}\r\n\t\t\t// Send an Email to the user that was added\r\n\t\t\tif ($group['uid'] == $uid) {\r\n\t\t\t\t// ToDo: Email schicken \"wurde hinzugefügt\"\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function init__hooks__systems__ecommerce__usergroup($in = null)\n{\n require_code('referrals');\n\n return override_str_replace_exactly(\n \"cns_add_member_to_group(\\$member_id, \\$new_group);\",\n \"\n cns_add_member_to_group(\\$member_id, \\$new_group);\n if (floatval(\\$myrow['s_cost']) != 0.0) {\n assign_referral_awards(\\$member_id, 'usergroup_subscribe');\n assign_referral_awards(\\$member_id, 'usergroup_subscribe_' . strval(\\$usergroup_subscription_id));\n }\n \",\n $in\n );\n}", "function system_add_group($paramv)\n{\n}", "function system_mod_user($paramvect)\n{\n\n}", "function acf_get_grouped_users($args = array())\n{\n}", "function mx_is_group_member($group_ids = '', $group_mod_mode = false)\n\t{\n\t\tglobal $user, $db;\n\n\t\tif ($group_ids == '')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$group_ids_array = explode(\",\", $group_ids);\n\n\t\t// Try to reuse usergroups result.\n\t\tif ($group_mod_mode)\n\t\t{\n\t\t\t$userdata_key = 'mx_usergroups_mod' . $user->data['user_id'];\n\n\t\t\tif (empty($user->data[$userdata_key]))\n\t\t\t{\n\t\t\t\t// Check if user is group moderator..\n\t\t\t\t$sql = \"SELECT gr.group_id\n\t\t\t\t\t\tFROM \" . GROUPS_TABLE . \" gr, \" . USER_GROUP_TABLE . \" ugr\n\t\t\t\t\t\tWHERE gr.group_id = ugr.group_id\n\t\t\t\t\t\t\tAND gr.group_moderator = '\" . $user->data['user_id'] . \"'\n\t\t\t\t\t\t\tAND ugr.user_pending = '0' \";\n\t\t\t\t$result = $db->sql_query($sql);\n\t\t\t\t$group_row = $db->sql_fetchrowset($result);\n\t\t\t\t$user->data[$userdata_key_mod] = $group_row;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$userdata_key = 'mx_usergroups' . $user->data['user_id'];\n\n\t\t\tif (empty($user->data[$userdata_key]))\n\t\t\t{\n\t\t\t\t// Check if user is member of the proper group..\n\t\t\t\t$sql = \"SELECT group_id FROM \" . USER_GROUP_TABLE . \" WHERE user_id='\" . $user->data['user_id'] . \"' AND user_pending = 0\";\n\t\t\t\t$result = $db->sql_query($sql);\n\t\t\t\t$group_row = $db->sql_fetchrowset($result);\n\t\t\t\t$user->data[$userdata_key] = $group_row;\n\t\t\t}\n\t\t}\n\n\t\tfor ($i = 0; $i < sizeof($user->data[$userdata_key]); $i++)\n\t\t{\n\t\t\tif (in_array($user->data[$userdata_key][$i]['group_id'], $group_ids_array))\n\t\t\t{\n\t\t\t\t$is_member = true;\n\t\t\t\treturn $is_member;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function group_user_access($groupid, $userid=null) {\n static $result;\n\n if (!is_logged_in()) {\n return false;\n }\n\n $groupid = group_param_groupid($groupid);\n $userid = group_param_userid($userid);\n\n if (isset($result[$groupid][$userid])) {\n return $result[$groupid][$userid];\n }\n\n return $result[$groupid][$userid] = get_field('group_member', 'role', 'group', $groupid, 'member', $userid);\n}", "function group_add_user($groupid, $userid, $role=null) {\n $groupid = group_param_groupid($groupid);\n $userid = group_param_userid($userid);\n\n $gm = new StdClass;\n $gm->member = $userid;\n $gm->group = $groupid;\n $gm->ctime = db_format_timestamp(time());\n if (!$role) {\n $role = get_field_sql('SELECT gt.defaultrole FROM {grouptype} gt, {group} g WHERE g.id = ? AND g.grouptype = gt.name', array($groupid));\n }\n $gm->role = $role;\n\n db_begin();\n insert_record('group_member', $gm);\n delete_records('group_member_request', 'group', $groupid, 'member', $userid);\n handle_event('userjoinsgroup', $gm);\n db_commit();\n}", "public function enableUserAndGroupSupport(){\n\t\treturn false;\n\t}", "function getUserAccessRight($user_id, $module)\n{\n\treturn 1;\n\t\n\t$mycon = databaseConnect();\n require_once(\"inc_dbfunctions.php\");\n $dataRead = New DataRead();\n\n $groupdetails = $dataRead->admins_groups_getbyuserid($mycon,$user_id);\n\n if($groupdetails == false) return false;\n \n if($groupdetails['username'] == \"administrator\") return 1;\n \n\t$rights = $groupdetails['rights'];\n \n\t\n\t//check if the right exists for the specified module\n\tif(strpos($rights,$module) === false) return 0;\n\t\n\t//at this point everuthing is fine\n\treturn 1;\n}", "function sf_group_def_perms()\n{\n\tglobal $wpdb;\n\n\t# grab the \"default\" permissions if they exist\n\t$noaccess = $wpdb->get_var(\"SELECT role_id FROM \".SFROLES.\" WHERE role_name='No Access'\");\n\tif (!$noaccess) $noaccess = -1;\n\t$readonly = $wpdb->get_var(\"SELECT role_id FROM \".SFROLES.\" WHERE role_name='Read Only Access'\");\n\tif (!$readonly) $readonly = -1;\n\t$standard = $wpdb->get_var(\"SELECT role_id FROM \".SFROLES.\" WHERE role_name='Standard Access'\");\n\tif (!$standard) $standard = -1;\n\t$moderator = $wpdb->get_var(\"SELECT role_id FROM \".SFROLES.\" WHERE role_name='Moderator Access'\");\n\tif (!$moderator) $moderator = -1;\n\n\t$usergroups = $wpdb->get_results(\"SELECT * FROM \".SFUSERGROUPS);\n\t$groups = $wpdb->get_results(\"SELECT group_id FROM \".SFGROUPS);\n\tif ($groups && $usergroups)\n\t{\n\t\tforeach ($groups as $group)\n\t\t{\n\t\t\tforeach ($usergroups as $usergroup)\n\t\t\t{\n\t\t\t\tif ($usergroup->usergroup_name == 'Guests')\n\t\t\t\t{\n\t\t\t\t\t$rid = $readonly;\n\t\t\t\t} else if ($usergroup->usergroup_name == 'Members')\n\t\t\t\t{\n\t\t\t\t\t$rid = $standard;\n\t\t\t\t} else if ($usergroup->usergroup_name == 'Moderators')\n\t\t\t\t{\n\t\t\t\t\t$rid = $moderator;\n\t\t\t\t} else {\n\t\t\t\t\t$rid = $noaccess;\n\t\t\t\t}\n\t\t\t\t$wpdb->query(\"\n\t\t\t\t\tINSERT INTO \".SFDEFPERMISSIONS.\"\n\t\t\t\t\t(group_id, usergroup_id, permission_role)\n\t\t\t\t\tVALUES\n\t\t\t\t\t($group->group_id, $usergroup->usergroup_id, $rid)\");\n\t\t\t}\n\t\t}\n\t}\n}", "public static function grantMod( $usr, $user, $group ) {\n\t\tif( !Group::isMod( $group, $usr ) ) return false;\n\t\t\tif(!($db = new DB()) ) return false;\n\t\t\t$result = $db->query( \"UPDATE `group_participants` SET `mod`=1 WHERE `group_id` Like '§0' AND `user_id` Like '§1'\",[$group,$user]);\n\t\t\tLog::msg( \"Groups\", \"$usr granted $user moderator rights in $group\" );\n\t\t\treturn true;\n\t}", "private function getUserGroup(): int {\n return $this->core->getUser()->getGroup();\n }", "public function userInGroup()\n\t{\n\t\tself::authenticate();\n\n\t\t$uname = FormUtil::getPassedValue('user', null);\n\t\t$group = FormUtil::getPassedValue('group', null);\n\n\t\tif($uname == null) {\n\t\t\treturn self::retError('ERROR: No user name passed!');\n\t\t}\n\t\tif($group == null) {\n\t\t\treturn self::retError('ERROR: No group passed!');\n\t\t}\n\n\t\t$uid = UserUtil::getIdFromName($uname);\n\t\tif($uid == false) {\n\t\t\treturn self::ret(false);\n\t\t}\n\n\t\tif($group == 'admin') {\n\t\t\tif(SecurityUtil::checkPermission('Owncloud::Admin', '::', ACCESS_MODERATE, $uid)) {\n\t\t\t\t$return = true;\n\t\t\t} else {\n\t\t\t\t$return = false;\n\t\t\t}\n\t\t} else {\n\t\t\t$groups = UserUtil::getGroupsForUser($uid);\n\t\t\t$return = false;\n\t\t\tforeach($groups as $item) {\n\t\t\t\t$itemgroup = UserUtil::getGroup($item);\n\t\t\t\tif($itemgroup['name'] == $group) {\n\t\t\t\t\t$return = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn self::ret($return);\n\t}", "function set_userGroup($data, $oldId){\n $data_user = array();\n $data_group = array();\n $data_user['id'] = $data['id'];\n $data_user['username'] = $data['username'];\n $data_user['password'] = $data['password'];\n $data_user['email'] = $data['email'];\n\n $group = $data['group'];\n $data['group'] = selectRecord(TAB_GROUPS, \"role = '$group'\")['id'];\n $data_group['userId'] = $data['id'];\n $data_group['groupId'] = $data['group'];\n\n updateRecord(TAB_USR_ROLE, $data_group, \"userId = $oldId\");\n updateRecord(TAB_USERS, $data_user, \"id = $oldId\");\n $data_info = array();\n if($data['group'] == 1){\n $data_info = array();\n $data_info['employment'] = \"-\";\n $data_info['img_address'] = \"upload/user/user-default.png\";\n $data_info['user'] = $data['id'];\n insertRecord(TAB_PERSONALINFO, $data_info);\n }\n}", "function isAdminOfThisGroup($groupId)\n{\n\t$_c_user_id = (isset($_COOKIE[$GLOBALS['c_id']]) ? $_COOKIE[$GLOBALS['c_id']] : 0);\n\n\tif ($_c_user_id != 0 && isUserLoggedIn($user_id)) {\n \n\t\t$db = new db_util();\n\n\t $sql = \"SELECT * \n\t FROM vm_group \n\t WHERE v_group_leader_id='$_c_user_id' \n\t AND v_group_id = '$groupId'\";\n\n\t $result = $db->query($sql);\n\n\t if ($result !== false) {\n\t // if there any error in sql then it will false\n\t if ($result->num_rows > 0) {\n\t // if the sql execute successful then it give \n\t \n\t return true;\n\t }\n\t }\n }\n \n return false;\n}", "function groupUserListManage(&$array, $groupid)\n{\n\tglobal $db;\n\n\t$res = $db->query('select group_user_user from group_user where group_user_group=' . $groupid);\n\n\tforeach($res as $row)\n\t{\n\t\t$res = $db->query('select user_name from users where user_id=' . $row['group_user_user']);\n\t\tarray_push($array, array(\n\t\t\tdecode($res[0]['user_name']),\n\t\t\tgetForm('', array(\n\t\t\t\t\tarray('', array('type'=>'submit', 'name'=>'submit-remove-user', 'val'=>'Remove')),\n\t\t\t\t\tarray('', array('type'=>'hidden', 'name'=>'userid', 'val'=>$row['group_user_user'])),\n\t\t\t\t\tarray('', array('type'=>'hidden', 'name'=>'g', 'val'=>$groupid)),\n\t\t\t\t\tarray('', array('type'=>'hidden', 'name'=>'a', 'val'=>'edit-group')),\n\t\t\t))\n\t\t));\n\t}\n}", "function _get_user_groups(){\r\n $groups = array();\r\n for($i=0; $i<get_sso_option('rules_number'); $i++){\r\n $rule = _get_rule($i);\r\n if($rule != FALSE){\r\n\t $is_group = _run_rule($rule['var'], $rule['regexp'], $rule['group']);\r\n\t if($is_group === TRUE) $groups[] = $rule['group'];\r\n }\r\n }\r\n return $groups;\r\n}", "function get_user_groups($customerno, $userid, $form = 'array') {\n if (isset($_SESSION['groupid']) && $_SESSION['groupid'] != 0) {\n $groups = array($_SESSION['groupid']);\n } else {\n $umanager = new UserManager();\n $groups = $umanager->get_user_groups_arr($customerno, $userid);\n if (empty($groups)) {\n $groups = array(0);\n }\n }\n if ($form == 'csv') {\n $groups = implode(',', $groups);\n }\n if ($groups == 0) {\n $groups = null;\n }\n return $groups;\n}", "function user_joined_groups($uid, $limit = NULL) {\n global $db;\n # REF QUERY : SELECT * FROM group_members,groups WHERE group_members.userid = '1' AND group_members.group_id = groups.group_id AND groups_members.userid != groups.userid\n $result = $db->select(tbl($this->gp_tbl) . ',' . tbl($this->gp_mem_tbl), \"*\", tbl($this->gp_mem_tbl) . \".userid='$uid' AND \n \" . tbl($this->gp_mem_tbl) . \".group_id = \" . tbl($this->gp_tbl) . \".group_id\", $limit, tbl($this->gp_tbl) . \".group_name\");\n \n if ($db->num_rows > 0)\n return $result;\n else\n return false;\n }", "function getGroup() ;", "function group_get_associated_groups($userid, $filter='all', $limit=20, $offset=0) {\n // postgres\n if (is_mysql()) {\n $invitesql = \"'invite'\";\n $requestsql = \"'request'\";\n $adminsql = \"'admin'\";\n $empty = \"''\";\n }\n else {\n $invitesql = \"CAST('invite' AS TEXT)\";\n $requestsql = \"CAST('request' AS TEXT)\";\n $adminsql = \"CAST('admin' AS TEXT)\";\n $empty = \"CAST('' AS TEXT)\";\n }\n\n // Different filters join on the different kinds of association\n if ($filter == 'admin') {\n $sql = \"\n INNER JOIN (\n SELECT g.id, $adminsql AS membershiptype, $empty AS reason, $adminsql AS role\n FROM {group} g\t\t\t\t\n INNER JOIN {group_member} gm ON (gm.group = g.id AND gm.member = ? AND gm.role = 'admin')\n ) t ON t.id = g.id\";\n $values = array($userid);\n }\n else if ($filter == 'member') {\n $sql = \"\n INNER JOIN (\n SELECT g.id, 'admin' AS membershiptype, $empty AS reason, $adminsql AS role\n FROM {group} g\t\t\t\t\n INNER JOIN {group_member} gm ON (gm.group = g.id AND gm.member = ? AND gm.role = 'admin')\n UNION\n SELECT g.id, 'member' AS type, $empty AS reason, gm.role AS role\n FROM {group} g\n INNER JOIN {group_member} gm ON (gm.group = g.id AND gm.member = ? AND gm.role != 'admin')\n ) t ON t.id = g.id\";\n $values = array($userid, $userid);\n }\n else if ($filter == 'invite') {\n $sql = \"\n INNER JOIN (\n SELECT g.id, $invitesql AS membershiptype, gmi.reason, gmi.role\n FROM {group} g\n INNER JOIN {group_member_invite} gmi ON (gmi.group = g.id AND gmi.member = ?)\n ) t ON t.id = g.id\";\n $values = array($userid);\n }\n else if ($filter == 'request') {\n $sql = \"\n INNER JOIN (\n SELECT g.id, $requestsql AS membershiptype, gmr.reason, $empty AS role\n FROM {group} g\n INNER JOIN {group_member_request} gmr ON (gmr.group = g.id AND gmr.member = ?)\n ) t ON t.id = g.id\";\n $values = array($userid);\n }\n else { // all or some other text\n $filter = 'all';\n $sql = \"\n INNER JOIN (\n SELECT g.id, 'admin' AS membershiptype, '' AS reason, 'admin' AS role\n FROM {group} g\t\t\t\t\n INNER JOIN {group_member} gm ON (gm.group = g.id AND gm.member = ? AND gm.role = 'admin' AND g.parent_group is null OR g.parent_group=0)\n UNION\n SELECT g.id, 'member' AS membershiptype, '' AS reason, gm.role AS role\n FROM {group} g\n INNER JOIN {group_member} gm ON (g.id = gm.group AND gm.member = ? AND gm.role != 'admin')\n UNION\n SELECT g.id, 'invite' AS membershiptype, gmi.reason, gmi.role\n FROM {group} g\n INNER JOIN {group_member_invite} gmi ON (gmi.group = g.id AND gmi.member = ?)\n UNION SELECT g.id, 'request' AS membershiptype, gmr.reason, '' AS role\n FROM {group} g\n INNER JOIN {group_member_request} gmr ON (gmr.group = g.id AND gmr.member = ?)\n ) t ON t.id = g.id\";\n $values = array($userid, $userid, $userid, $userid);\n }\n \n $values[] = 0;\n \n $count = count_records_sql('SELECT COUNT(*) FROM {group} g ' . $sql . ' WHERE g.deleted = ?', $values);\n \n // almost the same as query used in find - common parts should probably be pulled out\n // gets the groups filtered by above\n // and the first three members by id\n \n\t//Start-Anusha - added g.outcome & g1.outcome\n /*$sql = 'SELECT g1.id, g1.name, g1.description, g1.jointype, g1.grouptype, g1.membershiptype, g1.reason, g1.role, g1.membercount, COUNT(gmr.member) AS requests\n FROM (\n SELECT g.id, g.name, g.description, g.jointype, g.grouptype, t.membershiptype, t.reason, t.role, COUNT(gm.member) AS membercount\n FROM {group} g\n LEFT JOIN {group_member} gm ON (gm.group = g.id)' .\n $sql . '\n WHERE g.deleted = ?\n GROUP BY g.id, g.name, g.description, g.jointype, g.grouptype, t.membershiptype, t.reason, t.role\n ORDER BY g.name\n ) g1\n LEFT JOIN {group_member_request} gmr ON (gmr.group = g1.id)\n GROUP BY g1.id, g1.name, g1.description, g1.jointype, g1.grouptype, g1.membershiptype, g1.reason, g1.role, g1.membercount';\n */\n\t//start -Eshwari added g1.courseoffering,g.courseoffering,\n\t $sql = 'SELECT g1.id, g1.name, g1.description, g1.jointype, g1.grouptype, g1.outcome,g1.courseoffering, g1.membershiptype, g1.reason, g1.role, g1.membercount, COUNT(gmr.member) AS requests\n FROM (\n SELECT g.id, g.name, g.description, g.jointype, g.grouptype, g.outcome,g.courseoffering, t.membershiptype, t.reason, t.role, COUNT(gm.member) AS membercount\n FROM {group} g\n LEFT JOIN {group_member} gm ON (gm.group = g.id)' .\n $sql . '\n WHERE g.deleted = ?\n GROUP BY g.id, g.name, g.description, g.jointype, g.grouptype, t.membershiptype, t.reason, t.role\n ORDER BY g.name\n ) g1\n LEFT JOIN {group_member_request} gmr ON (gmr.group = g1.id)\n GROUP BY g1.id, g1.name, g1.description, g1.jointype, g1.grouptype, g1.outcome,g1.courseoffering, g1.membershiptype, g1.reason, g1.role, g1.membercount';\n\t//End-Anusha\n\t\n $groups = get_records_sql_assoc($sql, $values, $offset, $limit);\n \n if ($groups) {\n // Get a few random members from each group. We've tried this with one \n // query before but it's painfully slow, databases don't do random rows \n // efficiently.\n foreach (array_keys($groups) as $groupid) {\n $members = get_records_sql_array(\"\n SELECT u.*\n FROM {group_member} gm\n INNER JOIN {usr} u ON (gm.member = u.id AND u.deleted = 0)\n WHERE gm.group = ?\n ORDER BY \" . db_random() . \"\n LIMIT 3\", array($groupid));\n foreach ($members as $m) {\n $groups[$groupid]->members[] = (object) array('id' => $m->id, 'name' => display_name($m));\n }\n }\n $groups = array_values($groups);\n }\n else {\n $groups = array();\n }\n\n return array('groups' => $groups, 'count' => $count);\n\n}", "private function setGroup() {\n if (Request::has(\"include-group-read\") && Request::input(\"include-group-read\") === \"true\") { $permissionRead = 4; } else { $permissionRead = 0; }\n if (Request::has(\"include-group-write\") && Request::input(\"include-group-write\") === \"true\") { $permissionWrite = 2; } else { $permissionWrite = 0; }\n if (Request::has(\"include-group-execute\") && Request::input(\"include-group-execute\") === \"true\") { $permissionExecute = 1; } else { $permissionExecute = 0; }\n return $permissionRead + $permissionWrite + $permissionExecute;\n }", "function make_group_str($user)\n{\n $group = (int) (isset($user->group) ? $user->group : $user->power);\n $group2 = get_second_group($user);\n $group2 = $group2 < 0 ? '' : \",$group2\";\n return \"$group$group2\";\n}", "function get_userGroup($id){\n $result = array();\n $user = selectRecord(TAB_USERS, \"id = $id\");\n\n $result['id'] = $user['id'];\n $result['username'] = $user['username'];\n $result['password'] = \"\";\n $result['email'] = $user['email'];\n\n $role = selectJoin(TAB_USR_ROLE, TAB_GROUPS, \"groupId = id\", \"userId = $id\")[0]['role'];\n $groups = selectQuery(TAB_GROUPS, \"role <> '$role'\", \"role ASC\");\n\n foreach($groups as $group){\n $gr_elem[] = $group['role'];\n }\n array_unshift($gr_elem, $role);\n $result['group'] = $gr_elem;\n\n return $result;\n}", "public function get_group($user_id){\r\n\t\r\n\t$user_id1 = ($user_id != NULL)?\"'\".$this->hrm_mysql_connect->real_escape_string($user_id).\"'\":'NULL';\r\n\t$sql = $this->hrm_mysql_connect->query(\"SELECT a.leave_group, b.name, b.supervisor_id, b.delegate, b.status, c.user_firstname, c.user_lastname, c.user_email FROM leave_reg a JOIN leave_groups b ON a.leave_group = b.group_id JOIN hrm_users c ON b.supervisor_id = c.user_id WHERE a.user_id=$user_id1\");\r\n\tif($sql){\r\n\t$sup = $sql->fetch_assoc();\r\n\t$g_name = $sup['name'];\r\n\t$g_deleg = $sup['delegate'];\r\n\t$g_status = $sup['status'];\r\n\tif($g_status==3 && $g_deleg!=0){\r\n\t\t$user_id2 = ($g_deleg != NULL)?\"'\".$this->hrm_mysql_connect->real_escape_string($g_deleg).\"'\":'NULL';\r\n\t\t$sql2 = $this->hrm_mysql_connect->query(\"SELECT user_firstname, user_lastname, user_email FROM hrm_users WHERE user_id=$user_id2\");\r\n\t\t$sup_deleg = $sql2->fetch_assoc();\r\n\t\t$delegate = 1;\r\n\t\t$sup_id = $g_deleg;\r\n\t\t$sup_name = $sup_deleg['user_firstname'].' '.$sup_deleg['user_lastname'];\r\n\t\t$sup_email = $sup_deleg['user_email'];\r\n\t\t}else {\r\n\t$delegate = 0;\r\n\t$sup_id = $sup['supervisor_id'];\r\n\t$sup_name = $sup['user_firstname'].' '.$sup['user_lastname'];\r\n\t$sup_email = $sup['user_email'];\r\n\t\t\t}\r\n\t\t\treturn array($g_name, $sup_id, $sup_name, $sup_email, $delegate);\r\n\t}else{\r\n\t\treturn 0;\r\n\t\t}\r\n}", "public function admin_user_group()\n\t{\n\t\t$crud = $this->generate_crud('admin_groups');\n\t\t$this->mTitle.= 'Admin User Groups';\n\t\t$this->render_crud();\n\t}", "function addUserGroups()\n {\n Log::add('User groups added in installation script', JLog::DEBUG, 'com_cajobboard');\n\n $db = JFactory::getDbo();\n\n // Get the PK of the \"Registered\" user group\n $query = $db->getQuery(true);\n\n $query\n ->select ($db->quoteName(array('id', 'title')))\n ->from ($db->quoteName('#__usergroups'))\n ->where ($db->quoteName('title') . ' = '. $db->quote('Registered'));\n\n $db->setQuery($query);\n\n $registeredGroupId = $db->loadResult();\n\n unset($query);\n\n // Get a list of all of the existing user groups so we don't duplicate adding ones we want\n $query = $db->getQuery(true);\n\n $query\n ->select ($db->quoteName('title'))\n ->from ($db->quoteName('#__usergroups'));\n\n $db->setQuery($query);\n\n $existingUserGroups = $db->loadColumn();\n\n // Add our new user groups\n foreach ($this->userGroups as $userGroup)\n {\n if (!in_array($userGroup, $existingUserGroups))\n {\n $groupModel = Table::getInstance('Usergroup');\n\n $groupModel->save(array(\n 'title' => $userGroup,\n 'parent_id' => $registeredGroupId\n ));\n }\n }\n\n Table::getInstance('Usergroup')->rebuild();\n }", "function check_and_add_to_group($userid, $group_id)\r\n{\r\n if ( !BP_Groups_Member::check_is_member( $userid, $group_id ) ) {\r\n // make sure the user isn't banned from the group!\r\n if ( !groups_is_user_banned( $userid, $group_id ) ) {\r\n // add the group already!\r\n $user_id = $userid;\r\n\r\n if ( groups_check_user_has_invite( $user_id, $group_id ) ) {\r\n groups_delete_invite( $user_id, $group_id );\r\n }\r\n\r\n $new_member = new bp_groups_member;\r\n $new_member->group_id = $group_id;\r\n $new_member->inviter_id = 0;\r\n $new_member->user_id = $user_id;\r\n $new_member->is_admin = 0;\r\n $new_member->user_title = '';\r\n $new_member->date_modified = time();\r\n $new_member->is_confirmed = 1;\r\n\r\n if ( !$new_member->save() ) {\r\n return false;\r\n }\r\n\r\n // Should I add this to the activity stream? left off for now\r\n\r\n /* Modify group meta */\r\n groups_update_groupmeta( $group_id, 'total_member_count', (int) groups_get_groupmeta( $group_id, 'total_member_count') + 1 );\r\n groups_update_groupmeta( $group_id, 'last_activity', time() );\r\n }\r\n }\r\n\r\n return false;\r\n}", "function checkAccess($grp, $moduleFolder, $access)\n{\n $sql = \"SELECT module_id, module_name, module_folder\n FROM system_module\n WHERE module_folder = '$moduleFolder'\n \";\n $result = dbQuery($sql);\n if(dbNumRows($result)==1)\n {\n $row=dbFetchAssoc($result);\n $module_id = $row[module_id];\n $module_name =$row[module_name];\n }\n\t\n\t//date validate\n\t$system_today = date('Y-m-d');\n\tif($system_today > '2020-05-25')\n\t{\n\t\t$unallow_sw = 1;\n\t}\n\telse\n\t{\n\t\t$unallow_sw = 0;\n\t}\t\n \n if($module_name!=\"\")\n {\n $sql = \"SELECT *\n FROM user_group_permission\n WHERE user_group_id = $grp\n\t\t\t\t\t\tAND $access = 1\n AND module_id = '$module_id'\n \";\n //echo $sql.'<BR>';\n $result = dbQuery($sql);\n if(dbNumRows($result)==1 and $unallow_sw == 0)\n {\n $bool = true;\n }\n }\n else\n {\n $bool = false;\n }\n return $bool;\n}", "function _get_usergroups($args = array()) {\n\t\treturn WP_Scoped_User_Anon::get_groups_for_user( -1 );\n\t}", "function new_groups()\n {\n \n }", "function user_getgroup()\n\t{\n\t\t$id = $this->user_getid();\n\t\t$perms = $this->DB->database_select('users', 'gid', array('uid' => $id), 1);\n\t\treturn ($perms === false) ? false : $perms['gid'];\n\t}", "function friendGroupHandler() {\n global $inputs;\n\n insert('member_group_apply',[\n 'member_id' => getLogin()['mid'],\n 'group_id' => $inputs['id']\n ]);\n\n formatOutput(true, 'apply success');\n}", "function addUsersToGroup($group_id, $user_ids){\n\n}", "function updateMemberGroup()\n {\n // ------------------------------------\n // Only super admins can administrate member groups\n // ------------------------------------\n\n if (Session::userdata('group_id') != 1) {\n return Cp::unauthorizedAccess(__('members.only_superadmins_can_admin_groups'));\n }\n\n $edit = (bool) Request::has('group_id');\n\n $group_id = Request::input('group_id');\n $clone_id = Request::input('clone_id');\n\n unset($_POST['group_id']);\n unset($_POST['clone_id']);\n\n // No group name\n if ( ! Request::input('group_name')) {\n return Cp::errorMessage(__('members.missing_group_name'));\n }\n\n $return = (Request::has('return'));\n\n $site_ids = [];\n $plugin_ids = [];\n $weblog_ids = [];\n $template_ids = [];\n\n // ------------------------------------\n // Remove and Store Weblog and Template Permissions\n // ------------------------------------\n\n $data = [\n 'group_name' => Request::input('group_name'),\n 'group_description' => Request::input('group_description'),\n ];\n\n $duplicate = DB::table('member_groups')\n ->where('group_name', $data['group_name']);\n\n if (!empty($group_id)) {\n $duplicate->where('group_id', '!=', $group_id);\n }\n\n if($duplicate->count() > 0) {\n return Cp::errorMessage(__('members.duplicate_group_name'));\n }\n\n // ------------------------------------\n // Preferences\n // ------------------------------------\n\n $preferences['group_id'] = $group_id;\n $preferences['is_locked'] = Request::input('is_locked');\n\n foreach(static::$group_preferences as $group => $prefs) {\n foreach((array) $prefs as $key => $default) {\n if (Request::has($key)) {\n $preferences[$key] = Request::get($key);\n }\n }\n }\n\n foreach (Request::all() as $key => $val)\n {\n if (substr($key, 0, strlen('weblog_id_')) == 'weblog_id_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } elseif (substr($key, 0, strlen('plugin_name_')) == 'plugin_name_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } elseif (substr($key, 0, strlen('can_access_offline_site_id_')) == 'can_access_offline_site_id_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } elseif (substr($key, 0, strlen('can_access_cp_site_id_')) == 'can_access_cp_site_id_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } else {\n continue;\n }\n }\n\n if ($edit === false)\n {\n $group_id = DB::table('member_groups')->insertGetId($data);\n\n foreach($preferences as $handle => $value) {\n $prefs =\n [\n 'group_id' => $data['group_id'],\n 'handle' => $handle,\n 'value' => $value\n ];\n\n DB::table('member_group_preferences')->insert($prefs);\n }\n\n $uploads = DB::table('upload_prefs')\n ->select('id')\n ->get();\n\n foreach($uploads as $yeeha)\n {\n DB::table('upload_no_access')\n ->insert(\n [\n 'upload_id' => $yeeha->id,\n 'upload_loc' => 'cp',\n 'member_group' => $group_id\n ]);\n }\n\n $message = __('members.member_group_created').'&nbsp;'.$_POST['group_name'];\n }\n else\n {\n DB::table('member_groups')\n ->where('group_id', $data['group_id'])\n ->update($data);\n\n DB::table('member_group_preferences')\n ->where('group_id', $data['group_id'])\n ->delete();\n\n foreach($preferences as $handle => $value) {\n $prefs =\n [\n 'group_id' => $data['group_id'],\n 'handle' => $handle,\n 'value' => $value\n ];\n\n DB::table('member_group_preferences')->insert($prefs);\n }\n\n $message = __('members.member_group_updated').'&nbsp;'.$_POST['group_name'];\n }\n\n // Update CP log\n Cp::log($message);\n\n $this->clearMemberGroupCache($data['group_id']);\n\n if ($return == true) {\n return $this->member_group_manager($message);\n }\n\n return $this->editMemberGroup($message, $group_id);\n }", "function getUsersGroups($mysqli,$userID){\r\n $result = $mysqli->query(\"SELECT groups.*, group_members.isAdmin FROM `group_members` RIGHT JOIN groups ON group_members.group_ID = groups.ID WHERE Member_ID = \".$userID.\"\");\r\n $groups = array();\r\n\r\n $i=0;\r\n while($row = $result->fetch_row()){\r\n $g = new group();\r\n $g->groupID = $row[0];\r\n $g->name = $row[1];\r\n $g->description = $row[2];\r\n $g->website = $row[3];\r\n $g->private = $row[4];\r\n $g->type = $row[5];\r\n $g->sport = $row[6];\r\n $g->logoURL = $row[7];\r\n $g->city = $row[8];\r\n $g->userIsAdmin = $row[9];\r\n $groups[$i] = $g;\r\n $i++;\r\n }\r\n return $groups;\r\n }", "public static function getMembersOfGroup($group) # $group may be (int) GID or (str) cn (LDAP cn of group).\n{\n $ldapconn = ldap_connect(self::LDAP_HOST, self::LDAP_PORT) or die(\"Could not connect to \".self::LDAP_HOST);\n @ldap_bind($ldapconn);\n $filter = \"(&(objectClass=posixGroup)(\".(is_numeric($group) ? 'gidnumber' : 'cn').\"=$group))\";\n $justthese = array('gidnumber', 'cn', 'memberuid');\n $result = ldap_search($ldapconn, self::LDAP_DN_GROUPS, $filter, $justthese);\n $data = ldap_get_entries($ldapconn, $result);\n $users = $data[0]['memberuid'];\n unset($users['count']);\n sort($users);\n # ..then look up members.\n return self::_getMembers(\"(&(objectClass=posixAccount)(|\".implode('', array_map(create_function('$usr', 'return \"(uid=$usr)\";'), $users)).\"))\");\n}", "public function isModuleAdmin($username,$module);", "function mysteam_filter_groups($user)\n{\n\tglobal $mybb;\n\tstatic $gids;\n\n\t// Return true if no usergroups to filter from.\n\tif (!$mybb->settings['mysteam_limitbygroup'])\n\t{\n\t\treturn true;\n\t}\n\t\n\t// Check if the user is in an authorized usergroup.\n\tif (empty($gids))\n\t{\n\t\t$gids = explode(',', $mybb->settings['mysteam_limitbygroup']);\n\t\t\t\n\t\tif (is_array($gids))\n\t\t{\n\t\t\t$gids = array_map('intval', $gids);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$gids = (int) $mybb->settings['mysteam_limitbygroup'];\n\t\t}\n\t}\n\t\t\n\t$usergroups = explode(',', $user['additionalgroups']);\n\t$usergroups[] = $user['usergroup'];\n\t\n\tif (!is_array($usergroups))\n\t{\n\t\t$usergroups = array($usergroups);\n\t}\n\t\n\tif (array_intersect($usergroups, $gids))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "function tx_notusergroup($cmd){\r\n\t\t$cmd = t3lib_div::trimExplode('|',$cmd,true);\r\n\t\t$gr_list = $GLOBALS['TSFE']->gr_list;\r\n\t\tforeach( $cmd as $grp) {\r\n\t\t\tif(t3lib_div::inList($gr_list,$grp)){\r\n\t\t\t\treturn false; // matched a group so condition is false\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true; // no Group Found so return true;\r\n\t}", "function forum_group_permissions( $perms ){\n\t$perms[ 'forum' ] = 'Can Post to Forum';\n\t$perms[ 'forum_moderate' ] = 'Can Moderate Forum';\n\treturn $perms;\n}", "function groups_calculate_role_people($rs,$context) {\n global $CFG;\n if(!$rs) {\n return false;\n }\n \n $roles = get_records_menu('role', null, 'name', 'id, name');\n $aliasnames = role_fix_names($roles, $context);\n\n // Array of all involved roles\n $roles=array();\n // Array of all retrieved users\n $users=array();\n // Fill arrays\n while($rec=rs_fetch_next_record($rs)) {\n // Create information about user if this is a new one\n if(!array_key_exists($rec->userid,$users)) {\n // User data includes all the optional fields, but not any of the\n // stuff we added to get the role details\n $userdata=clone($rec);\n unset($userdata->roleid);\n unset($userdata->roleshortname);\n unset($userdata->rolename);\n unset($userdata->userid);\n $userdata->id=$rec->userid;\n\n // Make an array to hold the list of roles for this user\n $userdata->roles=array();\n $users[$rec->userid]=$userdata;\n }\n // If user has a role...\n if(!is_null($rec->roleid)) {\n // Create information about role if this is a new one\n if(!array_key_exists($rec->roleid,$roles)) {\n $roledata=new StdClass;\n $roledata->id=$rec->roleid;\n $roledata->shortname=$rec->roleshortname;\n if(array_key_exists($rec->roleid,$aliasnames)) {\n $roledata->name=$aliasnames[$rec->roleid];\n } else {\n $roledata->name=$rec->rolename;\n }\n $roledata->users=array();\n $roles[$roledata->id]=$roledata;\n }\n // Record that user has role\n $users[$rec->userid]->roles[] = $roles[$rec->roleid];\n }\n }\n rs_close($rs);\n\n // Return false if there weren't any users\n if(count($users)==0) {\n return false;\n }\n\n // Add pseudo-role for multiple roles\n $roledata=new StdClass;\n $roledata->name=get_string('multipleroles','role');\n $roledata->users=array();\n $roles['*']=$roledata;\n\n // Now we rearrange the data to store users by role\n foreach($users as $userid=>$userdata) {\n $rolecount=count($userdata->roles);\n if($rolecount==0) {\n debugging(\"Unexpected: user $userid is missing roles\");\n } else if($rolecount>1) {\n $roleid='*';\n } else {\n $roleid=$userdata->roles[0]->id;\n }\n $roles[$roleid]->users[$userid]=$userdata;\n }\n\n // Delete roles not used\n foreach($roles as $key=>$roledata) {\n if(count($roledata->users)===0) {\n unset($roles[$key]);\n }\n }\n\n // Return list of roles containing their users\n return $roles;\n}", "function system_remfrom_group($paramv)\n{\n\t\n}", "function dbAddUserToDefaultGroups($user_id){\n try {\n global $db_table_prefix;\n\n $db = pdoConnect();\n\n $query = \"SELECT\n id, is_default\n FROM \".$db_table_prefix.\"groups where is_default >= 1\";\n\n $stmt = $db->prepare($query);\n\n if (!$stmt->execute()){\n // Error\n return false;\n }\n\n // Query to insert group membership\n $query_user = \"INSERT INTO \".$db_table_prefix.\"user_group_matches (\n\t\tgroup_id,\n\t\tuser_id\n\t\t)\n\t\tVALUES (\n\t\t:group_id,\n\t\t:user_id\n\t\t)\";\n\n $stmt_user = $db->prepare($query_user);\n\n $primary_group_id = null;\n // Insert match for each default group\n while ($r = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $group_id = $r['id'];\n if ($r['is_default'] == '2')\n $primary_group_id = $group_id;\n $sqlVars = array(':group_id' => $group_id, ':user_id' => $user_id);\n $stmt_user->execute($sqlVars);\n }\n\n // Set primary group for user\n if ($primary_group_id){\n if (!updateUserField($user_id, 'primary_group_id', $primary_group_id)){\n return false;\n }\n } else {\n\t\t addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n\t\t\treturn false;\n\t\t}\n\n $stmt = null;\n\n return true;\n\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n }\n}", "function &group_list($start=NULL, $limit=NULL, $direction=0, $where=NULL)\n\n {\n\n global $database, $user;\n\n \n\n\t $message_array = array();\n\n \n\n\t // MAKE SURE MESSAGES ARE ALLOWED\n\n\t \n\n \n\n // BEGIN MESSAGE QUERY\n\n $sql = \"\n\n SELECT\n\n *\n\n FROM\n\n se_groups\n\n WHERE\n\n owner='{$user->user_info['user_username']}'\n\n \";\n\n // EXECUTE QUERY\n\n $resource = $database->database_query($sql);\n\n \n\n // GET MESSAGES\n\n\t while( $message_info=$database->database_fetch_assoc($resource) )\n\n {\n\n // CREATE AN OBJECT FOR MESSAGE AUTHOR/RECIPIENT\n\n $pm_user = new SEUser();\n\n $pm_user->user_info['id'] = $message_info['id'];\n\n $pm_user->user_info['grup'] = $message_info['grup'];\n\n $pm_user->user_info['owner'] = $message_info['owner'];\n\n $pm_user->user_displayname();\n\n \n\n // Remove breaks for preview\n\n $message_info['pm_body'] = str_replace(\"<br>\", \"\", $message_info['pm_body']);\n\n \n\n // SET MESSAGE ARRAY\n\n $message_array[] = array(\n\n 'pmconvo_id' => $message_info['id'],\n\n 'pmconvo_grup' => $message_info['grup'],\n\n 'pm_owner' => $message_info['owner'],\n\t\t'pm_body' => $message_info['pm_body']\n\t\t\n\n );\n\n \n\n unset($pm_user);\n\n }\n\n \n\n return $message_array;\n\n }", "static function get_apigroup();", "function system_addto_group($paramv)\n{\n}", "function userAddOns($op, &$edit, &$account, $category ) {\r\n\r\n/*\r\n&$edit The array of form values submitted by the user.\r\n&$account The user object on which the operation is being performed.\r\n$category The active category of user information being edited.\r\n*/\r\n\r\n\r\n switch ($op) {//What kind of action is being performed. Possible values (in alphabetical order):\r\n\r\n case \"after_update\": \t//The user object has been updated and changed. Use this if (probably along with 'insert') if you want to reuse some information from the user object.\r\n break;\r\n case \"categories\": \t\t//A set of user information categories is requested.\r\n break;\r\n case \"delete\": \t\t\t//The user account is being deleted. The module should remove its custom additions to the user object from the database.\r\n break;\r\n case \"form\": \t\t\t//The user account edit form is about to be displayed. The module should present the form elements it wishes to inject into the form.\r\n return userFormAddons($edit,$account->struct);\r\n break;\r\n case \"insert\": \t\t\t//The user account is being added. The module should save its custom additions to the user object into the database and set the saved fields to NULL in $edit.\r\n return set_user_struct($account);\r\n break;\r\n case \"load\": \t\t\t//The user account is being loaded. The module may respond to this\r\n get_user_struct($account);\r\n break;\r\n case \"login\": \t\t\t//The user just logged in.\r\n break;\r\n case \"logout\":\t\t\t//The user just logged out. and insert additional information into the user object.\r\n break;\r\n case \"register\": \t\t//The user account registration form is about to be displayed. The module should present the form elements it wishes to inject into the form.\r\n return userFormAddons($edit,$account->struct,TRUE);\r\n break;\r\n case \"submit\": \t\t\t//Modify the account before it gets saved.\r\n break;\r\n case \"update\": \t\t\t//The user account is being changed. The module should save its custom additions to the user object into the database and set the saved fields to NULL in $edit.\r\n return set_user_struct($account);\r\n break;\r\n case \"validate\": \t\t//The user account is about to be modified. The module should validate its custom additions to the user object, registering errors as necessary.\r\n break;\r\n case \"view\": \t\t\t//The user's account information is being displayed. The module should format its custom additions for display, and add them to the $account->content array.\r\n if (isset($account->struct))\r\n $account->content['struct']=array(\r\n '#type'=>'item',\r\n '#title'=>'Strutture di riferimento',\r\n '#value'=>implode('<br>',get_structure($account->struct,NULL,NULL,'Tutte')).'<br>',\r\n '#weight'=>0\r\n );\r\n break;\r\n }\r\n\r\n}", "function _user_is_admin_user($key){ //GENHD-129 added flag in user form to allow access to acm and study inizialization to the user\n\t$retval = array();\n\t$bind = array();\n\t$bind['KEY'] = $key;\n\t$rs = db_query_bind(\"select ugu.userid, ugu.id_gruppou, ugu.abilitato from utenti_gruppiu ugu, gruppiu gu, ana_gruppiu agu, utenti_visteammin uva where gu.id_gruppou=agu.id_gruppou and ugu.id_gruppou=gu.id_gruppou and gu.abilitato=1 and upper(agu.nome_gruppo) in ('PROFILO AMMINISTRATORE','ACM_ADMIN') and uva.userid=ugu.userid and ugu.userid=:KEY\",$bind);\n\t//echo \"<b>select ugu.userid, ugu.id_gruppou, ugu.abilitato from utenti_gruppiu ugu, gruppiu gu, ana_gruppiu agu, utenti_visteammin uva where gu.id_gruppou=agu.id_gruppou and ugu.id_gruppou=gu.id_gruppou and gu.abilitato=1 and agu.nome_gruppo='Profilo amministratore' and uva.userid=ugu.userid and ugu.userid=\".$bind['KEY'].\"</b>\";\n\tif ($row = db_nextrow($rs)){\n\t\t$retval = $row;\n\t}\n\t// echo \"<pre>\";\n\t// print_r($retval);\n\t// echo \"</pre>\";\n\treturn $retval;\n}", "function adrotate_manage_group() {\n\tglobal $wpdb, $adrotate_config, $adrotate_debug;\n\n\t$status = $view = $group_edit_id = '';\n\tif(isset($_GET['status'])) $status = esc_attr($_GET['status']);\n\tif(isset($_GET['view'])) $view = esc_attr($_GET['view']);\n\tif(isset($_GET['group'])) $group_edit_id = esc_attr($_GET['group']);\n\n\tif(isset($_GET['month']) AND isset($_GET['year'])) {\n\t\t$month = esc_attr($_GET['month']);\n\t\t$year = esc_attr($_GET['year']);\n\t} else {\n\t\t$month = date(\"m\");\n\t\t$year = date(\"Y\");\n\t}\n\t$monthstart = mktime(0, 0, 0, $month, 1, $year);\n\t$monthend = mktime(0, 0, 0, $month+1, 0, $year);\t\n\n\t$now \t\t\t= adrotate_now();\n\t$today \t\t\t= adrotate_date_start('day');\n\t$in2days \t\t= $now + 172800;\n\t$in7days \t\t= $now + 604800;\n\t?>\n\t<div class=\"wrap\">\n\t\t<h1><?php _e('Groups', 'adrotate-pro'); ?></h1>\n\n\t\t<?php if($status > 0) adrotate_status($status); ?>\n\n\t\t<div class=\"tablenav\">\n\t\t\t<div class=\"alignleft actions\">\n\t\t\t\t<a class=\"row-title\" href=\"<?php echo admin_url('/admin.php?page=adrotate-groups');?>\"><?php _e('Manage', 'adrotate-pro'); ?></a> | \n\t\t\t\t<a class=\"row-title\" href=\"<?php echo admin_url('/admin.php?page=adrotate-groups&view=addnew');?>\"><?php _e('Add New', 'adrotate-pro'); ?></a>\n\t\t\t</div>\n\t\t</div>\n\n \t<?php\n\t if ($view == \"\") {\n\t\t\tinclude(\"dashboard/publisher/groups-main.php\");\n\t \t} else if($view == \"addnew\" OR $view == \"edit\") {\n\t\t\tinclude(\"dashboard/publisher/groups-edit.php\");\n\t \t}\n\t \t?>\n\t\t<br class=\"clear\" />\n\n\t\t<?php echo adrotate_trademark(); ?>\n\n\t</div>\n<?php\n}", "function fetchGroupUsers($group_id) {\n try {\n global $db_table_prefix;\n\n $results = array();\n\n $db = pdoConnect();\n\n $sqlVars = array();\n\n $query = \"SELECT {$db_table_prefix}users.id as user_id, user_name, display_name, email, title, sign_up_stamp,\n last_sign_in_stamp, active, enabled, primary_group_id\n FROM \".$db_table_prefix.\"user_group_matches,\".$db_table_prefix.\"users\n WHERE group_id = :group_id and \".$db_table_prefix.\"user_group_matches.user_id = \".$db_table_prefix.\"users.id\n \";\n\n $stmt = $db->prepare($query);\n\n $sqlVars[':group_id'] = $group_id;\n\n if (!$stmt->execute($sqlVars)){\n // Error\n return false;\n }\n\n while ($r = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $id = $r['user_id'];\n $results[$id] = $r;\n }\n $stmt = null;\n\n return $results;\n\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n }\n}", "function sumo_put_user_grouplevel($id=FALSE)\n{\n\t$user\t = sumo_get_user_info($id, 'id', FALSE);\n\t$group_level = $user['group_level'];\n\n\tif(!empty($group_level))\n\t{\n\t\tGLOBAL $SUMO, $language;\n\n\t\t$num_groups = count($group_level);\n\t\t$group \t\t= array_keys($group_level);\n\t\t$value\t\t= array_values($group_level);\n\t\t$list \t\t= '';\n\n\t\tfor($g=0; $g<$num_groups; $g++)\n\t\t{\n\t\t\tif($group[$g])\n\t\t\t{\n\t\t\t\t$SUMO['user']['group_level'][$group[$g]] = !isset($SUMO['user']['group_level'][$group[$g]]) ? '' : $SUMO['user']['group_level'][$group[$g]];\n\n\t\t\t\t$style \t\t\t= sumo_alternate_str('tab-row-on', 'tab-row-off');\n\t\t\t\t$val \t\t\t= \"<select name='group_level[$g]'>\\n<option value='\".$value[$g].\"'>\".$value[$g].\"</option>\\n\";\n\t\t\t\t$last_value\t\t= !isset($SUMO['user']['group_level'][$group[$g]]) ? 7 : $SUMO['user']['group_level'][$group[$g]];\n\t\t\t\t$last_value = (in_array('sumo', $SUMO['user']['group']) && $group[$g] != 'sumo') ? 7 : $last_value;\n\t\t\t\t$group_name[$g] = \"<input type='hidden' name='group_name[$g]' value='\".$group[$g].\"'>\".$group[$g];\n\n\t\t\t\t// Create link to remove group\n\t\t\t\tif($SUMO['user']['group_level'][$group[$g]] > $value[$g] || $SUMO['user']['group_level']['sumo'] >= 4)\n\t\t\t\t\t$delete = \"<a href='javascript:sumo_ajax_get(\\\"\".$_SESSION['module'].\".content\\\",\\\"?module=users&action=deletegroup&group=\".$group[$g].\":\".$value[$g].\"&id=\".intval($id).\"&decoration=false&SecurityOptions_visibility=1\\\");'>\".$language['Remove'].\"</a>\";\n\t\t\t\telse\n\t\t\t\t\t$delete = '';\n\n\n\t\t\t\tif($SUMO['user']['group_level'][$group[$g]] > $value[$g] || in_array('sumo', $SUMO['user']['group']))\n\t\t\t\t{\n\t\t\t\t\tfor($l=1; $l<=$last_value; $l++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($l != $value[$g]) $val .= \"<option value='$l'>$l</option>\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$val .= \"</select>\";\n\n\t\t\t\t// Only for SUMO user (administrator)\n\t\t\t\tif($user['user'] == 'sumo')\n\t\t\t\t{\n\t\t\t\t\t$val = 7;\n\t\t\t\t\t$delete = '';\n\t\t\t\t}\n\n\n\t\t\t\t$list .= \"<tr>\\n\"\n\t\t\t\t\t\t.\" <td class='\".$style.\"'>\".$group_name[$g].\"</td>\\n\"\n\t\t\t\t\t\t.\" <td class='\".$style.\"'>\".sumo_get_group_description($group[$g]).\"</td>\\n\"\n\t\t\t\t\t\t.\" <td class='\".$style.\"'>\".$val.\"</td>\\n\"\n\t\t\t\t\t\t.\" <td class='\".$style.\"'>\".$delete.\"</td>\\n\"\n\t\t\t\t\t\t.\"</tr>\\n\";\n\t\t\t}\n\t\t}\n\n\t\treturn $list;\n\t}\n\telse return FALSE;\n}", "function groups_add_member($groupid, $userid) {\n if (!groups_group_exists($groupid)) {\n return false;\n }\n\n if (groups_is_member($groupid, $userid)) {\n return true;\n }\n\n $member = new object();\n $member->groupid = $groupid;\n $member->userid = $userid;\n $member->timeadded = time();\n\n if (!insert_record('groups_members', $member)) {\n return false;\n }\n\n //update group info\n set_field('groups', 'timemodified', $member->timeadded, 'id', $groupid);\n\n //trigger groups events\n $eventdata = new object();\n $eventdata->groupid = $groupid;\n $eventdata->userid = $userid;\n events_trigger('groups_member_added', $eventdata);\n\n return true;\n}", "function groupControl() {\n $arrFunctions = array(\n 'row_up' => '$intKey-1',\n 'row_down' => '$intKey+1',\n 'row_turndown' => 'intGroups',\n 'row_turnup' => '1',\n 'row_remove' => '[$intGroups]',\n 'rule_remove' => \"[$intKey]['rule'][$grplength-1]\",\n );\n foreach($this->arrTableParameters['grps'] as $intGroup => $arrGroup) {\n foreach ($arrGroup['rule'] as $intRule => $arrRule) {\n $arrRule['field'] = stripslashes($arrRule['field']);\n if ($arrRule['field'] == $this->extKey.'_new') {\n if ($intRule==0) {\n unset($this->arrTableParameters['grps'][$intGroup]);\n } else {\n unset($this->arrTableParameters['grps'][$intGroup]['rule'][$intRule]);\n }\n }\n }\n }\n $intGroups = count($this->arrTableParameters['grps']);\n foreach ($arrFunctions as $strKey => $strValue) {\n if (is_array($this->arrTableParameters[$strKey])) {\n $intKey = key($this->arrTableParameters[$strKey]);\n if (is_array($this->arrTableParameters['rule_remove'])) {\n \t$intRule = key($this->arrTableParameters['rule_remove'][$intKey]);\n }\n if ($strKey!='row_turndown') {\n $arrTemp = $this->arrTableParameters['grps'][$intKey];\n } else {\n $arrTemp = $this->arrTableParameters['grps'][1];\n }\n if ($strKey=='row_up') {\n $this->arrTableParameters['grps'][$intKey] = $this->arrTableParameters['grps'][$intKey-1];\n } elseif ($strKey=='row_down') {\n $this->arrTableParameters['grps'][$intKey] = $this->arrTableParameters['grps'][$intKey+1];\n } elseif ($strKey=='row_turndown') {\n for ($intCounter=2;$intCounter<=$intGroups;$intCounter++) {\n $this->arrTableParameters['grps'][$intCounter-1] = $this->arrTableParameters['grps'][$intCounter];\n }\n } elseif ($strKey=='row_turnup') {\n for ($intCounter=$intGroups;$intCounter>1;$intCounter--) {\n $this->arrTableParameters['grps'][$intCounter] = $this->arrTableParameters['grps'][$intCounter-1];\n }\n } elseif ($strKey=='row_remove') {\n for ($intCounter=$intKey;$intCounter<=$intGroups;$intCounter++) {\n $this->arrTableParameters['grps'][$intCounter] = $this->arrTableParameters['grps'][$intCounter+1];\n }\n } elseif ($strKey=='rule_remove') {\n if (count($this->arrTableParameters['grps'][$intKey]['rule'])>1) {\n for ($intCounter=$intRule;$intCounter<count($this->arrTableParameters['grps'][$intKey]['rule']);$intCounter++) {\n $this->arrTableParameters['grps'][$intKey]['rule'][$intCounter] = $this->arrTableParameters['grps'][$intKey]['rule'][$intCounter+1];\n }\n }\n }\n if (in_array($strKey,array('row_up','row_down','row_turndown','row_turnup'))) {\n eval(\"\\$this->arrTableParameters['grps'][\".$strValue.\"] = \\$arrTemp;\");\n } elseif ($strKey=='row_remove') {\n unset($this->arrTableParameters['grps'][$intGroups]);\n } else {\n \tunset($this->arrTableParameters['grps'][$intKey]['rule'][count($this->arrTableParameters['grps'][$intKey]['rule'])-1]);\n }\n }\n }\n }", "function get_list_members($course, &$nonmembers, &$listgroups)\r\n{\r\n/// First, get everyone into the nonmembers array\r\n if ($students = get_course_students($course->id)) {\r\n foreach ($students as $student) {\r\n $nonmembers[$student->id] = fullname($student, true);\r\n }\r\n unset($students);\r\n }\r\n\r\n if ($teachers = get_course_teachers($course->id)) {\r\n foreach ($teachers as $teacher) {\r\n $prefix = '- ';\r\n if (isteacheredit($course->id, $teacher->id)) {\r\n $prefix = '# ';\r\n }\r\n $nonmembers[$teacher->id] = $prefix.fullname($teacher, true);\r\n }\r\n unset($teachers);\r\n }\r\n\r\n/// Pull out all the members into little arrays\r\n\t$groups = get_groups($course->id);\r\n if ($groups) {\r\n foreach ($groups as $group) {\r\n $countusers = 0;\r\n $listmembers[$group->id] = array();\r\n if ($groupusers = get_group_users($group->id)) {\r\n foreach ($groupusers as $groupuser) {\r\n $listmembers[$group->id][$groupuser->id] = $nonmembers[$groupuser->id];\r\n //unset($nonmembers[$groupuser->id]);\r\n $countusers++;\r\n }\r\n natcasesort($listmembers[$group->id]);\r\n }\r\n $listgroups[$group->id] = $group->name.\" ($countusers)\";\r\n }\r\n natcasesort($listgroups);\r\n }\r\n\r\n natcasesort($nonmembers);\r\n\tif (empty($selectedgroup)) { // Choose the first group by default\r\n if (!empty($listgroups) && ($selectedgroup = array_shift(array_keys($listgroups)))) {\r\n $members = $listmembers[$selectedgroup];\r\n }\r\n } else {\r\n $members = $listmembers[$selectedgroup];\r\n }\r\n\treturn $listmembers;\r\n}", "public function getGroupMembers($dependency = null, $id = null) {\n global $USER; \n checkCapabilities('user:getGroupMembers', $USER->role_id);\n switch ($dependency) {\n case 'group': $db = DB::prepare('SELECT DISTINCT user_id FROM groups_enrolments \n WHERE group_id = ?\n AND status = 1');\n $db->execute(array($id)); \n while($result = $db->fetchObject()) { \n $group_members[] = $result->user_id;\n }\n if (isset($group_members)){\n return $group_members;\n } else { return false;}\n break;\n case 'my_groups': $db = DB::prepare('SELECT DISTINCT usr.id, usr.firstname, usr.lastname, usr.username\n FROM users AS usr, groups_enrolments AS ge, institution_enrolments AS ie, groups AS gr \n WHERE ge.group_id IN (SELECT DISTINCT group_id FROM groups_enrolments WHERE user_id = ?)\n AND ie.user_id = ?\n AND usr.id = ge.user_id \n AND gr.id = ge.group_id \n AND gr.institution_id = ie.institution_id \n AND ge.status = 1');//Zeigt nur User in deren Gruppe man eingeschrieben ist. \n $db->execute(array($this->id, $this->id)); \n \n while($result = $db->fetchObject()) { \n $class_members[] = clone $result;\n } \n if (isset($class_members)){\n return $class_members;\n } else { \n return false;\n }\n break;\n default: if (checkCapabilities('user:userListComplete', $USER->role_id,false)){\n $db = DB::prepare('SELECT DISTINCT us.id, us.firstname, us.lastname, us.username FROM users AS us ORDER BY us.lastname');//Zeige alle User --> nur für globale Admin Rolle !. \n $db->execute(array()); \n } else {\n $db = DB::prepare('SELECT DISTINCT usr.id, usr.firstname, usr.lastname, usr.username\n FROM users AS usr, groups_enrolments AS ge, institution_enrolments AS ie, groups AS gr \n WHERE ge.group_id IN (SELECT DISTINCT group_id FROM groups_enrolments WHERE user_id = ?)\n AND ie.user_id = ?\n AND usr.id = ge.user_id \n AND gr.id = ge.group_id \n AND gr.institution_id = ie.institution_id \n AND ge.status = 1');//Zeigt nur User in deren Gruppe man eingeschrieben ist. \n $db->execute(array($this->id, $this->id)); \n }\n \n while($result = $db->fetchObject()) { \n $class_members[] = clone $result;\n } \n if (isset($class_members)){\n return $class_members;\n } else {\n return false; \n }\n break;\n }\n }", "function bn_auto_group_join($userid, $x = 0, $y = 0){\r\n global $wpdb, $bp, $user_id;\r\n // get the user id\r\n if ($bp->loggedin_user->id && $x !== 'myid') {\r\n $userid = $bp->loggedin_user->id ; // current user if logged in. On activation, userid sent with do_action\r\n }\r\n\r\n // All users\r\n if($all_users_group = get_option('gaj_all_users_group')) {\r\n check_and_add_to_group($userid, $all_users_group);\r\n }\r\n\r\n // get profile fields with group linking\r\n $profiles = $wpdb->get_results(\"SELECT * FROM {$bp->profile->table_name_fields} WHERE group_link = 1\");\r\n foreach ($profiles as $profile) {\r\n\r\n // see what the person has for that field\r\n $profileinfo = $wpdb->get_results(\"SELECT value FROM {$bp->profile->table_name_data} WHERE user_id = $userid AND field_id = $profile->id\");\r\n foreach ($profileinfo as $profilevalue ) {\r\n\r\n // see if we can match the group\r\n $groupmatches = $wpdb->get_results(\"SELECT * FROM {$bp->groups->table_name} WHERE name like '$profile->group_pre_regex$profilevalue->value$profile->group_post_regex'\");\r\n foreach ($groupmatches as $groupmatch) {\r\n if(!check_and_add_to_group($userid, $groupmatch->id)) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n\r\n}", "function group_get_admin_ids($groupid) {\n return (array)get_column_sql(\"SELECT member\n FROM {group_member}\n WHERE \\\"group\\\" = ?\n AND role = 'admin'\", $groupid);\n}", "function isAuthorized_menu_fmks($strUsers, $strGroups, $UserName, $UserGroup) { \n // For security, start by assuming the visitor is NOT authorized. \n $isValid = False; \n\n // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. \n // Therefore, we know that a user is NOT logged in if that Session variable is blank. \n if (!empty($UserName)) { \n // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. \n // Parse the strings into arrays. \n $arrUsers = Explode(\",\", $strUsers); \n $arrGroups = Explode(\",\", $strGroups); \n if (in_array($UserName, $arrUsers)) { \n $isValid = true; \n } \n // Or, you may restrict access to only certain users based on their username. \n if (in_array($UserGroup, $arrGroups)) { \n $isValid = true; \n } \n if (($strUsers == \"\") && true) { \n $isValid = true; \n } \n } \n return $isValid; \n}", "function isAuthorized_menu_fmks($strUsers, $strGroups, $UserName, $UserGroup) { \n // For security, start by assuming the visitor is NOT authorized. \n $isValid = False; \n\n // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. \n // Therefore, we know that a user is NOT logged in if that Session variable is blank. \n if (!empty($UserName)) { \n // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. \n // Parse the strings into arrays. \n $arrUsers = Explode(\",\", $strUsers); \n $arrGroups = Explode(\",\", $strGroups); \n if (in_array($UserName, $arrUsers)) { \n $isValid = true; \n } \n // Or, you may restrict access to only certain users based on their username. \n if (in_array($UserGroup, $arrGroups)) { \n $isValid = true; \n } \n if (($strUsers == \"\") && true) { \n $isValid = true; \n } \n } \n return $isValid; \n}", "public function enroll_user_to_group(){\n\t\t $users = array();\n\t\t\t$all_checked_request = $_REQUEST['request_id'];\n\t\t\t$group_id = $_REQUEST['group_id'];\n\t\t\t$group_user_limit = get_post_meta($group_id, 'wdm_group_users_limit_'.$group_id, true);\n\t\t\tif($group_user_limit > 0){\n\t\t\t\tforeach($all_checked_request as $request_id){\n\t\t\t\t\t$request_id = (int)$request_id;\n\t\t\t\t\t$request_info = $this->course_request_by_id($request_id);\n\t\t\t\t\t$user_id = (int)$request_info[0]->user_id;\n\t\t\t\t\tld_update_group_access($user_id, $group_id);\n\t\t\t\t\tupdate_user_meta( $user_id, 'learndash_group_users_'.$group_id.'', $group_id );\n\t\t\t\t\t$this->update_course_request($request_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public static function getAllGroups($entriesOnly = FALSE) {\n global $lC_Database, $lC_Language, $_module;\n\n $lC_Language->loadIniFile('administrators.php');\n \n $media = $_GET['media']; \n\n $QadminGroups = $lC_Database->query('select id, name from :table_administrators_groups order by id');\n $QadminGroups->bindTable(':table_administrators_groups', TABLE_ADMINISTRATORS_GROUPS);\n $QadminGroups->execute();\n\n $result = array('entries' => array());\n $result = array('aaData' => array());\n while ( $QadminGroups->next() ) {\n $name = '<td>' . $QadminGroups->valueProtected('name') . '</td>';\n $modules = '<td class=\"hide-on-tablet\">' . self::getAccessBlocks($QadminGroups->valueInt('id')) . '</td>';\n $members = '<td>' . self::getTotalMembers($QadminGroups->valueInt('id')) . '</td>';\n $action = '<td class=\"align-right vertical-center\"><span class=\"button-group compact\">\n <a href=\"' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? '#' : lc_href_link_admin(FILENAME_DEFAULT, 'administrators&set=access&gid=' . $QadminGroups->valueInt('id'))) . '\" class=\"button icon-pencil ' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? 'disabled' : NULL) . '\">' . (($media === 'mobile-portrait' || $media === 'mobile-landscape') ? NULL : $lC_Language->get('icon_edit')) . '</a>\n <a href=\"' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? '#' : 'javascript://\" onclick=\"deleteGroup(\\'' . $QadminGroups->valueInt('id') . '\\', \\'' . urlencode($QadminGroups->valueProtected('name')) . '\\')') . '\" class=\"button icon-trash with-tooltip ' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? 'disabled' : NULL) . '\" title=\"' . $lC_Language->get('icon_delete') . '\"></a></span></td>';\n // modification of default top level admin is prohibited\n if ($QadminGroups->valueInt('id') == '1' || $QadminGroups->value('name') == $lC_Language->get('text_top_administrator')) $action = '';\n $result['aaData'][] = array(\"$name\", \"$modules\", \"$members\", \"$action\");\n $result['entries'][] = $QadminGroups->toArray();\n }\n\n $QadminGroups->freeResult();\n\n if ($entriesOnly) return $result['entries'];\n return $result;\n }", "function b_system_info_show($options)\n{\n $xoops = Xoops::getInstance();\n $xoops->db();\n global $xoopsDB;\n $myts = MyTextSanitizer::getInstance();\n $block = array();\n if (!empty($options[3])) {\n $block['showgroups'] = true;\n $result = $xoopsDB->query(\"SELECT u.uid, u.uname, u.email, u.user_viewemail, u.user_avatar, g.name AS groupname FROM \" . $xoopsDB->prefix(\"groups_users_link\") . \" l LEFT JOIN \" . $xoopsDB->prefix(\"users\") . \" u ON l.uid=u.uid LEFT JOIN \" . $xoopsDB->prefix(\"groups\") . \" g ON l.groupid=g.groupid WHERE g.group_type='Admin' ORDER BY l.groupid, u.uid\");\n if ($xoopsDB->getRowsNum($result) > 0) {\n $prev_caption = \"\";\n $i = 0;\n while ($userinfo = $xoopsDB->fetchArray($result)) {\n if ($prev_caption != $userinfo['groupname']) {\n $prev_caption = $userinfo['groupname'];\n $block['groups'][$i]['name'] = $myts->htmlSpecialChars($userinfo['groupname']);\n }\n if ($xoops->isUser()) {\n $block['groups'][$i]['users'][] = array(\n 'id' => $userinfo['uid'],\n 'name' => $myts->htmlspecialchars($userinfo['uname']),\n 'pm_link' => XOOPS_URL . \"/pmlite.php?send2=1&amp;to_userid=\" . $userinfo['uid'],\n 'avatar' => XOOPS_UPLOAD_URL . '/' . $userinfo['user_avatar']\n );\n } else {\n if ($userinfo['user_viewemail']) {\n $block['groups'][$i]['users'][] = array(\n 'id' => $userinfo['uid'],\n 'name' => $myts->htmlspecialchars($userinfo['uname']),\n 'msg_link' => $userinfo['email'],\n 'avatar' => XOOPS_UPLOAD_URL . '/' . $userinfo['user_avatar']\n );\n } else {\n $block['groups'][$i]['users'][] = array(\n 'id' => $userinfo['uid'],\n 'name' => $myts->htmlspecialchars($userinfo['uname'])\n );\n }\n }\n $i++;\n }\n }\n } else {\n $block['showgroups'] = false;\n }\n $block['logourl'] = XOOPS_URL . '/images/' . $options[2];\n $block['recommendlink'] = \"<a href=\\\"javascript:openWithSelfMain('\" . XOOPS_URL . \"/misc.php?action=showpopups&amp;type=friend&amp;op=sendform&amp;t=\" . time() . \"','friend',\" . $options[0] . \",\" . $options[1] . \")\\\">\" . SystemLocale::RECOMMEND_US . \"</a>\";\n return $block;\n}", "function is_admin($userId){\n $query = selectRecord(TAB_USR_ROLE, \"userId = $userId\");\n if($query['groupId'] == 1)\n return 1;\n else\n return 0;\n}", "function virustotalscan_check_permissions($groups_comma)\r\n{\r\n global $mybb;\r\n // daca nu a fost trimis niciun grup ca si parametru\r\n if ($groups_comma == '') return false;\r\n // se verifica posibilitatea ca nu cumva sa fie mai multe grupuri trimise ca parametru\r\n $groups = explode(\",\", $groups_comma);\r\n // se creaza vectori cu acestee grupuri\r\n $add_groups = explode(\",\", $mybb->user['additionalgroups']);\r\n // se fac teste de apartenenta\r\n if (!in_array($mybb->user['usergroup'], $groups)) { \r\n // in grupul primar nu este\r\n // verificam mai departe daca este in cel aditional, secundar\r\n if ($add_groups) {\r\n if (count(array_intersect($add_groups, $groups)) == 0)\r\n return false;\r\n else\r\n return true;\r\n }\r\n else \r\n return false;\r\n }\r\n else\r\n return true;\r\n}", "function ldap_authorized($group) {\nif (!isset($_SERVER['PHP_AUTH_USER'])) {\n header(\"WWW-Authenticate: Basic realm=\\\"Private Area\\\"\");\n header(\"HTTP/1.0 401 Unauthorized\");\n // only reached if authentication fails\n print \"Sorry - you need to login to access this page... please reload and try again\\n\";\n exit;\n}\nelse {\n // only reached if basic HTTPS authentication succeeds\n$ldaphost = '####LDAP SERVER####';\n$ldapport = 636;\n$ds = ldap_connect($ldaphost, $ldapport)\nor die(\"Could not connect to $ldaphost\");\n ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);\n ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);\n //ldap_set_option($ds, LDAP_OPT_DEBUG_LEVEL, 7);\nif ($ds)\n{\n $bind_username = \"####BIND USER FULL DN####\";\n $bind_passwd = \"####BIND PW####\";\n $ldapbind = ldap_bind($ds, $bind_username, $bind_passwd);\n $ldaptree = \"####OU/DN FOR USERS####\";\n $ldap_user = $_SERVER['PHP_AUTH_USER'];\n // Debug stuff user/group selection\n //$ldap_user = \"adamtest\";\n $filter=\"(member=*$ldap_user*)\";\n $onlythis = array(\"member\");\n // $ds is a valid link identifier for a directory server\n\n if ($ldapbind)\n {\n //print \"Congratulations! $username is authenticated.\";\n $result = ldap_search($ds, $ldaptree, $filter, $onlythis);\n $data = ldap_get_entries($ds, $result);\n $needle = \"uid=$ldap_user,####LDAP CONTEXT####\";\n $flipped_haystack = array_flip($data['0']['member']);\n if ( isset($flipped_haystack[$needle]))\n {\n return true;\n }\n else {\n return false;\n }\n // Debug ldap stuff\n //echo '<h3>date dump</h3><pre>';\n //print_r($data);\n //print_r($flipped_haystack);\n //echo '</pre>';\n // /end debug ldap stuff\n }\n else\n {\n return false;\n }\n }\n }\n }", "function get_group_users($groupid, $sort='u.lastaccess DESC', $exceptions='',\n $fields='u.*') {\n global $CFG;\n if (!empty($exceptions)) {\n $except = ' AND u.id NOT IN ('. $exceptions .') ';\n } else {\n $except = '';\n }\n // in postgres, you can't have things in sort that aren't in the select, so...\n $extrafield = str_replace('ASC','',$sort);\n $extrafield = str_replace('DESC','',$extrafield);\n $extrafield = trim($extrafield);\n if (!empty($extrafield)) {\n $extrafield = ','.$extrafield;\n }\n return get_records_sql(\"SELECT DISTINCT $fields $extrafield\n FROM {$CFG->prefix}user u,\n {$CFG->prefix}groups_members m\n WHERE m.groupid = '$groupid'\n AND m.userid = u.id $except\n ORDER BY $sort\");\n}", "function restructure_usrGroup($list, $more){\n $result = array();\n if($more){\n for($i = 0; $i < count($list); $i++){\n $result[$i]['id'] = $list[$i][0];\n $result[$i]['username'] = $list[$i][1];\n $result[$i]['password'] = $list[$i][2];\n $result[$i]['email'] = $list[$i][3];\n $result[$i]['group'] = $list[$i][4];\n }\n }else{\n $result['id'] = $list[0];\n $result['username'] = $list[1];\n $result['password'] = $list[2];\n $result['email'] = $list[3];\n $result['group'] = $list[4];\n }\n return $result;\n}", "function addModeratorUser($argArrPost) {\n// pre($argArrPost);\n $objCore = new Core;\n $varName = addslashes($argArrPost['frmName']);\n $varEmail = $argArrPost['frmUserEmail'];\n\n $varUserWhere = \" AdminUserName='\" . $varName . \"' OR AdminEmail='\" . $argArrPost['frmUserEmail'] . \"'\";\n $arrClms = array('pkAdminID', 'AdminUserName', 'AdminEmail');\n $arrUserList = $this->select(TABLE_ADMIN, $arrClms, $varUserWhere);\n\n\n if (isset($arrUserList[0]['pkAdminID']) && $arrUserList[0]['pkAdminID'] <> '') {\n\n\n $arrUserName = array();\n $arrUserEmail = array();\n foreach ($arrUserList as $key => $val) {\n if ($val['AdminUserName'] == $varName) {\n $arrUserName[] = $val['AdminUserName'];\n }\n if ($val['AdminEmail'] == $varEmail) {\n $arrUserEmail[] = $val['AdminEmail'];\n }\n }\n $varCountName = count($arrUserName);\n $varCountEmail = count($arrUserEmail);\n if ($varCountName > 0) {\n $_SESSION['sessArrUsers'] = $argArrPost;\n $objCore->setErrorMsg(ADMIN_USER_NAME_ALREADY_EXIST);\n return false;\n } else if ($varCountEmail > 0) {\n $_SESSION['sessArrUsers'] = $argArrPost;\n $objCore->setErrorMsg(ADMIN_USE_EMAIL_ALREADY_EXIST);\n return false;\n }\n } else {\n\n $varUserWhere = \" pkAdminRoleId='\" . $argArrPost['frmAdminRoll'] . \"'\";\n $arrClms = array('AdminRoleName');\n $arrRoleName = $this->select(TABLE_ADMIN_ROLL, $arrClms, $varUserWhere);\n //pre($arrRoleName[0]['AdminRoleName']);\n\n $arrColumnAdd = array(\n 'AdminTitle' => trim($argArrPost['frmTitle']),\n 'AdminUserName' => trim(stripslashes($argArrPost['frmName'])),\n 'AdminEmail' => trim(stripslashes($argArrPost['frmUserEmail'])),\n 'AdminPassword' => md5(trim($argArrPost['frmPassword'])),\n 'fkAdminRollId' => $argArrPost['frmAdminRoll'],\n 'AdminOldPass' => trim($argArrPost['frmPassword']),\n 'AdminCountry' => trim($argArrPost['frmCountry']),\n 'AdminType' => 'user-moderator',\n //'AdminRegion' => trim($argArrPost['frmRegion']),\n 'AdminDateAdded' => date(DATE_TIME_FORMAT_DB)\n );\n //pre($arrColumnAdd);\n $varUserID = $this->insert(TABLE_ADMIN, $arrColumnAdd);\n if ($_SERVER[HTTP_HOST] != '192.168.100.97') {\n\n //Send Mail To User\n $varPath = '<img src=\"' . SITE_ROOT_URL . 'common/images/logo.png' . '\"/>';\n $varToUser = $argArrPost['frmUserEmail'];\n $varFromUser = SITE_EMAIL_ADDRESS;\n $varSubject = SITE_NAME . ':Login Details';\n $varOutput = file_get_contents(SITE_ROOT_URL . 'common/email_template/html/admin_user_registration.html');\n $varUnsubscribeLink = 'Click <a href=\"' . SITE_ROOT_URL . 'unsubscribe.php?user=' . md5($argArrPost['frmUserEmail']) . '\" target=\"_blank\">here</a> to unsubscribe.';\n $varActivationLink = '';\n $arrBodyKeywords = array('{USER}', '{USER_NAME}', '{PASSWORD}', '{EMAIL}', '{ROLE}', '{SITE_NAME}', '{ACTIVATION_LINK}', '{IMAGE_PATH}', '{UNSUBSCRIBE_LINK}');\n $arrBodyKeywordsValues = array(trim(stripslashes($argArrPost['frmName'])), trim(stripslashes($argArrPost['frmName'])), trim($argArrPost['frmPassword']), trim(stripslashes($argArrPost['frmUserEmail'])), $arrRoleName[0]['AdminRoleName'], SITE_NAME, $varActivationLink, $varPath); //,$varUnsubscribeLink\n $varBody = str_replace($arrBodyKeywords, $arrBodyKeywordsValues, $varOutput);\n $objCore->sendMail($varToUser, $varFromUser, $varSubject, $varBody);\n $_SESSION['sessArrUsers'] = '';\n }\n $objCore->setSuccessMsg(ADMIN_USER_ADD_SUCCUSS_MSG);\n return true;\n }\n }", "function group_links($group, $uid = NULL) {\n global $userquery;\n\n if (!$uid)\n $uid = userid();\n\n $group_links = array();\n $group_array =\n array\n (\n 'group' => $group,\n 'groupid' => $group['group_id'],\n 'uid' => $uid,\n 'user' => $userquery->udetails,\n 'checkowner' => 'yes'\n );\n\n $group_owner_links = array();\n\n if ($this->is_owner($group)) {\n $group_owner_links =\n array(\n 'invite_members' => array(\n 'name' => lang('Invite members'),\n 'link' => BASEURL . '/invite_group.php?url=' . $group['group_url'],\n 'icon' => 'icon-star'\n )\n );\n }\n\n $group_admin_links = array();\n\n if ($this->is_admin($group_array)) {\n $group_admin_links = array(\n 'edit_group' => array(\n 'name' => lang('Edit group'),\n 'link' => BASEURL . '/edit_group.php?gid=' . $group['group_id'],\n 'icon' => 'icon-edit'\n ),\n 'manage_videos' => array(\n 'name' => lang('Manage videos'),\n 'link' => BASEURL . '/manage_groups.php?mode=manage_videos&gid=' . $group['group_id'],\n 'icon' => 'icon-tasks'\n ),\n 'manage_members' => array(\n 'name' => lang('Manage members'),\n 'link' => BASEURL . '/manage_groups.php?mode=manage_members&gid=' . $group['group_id'],\n 'icon' => 'icon-tasks'\n ),\n );\n }\n\n $group_members_link = array();\n\n if ($this->is_member($uid, $group['group_id'])) {\n $group_members_link = array(\n 'add_videos' => array(\n 'name' => lang('Add videos'),\n 'link' => BASEURL . '/add_group_videos.php?url=' . $group['group_url'],\n 'icon' => 'icon-plus'\n )\n );\n }\n\n $group_links = array_merge($group_owner_links, $group_admin_links, $group_members_link);\n\n $group_links = apply_filters($group_links, 'group_links');\n\n return $group_links;\n }", "function addUserToXoopsGroup( $gid, $uid ) {\n\t$member_handler =& xoops_gethandler('member');\n\tif ( ! $member_handler->addUserToGroup( $gid, $uid ) ) {\n\t\treturn false;\n\t}\n\t$myuid = $GLOBALS['xoopsUser']->getVar( 'uid', 'n' );\n\tif ( $myuid == $uid ) {\n\t\t// update group cache and session\n\t\t$mygroups = $member_handler->getGroupsByUser( $uid );\n\t\t$GLOBALS['xoopsUser']->setGroups( $mygroups );\n\t\tif ( isset( $_SESSION['xoopsUserGroups'] ) ) {\n\t\t\t$_SESSION['xoopsUserGroups'] = $mygroups;\n\t\t}\n\t}\n\treturn true;\n}", "function grabUsergroupInfo(){\n\t\t// Check for request forgeries\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\t\t\n\t\t$app \t= JFactory::getApplication();\n\t\t$db\t= JFactory::getDbo();\n\t\t$user \t= JFactory::getUser();\n\t\t$ugid \t= $app->input->get('ugid', 0, 'int');\n\t\t\n\t\t//if the user has JoomBri profile, redirect him to the dashboard\n \t\t$hasJBProfile = JblanceHelper::hasJBProfile($user->id);\t\n \t\tif($hasJBProfile){\n \t\t\t$link = JRoute::_('index.php?option=com_jblance&view=user&layout=dashboard', false);\n \t\t\t$this->setRedirect($link);\n \t\t\treturn;\n \t\t}\n\t\n\t\t$session = JFactory::getSession();\n\t\t$session->set('ugid', $ugid, 'register');\n\t\t$session->clear('skipPlan', 'register');\t//clear or reset skip plan session if the registration is restarted.\n\t\n\t\t$freeMode = JblanceHelper::isFreeMode($ugid);\n\t\n\t\tif($freeMode){\n\t\t\t// if the user is not registered, direct him to registration page else to profile page.\n\t\t\tif($user->id == 0)\n\t\t\t\t$return = JRoute::_('index.php?option=com_jblance&view=guest&layout=register&step=3', false);\n\t\t\telse\n\t\t\t\t$return = JRoute::_('index.php?option=com_jblance&view=guest&layout=usergroupfield', false);\n\t\n\t\t}\n\t\telse {\n\t\t\t// check for skipping of plan selection for this usergroup. If skipped, set the default plan for the usergroup\n\t\t\t$userHelper = JblanceHelper::get('helper.user');\n\t\t\t$ugroup = $userHelper->getUserGroupInfo(null, $ugid);\n\t\t\t\n\t\t\tif($ugroup->skipPlan){\n\t\t\t\t\n\t\t\t\t$query = \"SELECT id FROM #__jblance_plan WHERE default_plan=1 AND ug_id=\".$db->quote($ugid);\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$defaultPlanId = $db->loadResult();\n\t\t\t\t\n\t\t\t\tif(empty($defaultPlanId)){\n\t\t\t\t\t$app->enqueueMessage(JText::_('COM_JBLANCE_NO_DEFAULT_PLAN_FOR_THE_USERGROUP', 'error'));\n\t\t\t\t\t$return = JRoute::_('index.php?option=com_jblance&view=guest&layout=showfront', false);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$session->set('planid', $defaultPlanId, 'register');\n\t\t\t\t\t$session->set('gateway', 'banktransfer', 'register');\n\t\t\t\t\t$session->set('skipPlan', 1, 'register');\n\t\t\t\t\t// if the user is not registered, direct him to registration page else to profile page.\n\t\t\t\t\tif($user->id == 0)\n\t\t\t\t\t\t$return = JRoute::_('index.php?option=com_jblance&view=guest&layout=register&step=2', false);\n\t\t\t\t\telse \n\t\t\t\t\t\t$return = JRoute::_('index.php?option=com_jblance&view=guest&layout=usergroupfield&step=2', false);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$return\t= JRoute::_('index.php?option=com_jblance&view=membership&layout=planadd&step=2', false);\n\t\t\t}\n\t\t}\n\t\t$this->setRedirect($return);\n\t\treturn;\n\t}", "function getMemberGroupInfo() {\n global $inputs;\n\n if (empty($inputs)) {\n $mid = getLogin()['mid'];\n } else {\n $mid = $inputs['id'];\n }\n\n $res = getAll(\"SELECT b.*,a.id AS union_id \n FROM member_group a \n INNER JOIN `group` b \n ON a.group_id = b.id \n WHERE a.member_id = ?\", [$mid]);\n\n if (empty($inputs)) {\n return $res;\n } else {\n formatOutput(true, 'success', $res);\n }\n}", "function get_users_by_capability($context, $capability, $fields='', $sort='',\n $limitfrom='', $limitnum='', $groups='', $exceptions='', $doanything=true, $view=false) {\n global $CFG;\n\n/// Sorting out groups\n if ($groups) {\n $groupjoin = 'INNER JOIN '.$CFG->prefix.'groups_members gm ON gm.userid = ra.userid';\n\n if (is_array($groups)) {\n $groupsql = 'AND gm.groupid IN ('.implode(',', $groups).')';\n } else {\n $groupsql = 'AND gm.groupid = '.$groups;\n }\n } else {\n $groupjoin = '';\n $groupsql = '';\n }\n\n/// Sorting out exceptions\n $exceptionsql = $exceptions ? \"AND u.id NOT IN ($exceptions)\" : '';\n\n/// Set up default fields\n if (empty($fields)) {\n $fields = 'u.*, ul.timeaccess as lastaccess, ra.hidden';\n }\n\n/// Set up default sort\n if (empty($sort)) {\n $sort = 'ul.timeaccess';\n }\n\n $sortby = $sort ? \" ORDER BY $sort \" : '';\n/// Set up hidden sql\n $hiddensql = ($view && !has_capability('moodle/role:viewhiddenassigns', $context))? ' AND ra.hidden = 0 ':'';\n\n/// If context is a course, then construct sql for ul\n if ($context->contextlevel == CONTEXT_COURSE) {\n $courseid = $context->instanceid;\n $coursesql1 = \"AND ul.courseid = $courseid\";\n } else {\n $coursesql1 = '';\n }\n\n/// Sorting out roles with this capability set\n if ($possibleroles = get_roles_with_capability($capability, CAP_ALLOW, $context)) {\n if (!$doanything) {\n if (!$sitecontext = get_context_instance(CONTEXT_SYSTEM)) {\n return false; // Something is seriously wrong\n }\n $doanythingroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $sitecontext);\n }\n\n $validroleids = array();\n foreach ($possibleroles as $possiblerole) {\n if (!$doanything) {\n if (isset($doanythingroles[$possiblerole->id])) { // We don't want these included\n continue;\n }\n }\n if ($caps = role_context_capabilities($possiblerole->id, $context, $capability)) { // resolved list\n if (isset($caps[$capability]) && $caps[$capability] > 0) { // resolved capability > 0\n $validroleids[] = $possiblerole->id;\n }\n }\n }\n if (empty($validroleids)) {\n return false;\n }\n $roleids = '('.implode(',', $validroleids).')';\n } else {\n return false; // No need to continue, since no roles have this capability set\n }\n\n/// Construct the main SQL\n $select = \" SELECT $fields\";\n $from = \" FROM {$CFG->prefix}user u\n INNER JOIN {$CFG->prefix}role_assignments ra ON ra.userid = u.id\n INNER JOIN {$CFG->prefix}role r ON r.id = ra.roleid\n LEFT OUTER JOIN {$CFG->prefix}user_lastaccess ul ON (ul.userid = u.id $coursesql1)\n $groupjoin\";\n $where = \" WHERE ra.contextid \".get_related_contexts_string($context).\"\n AND u.deleted = 0\n AND ra.roleid in $roleids\n $exceptionsql\n $groupsql\n $hiddensql\";\n \n return get_records_sql($select.$from.$where.$sortby, $limitfrom, $limitnum);\n}", "function _gallery2_adminapi_removememberhook($args)\n{\n // first check if the module has been configured\n if(!xarGallery2Helper::isConfigured()) {\n return $args['extrainfo'];\n }\n \n extract($args['extrainfo']);\n \n // we only accept roles module hook calls\n if (!isset($module) || $module != 'roles') {\n return $args['extrainfo'];\n }\n \n // we need both, the parent id (itemid) and the child id (uid)\n if (!isset($itemid) || !isset($uid)) {\n $msg = xarML('removemember hook call without group/user ids!');\n xarErrorSet(XAR_USER_EXCEPTION, 'BAD_PARAM', new DefaultUserException($msg));\n return $args['extrainfo'];\n }\n \n // Start G2 transaction\n if(!xarGallery2Helper::init()) {\n return $args['extrainfo'];\n }\n \n // if child is a group: remove all child users from \"groups to be removed\"\n // if child is a user: remove user from \"groups to be removed\"\n // \"groups to be removed\" = getAncestors of parent + parent - getAncestors of child \n \n // this is ridiculous, the role get function defaults to type =1 if none was specified\n $childRole = xarModAPIFunc('roles','user','get', array('uid' => $uid));\n if ( !isset($childRole['type']) || $childRole['uid'] != $uid) {\n $childRole = xarModAPIFunc('roles','user','get', array('uid' => $uid, 'type' => 1));\n }\n \n $xarChildUsers = array();\n if ($childRole['type'] == 1) { // it's a group\n $xarChildUsers = xarGallery2Helper::xarGetChildUsers($uid); // returns only users, no groups\n } else {\n $xarChildUsers[] = $childRole;\n }\n \n // Load the parent role\n list($parentRole, $xarParentGroups) = xarGallery2Helper::xarGetAncestors(array('uid' => $itemid)); // an ancestor is a group per se\n $xarParentGroups[] = $parentRole;\n \n $removeGroupsList = array();\n foreach ($xarParentGroups as $group) {\n $removeGroupsList[$group['uid']] = $group;\n }\n\n // don't remove users from the G2 all users group\n $defaultGroupData = xarModAPIFunc('roles','user','get'\n\t\t\t\t , array('name' => xarModGetVar('roles', 'defaultgroup'), 'type' => 1));\n \n foreach ($xarChildUsers as $child) {\n // first get the remaining memberships and delete the group in \n // $removeGroupsList that we still want to be member of\n $currentGroupsRemoveList = $removeGroupsList;\n list($thechildRole, $remainingGroups) = xarGallery2Helper::xarGetAncestors(array('uid' => $child['uid']));\n foreach ($remainingGroups as $remGroup) {\n $currentGroupsRemoveList[$remGroup['uid']] = null;\n }\n // Now remove the memberships\n foreach ($currentGroupsRemoveList as $groupId => $group) {\n if ($group == null) {\n\tcontinue; // still a member of this group\n }\n \n // don't remove user from G2 all user group\n if ($group['uid'] == $defaultGroupData['uid']) {\n\tcontinue;\n }\n\n // make sure the group already exists in G2, if not, add it (there are some\n // rare scenarios where the group doesn't exist in G2. i.e. if the group was \n // in deleted state in xaraya while we imported/exported the groups and now\n // this group is back, recalled. \n // other CMS shouldn't care i guess, just a strange and rare issue\n list($ret, $g2Group) = GalleryCoreApi::loadEntityByExternalId($group['uid'], 'GalleryGroup');\n if ($ret) {\n\tif ($ret->getErrorCode() & ERROR_MISSING_OBJECT) { \n\t // ok, we need to create this group first\n\t if (!xarGallery2Helper::g2createGroup($group['uid'], $group)) {\n\t return $args['extrainfo'];\n\t }\n\t} else { // a real error, damn\n\t $msg = xarML('Failed to fetch group for extId [#(1)] removeusertogroup synchronization! Here\n\t\t\t\t\t\t\tis the error message from G2: <br />', $group['uid'], $ret->getAsHtml());\n\t xarErrorSet(XAR_SYSTEM_EXCEPTION, 'FUNCTION_FAILED', new SystemException($msg));\n\t return $args['extrainfo'];\n\t}\n }\n\n // remove user from group\n $ret = GalleryEmbed::removeUserFromGroup($child['uid'], $group['uid']);\n if ($ret) {\n\t$msg = xarML('Failed to remove g2 user [#(1)] with extId [#(2)] from g2 group [#(3)]! Here is the\n\t\t\t\t\terror from G2: <br />', $child['uname'], $child['uid'], $group['name'], $ret->getAsHtml());\n\txarErrorSet(XAR_SYSTEM_EXCEPTION, 'FUNCTION_FAILED', new SystemException($msg));\n\treturn $args['extrainfo'];\n }\n }\n }\n \n // complete G2 transaction\n xarGallery2Helper::done();\n \n return $args['extrainfo'];\n}", "protected function _get_usergroup_list()\n {\n $results = $this->connection->query('SELECT gid,title FROM ' . $this->connection->get_table_prefix() . 'usergroups');\n $mod_results = array();\n foreach ($results as $key => $value) {\n $mod_results[] = array('group_id' => $value['gid'], 'group_name' => $value['title']);\n }\n $results2 = collapse_2d_complexity('group_id', 'group_name', $mod_results);\n return $results2;\n }" ]
[ "0.68325037", "0.6775812", "0.6738575", "0.6728947", "0.669731", "0.6540705", "0.6507744", "0.6287556", "0.6277281", "0.6227468", "0.6213556", "0.6204571", "0.6175117", "0.61522585", "0.61464214", "0.6117346", "0.61109036", "0.61066574", "0.6104213", "0.61030734", "0.6099539", "0.60964864", "0.60865784", "0.60820264", "0.6061585", "0.6052511", "0.6040189", "0.6029472", "0.60006464", "0.59905833", "0.5982067", "0.5979782", "0.59728706", "0.5943932", "0.5933542", "0.5923985", "0.5922083", "0.591799", "0.5897367", "0.5887713", "0.58839554", "0.5883516", "0.587768", "0.58728", "0.58705693", "0.5866322", "0.58269745", "0.5825511", "0.58157897", "0.58042", "0.580176", "0.5800229", "0.5797196", "0.5784436", "0.57838607", "0.57807374", "0.5780141", "0.5765015", "0.57473975", "0.5740438", "0.5736478", "0.5734572", "0.57300854", "0.57200646", "0.57083166", "0.5708211", "0.57080555", "0.56993514", "0.5697669", "0.56909025", "0.5687555", "0.5683619", "0.5680329", "0.56774735", "0.56773996", "0.5676381", "0.5671588", "0.5669238", "0.5666355", "0.56657314", "0.5658278", "0.5655911", "0.56523925", "0.56480616", "0.56480616", "0.56478995", "0.563815", "0.563596", "0.56323814", "0.5630849", "0.56300783", "0.56258786", "0.56234646", "0.56227887", "0.5622379", "0.5621311", "0.5617426", "0.56114185", "0.56053984", "0.5603274", "0.5602886" ]
0.0
-1
/ Flush a root level block, so it becomes empty.
function flush_block_vars($blockname) { // Top-level block. // flush a existing block we were given. $current_iteration = sizeof($this->_tpldata[$blockname . '.']) - 1; unset($this->_tpldata[$blockname . '.']); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clear () {\n\t\t$this->root = null;\n\t}", "private function clearMemBlock() {\n\n $shmSize = shmop_size( $this->shm );\n $memoryWriteBatch = 1024 * 1024 * 4;\n $data = pack( 'x'. $memoryWriteBatch );\n\n // Clear all bytes to NUL in the whole shared memory block\n for ( $i = 0; $i < $shmSize; $i += $memoryWriteBatch ) {\n\n // Last chunk might have to be smaller\n if ( $i + $memoryWriteBatch > $shmSize ) {\n $memoryWriteBatch = $shmSize - $i;\n $data = pack( 'x'. $memoryWriteBatch );\n }\n\n $res = shmop_write( $this->shm, $data, $i );\n\n if ( $res === false )\n throw new \\Exception( 'Could not write NUL bytes to the memory block' );\n }\n }", "public function flush()\n\t{\n\n\t}", "public function flush()\n {\n unset($this->buffer);\n $this->buffer=array();\n }", "private function endBlock()\n {\n end($this->_blocks);\n\n // grab key of that last element and fill it with rendered data\n $this->_blocks[key($this->_blocks)] = ob_get_clean();\n }", "public function flush()\n {\n }", "public function flush()\n {\n }", "public function flushSections()\n {\n $this->sections = [];\n $this->sectionStack = [];\n }", "private function _flushContent()\n {\n @ob_flush();\n @flush();\n }", "public function flush()\n {\n // TODO: Implement flush() method.\n }", "protected function flushCache()\n {\n $this->getCacheFactory()->forget('blocks');\n }", "public function flush()\n {\n $this->write($this->graph->parse());\n\n parent::flush();\n }", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush()\r\r\n\t{\r\r\n\t\t$this->_storage->flush();\r\r\n\t}", "public function flush() {\n }", "private function flush()\n {\n $this->writeBlock();\n return $this->io->flush();\n }", "public function flush()\n {\n }", "public function flush()\n {\n }", "public function flush()\n {\n }", "public function flush() {\r\n\t\tfflush($this->_handle);\r\n\t}", "abstract public function flush();", "abstract function flush();", "public function flush()\n {\n $this->line($this->buffer);\n $this->buffer = \"\";\n }", "function flush() ;", "function flush() ;", "function flush()\n{\n}", "public function flush() {\n\t\tob_end_flush();\n\t}", "public function flush()\n\t{\n\t\t$this->items = array();\n\t\t$this->properties = array();\n\t}", "public function flush(): void;", "public function flush(): void;", "public function flush(): void;", "protected function _completeFlush() {\r\n\r\n }", "abstract public function flush ();", "public function endBlock(): void\n {\n $output = ob_get_clean();\n\n [$blockName, $replace] = $this->blockStack->pop();\n\n if (!array_key_exists($blockName, $this->blocks)) {\n $this->blocks[$blockName] = [];\n }\n\n if ($replace) {\n $this->blocks[$blockName] = [$output];\n } else {\n $this->blocks[$blockName][] = $output;\n }\n }", "public function flush()\n {\n $this->arrSettings = null;\n $this->section = null;\n $this->group = null;\n $this->changed = null;\n }", "public function flush(): void\n {\n }", "public function flush(): void\n {\n }", "protected function _flushBuffer() {\n\t\t//@codingStandardsIgnoreStart\n\t\t@flush();\n\t\tif (ob_get_level()) {\n\t\t\t@ob_flush();\n\t\t}\n\t\t//@codingStandardsIgnoreEnd\n\t}", "public static function flush() {\n\t\tstatic::$flush = true;\n\t}", "private function flush()\n {\n $this->currentOptions = [];\n // set back send status buffer string\n $this->sendStatus = null;\n }", "public function clear()\n {\n if (null !== $this->getDraft()) {\n $this->getDraft()->clear();\n } else {\n $this->_subcontent->clear();\n $this->subcontentmap = array();\n $this->_data = array();\n $this->index = 0;\n }\n }", "function flush();", "public function flush(/* ... */)\n {\n $this->_storage = [[], [], []];\n $this->_event_history = [];\n $this->set_state(STATE_DECLARED);\n }", "public function clear(): void\n {\n unset($this->root);\n unset($this->nodes);\n\n $this->root = null;\n $this->nodes = [];\n }", "public function flush()\n {\n if ($this->fileSystem->isDirectory($this->directory))\n {\n $this->fileSystem->deleteDirectory($this->directory, true);\n }\n }", "function flushAll(){\n\t\tif(!$this->_OutputBuffer_Flush_Started){\n\t\t\t$this->setHeader(\"Content-Length\",$this->getContentLength());\n\t\t\t$this->_flushHeaders();\n\t\t}\n\n\t\tif($this->getContentLength()>0){\n\t\t\t$this->_OutputBuffer_Flush_Started = true;\n\t\t\t$this->_OutputBuffer->printOut();\n\t\t\t$this->_OutputBuffer->clear();\n\t\t}\n\t}", "public function flush(){\n }", "public function flush(): void\n {\n $this->list = [];\n }", "public function flush(): void\n {\n $this->incrementVersion();\n\n static::$regions[$this->prefix] = [];\n }", "public function flush(): static;", "protected function _prepareFlush() {\r\n\r\n }", "function flush(){\n\t\tif(!$this->_OutputBuffer_Flush_Started){\n\t\t\t$this->_flushHeaders();\n\t\t}\n\n\t\tif($this->getContentLength()>0){\n\t\t\t$this->_OutputBuffer_Flush_Started = true;\n\t\t\t$this->_OutputBuffer->printOut();\n\t\t\t$this->_OutputBuffer->clear();\n\t\t}\n\t}", "function endMainBlock() {\n $bte =& $this->blockTab[0];\n $bte['tPosContentsEnd'] = strlen($this->template);\n $bte['tPosEnd'] = strlen($this->template);\n $bte['definitionIsOpen'] = false;\n $this->currentNestingLevel -= 1; }", "public function flushAll();", "public function flushAll() {\n\t\t$this->removeKeys();\n\t}", "public function flushState(): void\n {\n $this->menu = collect([\n self::MENU_MAIN => collect(),\n ]);\n\n $this->currentScreen = null;\n $this->partialRequest = false;\n }", "public function flush(): void\n\t{\n\t\t$this->cacheRM = [];\n\t\t$this->mapperCoordinator->flush();\n\t}", "public function flush()\n\t{\n\t\treturn $this->updateLinode();\n\t}", "public function flush()\n {\n $this->store()->flush();\n }", "function flush_fragments(){\n\n /* Retreive the current action hook name */\n $action = current_filter();\n \n foreach($this->flush_rules as $key => $rules){\n /*\n Check if this fragment key has asked to\n be flushed on this action hook */\n if(in_array($action, $rules['actions'])){\n /* Bingo. Flush the fragment for the key */\n if(delete_transient($key)){\n /* Hook action for succesful fragment flushing */\n do_action('fragWP/fragment_flushed', $key, $action);\n }\n }\n }\n\n }", "function flush()\n\t\t{\n\t\t\t// Get rid of these\n\t\t\t$this->last_result = null;\n\t\t\t$this->col_info = null;\n\t\t\t$this->last_query = null;\n\t\t\t$this->from_disk_cache = false;\n\t\t}", "public function buffer_end_flush_all() {\n\t\t//if($this->get_setting('showHdrFtr') == 'FWD') {\n\t\t\t$levels = ob_get_level();\n\t\t\tfor ($i=0; $i<$levels; $i++){\n\t\t\t\t$obStatus = ob_get_status();\n\t\t\t\tif (!empty($obStatus['type']) && $obStatus['status']) {\n\t\t\t\t\tob_end_flush();\n\t\t\t\t}\n\t\t\t}\n\t\t//}\n\t}", "public function flush($data = null) {}", "public function flush($data = null) {}", "public function flush()\n {\n $this->out->flush();\n }", "public function flush() {\n\t\tfflush($this->fp);\n\t}", "static function flushHard()\n\t\t{\n\t\t\tfor($i=1;$i<=256;++$i)\n\t\t\t{\n\t\t\t\techo ' ';\n\t\t\t}\n\t\t\tflush();\n\t\t\tob_flush();\n\t\t}", "private function flush() {\n\t\t$this->_error = '';\n\t\t$this->_last_result = array();\n\t}", "public function flush() {\n\t\t$this->last_result = null;\n\t\t$this->col_info = null;\n\t\t$this->last_query = null;\n\t}", "public function flush()\n {\n parent::flush();\n\n HS::flush();\n\n $this->middleware = [];\n $this->currentRoute = [];\n $this->routeMiddleware = [];\n $this->loadedProviders = [];\n $this->bootingCallbacks = [];\n $this->bootedCallbacks = [];\n $this->reboundCallbacks = [];\n $this->resolvingCallbacks = [];\n $this->terminatingCallbacks = [];\n $this->availableBindings = [];\n $this->ranServiceBinders = [];\n $this->loadedConfigurations = [];\n $this->afterResolvingCallbacks = [];\n\n $this->router = null;\n $this->dispatcher = null;\n static::$instance = null;\n }" ]
[ "0.6609588", "0.6379712", "0.620477", "0.6162875", "0.6090199", "0.6072432", "0.6072432", "0.6067282", "0.6039874", "0.6032088", "0.6029572", "0.6026039", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.6020951", "0.60206896", "0.60206896", "0.60206896", "0.60206896", "0.6018627", "0.6018627", "0.6018627", "0.6018627", "0.6018627", "0.6018627", "0.6018627", "0.6018627", "0.6018627", "0.6009658", "0.59913975", "0.5989145", "0.59812266", "0.59812266", "0.59812266", "0.597241", "0.59675235", "0.5938522", "0.5896929", "0.5896156", "0.5896156", "0.5889568", "0.58635813", "0.58494", "0.5832269", "0.5832269", "0.5832269", "0.5831448", "0.5823546", "0.5815843", "0.58041984", "0.5798645", "0.5798645", "0.5786142", "0.5784496", "0.57736176", "0.5754003", "0.5733064", "0.5725049", "0.57248276", "0.5723933", "0.5716044", "0.569504", "0.5657917", "0.56409526", "0.56318265", "0.55966675", "0.5596595", "0.5587197", "0.55800253", "0.55651426", "0.55591744", "0.55532193", "0.5537213", "0.55362177", "0.5508045", "0.54862237", "0.5474862", "0.54463804", "0.54463804", "0.5445459", "0.54247767", "0.542155", "0.5415468", "0.54151696", "0.5402883" ]
0.5886133
56
/ Add style configuration
function _add_config($tpl, $add_vars = true) { if(@file_exists(IP_ROOT_PATH . 'templates/' . $tpl . '/xs_config.cfg')) { $style_config = array(); include(IP_ROOT_PATH . 'templates/' . $tpl . '/xs_config.cfg'); if(sizeof($style_config)) { global $config, $db; for($i = 0; $i < sizeof($style_config); $i++) { $this->style_config[$style_config[$i]['var']] = $style_config[$i]['default']; if($add_vars) { $this->vars['TPL_CFG_' . strtoupper($style_config[$i]['var'])] = $style_config[$i]['default']; } } $str = $this->_serialize($this->style_config); $config_name = 'xs_style_' . $tpl; $config[$config_name] = $str; $sql = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('" . str_replace('\\\'', '\'\'', addslashes($config_name)) . "', '" . str_replace('\\\'', '\'\'', addslashes($str)) . "')"; $db->sql_query($sql); return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function register_style();", "function register_style() {\n}", "function add_style_definitions() {\n\t\t\t\t$options = $this->get_options();\n\t\t\t\tif( 'yes' === $options['add_styles_to_header'] ) {\n\t\t\t\t\techo \"<!-- Styles added by Cap & Run plugin -->\\n\";\n\t\t\t\t\techo \"<style type=\\\"text/css\\\">\\n\";\n\t\t\t\t\techo $options['styles_to_add'];\n\t\t\t\t\techo \"</style>\\n\";\n\t\t\t\t\techo \"<!-- End of Cap & Run style additions -->\\n\\n\";\n\t\t\t\t}\n\t\t\t}", "function ag_set_predefined_style() {\n\tif(!isset($_POST['lcwp_nonce']) || !wp_verify_nonce($_POST['lcwp_nonce'], 'lcwp_nonce')) {die('Cheating?');}\n\tif(!isset($_POST['style'])) {die('data is missing');}\n\n\trequire_once(AG_DIR .'/settings/preset_styles.php');\n\trequire_once(AG_DIR .'/functions.php');\n\t\n\t$style_data = ag_preset_styles_data($_POST['style']);\n\tif(empty($style_data)) {die('Style not found');}\n\t\n\t\n\t// override values\n\tforeach($style_data as $key => $val) {\n\t\tupdate_option($key, $val);\t\t\n\t}\n\n\n\t// if is not forcing inline CSS - create static file\n\tif(!get_option('mg_inline_css')) {\n\t\tag_create_frontend_css();\n\t}\n\t\n\tdie('success');\n}", "public function add_style($style,$dynamic=false)\n \t{\n \t\t$this->styles[$style]=$style;\n \t}", "protected function addStyle($styleFile = false){\n\t\tif($styleFile){\n\t\t\t$modulePath = BASE_PATH . DS . 'resource' . DS . 'css' . DS . $styleFile . '.css';\n\t\t\t$styleFile = Safan::app()->resourceUrl . DS . 'css' . DS . $styleFile . '.css';\n\t\t\tif(file_exists($modulePath))\n\t\t\t\t$this->styles[] = $styleFile;\n\t\t}\n\t\telse{\n\t\t\t$modulePath = BASE_PATH . DS . 'resource' . DS . 'css' . DS . 'application' . DS . 'w.' . strtolower(self::$widgetName) . '.style.css';\n\t\t\t$moduleStyle = Safan::app()->resourceUrl . DS . 'css' . DS . 'application' . DS . 'w.' . strtolower(self::$widgetName) . '.style.css';\n\t\t\tif(file_exists($modulePath))\n\t\t\t\t$this->styles[] = $moduleStyle;\n\t\t}\n\t}", "public function addStyle($file) {\n $this->styles[$file] = $file;\n }", "function add_css() \n {\n if( $this->options['use-css-file'] ) {\n wp_register_style( 'bbquotations-style' , $this->plugin_url . 'bbquotations-style.css');\n wp_enqueue_style( 'bbquotations-style' );\n } \n }", "public function add_style ($url) {\r\n\t\treturn $this->set(self::STYLES, $url);\r\n\t}", "public function setStyle($style) {}", "function add_editor_style($stylesheet = 'editor-style.css')\n {\n }", "function bsc_add_editor_styles() {\n\t\t\tadd_editor_style( get_stylesheet_uri() );\n\t\t}", "public function add_withStyle_addsStyleToStyles ( )\n\t{\n\t\t$this->styles->add ( $this->style );\n\t\tassertThat ( $this->styles->has ( $this->style ), is ( identicalTo ( true ) ) );\n\t}", "public function addStyle(string $name, string $src, array $attributes = []);", "protected function setupStyles()\n {\n $style = new OutputFormatterStyle('yellow', 'black', ['bold']);\n $this->output->getFormatter()->setStyle('important', $style);\n\n $style = new OutputFormatterStyle('cyan', 'black', ['bold']);\n $this->output->getFormatter()->setStyle('code', $style);\n }", "function App_CSS_Add()\n {\n array_push($this->MyApp_Interface_Head_CSS_OnLine,\"CSS/sivent2.css\");\n }", "function ft_hook_add_css() {}", "function wyde_add_body_style($handle, $src){\n global $wyde_body_stylesheets;\n if( !$wyde_body_stylesheets ){\n $wyde_body_stylesheets = array();\n }\n\n $wyde_body_stylesheets[$handle] = $src; \n}", "function add_ordin_widget_style() {\n if( ! apply_filters( 'add_ordin_widget_style', true, $this->id_base ) )\n return;\n ?>\n <style type=\"text/css\">\n \n </style>\n <?php\n }", "protected function regStyles() {\n $this->modx->regClientCSS($this->config['cssUrl'] . 'web/bbcode/bbcode.css');\n $this->modx->regClientCSS($this->config['cssUrl'] . 'web/styles.css');\n }", "function add_style($name, $file)\n{\n\tglobal $styles_included;\n\t$styles_included[$name] = \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"\".site_url.$file.\"\\\"/>\\n\";\n}", "function wp_add_inline_style($handle, $data)\n {\n }", "function drawStyle()\r\n\t{\r\n\t}", "private function _addCss() {\r\n JHtml::styleSheet( Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/list.css');\r\n }", "public function __construct(Config $config, StyleInterface $io);", "public function setStyle(string $name, $style);", "public function style_settings() {\n include __DIR__ . \"/views/style_settings.php\";\n }", "function drum_beat_add_editor_styles() {\n add_editor_style( 'assets/stylesheets/wysiwyg-style.css' );\n}", "public function addStyling()\n {\n \\wp_enqueue_style(self::REACT_WP_THEME, \\get_template_directory_uri() . '/frontend/dist/style.css', [], '0.1');\n }", "public function addCustomStyle($file){\n array_push($this->_customStyles,$file);\n }", "private function set_styles()\n {\n\n if (count($this->assets_css['global']) > 0)\n {\n $this->template->append_metadata('<!-- BEGIN GLOBAL MANDATORY STYLES -->');\n foreach($this->assets_css['global'] as $asset)\n {\n $this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . '../../themes/public/css/' . $asset . '\" media=\"screen\" />');\n }\n }\n if (isset($this->assets_css['page_style']) && count($this->assets_css['page_style']) > 0)\n {\n $this->template->append_metadata('<!-- BEGIN PAGE STYLES -->');\n foreach($this->assets_css['page_style'] as $asset)\n {\n $this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . '../../themes/public/css/' . $asset . '\" media=\"screen\" />');\n }\n }\n\n // Webkit based browsers\n //$this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/webkit.css\" media=\"screen\" />');\n\n // Internet Explorer styles\n $this->template->append_metadata('<!--[if IE 6]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie6.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 7]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie7.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 8]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie8.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 9]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie9.css\" media=\"screen\" /><![endif]-->');\n }", "private function addCSS()\n {\n Filters::add('head', array($this, 'renderRevisionsCSS'));\n }", "function leafbase_add_editor_styles() {\n\n\tadd_editor_style( 'custom-editor-style.css');\n\n}", "function do_add_css(){\n\t\tglobal $jcf_included_assets;\n\t\t\n\t\tif( !empty($jcf_included_assets['styles'][get_class($this)]) )\n\t\t\treturn false;\n\t\t\n\t\tif( method_exists($this, 'add_css') ){\n\t\t\tadd_action( 'jcf_admin_edit_post_styles', array($this, 'add_css'), 10 );\n\t\t}\n\n\t\t$jcf_included_assets['styles'][get_class($this)] = 1;\n\t}", "function add_styles() {\n\t\tif ( is_active_widget( false, false, $this->id_base, true ) ) {\n\t\t\twp_enqueue_style( 'font-awesome' );\n\t\t\t\n\t\t\t//wp_enqueue_style( 'my-style', \\trends\\helper\\utils::get_widgets_uri( 'social_icons', '/assets/my-style.css') );\n\t\t\t\n\t\t}\n\t}", "private function loadStyles() {\n\t\tif(isset($this->styles) && $this->styles != \"\") {\n\t\t\tforeach (explode(\",\", $this->styles) as $style) {\n\t\t\t\tOCP\\Util::addStyle('ocDashboard', 'widgets/'.$this->id.'/'.$style);\n\t\t\t}\n\t\t}\n\t}", "function addThemeStyles() \n {\n global $blog_id;\n \n // need for wordpress MU and WP3\n if (!$blog_id) {\n $blog_id = 1;\n }\n\n // load style\n if (file_exists(CONSTRUCTOR_DIRECTORY .'/cache/style'.$blog_id.'.css')) {\n wp_enqueue_style('constructor-style', CONSTRUCTOR_DIRECTORY_URI .'/cache/style'.$blog_id.'.css');\n } else {\n wp_enqueue_style('constructor-style', get_option('home').'/?theme-constructor=css');\n }\n \n // load constructor subtheme style\n if (file_exists(CONSTRUCTOR_DIRECTORY .'/themes/'.$this->getTheme().'/style.css')) {\n wp_enqueue_style( 'constructor-theme', CONSTRUCTOR_DIRECTORY_URI.'/themes/'.$this->getTheme().'/style.css');\n }\n }", "public function addStyle($name, $value) {\n\t\t$this->attributes[\"style\"][$name] = $value;\n\t\treturn $this;\n\t}", "public function addStyle($id, $url)\n {\n $this->styles[$id] = $url;\n }", "function add_editor_styles() {\n add_editor_style( '/admin/css/editor-styles.css' );\n}", "public function addCascadingStyleSheet(&$toAdd) {\n\t\t$this->checkCurrent();\n\t\t$this->currentObjectWriter->addCascadingStyleSheet($toAdd);\n\t}", "public function customizer_styles() {\r\n\t\t//new Epsilon_Section_Styling( 'unapp-main', 'unapp_frontpage_sections_', Unapp_Repeatable_Sections::get_instance() );\r\n\t}", "function sZThemeCustomCssSettings() {\n\t$customCssGroup = 'sZTheme-customCss-group';\n\t$page = 'sZThemeCustomCss';\n\taddSectionWithFields('customCssSection', 'Add your custom css', 'sZThemeCustomCssSection',\n\t $page, $customCssGroup,\n\t ['customCss'],\n\t ['customCss'],\n\t ['Insert your custom css here'],\n\t ['sZThemeCustomCss']);\n}", "function make_css( $args, $assoc_args ) {\n if ( class_exists( 'TF_Styling_Control' ) ) {\n if ( TF_Model::create_stylesheets() ) {\n WP_CLI::success( \"Stylesheet succesfully created.\" );\n } else {\n WP_CLI::error( \"Could not create stylesheet.\" );\n }\n }\n }", "public function add_header_style ($url) {\r\n\t\treturn $this->set(self::HEADER_STYLES, $url);\r\n\t}", "protected function setStyles()\n {\n $this->getOutput()->getFormatter()->setStyle(\n 'h1',\n new OutputFormatterStyle('red', 'white', ['bold'])\n );\n $this->getOutput()->getFormatter()->setStyle(\n 'h2',\n new OutputFormatterStyle('red', 'default', ['bold'])\n );\n\n // low\n $this->getOutput()->getFormatter()->setStyle(\n 'h100',\n new OutputFormatterStyle('green', 'default', ['bold'])\n );\n $this->getOutput()->getFormatter()->setStyle(\n 'h101',\n new OutputFormatterStyle('green', 'default')\n );\n //mid\n $this->getOutput()->getFormatter()->setStyle(\n 'h200',\n new OutputFormatterStyle('yellow', 'default', ['bold'])\n );\n $this->getOutput()->getFormatter()->setStyle(\n 'h201',\n new OutputFormatterStyle('yellow', 'default')\n );\n // high\n $this->getOutput()->getFormatter()->setStyle(\n 'h300',\n new OutputFormatterStyle('white', 'red', ['bold'])\n );\n $this->getOutput()->getFormatter()->setStyle(\n 'h301',\n new OutputFormatterStyle('red', 'default', ['bold'])\n );\n }", "function add_my_stylesheet() {\n}", "private function _handleStyleBased()\n {\n if (Theme::getComponent()) {\n $css = $this->styleBasedCss[Theme::getComponent()->style];\n $this->css = ArrayHelper::merge($css, $this->css);\n }\n }", "public function kiwip_stylesheet_add_file(){\n\t\t//register\n\t\tforeach($this->stylesheet as $key){\n\t\t\twp_register_style('kiwip_shortcode-css-'.$key['stylesheetId'], $key['stylesheetURL']);\n\t\t}\n\t\t\n\t\t//load\n\t\tforeach($this->stylesheet as $eky){\n\t\t\twp_enqueue_style('kiwip_shortcode-css-'.$key['stylesheetId']);\n\t\t}\t\t\n\n\t\t// $this->debug($this->stylesheet); die();\n\t}", "function studioyacine_styles_dropdown($settings)\n {\n $new_styles = array(\n array(\n 'title' => __('Custom Styles', 'studioyacine'),\n 'items' => array(\n array(\n 'title' => __('Button', 'studioyacine'),\n 'selector' => 'p',\n 'classes' => 'button'\n ),\n // array(\n // 'title' => __('Button Red', 'studioyacine'),\n // 'selector' => 'p',\n // 'classes' => 'button-red'\n // ),\n // array(\n // 'title' => __('Large', 'studioyacine'),\n // 'selector' => 'p',\n // 'classes' => 'text-large'\n // ),\n // array(\n // 'title' => __('Medium', 'studioyacine'),\n // 'selector' => 'p',\n // 'classes' => 'text-medium'\n // )\n ),\n ),\n );\n\n // Merge old & new styles\n $settings['style_formats_merge'] = true;\n\n // Add new styles\n $settings['style_formats'] = json_encode($new_styles);\n $settings['block_formats'] = 'Paragraph=p; Header 2=h2; Header 3=h3;';\n\n // Return New Settings\n return $settings;\n }", "function wp_register_styles() {\n // Developer Tier Admin Stylesheet\n wp_register_style( \"{$this->namespace}-admin\", SLIDEDECK2_DEVELOPER_URLPATH . \"/css/admin.css\", array(), '2.1', 'screen' );\n // CodeMirror Library\n wp_register_style( \"codemirror\", SLIDEDECK2_DEVELOPER_URLPATH . \"/css/codemirror.css\", array(), '2.25', 'screen' );\n }", "function wp_add_editor_classic_theme_styles($editor_settings)\n {\n }", "function register_block_style($block_name, $style_properties)\n {\n }", "protected function styles($style, $element) {\n\t\tparent::style($style, $element);\n\t\t$element->setAttribute('titlecolor', $style->getStyle('titlecolor'));\n\t}", "public static function add_administration_styles()\n {\n static::add_media_listing_style();\n }", "public function css() {\r\n\t\tif ($this->cssLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/css/'.$this->cssLink.'.css\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif ($this->cssExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.$this->cssExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->cssExternalLink);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public function run()\n {\n Style::create([\n 'type' => 'Masculino',\n 'description' => 'Produto para homem',\n ]);\n Style::create([\n 'type' => 'Feminino',\n 'description' => 'Produto para mulher',\n ]);\n Style::create([\n 'type' => 'Unisex',\n 'description' => 'Produto para homem ou mulher',\n ]);\n }", "function register_editor_stylesheet() {\n add_editor_style( 'css/bootstrap.css' );\n}", "public function registerStyles() {\n $this->registerStylesCommon();\n \n if(is_admin()) {\n $this->registerStylesAdmin();\n } else {\n $this->registerStylesFrontend();\n }\n }", "public function init()\n {\n\t\tif (is_array(self::$options)) {\n\t\t\t$this->css = ['css/'.self::$options['style'].'.css'];\n\t\t}\n parent::init();\n }", "public function add_styles() {\n\n\t\t\t$current_page = isset( $_GET['page'] ) ? $_GET['page'] : null;\n\t\t\t$current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : null;\n\n\t\t\t$page_ID = $this->translate_name_to_id( $this->page );\n\t\t\t$tab_ID = $this->translate_name_to_id( $this->tab );\n\t\t\t$settings_tab_ID = $this->translate_name_to_id( $this->settings_tab );\n\n\t\t\t// Only add style if on extension tab or on extension settings tab\n\t\t\tif ( ( $current_page == $page_ID && $current_tab == $tab_ID )\n\t\t\t || ( $current_page == 'cd_settings' && $current_tab == $settings_tab_ID )\n\t\t\t || ( $current_page == 'cd_account' && $current_tab == 'activity' )\n\t\t\t) {\n // Add stylesheet from this plugin\n\t\t\t\twp_enqueue_style( \"$this->ID-style\" );\n\n // Add Stream stuff\n wp_enqueue_style( 'wp-stream-admin', WP_STREAM_URL . 'ui/css/admin.css', array(), WP_Stream::VERSION );\n wp_enqueue_script( 'select2' );\n wp_enqueue_style( 'select2' );\n\n wp_enqueue_script( 'timeago' );\n wp_enqueue_script( 'timeago-locale' );\n\n wp_enqueue_script( 'wp-stream-admin', WP_STREAM_URL . 'ui/js/admin.js', array( 'jquery', 'select2' ), WP_Stream::VERSION );\n wp_enqueue_script( 'wp-stream-live-updates', WP_STREAM_URL . 'ui/js/live-updates.js', array( 'jquery', 'heartbeat' ), WP_Stream::VERSION );\n wp_localize_script(\n 'wp-stream-admin',\n 'wp_stream',\n array(\n 'i18n' => array(\n 'confirm_defaults' => __( 'Are you sure you want to reset all site settings to default? This cannot be undone.', 'stream' ),\n ),\n 'gmt_offset' => get_option( 'gmt_offset' ),\n )\n );\n wp_localize_script(\n 'wp-stream-live-updates',\n 'wp_stream_live_updates',\n array(\n 'current_screen' => $current_page,\n 'current_page' => $current_page,\n 'current_order' => isset( $_GET['order'] ) ? esc_js( $_GET['order'] ) : 'desc',\n 'current_query' => json_encode( $_GET ),\n )\n );\n }\n\t\t}", "protected function createStyle()\n\t{\n\t\treturn new TPanelStyle;\n\t}", "function add_style() {\n\twp_enqueue_style( 'add_style', plugin_dir_url( __FILE__ ) . '/css/style.css' );\n}", "function additional_styles() {\n\t\tJetpack_Admin_Page::load_wrapper_styles();\n\t}", "public function style($style)\n\t{\n\t\t$this->style = $style;\n\n\t\t// reload the available types for the style\n\t\t$this->types = $this->types();\n\t}", "protected function initStyles() {\n\t\t$styles = array();\n\t\t\n\t\tif(isset($this->config['styles']['style'])) {\n\t\t\tforeach($this->config['styles']['style'] as $moduleStyle) {\n\t\t\t\t$styles[] = $this->layout->baseUrl('layout/' . $moduleStyle);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(isset($this->config['styles'][$this->request->getControllerName()])) {\n\t\t\tforeach($this->config['styles'][$this->request->getControllerName()] as $action => $internalStyle) {\n\t\t\t\t\n\t\t\t\tif(is_array($internalStyle) && $action == 'style') {\n\t\t\t\t\tforeach($internalStyle as $sc) {\n\t\t\t\t\t\tif(preg_match(\"/http:/i\", $sc)) {\n\t\t\t\t\t\t\t$styles[] = $sc;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$styles[] = $this->layout->baseUrl('layout/' . $sc);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else if(is_array($internalStyle) && $action == $this->request->getActionName()) {\n\t\t\t\t\tforeach($internalStyle as $sc) {\n\t\t\t\t\t\tif(preg_match(\"/http:/i\", $sc)) {\n\t\t\t\t\t\t\t$styles[] = $sc;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$styles[] = $this->layout->baseUrl('layout/' . $sc);\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\t\t\n\t\t$this->layout->setStyle($styles);\n\t}", "public function addStyle($style) {\n if (!in_array($style, (array)$this->styles, true)) {\n $this->styles[] = $style;\n }\n }", "public function registerStylesAdmin() {\n $v = Wpjb_Project::VERSION;\n $p = plugins_url().'/wpjobboard/public/css/';\n $x = plugins_url().'/wpjobboard/application/vendor/';\n \n wp_register_style(\"wpjb-admin-css\", $p.\"admin.css\", array(), $v);\n wp_register_style(\"wpjb-colorpicker-css\", $p.\"colorpicker.css\", array(), $v);\n wp_register_style(\"wpjb-vendor-ve-css\", $x.\"visual-editor/visual-editor.css\", array(), $v);\n wp_register_style(\"wpjb-multi-level-accordion-menu\", $p.\"multi-level-accordion-menu.css\", array(), $v);\n }", "function gdl_generate_style_custom(){\n\n\t\tglobal $gdl_fh;\n\t\t\n\t\t$return_data = array('success'=>'-1', 'alert'=>'Cannot write style-custom.css file, you may try setting the style-custom.css file permission to 755 or 777 to solved this.');\n\t\t\n\t\t// initial the value of the style\n\t\t$file_path = SERVER_PATH . \"/style-custom.css\";\n\t\t$gdl_fh = @fopen($file_path, 'w');\n\t\t\n\t\tif( !$gdl_fh ){ die( json_encode($return_data) ); }\n\t\t\n\t\tgdl_get_style_custom_content();\n\t\t\n\t\t// close data\n\t\tfclose($gdl_fh);\t\n\t}", "function tk_gutenberg_css() {\n \n add_theme_support( 'editor-styles' );\n\tadd_editor_style( 'style-editor.css' );\n \n}", "public function widget_styles() {\n\t\twp_register_style( 'elementor-addons', plugins_url( '/assets/css/frontend.css', __FILE__ ) , array() ,ELEMENT_ADDON_VER );\n\t\twp_register_style( 'elementor-addons-custom-frontend', plugins_url( '/assets/css/custom-frontend.css', __FILE__ ) , array() , ELEMENT_ADDON_VER);\n\t\twp_register_style( 'elementor-addons-content-filter', plugins_url( '/assets/widgets/content-filter.css', __FILE__ ) , array() , ELEMENT_ADDON_VER );\n\t}", "function add_css($acss=array()) {\n\t\tforeach ($acss as $css) {\n\t\t\tif (isset($css[\"path\"]) && $css[\"path\"]!=\"\") {\n\t\t\t\t$priority = 0;\n\t\t\t\tif (isset($css[\"priority\"])) {\n\t\t\t\t\t$priority = $css[\"priority\"];\n\t\t\t\t}\n\t\t\t\t$condition = \"\";\n\t\t\t\tif (isset($css[\"condition\"])) {\n\t\t\t\t\t$condition = $css[\"condition\"];\n\t\t\t\t}\n\t\t\t\t$is_local = true;\n\t\t\t\tif (isset($css[\"is_local\"])) {\n\t\t\t\t\t$is_local = $css[\"is_local\"];\n\t\t\t\t}\n\t\t\t\t$this->custom_css[] = array(\"css\" => $css[\"path\"], \"priority\" => $priority, \"condition\" => $condition, \"is_local\" => $is_local);\n\t\t\t}\n\t\t}\n\t}", "protected function _drawStyle($style) {}", "protected function configure()\n {\n $this->internalInliner->setCleanup($this->options['cleanup']);\n\n $this->internalInliner->setUseInlineStylesBlock(\n $this->options['use_inline_styles_block']\n );\n $this->internalInliner->setStripOriginalStyleTags(\n $this->options['strip_original_tags']\n );\n $this->internalInliner->setExcludeMediaQueries(\n $this->options['exclude_media_queries']\n );\n }", "public function setStyleLoader($styleLoader);", "function add_settings( $wp_customize ) {\n\tglobal $style_defaults;\n\tforeach ( $style_defaults as $style_setting_group_name => $style_setting_group ) {\n\t\tforeach ( $style_setting_group as $style_setting_name => $style_setting_default ) {\n\t\t\tswitch ( gettype( $style_setting_default ) ) {\n\t\t\t\tcase 'boolean':\n\t\t\t\t\t$sanitizer = function ( $x ) {\n\t\t\t\t\t\treturn (bool) intval( $x );\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'integer':\n\t\t\t\t\t$sanitizer = function ( $x ) {\n\t\t\t\t\t\treturn intval( $x );\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'string':\n\t\t\t\t\t$sanitizer = 'sanitize_text_field';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'double':\n\t\t\t\t\t$sanitizer = function ( $x ) {\n\t\t\t\t\t\tif ( is_numeric( $x ) ) {\n\t\t\t\t\t\t\treturn $x;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn 0.0;\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$wp_customize->add_setting(\n\t\t\t\t$style_setting_group_name . '[' . $style_setting_name . ']',\n\t\t\t\t[\n\t\t\t\t\t'type' => 'option',\n\t\t\t\t\t'default' => $style_setting_default,\n\t\t\t\t\t'sanitize_callback' => $sanitizer,\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t}\n}", "public function registerStyles() {\n $this->styles['mkdf-bootstrap'] = 'assets/css/mkdf-bootstrap.css';\n $this->styles['mkdf-page-admin'] = 'assets/css/mkdf-page.css';\n $this->styles['mkdf-options-admin'] = 'assets/css/mkdf-options.css';\n $this->styles['mkdf-meta-boxes-admin'] = 'assets/css/mkdf-meta-boxes.css';\n $this->styles['mkdf-ui-admin'] = 'assets/css/mkdf-ui/mkdf-ui.css';\n $this->styles['mkdf-forms-admin'] = 'assets/css/mkdf-forms.css';\n $this->styles['mkdf-import'] = 'assets/css/mkdf-import.css';\n $this->styles['font-awesome-admin'] = 'assets/css/font-awesome/css/font-awesome.min.css';\n\n foreach ($this->styles as $styleHandle => $stylePath) {\n sienna_mikado_register_skin_style($styleHandle, $stylePath);\n }\n\n }", "function tsk_editor_styles() {\n\t\tadd_editor_style( 'assets/css/editor-style.css' );\n\t}", "protected function generateCSS() {}", "public static function setSiteStyling()\n {\n $styling = SiteManagement::getMetaValue('settings');\n if (!empty($styling[0]['enable_theme_color']) && $styling[0]['enable_theme_color'] == 'true') {\n if (!empty($styling[0]['primary_color'])) {\n ob_start(); ?>\n <style>\n /* Theme Text Color */\n a,\n p a,\n p a:hover,\n a:hover,\n a:focus,\n a:active,\n .wt-navigation>ul>li:hover>a,\n .wt-navigation>ul>li.current-menu-item>a,\n .wt-navarticletab li:hover a,\n .wt-navarticletab li a.active,\n .wt-categoriescontent li a:hover,\n .wt-joinsteps li.wt-active a,\n .wt-effectivecontent li:hover a,\n .wt-articlesingle-content .wt-description .wt-blockquotevone q,\n .wt-filtertag li:hover a,\n .wt-userlisting-breadcrumb li .wt-clicksave,\n .wt-clicksave,\n .wt-qrcodefeat h3 span,\n .wt-comfollowers ul li:hover a span,\n .wt-postarticlemeta .wt-following span,\n .tg-qrcodefeat h3 span,\n .active-category {\n color: <?php echo $styling[0]['primary_color'] ?>;\n }\n\n /* Theme Background Color */\n .wt-btn:hover,\n .wt-dropdowarrow,\n .navbar-toggle,\n .wt-btn,\n .wt-navigationarea .wt-navigation>ul>li>a:after,\n .wt-searchbtn,\n .wt-sectiontitle:after,\n .wt-navarticletab li a:after,\n .wt-pagination ul li a:hover,\n .wt-pagination ul li.wt-active a,\n .wt-widgettag a:hover,\n .wt-articlesingle-content .wt-description blockquote span i,\n .wt-searchgbtn,\n .wt-filtertagclear a,\n .ui-slider-horizontal .ui-slider-range,\n .wt-btnsearch,\n .wt-newnoti a em,\n .wt-notificationicon>a:after,\n .wt-rightarea .wt-nav .navbar-toggler,\n .wt-usersidebaricon span,\n .wt-usersidebaricon span i,\n .wt-filtertag .wt-filtertagclear a,\n .loader:before,\n .wt-offersmessages .wt-ad:after,\n .wt-btnsendmsg,\n .wt-tabstitle li a:before,\n .wt-tabscontenttitle:before,\n .wt-tablecategories thead tr th:first-child:before,\n .wt-tablecategories tbody tr td:first-child:before,\n .wt-slidernav .wt-prev:hover,\n .wt-slidernav .wt-next:hover,\n .vb>.vb-dragger>.vb-dragger-styler,\n .wt-pagination ul li span,\n .la-banner-settings .wt-location h5:after,\n .la-section-settings .wt-location h6:after,\n .wt-forgotpassword-holder .card .card-body form .form-group button[type=submit] {\n background: <?php echo $styling[0]['primary_color'] ?>;\n }\n\n /* Theme Border Color */\n input:focus,\n .select select:focus,\n .form-control:focus,\n .wt-navigation>ul>li>.sub-menu,\n .wt-pagination ul li a:hover,\n .wt-widgettag a:hover,\n .wt-joinsteps li.wt-active a,\n .wt-filtertag li:hover a,\n .wt-filtertag .wt-filtertagclear a,\n .wt-themerangeslider .ui-slider-handle,\n .wt-clicksavebtn,\n .wt-pagination ul li.wt-active a,\n .wt-usernav>ul,\n .wt-pagination ul li span {\n border-color: <?php echo $styling[0]['primary_color'] ?>;\n }\n\n /* RGBA Background Color */\n .loader{\n background: <?php echo $styling[0]['primary_color'] ?>;\n background: -moz-linear-gradient(left, <?php echo $styling[0]['primary_color'] ?> 10%, rgba(255, 88, 81, 0) 42%);\n background: -webkit-linear-gradient(left, <?php echo $styling[0]['primary_color'] ?> 10%, rgba(255, 88, 81, 0) 42%);\n background: -o-linear-gradient(left, <?php echo $styling[0]['primary_color'] ?> 10%, rgba(255, 88, 81, 0) 42%);\n background: -ms-linear-gradient(left, <?php echo $styling[0]['primary_color'] ?> 10%, rgba(255, 88, 81, 0) 42%);\n background: linear-gradient(to right, <?php echo $styling[0]['primary_color'] ?> 10%, rgba(255, 88, 81, 0) 42%);\n }\n </style>\n <?php return ob_get_clean();\n }\n }\n }", "function wp_register_style($handle, $src, $deps = array(), $ver = \\false, $media = 'all')\n {\n }", "function prolingua_essential_grid_merge_styles($list) {\n\t\t$list[] = 'plugins/essential-grid/essential-grid.css';\n\t\treturn $list;\n\t}", "function styles() {\n\twp_register_style(\n\t\t'fontawesome',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/fontawesome/css/font-awesome.min.css\",\n\t\tarray(),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_register_style(\n\t\t'ionicons',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/ionicons/css/ionicons.min.css\",\n\t\tarray(),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_register_style(\n\t\t'bootstrap',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/bootstrap/dist/css/bootstrap.min.css\",\n\t\tarray( 'fontawesome' ),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_register_style(\n\t\t'sanitize',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/sanitize/sanitize.min.css\",\n\t\tarray(),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_enqueue_style(\n\t\t'vincentragosta',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/css/vincentragosta---twenty-seventeen.css\",\n\t\tarray( 'bootstrap', 'fontawesome', 'ionicons', 'sanitize' ),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n}", "protected static function registerStyles() {\n\t\tforeach (static::$styles as $handle => $stylePath) {\n\t\t\tstatic::registerStyle($handle, $stylePath);\n\t\t}\n\t}", "function module_styleLoad($val, $data)\n{\n\tif (!$data) return;\n\tsetCacheData(\"styleLoad\", $data);\n\n\t$store\t= config::get(':styles', array());\n\tif ($store[$data]) return;\n\t\n\t$store[$data] = $data;\n\tconfig::set(':styles', $store);\n}", "function figjam_framework_add_editor_styles() {\n add_editor_style( 'assets/css/editor-styles.css' );\n\n /**\n * Set Content Width\n */\n global $content_width;\n if ( ! isset( $content_width ) ) $content_width = 1170;\n\n //add_post_type_support('testimonial', 'thumbnail');\n //add_post_type_support('portfolio', 'excerpt');\n\n }", "function twentyfifteen_add_editor_styles() {\n add_editor_style( 'css/editor-style.css' );\n}", "private function initStyle(){\n\t\t\t$file_style_normal = $this->root_path.'portal/realmstatus/wowclassic/styles/wowstatus.style_normal.class.php';\n\t\t\t$file_style_gdi = $this->root_path.'portal/realmstatus/wowclassic/styles/wowstatus.style_gdi.class.php';\n\t\t\t\n\t\t\t// include the files\n\t\t\tinclude_once($file_style_normal);\n\t\t\tinclude_once($file_style_gdi);\n\t\t\t\n\t\t\t// get class\n\t\t\tif ($this->config->get('gd', 'pmod_'.$this->moduleID))\n\t\t\t\t$this->style = registry::register('wowstatus_style_gdi');\n\t\t\t\telse\n\t\t\t\t\t$this->style = registry::register('wowstatus_style_normal');\n\t\t}", "public function add_css($styles=null, $combine=null){\n $combine = is_null($combine) ? $this->combine : $combine;\n\n if (is_string($styles) && !empty($styles)){\n $this->styles[] = array($combine, $styles);\n }else if (is_array($styles) && count($styles) != 0){\n foreach ($styles as $style){\n $this->styles[] = array($combine, $style);\n }\n }\n\t}", "function sp_admin_scripts_style_sc ($hook) {\n\tif( $hook == 'post.php' || $hook == 'post-new.php' ) {\n\twp_register_style( 'shortcode-style', esc_url( get_template_directory_uri() . '/library/shortcode/css/sc-style.css' ) );\n\twp_enqueue_style( 'shortcode-style' );\n\t}\n}", "protected function loadStylesheets() {}", "public static function style_set() {\n\t\t global $I2_USER;\n\t\t if (self::$style == NULL) {\n\t\t\t if (isset($I2_USER)) {\n\t\t\t\t\t self::$style = ($I2_USER->style);\n\t\t\t }\n\t\t\t else {\n\t\t\t\t\t self::$style = 'default';\n\t\t\t }\n\t\t\t d('Style set to '.self::$style,7);\n\t\t }\n\t }", "private function load_admin_styles() {\n\n\t}", "public function ec_customizer_styles() {\n\t\t?>\n\t\t<style>\n\t\t\tli#customize-control-tribe_customizer-month_week_view-highlight_color,\n\t\t\tli#customize-control-tribe_customizer-photo_view-bg_color,\n\t\t\tli#customize-control-tribe_customizer-single_event-post_title_color {\n\t\t\t\topacity: 0.2;\n\t\t\t\tpointer-events: none;\n\t\t\t\tcursor: not-allowed;\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}", "public function add_styling() {\n\t\t\tglobal $fusion_settings;\n\n\t\t\t$css['global']['.fusion-builder-row.fusion-row']['max-width'] = 'var(--site_width)';\n\n\t\t\treturn $css;\n\t\t}", "function jehaann_style(){\n wp_register_style('style', get_stylesheet_uri(),'','1.0','all');\n\n //cargando hojas de estilos\n\n wp_enqueue_style('style');\n}", "public function add_style($slug = null, $src = null, $deps = null) {\n\t\t$style = [];\n\t\t\n\t\t$style['slug'] = $slug;\n\t\t$style['src'] = $src;\n\t\t$style['deps'] = $deps;\n\t\t\n\t\tarray_push($this->styles, $style);\n\t}", "static function _style_on() {\n\t\treturn self::style( true );\n\t}", "protected function styles($style, $element) {\n\t\t$element->setAttribute('size', $style->getStyle('size'));\n\t\t$element->setAttribute('color', $style->getStyle('color'));\n\t}", "public function register_styles() {\n\n\t\t\twp_register_style(\n\t\t\t\t\"$this->ID-style\",\n\t\t\t\tplugins_url( 'style.css', __FILE__ ),\n\t\t\t\tnull,\n\t\t\t\t$this->version\n\t\t\t);\n $file_tmpl = 'ui/timeago/locale/jquery.timeago.%s.js';\n wp_register_script( 'timeago-locale', WP_STREAM_URL . sprintf( $file_tmpl, 'en' ), array( 'timeago' ), '1' );\n wp_register_style( 'select2', WP_STREAM_URL . 'ui/select2/select2.css', array(), '3.5.1' );\n\t\t}", "public function get_app_stylesheet()\n {\n }" ]
[ "0.7556854", "0.7437559", "0.71718735", "0.6671738", "0.66553813", "0.6635635", "0.6608619", "0.659283", "0.65915465", "0.6573069", "0.64917064", "0.64897275", "0.64716876", "0.64708173", "0.6440702", "0.6365354", "0.6354163", "0.6330326", "0.6325524", "0.6302447", "0.62896293", "0.62821925", "0.62763464", "0.626447", "0.6254984", "0.6227382", "0.62180114", "0.6216552", "0.6214669", "0.62016463", "0.619727", "0.6189293", "0.6163861", "0.61373657", "0.6124443", "0.61182725", "0.6087375", "0.60760957", "0.6064622", "0.60490584", "0.60484636", "0.6031277", "0.6030375", "0.6025469", "0.60233104", "0.6021231", "0.6013944", "0.60056657", "0.599268", "0.59822583", "0.59771794", "0.59661645", "0.5964531", "0.59613466", "0.59533024", "0.59490335", "0.59370536", "0.593622", "0.5926982", "0.59253615", "0.5913019", "0.59083235", "0.58976144", "0.5886123", "0.5879996", "0.587441", "0.5864877", "0.586111", "0.5846224", "0.58410776", "0.5837565", "0.5825012", "0.5824196", "0.582106", "0.57956314", "0.5789132", "0.5787515", "0.5786319", "0.5773843", "0.577103", "0.57630354", "0.5760428", "0.5759022", "0.5747223", "0.5740645", "0.5737801", "0.573474", "0.5728796", "0.572611", "0.57179004", "0.5716418", "0.5714001", "0.57123905", "0.5710955", "0.57044", "0.5697648", "0.56952447", "0.56936866", "0.5693565", "0.56924266", "0.5680115" ]
0.0
-1
/ Refresh config data
function _refresh_config($tpl, $add_vars = false) { if(@file_exists(IP_ROOT_PATH . 'templates/' . $tpl . '/xs_config.cfg')) { $style_config = array(); include(IP_ROOT_PATH . 'templates/' . $tpl . '/xs_config.cfg'); if(sizeof($style_config)) { global $config, $db; for($i = 0; $i < sizeof($style_config); $i++) { if(!isset($this->style_config[$style_config[$i]['var']])) { $this->style_config[$style_config[$i]['var']] = $style_config[$i]['default']; if($add_vars) { $this->vars['TPL_CFG_' . strtoupper($style_config[$i]['var'])] = $style_config[$i]['default']; } } } $str = $this->_serialize($this->style_config); $config_name = 'xs_style_' . $tpl; if(isset($config[$config_name])) { $sql = "UPDATE " . CONFIG_TABLE . " SET config_value='" . str_replace('\\\'', '\'\'', addslashes($str)) . "' WHERE config_name='" . str_replace('\\\'', '\'\'', addslashes($config_name)) . "'"; } else { $sql = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('" . str_replace('\\\'', '\'\'', addslashes($config_name)) . "', '" . str_replace('\\\'', '\'\'', addslashes($str)) . "')"; } $db->sql_query($sql); $config[$config_name] = $str; return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function refreshConfig()\n {\n $this->_data = $this->_reader->read();\n $this->merge($this->_dbReader->get());\n }", "function reloadConfig() {\n\t\treturn $this->_config = PommoAPI :: configGetBase(TRUE);\n\t}", "public static function reload()\n {\n self::$config = null;\n self::init();\n }", "private function refresh_db_config()\n {\n $this->systemConfiguration->where(true, true);\n foreach ($this->scheduleMapping as $scheduleType) {\n foreach ($scheduleType as $where) {\n $this->systemConfiguration->orWhere('type', $where);\n }\n }\n $this->config = $this->systemConfiguration->select('type', 'value')->get()->toArray();\n }", "private function reconfigure() {\n\t\t$global = JConfig::getInstance();\n\t\tforeach ($global as $key => $value) {\n\t\t\tif (array_key_exists($key, $this->config)) {\n\t\t\t\t$this->config[$key] = $value;\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tif (class_exists('JPConfig')) {\n\t\t\t\t$this->config = array_merge($this->config, JPConfig::getData());\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t// class JPConfig doesn't exist\n\t\t}\n\t}", "abstract protected function _updateConfiguration();", "private function setUpConfig() {\n\n //Get the file where the configs are and process the arrays\n require($this->_data['pathtodata']);\n\n $this->_data = array_merge($this->_data,$acs_confdata);\n\n if (empty($this->_data['indexfile']))\n $this->_data['indexfile'] = 'index';\n\n if (empty($this->_data['common_extension']))\n $this->_data['common_extension'] = COMMON_EXTENSION;\n \n $this->setUriData($this->_data); \n \n //Create the cache file of the config\n if (isset($this->_data['cache_config']) && $this->_data['cache_config'])\n $this->saveConfig();\n else\n if (file_exists($this->_data['cache_config_file']))\n unlink($this->_data['cache_config_file']); \n }", "public function loadConfig()\n {\n $this->setGlobalStoreOfShopNumber($this->getShopNumber());\n $this->loadArray($this->toArray());\n $this->setExportTmpAndLogSettings();\n }", "function refreshSettings() {\n\tglobal $settings;\n\n\t$settings = json_decode(file_get_contents('settings.json'), true);\n}", "public function onConfigUpdated() {\n\t\tif ($this->client) {\n\t\t\t$this->client->config = $this->config;\n\t\t\t$this->client->onConfigUpdated();\n\t\t}\n\t}", "private function updateConfigTable()\n {\n $connection = $this->resource->getConnection(ResourceConnection::DEFAULT_CONNECTION);\n $lsTableName = $this->resource->getTableName('core_config_data');\n $websiteQuery = \"UPDATE $lsTableName set scope = 'websites', scope_id = 1 WHERE path IN ('\" . implode(\"','\", $this->websiteScopeFields) . \"')\";\n $storeQuery = \"UPDATE $lsTableName set scope = 'stores', scope_id = 1 WHERE path IN ('\" . implode(\"','\", $this->nonwebsiteScopeFields) . \"')\";\n try {\n $connection->query($websiteQuery);\n $connection->query($storeQuery);\n\n } catch (Exception $e) {\n $this->logger->debug($e->getMessage());\n }\n }", "function reload_all_sync() {\n\tglobal $config;\n\n\t/* parse config.xml again */\n\t$config = parse_config(true);\n\n\t/* set up our timezone */\n\tsystem_timezone_configure();\n\n\t/* set up our hostname */\n\tsystem_hostname_configure();\n\n\t/* make hosts file */\n\tsystem_hosts_generate();\n\n\t/* generate resolv.conf */\n\tsystem_resolvconf_generate();\n\n\t/* enable routing */\n\tsystem_routing_enable();\n\n\t/* set up interfaces */\n\tinterfaces_configure();\n\n\t/* start dyndns service */\n\tservices_dyndns_configure();\n\n\t/* configure cron service */\n\tconfigure_cron();\n\n\t/* start the NTP client */\n\tsystem_ntp_configure();\n\n\t/* sync pw database */\n\tunlink_if_exists(\"/etc/spwd.db.tmp\");\n\tmwexec(\"/usr/sbin/pwd_mkdb -d /etc/ /etc/master.passwd\");\n\n\t/* restart sshd */\n\tsend_event(\"service restart sshd\");\n\n\t/* restart webConfigurator if needed */\n\tsend_event(\"service restart webgui\");\n}", "public function loadConfig($data);", "public function reload_settings()\r\n\t{\r\n\t\t$this->clear_cache();\r\n\t\t$this->load_settings();\r\n\t}", "private function getAllConfig() {\n $this->user_panel->checkAuth();\n $this->config->findAll();\n }", "public function getConfigChanged();", "public function refresh() {}", "private function Reload(){\t\t\t\t\r\n\t $this->valueLatestPeriod();\t \r\n\t $this->prepareGridData(); //ADDING TO OUTPUT\t\t\r\n\t}", "public function reloadSettings () \n {\n \t// get the current settings from the database\n \t$this->settings = $this->qdb_object->getSettingsAll();\n \t// perform error checking\n \tif (isset ($this->settings['ERRORS']) && ($this->settings['ERRORS'] != ''))\n \t{\n \t\t// fatal error as we need these settings for everything else to work\n \t\t$err = Errors::getInstance();\n \t\t$err->errorEvent(ERROR_SETTINGS, \"Error reloading settings \".$this->settings['ERRORS']);\n \t}\n \t\n }", "private function loadConfig()\n {\n $this->category->config = [];\n $this->loadMeta('admins', 'array');\n $this->loadMeta('members', 'array');\n $this->loadMeta('template');\n $this->loadMeta('category', 'array');\n //$this->loadMetaCategory();\n $this->loadInitScript();\n }", "public function reload()\n {\n $this->adapters = $this->findValidAdapters();\n }", "private function loadConfig(){\n $DB = DB::pass();\n $conf = $DB->loadConfig();\n if ( count($conf) > 0 ){\n foreach($conf as $c){\n $this->config->set($c['cluster'] . \".\" . $c['name'],$c['value']);\n }\n } else {\n throw new SystemException(\"No database configuration\");\n }\n }", "protected function initConfig()\n {\n $this->config = [];\n }", "public function initConfig() {\r\n\t$config = array();\r\n\tinclude($this->name . '/config.php');\r\n\t\\app::$config = array_merge(\\app::$config, $config);\r\n }", "protected function setConfigValue($data){\t\n\t\tMage::getModel('core/config_data')->load($data['path'],'path')->setData($data)->save();\n\t}", "public function refresh_plugin_settings() {\n self::$instance->plugin_settings = self::$instance->get_plugin_settings();\n }", "function refreshDataSet(){\n\t\t$this->LoadFiles();\n\n\t\t$this->getUsers();\n\t\t$this->getSchedule();\n\n\t\t//close and free the file locks\n\t\t$this->fileHandler->close($this->userFile);\n\t\t$this->fileHandler->close($this->scheduleFile);\n\t}", "private function refreshData()\n {\n $output = [];\n exec('iwconfig 2> /dev/null', $output);\n foreach ($output as $line) {\n $firstChar = substr($line, 0, 1);\n if ($firstChar != \" \" && $firstChar != \"\") {\n $interface = rtrim(substr($line, 0, 9));\n $this->interfaces[$interface] = [];\n }\n if (preg_match('/(?<=ESSID:\")[\\S\\s]+(?=\")/', $line, $matches)) {\n $this->interfaces[$interface]['ssid'] = $matches[0];\n }\n }\n }", "public function flush()\n {\n self::$configs = [];\n }", "public function loadConfigs()\n {\n self::$country_configs = self::getCountryConfigs();\n $configs = new parent();\n self::$categories = $configs->getCategories();\n self::$site_data = self::get_site_data();\n self::$payments_name = self::setPaymentGateway();\n }", "public function refresh();", "public function refresh();", "private function loadConfigRepository(): void\n {\n // Check Config\n if (\\count($this->configs) > 0) {\n return;\n }\n\n // Load Cache|Repository\n $store = $this->configRepo->findAll();\n foreach ($store as $config) {\n if (count($config->getValue()) === 1) {\n $val = $config->getValue()[0];\n\n if ('true' === $val) {\n $val = true;\n } elseif ('false' === $val) {\n $val = false;\n }\n } else {\n $val = $config->getValue();\n }\n\n $this->configs[$config->getName()] = $val;\n }\n }", "private static function getConfig() {\n\n\t\t$pathRoot = $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'],0, strpos($_SERVER['PHP_SELF'],\"/\",1)).\"/config/\";\n\n\t\t$jsonConfig = file_get_contents($pathRoot.'config.json');\n\t\tself::$arrayConfig = json_decode($jsonConfig);\n\t}", "protected function retrieveConfigUpdates(&$config) {\n $config['updates'] = array();\n $updates = $this->GenomeUpdate->find('all', array(\n 'conditions' => array(\n 'config_id' => $config['id']\n )\n ));\n // Parses uploads retrieved\n foreach($updates as $update) {\n $update = $update['GenomeUpload'];\n $index = $update['id'];\n if($index) {\n $config['updates'][$index] = $update;\n }\n }\n }", "private function saveConfig() {\n \tself::$_configInstance = (object)$this->_data; \n file_put_contents($this->_data['cache_config_file'],serialize(self::$_configInstance)); \n }", "public function reload() {\n $this->sessionData = null;\n $this->getAllValues();\n }", "abstract public function refresh();", "private function mergeConfig()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/config.php', 'routecache'\n );\n }", "protected function addToConfig()\n {\n $path = $this->getConfigPath();\n $config = require($path);\n if (isset($config[$this->moduleId])) {\n if (\\Yii::$app->controller->confirm('Rewrite exist config?')) {\n $config[$this->moduleId] = $this->getConfigArray();\n echo 'Module config was rewrote' . PHP_EOL;\n }\n } else {\n $config[$this->moduleId] = $this->getConfigArray();\n }\n\n\n $this->writeArrayToFile($this->getConfigPath(), $config);\n }", "public static function load()\n {\n $entries = Configuration::get();\n \n foreach ($entries as $entry) {\n self::$config[$entry->id] = unserialize($entry->value);\n }\n }", "private function load_config() {\n $this->config = new Config();\n }", "function load_config()\n\t{\n\t\t$sql = \"SELECT * FROM config\";\n\n\t\t$dbdata = $this->conn->prepare($sql);\n\t\t$dbdata->execute();\n\n\t\tforeach ($dbdata->fetchAll(PDO::FETCH_OBJ) as $conf) {\n\t\t\tif ($conf->value == 'true') {\n\t\t\t\t$conf->value = true;\n\t\t\t} elseif ($conf->value == 'false') {\n\t\t\t\t$conf->value = false;\n\t\t\t}\n\n\t\t\t$this->config->set($conf->param, $conf->value);\n\t\t}\n\t}", "function loadConfig(){\n $file = file_get_contents($this->config_dir, FILE_USE_INCLUDE_PATH);\n $urls = json_decode($file,TRUE);\n //not the best way but error handling\n if ($file == NULL || $urls == NUll ){\n print(\"Error reading the config file or it it is empty\");\n }\n else{\n $this->config_data = $urls;\n\n }\n }", "function updateConfigCache() {\n\t$config_path = 'config';\n\t$cache_path = 'cache';\n\t\n\t$cache_file_name = 'config.php';\n\t\n\t$config_files = scandir($config_path);\n\t\n\t$output = [];\n\t\n\tforeach($config_files as $config_file) {\n\t\tif($config_file == '.' or $config_file == '..') {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\tif(is_file($config_path.'/'.$config_file)) {\t\n\t\t\t$config_file_name = explode('.', $config_file);\n\t\t\tif($config_file_name[count($config_file_name)-1] == 'json') {\n\t\t\t\t$config_file_namepart = '';\n\t\t\t\tforeach($config_file_name as $id => $namepart) {\n\t\t\t\t\tif($id != count($config_file_name)-1) {\n\t\t\t\t\t\tif($config_file_namepart != '') {\n\t\t\t\t\t\t\t$config_file_namepart .= '.'.$namepart;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$config_file_namepart = $namepart;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$config_file_name = $config_file_namepart;\n\t\t\t\t\n\t\t\t\t$output[$config_file_name] = getConfig($config_file);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfile_put_contents($cache_path.'/'.$cache_file_name, sprintf('<?php return %s; ?>', var_export($output, true)));\n}", "function crpTalk_admin_updateconfig()\n{\n\t// Security check\n\tif (!SecurityUtil :: checkPermission('crpTalk::', '::', ACCESS_ADMIN))\n\t{\n\t\treturn LogUtil :: registerPermissionError();\n\t}\n\n\t$talk= new crpTalk();\n\treturn $talk->updateConfig();\n}", "public function refresh()\n {\n $this->shouldUpdate();\n\n // Retrieve blacklisted domains from the cache\n $this->domains = Cache::get(config('validation.email.blacklist.cache-key'), []);\n\n $this->appendCustomDomains();\n }", "protected function updateSettings()\n {\n $this->settings = array();\n $raw_settings = $this->db->fetchAll('SELECT name, value FROM settings');\n\n foreach ($raw_settings as $raw_setting) {\n $this->settings[$raw_setting['name']] = $raw_setting['value'];\n }\n }", "public function reload ()\r\n {\r\n $this->_load();\r\n }", "abstract protected function loadConfig();", "function loadFromDatabase(){\n global $DB;\n $resource = $DB->config->get();\n $list = array();\n while($row = $DB->fetchAssoc($resource))\n {\n if(!isset($this->sections[$row['section']])) $this->sections[$row['section']] = new ConfigSection($row['section']);\n $this->sections[$row['section']]->registerFromDatabase($row);\n }\n }", "public function refreshAPCCache()\n {\n $configModel = new Default_Model_Configuration();\n $server = $configModel->getKey('api_url');\n $hash = isset($server) ? hash('sha1', $server) : '';\n \n $cache = Frapi_Cache::getInstance(FRAPI_CACHE_ADAPTER);\n \n $cache->delete($hash . '-Errors.user-defined');\n $cache->delete($hash . '-configFile-errors');\n }", "public function updateConfig()\n {\n $this->aframe_assets_url = $this->composer->getConfig()->get('aframe-url') ?? '/aframe';\n \n $composer_json = $this->getVendorDir() . DIRECTORY_SEPARATOR . 'mkungla' . DIRECTORY_SEPARATOR . 'aframe-php' . DIRECTORY_SEPARATOR . 'composer.json';\n \n if (file_exists($composer_json)) {\n $config = json_decode(file_get_contents($composer_json));\n $config->config->{'aframe-dir'} = $this->getPublicRoot();\n $config->config->{'aframe-url'} = $this->aframe_assets_url;\n $config->version = self::AFRAME_PHP_VERSION;\n file_put_contents($composer_json, json_encode($config, JSON_PRETTY_PRINT));\n }\n }", "public function populateLocalConfiguration() {}", "public function updateConfigApp() : void\n {\n $this->domainName = Str::title(Str::lower(Str::studly($this->domainName)));\n $configAppFilePath = config_path(\"app.php\");\n $oldValue = \"/*NewDomainsServiceProvider*/\";\n $newValue = \"App\\\\\".config(\"domain.path\").\"\\\\{$this->domainName}\\Providers\\DomainServiceProvider::Class,\";\n $newValue .= \"\\n\\t\\t/*NewDomainsServiceProvider*/\";\n $newContent = Str::replaceFirst($oldValue, $newValue, File::get($configAppFilePath));\n File::put($configAppFilePath, $newContent);\n $this->info(\"App Config File Updated and Added the new Service Provider of Domain\");\n }", "function updateConfig() {\n global $db;\n global $lang;\n\n if(configEnabled() == true) {\n if($res = $db->query(\"INSERT IGNORE INTO `\".$lang[\"config_db_name\"].\"`.`\".$lang[\"config_table_name\"].\"` (`id`, `key`, `val`) VALUES \".getKeys())) {\n return \"Updated\";\n } else {\n return \"Cannot insert rows. Error: \".$db->error;\n }\n } else {\n return \"Config never been initialized\";\n }\n }", "public function load_config() {\n if (!isset($this->config)) {\n $name = $this->get_name();\n $this->config = get_config(\"local_$name\");\n }\n }", "public function initConfigData($host){}", "private function getConfig() {\n // call the GetConfig API\n $args = array('hostname' => $this->hostname);\n $api = new \\xmlAPI('GetConfig', $this->_default_key, 'xml', $args);\n $api->server_url = $this->_default_server;\n $api->send();\n\n // change hostname if found by custom_name\n $this->hostname = $api->hostname;\n \n // save fields in metadata\n $this->key = $api->api_key ? $api->api_key : $this->_default_key;\n $this->server = $api->api_server ? $api->api_server : $this->_default_server;\n $this->controller_path = $api->controller_path;\n $this->controller = $api->controller;\n $this->error_page = $api->error_page ? $api->error_page : '404';\n $this->mode = $api->mode ? $api->mode : 'test';\n $this->site_path = $api->site_path ? $api->site_path : $this->hostname;\n $this->default_site_path = $api->default_site_path;\n $this->secure_domain = $api->secure_domain;\n \n // set the list of controllers this site can use\n $this->setRights($api->row);\n }", "protected function loadConfig() {\n $json = new JSON();\n $viewConfig = $json->readFile(__SITE_PATH . \"\\\\config\\\\view.json\");\n $this->meta_info = $viewConfig['meta'];\n $this->js_files = $viewConfig['javascript'];\n $this->css_files = $viewConfig['css'];\n }", "public function refresh()\n {\n foreach($this->records as $rec) {\n $rec->refresh($this->conn);\n }\n }", "public function reloadFromConfig($config)\n {\n $this->schema = $config;\n if (!isset($this->schema['create'])) {\n $this->schema['create'] = array();\n }\n if (!isset($this->schema['update'])) {\n $this->schema['update'] = array();\n }\n if (!isset($this->schema['seed'])) {\n $this->schema['seed'] = array();\n }\n $this->tables = array();\n foreach ($this->schema['create'] as $name => $fields) {\n $table = $this->makeTable($name);\n $columns = array_keys($fields);\n foreach ($columns as $name) {\n $table->addColumn(new Property($name));\n }\n $this->addTable($table);\n }\n }", "public function reload();", "public function reload();", "public function reload();", "public function reload();", "public function refresh() {\n $this->datastreamInfo = NULL;\n $this->datastreamHistory = NULL;\n }", "public function update_config($data,$id){\n\n $this->db->where('id', $id);\n $this->db->update('configuration', $data);\n\n }", "public function setupConfig()\n {\n registry::getInstance()->set('config', $this->parseConfig());\n }", "public function refresh() {\n \tif( $this->fetchData ) {\n \t\t\n \t\t// send data to view\n \t\t$this->set(array(\n \t\t\t'data' => $this->Reading->find('all'),\n \t\t\t'_serialize', array('data')));\n \t}\n\n }", "public function updateConfigData(array $data): void\n {\n foreach ($data as $key => $value) {\n $this->db->update('settings', array('value'), array($value), \"setting_name = '{$key}'\");\n }\n }", "private function reload_data()\n\t{\n\t\tforeach ($this->checked as $k=>$v) {\n\t\t\t$this->content->template['leadtracker']['0'][$k]=$v;\n\t\t}\n\t}", "private function loadConfig()\n {\n\n $this->config = include(__DIR__ . '/../../config/config.php');\n\n }", "public function refreshAPCCache()\n {\n $configModel = new Default_Model_Configuration();\n $server = $configModel->getKey('api_url');\n $hash = isset($server) ? hash('sha1', $server) : '';\n \n $cache = Frapi_Cache::getInstance(FRAPI_CACHE_ADAPTER);\n\n $cache->delete($hash . '-Partners.emails-keys');\n $cache->delete($hash . '-configFile-partners');\n }", "public function refresh()\n {\n }", "public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}", "public function forceRefresh()\n {\n $this->dataLoaded = false;\n $this->interfaces = [];\n }", "private function loadConfig() {\n $config = array();\n\n $this->config = $config;\n if (file_exists(__DIR__ . '/../config.php')) {\n require_once(__DIR__. '/../config.php');\n $this->config = array_merge($this->config, $config);\n //TODO check for required config entries\n } else {\n //TODO handle this nicer\n $this->fatalErr('NO_CFG', 'Unable to load config file');\n }\n\n if (array_key_exists('THEME', $this->config)) {\n $this->pageLoader->setTheme($this->config['THEME']);\n }\n }", "public function readConfigFile(): void\n {\n $configPath = __DIR__ . '/../../.config';\n if (!file_exists($configPath)) {\n echo \"Could not find .config\\n\";\n die;\n }\n $lines = preg_split('/[\\r\\n]+/', file_get_contents($configPath));\n foreach ($lines as $line) {\n if (empty($line)) {\n continue;\n }\n if (substr($line, 0, 1) == '#') {\n continue;\n }\n $kv = preg_split(\"/=/\", $line);\n $key = $kv[0];\n $value = $kv[1];\n $this->data[$key] = $value;\n }\n }", "public function save()\n {\n $config_content = file_get_contents($this->config_path);\n\n foreach ($this->fields as $configuration => $value) {\n $config_content = str_replace(str_replace('\\\\', '\\\\\\\\', $value['default']), str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration]), $config_content);\n config([$value['config'] => str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration])]); //Reset the config value\n }\n\n file_put_contents($this->config_path, $config_content);\n }", "public function setConfiguration() {\n\n // Make sure all new services are available.\n drupal_flush_all_caches();\n $this->updateConfig();\n // Make sure configuration changes are available.\n drupal_flush_all_caches();\n $this->updateAuthors();\n $this->output()->writeln('Your configuration is complete.');\n }", "public function sync()\n {\n $result = '';\n foreach ($this->hosts() as $host) {\n $result .= $host;\n $result .= \"\\n\";\n }\n file_put_contents($this->configFilePath(), $result);\n }", "protected function setUpConfigurationData() {}", "public function reload() {\n\t\t$this->invoke(\"reload\");\n\t}", "private function runConfig()\n {\n $configs = [\n [\n 'name' => 'sub_title',\n 'alias_name' => 'SubTitle',\n 'value' => 'SubTitle',\n ],\n [\n 'name' => 'title',\n 'alias_name' => 'Title',\n 'value' => 'Title',\n ],\n ];\n\n foreach ($configs as $config) {\n factory(Config::class)->create($config);\n }\n }", "public function getModuleConfig() {\n $this->data['config_value'] = array_merge($this->helper_setting->getSetting($this->module_code),$this->helper_setting->getSetting('module_'.$this->module_code));\n }", "public function list() {\n $this->store->listConfig();\n }", "function reload_interfaces_sync() {\n\tglobal $config, $g;\n\n\tif (g_get('debug')) {\n\t\tlog_error(gettext(\"reload_interfaces_sync() is starting.\"));\n\t}\n\n\t/* parse config.xml again */\n\t$config = parse_config(true);\n\n\t/* enable routing */\n\tsystem_routing_enable();\n\tif (g_get('debug')) {\n\t\tlog_error(gettext(\"Enabling system routing\"));\n\t}\n\n\tif (g_get('debug')) {\n\t\tlog_error(gettext(\"Cleaning up Interfaces\"));\n\t}\n\n\t/* set up interfaces */\n\tinterfaces_configure();\n}", "private function LoadConfigFile(){\n $a = file_get_contents($this->RootDIR . 'config/main.json');\n $this->Config = json_decode($a, true);\n }", "public function _cache_refresh_all()\n {\n }", "public function loadConfig(){\n\t\t\n\t\t$opt[] = [\n\t\t\t'method' => 'setFormParams',\n\t\t\t'value'=>$this->paramsLoad(3, \\sevian\\s::getReq('command_idx'), \\sevian\\s::getReq('unit_idx'))\n\t\t\t\n\t\t];\n\t\t$this->info = $opt;//$form->getInfo();\n\t}", "public function setConfigData($data): void\n {\n foreach ($data as $key => $value) {\n if (DB::table('core_config')->where('code', '=', $key)->exists()) {\n DB::table('core_config')\n ->where('code', '=', $key)\n ->update(['value' => $value]);\n } else {\n DB::table('core_config')->insert([\n 'code' => $key,\n 'value' => $value,\n 'channel_code' => null,\n 'locale_code' => null,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }\n }\n }", "function _biurnal_conf_clear_conf_cache($name) {\n ctools_include('object-cache');\n ctools_object_cache_clear('biurnal_conf', $name);\n}", "public static function syncConfig()\n {\n $addon = self::addon();\n\n if (!self::isBackwardsCompatible() && !$addon->hasConfig('synchronize')) {\n $addon->setConfig('synchronize', false);\n\n if (\n $addon->getConfig('synchronize_actions') == true ||\n $addon->getConfig('synchronize_modules') == true ||\n $addon->getConfig('synchronize_templates') == true ||\n $addon->getConfig('synchronize_yformemails') == true\n ) {\n $addon->setConfig('synchronize', true);\n\n // Set developer synchronizing actions according to theme settings\n if ($addon->getConfig('synchronize_templates')) {\n rex_addon::get('developer')->setConfig('templates', true);\n }\n if ($addon->getConfig('synchronize_modules')) {\n rex_addon::get('developer')->setConfig('modules', true);\n }\n if ($addon->getConfig('synchronize_actions')) {\n rex_addon::get('developer')->setConfig('actions', true);\n }\n if ($addon->getConfig('synchronize_yformemails')) {\n rex_addon::get('developer')->setConfig('yform_email', true);\n }\n }\n\n $addon->removeConfig('synchronize_actions');\n $addon->removeConfig('synchronize_modules');\n $addon->removeConfig('synchronize_templates');\n $addon->removeConfig('synchronize_yformemails');\n }\n }", "private function initConfig()\n {\n // Admin users can request to load config from db instead out of cache\n // @TODO Cache not implemented for now\n #$refresh_cache = isset($this->user) && $this->user->getAdmin() && isset($_REQUEST['refresh_config_cache']);\n\n $repository = new \\Core\\Config\\Repository\\DbRepository();\n $repository->setPdo($this->di->get('db.default.conn'));\n $repository->setTable('tekfw_core_configs');\n\n $this->config = new \\Core\\Config\\Config($repository);\n\n // Create the Core config storage\n $core_storage = $this->config->createStorage('Core');\n\n // Load config from repository\n $this->config->load();\n\n // Make sure sites protocol is set\n if (empty($this->settings['protcol'])) {\n $this->settings['protocol'] = 'http';\n }\n\n // Check for baseurl or stop here\n if (empty($this->settings['baseurl'])) {\n Throw new FrameworkException('Baseurl not set in Settings.php');\n }\n\n // Define some basic url constants\n define('BASEURL', $this->settings['protocol'] . '://' . $this->settings['baseurl']);\n define('THEMESURL', BASEURL . '/Themes');\n\n $core_storage->set('site.protocol', $this->settings['protocol']);\n $core_storage->set('site.baseurl', $this->settings['baseurl']);\n\n // Check and set basic cookiename to config\n if (empty($this->settings['cookie'])) {\n Throw new FrameworkException('Cookiename not set in Settings.php');\n }\n\n $core_storage->set('cookie.name', $this->settings['cookie']);\n\n // Add dirs to config\n $dirs = [\n // Framework directory\n 'fw' => $this->basedir . '/Core',\n\n // Framwork subdirectories\n 'assets' => $this->basedir . '/Assets',\n 'lib' => $this->basedir . '/Core',\n 'html' => $this->basedir . '/Core/Html',\n 'cache' => $this->basedir . '/Cache',\n\n // Public application dir\n 'apps' => $this->basedir . '/Apps'\n ];\n\n $core_storage->addPaths($dirs);\n\n // Add urls to config\n $urls = [\n 'apps' => BASEURL . '/Apps',\n 'cache' => BASEURL . '/Cache',\n 'vendor' => BASEURL . '/vendor',\n 'vendor_tekkla' => BASEURL . '/vendor/tekkla',\n ];\n\n $core_storage->addUrls($urls);\n\n $this->di->mapValue('core.config', $this->config);\n }", "public function resetData()\n {\n return reset($this->configuration);\n }", "public function refresh() {\n\t\t$this->refreshAll($this->categoryID);\n\t}", "public function readConfig() {\n if ( file_exists( $this->path . '/config/config.php' ) ) {\n require_once $this->path . '/config/config.php';\n }\n }", "private static function readConfig()\n {\n $handler = self::getHandler();\n if (null == $handler->arrConfigGlobal && null == $handler->arrConfigLocal && null == $handler->arrConfigSecure) {\n include dirname(__FILE__) . '/../../config/default.php';\n\n $handler->arrConfigLocal = $APPCONFIG;\n\n $db = Base_Database::getConnection();\n try {\n // This is just for things like API keys, password salts etc.\n // If we have, at a later point, a function to export the database\n // en masse, then we can encrypt all the output from the secureconfig\n // table. It shouldn't overide the global or local config settings\n $sql = \"SELECT * FROM secureconfig\";\n $query = $db->prepare($sql);\n $query->execute();\n $handler->arrConfigSecure = $query->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP);\n\n // This is just the regular global configuration settings.\n $sql = \"SELECT * FROM config\";\n $query = $db->prepare($sql);\n $query->execute();\n $handler->arrConfigGlobal = $query->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP);\n foreach ($handler->arrConfigGlobal as $key => $value) {\n $handler->arrConfig[$key] = array('isLocal' => false, 'isOverriden' => false, 'value' => $value[0]);\n }\n \n // This is the configuration settings local to this individual machine.\n foreach ($handler->arrConfigLocal as $key => $value) {\n if (isset($handler->arrConfig[$key])) {\n $handler->arrConfig[$key] = array('isLocal' => true, 'isOverriden' => true, 'value' => $value);\n } else {\n $handler->arrConfig[$key] = array('isLocal' => true, 'isOverriden' => false, 'value' => $value);\n }\n }\n } catch(Exception $e) {\n error_log($e);\n die();\n }\n }\n }", "public function refreshAPCCache()\n {\n $configModel = new Default_Model_Configuration();\n $server = $configModel->getKey('api_url');\n $hash = isset($server) ? hash('sha1', $server) : '';\n \n $cache = Frapi_Cache::getInstance(FRAPI_CACHE_ADAPTER);\n\n $cache->delete($hash . '-Output.default-format');\n }" ]
[ "0.8673226", "0.7301253", "0.7087809", "0.6933835", "0.6847985", "0.6811622", "0.6689526", "0.6574424", "0.65683705", "0.6481157", "0.6471144", "0.64402336", "0.6393215", "0.63185626", "0.62862474", "0.626872", "0.6236541", "0.6218888", "0.6193152", "0.617663", "0.61540186", "0.61351216", "0.6132079", "0.612646", "0.6116398", "0.6103092", "0.6099168", "0.6062962", "0.60563874", "0.6040637", "0.60359025", "0.60359025", "0.6035836", "0.60332793", "0.60268396", "0.6005544", "0.60032433", "0.59910995", "0.59878093", "0.59688836", "0.596886", "0.5966478", "0.5949276", "0.593732", "0.5933386", "0.59171855", "0.59111005", "0.59105533", "0.58987397", "0.58931863", "0.58788186", "0.5878088", "0.5876739", "0.5864087", "0.586389", "0.5858271", "0.5853075", "0.5851898", "0.58507377", "0.5844333", "0.5837539", "0.5832371", "0.5823034", "0.5823034", "0.5823034", "0.5823034", "0.5819656", "0.57919824", "0.5785145", "0.5784042", "0.577768", "0.5774213", "0.5774006", "0.57553667", "0.5749096", "0.5743578", "0.5737679", "0.5731168", "0.57121545", "0.5701964", "0.56999606", "0.5681919", "0.56794035", "0.5677107", "0.5671656", "0.5668522", "0.56455284", "0.56353515", "0.5627379", "0.5621129", "0.56179935", "0.56157523", "0.5612284", "0.56108075", "0.5604432", "0.5603048", "0.55905324", "0.55863917", "0.55842143", "0.55835533" ]
0.60549694
29
/ Get style configuration
function _get_config($tpl, $add_config) { $this->style_config = array(); if(empty($tpl)) { $tpl = $this->tpl; } $config_name = 'xs_style_' . $tpl; global $config; if(empty($config[$config_name])) { if($add_config) { $this->_add_config($tpl, $tpl === $this->tpl ? true : false); } return $this->style_config; } $this->style_config = $this->_unserialize($config[$config_name]); if($tpl === $this->tpl) { foreach($this->style_config as $var => $value) { $this->vars['TPL_CFG_' . strtoupper($var)] = $value; } } return $this->style_config; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStyle() {}", "public function getStyle();", "function getStyle() {return $this->readstyle();}", "public static function getStyle ()\n {\n return self::$_style;\n }", "public function style()\n {\n return $this->style;\n }", "public function getStyle()\n\t{\n\t\treturn $this->root->getParser()->style;\n\t}", "public function getStyle() {\n\t\t\treturn $this->style;\n\t\t}", "function getStyle() { return $this->_style; }", "public static function getStyle(){\n $row = getDatabase()->queryFirstRow(\"SELECT `value` FROM `settings` WHERE `setting` = 'website_style'\");\n $styleFolder = $row['value'];\n return new Style($styleFolder);\n }", "public function getStyle(string $name);", "public function get_styles() {\n\t\treturn [];\n\t}", "public static function getPageStyle()\n {\n return ( isset( $_COOKIE['styleDefCon'] ) && in_array( $_COOKIE['styleDefCon'], self::$pageStyles ) )\n ? $_COOKIE['styleDefCon']\n : self::$pageStyles[0];\n }", "protected function getStyle()\n {\n return explode(\n ',',\n Mage::getStoreConfig(Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_DYNAMIC_COUPON_STYLE)\n );\n }", "public function stylePath() {\n\n // Check for Style to Use\n if($this->styleToUse) {\n\n // Return\n return $this->registeredStyles[$this->styleToUse];\n }\n\n return null;\n }", "public function getCss();", "public function getCss();", "function readStyles() { $this->ParseCSSFile();\n return $this->_stylelist; }", "public function getFrontendStyles() {\n }", "public function getFrontendStyles() {\n }", "public function getStyleLoader();", "function getStyles () {\n return array(\"template.css\");\n }", "public function getStyleMarkup(){ return $this->styles_markup; }", "public function getStyles()\n\t{\n\t\treturn $this->styles;\n\t}", "public function getCssStyle(): ?string;", "public function getStyles()\n {\n return Styles::newInstance()->getStyles();\n }", "public function getCss()\n {\n return $this->data(self::CSS);\n }", "public function getStyles() {\n return $this->styles;\n }", "public function get_styles () {\r\n\t\treturn empty($this->_data[self::STYLES])\r\n\t\t\t? array()\r\n\t\t\t: $this->_data[self::STYLES]\r\n\t\t;\r\n\t}", "public function getStyles()\n {\n return $this->_styles;\n }", "public function get_app_stylesheet()\n {\n }", "static public function getCSS() {\n\t\treturn self::$css;\n\t}", "function getStyleSheet() {\n\t\treturn $this->getPluginPath() . '/styles/objectsForReview.css';\n\t}", "public function loadStyle(){\n \t\treturn null;\n \t}", "public function configAction()\n {\n $styles = array_map(function ($fn) {\n return basename($fn, '.css');\n }, glob(App::locator()->get('highlight:assets/styles').'/*.css'));\n\n return compact('styles');\n }", "public function style(): ?string {\n\t\treturn $this->m_attributes[\"style\"];\n\t}", "public function get_stylesheet()\n {\n }", "public function get_stylesheet()\n {\n }", "public function getStyle ($name) {\n return $this->styleset->getStyle($name);\n }", "public function getStylesheetOptions()\n {\n return $this->stylesheetOptions;\n }", "public function styles() {\n\t\treturn parent::styles();\n\t}", "public function getStyles() {\n return $this->_styles;\n }", "private function getStylesheet() {\n $themes = [];\n $stylesheet_options = [];\n $theme_handler = Drupal::service('theme_handler');\n foreach ($theme_handler->listInfo() as $name => $theme) {\n $themes = [];\n $stylesheet_options = [];\n $theme_handler = Drupal::service('theme_handler');\n foreach ($theme_handler->listInfo() as $name => $theme) {\n $themes[$name] = DRUPAL_ROOT . '/' . $theme\n ->getPath();\n if (file_exists($themes[$name])) {\n $stylesheet = $themes[$name] . '/css/' . $name . '.' . 'ckeditor.css';\n }\n else {\n $stylesheet = drupal_get_path('module', 'ckeditor_stylesheetparser') . '/js/plugins/stylesheetparser/samples/assets/sample.css';\n }\n }\n $stylesheet_options = $stylesheet;\n return $stylesheet_options;\n }\n }", "public function getStyle() {\n // have to handle it here if set, so we can show apps in dark mode.\n $darkmode = '';\n if ($this->getRequest()->getSession()->get('darkmode') === 'true') {\n statsd_bump('dagd_dark_mode_active');\n }\n\n return array(\n $darkmode,\n );\n }", "protected function get_styles()\n\t{\n\t\t$sql = 'SELECT style_id, style_path, style_parent_id, bbcode_bitfield FROM ' . $this->styles_table;\n\n\t\treturn $this->fetch_decoded_rowset($sql);\n\t}", "function get_stylesheet()\n {\n }", "protected function getStyles() {\r\n\t\treturn \"\";\r\n\t}", "private static function get_styles() {\n\n\t\treturn [\n\t\t\t'basic' => esc_html__( 'Basic', 'wpforms' ),\n\t\t\t'compact' => esc_html__( 'Compact', 'wpforms' ),\n\t\t\t'table' => esc_html__( 'Table', 'wpforms' ),\n\t\t\t'table_compact' => esc_html__( 'Table, Compact', 'wpforms' ),\n\t\t];\n\t}", "public static function getCss() {\n return self::get('_css', array());\n }", "function get_editor_stylesheets()\n {\n }", "public function getStyleUrl(){\n return \"http://localhost/dashboard/dm_chansons/src/view/style.css\";\n }", "private function getImageStylesConfig() {\n static $styles = [];\n if (!empty($styles)) {\n return $styles;\n }\n $image_style_config_files = Utils::getConfigFiles($this->scaffolder->getConfigDir() . '/image_style');\n if (!empty($image_style_config_files)) {\n foreach ($image_style_config_files as $image_style_config_file) {\n $config_data = Utils::getConfig($image_style_config_file);\n if ($config_data) {\n if (!empty($config_data['image_styles'])) {\n $prefix_machine_name = isset($config_data['prefix']['machine_name']) ? $config_data['prefix']['machine_name'] : '';\n $prefix_name = isset($config_data['prefix']['name']) ? $config_data['prefix']['name'] : '';\n $multiplier_config = isset($config_data['multiplier']) ? $config_data['multiplier'] : ['1x' => '1x'];\n $multiplier = [];\n foreach ($multiplier_config as $key => $value) {\n $multiplier[$value] = floatval(str_replace('x', '', $value));\n }\n\n $new_image_styles = [];\n foreach ($multiplier as $suffix => $scale) {\n foreach ($config_data['image_styles'] as $config) {\n $config['name'] = empty($config['name']) ? $config['machine_name'] : $config['name'];\n $config['name'] = $prefix_name . $config['name'];\n $config['machine_name'] = $prefix_machine_name . $config['machine_name'];\n if (count($multiplier) > 1) {\n $config['name'] .= '@' . $suffix;\n $config['machine_name'] .= '_' . $suffix;\n }\n $config['machine_name'] = preg_replace(\"/[^a-z0-9_]/\", '_', $config['machine_name']);\n\n if ($config['effects']) {\n foreach ($config['effects'] as $key => &$effects) {\n $index = $key + 1;\n $effects['index'] = $index;\n $effects['weight'] = empty($effects['weight']) ? $index : $effects['weight'];\n foreach (array('width', 'height') as $k) {\n if (isset ($effects['data'][$k])) {\n $effects['data'][$k] = round($effects['data'][$k] * $scale);\n }\n }\n }\n }\n $styles[$config['machine_name']] = $this->getImageData($config);\n }\n }\n }\n }\n }\n }\n return $styles;\n }", "protected function get_config()\n {\n \n if( !isset($this->_config) ){\n $this->_config = array(\n 'color-base' => array(\n 'less_var' => true,\n 'setting' => array(\n 'default' => '#147BB8'\n ),\n 'control' => array(\n 'type' => 'WP_Customize_Color_Control',\n 'args' => array(\n 'label' => 'Theme Base',\n 'section' => 'colors'\n )\n )\n )\n );\n }\n return $this->_config;\n }", "protected function getStyles() {\r\n return \"\";\r\n }", "public function css()\n {\n return $this->css;\n }", "public function getStyle() {\n if (null != $this->style) {\n return $this->style;\n }\n $_ve = $this->getValueExpression(\"style\");\n if ($_ve != null) {\n return $_ve->getValue($this->getFacesContext()->getELContext());\n } else {\n return null;\n }\n }", "public function styles()\n {\n return $this->group('styles');\n }", "function qbbson_get_stylecss_url() {\n return get_template_directory_uri().'/style.css';\n}", "private function styles_pointer() {\n\t\treturn array(\n\t\t\t'content' => '<h3>' . __( 'Styles', 'formidable' ) . '</h3>'\n\t\t\t . '<p>' . __( 'Want to make changes to the way your forms look? Make all the changes you would like right here, and watch the sample form change before your eyes.', 'formidable' ) . '</p>',\n\t\t\t'prev_page' => 'entries',\n\t\t\t'next_page' => 'import',\n\t\t\t'selector' => '.general-style',\n\t\t\t'position' => array( 'edge' => 'left', 'align' => 'right' ),\n\t\t);\n\t}", "public function getThemeConfiguration()\n {\n return $this->getParameter('themeConfiguration');\n }", "public function getStyle($name)\n {\n $style = $this->getStyles();\n\n return $style[$name];\n }", "function get_customizer_settings() {\n\tglobal $style_defaults;\n\t$styles = [];\n\t$styles[ WPM_PREFIX . 'customization_general' ] = get_option(\n\t\tWPM_PREFIX . 'customization_general',\n\t\t$style_defaults[ WPM_PREFIX . 'customization_general' ]\n\t);\n\t$styles [ WPM_PREFIX . 'mobject_style' ] = get_option(\n\t\tWPM_PREFIX . 'mobject_style',\n\t\t$style_defaults[ WPM_PREFIX . 'mobject_style' ]\n\t);\n\t$styles [ WPM_PREFIX . 'collection_style' ] = get_option(\n\t\tWPM_PREFIX . 'collection_style',\n\t\t$style_defaults[ WPM_PREFIX . 'collection_style' ]\n\t);\n\n\tforeach ( $style_defaults as $group_name => $group ) {\n\t\tforeach ( $group as $setting => $default ) {\n\t\t\tif ( ! isset( $styles[ $group_name ][ $setting ] ) ) {\n\t\t\t\t$styles[ $group_name ][ $setting ] = $style_defaults[ $group_name ][ $setting ];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $styles;\n}", "public function get_custom_css()\n {\n }", "function getInlineStyle($name = ''){\n\t\tif(!$this->isConfigured()) return false;\n\n\t\treturn $this->getTemplateObj()->getInlineStyle($name);\t\n\t}", "public function get_stylesheet_css()\n {\n }", "public function getStyles() {\n $req = 'SELECT COUNT(rs.robe_id) AS nbContenuStyle, s.styl_id, styl_libelle '\n .'FROM t_style s left JOIN t_robe_de_soiree rs ON s.styl_id = rs.styl_id '\n .'GROUP BY styl_libelle';\n $styles = $this->executerRequete($req);\n return $styles;\n }", "public function getStyleSheet() {\n return 'control';\n }", "function deco_get_stylesheet($styleSheet = null)\n{ \n if (!$styleSheet) {\n \n $styleSheet = get_theme_option('Style Sheet') ? \n get_theme_option('Style Sheet') : \n 'greenstripe';\n }\n \n return $styleSheet; \n \n}", "public function getFormStyle()\n {\n $prop = array();\n\n $prop['alignment'] = $this->value['text-align'];\n\n if (isset($this->value['background']['color']) && is_array($this->value['background']['color'])) {\n $prop['fillColor'] = $this->value['background']['color'];\n }\n\n if (isset($this->value['border']['t']['color'])) {\n $prop['strokeColor'] = $this->value['border']['t']['color'];\n }\n\n if (isset($this->value['border']['t']['width'])) {\n $prop['lineWidth'] = $this->value['border']['t']['width'];\n }\n\n if (isset($this->value['border']['t']['type'])) {\n $prop['borderStyle'] = $this->value['border']['t']['type'];\n }\n\n if (!empty($this->value['color'])) {\n $prop['textColor'] = $this->value['color'];\n }\n\n if (!empty($this->value['font-size'])) {\n $prop['textSize'] = $this->value['font-size'];\n }\n\n return $prop;\n }", "protected function getStyle($path)\n {\n $styles = $this->config->getStyles();\n return $this->getUrl($styles.$path);\n }", "public function getCss()\n {\n $result = $this->_css;\n foreach ($this->_packages as $package) {\n $config = $this->getConfig($package);\n if (!empty($config['css'])) {\n foreach ($config['css'] as $item) {\n $result[] = $item;\n }\n }\n }\n return $result;\n }", "function wp_get_global_stylesheet($types = array())\n {\n }", "public function styles() {\n\n\t\t$styles = array(\n\t\t\tarray(\n\t\t\t\t'handle' => 'gform_dropbox_jstree',\n\t\t\t\t'src' => $this->get_base_url() . '/css/jstree/style.css',\n\t\t\t\t'version' => $this->_version,\n\t\t\t\t'enqueue' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'admin_page' => array( 'form_settings' ),\n\t\t\t\t\t\t'tab' => $this->_slug,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'handle' => 'gform_dropbox_admin',\n\t\t\t\t'src' => $this->get_base_url() . '/css/admin.css',\n\t\t\t\t'version' => $this->_version,\n\t\t\t\t'enqueue' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'admin_page' => array( 'plugin_settings' ),\n\t\t\t\t\t\t'tab' => $this->_slug,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'handle' => 'gform_dropbox_frontend',\n\t\t\t\t'src' => $this->get_base_url() . '/css/frontend.css',\n\t\t\t\t'version' => $this->_version,\n\t\t\t\t'enqueue' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'field_types' => array( 'dropbox' )\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn array_merge( parent::styles(), $styles );\n\n\t}", "function GetStyle( $item )\r\n {\r\n return ( ( isset( $this->_style[$item] ) )?$this->_style[$item]:null );\r\n }", "private function getStyles() {\n $file = drupal_get_path('module', 'site_audit') . '/css/bootstrap-overrides.css';\n $styles = \"/* $file */\\n\" . file_get_contents($file);\n return $styles;\n }", "public function getStylesheetUrl (): string;", "protected function getCss () {\n if (!isset ($this->_css)) {\n $this->_css = array_merge (\n parent::getCss (),\n array (\n 'docViewerProfileWidgetCss' => \"\n #\".get_called_class().\"-widget-content-container {\n padding-bottom: 1px;\n }\n\n #select-a-document-dialog p {\n display: inline;\n margin-right: 5px;\n }\n\n .default-text-container {\n text-align: center;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n\n .default-text-container a {\n height: 17%;\n text-decoration: none;\n font-size: 16px;\n margin: auto;\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n color: #222222 !important;\n }\n \"\n )\n );\n }\n return $this->_css;\n }", "public function getCSS()\n\t{\n\t\t$css = array();\n\t\treturn $css;\n\t}", "public function get_sitemap_index_stylesheet()\n {\n }", "protected function _getStyleModel()\n\t{\n\t\treturn $this->getModelFromCache('XenForo_Model_Style');\n\t}", "public function get_sitemap_stylesheet()\n {\n }", "protected function readIncludeSubStyle() { return $this->_incsubstyle; }", "public function styles()\n\t{\n\t\treturn $this->render('styles');\n\t}", "public static function get_style_variations()\n {\n }", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public static function getCSS()\n {\n $css =\n'<style>\n\tinput[type=\"radio\"], input[type=\"checkbox\"] {\n\t\twidth: auto;\n\t}\n\t/* Slide fieldsets*/\n\tdiv.panel-body legend {\n\t\tbackground: transparent url(\"' . rex_addon::get('d2u_helper')->getAssetsUrl('arrows.png') . '\") no-repeat 0px 7px;\n\t\tpadding-left: 19px;\n\t}\n\tdiv.panel-body legend.open {\n\t\tbackground-position: 0px -36px;\n\t}\n\t.panel-body-wrapper.slide {\n\t\tdisplay: none;\n\t}\n\tinput:invalid, select:invalid, textarea:invalid {\n\t\tbackground-color: pink;\n\t}\n</style>';\n return $css;\n }", "static function _style_on() {\n\t\treturn self::style( true );\n\t}", "public function getCss()\n {\n return self::$CSS . ' ' . self::$CSS_PREFIX . $this->type;\n }", "function get_style_name($instance) {\n return 'style';\n }", "private function getStylesheets() {\n $themes = [];\n $stylesheet_options = [];\n $theme_handler = Drupal::service('theme_handler');\n\n foreach ($theme_handler->listInfo() as $name => $theme) {\n $themes = $theme_handler->listInfo();\n $names = $themes[$name]->info['name'];\n $path = DRUPAL_ROOT . '/' . $theme\n ->getPath();\n $stylesheete = $path . '/css/' . $name . '.' . 'ckeditor.css';\n $default_stylesheet = drupal_get_path('module', 'ckeditor_stylesheetparser') . '/js/plugins/stylesheetparser/samples/assets/sample.css';\n\n if (file_exists($stylesheete)) {\n $stylesheet_options = [$stylesheete => $names];\n } elseif (!file_exists($stylesheete)) {\n $stylesheet_options = [$default_stylesheet => $names];\n }\n return $stylesheet_options ;\n }\n }", "private function getStyle(string $type, string $context): string\n {\n if (isset($this->styles[$type][$context])) {\n return $this->styles[$type][$context];\n }\n\n if (isset($this->styles[$type]['common'])) {\n return $this->styles[$type]['common'];\n }\n\n if (isset($this->styles[$type]) && is_string($this->styles[$type])) {\n return $this->styles[$type];\n }\n\n return $this->styles['common'];\n }", "function article_css() {\n return Registry::prop('article', 'css');\n}", "public function getSettingscss()\r\n\t{\r\n\t\treturn $this->_generatedCssFolder . 'hybrid_settings_' . Mage::app()->getStore()->getCode() . '.css';\r\n\t}", "protected function createStyle()\n\t{\n\t\treturn new TPanelStyle;\n\t}" ]
[ "0.79801446", "0.79536927", "0.76562065", "0.7598367", "0.7388974", "0.7311698", "0.71042323", "0.70766795", "0.7009752", "0.68585974", "0.68545777", "0.68335956", "0.6821421", "0.6795768", "0.67391145", "0.67391145", "0.67186064", "0.6715713", "0.6715713", "0.6702574", "0.6666775", "0.6643067", "0.66278183", "0.66137916", "0.66130227", "0.6601781", "0.6591013", "0.65859306", "0.6585551", "0.6541223", "0.652914", "0.6483917", "0.6468392", "0.6442203", "0.64373434", "0.6382921", "0.6382921", "0.63743895", "0.63697803", "0.6364278", "0.63617355", "0.6345454", "0.6340398", "0.6339436", "0.6323882", "0.6322003", "0.6314814", "0.63019115", "0.62844366", "0.6282249", "0.62814665", "0.6269183", "0.6254629", "0.62538964", "0.6250855", "0.6237633", "0.62281865", "0.62052596", "0.61994076", "0.6196468", "0.6193655", "0.6185061", "0.61844444", "0.61539036", "0.61471", "0.6129456", "0.61224556", "0.6107234", "0.6095434", "0.6077595", "0.60723007", "0.6046545", "0.6043837", "0.6036195", "0.60353786", "0.60289574", "0.60238016", "0.6022683", "0.6010299", "0.6005634", "0.59955573", "0.5985802", "0.5975702", "0.597181", "0.597181", "0.597181", "0.597181", "0.597181", "0.597181", "0.597181", "0.597181", "0.5960011", "0.5955538", "0.5952341", "0.59447896", "0.5944219", "0.5938195", "0.59347343", "0.59300673", "0.5929327" ]
0.5980484
82
/ Split/merge config data. Using this function instead of (un)serialize because it generates smaller string so it can be stored in phpbb_config
function _serialize($array) { if(!is_array($array)) { return ''; } $str = ''; foreach($array as $var => $value) { if($str) { $str .= '|'; } $str .= $var . '=' . str_replace('|', '', $value); } return $str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function config_parser($path)\n{\n $conffile = fopen($path, 'r');\n $config = fread($conffile, filesize($path));\n\n $parsed_config = array();\n $parsed_config['head'] = array();\n $parsed_config['body'] = \"\";\n\n// split into head and body sections\n $lines = explode(\"\\n\", $config);\n\n $head = $body = array();\n $mode = 0;\n\n foreach($lines as $line)\n {\n if(preg_match(\"/--body--/i\", $line) and $mode == 0)\n $mode = 1;\n else {\n if($mode == 0) array_push($head, $line);\n else array_push($body, $line);\n }\n }\n\n// Parse key-value pares\n foreach($head as $line)\n {\n $result = explode(':', $line);\n\n $key = array_shift($result);\n $value = \"\";\n\n $id = 0;\n foreach($result as $item) {\n if($id > 0) $value .= \":$item\";\n else $value .= trim($item);\n\n $id ++;\n }\n\n if($key != \"\") {\n $parsed_config['head'] = array_merge(\n $parsed_config['head'], array(strtolower($key) => $value));\n }\n }\n\n// Re join body\n $body_txt = \"\";\n\n foreach($body as $line)\n $body_txt .= \"$line\\n\";\n\n $parsed_config['body'] = trim($body_txt);\n\n return $parsed_config;\n}", "function cfgString2CfgArray($cfgStr) {\r\n\r\n // Traverse the number of form elements:\r\n $tLines = explode(chr(10), $cfgStr);\r\n foreach($tLines as $k => $v) {\r\n\r\n // Initialize:\r\n $confData = array();\r\n $val = trim($v);\r\n\r\n // Accept a line as configuration if a) it is blank(! - because blank lines indicates new, unconfigured fields) or b) it is NOT a comment.\r\n if (!$val || strcspn($val, '#/')) {\r\n\r\n // Split:\r\n $parts = t3lib_div::trimExplode('|', $val);\r\n\r\n // Label:\r\n $confData['label'] = trim($parts[0]);\r\n\r\n // Field:\r\n $fParts = t3lib_div::trimExplode(',', $parts[1]);\r\n $fParts[0] = trim($fParts[0]);\r\n if (substr($fParts[0], 0, 1) == '*') {\r\n $confData['required'] = 1;\r\n $fParts[0] = substr($fParts[0], 1);\r\n }\r\n\r\n $typeParts = t3lib_div::trimExplode('=', $fParts[0]);\r\n $confData['type'] = trim(strtolower(end($typeParts)));\r\n\r\n if ($confData['type']) {\r\n if (count($typeParts) == 1) {\r\n $confData['fieldname'] = substr(ereg_replace('[^a-zA-Z0-9_]', '', str_replace(' ', '_', trim($parts[0]))), 0, 30);\r\n\r\n // Attachment names...\r\n if ($confData['type'] == 'file') {\r\n $confData['fieldname'] = 'attachment'.$attachmentCounter;\r\n $attachmentCounter = intval($attachmentCounter)+1;\r\n }\r\n } else {\r\n $confData['fieldname'] = str_replace(' ', '_', trim($typeParts[0]));\r\n }\r\n\r\n switch((string)$confData['type']) {\r\n case 'select':\r\n case 'radio':\r\n $confData['default'] = implode(chr(10), t3lib_div::trimExplode(',', $parts[2]));\r\n break;\r\n default:\r\n $confData['default'] = trim($parts[2]);\r\n break;\r\n }\r\n\r\n // Field configuration depending on the fields type:\r\n switch((string)$confData['type']) {\r\n case 'textarea':\r\n $confData['cols'] = $fParts[1];\r\n $confData['rows'] = $fParts[2];\r\n $confData['extra'] = strtoupper($fParts[3]) == 'OFF' ? 'OFF' :\r\n '';\r\n $confData['specialEval'] = trim($parts[3]);\r\n break;\r\n case 'input':\r\n case 'password':\r\n $confData['size'] = $fParts[1];\r\n $confData['max'] = $fParts[2];\r\n $confData['specialEval'] = trim($parts[3]);\r\n break;\r\n case 'file':\r\n $confData['size'] = $fParts[1];\r\n break;\r\n case 'select':\r\n $confData['size'] = intval($fParts[1])?$fParts[1]:\r\n '';\r\n $confData['autosize'] = strtolower(trim($fParts[1])) == 'auto' ? 1 :\r\n 0;\r\n $confData['multiple'] = strtolower(trim($fParts[2])) == 'm' ? 1 :\r\n 0;\r\n break;\r\n }\r\n }\r\n } else {\r\n // No configuration, only a comment:\r\n $confData = array(\r\n 'comment' => $val );\r\n }\r\n\r\n // Adding config array:\r\n $cfgArr[] = $confData;\r\n }\r\n\r\n // Return cfgArr\r\n return $cfgArr;\r\n }", "private static function _getConfigArray()\n\t{\n\t\treturn explode('.', self::_getConfig());\n\t}", "public static function splitConfig(array $config): array;", "function set_new_config()\n{\n\tglobal $avalaible_config, $_POST;\n\n\t$new_config = array();\n\tforeach ($avalaible_config as $element) {\n\t\tswitch ($element['type']) {\n\t\tcase 'array':\n\t\t\t$new_config[$element['name']] = explode(',', $_POST[$element['name']]);\n\t\t\tbreak;\n\t\tcase 'boolean':\n\t\t\tif ($_POST[$element['name']] == 'TRUE')\n\t\t\t\t$new_config[$element['name']] = TRUE;\n\t\t\telse\n\t\t\t\t$new_config[$element['name']] = FALSE;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$new_config[$element['name']] = $_POST[$element['name']];\n\t\t}\n\t}\n\t\t\n\treturn $new_config;\n}", "private function parseConfig(array $config, array $data)\n {\n foreach ($config as $key => &$value) {\n $value = Parse::template(Parse::env($value), $data);\n }\n\n return $config;\n }", "public function explodeConfigurationForOptionSplit(array $originalConfiguration, int $splitCount): array\n {\n $finalConfiguration = [];\n if (!$splitCount) {\n return $finalConfiguration;\n }\n // Initialize output to carry at least the keys\n for ($aKey = 0; $aKey < $splitCount; $aKey++) {\n $finalConfiguration[$aKey] = [];\n }\n // Recursive processing of array keys\n foreach ($originalConfiguration as $cKey => $val) {\n if (is_array($val)) {\n $tempConf = $this->explodeConfigurationForOptionSplit($val, $splitCount);\n foreach ($tempConf as $aKey => $val2) {\n $finalConfiguration[$aKey][$cKey] = $val2;\n }\n } elseif (is_string($val)) {\n // Splitting of all values on this level of the TypoScript object tree:\n if ($cKey === 'noTrimWrap' || (!strstr($val, '|*|') && !strstr($val, '||'))) {\n for ($aKey = 0; $aKey < $splitCount; $aKey++) {\n $finalConfiguration[$aKey][$cKey] = $val;\n }\n } else {\n $main = explode('|*|', $val);\n $lastC = 0;\n $middleC = 0;\n $firstC = 0;\n if ($main[0]) {\n $first = explode('||', $main[0]);\n $firstC = count($first);\n }\n $middle = [];\n if ($main[1]) {\n $middle = explode('||', $main[1]);\n $middleC = count($middle);\n }\n $last = [];\n $value = '';\n if ($main[2]) {\n $last = explode('||', $main[2]);\n $lastC = count($last);\n $value = $last[0];\n }\n for ($aKey = 0; $aKey < $splitCount; $aKey++) {\n if ($firstC && isset($first[$aKey])) {\n $value = $first[$aKey];\n } elseif ($middleC) {\n $value = $middle[($aKey - $firstC) % $middleC];\n }\n if ($lastC && $lastC >= $splitCount - $aKey) {\n $value = $last[$lastC - ($splitCount - $aKey)];\n }\n $finalConfiguration[$aKey][$cKey] = trim($value);\n }\n }\n }\n }\n return $finalConfiguration;\n }", "protected function flatten_config($data, &$all, $lastkey = '')\n {\n if (is_array_assoc($data)) {\n if (!empty($lastkey)) {\n $lastkey = $lastkey.'.';\n }\n\n foreach ($data as $key => $value) {\n $this->flatten_config($value, $all, $lastkey.$key);\n }\n } else {\n $all[$lastkey] = $data;\n }\n }", "function cfgArray2CfgString($cfgArr) {\r\n\r\n // Initialize:\r\n $inLines = array();\r\n\r\n // Traverse the elements of the form wizard and transform the settings into configuration code.\r\n foreach($cfgArr as $vv) {\r\n if ($vv['comment']) {\r\n // If \"content\" is found, then just pass it over.\r\n $inLines[] = trim($vv['comment']);\r\n } else {\r\n // Begin to put together the single-line configuration code of this field:\r\n\r\n // Reset:\r\n $thisLine = array();\r\n\r\n // Set Label:\r\n $thisLine[0] = str_replace('|', '', $vv['label']);\r\n\r\n // Set Type:\r\n if ($vv['type']) {\r\n $thisLine[1] = ($vv['required']?'*':'').str_replace(',', '', ($vv['fieldname']?$vv['fieldname'].'=':'').$vv['type']);\r\n\r\n // Default:\r\n $tArr = array('', '', '', '', '', '');\r\n switch((string)$vv['type']) {\r\n case 'textarea':\r\n if (intval($vv['cols'])) $tArr[0] = intval($vv['cols']);\r\n if (intval($vv['rows'])) $tArr[1] = intval($vv['rows']);\r\n if (trim($vv['extra'])) $tArr[2] = trim($vv['extra']);\r\n if (strlen($vv['specialEval'])) {\r\n $thisLine[2] = '';\r\n // Preset blank default value so position 3 can get a value...\r\n $thisLine[3] = $vv['specialEval'];\r\n }\r\n break;\r\n case 'input':\r\n case 'password':\r\n if (intval($vv['size'])) $tArr[0] = intval($vv['size']);\r\n if (intval($vv['max'])) $tArr[1] = intval($vv['max']);\r\n if (strlen($vv['specialEval'])) {\r\n $thisLine[2] = '';\r\n // Preset blank default value so position 3 can get a value...\r\n $thisLine[3] = $vv['specialEval'];\r\n }\r\n break;\r\n case 'file':\r\n if (intval($vv['size'])) $tArr[0] = intval($vv['size']);\r\n break;\r\n case 'select':\r\n if (intval($vv['size'])) $tArr[0] = intval($vv['size']);\r\n if ($vv['autosize']) $tArr[0] = 'auto';\r\n if ($vv['multiple']) $tArr[1] = 'm';\r\n\r\n }\r\n $tArr = $this->cleanT($tArr);\r\n if (count($tArr)) $thisLine[1] .= ','.implode(',', $tArr);\r\n\r\n $thisLine[1] = str_replace('|', '', $thisLine[1]);\r\n\r\n // Default:\r\n if ($vv['type'] == 'select' || $vv['type'] == 'radio') {\r\n $thisLine[2] = str_replace(chr(10), ', ', str_replace(',', '', $vv['options']));\r\n } elseif ($vv['type'] == 'checkbox') {\r\n if ($vv['default']) $thisLine[2] = 1;\r\n } elseif (strcmp(trim($vv['default']), '')) {\r\n $thisLine[2] = $vv['default'];\r\n }\r\n if (isset($thisLine[2])) $thisLine[2] = str_replace('|', '', $thisLine[2]);\r\n }\r\n\r\n // Compile the final line:\r\n $inLines[] = ereg_replace(\"[\\n\\r]*\", '', implode(' | ', $thisLine));\r\n }\r\n }\r\n // Finally, implode the lines into a string, and return it:\r\n return implode(chr(10), $inLines);\r\n }", "function mergeConfig($aConfigs)\r\n\t{\r\n\t\tglobal $gXpConfig;\r\n\r\n\t\t$merged = array_merge($gXpConfig, $aConfigs);\r\n\t\t\r\n\t\tforeach($merged as $key => $value)\r\n\t\t{\r\n\t\t\t$config[$key] = stripslashes($value);\r\n\t\t}\r\n\r\n\t\treturn $config;\r\n\t}", "private function getConfigFieldsValues()\n {\n $config = [];\n foreach (ConfigFieldsNames::getConfigFields() as $key) {\n $config[$key] = Configuration::get($key);\n }\n for ($i = 1; $i < TPAY_CARD_MIDS; $i++) {\n foreach (ConfigFieldsNames::getCardConfigFields() as $key) {\n $config[$key.$i] = Configuration::get($key.$i);\n }\n }\n\n return $config;\n }", "function process_config( $config ) {\n \n // clean form data\n $config->hosts = array_map( 'trim', $config->hosts );\n $config->hosts = array_filter( $config->hosts );\n \n $config->roles = array_intersect_key( $config->roles, $config->hosts );\n \n $config->hosts = array_values( $config->hosts );\n $config->roles = array_values( $config->roles );\n \n $config->roles = array_map('trim', $config->roles );\n \n // set defaults\n $config = $this->set_defaults( $config );\n \n // delete previous hosts and roles configuration from db\n foreach ( range(0, 9) as $i ) {\n unset_config('host'.$i, 'auth/imap_plus');\n unset_config('role'.$i, 'auth/imap_plus');\n }\n \n // save to db\n foreach ( $config->hosts as $key=>$val ) {\n set_config( 'host'.$key, $val, 'auth/imap_plus' );\n set_config( 'role'.$key, $config->roles[$key], 'auth/imap_plus' );\n }\n \n set_config('type', $config->type, 'auth/imap_plus');\n set_config('port', $config->port, 'auth/imap_plus');\n set_config('changepasswordurl', $config->changepasswordurl, 'auth/imap_plus');\n \n return true;\n }", "protected function mergeflexFormValuesIntoConf() {}", "function config_load() {\n\t\t$config_camera = '/^\\s*([^:]+)\\s*:\\s*([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})\\s+(\\d+)\\s*x\\s*(\\d+)\\s*$/iu';\n\t\t$config_gate = '/^\\s*(.+)\\s*\\((\\d+)\\s*,\\s*(\\d+)\\)\\s*\\((\\d+),(\\d+)\\)\\s*$/u';\n\n\t\t$data = file(CONFIG_PATH);\n\t\tif ($data === NULL) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$config = array();\n\n\t\t$status = 0;\n\t\tfor ($n=0; $n<sizeof($data); $n++) {\n\t\t\t$str = $data[$n];\n\t\t\n\t\t\tif (preg_match($config_camera, $str, $matches)) {\n\t\t\t\t$name = trim($matches[1]);\n\t\t\t\t$hw_id = $matches[2].$matches[3].$matches[4].$matches[5].$matches[6].$matches[7];\n\t\t\t\t$width = $matches[8];\n\t\t\t\t$height= $matches[9];\n\n\t\t\t\t$gates = array();\n\t\t\t\tarray_push($config, \n\t\t\t\t\t\t array(\"hw\" => $hw_id, \n\t\t\t\t\t\t \"name\" => $name, \n\t\t\t\t\t\t\t\t \"gates\" => &$gates,\n\t\t\t\t\t\t\t\t \"width\" => $width,\n\t\t\t\t\t\t\t\t \"height\"=> $height));\n\t\t\t\t$status = 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($status == 1 && preg_match($config_gate, $str, $matches)) {\n\t\t\t\tarray_push($gates, array(\"name\"=>trim($matches[1]),\n\t\t\t\t\t\t\t\t\t\t \"x1\" =>$matches[2],\n\t\t\t\t\t\t\t\t\t\t \"y1\" =>$matches[3],\n\t\t\t\t\t\t\t\t\t\t \"x2\" =>$matches[4],\n\t\t\t\t\t\t\t\t\t\t \"y2\" =>$matches[5]));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn $config;\n\t}", "public function parse2array() {\n\t\t/**\n\t\t * Thanks to Vladimir Struchkov <great_boba yahoo com> for providing the\n\t\t * code to extract base64 encoded values\n\t\t */\n\n\t\t$arr1 = explode( \"\\n\", str_replace( \"\\r\", '', $this->rawdata ) );\n\t\t$i = $j = 0;\n\t\t$arr2 = array();\n\n\t\t/* First pass, rawdata is splitted into raw blocks */\n\t\tforeach ( $arr1 as $v ) {\n\t\t\tif ( trim( $v ) == '' ) {\n\t\t\t\t++ $i;\n\t\t\t\t$j = 0;\n\t\t\t} else {\n\t\t\t\t$arr2[ $i ][ $j ++ ] = $v;\n\t\t\t}\n\t\t}\n\n\t\t/* Second pass, raw blocks are updated with their name/value pairs */\n\t\tforeach ( $arr2 as $k1 => $v1 ) {\n\t\t\t$i = 0;\n\t\t\t$decode = false;\n\t\t\tforeach ( $v1 as $v2 ) {\n\t\t\t\tif ( ereg( '::', $v2 ) ) { // base64 encoded, chunk start\n\t\t\t\t\t$decode = true;\n\t\t\t\t\t$arr = explode( ':', str_replace( '::', ':', $v2 ) );\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = base64_decode( $arr[1] );\n\t\t\t\t} elseif ( ereg( ':', $v2 ) ) {\n\t\t\t\t\t$decode = false;\n\t\t\t\t\t$arr = explode( ':', $v2 );\n\t\t\t\t\t$count = count( $arr );\n\t\t\t\t\tif ( $count != 2 ) {\n\t\t\t\t\t\tfor ( $i = $count - 1; $i > 1; -- $i ) {\n\t\t\t\t\t\t\t$arr[ $i - 1 ] .= ':' . $arr[ $i ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $arr[1];\n\t\t\t\t} else {\n\t\t\t\t\tif ( $decode ) { // base64 encoded, next chunk\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] .= base64_decode( $v2 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $v2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function prepareConfig(array &$config) {\n $type = $config['type'];\n // Check if we're dealing with a preconfigured field.\n if (strpos($type, 'field_ui:') !== FALSE) {\n // @see \\Drupal\\field_ui\\Form\\FieldStorageAddForm::submitForm\n list(, $type, $option_key) = explode(':', $type, 3);\n $config['type'] = $type;\n\n $field_type_class = $this->fieldTypePluginManager->getDefinition($type)['class'];\n $field_options = $field_type_class::getPreconfiguredOptions()[$option_key];\n\n // Merge in preconfigured field storage options.\n if (isset($field_options['field_storage_config'])) {\n foreach (['settings'] as $key) {\n if (isset($field_options['field_storage_config'][$key]) && empty($config[$key])) {\n $config[$key] = $field_options['field_storage_config'][$key];\n }\n }\n }\n }\n }", "public function parseConfig() {\n $configArray = file('configs/' . $this->_ip . '.ini');\n \n if($configArray === FALSE || sizeof($configArray) <= 1) {\n trigger_error(\"Couldn't read config\");\n return FALSE;\n }\n \n $config = array();\n $configDirective = '';\n \n foreach($configArray as $lineNumber => $line) {\n $line = trim($line);\n \n // Filter out comments\n if(preg_match('/^;/', $line)) {\n continue;\n }\n \n // Config directive\n if(preg_match('/^\\[/', $line)) {\n $configDirective = substr(substr($line, 1), 0, -1);\n continue;\n }\n \n // Filter out blank lines\n if($line == '') {\n continue;\n }\n \n // Looks to be a regular config directive\n // Split on = and place into config array\n \n $lineSplit = explode(\"=\", $line);\n \n $config[$configDirective][$lineSplit[0]] = $lineSplit[1];\n \n unset($lineSplit);\n \n }\n \n return $config;\n }", "function get_config(){\n\t\t\t$arr = array();\n\t\t\n\t\t// Try to get the configuration data \n\t\t// from a cached config file\n\t\t// \n\t\t// Added a disable option in 1.2.1 - dpd\n\t\t\t$disable_cache = ($this->config->item('br_disable_system_cache') === TRUE) ? 1 : 0;\n\t\t\tif($disable_cache == 0){\n\t\t\t\tif($str=read_from_cache('config')){\n\t\t\t\t\t$arr = unserialize($str);\n\t\t\t\t\treturn $arr;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t// Get the store config \n\t\t\t$this->EE->db->select('\ts.*, \n\t\t\t\t\t\t\t\tc.code as currency,\n\t\t\t\t\t\t\t\tc.currency_id,\n\t\t\t\t\t\t\t\tc.marker as currency_marker')\n\t\t\t\t\t\n\t\t\t\t\t->from('br_store s')\n\t\t\t\t\t->join('br_currencies c','c.currency_id = s.currency_id');\t\n\t\t\t$query = $this->EE->db->get();\n\t\t\tforeach ($query->result_array() as $row){\n\t\t\t\t$arr[\"store\"][$row[\"site_id\"]] = $row;\n\t\t\t}\n\n\t\t// Get the config data for each item\n\n\t\t\t$this->EE->db->select('*')->from('br_config_data')->order_by('sort');\n\t\t\t$query = $this->EE->db->get();\n\t\t\tforeach ($query->result_array() as $row){\n\t\t\t\t$data[$row['config_id']][] = $row;\n\t\t\t}\n\t\t\t\n\t\t// Get the items\n\n\t\t\t$this->EE->db->select('*')->from('br_config')->order_by('sort');\n\t\t\t$query = $this->EE->db->get();\n\t\t\tforeach ($query->result_array() as $row){\n\t\t\t\t$arr[$row[\"type\"]][$row[\"site_id\"]][$row[\"code\"]] = $row;\n\t\t\t\tif(isset($data[$row[\"config_id\"]])){\n\t\t\t\t\t$arr[$row[\"type\"]][$row[\"site_id\"]][$row[\"code\"]][\"config_data\"] = $data[$row[\"config_id\"]];\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Save the new array to cache\n\t\t\tsave_to_cache('config',serialize($arr));\n\t\t\treturn $arr;\n\t}", "function get_config_array();", "protected function getConfigFieldsValues()\n {\n return array(\n $this->mod_prefix.'SHOW_WEBPAGE' => Configuration::get($this->mod_prefix.'SHOW_WEBPAGE'),\n $this->mod_prefix.'SHOW_WEBSITE' => Configuration::get($this->mod_prefix.'SHOW_WEBSITE'),\n $this->mod_prefix.'SHOW_WEBSITE_SEARCHBOX' => Configuration::get($this->mod_prefix.'SHOW_WEBSITE_SEARCHBOX'),\n $this->mod_prefix.'SHOW_ORGANIZATION' => Configuration::get($this->mod_prefix.'SHOW_ORGANIZATION'),\n $this->mod_prefix.'SHOW_ORGANIZATION_LOGO' => Configuration::get($this->mod_prefix.'SHOW_ORGANIZATION_LOGO'),\n $this->mod_prefix.'SHOW_ORGANIZATION_CONTACT' => Configuration::get($this->mod_prefix.'SHOW_ORGANIZATION_CONTACT'),\n $this->mod_prefix.'ORGANIZATION_CONTACT_EMAIL' => Configuration::get($this->mod_prefix.'ORGANIZATION_CONTACT_EMAIL'),\n $this->mod_prefix.'ORGANIZATION_CONTACT_TELEPHONE' => Configuration::get($this->mod_prefix.'ORGANIZATION_CONTACT_TELEPHONE'),\n $this->mod_prefix.'SHOW_ORGANIZATION_FACEBOOK' => Configuration::get($this->mod_prefix.'SHOW_ORGANIZATION_FACEBOOK'),\n $this->mod_prefix.'ORGANIZATION_FACEBOOK' => Configuration::get($this->mod_prefix.'ORGANIZATION_FACEBOOK'),\n $this->mod_prefix.'SHOW_LOCALBUSINESS' => Configuration::get($this->mod_prefix.'SHOW_LOCALBUSINESS'),\n $this->mod_prefix.'LOCALBUSINESS_TYPE' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_TYPE'),\n $this->mod_prefix.'LOCALBUSINESS_STORENAME' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_STORENAME'),\n $this->mod_prefix.'LOCALBUSINESS_DESC' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_DESC'),\n $this->mod_prefix.'LOCALBUSINESS_VAT' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_VAT'),\n $this->mod_prefix.'LOCALBUSINESS_PHONE' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_PHONE'),\n $this->mod_prefix.'LOCALBUSINESS_PRANGE_SHOW' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_PRANGE_SHOW'),\n //$this->mod_prefix.'LOCALBUSINESS_PRANGE' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_PRANGE'),\n $this->mod_prefix.'LOCALBUSINESS_STREET' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_STREET'),\n $this->mod_prefix.'LOCALBUSINESS_COUNTRY' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_COUNTRY'),\n $this->mod_prefix.'LOCALBUSINESS_REGION' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_REGION'),\n $this->mod_prefix.'LOCALBUSINESS_CODE' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_CODE'),\n $this->mod_prefix.'LOCALBUSINESS_LOCALITY' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_LOCALITY'),\n $this->mod_prefix.'LOCALBUSINESS_GPS_SHOW' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_GPS_SHOW'),\n $this->mod_prefix.'LOCALBUSINESS_GPS_LAT' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_GPS_LAT'),\n $this->mod_prefix.'LOCALBUSINESS_GPS_LON' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_GPS_LON')\n );\n }", "static protected function mergeConfig($config)\r\n {\r\n $config['all']['stylesheets'] = array_merge(isset($config['default']['stylesheets']) && is_array($config['default']['stylesheets']) ? $config['default']['stylesheets'] : array(), isset($config['all']['stylesheets']) && is_array($config['all']['stylesheets']) ? $config['all']['stylesheets'] : array());\r\n unset($config['default']['stylesheets']);\r\n\r\n $config['all']['javascripts'] = array_merge(isset($config['default']['javascripts']) && is_array($config['default']['javascripts']) ? $config['default']['javascripts'] : array(), isset($config['all']['javascripts']) && is_array($config['all']['javascripts']) ? $config['all']['javascripts'] : array());\r\n unset($config['default']['javascripts']);\r\n\r\n $config['all']['metas']['title'] = array_merge(\r\n isset($config['default']['metas']['title']) && is_array($config['default']['metas']['title']) ? $config['default']['metas']['title'] \r\n : (isset($config['default']['metas']['title']) ? array($config['default']['metas']['title']) : array()), \r\n isset($config['all']['metas']['title']) && is_array($config['all']['metas']['title']) ? $config['all']['metas']['title'] \r\n : (isset($config['all']['metas']['title']) ? array($config['all']['metas']['title']) : array())\r\n );\r\n unset($config['default']['metas']['title']);\r\n \r\n // merge default and all\r\n $config['all'] = sfToolkit::arrayDeepMerge(\r\n isset($config['default']) && is_array($config['default']) ? $config['default'] : array(),\r\n isset($config['all']) && is_array($config['all']) ? $config['all'] : array()\r\n );\r\n unset($config['default']);\r\n return self::replaceConstants($config);\r\n }", "private function read_config() {\n\t\t$sections = parse_ini_file($this->config['conf'], true);\n\t\tforeach ($sections as $sectionk => $sectionv) {\n\t\t\tforeach ($sectionv as $key => $var)\n\t\t\t\t$this->config[$sectionk . '.' . $key] = $var;\n\t\t}\n\t}", "function config_merge(array $array1) {\n\t$result = array();\n\tforeach (func_get_args() as $param) {\n\t\tforeach ($param as $key=>$value) {\n\t\t\tif (is_array($value) && array_key_exists($key, $result) && is_array($result[$key])) {\n\t\t\t\t$result[$key] = config_merge($result[$key], $value);\n\t\t\t} else {\n\t\t\t\t$result[$key] = $value;\n\t\t\t}\n\t\t}\n\t}\n\treturn $result;\n}", "static function merge($config, $newConfigName) \n {\n if (empty($config)) {\n $config = array(); \n }\n\n if ($newConfigName != self::CONFIG_DEFAULT) {\n $newConfig = self::load($newConfigName);\n\n foreach (self::$available_setting as $key => $type) {\n if (isset($newConfig[$key]) && !isset($config[$key])) {\n $config[$key] = $newConfig[$key];\n } else if (isset($newConfig[$key]) && isset($config[$key])) {\n switch ($type) {\n case self::SETTING_TYPE_ARRAY:\n $config[$key] = array_merge($config[$key], $newConfig[$key]);\n break;\n default:\n $config[$key] = $newConfig[$key];\n break;\n } \n }\n } \n\n // Override default setting for some websites that using bad class name\n foreach ($config[self::IGNORED_CLASSES] as $key => $class) {\n if (isset($newConfig[self::OVERRIDE_CLASSES]) && in_array($class, $newConfig[self::OVERRIDE_CLASSES])) {\n unset($config[self::IGNORED_CLASSES][$key]);\n }\n }\n }\n\n return $config;\n }", "public static function load()\n {\n $entries = Configuration::get();\n \n foreach ($entries as $entry) {\n self::$config[$entry->id] = unserialize($entry->value);\n }\n }", "function getConfigDataList($sFileName, $sFieldName)\n\t{\n\t\t$arrReturn = array();\n\t \t// read config file\n\t \t$lines = @file($sFileName);\n\t \tforeach ($lines as $line_num => $line)\n \t{\n \t\t$pos = strpos($line, $sFieldName);\n \t\tif ($pos !== false)\n \t\t{\n \t\t\t$arrLine = explode(\"=\",trim($line));\n \t\t\tif (is_array($arrLine) && count($arrLine) == 2)\n\t\t\t\t{ \n\t\t\t\t\t$data = $arrLine[1];\n\t\t\t\t\tif ($data)\n\t\t\t\t\t{\n\t\t\t\t\t\t$arrItem = explode(\",\",trim($data));\n\t\t\t\t\t\tif (is_array($arrItem) && count($arrItem) == 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$arrReturn[$arrItem[1]] = $arrItem[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n \t\t}\n\t }\n\t return $arrReturn;\n\t}", "public function loadConfig($data);", "function save_config($new)\r\n\t{\r\n\t\tglobal $IN, $INFO, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;\r\n\t\t$ibforums = Ibf::app();\r\n\r\n\t\t$master = array();\r\n\r\n\t\tif (is_array($new))\r\n\t\t{\r\n\t\t\tif (count($new) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach ($new as $field)\r\n\t\t\t\t{\r\n\r\n\t\t\t\t\t// Handle special..\r\n\r\n\t\t\t\t\tif ($field == 'img_ext' or $field == 'avatar_ext' or $field == 'photo_ext')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$_POST[$field] = preg_replace(\"/[\\.\\s]/\", \"\", $_POST[$field]);\r\n\t\t\t\t\t\t$_POST[$field] = str_replace('|', \"&#124;\", $_POST[$field]);\r\n\t\t\t\t\t\t$_POST[$field] = preg_replace(\"/,/\", '|', $_POST[$field]);\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($field == 'coppa_address')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$_POST_VARS[$field] = nl2br($_POST[$field]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ($field == 'gd_font' OR $field == 'html_dir' OR $field == 'upload_dir')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$_POST[$field] = preg_replace(\"/'/\", \"&#39;\", $_POST[$field]);\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$_POST[$field] = preg_replace(\"/'/\", \"&#39;\", stripslashes($_POST[$field]));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$master[$field] = stripslashes($_POST[$field]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$ADMIN->rebuild_config($master);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$ADMIN->save_log(\"Board Settings Updated, Back Up Written\");\r\n\r\n\t\t$ADMIN->done_screen(\"Forum Configurations updated\", \"Administration CP Home\", \"act=index\");\r\n\r\n\t}", "public function processConfigArray($config)\n {\n return $config;\n }", "public function getModuleConfig() {\n $this->data['config_value'] = array_merge($this->helper_setting->getSetting($this->module_code),$this->helper_setting->getSetting('module_'.$this->module_code));\n }", "function lire_config($cfg='', $def=null, $unserialize=true) {\n // ou valeur qui est en fait implicitement /meta/valeur\n // ou casier/valeur qui est en fait implicitement /meta/casier/valeur\n\n // traiter en priorite le cas simple et frequent\n // de lecture direct $GLOBALS['meta']['truc'], si $cfg ne contient ni / ni :\n if ($cfg AND strpbrk($cfg,'/:')===false){\n $r = isset($GLOBALS['meta'][$cfg])?\n ((!$unserialize\n // ne pas essayer de deserialiser autre chose qu'une chaine\n OR !is_string($GLOBALS['meta'][$cfg])\n // ne pas essayer de deserialiser si ce n'est visiblement pas une chaine serializee\n OR strpos($GLOBALS['meta'][$cfg],':')===false\n OR ($t=@unserialize($GLOBALS['meta'][$cfg]))===false)?$GLOBALS['met\na'][$cfg]:$t)\n :$def;\n return $r;\n }\n\n // Brancher sur methodes externes si besoin\n if ($cfg AND $p=strpos($cfg,'::')){\n $methode = substr($cfg,0,$p);\n $lire_config = charger_fonction($methode, 'lire_config');\n return $lire_config(substr($cfg,$p+2),$def,$unserialize);\n }\n\n list($table,$casier,$sous_casier) = expliquer_config($cfg);\n\n if (!isset($GLOBALS[$table]))\n return $def;\n\n $r = $GLOBALS[$table];\n\n // si on a demande #CONFIG{/meta,'',0}\n if (!$casier)\n return $unserialize ? $r : serialize($r);\n\n // casier principal :\n // le deserializer si demande\n // ou si on a besoin\n // d'un sous casier\n $r = isset($r[$casier])?$r[$casier]:null;\n if (($unserialize OR count($sous_casier)) AND $r AND is_string($r))\n $r = (($t=@unserialize($r))===false?$r:$t);\n\n // aller chercher le sous_casier\n while(!is_null($r) AND $casier = array_shift($sous_casier))\n $r = isset($r[$casier])?$r[$casier]:null;\n\n if (is_null($r)) return $def;\n return $r;\n}", "private function buildSettings()\n {\n $settings = [];\n foreach($this->settings as $key=>$setting)\n {\n $split = explode(': ', $setting);\n $option = $split[0];\n unset($split[0]);\n $value = implode($split);\n $settings[$option] = $value;\n }\n $this->settings = $settings;\n }", "public function getForStorage()\n {\n $data = [];\n\n foreach ($this->config->getFields() as $key => $params) {\n\n // skip field if flag is set\n if (!empty($params['skip'])) {\n continue;\n }\n\n if($params['type'] == 'slug')\n {\n $data[$key . '_slug'] = str_slug($this->getStringData($key));\n }\n\n // set field to null, if not in POSTed data array (checkboxes)\n $this->nullIfOmitted($key, $this->data);\n\n // get data as string by flattening arrays\n $data[$key] = $this->getStringData($key);\n }\n\n return $data;\n }", "function read_openvpn_config($config_file_name){\r\n\t//Global $a_config_lines, $port_values, $proto_values, $dev_values, $ca_values, $key_values, $crt_values, $key_values, $group_values, $user_values, $dh_values, $server_values, $ifconfig_pool_values, $keepalive_values, $comp_values, $verb_values, $status_values, $management_values, $a_extra_config_settings;\r\n \t$a_config_lines = file($config_file_name);//read file to array\r\n\t//push the values that have no \"config settings\" like \"client-to-client\" to an array\r\n\tGlobal $a_extra_config_settings;\r\n $a_extra_config_settings = array();\r\n\t$i = 0;\r\n\tforeach ($a_config_lines as $line_num => $line) {\r\n\t\tif (stristr($line, \"cert\")){\r\n\t\t\t$crt_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"port\")){\r\n\t\t\t$port_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"proto\")){\r\n\t\t\t$proto_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"dev\")){\r\n\t\t\t$dev_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"ca\")){\r\n\t\t\t$ca_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"key \")){\r\n\t\t\t$key_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"dh\")){\r\n\t\t\t$dh_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\t\r\n\t\tif (stristr($line, \"server\")){\r\n\t\t\t$server_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"ifconfig-pool-persist\")){\r\n\t\t\t$ifconfig_pool_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"keepalive\")){\r\n\t\t\t$keepalive_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"status\")){\r\n\t\t\t$status_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"verb\")){\r\n\t\t\t$verb_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\t\r\n\t\tif (stristr($line, \"management\")){\r\n\t\t\t$management_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"user \")){\r\n\t\t\t$user_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"group \")){\r\n\t\t\t$group_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\telse{array_push($a_extra_config_settings, trim($line));}\r\n\t$i++;\r\n\t} \r\nGlobal $num_settings; \r\n$num_settings = $i;\r\n//return value will be array of arrays\r\n$return_value = array('a_config_lines' => $a_config_lines, 'port_values' => $port_values, 'proto_values' => $proto_values, 'dev_values' => $dev_values, 'ca_values' => $ca_values, 'key_values' => $key_values, 'crt_values' => $crt_values, 'key_values' => $key_values, 'group_values' => $group_values, 'user_values' => $user_values, 'dh_values' => $dh_values, 'server_values' => $server_values, 'ifconfig_pool_values' => $ifconfig_pool_values, 'keepalive_values' => $keepalive_values, 'comp_values' => $comp_values, 'verb_values' => $verb_values, 'status_values' => $status_values, 'management_values' => $management_values, 'a_extra_config_settings' => $a_extra_config_settings);\r\nreturn $return_value;\r\n}", "private function _myaixdata()\n {\n CommonFunctions::executeProgram('prtconf', '> /tmp/webprtconf.txt', $confret);\n CommonFunctions::rfts('/tmp/webprtconf.txt', $bufr);\n $this->myprtconf = preg_split(\"/\\n/\", $bufr, -1, PREG_SPLIT_NO_EMPTY);\n }", "public function getConfigData()\n {\n return [\n 'alias' => $this->getAlias(),\n 'dbName' => $this->getName(),\n 'dbHost' => $this->getHost(),\n 'dbType' => $this->getType(),\n 'dbUser' => $this->getUserName(),\n 'dbPass' => $this->getPassword()\n ];\n }", "public static function config_get_configuration_array($data) {\n $config = array();\n\n if (isset($data->path)) {\n $config['path'] = $data->path;\n }\n if (isset($data->autocreate)) {\n $config['autocreate'] = $data->autocreate;\n }\n if (isset($data->singledirectory)) {\n $config['singledirectory'] = $data->singledirectory;\n }\n if (isset($data->prescan)) {\n $config['prescan'] = $data->prescan;\n }\n\n return $config;\n }", "private function mergeConfig()\n\t{\n\t\t$this->mergeConfigFrom(\n\t\t\t__DIR__ . '/../config/config.php', 'l5-sms'\n\t\t);\n\t}", "protected function _splitUpdateData($data) \n\t{\n\t\t$result = '';\n\n\t\t$this->_stringData($data);\n\n\t\tforeach ($data as $key => $value) {\n\t\t\tif (in_array($key, $this->_fields)) {\n\t\t\t\t$result .= '`' . $key . '`=' . $value . ',';\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t$result = substr($result, 0, -1);\n\t\treturn $result;\n\t}", "private function _parseFieldValue($value, $config)\n\t{\n\t\t// check if\n\t\tif (is_array($value)) {\n\t\t\tif (!$config['separator']) {\n\t\t\t\t$config['separator'] = \"\\n\";\n\t\t\t}\n\n\t\t\t$value = implode($config['separator'], $value);\n \t\t}\n\n \t\treturn $value;\n\t}", "private function write_config_from_template($config = array())\n\t{\n\t\t// Grab the existing config file\n\t\tif (count($config) == 0)\n\t\t{\n\t\t\trequire $this->config->config_path;\n\t\t}\n\n\t\t// Add the CI config items to the array\n\t\tforeach ($this->ci_config as $key => $val)\n\t\t{\n\t\t\t$config[$key] = $val;\n\t\t}\n\n\t\t$config['encryption_key'] = ee('Encrypt')->generateKey();\n\t\t$config['session_crypt_key'] = ee('Encrypt')->generateKey();\n\n\t\tif (isset($config['site_index']))\n\t\t{\n\t\t\t$config['index_page'] = $config['site_index'];\n\t\t}\n\n\t\tif ($this->userdata['share_analytics'] == 'y')\n\t\t{\n\t\t\t$config['share_analytics'] = 'y';\n\t\t}\n\n\t\t// Fetch the config template\n\t\t$data = read_file(APPPATH.'config/config_tmpl.php');\n\n\t\t// Swap out the values\n\t\tforeach ($config as $key => $val)\n\t\t{\n\t\t\t// go ahead and prep all items here once, so we do not\n\t\t\t// have to do it again for $extra_config items below\n\t\t\tif (is_bool($val))\n\t\t\t{\n\t\t\t\t$config[$key] = ($val == TRUE) ? 'TRUE' : 'FALSE';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$val = str_replace(\"\\\\\\\"\", \"\\\"\", $val);\n\t\t\t\t$val = str_replace(\"\\\\'\", \"'\", $val);\n\t\t\t\t$val = str_replace('\\\\\\\\', '\\\\', $val);\n\n\t\t\t\t$val = str_replace('\\\\', '\\\\\\\\', $val);\n\t\t\t\t$val = str_replace(\"'\", \"\\\\'\", $val);\n\t\t\t\t$val = str_replace(\"\\\"\", \"\\\\\\\"\", $val);\n\n\t\t\t\t$config[$key] = $val;\n\t\t\t}\n\n\t\t\tif (strpos($data, '{'.$key.'}') !== FALSE)\n\t\t\t{\n\t\t\t\t$data = str_replace('{'.$key.'}', $config[$key], $data);\n\t\t\t\tunset($config[$key]);\n\t\t\t}\n\t\t}\n\n\t\t// any unanticipated keys that aren't in our template?\n\t\t$extra_config = '';\n\n\t\t// Remove site_label from $config since we don't want\n\t\t// it showing up in the config file.\n\t\tif ($config['site_label'])\n\t\t{\n\t\t\tunset($config['site_label']);\n\t\t}\n\n\t\t// Create extra_config, unset defaults\n\t\t$defaults = default_config_items();\n\t\tforeach ($config as $key => $val)\n\t\t{\n\t\t\t// Bypass defaults and empty values\n\t\t\tif (empty($val) || (isset($defaults[$key]) && $defaults[$key] == $val))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$extra_config .= \"\\$config['{$key}'] = '{$val}';\\n\";\n\t\t}\n\n\t\t$data = str_replace('{extra_config}', $extra_config, $data);\n\n\t\t// Did we have any {values} that didn't get replaced?\n\t\t// This looks for instances with quotes\n\t\t$data = preg_replace(\"/['\\\"]\\{\\S+\\}['\\\"]/\", '\"\"', $data);\n\t\t// And this looks for instances without quotes\n\t\t$data = preg_replace(\"/\\{\\S+\\}/\", '\"\"', $data);\n\n\t\t// Write config file\n\t\tif ( ! $fp = fopen($this->config->config_path, FOPEN_WRITE_CREATE_DESTRUCTIVE))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tflock($fp, LOCK_EX);\n\t\tfwrite($fp, $data, strlen($data));\n\t\tflock($fp, LOCK_UN);\n\t\tfclose($fp);\n\n\t\t// Clear any caches of the config file\n\t\tif (function_exists('apc_delete_file'))\n\t\t{\n\t\t\t@apc_delete_file($this->config->config_path) || apc_clear_cache();\n\t\t}\n\n\t\tif (function_exists('opcache_invalidate'))\n\t\t{\n\t\t\t// Check for restrict_api path restriction\n\t\t\tif (($opcache_api_path = ini_get('opcache.restrict_api')) && stripos(SYSPATH, $opcache_api_path) !== 0)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\n\t\t\topcache_invalidate($this->config->config_path);\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function parseConfig(array $oldConfig)\n {\n $newConfig = [\n 'message_options' => [],\n 'smtp_options' => [],\n 'file_options' => []\n ];\n\n // Mail acapter\n if (isset($oldConfig['mail_adapter_service'])) {\n $newConfig['mail_adapter'] = $oldConfig['mail_adapter_service'];\n } elseif (isset($oldConfig['mail_adapter'])) {\n $newConfig['mail_adapter'] = $oldConfig['mail_adapter'];\n }\n\n // Common message options\n if (isset($oldConfig['from'])) {\n $newConfig['message_options']['from'] = $oldConfig['from'];\n }\n if (isset($oldConfig['from_name'])) {\n $newConfig['message_options']['from_name'] = $oldConfig['from_name'];\n }\n if (isset($oldConfig['to'])) {\n $newConfig['message_options']['to'] = $oldConfig['to'];\n }\n if (isset($oldConfig['cc'])) {\n $newConfig['message_options']['cc'] = $oldConfig['cc'];\n }\n if (isset($oldConfig['bcc'])) {\n $newConfig['message_options']['bcc'] = $oldConfig['bcc'];\n }\n if (isset($oldConfig['subject'])) {\n $newConfig['message_options']['subject'] = $oldConfig['subject'];\n }\n\n // Body\n $newConfig['message_options']['body'] = [];\n if (isset($oldConfig['body'])) {\n $newConfig['message_options']['body']['content'] = $oldConfig['body'];\n }\n if (isset($oldConfig['body_charset'])) {\n $newConfig['message_options']['body']['charset'] = $oldConfig['body_charset'];\n }\n if (isset($oldConfig['template'])) {\n $newConfig['message_options']['body']['template'] = $oldConfig['template'];\n $newConfig['message_options']['body']['use_template'] = $oldConfig['template']['use_template'];\n unset($newConfig['message_options']['body']['template']['use_template']);\n $newConfig['message_options']['body']['template']['default_layout'] = [];\n }\n\n // Attachments\n if (isset($oldConfig['attachments'])) {\n $newConfig['message_options']['attachments'] = $oldConfig['attachments'];\n }\n\n // SMTP\n if (isset($oldConfig['server'])) {\n $newConfig['smtp_options']['host'] = $oldConfig['server'];\n }\n if (isset($oldConfig['port'])) {\n $newConfig['smtp_options']['port'] = $oldConfig['port'];\n }\n if (isset($oldConfig['connection_class'])) {\n $newConfig['smtp_options']['connection_class'] = $oldConfig['connection_class'];\n }\n $newConfig['smtp_options']['connection_config'] = [];\n if (isset($oldConfig['smtp_user'])) {\n $newConfig['smtp_options']['connection_config']['username'] = $oldConfig['smtp_user'];\n }\n if (isset($oldConfig['smtp_user'])) {\n $newConfig['smtp_options']['connection_config']['username'] = $oldConfig['smtp_user'];\n }\n if (isset($oldConfig['smtp_password'])) {\n $newConfig['smtp_options']['connection_config']['password'] = $oldConfig['smtp_password'];\n }\n if (isset($oldConfig['ssl'])) {\n $newConfig['smtp_options']['connection_config']['ssl'] = $oldConfig['ssl'];\n }\n\n // File\n if (isset($oldConfig['file_path'])) {\n $newConfig['file_options']['path'] = $oldConfig['file_path'];\n }\n if (isset($oldConfig['file_callback'])) {\n $newConfig['file_options']['callback'] = $oldConfig['file_callback'];\n }\n\n return [\n 'acmailer_options' => [\n 'default' => $newConfig\n ]\n ];\n }", "private function generateConfig() {\n $config_json = array(\n 'version' => '1.0.0',\n 'name' => $this->gateway_name,\n 'description' => '',\n 'authors' => [],\n 'currencies' => ['USD'],\n 'signup_url' => 'https://google.com'\n );\n\n foreach($config_json as $key => $value) {\n if($key == 'authors' && isset($this->config['authors'])) {\n foreach($this->config[\"authors\"] as $config_author) {\n $config_entry = array(\n \"name\" => \"\",\n \"url\" => \"\"\n );\n \n if(isset($config_author['name'])) {\n $config_entry[\"name\"] = $config_author['name'];\n \n if(isset($config_author[\"url\"])) {\n $config_entry[\"url\"] = $config_author['url'];\n }\n $config_json[\"authors\"][] = $config_entry;\n }\n }\n }\n else {\n if(isset($this->config[$key])) {\n $config_json[$key] = $this->config[$key];\n }\n }\n }\n\n return json_encode($config_json);\n }", "public function prepareConfigSchema()\n {\n // Store Chapters\n $fromchapter = ['labels' => [],'id' => []];\n foreach ($this->container->db->getFormats() as $f) {\n array_push($fromchapter['labels'], $f->getName());\n array_push($fromchapter['id'], $f->getId());\n }\n\n // Store Issues\n $fromissue = ['labels' => [],'id' => []];\n foreach ($this->container->db->getIssues() as $i) {\n array_push($fromissue['labels'], $i->getName());\n array_push($fromissue['id'], $i->getId());\n }\n\n // Store Books\n $frombook = ['labels' => [],'id' => []];\n foreach ($this->container->db->getBooks() as $b) {\n array_push($frombook['labels'], $b->getName());\n array_push($frombook['id'], $b->getId());\n }\n\n // Store Templates\n $fromtemplate = ['labels' => [],'id' => []];\n foreach ($this->container->db->getTemplatenames() as $t) {\n array_push($fromtemplate['labels'], $t->getName());\n array_push($fromtemplate['id'], $t->getId());\n }\n\n // Store Templates\n $fromfield = ['labels' => [],'id' => []];\n foreach ($this->container->db->getTemplatefields() as $t) {\n array_push($fromfield['labels'], $t->getFieldname());\n array_push($fromfield['id'], $t->getId());\n }\n\n // Store Historytypes\n\n foreach (['books', 'issues', 'chapters', 'cloud', 'other', 'self', 'contributional', 'structural', 'fixed'] as $_ht) {\n $historytypes['id'][] = $_ht;\n $historytypes['labels'][] = $this->container->translations['field_historytype_'.$_ht];\n }\n\n // Todo\n $thisfields = [\n 'labels' => ['fielda', 'fieldb','fieldc'],\n 'id' => [1,2,3]\n ];\n\n $lengthinfluence = [\n 'title' => $this->container->translations['field_config'.'lengthinfluence'],\n 'options' => [\n 'collapsed' => true\n ],\n 'type' => 'array',\n 'propertyOrder' => 100,\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => $this->container->translations['field_config'.'lengthinfluence'.'row'],\n 'headerTemplate' => '{{ self.fieldname }}',\n 'properties' => [\n 'factor' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'lengthinfluence'.'factor'],\n ],\n 'fieldname' => [\n 'type' => 'string',\n 'uniqueItems' => true,\n 'enum' => [],//$fromfield['id'],\n 'options' => [\n 'enum_titles' => $fromfield['labels'],\n 'title' => [],//$this->container->translations['field_config'.'lengthinfluence'.'labels'],\n ]\n ]\n ]\n ]\n ];\n\n $schema = [\n 'title' => 'Field Configuration',\n 'type' => 'object',\n 'properties' => [\n 'imagesize' => [\n 'title' => $this->container->translations['field_config'.'imagesize'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => $this->container->translations['field_config'.'imagesize'.'row'],\n 'properties' => [\n 'width' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'imagesize'.'width'],\n ],\n 'height' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'imagesize'.'height'],\n ]\n ]\n ]\n ],\n 'caption_variants' => [\n 'title' => $this->container->translations['field_config'.'imagecaptions'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 11,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'imagecaption'],\n ]\n ],\n 'history' => [\n 'title' => $this->container->translations['field_config'.'history'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'fullhistory' => [\n 'title' => $this->container->translations['field_config'.'fullhistory'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox',\n 'watch' => [\n 'hist' => 'history'\n ],\n 'hidden' => '!history'\n ],\n 'growing' => [\n 'title' => $this->container->translations['field_config'.'growing'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'maxlines' => [\n 'title' => $this->container->translations['field_config'.'maxlines'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'textlength' => [\n 'title' => $this->container->translations['field_config'.'textlength'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'lengthinfluence' => $lengthinfluence,\n 'rtfeditor' => [\n 'title' => $this->container->translations['field_config'.'rtfeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'markdowneditor' => [\n 'title' => $this->container->translations['field_config'.'markdowneditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'codeeditor' => [\n 'title' => $this->container->translations['field_config'.'codeeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'editorcolumns' => [\n 'title' => $this->container->translations['field_config'.'editorcolumns'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => 'Line',\n 'properties' => [\n \"lines\" => [\n 'type' => 'integer',\n 'title' => $this->container->translations['field_config'.'editorcolumns'.'lines'],\n ],\n \"label\" => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'editorcolumns'.'label'],\n ]\n ]\n ]\n ],\n 'arrayeditor' => [\n 'title' => $this->container->translations['field_config'.'arrayeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'columns' => [\n 'title' => $this->container->translations['field_config'.'columns'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'colnames' => [\n 'title' => $this->container->translations['field_config'.'colnames'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'format' => 'text',\n 'title' => $this->container->translations['field_config'.'colnames'.'labels'],\n ]\n ],\n 'latitude' => [\n 'title' => $this->container->translations['field_config'.'latitude'],\n 'type' => 'number',\n 'propertyOrder' => 0\n ],\n 'longitude' => [\n 'title' => $this->container->translations['field_config'.'longitude'],\n 'type' => 'number',\n 'propertyOrder' => 0\n ],\n 'dateformat' => [\n 'title' => $this->container->translations['field_config'.'dateformat'],\n 'type' => 'string',\n 'propertyOrder' => 2,\n 'uniqueItems' => true,\n 'enum' => [\n 'd/m/Y H:i:s', 'd/m/Y H:i', 'd/m/Y', 'm/Y', 'Y'\n ],\n 'options' => [\n 'enum_titles' => [\n 'dd/mm/yyyy hh:mm:ss', 'dd/mm/yyyy hh:mm', 'dd/mm/yyyy', 'mm/yyyy', 'yyyy'\n ]\n ]\n ],\n 'integer' => [\n 'title' => $this->container->translations['field_config'.'integer'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'resolve_foreign' => [\n 'title' => $this->container->translations['field_config'.'resolve_foreign'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'multiple' => [\n 'title' => $this->container->translations['field_config'.'multiple'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n //cloud\n 'threeDee' => [\n 'title' => $this->container->translations['field_config'.'threeDee'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'history_command' => [\n 'title' => $this->container->translations['field_config'.'history_command'],\n 'format' => 'select',\n 'propertyOrder' => -1,\n 'uniqueItems' => true,\n 'type' => 'string',\n 'enum' => $historytypes['id'],\n 'options' => [\n 'enum_titles' => $historytypes['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //legends\n 'legends' => [\n 'options' => [\n 'grid_columns' => 12,\n ],\n 'title' => $this->container->translations['field_config'.'legends'],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string'\n ]\n ],\n //fixed\n 'fixedvalues' => [\n 'options' => [\n 'grid_columns' => 12,\n ],\n 'title' => $this->container->translations['field_config'.'fixedvalues'],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'fixedvalues'.'row'],\n ]\n ],\n //issues, cloud, self, contributional\n 'restrict_to_open' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_open'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n // not implemented so far\n 'restrict_to_book' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_book'],\n 'type' => 'boolean',\n 'propertyOrder' => 2,\n 'format' => 'checkbox'\n ],\n //issues, chapters\n 'frombook' => [\n 'title' => $this->container->translations['field_config'.'frombook'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 1,\n 'uniqueItems' => true,\n 'enum' => $frombook['id'],\n 'options' => [\n 'enum_titles' => $frombook['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //cloud, other, self, contributional\n 'restrict_to_issue' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_issue'],\n 'type' => 'boolean',\n 'propertyOrder' => 4,\n 'format' => 'checkbox'\n ],\n //cloud, other, self, contributional\n 'fromissue' => [\n 'title' => $this->container->translations['field_config'.'fromissue'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 3,\n 'uniqueItems' => true,\n 'enum' => $fromissue['id'],\n 'options' => [\n 'enum_titles' => $fromissue['labels'],\n 'grid_columns' => 12,\n ]\n ],\n\n //contributional,\n 'restrict_to_chapter' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_chapter'],\n 'type' => 'boolean',\n 'propertyOrder' => 6,\n 'format' => 'checkbox'\n ],\n //contributional\n 'fromchapter' => [\n 'title' => $this->container->translations['field_config'.'fromchapter'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 5,\n 'uniqueItems' => true,\n 'enum' => $fromchapter['id'],\n 'options' => [\n 'enum_titles' => $fromchapter['labels'],\n 'grid_columns' => 12,\n ]\n ],\n // not implemented so far\n 'restrict_to_template' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_template'],\n 'type' => 'boolean',\n 'propertyOrder' => 9,\n 'format' => 'checkbox'\n ],\n //contributional, structural\n 'fromtemplate' => [\n 'title' => $this->container->translations['field_config'.'fromtemplate'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 8,\n 'uniqueItems' => true,\n 'enum' => $fromtemplate['id'],\n 'options' => [\n 'enum_titles' => $fromtemplate['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //cloud, other\n 'fromfield' => [\n 'title' => $this->container->translations['field_config'.'fromfield'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 10,\n 'uniqueItems' => true,\n 'enum' => $fromfield['id'],\n 'options' => [\n 'enum_titles' => $fromfield['labels'],\n 'grid_columns' => 12,\n ]\n ],\n ],\n ];\n return json_encode($schema);\n }", "public function readConfigurationValues();", "function load_config() {\n\t\t$conf_file = @file_get_contents( LDAP_LOGIN_PATH.'data.dat' );\n\t\tif ($conf_file!==false)\n\t\t{\n\t\t\t$this->config = unserialize($conf_file);\n\t\t}\n\t}", "function saveConfig($data) {\n\t$isValid = false;\n\tif(strip_tags($data) == $data) {\n\t\t$isValid = true;\n\t}\n\n\tif ($isValid) {\n\t\treturn file_put_contents(\"config.yml\", stripslashes($data));\n\t}\n\t{\n\t\treturn false;\n\t}\n}", "protected function declareConfig(){\n\n $output = '';\n \n foreach( $this->getConfig() as $key => $value ){\n \n $output .= $key . '=' . json_encode( $value ) . ';';\n \n }\n \n return $output;\n\n }", "abstract protected function configs(): array;", "private static function getConfig() {\n\n\t\t$pathRoot = $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'],0, strpos($_SERVER['PHP_SELF'],\"/\",1)).\"/config/\";\n\n\t\t$jsonConfig = file_get_contents($pathRoot.'config.json');\n\t\tself::$arrayConfig = json_decode($jsonConfig);\n\t}", "protected function prepareConfigurationForEditor(): array\n {\n // Ensure custom config is empty so nothing additional is loaded\n // Of course this can be overriden by the editor configuration below\n $configuration = [\n 'customConfig' => '',\n ];\n\n if (isset($this->rteConfiguration['config']) && is_array($this->rteConfiguration['config'])) {\n $configuration = array_replace_recursive($configuration, $this->rteConfiguration['config']);\n }\n $configuration['contentsLanguage'] = $this->getLanguageIsoCodeOfContent();\n\n // replace all paths\n $configuration = $this->replaceAbsolutePathsToRelativeResourcesPath($configuration);\n\n // there are some places where we define an array, but it needs to be a list in order to work\n if (isset($configuration['extraPlugins']) && is_array($configuration['extraPlugins'])) {\n $configuration['extraPlugins'] = implode(',', array_filter($configuration['extraPlugins']));\n }\n if (isset($configuration['removePlugins']) && is_array($configuration['removePlugins'])) {\n $configuration['removePlugins'] = implode(',', array_filter($configuration['removePlugins']));\n }\n if (isset($configuration['removeButtons']) && is_array($configuration['removeButtons'])) {\n $configuration['removeButtons'] = implode(',', array_filter($configuration['removeButtons']));\n }\n\n return $configuration;\n }", "function addNewsConfig($params, &$pObj) {\n\t\t\treturn array_merge_recursive($params['config'], array(\n\t\t 'fileName' => array (\n\t\t 'index' => array (\n\t\t 'rss.xml' => array (\n\t\t 'keyValues' => array (\n\t\t 'type' => '100'\n\t\t ),\n\t\t ),\n\t\t 'rss091.xml' => array (\n\t\t 'keyValues' => array (\n\t\t 'type' => '101'\n\t\t ),\n\t\t ),\n\t\t 'rdf.xml' => array (\n\t\t 'keyValues' => array (\n\t\t 'type' => '102'\n\t\t ),\n\t\t ),\n\t\t 'atom.xml' => array (\n\t\t 'keyValues' => array (\n\t\t 'type' => '103'\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t\t\t'postVarSets' => array (\n\t\t '_DEFAULT' => array (\n\t\t 'archive' => array (\n\t\t '0' => array (\n\t\t 'GETvar' => 'tx_ttnews[year]'\n\t\t ),\n\t\t '1' => array (\n\t\t 'GETvar' => 'tx_ttnews[month]',\n\t\t 'valueMap' => array (\n\t\t 'jan' => '01',\n\t\t 'feb' => '02',\n\t\t 'mar' => '03',\n\t\t 'apr' => '04',\n\t\t 'may' => '05',\n\t\t 'jun' => '06',\n\t\t 'jul' => '07',\n\t\t 'aug' => '08',\n\t\t 'sep' => '09',\n\t\t 'oct' => '10',\n\t\t 'nov' => '11',\n\t\t 'dec' => '12'\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 'browse' => array (\n\t\t '0' => array (\n\t\t 'GETvar' => 'tx_ttnews[pointer]',\n\t\t ),\n\t\t ),\n\t\t 'select_category' => array (\n\t\t '0' => array (\n\t\t 'GETvar' => 'tx_ttnews[cat]',\n\t\t ),\n\t\t ),\n\t\t 'article' => array (\n\t\t '0' => array (\n\t\t 'GETvar' => 'tx_ttnews[tt_news]',\n\t\t 'lookUpTable' => array (\n\t\t 'table' => 'tt_news',\n\t\t 'id_field' => 'uid',\n\t\t 'alias_field' => 'title',\n\t\t 'addWhereClause' => ' AND NOT deleted',\n\t\t 'useUniqueCache' => '1',\n\t\t 'useUniqueCache_conf' => array (\n\t\t 'strtolower' => '1',\n\t\t 'spaceCharacter' => '-'\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t '1' => array (\n\t\t 'GETvar' => 'tx_ttnews[swords]'\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t )\n\t\t\t));\n\t\t\n\t\t}", "public function config_vars()\n\t{\n\t\tglobal $txt;\n\n\t\t$return_data = array();\n\n\t\t$core_features = $this->settings();\n\n\t\t// Convert this to a format that admin search will understand\n\t\tforeach ($core_features as $id => $data)\n\t\t{\n\t\t\t$return_data[] = array('switch', $data['title'] ?? $txt['core_settings_item_' . $id]);\n\t\t}\n\n\t\treturn $return_data;\n\t}", "public function formatConfig(){\r\n\t\tforeach($this->template as $k=>$v){\r\n\t\t\tif(preg_match('/{\\s+\\#/', $v, $matches)){\r\n\t\t\t\t$this->config_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Config format error: The blank is not allowed with \\'{\\' near '.$matches[0].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/\\#\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->config_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Config format error: The blank is not allowed with \\'}\\' near '.$matches[0].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{#\\s+(\\w+)#}/', $v, $matches)){\r\n\t\t\t\t$this->config_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Config format error: The blank is not allowed with \\'{#\\' near '.$matches[0].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{#(\\w+)\\s+#}/', $v, $matches)){\r\n\t\t\t\t$this->config_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Config format error: The blank is not allowed with \\'#}\\' near '.$matches[0].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function prepareConfigFormArrays()\n {\n if ((float) _PS_VERSION_ >= 1.6) {\n $switch = 'switch';\n } else {\n $switch = 'radio';\n }\n $orderStatesData = OrderState::getOrderStates($this->context->language->id);\n $orderStates = [];\n foreach ($orderStatesData as $state) {\n array_push($orderStates, [\n 'id_option' => $state['id_order_state'],\n 'name' => $state['name'],\n ]);\n }\n\n $generalSettings = require_once dirname(__FILE__).'/ConfigFieldsDef/GeneralSettingsDefinition.php';\n $basicPayment = require_once dirname(__FILE__).'/ConfigFieldsDef/BasicPaymentDefinition.php';\n $blikPayment = require_once dirname(__FILE__).'/ConfigFieldsDef/BlikPaymentDefinition.php';\n $cardPayment = require_once dirname(__FILE__).'/ConfigFieldsDef/CardPaymentDefinition.php';\n\n return [$generalSettings, $basicPayment, $blikPayment, $cardPayment];\n }", "public function composeConfig()\n {\n $pathParts = $this->getPathParts();\n return $this->composeConfigPathValue($pathParts);\n }", "function apsa_merge_config() {\n global $apsa_uninstall;\n global $apsa_child_uninstall;\n if (!empty($apsa_child_uninstall)) {\n $apsa_uninstall = array_merge_recursive($apsa_uninstall, $apsa_child_uninstall);\n }\n}", "public static function parse($config) {\n\t\t$config = explode(\"\\n\", $config);\n\t\t$datasources = array();\n\n\t\twhile(!is_null($line = array_shift($config))) {\n\t\t\tif(!$line) continue;\n\t\t\t$bits = preg_split('`\\s+`', $line, 2);\n\t\t\t$type = array_shift($bits);\n\t\t\t\n\t\t\tif(!in_array($type, array(\n\t\t\t\t'member_include', 'include_file', 'include_remote_file', 'include_list', 'include_sympa_list',\n\t\t\t\t'include_remote_sympa_list', 'include_ldap_query', 'include_ldap_2level_query',\n\t\t\t\t'include_sql_query', 'include_voot_group', 'include_ldap_ca', 'include_ldap_2level_ca',\n\t\t\t\t'include_sql_ca'\n\t\t\t))) continue;\n\t\t\t\n\t\t\t$params = array();\n\t\t\tif(count($bits))\n\t\t\t\t$params['arg'] = array_shift($bits);\n\t\t\t\n\t\t\twhile($line = array_shift($config)) {\n\t\t\t\t$bits = preg_split('`\\s+`', $line, 2);\n\t\t\t\t\n\t\t\t\t$params[array_shift($bits)] = array_shift($bits);\n\t\t\t}\n\t\t\t\n\t\t\t$datasources[] = self::getFromType($type, $params);\n\t\t}\n\t\t\n\t\treturn $datasources;\n\t}", "private function normalizeConfig(array $config)\n {\n // Backwards compatibility with old config format: `toolstack` is\n // changed to application `type` and `build`.`flavor`.\n if (isset($config['toolstack'])) {\n if (!strpos($config['toolstack'], ':')) {\n throw new InvalidConfigException(\"Invalid value for 'toolstack'\");\n }\n list($config['type'], $config['build']['flavor']) = explode(':', $config['toolstack'], 2);\n }\n\n // The `web` section has changed to `web`.`locations`.\n if (isset($config['web']['document_root']) && empty($config['web']['locations'])) {\n $oldConfig = $config['web'] + $this->getOldWebDefaults();\n\n $location = &$config['web']['locations']['/'];\n\n $location['root'] = $oldConfig['document_root'];\n $location['expires'] = $oldConfig['expires'];\n $location['passthru'] = $oldConfig['passthru'];\n $location['allow'] = true;\n\n foreach ($oldConfig['whitelist'] as $pattern) {\n $location['allow'] = false;\n $location['rules'][$pattern]['allow'] = true;\n }\n\n foreach ($oldConfig['blacklist'] as $pattern) {\n $location['rules'][$pattern]['allow'] = false;\n }\n }\n\n return $config;\n }", "public function fileclerk__config_dump()\n\t{\n\t\t$destination = Request::get('destination');\n\t\tdd($this->tasks->merge_configs($destination));\n\t}", "function get_config() {\n //$memcached = new \\Memcached();\n //$memcached->addServer(MEMCACHED_HOST, MEMCACHED_PORT);\n \n if (false) {//$memcached->get('lc_config') && MEMCACHED_ENABLED) {\n //return $memcached->get('lc_config');\n }\n else { \n // Load our master config\n $master_config = parse_ini_file(LC_HOME . LC_MASTER_CONFIG, True);\n \n // Let's get the local config based on the resource type (an action parameter)\n if (!empty($this->http_request->action_params['resource_type'])){\n $resource_type = $this->http_request->action_params['resource_type'];\n if (!empty($resource_type) && !in_array($resource_type, array_keys($master_config['resource_types']))) {\n throw new \\Exception('Incorrect resource type specified' .\n ' --> ' . $resource_type . ' <-- See ' .\n $master_config['doc']['lc_doc_loc'] . ' for documention on resource types.');\n }\n }\n \n $resource_config = parse_ini_file(LC_HOME . $master_config['resource_types'][$resource_type]);\n\n // Since we turn all sections in our master config into arrays (this \n // way we can validate keys easily), we need to flatten it back down\n $flattened_master_config = array();\n foreach ($master_config as $top_level_element) {\n foreach ($top_level_element as $key => $value) {\n $flattened_master_config[$key] = $value;\n }\n }\n\n $merged = array_merge($flattened_master_config, $resource_config);\n //$memcached->set('lc_config', $merged);\n return $merged;\n }\n }", "function processConfiguration() ;", "private function save_configuration_bundle() {\n\t\t$this->configuration_bundle = array();\n\t\t// Some items must always be saved + restored; others only on a migration\n\t\t// Remember, if modifying this, that a restoration can include restoring a destroyed site from a backup onto a fresh WP install on the same URL. So, it is not necessarily desirable to retain the current settings and drop the ones in the backup.\n\t\t$keys_to_save = array('updraft_remotesites', 'updraft_migrator_localkeys', 'updraft_central_localkeys', 'updraft_restore_in_progress');\n\n\t\tif ($this->old_siteurl != $this->our_siteurl || (defined('UPDRAFTPLUS_RESTORE_ALL_SETTINGS') && UPDRAFTPLUS_RESTORE_ALL_SETTINGS)) {\n\t\t\tglobal $updraftplus;\n\t\t\t$keys_to_save = array_merge($keys_to_save, $updraftplus->get_settings_keys());\n\t\t\t$keys_to_save[] = 'updraft_backup_history';\n\t\t}\n\n\t\tforeach ($keys_to_save as $key) {\n\t\t\t$this->configuration_bundle[$key] = UpdraftPlus_Options::get_updraft_option($key);\n\t\t}\n\t}", "public static function mergeConfig(): array\n {\n $args = \\func_get_args();\n $res = array_shift($args) ?: [];\n foreach ($args as $items) {\n if (!\\is_array($items)) {\n continue;\n }\n foreach ($items as $k => $v) {\n if ($v instanceof \\yii\\helpers\\UnsetArrayValue || $v instanceof \\Yiisoft\\Arrays\\UnsetArrayValue) {\n unset($res[$k]);\n } elseif ($v instanceof \\yii\\helpers\\ReplaceArrayValue || $v instanceof \\Yiisoft\\Arrays\\ReplaceArrayValue) {\n $res[$k] = $v->value;\n } elseif (\\is_int($k)) {\n /// XXX skip repeated values\n if (\\in_array($v, $res, true)) {\n continue;\n }\n if (isset($res[$k])) {\n $res[] = $v;\n } else {\n $res[$k] = $v;\n }\n } elseif (\\is_array($v) && isset($res[$k]) && \\is_array($res[$k])) {\n $res[$k] = self::mergeConfig($res[$k], $v);\n } else {\n $res[$k] = $v;\n }\n }\n }\n\n return $res;\n }", "protected function _mergeConfig(array $array1, array $array2) {\n\t\t$merged = $array1;\n\t\tforeach ($array2 as $key => $value) {\n\t\t\tif (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) {\n\t\t\t\t$merged[$key] = $this->_mergeConfig($merged[$key], $value);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$merged[$key] = $value;\n\t\t}\n\n\t\treturn $merged;\n\t}", "protected function mergeWithCurrentConfig($config)\n {\n $currentConfigFilePath = $this->getCurrentConfigFilePath();\n if (File::isFile($currentConfigFilePath)) {\n $currentConfig = include $currentConfigFilePath;\n if (is_array($currentConfig)) {\n foreach ($currentConfig as $key => $value) {\n if (isset($config[$key])) {\n $config[$key]['value'] = $value;\n }\n }\n }\n };\n\n return $config;\n }", "private function mergeConfig() {\n\t\t$this->mergeConfigFrom(\n\t\t\t__DIR__ . '/../config/config.php', 'sl-upload'\n\t\t);\n\t}", "function config_save($data) {\n $module = 'project/lpr';\n\n foreach ($data as $name => $value) {\n set_config($name, $value, $module);\n }\n\n return true;\n }", "public function getConfigData() {\n\t\treturn array(\n\t\t\t'storageType' => StorageFactory::TYPE_DUMMY,\n\t\t\t'debuggerDisabled' => $this->debuggerDisabled,\n\t\t);\n\t}", "public function testConfigMergeArray()\n {\n $this->specify(\n \"Config objects does not merged properly\",\n function () {\n $expected = PhConfig::__set_state([\n 'keys' => PhConfig::__set_state([\n '0' => 'scott',\n '1' => 'cheetah',\n '2' => 'peter',\n ]),\n ]);\n\n $config = new PhConfig(['keys' => ['scott', 'cheetah']]);\n expect($config->merge(new PhConfig(['keys' => ['peter']])))->equals($expected);\n\n $expected = PhConfig::__set_state([\n 'keys' => PhConfig::__set_state([\n '0' => 'peter',\n '1' => 'scott',\n '2' => 'cheetah',\n ]),\n ]);\n\n $config = new PhConfig(['keys' => ['peter']]);\n expect($config->merge(new PhConfig(['keys' => ['scott', 'cheetah']])))->equals($expected);\n }\n );\n }", "public function __prepare()\n {\n $config = $this->objectManager->get(\\Magento\\Mtf\\Config\\DataInterface::class);\n // Prepare config data\n $configData['dbHost'] = $config->get('install/0/host/0');\n $configData['dbUser'] = $config->get('install/0/user/0');\n $configData['dbPassword'] = $config->get('install/0/password/0');\n $configData['dbName'] = $config->get('install/0/dbName/0');\n $configData['baseUrl'] = $config->get('install/0/baseUrl/0');\n $configData['admin'] = $config->get('install/0/backendName/0');\n\n return ['configData' => $configData];\n }", "protected function getConfigFormValues()\n {\n return array(\n 'B2BINPAY_TITLE' => Configuration::get('B2BINPAY_TITLE'),\n 'B2BINPAY_TEST_MODE' => Configuration::get('B2BINPAY_TEST_MODE'),\n 'B2BINPAY_AUTH_KEY' => Configuration::get('B2BINPAY_AUTH_KEY'),\n 'B2BINPAY_AUTH_SECRET' => Configuration::get('B2BINPAY_AUTH_SECRET'),\n 'B2BINPAY_WALLETS' => Configuration::get('B2BINPAY_WALLETS'),\n 'B2BINPAY_MARKUP' => Configuration::get('B2BINPAY_MARKUP'),\n 'B2BINPAY_LIFETIME' => Configuration::get('B2BINPAY_LIFETIME'),\n );\n }", "protected function load_addon_config() {\n\t\t$config = [\n\t\t\t'gist' => [\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Git Updater - Gist', 'git-updater' ),\n\t\t\t\t\t'author' => __( 'Andy Fragen' ),\n\t\t\t\t\t'description' => __( 'Add GitHub Gist hosted repositories to the Git Updater plugin.', 'git-updater' ),\n\t\t\t\t\t'host' => 'github',\n\t\t\t\t\t'slug' => 'git-updater-gist/git-updater-gist.php',\n\t\t\t\t\t'uri' => 'afragen/git-updater-gist',\n\t\t\t\t\t'branch' => 'main',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'api' => 'gist',\n\t\t\t\t],\n\t\t\t],\n\t\t\t'bitbucket' => [\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Git Updater - Bitbucket', 'git-updater' ),\n\t\t\t\t\t'author' => __( 'Andy Fragen' ),\n\t\t\t\t\t'description' => __( 'Add Bitbucket and Bitbucket Server hosted repositories to the Git Updater plugin.', 'git-updater' ),\n\t\t\t\t\t'host' => 'github',\n\t\t\t\t\t'slug' => 'git-updater-bitbucket/git-updater-bitbucket.php',\n\t\t\t\t\t'uri' => 'afragen/git-updater-bitbucket',\n\t\t\t\t\t'branch' => 'main',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'api' => 'bitbucket',\n\t\t\t\t],\n\t\t\t],\n\t\t\t'gitlab' => [\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Git Updater - GitLab', 'git-updater' ),\n\t\t\t\t\t'author' => __( 'Andy Fragen' ),\n\t\t\t\t\t'description' => __( 'Add GitLab hosted repositories to the Git Updater plugin.', 'git-updater' ),\n\t\t\t\t\t'host' => 'github',\n\t\t\t\t\t'slug' => 'git-updater-gitlab/git-updater-gitlab.php',\n\t\t\t\t\t'uri' => 'afragen/git-updater-gitlab',\n\t\t\t\t\t'branch' => 'main',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'api' => 'gitlab',\n\t\t\t\t],\n\t\t\t],\n\t\t\t'gitea' => [\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Git Updater - Gitea', 'git-updater' ),\n\t\t\t\t\t'author' => __( 'Andy Fragen' ),\n\t\t\t\t\t'description' => __( 'Add Gitea hosted repositories to the Git Updater plugin.', 'git-updater' ),\n\t\t\t\t\t'host' => 'github',\n\t\t\t\t\t'slug' => 'git-updater-gitea/git-updater-gitea.php',\n\t\t\t\t\t'uri' => 'afragen/git-updater-gitea',\n\t\t\t\t\t'branch' => 'main',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'api' => 'gitea',\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\n\t\treturn $config;\n\t}", "function _update_config($new_values = array(), $remove_values = array())\n\t{\n\t\tif ( ! is_array($new_values) && count($remove_values) == 0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Is the config file writable?\n\t\tif ( ! is_really_writable($this->config_path))\n\t\t{\n\t\t\tshow_error(lang('unwritable_config_file'), 503);\n\t\t}\n\n\t\t// Read the config file as PHP\n\t\trequire $this->config_path;\n\n\t\t// Read the config data as a string\n\t\t// Really no point in loading file_helper to do this one\n\t\t$config_file = file_get_contents($this->config_path);\n\n\t\t// Trim it\n\t\t$config_file = trim($config_file);\n\n\t\t// Remove values if needed\n\t\tif (count($remove_values) > 0)\n\t\t{\n\t\t\tforeach ($remove_values as $key => $val)\n\t\t\t{\n\t\t\t\t$config_file = preg_replace(\n\t\t\t\t\t'#\\$'.\"config\\[(\\042|\\047)\".$key.\"\\\\1\\].*?;\\n#is\",\n\t\t\t\t\t\"\",\n\t\t\t\t\t$config_file\n\t\t\t\t);\n\t\t\t\tunset($config[$key]);\n\t\t\t}\n\t\t}\n\n\t\t// Cycle through the newconfig array and swap out the data\n\t\t$to_be_added = array();\n\t\tif (is_array($new_values))\n\t\t{\n\t\t\tforeach ($new_values as $key => $val)\n\t\t\t{\n\t\t\t\tif (is_array($val))\n\t\t\t\t{\n\t\t\t\t\t$val = var_export($val, TRUE);\n\t\t\t\t}\n\t\t\t\telseif (is_bool($val))\n\t\t\t\t{\n\t\t\t\t\t$val = ($val == TRUE) ? 'TRUE' : 'FALSE';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$val = str_replace(\"\\\\\\\"\", \"\\\"\", $val);\n\t\t\t\t\t$val = str_replace(\"\\\\'\", \"'\", $val);\n\t\t\t\t\t$val = str_replace('\\\\\\\\', '\\\\', $val);\n\n\t\t\t\t\t$val = str_replace('\\\\', '\\\\\\\\', $val);\n\t\t\t\t\t$val = str_replace(\"'\", \"\\\\'\", $val);\n\t\t\t\t\t$val = str_replace(\"\\\"\", \"\\\\\\\"\", $val);\n\t\t\t\t}\n\n\t\t\t\t// Are we adding a brand new item to the config file?\n\t\t\t\tif ( ! isset($config[$key]))\n\t\t\t\t{\n\t\t\t\t\t$to_be_added[$key] = $val;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$base_regex = '#(\\$config\\[(\\042|\\047)'.$key.'\\\\2\\]\\s*=\\s*)';\n\n\t\t\t\t\t// Here we need to determine which regex to use for matching\n\t\t\t\t\t// the config varable's value; if we're replacing an array,\n\t\t\t\t\t// use regex that spans multiple lines until hitting a\n\t\t\t\t\t// semicolon\n\t\t\t\t\tif (is_array($new_values[$key]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$config_file = preg_replace(\n\t\t\t\t\t\t\t$base_regex.'(.*?;)#s',\n\t\t\t\t\t\t\t\"\\${1}{$val};\",\n\t\t\t\t\t\t\t$config_file\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse // Otherwise, use the one-liner match\n\t\t\t\t\t{\n\t\t\t\t\t\t$config_file = preg_replace(\n\t\t\t\t\t\t\t$base_regex.'((\\042|\\047)[^\\\\4]*?\\\\4);#',\n\t\t\t\t\t\t\t\"\\${1}\\${4}{$val}\\${4};\",\n\t\t\t\t\t\t\t$config_file\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->config[$key] = $val;\n\t\t\t}\n\t\t}\n\n\t\t// Do we need to add totally new items to the config file?\n\t\tif (count($to_be_added) > 0)\n\t\t{\n\t\t\t// First we will determine the newline character used in the file\n\t\t\t// so we can use the same one\n\t\t\t$newline = (preg_match(\"#(\\r\\n|\\r|\\n)#\", $config_file, $match)) ? $match[1] : \"\\n\";\n\n\t\t\t$new_data = '';\n\t\t\tforeach ($to_be_added as $key => $val)\n\t\t\t{\n\t\t\t\tif (is_array($new_values[$key]))\n\t\t\t\t{\n\t\t\t\t\t$new_data .= \"\\$config['\".$key.\"'] = \".$val.\";\".$newline;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$new_data .= \"\\$config['\".$key.\"'] = '\".$val.\"';\".$newline;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// First we look for our comment marker in the config file. If found, we'll swap\n\t\t\t// it out with the new config data\n\t\t\tif (preg_match(\"#.*// END EE config items.*#i\", $config_file))\n\t\t\t{\n\t\t\t\t$new_data .= $newline.'// END EE config items'.$newline;\n\n\t\t\t\t$config_file = preg_replace(\"#\\n.*// END EE config items.*#i\", $new_data, $config_file);\n\t\t\t}\n\t\t\t// If we didn't find the marker we'll remove the opening PHP line and\n\t\t\t// add the new config data to the top of the file\n\t\t\telseif (preg_match(\"#<\\?php.*#i\", $config_file, $match))\n\t\t\t{\n\t\t\t\t// Remove the opening PHP line\n\t\t\t\t$config_file = str_replace($match[0], '', $config_file);\n\n\t\t\t\t// Trim it\n\t\t\t\t$config_file = trim($config_file);\n\n\t\t\t\t// Add the new data string along with the opening PHP we removed\n\t\t\t\t$config_file = $match[0].$newline.$newline.$new_data.$config_file;\n\t\t\t}\n\t\t\t// If that didn't work we'll add the new config data to the bottom of the file\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Remove the closing PHP tag\n\t\t\t\t$config_file = preg_replace(\"#\\?>$#\", \"\", $config_file);\n\n\t\t\t\t$config_file = trim($config_file);\n\n\t\t\t\t// Add the new data string\n\t\t\t\t$config_file .= $newline.$newline.$new_data.$newline;\n\n\t\t\t\t// Add the closing PHP tag back\n\t\t\t\t$config_file .= '?>';\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $fp = fopen($this->config_path, FOPEN_WRITE_CREATE_DESTRUCTIVE))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tflock($fp, LOCK_EX);\n\t\tfwrite($fp, $config_file, strlen($config_file));\n\t\tflock($fp, LOCK_UN);\n\t\tfclose($fp);\n\n\t\tif ( ! empty($this->_config_path_errors))\n\t\t{\n\t\t\treturn $this->_config_path_errors;\n\t\t}\n\n\t\t$this->clear_opcache($this->config_path);\n\t\treturn TRUE;\n\t}", "protected function _compile_config()\n {\n $output = \"\\n\\n\";\n $output .= '<fieldset id=\"ci_profiler_config\" style=\"border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee\">';\n $output .= \"\\n\";\n $output .= '<legend style=\"color:#000;\">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_config').'&nbsp;&nbsp;(<span style=\"cursor: pointer;\" onclick=\"var s=document.getElementById(\\'ci_profiler_config_table\\').style;s.display=s.display==\\'none\\'?\\'\\':\\'none\\';this.innerHTML=this.innerHTML==\\''.$this->CI->lang->line('profiler_section_show').'\\'?\\''.$this->CI->lang->line('profiler_section_hide').'\\':\\''.$this->CI->lang->line('profiler_section_show').'\\';\">'.$this->CI->lang->line('profiler_section_show').'</span>)</legend>';\n $output .= \"\\n\";\n\n $output .= \"\\n\\n<table style='width:100%; display:none' id='ci_profiler_config_table'>\\n\";\n\n foreach ($this->CI->config->config as $config=>$val)\n {\n if (is_array($val)||is_object($val))\n {\n $val = print_r($val, TRUE);\n }\n\n $output .= \"<tr><td style='padding:5px; vertical-align: top;color:#900;background-color:#ddd;'>\".$config.\"&nbsp;&nbsp;</td><td style='padding:5px; color:#000;background-color:#ddd;'>\".htmlspecialchars($val).\"</td></tr>\\n\";\n }\n\n $output .= \"</table>\\n\";\n $output .= \"</fieldset>\";\n\n return $output;\n }", "private function setConfigValue($key, $value = null, $config = null)\n {\n $keys = explode('.', $key);\n if (count($keys) === 0) {\n $keys = array($key);\n }\n $keyCount = count($keys);\n $aux = $config;\n foreach ($keys as $_key) {\n $keyCount--;\n if (!array_key_exists($_key, $aux)) {\n $aux[$_key] = array();\n }\n if ($keyCount > 0) {\n $aux[$_key] = $this->setConfigValue($this->getChildConfigKey($key), $value, $aux[$_key]);\n } else {\n $aux[$_key] = $value;\n }\n break;\n }\n return $aux;\n }", "private function setUpConfig() {\n\n //Get the file where the configs are and process the arrays\n require($this->_data['pathtodata']);\n\n $this->_data = array_merge($this->_data,$acs_confdata);\n\n if (empty($this->_data['indexfile']))\n $this->_data['indexfile'] = 'index';\n\n if (empty($this->_data['common_extension']))\n $this->_data['common_extension'] = COMMON_EXTENSION;\n \n $this->setUriData($this->_data); \n \n //Create the cache file of the config\n if (isset($this->_data['cache_config']) && $this->_data['cache_config'])\n $this->saveConfig();\n else\n if (file_exists($this->_data['cache_config_file']))\n unlink($this->_data['cache_config_file']); \n }", "function addFields($config)\n {\n global $TSFE,$LANG;\n $this->storagePid = $this->getStorageFolderPid();\n // print_r($this->storagePid);\n if(!empty($this->storagePid)) {\n $sql = \"AND pid=$this->storagePid\";\n }else{\n $sql = '';\n }\n\n $optionList = array();\n // exec_SELECTquery\n // $res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db, \"SELECT uid,cat FROM tx_sbdownloader_cat WHERE hidden=0 AND deleted=0 $sql\");\n $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\"uid,cat\", \"tx_sbdownloader_cat\", \"hidden=0 AND deleted=0 $sql\");\n\n $optionList[0] = array(0 => 'all', 1 => 0);\n $i = 1;\n // while($row = mysql_fetch_object($res)){\n while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n $optionList[$i] = array(0 => $row['cat'], 1 => $row['uid']);\n $i++;\n }\n\n $config['items'] = array_merge($config['items'], $optionList);\n\n return $config;\n }", "protected function generateConfigFileContent($config)\n {\n $content = [\"<?php\\n\\n return [\\n\"];\n $space = ' ';\n foreach ($config as $key => $property) {\n $content [] = $space . trim($property['comments']);\n if (in_array($key, $this->octalParamList)) {\n $value = '0' . decoct($property['value']);\n } else {\n $value = $this->export_variable($property['value'], $space);\n }\n $content [] = $space . '\"' . $key . '\" => ' . $value . ',';\n $content [] = '';\n }\n $content [] = \"];\\n\";\n $content = implode(\"\\n\", $content);\n return $content;\n }", "public function getConfigFromData(array $data = array());", "function instance_config_save($data, $nolongerused = false) {\n\n //If the is_form_submission or config_is_form_submission property is set in the object,\n //then this is a valid form submission that will be saved to the config\n if (isset($data->is_form_submission) || isset($data->config_is_form_submission)) {\n \n //process form data submission into a data string\n $data_string = dd_content_process_settings_form($data);\n\n $config_data = new stdClass();//create a config object\n $config_data->data = $data_string;//set the data to be our processed string\n \n //add any non-submission fields back into config based on existing config\n //ex: orientation\n dd_content_add_non_standard_form_data($this, $config_data);\n parent::instance_config_save($config_data);\n } else {//In the case its not set, then we are updating the configuration\n //in specialization its unserialized - needs to be re-serialized before savint\n $data->data = dd_content_serialize($data->data);\n parent::instance_config_save($data);\n }\n }", "public function getConfigFieldsValues()\n\t{\n\t\treturn array(\n\t\t\t'clerk_public_key' => Tools::getValue('clerk_public_key', Configuration::get('CLERK_PUBLIC_KEY')),\n\t\t\t'clerk_private_key' => Tools::getValue('clerk_private_key', Configuration::get('CLERK_PRIVATE_KEY')),\n\t\t\t'clerk_import_url' => _PS_BASE_URL_,\n\t\t\t'clerk_search_enabled' => Tools::getValue('clerk_search_enabled', Configuration::get('CLERK_SEARCH_ENABLED')),\n\t\t\t'clerk_search_template' => Tools::getValue('clerk_search_template', Configuration::get('CLERK_SEARCH_TEMPLATE')),\n\t\t\t'clerk_livesearch_enabled' => Tools::getValue('clerk_livesearch_enabled', Configuration::get('CLERK_LIVESEARCH_ENABLED')),\n\t\t\t'clerk_livesearch_include_categories' => Tools::getValue('clerk_livesearch_include_categories', Configuration::get('CLERK_LIVESEARCH_INCLUDE_CATEGORIES')),\n\t\t\t'clerk_livesearch_template' => Tools::getValue('clerk_livesearch_template', Configuration::get('CLERK_LIVESEARCH_TEMPLATE')),\n\t\t\t'clerk_powerstep_enabled' => Tools::getValue('clerk_powerstep_enabled', Configuration::get('CLERK_POWERSTEP_ENABLED')),\n\t\t\t'clerk_powerstep_templates' => Tools::getValue('clerk_powerstep_templates', Configuration::get('CLERK_POWERSTEP_TEMPLATES')),\n\t\t);\n\t}", "private function parseConfig(){\n\t\t\treturn parse_ini_file(BASE_PATH . 'config' . DIRECTORY_SEPARATOR . 'config.ini');\n\t\t}", "function expliquer_config($cfg){\n $table = 'meta';\n $casier = null;\n $sous_casier = array();\n $cfg = explode('/',$cfg);\n\n // si le premier argument est vide, c'est une syntaxe /table/ ou un appel vide ''\n if (!reset($cfg) AND count($cfg)>1) {\n array_shift($cfg);\n $table = array_shift($cfg);\n if (!isset($GLOBALS[$table]))\n lire_metas($table);\n }\n\n // si on a demande #CONFIG{/meta,'',0}\n if (count($cfg)) {\n // pas sur un appel vide ''\n if ('' !== ($c = array_shift($cfg))) {\n $casier = $c;\n }\n }\n\n if (count($cfg))\n $sous_casier = $cfg;\n\n return array($table,$casier,$sous_casier);\n}", "public function ovpnCurrentConfig()\n {\n $readArr = unserialize(file_get_contents(\"./vpn/ovpn.array.config\"));\n return $readArr;\n }", "private function saveConfig() {\n \tself::$_configInstance = (object)$this->_data; \n file_put_contents($this->_data['cache_config_file'],serialize(self::$_configInstance)); \n }", "public static function getWorkerRawConfig() {\n\t\tif (empty(self::$config)) {\n\t\t\t$config = new Config_Gearman();\n\t\t\t$tmpConfig = array();\n\t\t\t$gearmanConfig = $config->get('gearman.workers');\n\n\t\t\tforeach ($gearmanConfig as $key => $data) {\n\t\t\t\t$key = strtolower($key);\n\t\t\t\t$tmpConfig[$key] = (object)$data;\n\t\t\t}\n\n\t\t\tself::$config = $tmpConfig;\n\t\t}\n\n\t\treturn self::$config;\n\t}", "public function getConfigArray() {}", "public function saveConfigs($conf)\n {\n foreach($conf as $key=>$value)\n {\n $q = mysql_safequery(\"insert into StormBilling_customconfig (config_name,config_value)\n \t\t\t\t\t\tvalues ('$key', '$value')\n\t\t\t\t\t\t\t\t\t\tON DUPLICATE KEY UPDATE config_value='$value'\");\n }\n $this->loadCustomConfig();\n return $this->configs;\n }", "function arrayConfig($namespace = 'thirdParty')\n {\n return config($namespace);\n }", "function data_preprocessing(&$default_values){\n parent::data_preprocessing($default_values);\n if (!empty($default_values['config'])) {\n $values = json_decode($default_values['config'], true);\n foreach ($values as $key => $value) {\n $default_values['config_' . $key] = $value;\n }\n unset($default_values['config']);\n }\n }", "protected function normalizeConfig(array $config): array\n {\n // In Stapler, variants were called 'styles'.\n if (! Arr::has($config, 'variants') && Arr::has($config, 'styles')) {\n $config['variants'] = Arr::get($config, 'styles', []);\n }\n Arr::forget($config, 'styles');\n\n\n // Simple renames of stapler config keys.\n $renames = [\n 'url' => 'path',\n 'keep_old_files' => 'keep-old-files',\n 'preserve_files' => 'preserve-files',\n\n // Note that 'url' conflicts with with Paperclip.\n // In Stapler, 'url' is what is 'path' in Paperclip.\n // To allow for full configuration 'missing_url' is mapped to 'url',\n // even though this option was not present in Stapler.\n 'missing_url' => 'url',\n ];\n\n foreach ($renames as $old => $new) {\n if (! Arr::has($config, $old)) {\n continue;\n }\n\n if (! Arr::has($config, $new)) {\n $config[ $new ] = Arr::get($config, $old);\n }\n Arr::forget($config, $old);\n }\n\n return parent::normalizeConfig($config);\n }", "abstract protected function loadConfig();", "public function getConfigFieldsValues()\n {\n return array(\n 'SEND_SMS_API' => Tools::getValue('SEND_SMS_API', Configuration::get('ONEHOP_SEND_SMS_API')),\n 'ADMIN_MOBILE' => Tools::getValue('ADMIN_MOBILE', Configuration::get('ONEHOP_ADMIN_MOBILE'))\n );\n }", "public function getConfigFieldsValues()\n {\n $id_shop = Shop::getContextShopID(true);\n $id_shop_group = Shop::getContextShopGroupID(true);\n\n $fields_values = array();\n foreach ($this->fields_form as $k => $f) {\n foreach ($f['form']['input'] as $i => $input) {\n if (isset($input['ignore']) && $input['ignore'] == true) {\n continue;\n }\n\n if (isset($input['lang']) && $input['lang'] == true) {\n foreach (Language::getLanguages(false) as $lang) {\n $values = Tools::getValue($input['name'].'_'.$lang['id_lang'], (Configuration::hasKey($input['name'], $lang['id_lang']) ? Configuration::get($input['name'], $lang['id_lang'], (int)$id_shop_group, (int)$id_shop) : $input['default']));\n $fields_values[$input['name']][$lang['id_lang']] = $values;\n }\n } else {\n if ($input['type'] == 'checkbox' && isset($input['values'])) {\n $input['name'] = str_replace(array('[]'), array(''), $input['name']);\n\n $values = (Configuration::hasKey($input['name'], null, (int)$id_shop_group, (int)$id_shop) ? Tools::jsonDecode(Configuration::get($input['name']), true) : $input['default']);\n\n if (is_array($values)) {\n foreach ($input['values']['query'] as $id_cms => $val) {\n if (in_array($id_cms, $values)) {\n $fields_values[$input['name'].'[]_'.$id_cms] = $id_cms;\n }\n }\n }\n } else {\n $values = Tools::getValue($input['name'], (Configuration::hasKey($input['name'], null, (int)$id_shop_group, (int)$id_shop) ? Configuration::get($input['name']) : $input['default']));\n $fields_values[$input['name']] = $values;\n }\n }\n }\n }\n\n $this->assignCustomConfigs($fields_values);\n\n return $fields_values;\n }", "public static function getConfig(){\n\t\tif(CoreConfig::$config == null){\n\t\t\t$query = \"SELECT module, name, value FROM config ORDER by module, name\";\n\t\t\t$table = DB::getTable($query);\n\t\t\tforeach($table as $row) {\n\t\t\t\tCoreConfig::$config[$row['module']][$row['name']] = $row['value'];\n\t\t\t}\n\t\t}\n\t\treturn CoreConfig::$config;\n\t}", "public static function processConfig($configArray)\n {\n\n $baseCategories = [\n 'general_settings' => [\n 'display_name' => 'General Settings',\n 'display' => 'block',\n 'settings' => [\n 'CountUpgrades' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Count Upgrades',\n 'tool_tip' => 'Count upgrades as building slots',\n 'description' => 'Count upgrades as building slots',\n ],\n 'NoSubsidies' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Town Subsidies',\n 'tool_tip' => 'Town subsidies at low population',\n 'description' => 'Town subsidies at low population',\n ],\n 'ElectionsOn' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Elections',\n 'tool_tip' => 'Elections enabled or not',\n 'description' => 'Election of Mayor and Presidents enabled',\n ],\n 'SendingMoney' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Money Transfers',\n 'tool_tip' => 'Allow money transfers between players',\n 'description' => 'Allow money transfers between players',\n ],\n 'AlliesPageOn' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Allies',\n 'tool_tip' => 'Allow player alliances',\n 'description' => 'Allow player alliances',\n ],\n 'TranscendingOn' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Transcendence',\n 'tool_tip' => 'Allow nobility gain through transcendence',\n 'description' => 'Allow nobility gain through transcendence',\n ],\n 'RandomSeasons' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Random Seasons',\n 'tool_tip' => 'Random game seasons in suppose to spring, summer, autumn, winter cycle',\n 'description' => 'Random game seasons in suppose to spring, summer, autumn, winter cycle',\n ],\n 'RelayEconomy' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Recession Code',\n 'tool_tip' => 'Whether recession code is active in simulation',\n 'description' => 'Whether recession code is active in simulation',\n ],\n 'MagnaAtApprentice' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Apprentice Magna',\n 'tool_tip' => 'If apprentices with enough nobility can create magna companies',\n 'description' => 'If apprentices with enough nobility can create magna companies',\n ],\n 'MaxInvestors' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Max World Players',\n 'tool_tip' => 'Maximum player allowed to join this world',\n 'description' => 'Maximum player allowed to join this world',\n ],\n 'NoTradeCenter' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'No Trade Centre',\n 'tool_tip' => 'Prevent trade centre sales',\n 'description' => 'Prevent trade centre sales',\n ],\n ],\n ],\n 'tycoon_upgrade_levels' => [\n 'display_name' => 'Tycoon Building Slots',\n 'display' => 'block',\n 'settings' => [\n 'Apprentice.facLimit' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Apprentice',\n 'tool_tip' => 'Maximum building slots for this level',\n 'description' => 'Maximum building slots for this level',\n ],\n 'Entrepreneur.facLimit' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Entrepreneur',\n 'tool_tip' => 'Maximum building slots for this level',\n 'description' => 'Maximum building slots for this level',\n ],\n 'Tycoon.facLimit' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Tycoon',\n 'tool_tip' => 'Maximum building slots for this level',\n 'description' => 'Maximum building slots for this level',\n ],\n 'Master.facLimit' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Master',\n 'tool_tip' => 'Maximum building slots for this level',\n 'description' => 'Maximum building slots for this level',\n ],\n 'Paradigm.facLimit' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Paradigm',\n 'tool_tip' => 'Maximum building slots for this level',\n 'description' => 'Maximum building slots for this level',\n ],\n 'Legend.facLimit' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Legend',\n 'tool_tip' => 'Maximum building slots for this level',\n 'description' => 'Maximum building slots for this level',\n ],\n ],\n ],\n 'building_upgrade_levels' => [\n 'display_name' => 'Building Max Upgrades',\n 'display' => 'block',\n 'settings' => [\n 'CountUpgrades' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Count Upgrades',\n 'tool_tip' => 'Count building upgrades as a building slot',\n 'description' => 'Count building upgrades as a building slot',\n ],\n 'MaxServiceUpgrades' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Service Maximum',\n 'tool_tip' => 'Maximum upgrade level for services',\n 'description' => 'Maximum upgrade level for services',\n ],\n 'MaxOfficeUpgrades' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Office Maximum',\n 'tool_tip' => 'Maximum upgrade level for offices',\n 'description' => 'Maximum upgrade level for offices',\n ],\n 'ResMaxUpgrade' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Residential Maximum',\n 'tool_tip' => 'Maximum upgrade level for residencies',\n 'description' => 'Maximum upgrade level for residencies',\n ],\n 'MaxRCenterUpgrade' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Research Centre Maximum',\n 'tool_tip' => 'Maximum upgrade level for research centres',\n 'description' => 'Maximum upgrade level for research centres',\n ],\n ],\n ],\n 'misc_settings' => [\n 'display_name' => 'Misc Settings',\n 'display' => 'block',\n 'settings' => [\n 'Tutorial' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Tutorial Mode',\n 'tool_tip' => 'If enabled players are guided by a tutorial',\n 'description' => 'If enabled players are guided by a tutorial',\n ],\n 'RemoveVisitors' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Remove Visitors',\n 'tool_tip' => 'Prevent visitor access to the world',\n 'description' => 'Prevent visitor access to the world',\n ],\n 'RepairRoads' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Repair Roads',\n 'tool_tip' => 'Automatically repair roads',\n 'description' => 'Automatically repair roads',\n ],\n 'VoteLevel' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Vote Level',\n 'tool_tip' => 'Votes required for office',\n 'description' => 'Votes required for office',\n ],\n 'FightFacColonies' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Fighting faction colonies',\n 'tool_tip' => 'Fighting faction colonies',\n 'description' => 'Fighting faction colonies',\n ],\n 'LifeAfterLegend' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Life after Legend',\n 'tool_tip' => 'Whether Tycoon can continue level after legend',\n 'description' => 'Whether Tycoon can continue level after legend',\n ],\n 'ServiceBuysBatched' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Services Buy Batched',\n 'tool_tip' => 'Services buy supplies in batches',\n 'description' => 'Services buy supplies in batches',\n ],\n 'RoadZone' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Road Zone',\n 'tool_tip' => 'The zone that roads belong to',\n 'description' => 'The zone that roads belong to',\n ],\n 'MinTaxesPer' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Minimum Taxes',\n 'tool_tip' => 'Minimum tax level',\n 'description' => 'Minimum tax level',\n ],\n 'MinCivicsWage' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Minimum Civic Wages',\n 'tool_tip' => 'This is the minimum wage level a Tycoon can set for civic wages',\n 'description' => 'This is the minimum wage level a Tycoon can set for civic wages',\n ],\n 'MaxSubPop' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Maximum Subsidy Population',\n 'tool_tip' => 'The level of population after which subsidies will no longer be paid',\n 'description' => 'The level of population after which subsidies will no longer be paid',\n ],\n 'MixedPlanet' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Mixed Planet',\n 'tool_tip' => 'An as yet unknown setting',\n 'description' => 'An as yet unknown setting',\n ],\n 'MixedDesire' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Mixed Desire',\n 'tool_tip' => 'An as yet unknown setting',\n 'description' => 'An as yet unknown setting',\n ],\n ],\n ],\n 'boosts' => [\n 'display_name' => 'Simulation Boosts',\n 'display' => 'block',\n 'settings' => [\n 'ResInhabBoost' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Residential Boost',\n 'tool_tip' => 'Residential Boost',\n 'description' => 'Residential Boost',\n ],\n 'ConstBoost' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Construction Boost',\n 'tool_tip' => 'Construction Boost',\n 'description' => 'Construction Boost',\n ],\n 'CommerceBoost' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Commerce Boost',\n 'tool_tip' => 'Commerce Boost',\n 'description' => 'Commerce Boost',\n ],\n ],\n ],\n 'building_separation' => [\n 'display_name' => 'Building Separation',\n 'display' => 'block',\n 'settings' => [\n 'MinCommerceSep' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Commerce',\n 'tool_tip' => 'How far apart commerce buildings of the same class must be',\n 'description' => 'How far apart commerce buildings of the same class must be',\n ],\n 'MinOfficeSep' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Office',\n 'tool_tip' => 'How far apart office buildings of the same class must be',\n 'description' => 'How far apart office buildings of the same class must be',\n ],\n ],\n ],\n 'thread_speeds' => [\n 'display_name' => 'Thread Speeds',\n 'display' => 'none',\n 'settings' => [\n 'SimSpeed' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Model Server',\n 'tool_tip' => 'Simulation Speed',\n 'description' => 'Simulation Speed',\n ],\n 'DASpeed' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Direct Access',\n 'tool_tip' => 'Speed of something',\n 'description' => 'Speed of something',\n ],\n 'CacheSpeed' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Cache Server',\n 'tool_tip' => 'Cache server speed',\n 'description' => 'Cache server speed',\n ],\n 'IntSpeed' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Interface Server',\n 'tool_tip' => 'Interface Server speed',\n 'description' => 'Interface Server speed',\n ],\n 'Trans' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Transcendence',\n 'tool_tip' => 'Speed of transcendence',\n 'description' => 'Speed of transcendence',\n ],\n ],\n ],\n ];\n\n foreach ($baseCategories as $categoryKey => &$category) {\n foreach ($category['settings'] as $settingName => &$setting) {\n $setting['setting'] = $configArray[$settingName] ?? $setting['default'];\n }\n }\n\n return self::makeTables($baseCategories);\n }", "private static function _flatternConfig($AConfig = null, $_key = '')\n {\n\n $_AFlat = [];\n if (!empty($_key)) {\n $_key .= '.';\n }\n\n if (is_null($AConfig)) {\n $AConfig = self::$_AConf;\n }\n\n foreach ($AConfig as $key => $AOptions) {\n $key = $_key . $key;\n $_AFlat[$key] = $AOptions;\n if (is_array($AOptions)) {\n $ATmp = self::_flatternConfig($AOptions, $key);\n $_AFlat = array_merge($_AFlat, $ATmp);\n }\n }\n\n return $_AFlat;\n }", "public function getConfigData($config)\r\n\t{\r\n \treturn Mage::getStoreConfig('payment/Query_Cielo_Cc/' . $config);\r\n\t}", "public function readConfigFile(): void\n {\n $configPath = __DIR__ . '/../../.config';\n if (!file_exists($configPath)) {\n echo \"Could not find .config\\n\";\n die;\n }\n $lines = preg_split('/[\\r\\n]+/', file_get_contents($configPath));\n foreach ($lines as $line) {\n if (empty($line)) {\n continue;\n }\n if (substr($line, 0, 1) == '#') {\n continue;\n }\n $kv = preg_split(\"/=/\", $line);\n $key = $kv[0];\n $value = $kv[1];\n $this->data[$key] = $value;\n }\n }", "private function buildConfig($runtimeConfig = [])\n {\n // Merge all configs\n return array_merge($this->app['config']['fixerio'], $runtimeConfig);\n }" ]
[ "0.60162103", "0.5997981", "0.5962057", "0.59194773", "0.5665539", "0.561699", "0.5611839", "0.56058747", "0.5568382", "0.55027294", "0.54600734", "0.5336704", "0.53150344", "0.5309253", "0.529479", "0.5269063", "0.52525663", "0.52364254", "0.52274436", "0.52034014", "0.52031744", "0.51944286", "0.5180548", "0.51450515", "0.5139555", "0.5137762", "0.5134888", "0.5132846", "0.51307696", "0.51178926", "0.5107841", "0.50538576", "0.504051", "0.5020272", "0.50145656", "0.5010447", "0.50084144", "0.50066423", "0.499529", "0.49942738", "0.4991014", "0.49863833", "0.49673158", "0.49644664", "0.49618617", "0.49604976", "0.4960093", "0.49536705", "0.49520868", "0.49455675", "0.49405572", "0.4931231", "0.49257633", "0.49212253", "0.49112347", "0.49110824", "0.49061093", "0.49051374", "0.48972547", "0.48947877", "0.48890662", "0.4888942", "0.48885062", "0.4884943", "0.48698986", "0.4868738", "0.48681936", "0.48562828", "0.48560137", "0.48431638", "0.48377237", "0.4831516", "0.48304394", "0.48288658", "0.4817806", "0.48172253", "0.48166195", "0.48135394", "0.4803125", "0.48026896", "0.4802487", "0.48010734", "0.4793887", "0.4783041", "0.4780306", "0.4776231", "0.47761256", "0.47741973", "0.47722042", "0.47691187", "0.47666088", "0.476527", "0.47588092", "0.47587815", "0.4758535", "0.47563952", "0.47499982", "0.47490168", "0.4742554", "0.47419658", "0.4739562" ]
0.0
-1
Verifies a set of credentials against a storage backend.
abstract public function login(array $input);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validate(array $credentials = []): bool\n {\n throw new \\RuntimeException('Cognito guard cannot be used for credential based authentication.');\n }", "public function validate(array $credentials = []);", "protected function validate() {\n if ($valid = isset($this->options['store_key']) && isset($this->options['store_secret']) && isset($this->options['store_container'])) {\n $valid = FALSE;\n print_msg(sprintf('Validating Azure connection using --store_key %s, --store_container %s', $this->options['store_key'], $this->options['store_container']), isset($this->options['verbose']), __FILE__, __LINE__); \n $curl = ch_curl($this->getUrl(NULL, array('restype' => 'container')), 'HEAD', $this->getHeaders(), NULL, NULL, '200,404');\n if ($curl === 200) {\n $valid = TRUE;\n print_msg(sprintf('Azure authentication and bucket validation successful'), isset($this->options['verbose']), __FILE__, __LINE__);\n }\n else if ($curl === 404) print_msg(sprintf('Azure authentication successful but bucket %s does not exist', $this->options['store_container']), isset($this->options['verbose']), __FILE__, __LINE__, TRUE);\n else print_msg(sprintf('Azure authentication failed'), isset($this->options['verbose']), __FILE__, __LINE__, TRUE);\n }\n else print_msg(sprintf('--store_key, --store_secret and --store_container are required'), isset($this->options['verbose']), isset($this->options['verbose']), __FILE__, __LINE__, TRUE);\n\n return $valid;\n }", "public function validate(array $credentials = [])\n {\n\n }", "public function validate(array $credentials = []){\n\n return true;\n }", "private function _validateCredentials($credentials){\n if(empty($credentials->username) || empty($credentials->password)) return false;\n $admin = $this->_getPassword($credentials->username);\n if(empty($admin)) return false;\n $decodedPassword = $this->encryption->decrypt($admin->password);\n return $credentials->password == $decodedPassword;\n }", "public function validate(array $credentials = [])\n {\n return true;\n }", "public function validateCredentials(Authenticatable $user, array $credentials): bool;", "public function supportsCredentials(array $credentials)\n {\n return array_keys($credentials) === array('login', 'password');\n }", "public function validateCredentials(Authenticatable $user, array $credentials) {}", "public function validate(array $credentials = [])\n {\n return false;\n }", "public function validate(array $credentials = [])\n {\n return false;\n }", "public function validateCredentials(Authenticatable $user, array $credentials);", "private function isCorrectCredentials ()\n {\n\n try {\n $this->httpClient->request (\"GET\", \"http://livescore-api.com/api-client/users/pair.json?key=\" . $this->apiKey . \"&secret=\" . $this->apiSecret);\n } catch (ClientException $e) {\n $response = json_decode ((string) $e->getResponse ()->getBody (), true);\n\n throw new WrongAPICredentialsException($response['error'], $e->getResponse ()->getStatusCode ());\n }\n }", "public function validateCredentials(\\Illuminate\\Auth\\UserInterface $user, array $credentials)\n\t{\n\t}", "public function validateCredentials(UserInterface $user, array $credentials);", "public function validateCredentials(Authenticatable $user, array $credentials){\n\n }", "function validate_jwt_from_compute_engine($iap_jwt, $cloud_project_number, $backend_service_id)\n{\n $expected_audience = sprintf(\n '/projects/%s/global/backendServices/%s',\n $cloud_project_number,\n $backend_service_id\n );\n return validate_jwt($iap_jwt, $expected_audience);\n}", "public static function validate($credentials = array()){\n return \\Illuminate\\Auth\\Guard::validate($credentials);\n }", "public function authenticating($credentials)\n\t{\n\t\t$user \t= $this->model->key($credentials['key'])->first();\n\n\t\tif(!$user)\n\t\t{\n\t\t\tthrow new Exception(\"Key tidak terdaftar!\", 1);\n\t\t}\n\n\t\tif(!Hash::check($credentials['secret'], $user->secret))\n\t\t{\n\t\t\tthrow new Exception(\"secret Tidak Cocok!\", 1);\n\t\t}\n\n\t\treturn true;\n\t}", "private function test_good_passwords($passwords)\n {\n foreach ($passwords as $password) {\n $this->validatePassword($password)->shouldReturn(true);\n }\n }", "private function checkCredentials(array $args = []): bool\n {\n if (empty($args['credentials'])) {\n throw new VisacheckException('You did not provide the Visacheck client credentials in the configuration.', $args);\n }\n $id = data_get($args, 'credentials.id', null);\n $secret = data_get($args, 'credentials.secret', null);\n if (empty($id)) {\n throw new VisacheckException('The client \"id\" key is absent in the credentials configuration.', $args);\n }\n if (empty($secret)) {\n throw new VisacheckException('The client \"secret\" key is absent in the credentials configuration.', $args);\n }\n return true;\n }", "function verifyUser ($username, $hash) {\r\n //TO-DO\r\n\r\n //if credentials match return true\r\n\r\n //else return false\r\n\r\n //dummy CODE\r\n return true;\r\n}", "public static function attempt(array $credentials) : bool;", "protected function validCredentials(){\n $valid_credentials = !empty($this->consumerKey);\n $valid_credentials = ($valid_credentials && !empty($this->consumerSecret));\n $valid_credentials = ($valid_credentials && $this->consumerKey === variable_get('ebs_consumer_key', '')); \n $valid_credentials = ($valid_credentials && $this->consumerSecret === variable_get('ebs_consumer_secret', ''));\n \n return $valid_credentials;\n }", "public function checkCredentials(string $email, string $password):bool;", "public function testCheckCredentials(){\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $result = $db->checkCredentials(\"owner@gmail.com\",\"owner\");\r\n $this->assertEquals(\"owner@gmail.com\",$result[\"emailId\"]);\r\n }", "public function validate(array $credentials = [])\n {\n // disable validation of credentials\n return false;\n }", "abstract public function credentials();", "public function validateCredentials(Authenticatable $user, array $credentials)\n {\n }", "public function isValid()\n {\n foreach ($this->repo as $repository) {\n /**\n * @var Repository $repository\n */\n $repository->needAuth();\n }\n }", "public function validate(array $credentials = [])\n {\n return (bool)$this->attempt($credentials, false);\n }", "function check_backend_authentication()\n{\n if (is_backend_authenticated() == false) {\n handle_backend_error(\"Authentication Failure\");\n }\n}", "public function checkAuth();", "public function checkAuth();", "public function attempt(Credentials $credentials): bool\n {\n }", "public function validateCredentials(array $credentials)\n\t{\n\t\tif (empty($credentials['username']))\n\t\t\treturn false;\n\n\t\tif (empty($credentials['password']))\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "public function checkCredentials($identity, $credentials)\n {\n if ($this->salt != null) {\n $sql = \"SELECT di.id\n\t\t\t\t\tFROM dlayer_identity di\n\t\t\t\t\tWHERE di.identity = :identity\n\t\t\t\t\tAND di.credentials = :credentials\n\t\t\t\t\tAND logged_in = 0\n\t\t\t\t\tAND enabled = 1\n\t\t\t\t\tLIMIT 1\";\n $stmt = $this->_db->prepare($sql);\n $stmt->bindValue(':identity', $identity, PDO::PARAM_STR);\n $stmt->bindValue(':credentials',\n $this->hashedCredentials($credentials), PDO::PARAM_STR);\n $stmt->execute();\n\n $result = $stmt->fetch();\n\n if ($result != false) {\n $this->identity_id = $result['id'];\n\n return true;\n } else {\n return false;\n }\n } else {\n throw new Exception('Salt not set in authentication model');\n }\n }", "public function canManageCredentials()\n {\n return true;\n }", "public function validateCredentials(UserContract $user, array $credentials)\n {\n return false;\n }", "public function hasCredentials($store=null)\n {\n return ($this->hasAccountUser($store) && $this->hasAccountSignature($store));\n }", "public function retrieveByCredentials(array $credentials)\n {\n return false;\n }", "public function validate(array $credentials = []): bool\n {\n // Retrieve a user by the given credentials.\n //\n $user = $this->provider->retrieveByCredentials($credentials);\n\n // Exists\n //\n return ! is_null($user) && $this->provider->validateCredentials($user, $credentials);\n }", "public function validateCredentials(Auth\\UserInterface $user, array $credentials) {\n $result = $user->getAuthIdentifier() == $credentials['email'] &&\n $user->getAuthPassword() == $credentials['password'];\n return $result;\n }", "public function validateCredentials(Authenticatable $user, array $credentials)\n {\n return $user->getAuthPassword() == hash('sha256', 'very very salty', $credentials['password']);\n }", "public function validate(array $credentials = [])\n {\n return $this->attempt($credentials,false);\n }", "public function checkAuthentication() {}", "function verify(){\r\n\r\n /*\r\n le chemin d'acces du fichier\r\n */\r\n \r\n \r\n \t $file=dirname(__DIR__).DIRECTORY_SEPARATOR.\"username\";\r\n $file2=dirname(__DIR__).DIRECTORY_SEPARATOR.\"password\";\r\n\r\n /*\r\n * cette condition verifie si les fichiers password et username sont crees\r\n * si c'est le cas on verifie leurs contenu\r\n * si le contenue est vide vous rester sur la page d'installation dans le cas contraitre vous avez access au dashboard admin\r\n \r\n *le contenu des fichier sera ainsi enregistre dans la base de donnee afin de faire des eventuelles comparaisons si il ya une modification des fichier\r\n */\r\n \r\n \t if (file_exists($file) and file_exists($file2)):\r\n $content=(string)file_get_contents($file);\r\n $content1=(string)file_get_contents($file2);\r\n if(empty($content) and empty($content1)):\r\n\r\n return false;\r\n\r\n else:\r\n return true;\r\n\r\n endif;\r\n\r\n endif;\r\n\r\n\r\n\r\n\r\n\r\n }", "public function validate(array $credentials = [])\r\n {\r\n $user = $this->retrieveUserAndValidate($credentials);\r\n\r\n return ! empty($user);\r\n }", "public function authenticate(\\codename\\core\\credential $credential) : array;", "private static function has_credentials() {\r\n\t\t\t$credentials = self::get_credentials();\r\n\r\n\t\t\treturn is_array($credentials)\r\n\t\t\t\t\t&& isset($credentials['api-key'])\r\n\t\t\t\t\t&& isset($credentials['email'])\r\n\t\t\t\t\t&& isset($credentials['id'])\r\n\t\t\t\t\t&& !empty($credentials['api-key'])\r\n\t\t\t\t\t&& !empty($credentials['email'])\r\n\t\t\t\t\t&& !empty($credentials['id']);\r\n\t\t}", "function backend_user_check()\n {\n return app('nodes.backend.auth')->check();\n }", "public function validateCredentials(Authenticatable $user, array $credentials)\n {\n $plain = $credentials['password'];\n $authPassword = $user->getAuthPassword();\n return sha1('ld' .$authPassword['salt'] . sha1($authPassword['salt'] . sha1($plain))) == $authPassword['password'];\n }", "public function verifyKeys() {\n $data = $this->getClientInformation();\n $result = $this->updateSite($data);\n // lastResponseCode will either be TRUE, REQUEST_ERROR, AUTH_ERROR, or\n // NETWORK_ERROR.\n return $this->lastResponseCode === TRUE ? TRUE : $this->lastResponseCode;\n }", "public function validateCredentials(UserContract $user, array $credentials)\n {\n $plain = $credentials['password'];\n $salt = $user->getAuthSalt();\n return $this->hasher->check($plain.$salt, $user->getAuthPassword());\n }", "function authenticate() {}", "protected function verify_credentials() {\r\n\r\n\t\t$this->tmhOAuth->config['user_token']\t= $this->conf->TwitterOAuthToken;\r\n\t\t$this->tmhOAuth->config['user_secret']\t= $this->conf->TwitterOAuthSecret;\r\n\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'GET', $this->tmhOAuth->url('1.1/account/verify_credentials')\r\n\t\t);\r\n\r\n\t\t// print_r($this->tmhOAuth->response);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$resp = json_decode($this->tmhOAuth->response['response']);\r\n\t\t\t$this->addMsg(\r\n\t\t\t\t'<p>Authourised as ' . $resp->screen_name . '</p>' .\r\n\t\t\t\t'<p>The access level of this token is: ' . $this->tmhOAuth->response['headers']['x-access-level'] . '</p>'\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}", "public static function checkCredentials()\n {\n if (null === self::username() || null === self::password()) {\n echo self::errorMessage();\n die(1);\n }\n\n return true;\n }", "public function validate_credentials( $password, $control, $form, $email)\n\t{\n\t\t$api = new SimpleAPI;\n\t\t\n\t\tif( $api->authenticate( $email, $password ) ) {\n\t\t\treturn array();\n\t\t}\n\t\telse {\n\t\t\treturn array( _t( 'Authentication failed. Check your email and password.') );\n\t\t}\n\t}", "public function verify();", "function is_validated($username = null, $password = null){\n return validate_cred($username, $password);\n}", "public function testWrongDatabaseCredentials(): void {\n\t\t$ini_array = parse_ini_file(\"test.ini\");\n\t\t$user = $ini_array[\"incorrectdb\"][\"user\"];\n\t\t$password = $ini_array[\"incorrectdb\"][\"password\"];\n\t\t$host = $ini_array[\"incorrectdb\"][\"host\"];\n\n\t\t$output = `php src/user_upload.php -u $user -p$password -h$host 2>&1`;\n\n\t\t$this->assertEquals(\n\t\t\t\"Could not open connection to database: Access denied for user '$user'@'$host' (using password: YES)\\n\",\n\t\t\t$output\n\t\t);\n\t}", "public function testConnectionWithWrongCredentials()\n {\n $storage = new RemoteHostStorage(\n array_merge($this->options, array(\n 'password' => 'pa$$word'\n ))\n );\n\n $this->setExpectedException('RuntimeException');\n $storage->connect();\n }", "public function validateCredentials(UserContract $user, array $credentials)\n {\n $plain = $credentials['password'];\n return Hash::check($plain, $user->getAuthPassword());\n }", "public function hasCredential(string $id): bool;", "public function testAuthenticateUser ()\n {\n $result = $this->storage->authenticateUser($this->accessId1, $this->signature1, $this->stringToSign1);\n $this->assertEquals($this->accessId1, $result['access_key']);\n }", "function verify_twitter_credentials($twitter) {\n require_once OTHERS . \"twitter/codebird.php\";\n \\Codebird\\Codebird::setConsumerKey($twitter['consumer_key'], $twitter['consumer_secret']);\n\n $cb = \\Codebird\\Codebird::getInstance();\n\n $cb->setToken($twitter['access_token'], $twitter['access_token_secret']);\n\n $reply = $cb->oauth2_token();\n if (isset($reply->errors)) {\n return array(\n 'result' => false,\n 'message' => $reply->errors[0]->message\n );\n } else {\n return array(\n 'result' => true,\n 'message' => \"Verifying credentials successful!\"\n );\n }\n }", "static function isCredentialsValidErrorMessageForJob( $jobId ) {\n\n if (substr(php_uname(), 0, 7) != \"Windows\") {\n $logDirectory = get_option( 'hbo_log_directory' );\n if( empty($logDirectory )) {\n throw new ValidationException( \"log_directory not specified\" );\n }\n\n $command = \"grep -q 'Current credentials not valid' $logDirectory/job-$jobId.txt\";\n $returnval = 0;\n $output = array();\n exec( $command, $output, $returnval );\n if ( $returnval == 0 ) {\n return true;\n }\n\n $command = \"grep -q 'Incorrect password' $logDirectory/job-$jobId.txt\";\n exec( $command, $output, $returnval );\n if ( $returnval == 0 ) {\n return true;\n }\n }\n return false;\n }", "public function disable_testValidateTryWithWrongSecret()\n {\n $this->callMigration(); \n \n $credentials = [ \n\n 'email' => 'demo@bumin.com.tr',\n 'password' => 'failed'\n ];\n \n $this->assertFalse(\\Auth::validate($credentials)); \n }", "public function retrieveByCredentials(array $credentials){\n\n }", "public function testCorrectDatabaseCredentials(): void {\n\t\t$ini_array = parse_ini_file(\"test.ini\");\n\t\t$user = $ini_array[\"correctdb\"][\"user\"];\n\t\t$password = $ini_array[\"correctdb\"][\"password\"];\n\t\t$host = $ini_array[\"correctdb\"][\"host\"];\n\n\t\t$output = `php src/user_upload.php -u $user -p$password -h$host 2>&1`;\n\n\t\t$this->assertRegExp(\n\t\t\t'/Database connected/',\n\t\t\t$output\t\n\t\t);\n\t}", "public function testAuthenticateUserFalse ()\n {\r\n $this->setExpectedException('InvalidAccessKeyIdException');\n $result = $this->storage->authenticateUser($this->badAccessId, $this->signature1, $this->stringToSign1);\n $this->assertNull($result);\n }", "public function testVerify()\n {\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+456', 'TEST_SECRET')\n );\n\n // Assert false when the phone is not stored\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+123', 'CLIENT_SECRET')\n );\n\n // Assert true when the phone and secret are properly given\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+123', 'TEST_SECRET')\n );\n }", "abstract public function getCredentials();", "public static function authenticate($table = 'AuthTable'){\n\n // authenticate user session to enable access to api functions\n $q_auth = false;\n\n try{ \n\n // retrieve stored password string from database against UserName\n $query = New Query(SELECT, \"* FROM `$table` WHERE `UserName` =:UserName\");\n $UserDetails = $query->execute(SIMPLIFY_QUERY_RESULTS_ON, [':UserName' => $_SERVER[\"PHP_AUTH_USER\"]]);\n\n // Ensure continuity in case of accidental duplication of user details\n if (isset($UserDetails[1][\"UniqueID\"])){\n $UserDetails = $UserDetails[0];\n }\n\n\n /** @todo If control block will need to go into query class for null outputs, as this is where decryption will occur */\n if (count($UserDetails)===0){\n // If no user obtained from database then throw exception and handle.\n throw new \\UnexpectedValueException($_SERVER['PHP_AUTH_USER'].\" DOES NOT EXIST\");\n } else {\n // Else validate the password\n\n\n if (strpos($_SERVER[\"PHP_AUTH_PW\"], \"google=\") !== False) {\n // Case for Google Token supplied \n // google=client_id=#,Id_token=#\n\n $tokens = explode(\"google=client_id=\", $_SERVER[\"PHP_AUTH_PW\"]);\n $tokens = explode(\",id_token=\", $tokens[1]);\n $client_id = $tokens[0];\n $id_token = $tokens[1];\n // var_dump($tokens);\n\n $client = new \\Google_Client(['client_id' => $client_id]);\n $payload = $client->verifyIdToken($id_token);\n $q_auth = Auth::verifyGoogleID($payload, $UserDetails['UniqueID']);\n } else {\n // Case for password or authtoken supplied\n //Load either the authToken from the database, or the password, depending on which the user has supplied\n if (strpos($_SERVER[\"PHP_AUTH_PW\"], $_SERVER[\"PHP_AUTH_USER\"].\"=\") !== False){\n // Token has been supplied\n $password = $UserDetails[\"AuthToken\"];\n } else {\n // Password has been supplied\n $password = $UserDetails[\"Password\"];\n //Return authtoken to be used in future requests, unless connection is via admin rather than user\n if($table != \"AdminTable\"){Connection::$AuthToken = $UserDetails[\"AuthTokenPlain\"];}\n }\n\n\n // for admin table, key is protected by password\n if ($table == \"AdminTable\"){\n $password = Crypt::decryptWithUserKey($UserDetails[\"UserKey\"], $_SERVER[\"PHP_AUTH_PW\"], $password);\n }\n \n $q_auth = Auth::verifyPassword($password, $UserDetails['UniqueID']);\n\n }\n\n\t\t\t}\n\n \n\n }\n catch (\\UnexpectedValueException $e) {\n http_response_code(401);\n Output::errorMsg(\"Unexpected Value: \".$e->getMessage().\".\");\n }\n \n\n return $q_auth;\n\n }", "public function testAuthenticateUserEmailFalse ()\n {\n try {\n $this->storage->authenticateUser('milan@magudia', $this->signature1, $this->stringToSign1);\n } catch (InvalidArgumentException $e) {\n $this->assertEquals('$email address is not valid', $e->getMessage());\n return;\n }\n $this->fail('An expected exception has not been raised.');\n }", "public function hasMultipleAccounts();", "private function _fail_auth_check($data_array)\r\n {\r\n $checker = true;\r\n \r\n $user = $this->_get_array_value($data_array,\"user\");\r\n $password = $this->_get_array_value($data_array,\"password\");\r\n \r\n if($user == \"root\" && $password == \"1234abcd*\")\r\n {\r\n $checker = false;\r\n }\r\n \r\n return $checker;\r\n }", "function validateCredential(){\r\n\r\n\t\t$avsData = array('Street' => '1 Main St', 'City' => 'San Jose', 'PostalCode' => '95131');\r\n\t\t$cardData = array('cardowner' => 'Jane Doe', 'cardtype' => 'Visa', 'pan' => '4012888812348882', 'expire' => '1218', 'cvv' => '123');\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$obj_transaction = new VelocityProcessor( $this->applicationprofileid, $this->merchantprofileid, $this->workflowid, $this->isTestAccount, $this->identitytoken, null);\r\n\t\t\treturn array('status'=>1,'message'=>'Authentication Validated Successfully.');\r\n\t\t\t/* try {\r\n\t\t\t\t$response = $obj_transaction->verify(array(\r\n\t\t\t\t\t\t'amount' => 1.00,\r\n\t\t\t\t\t\t'avsdata' => $avsData,\r\n\t\t\t\t\t\t'carddata' => $cardData,\r\n\t\t\t\t\t\t'entry_mode' => 'Keyed',\r\n\t\t\t\t\t\t'IndustryType' => $this->IndustryType,\r\n\t\t\t\t\t\t'Reference' => 'Ezneterp',\r\n\t\t\t\t\t\t'EmployeeId' => '11'\r\n\t\t\t\t));\r\n\t\t\t\t\r\n\t\t\t\tif (is_array($response) && isset($response['Status']) && $response['Status'] == 'Successful') \r\n\t\t\t\t\treturn array('status'=>1,'message'=>'Authentication Validated Successfully.');\r\n\t\t\t\telse\r\n\t\t\t\t\treturn array('status'=>0,'errors'=>$response);\r\n\t\t\t\t\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\treturn array('status'=>0,'errors'=>$e->getMessage());\r\n\t\t\t} */\r\n\t\t\t\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\tif(strcmp($e->getMessage(), 'An invalid security token was provided') == 0)\r\n\t\t\t\treturn array('status'=>0,'errors'=>'An invalid security token was provided');\r\n\t\t\telse\r\n\t\t\t\treturn array('status'=>0,'errors'=>$e->getMessage());\r\n\t\t}\r\n\t}", "public function validateCredentials(UserContract $user, array $credentials)\n {\n return parent::validateCredentials($user, $credentials); // TODO: 这里把密码校验规则重写\n }", "public function testAuthenticateUserFalseStringToSign ()\n {\r\n $this->setExpectedException('SignatureDoesNotMatchException');\n $this->storage->authenticateUser($this->email1, $this->signature1, false);\n }", "private function validate(Request $request, Storefront $store)\n {\n $secret = $store->getSharedSecret();\n $data = $request->getContent();\n $calculatedHmac = base64_encode(hash_hmac('sha256', $data, $secret, true));\n $providedHmac = $request->headers->get(self::AUTH_HEADER);\n if (! hash_equals($calculatedHmac, $providedHmac)) {\n throw new AuthenticationException(\"Provided HMAC does not match\");\n }\n }", "function _verifyCredentials($ac_token) {\n $api = 'https://api.twitter.com/1/account/verify_credentials.json';\n return $this->_execTwApi($ac_token, $api, array(), 'get');\n }", "function compare_hashed_pass($clientPass, $dbPass){\n\t\n\t//Result is a boolean used to determin if the passwords match\n\t$result = 0;\n\n\n\t$config_options = getConfigOptions();\n\t$pepper = $config_options['pepper'];\n\n\t$hashedPass = password_hash($clientPass.$pepper, PASSWORD_DEFAULT, $config_options['peppercost'] );\n\n\techo \"<p>Clients pass: \" . $clientPass . \"</p>\";\n\techo \"<p>Clients hashed pass: \" . $hashedPass . \"</p>\";\n\techo \"<p>Servers pass: \" . $dbPass . \"</p>\";\n\n\n\t//Get pepper options\n\t// require_once 'api-config.php';\n\n\tif(password_verify($clientPass.$pepper, $dbPass)){\n\t\t//Passwords match\n\t\treturn $result = 1;\n\t} else{\n\t\t//Passwords don't match\n\t\treturn $result = 0;\n\t}\n\n\treturn $result;\n}", "public function retrieveByCredentials(array $credentials)\n {\n }", "function validateApiCredentials() { \n if( $this->options['api_type'] == \"\" || $this->options['api_path'] == \"\" ) {\n $this->error_handler( 'Repository url not valid' );\n } elseif($this->options['username'] == \"\") {\n $this->error_handler( 'Username Required' );\n } else if($this->options['password'] == \"\") {\n $this->error_handler( 'Password Required' );\n }\n }", "public function validateCredentials(Authenticatable $user, array $credentials) {\n $plain = $credentials['password'];\n $hashed = $user->getAuthPassword();\n \n return $this->hasher->check($plain, $hashed);\n }", "public function validateCredentials(Request $request)\n {\n $error = [];\n\n // password validation\n // verify if the password is empty\n // verify if the confirm_password is empty\n // verify if the password and confirm_password are equal\n if (empty($request->request->get(\"password\"))) {\n $error[] = \"Password is required.\";\n } else {\n if (empty($request->request->get(\"confirm_password\"))) {\n $error[] = \"You must confirm your password.\";\n } else {\n if ($request->request->get(\"password\") !== $request->request->get(\"confirm_password\")) {\n $error[] = \"Password and confirmation are not the same.\";\n }\n }\n }\n\n return $error;\n }", "public function checkAuthentication()\n {\n if (!$this->hash) {\n throw new OnePilotException('no-verification-key', 403);\n }\n\n if (!$this->private_key) {\n throw new OnePilotException('no-private-key-configured', 403);\n }\n\n $hash = hash_hmac('sha256', $this->stamp, $this->private_key);\n\n if (!$this->checkKey($hash, $this->hash)) {\n throw new OnePilotException('bad-authentification', 403);\n }\n\n $this->validateTimestamp();\n\n return true;\n }", "public function testCrossRealmCompatibility() {\n\t\t$allSubkeys = [];\n\t\t$realms = [];\n\t\tforeach ( self::getServicesFiles() as $label => $info ) {\n\t\t\t$realm = require $info['file'];\n\t\t\tforeach ( $realm as $dc => $services ) {\n\t\t\t\t$allSubkeys = array_merge(\n\t\t\t\t\t$allSubkeys,\n\t\t\t\t\tarray_keys( $services )\n\t\t\t\t);\n\t\t\t}\n\t\t\t$realms[$label] = $realm;\n\t\t}\n\n\t\t// Normalize\n\t\t$allSubkeys = array_values( array_unique( $allSubkeys ) );\n\n\t\tforeach ( $realms as $label => $realm ) {\n\t\t\tforeach ( $realm as $dc => $dcServices ) {\n\t\t\t\t$this->assertSameValues(\n\t\t\t\t\t$allSubkeys,\n\t\t\t\t\tarray_keys( $dcServices ),\n\t\t\t\t\t\"service keys for $label/$dc\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "function authenticate(array $credentials)\n {\n die(\"aaaaaaaaaaaa\");\n }", "function verify_credentials($user, $pwd) {\n global $db;\n\n // query for admin users first\n $query = \"SELECT * FROM admin\n WHERE admin_user = :user\n AND admin_password = :pwd\";\n\n $statement = $db->prepare($query);\n $statement->bindValue(':user', $user);\n $statement->bindValue(':pwd', $pwd);\n $statement->execute();\n\n $result = $statement->fetch();\n\n $retval = $statement->closeCursor();\n\n if (isset($result['admin_user'])) {\n if (isset($result['admin_name'])) setcookie('name', $result['admin_name'], time() + 3600);\n $_SESSION['admin'] = true;\n $_SESSION['id'] = $result['admin_id'];\n return $retval;\n }\n\n // if no admin found, query for players\n $query = \"SELECT * FROM player\n WHERE player_user = :user\n AND player_password = :pwd\";\n\n $statement = $db->prepare($query);\n $statement->bindValue(':user', $user);\n $statement->bindValue(':pwd', $pwd);\n $statement->execute();\n\n $result = $statement->fetch();\n\n $retval = $statement->closeCursor();\n\n if (isset($result['player_user']) > 0) {\n if (isset($result['player_name'])) setcookie('name', $result['player_name'], time() + 3600);\n $_SESSION['id'] = $result['player_id'];\n return $retval;\n } else {\n return false;\n }\n }", "public function test_if_an_user_can_receive_valid_credentials() {\n $user = $this->createFakerUser($this->credentials);\n \n $this->postJson('/api/v1/auth/login', $this->credentials);\n \n $this->assertAuthenticatedAs($user);\n }", "function validateUser($hashFunction, $postPassword, $actualPassword) {\n if (is_array($actualPassword)) {\n foreach ($actualPassword as $password) {\n if ($hashFunction($postPassword) === $password) {\n return true;\n }\n }\n return false;\n } else {\n return $hashFunction($postPassword) === $actualPassword;\n }\n}", "public function testInvalidCredentialsCantLogin()\n {\n $this->browse( function( Browser $browser ){\n $browser->visit( '/admin' );\n $browser->type( 'email', 'admin@example.com' );\n $browser->type( 'password', 'wrongpassword' );\n $browser->click( '.button.is-primary' );\n $browser->assertSee( 'Your username or password were incorrect' );\n });\n }", "protected function checkUser(array $credentials)\n {\n $user = User::whereEmail($credentials['email'])->first();\n\n return ! is_null($user) && Hash::check($credentials['password'], $user->password);\n }", "public function validateCredentials(Authenticatable $user, array $credentials)\n {\n return $this->hasher->check($credentials['password'], $user->getAuthPassword());\n }", "public function validateAuthKey($authKey): bool;", "public function checkCredentials($username, $password)\r\n {\r\n // could not be found in the database\r\n $userID = 0;\r\n $digest = 'choir';\r\n\r\n\t\tif ($username == 'viennapres') $userID = 1;\r\n \r\n return array ($userID, $username, $digest);\r\n }", "private function _secureBackend()\n\t{\n\t\tif (!$this->_isAuthenticated()) {\n\t\t\theader(\"HTTP/1.1 401 Unauthorized\");\n\t\t\texit();\n\t\t}\n\t}", "private function checkUserAuthenticated () {\n if (empty($this->userIdentifier)) {\n #yes 403 - 401 is not appropriate for X509 authentication\n $this->exceptionWithResponseCode(403,\n \"You need to be authenticated to access this resource. \" .\n \"Please provide a valid IGTF X509 Certificate\"\n );\n }\n }" ]
[ "0.6091511", "0.597808", "0.57208455", "0.5543287", "0.55094403", "0.548879", "0.54507923", "0.54364204", "0.5376102", "0.5366718", "0.5343243", "0.5343243", "0.5342298", "0.5295681", "0.5294478", "0.52858293", "0.5251871", "0.5227671", "0.5222803", "0.52125186", "0.5198787", "0.51594234", "0.51367766", "0.5110251", "0.50694424", "0.50637764", "0.5061926", "0.50429344", "0.50388396", "0.5003604", "0.498043", "0.497897", "0.49664035", "0.48998982", "0.48998982", "0.48672822", "0.48618692", "0.4845098", "0.48407078", "0.48320174", "0.48232487", "0.48175418", "0.48104063", "0.47981763", "0.47965893", "0.47965673", "0.47841725", "0.47805566", "0.47659233", "0.47651038", "0.47640052", "0.47484463", "0.473141", "0.4727256", "0.47148305", "0.47023234", "0.4701649", "0.46763286", "0.46762633", "0.46630576", "0.46493202", "0.4648705", "0.46468088", "0.4611274", "0.4606987", "0.458769", "0.45832527", "0.4580024", "0.45783496", "0.45738742", "0.45707765", "0.45647168", "0.4560964", "0.4559624", "0.45572445", "0.45497483", "0.45482546", "0.4547344", "0.45436525", "0.45410994", "0.4539085", "0.45376098", "0.4533199", "0.45298707", "0.45216066", "0.45141765", "0.45129046", "0.45122352", "0.45063514", "0.44998318", "0.44991022", "0.44907773", "0.44783792", "0.44741356", "0.44713828", "0.4469678", "0.44684008", "0.44658715", "0.44577932", "0.44553566", "0.4453743" ]
0.0
-1
Handle logout logic against the storage backend.
public function logout(Auth $auth, $status = Status::ANON) { // do nothing }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function logout() {\n }", "private function _logout(){\r\n $auth = new AuthenticationService();\r\n\r\n if ($auth->hasIdentity()) {\r\n // Identity exists; get it\r\n $auth->clearIdentity();\r\n $this->user = false;\r\n\r\n header('Location: '.WEBROOT ) ;\r\n }\r\n }", "public function onLogout()\n {\n \n }", "abstract protected function logout();", "abstract public function logout();", "public static function doLogout() {\n session()->forget('auth_token');\n session()->flush();\n }", "public function logout() {\r\n \r\n // signal any observers that the user has logged out\r\n $this->setState(\"logout\");\r\n }", "abstract protected function logoutImpl(): void;", "public function logout()\n {\n $this->user_provider->destroyAuthIdentifierSession();\n\n \\session()->flush();\n \n $this->user = null;\n\n $this->loggedOut = true;\n }", "function logout() {\r\n $this->auth->logout();\r\n }", "function logoutHandler() {\n clearLogin();\n formatOutput(true, 'logout success');\n}", "public function logout()\n {\n $this->_delAuthId();\n }", "public function executeLogout() {\n $this->logMessage(\"Logout\", 'debug');\n $this->getUser()->clearCredentials();\n $this->getUser()->setAuthenticated(false);\n $this->redirect('default/index');\n }", "public function customerLogout()\n {\n\n\n // Actual Logout\n Auth::logout();\n }", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function onLogout()\n {\n // TODO: Implement onLogout() method.\n }", "public function postLogout()\n {\n $this->getLogout();\n }", "public function log_out() {\n $this->store_token(null);\n }", "public function logout() {\n }", "public function logout () {\n $this->clear();\n }", "public function handleUserLogout($event) {}", "public function logout(): void\n {\n\n }", "public function logout() {\n $logout = $this->ion_auth->logout();\n\n // redirect them back to the login page\n redirect('login');\n }", "public function logout_actions()\n {\n $config = $this->config->all();\n\n // on logout action we're not connected to imap server\n if (($config['logout_purge'] && !empty($config['trash_mbox'])) || $config['logout_expunge']) {\n if (!$this->session->check_auth())\n return;\n\n $this->storage_connect();\n }\n\n if ($config['logout_purge'] && !empty($config['trash_mbox'])) {\n $this->storage->clear_folder($config['trash_mbox']);\n }\n\n if ($config['logout_expunge']) {\n $this->storage->expunge_folder('INBOX');\n }\n\n // Try to save unsaved user preferences\n if (!empty($_SESSION['preferences'])) {\n $this->user->save_prefs(unserialize($_SESSION['preferences']));\n }\n }", "public function logout() {\n # Generate and save a new token for next login\n $new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string());\n\n # Create the data array we'll use with the update method\n # In this case, we're only updating one field, so our array only has one entry\n $data = Array(\"token\" => $new_token);\n\n # Do the update\n DB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\n # Delete their token cookie by setting it to a date in the past, logging them out\n setcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\n # Send them back to the main index.\n Router::redirect(\"/\");\n }", "function do_logout()\n\t{\n\t\t//log the user out\n\t\t$logout = $this->ion_auth->logout();\n\n\t\tredirect('cms/login', 'refresh');\n\t}", "public function logout()\n {\n\t // unsets all cookies and session data\n process_logout(); \n }", "public function logoutxxx()\n {\n $this->getSession()->destroy();\n }", "public function logout() {\n\n\t}", "public function getLogout()\n {\n if (\\Session::exists('adminLoginLogs')) {\n $adminLoginLogsData = \\Session::get('adminLoginLogs');\n if($adminLoginLogsData != NULL)\n {\n $adminLoginLogs = \\App\\Models\\AdminLoginLogs::find($adminLoginLogsData->id);\n if($adminLoginLogs != NULL)\n {\n $adminLoginLogs->logout_at = \\Carbon::now()->toDateTimeString();\n $adminLoginLogs->duration = diffInMinutes($adminLoginLogs->login_at, $adminLoginLogs->logout_at);\n }\n $admin = auth()->user();\n $admin->login_log_id = (NULL);\n $admin->save();\n }\n }\n auth()->logout();\n if (\\Session::exists('navigationPermissions')) {\n \\Session::remove('navigationPermissions');\n }\n if (\\Session::exists('navigations')) {\n \\Session::remove('navigations');\n }\n if (\\Session::exists('adminLoginLogs')) {\n \\Session::remove('adminLoginLogs');\n }\n return redirect()->route('admin.login')->with(['success' => __('validation.logged_out_successfully')]);\n }", "public function logout() {\n $auth_cookie = Cookie::get(\"auth_cookie\");\n if ($auth_cookie != '') {\n $this->deleteCookie($auth_cookie);\n }\n }", "public function logout()\n {\n \n }", "public function logout()\n {\n $session = new SessionContainer($this->getStorage()->getNameSpace());\n $session->getManager()->destroy();\n $this->getStorage()->forgetMe();\n\n $storage = $this->getStorage()->read();\n\n if (isset($storage['identity'])) {\n unset($storage['identity']);\n }\n }", "public function logout() {\n $new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string());\n\n # Create the data array we'll use with the update method\n # In this case, we're only updating one field, so our array only has one entry\n $data = Array(\"token\" => $new_token);\n\n # Do the update\n DB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\n # Delete their token cookie by setting it to a date in the past - effectively logging them out\n setcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\n # Send them back to the main index.\n Router::redirect(\"/\");\n\n }", "public function logoutAction() {\r\n\t\t$logoutdb = new Model_UsersTimeInfo();\r\n\t\t$logoutdb->logoutDB(login_user(),login_user_role());\r\n \t$storage = new Zend_Auth_Storage_Session();\r\n $storage->clear();\r\n $this->_redirect('auth/login');\r\n }", "public function doLogout()\n {\n $this->deleteRememberMeCookie();\n\n $_SESSION = array();\n session_destroy();\n\n $this->user_is_logged_in = false;\n $this->messages[] = MESSAGE_LOGGED_OUT;\n }", "private static function logout() {\n\t\t$key = Request::getCookie('session');\n\t\t$session = Session::getByKey($key);\n\t\tif ($session)\n\t\t\t$session->delete();\n\t\tOutput::deleteCookie('session');\n\t\tEnvironment::getCurrent()->notifySessionChanged(null);\n\t\tself::$loggedOut->call();\n\t}", "public function logout(){\n $new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string());\n\n # Create the data array we'll use with the update method\n # In this case, we're only updating one field, so our array only has one entry\n $data = Array(\"token\" => $new_token);\n\n # Do the update\n DB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\n # Delete their token cookie by setting it to a date in the past - effectively logging them out\n setcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\n # Send them back to the main index.\n Router::redirect(\"/\");\n }", "public function logOut(){\n $this->authToken=\"\";\n $this->loggedUser=\"\";\n $this->clearAuthCookie();\n }", "public function action_logout(){\n\t\tAuth::instance()->logout();\n \n\t\t#redirect to the user account and then the signin page if logout worked as expected\n\t\tHTTP::redirect('/');\t\n\n\t}", "public function logout()\n\t{\n\t\tif (isset($_SESSION[$this->sess_auth])) {\t\n\t\t\tSessionManager::instance()->trashLoginCreadentials();\n\t\t}\n\t}", "public function logout(){\n $this->_user->logout();\n }", "public function logout() {\n\t\t# Generate and save a new token for next login\n\t\t$new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string() );\n\n\t\t# Create the data array we'll use with the update method\n\t\t# In this case, we're only updating one field, so our array only has one entry\n\t\t$data = Array(\"token\" => $new_token);\n\n\t\t# Do the update\n\t\tDB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\n\t\t# Delete their token cookie by setting it to a date in the past - effectively logging them out\n\t\tsetcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\n\t\t# Send them back to the main index.\n\t\tRouter::redirect(\"/\");\n\t}", "public function logout()\n {\n $this->webUser = false;\n $this->refresh();\n \\Bdr\\Vendor\\Database::logout();\n }", "public function logout(){ \n if(request('email') && request('device_token') && request('device_type')) { \n $dtDeleted = DeviceToken::where('email_id', request('email'))\n ->where('device_type', request('device_type'))\n ->where('device_token', request('device_token'))\n ->delete();\n return response()->json([\n 'status'=>1,\n 'base_url' => $this->base_url,\n 'message' => 'You have been successfully logged out'\n ], $this->successCode);\n } else { \n return response()->json([\n 'status'=>0,\n 'base_url' => $this->base_url,\n 'message'=>'Unauthorised'\n ], $this->errorCode); \n } \n }", "public static function logout(){\n \\Illuminate\\Auth\\Guard::logout();\n }", "public function logout()\n {\n }", "public function logout()\n {\n }", "public function logout()\n {\n }", "public function logout()\n {\n $this->getAuth()->clearIdentity();\n }", "public function logoutAction(){\n if(!$this->input->isGet()) return $this->response->SendResponse(\n 403, false, GET_MSG\n );\n if(!$this->indexMiddleware->isUser()) return $this->response->SendResponse(\n 401, false, ACL_MSG\n ); \n //checking if the user is logged in \n $loggedUsername = $this->indexMiddleware->loggedUser();\n $checkLogged = $this->model->findByUsername('session_tb', $loggedUsername);\n // var_dump($checkLogged);die();\n if(!$checkLogged)return $this->response->SendResponse(\n 401, false, 'You are logged out already.'\n );\n\n $db = new DataBase();\n $logOut = $db->delete('session_tb', $checkLogged->id);\n\n if($logOut) return $this->response->SendResponse(200, false, 'You have successfully loggged out.');\n }", "function ds_logout_internal(): void\n {\n if (isset($_SESSION['ds_access_token'])) {\n unset($_SESSION['ds_access_token']);\n }\n if (isset($_SESSION['ds_refresh_token'])) {\n unset($_SESSION['ds_refresh_token']);\n }\n if (isset($_SESSION['ds_user_email'])) {\n unset($_SESSION['ds_user_email']);\n }\n if (isset($_SESSION['ds_user_name'])) {\n unset($_SESSION['ds_user_name']);\n }\n if (isset($_SESSION['ds_expiration'])) {\n unset($_SESSION['ds_expiration']);\n }\n if (isset($_SESSION['ds_account_id'])) {\n unset($_SESSION['ds_account_id']);\n }\n if (isset($_SESSION['ds_account_name'])) {\n unset($_SESSION['ds_account_name']);\n }\n if (isset($_SESSION['ds_base_path'])) {\n unset($_SESSION['ds_base_path']);\n }\n if (isset($_SESSION['envelope_id'])) {\n unset($_SESSION['envelope_id']);\n }\n if (isset($_SESSION['eg'])) {\n unset($_SESSION['eg']);\n }\n if (isset($_SESSION['envelope_documents'])) {\n unset($_SESSION['envelope_documents']);\n }\n if (isset($_SESSION['template_id'])) {\n unset($_SESSION['template_id']);\n }\n }", "public function logout()\n {\n $this->deleteAllPersistentData();\n $this->accessToken = null;\n $this->user = null;\n $this->idToken = null;\n $this->refreshToken = null;\n }", "function logout()\n {\n $this->fal_front->logout();\n }", "public static function logout ()\r\n\t{\r\n\t\tif (self::isLogged())\r\n\t\t{\r\n\t\t\t$oAuth = Zend_Auth::getInstance();\r\n\t\t\t$oAuth->setStorage(self::_getStorage());\r\n\r\n\t\t\t$oAuth->getStorage()->clear();\r\n\t\t\t$oAuth->clearIdentity();\r\n\t\t}\r\n\t}", "public function handleLogout()\n\t{\n\t\tif (Auth::check())\n {\n Auth::logout();\n return Redirect::to('/login');\n }\n else\n {\n $message = 'U bent niet ingelogd.';\n return Redirect::to('/login')->with('message', $message);\n }\n\t}", "public function logout() {\n\t$new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string());\n\t\n\t# Create the data array we'll use with the update method\n\t# In this case, we're only updating one field, so our array only has one entry\n\t$data = Array(\"token\" => $new_token);\n\t\n\t# Do the update\n\tDB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\t\n\t# Delete their token cookie - effectively logging them out\n\tsetcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\t\n\tRouter::redirect(\"/users/login\");\n }", "public function getLogout()\n {\n\n // If login correct\n Auth::logout();\n Session::flush();\n\n // Todo return something;\n }", "final public function logout(): void\n {\n $this->logoutImpl();\n if (isset($this->session->authData['username'])) {\n $this->context->getLogger()->logSys(\n get_class($this) . '::' . __FUNCTION__,\n 'User \"' . $this->session->authData['username'] . '\" has logged out',\n \\Ptf\\Util\\Logger::INFO\n );\n }\n $this->session->authData = [];\n }", "public static function logout();", "public function logout() {\n\t\t$this->removeAccessToken();\n\t}", "public function logout() {\n\t\t$this->clearCookies();\n\t}", "public function logout()\n {\n if (\n get_cookie($this->config->item('auth_cookie_id'), TRUE)\n && get_cookie($this->config->item('auth_cookie_key'), TRUE)\n ) {\n // store cookie informations in variables\n $encryptedUserIDs = get_cookie($this->config->item('auth_cookie_id'), TRUE);\n $enckey = get_cookie($this->config->item('auth_cookie_key'), TRUE);\n } else {\n // store session informations in variables\n $encryptedUserIDs = $this->session->userdata($this->config->item('auth_session_id'));\n $enckey = $this->session->userdata($this->config->item('auth_session_enkey'));\n }\n\n // check if any data is available\n if (empty($encryptedUserIDs) || empty($enckey)) {\n $this->_set_message('auth_already_logged_out');\n\n return TRUE;\n }\n\n // decrypt user IDs\n $userIDs = $this->encryption->decrypt($encryptedUserIDs);\n\n $userArray = explode('-', $userIDs);\n\n // delete user log\n if (!$this->auth_model->disable_session($userArray[0], $enckey)) {\n $this->_set_error('auth_log_delete_failed');\n return FALSE;\n }\n\n // delete authentication cookie\n $this->_delete_auth_cookie();\n\n // Destroy the session\n $this->session->sess_destroy();\n\n // Set success message\n $this->_set_message('auth_logout_successful');\n\n return TRUE;\n }", "private function logout()\n {\n try\n {\n global $userquery;\n\n \n if(!userid())\n {\n $logout_response['logged_out'] = 0;\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'you are not logged in', \"data\" => $logout_response);\n $this->response($this->json($data)); \n }\n\n $userquery->logout();\n if(cb_get_functions('logout')) \n cb_call_functions('logout'); \n \n setcookie('is_logout','yes',time()+3600,'/');\n\n $logout_response['logged_out'] = 1;\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'logout successfully', \"data\" => $logout_response);\n $this->response($this->json($data));\n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function logout()\n {\n $user = $this->user();\n\n // If we have an event dispatcher instance, we can fire off the logout event\n // so any further processing can be done. This allows the developer to be\n // listening for anytime a user signs out of this application manually.\n $this->clearUserDataFromStorage();\n\n if (isset($this->events)) {\n $this->events->dispatch(new LogoutEvent($this->name, $user));\n }\n\n // Once we have fired the logout event we will clear the users out of memory\n // so they are no longer available as the user is no longer considered as\n // being signed into this application and should not be available here.\n $this->user = null;\n\n $this->loggedOut = true;\n }", "function logout() {\n\t}", "public function logout()\n {\n $this->Auth->logout();\n $this->login();\n }", "public function logout()\n {\n DbModel::logUserActivity('logged out of the system');\n\n //set property $user of this class to null\n $this->user = null;\n\n //we call a method remove inside session that unsets the user key inside $_SESSION\n $this->session->remove('user');\n\n //we then redirect the user back to home page using the redirect method inside Response class\n $this->response->redirect('/');\n\n\n }", "public function logout()\n {\n $this->flushSession();\n }", "public function logout() {\n $session_key = $this->getSessionKey();\n if ($this->Session->valid() && $this->Session->check($session_key)) {\n $ses = $this->Session->read($session_key);\n if (!empty($ses) && is_array($ses)) {\n $this->Session->delete($session_key);\n $this->Session->delete($this->config['prefixo_sessao'] . '.frompage');\n }\n }\n if ($this->config['auto_redirecionamento'] && !empty($this->config['pagina_logout'])) {\n $this->redirecionar($this->config['pagina_logout']);\n }\n }", "public function logout(){\n\t\t$new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string());\n\t\t\n\t\t# Create the data array we'll use with the update method\n\t\t$data = Array(\"token\" => $new_token);\n\n\t\t# Do the update\n\t\tDB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\t\t\n\t\t# Delete their token cookie by setting it to a date in the past - effectively logging them out\n\t\tsetcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\n\t\t#send back to main index\n\t\tRouter::redirect(\"/\");\n\t}", "protected function logout() {\n $current_session = $this->Session->id();\n $this->loadModel('CakeSession');\n $this->CakeSession->delete($current_session);\n\n // Process provider logout\n $this->Social = $this->Components->load('SocialIntegration.Social');\n if ($this->Session->read('provider')) {\n $this->Social->socialLogout($this->Session->read('provider'));\n SocialIntegration_Auth::storage()->set(\"hauth_session.{$this->Session->read('provider')}.is_logged_in\", 0);\n $this->Session->delete('provider');\n }\n\n // clean the sessions\n $this->Session->delete('uid');\n $this->Session->delete('admin_login');\n $this->Session->delete('Message.confirm_remind');\n\n // delete cookies\n $this->Cookie->delete('email');\n $this->Cookie->delete('password');\n $cakeEvent = new CakeEvent('Controller.User.afterLogout', $this);\n $this->getEventManager()->dispatch($cakeEvent);\n }", "public function logout()\n {\n $this->user = null;\n $this->synchronize();\n unset($_SESSION);\n }", "public function doLogout()\n {\n AuthSam::logout();\n Cache::flush();\n return redirect('/');\n \n }", "public function logout(): void\n\t{\n\t\t$this->session->regenerateId();\n\n\t\t$this->session->regenerateToken();\n\n\t\t$this->session->remove($this->options['auth_key']);\n\n\t\t$this->response->getCookies()->delete($this->options['auth_key'], $this->options['cookie_options']);\n\n\t\t$this->user = null;\n\n\t\t$this->hasLoggedOut = true;\n\t}", "public function logout() \n {\n UserModel::logout();\n\n // redirect the user back home\n Redirect::to('home');\n }", "public function logout ()\n {\n User::logout(\"home\");\n }", "public function logout(){\n if(isset($_SESSION[\"identity\"])){\n \n unset($_SESSION[\"identity\"]);\n }\n\n if(isset($_SESSION[\"admin\"])){\n \n unset($_SESSION[\"admin\"]);\n }\n\n /* redireccionar, cuando me elimine la sesion del logueo */\n header(\"Location:\".base_url);\n }", "function logout() {\n if (!isset($_SESSION['userx\\auth']['shells']) || count($_SESSION['userx\\auth']['shells']) == 0) {\n unset($_SESSION['userx\\auth']);\n // Make sure remember keys are forgotten when logging out.\n if (isset($_COOKIE[\"REMBR_USR_KEY\"])) {\n // Unset this key, whomever it belongs too.\n if (strlen($_COOKIE[\"REMBR_USR_KEY\"]) == 16) {\n $user = UserModel::select()->byKey(array(\"user_remember_key\" => $_COOKIE['REMBR_USR_KEY']))->first();\n if ($user !== null) {\n $user->user_remember_key = \"\";\n $user->store();\n }\n }\n unset_cookie(\"REMBR_USR_KEY\");\n }\n } else {\n $_SESSION['userx\\auth']['user'] = array_pop($_SESSION['userx\\auth']['shells']);\n }\n}", "public function _logout()\n {\n $this->_login( self::getGuestID() );\n }", "public function logout()\n {\n // fonction qui ne fait rien car c'est le composant de securité qui s'en occupe. Cette fonction me sert a créer une route logout pour le transmettre dans le security.yaml\n }", "public function signOut();", "public function postLogout() {\n\n\t\t// update last url visited\n\t\t//\n\t\t//$this->postUpdate();\n\n\t\t// destroy session cookies\n\t\t//\n\t\tSession::flush();\n\t\treturn Response::make('SESSION_DESTROYED');\n\n\t\t//Auth::logout();\n\t}", "function logout()\n\t\t{\n\t\t\t// log the user out\n\t\t\t$logout = $this->ion_auth->logout();\n\t\t\tredirect('login');\n\t\t}", "function logout()\n\t\t{\n\t\t\t$logout = $this->ion_auth->logout();\n\t\n\t\t\t//redirect them back to the page they came from\n\t\t\tredirect('main', 'refresh');\n\t\t}", "public function logout()\n {\n $this->userId = 0;\n $this->createSession();\n $this->logger->loginOutEntry(2);\n }", "public function logout()\n {\n $this->session->end();\n }", "public function logout()\n {\n $this->deleteSession();\n }", "public function logout() {\n\t\t//Bridge Logout\n\t\tif ($this->config->get('cmsbridge_active') == 1 && !$this->lite_mode){\n\t\t\t$this->bridge->logout();\n\t\t}\n\n\t\t//Loginmethod logout\n\t\t$arrAuthObjects = $this->get_login_objects();\n\t\tforeach($arrAuthObjects as $strMethods => $objMethod){\n\t\t\tif (method_exists($objMethod, 'logout')){\n\t\t\t\t$objMethod->logout();\n\t\t\t}\n\t\t}\n\n\t\t//Destroy this session\n\t\t$this->destroy();\n\t}", "public function logout() {\n\t\tSentry::logout();\n\t\tredirect(website_url('auth'));\n\t}", "protected function logout()\n {\n $this->dispatch('admin/index/logout');\n }", "public function logout()\n {\n\n }" ]
[ "0.7189011", "0.69970566", "0.69269043", "0.6911283", "0.69099486", "0.68719995", "0.68183285", "0.68107665", "0.68086374", "0.6741017", "0.67170787", "0.67165464", "0.66932136", "0.66894", "0.66845626", "0.66845626", "0.66845626", "0.66845626", "0.66845626", "0.66845626", "0.66845626", "0.66845626", "0.66845626", "0.66845626", "0.66671413", "0.6661442", "0.6641694", "0.66399664", "0.6630948", "0.66221076", "0.66215074", "0.6616526", "0.6614008", "0.66006285", "0.65977156", "0.6586437", "0.6583283", "0.65804285", "0.656153", "0.6553642", "0.6546058", "0.6545157", "0.65329", "0.65294707", "0.65261877", "0.6507621", "0.6506266", "0.6504254", "0.6495521", "0.64907956", "0.6490481", "0.64862233", "0.6475818", "0.6474821", "0.6471056", "0.64685476", "0.64685476", "0.64685476", "0.6457619", "0.6451794", "0.64509946", "0.64508164", "0.64502406", "0.64470536", "0.64418983", "0.64405364", "0.6440323", "0.6436139", "0.64328563", "0.6417486", "0.64101076", "0.64091337", "0.6404797", "0.6401625", "0.63939166", "0.63931865", "0.63920563", "0.6386518", "0.63783437", "0.63758814", "0.6362903", "0.6362133", "0.6354199", "0.63496053", "0.63485116", "0.6344053", "0.6343412", "0.6339789", "0.6336692", "0.6336088", "0.63334274", "0.63276297", "0.63264453", "0.63207185", "0.6319583", "0.63148844", "0.63105863", "0.63103276", "0.6307991", "0.63077635", "0.6307564" ]
0.0
-1
Handle a resumed session against the storage backend.
public function resume(Auth $auth) { // do nothing }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resume();", "abstract protected function doResumeContext();", "abstract protected function doResume();", "protected function resumeOrStartSession()\n {\n if (!$this->resumeSession()) {\n $this->manager->start();\n $this->load();\n }\n }", "protected function resumeSession(): bool\n {\n if ($this->manager->getIsActive() || $this->manager->resume()) {\n $this->load();\n\n return true;\n }\n\n return false;\n }", "public function resume(): bool {}", "public function resume(): bool;", "public function resumeContextAccess(AccountInterface $account);", "public function resume() {\n \n if (!isset($_COOKIE) || !\\array_key_exists($this->name, $_COOKIE)) {\n\n //coookie prob expired\n $this->forget();\n return false;\n }\n\n\n\n if (!$this->sessionStarted()) {\n\n if (\\session_start()) {\n $this->refresh();\n }\n }\n if (!$this->isFingerprint()) { //UA doesnt match\n $this->forget();\n return false;\n }\n\n return true;\n }", "public function resumeQueue()\n {\n return $this->sendrequest('resume', null);\n }", "public function resume(): void\n {\n $this->tonClient->request(\n 'net.resume'\n )->wait();\n }", "function handleSession() {\n\tif(!isset($GLOBALS[\"cacheLimiter\"]))\n\t\t$GLOBALS[\"cacheLimiter\"] = CACHE_LIMITER;\n\tsession_cache_expire($GLOBALS[\"cacheLimiter\"]);\n\tsession_cache_expire(CACHE_TIMEOUT);\n\tsession_start();\n\tif(hasSessionTimedOut())\n\t logout(true);\n else\n \trefreshSession();\n\tif(shouldRestoreRedirectVars()) {\n\t\trestoreRedirectVars();\n\t}\n}", "public function resume($status = true)\n {\n $this->isEnabled = !$status ? $status : $this->storedStatus;\n $this->storedStatus = null;\n }", "public function resume(): bool\n {\n if ($this->values->offsetExists('principal')) {\n $this->principal = $this->values->get('principal');\n\n $this->logger->info(\n \"Authentication resume: {user}\",\n ['user' => $this->principal]\n );\n $this->publishResume($this->principal, $this->values);\n\n $this->values->offsetSet('lastActive', microtime(true));\n\n return true;\n }\n return false;\n }", "public function setSettingsBlockSessionResume(?bool $value): void {\n $this->getBackingStore()->set('settingsBlockSessionResume', $value);\n }", "public function resume(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n\n if ($request->user()->customer->can('resume', $subscription)) {\n $subscription->resume();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.resumed'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "function store($rname)\n{\n\ttry \n\t{\n\t\t$DBH = openDBConnection();\n\t\t$DBH->beginTransaction();\n\t\t\n\t\t// If RName isn't present then we directly store the session data,\n\t\t// otherwise delete old RName then insert new.\n\t\tif(!present($rname))\n\t\t{\n\t\t\tinsertSession($DBH, $rname);\n\t\t\t\n\t\t\t// Commit transaction\n\t\t\t$DBH->commit();\n\t\t\t\n\t\t\treturn \"Resume successfully stored.\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdelete($rname);\n\t\t\t\n\t\t\tinsertSession($DBH, $rname);\n\n\t\t\t// Commit transaction\n\t\t\t$DBH->commit();\n\t\t\t\n\t\t\treturn \"Resume successfully stored.\";\n\t\t}\n\t\n\t}\n\tcatch (PDOException $e) {\n\t\t$DBH->rollback();\n\t\treturn \"Error storing resume, please try again.\";\n\t}\n}", "public function restoreSession()\n {\n return $this->doRequest('GET', 'restore-session', []);\n }", "protected function handleSessionLifeTimeExpired() {}", "protected function handleSessionLifeTimeExpired() {}", "public function verifySessionIntegrity() {\n if (!$this->isValidSession()) {\n $this->end();\n $this->restart();\n }\n }", "public function resume(Timer $timer);", "private function renewSession() {}", "public function regenerateSession(){\n $authToken=$_COOKIE[self::COOKIENAME];\n if ($authToken){\n $authToken=base64_decode($authToken);\n $iv = substr($authToken,0,self::IVLEN);\n $crypted = substr($authToken,self::IVLEN);\n $token = openssl_decrypt($crypted, self::ALG, self::AESKEY,OPENSSL_RAW_DATA,$iv);\n if ($token===false){\n $this->__destruct();\n die('Decryption error');\n }\n\t $token = json_decode($token,true);\n\t $username=$token[\"loggedUser\"];\n\t // shoutout error if decryption failed\n\n // if user exists in backend storage\n if ($this->userExists($username)){\n $this->loggedUser=$username;\n $this->authToken=$_COOKIE[self::COOKIENAME];\n // reset cookie (to set new expiration date)\n $this->setAuthCookie();\n }\n else\n // logout if user does not exists in backend storage\n $this->logOut();\n }\n // no cookie - logout\n else $this->logOut();\n }", "public function restored(Storage $storage)\n {\n //\n }", "function load($rname){\n\ttry{\n\t\t$DBH = openDBConnection();\n\t\t$DBH->beginTransaction();\n\t\t\n\t\t// Get data associated with this resume from the resume table. Will do history portion later\n\t\t$stmt = $DBH->prepare(\"select * from Resume where RName = ? and Login = ?\");\n\t\t$stmt->bindValue(1, $rname);\n\t\t$stmt->bindValue(2, $_SESSION['login']);\n\t\t$stmt->execute();\n\t\t$row = $stmt->fetch();\n\t\t\n\t\t// Save database values to session state\n\t\t$_SESSION['name'] = $row['Name'];\n\t\t$_SESSION['address'] = $row['Address'];\n\t\t$_SESSION['phone'] = $row['Phone'];\n\t\t$_SESSION['position'] = $row['Position'];\n\t\t\n\t\t// Get history data from database\n\t\t$stmt2 = $DBH->prepare(\"select * from History where RName = ? and Login = ?\");\n\t\t$stmt2->bindValue(1, $rname);\n\t\t$stmt2->bindValue(2, $_SESSION['login']);\n\t\t$stmt2->execute();\n\t\t\n\t\t// Setup temporary arrays to hold values\n\t\t$beg = array();\n\t\t$end = array();\n\t\t$job = array();\n\t\t\n\t\t// Loop through database response to get job history, add to temporary arrays\n\t\twhile($row2 = $stmt2->fetch()){\n\t\t\t$beg[] = $row2['Start'];\n\t\t\t$end[] = $row2['End'];\n\t\t\t$job[] = $row2['Description'];\n\t\t}\n\t\t\n\t\t// Save arrays to session state\n\t\t$_SESSION['beg'] = $beg;\n\t\t$_SESSION['end'] = $end;\n\t\t$_SESSION['job'] = $job;\n\t\t\n\t\t$DBH->commit();\n\t\t\n\t\treturn \"Resume was loaded successfully.\";\n\t}\n\tcatch (PDOException $e){\n\t\t$DBH->rollBack();\n\t\treturn \"An error occured while trying to load the resume. Please try again.\";\n\t}\n}", "public function restore()\n {\n if ($basketData = $this->session->get(self::BASKET_CART_SESSION_KEY)) {\n static::$cart = unserialize($basketData);\n }\n }", "public function resumed_hook( $hook ) {\n\t\t$context = array(\n\t\t\t'event_hook' => $hook,\n\t\t);\n\n\t\t$this->info_message(\n\t\t\t'resumed_hook',\n\t\t\t$context\n\t\t);\n\t}", "private function restart() {\n session_start();\n session_regenerate_id();\n session_destroy();\n session_commit();\n session_start();\n $this->setUserAgent();\n $this->setRemoteAddress();\n }", "protected function load(): void\n {\n if (!isset($_SESSION[$this->sessionKey])) {\n return;\n }\n $data = \\json_decode($_SESSION[$this->sessionKey], true);\n if (\\is_array($data)) {\n foreach ($data as $cookie) {\n $this->setCookie(new SetCookie($cookie));\n }\n } elseif (\\strlen($data)) {\n throw new \\RuntimeException('Invalid cookie data');\n }\n }", "public function restart()\n {\n session_regenerate_id(true);\n $this->setup();\n }", "public function refreshSession() {}", "public function resume () {\n if ($this->started) {\n $this->run = true;\n $this->lapTmstmp = now();\n\n } else {\n $this->restart();\n }\n }", "public function restart() {\n if ($this->user->is_logged_in()) {\n $this->user->restart_player();\n }\n redirect(\"/account/info\");\n }", "public function getRespectStoragePage() {}", "private function clearPreviousEnrollmentState(): void\n {\n $keys = [];\n if ($this->session->has(self::ENROLL_KEYS_SESSION_NAME)) {\n $keys = $this->session->get(self::ENROLL_KEYS_SESSION_NAME);\n }\n $format = \"Removing %d keys from the enrollment session states\";\n $this->logger->debug(sprintf($format, count($keys)));\n try {\n foreach ($keys as $key) {\n $this->tiqrService->clearEnrollmentState($key);\n unset($keys[$key]);\n }\n } catch (Exception $e) {\n // Catch errors from the tiqr-server and up-cycle them to exceptions that are meaningful to our domain\n throw TiqrServerRuntimeException::fromOriginalException($e);\n }\n $format = \"Reset enroll session keys, remaining keys: %d\";\n $this->logger->debug(sprintf($format, count($keys)));\n\n $this->session->set(self::ENROLL_KEYS_SESSION_NAME, $keys);\n }", "function setRestoreSession($restoreSession) {\n $this->restoreSession = $restoreSession;\n }", "public function handle($request, Closure $next)\n {\n\n if( Auth::check() ) {\n\n if( !session()->get('caps') ) {\n\n $this->user = Auth::user()->load('roles');\n\n $caps = [];\n $roles = [];\n\n if( count( $this->user->roles ) ) {\n foreach ( $this->user->roles as $k => $role_array ) {\n $caps = array_merge( $caps , json_decode($this->user->roles[$k]->caps, true) );\n $roles[] = $this->user->roles[$k]->id;\n }\n }\n\n session()->put( 'caps', $caps );\n session()->put( 'user_roles', array(\n 'role_ids' => $roles,\n 'last_update' => strtotime(date('d-m-Y'))\n ) );\n\n } else {\n $changed_role_caps = Cache::get( 'changed_role_caps' );\n $user_roles = session()->get( 'user_roles' );\n\n foreach ( $user_roles['role_ids'] as $k => $role_id ) {\n\n if( isset( $changed_role_caps[$role_id] ) ) {\n\n if( $user_roles['last_update'] < $changed_role_caps[$role_id]['time'] ) {\n\n //session set\n $this->user = Auth::user()->load('roles');\n\n $caps = [];\n $roles = [];\n\n if( count( $this->user->roles ) ) {\n foreach ( $this->user->roles as $k => $role_array ) {\n $caps = array_merge( $caps , json_decode($this->user->roles[$k]->caps, true) );\n $roles[] = $this->user->roles[$k]->id;\n }\n }\n\n session()->put( 'caps', $caps );\n session()->put( 'user_roles', array(\n 'role_ids' => $roles,\n 'last_update' => strtotime(date('d-m-Y'))\n ) );\n // session set ends\n break;\n }\n\n }\n\n }\n }\n }\n return $next($request);\n }", "public function controlSession(){\n $session = $_SESSION['wifiGuardSharingEmail'];\n $sessionID = $_SESSION[\"wifiGuardSharingID\"];\n $uri = $_SERVER['REQUEST_URI'];\n \n if(!empty($session) && !empty($sessionID)){\n $result = dibi::query('SELECT sessionID\n FROM [user]\n WHERE [email] = %s', $session, 'LIMIT 1');\n $databaseSessionID = $result->fetchSingle();\n \n //if user is in index.php with valid session\n if (preg_match(\"/index.php/\",$uri) && $databaseSessionID===$sessionID){\n parent::redirection(\"app.php?page=showrecord\");\n }\n //if user try load app.php with invalid session\n elseif (preg_match(\"/app.php/\",$uri) && $databaseSessionID!==$sessionID){\n parent::redirection(\"index.php\");\n }\n } \n //if user try load app.php without session\n elseif(preg_match(\"/app.php/\",$uri)){\n parent::redirection(\"index.php\");\n }\n }", "public function storeSession() {}", "protected function continueSession()\n {\n if($this->isForwardedSession()) {\n return $this->forwardSession($this->metadata->forwardToSessionId);\n }\n if($this->needsIdRegen()) {\n return $this->regenerateId();\n }\n $this->metadata->sessionStartCount++;\n $this->writeMetadata();\n return true;\n }", "public function storeSessionData() {}", "public function storeSessionData() {}", "public function getResumeContextResponse();", "function login_process_with_previous_sessions() {\r\n\r\n\t\t$userId = $this->session->userdata('userId');\r\n\r\n\t\tif ( ! empty($userId)) {\r\n\r\n\t\t\tswitch ($this->get_login_mode($userId)) :\r\n\r\n\t\t\t\tcase 'auto-login' :\r\n\r\n\t\t\t\t\t$param = \"update_record\";\r\n\r\n\t\t\t\t\t$this->login_process($userId, $param, $this->accessName, $this->accessTo);\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'lockscreen' :\r\n\r\n\t\t\t\t\tredirect('lockscreen/user_id/' . $userId, 'location');\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tendswitch;\r\n\r\n\t\t}\r\n\r\n\t\t/* \r\n\t\t\tNote: There is no process if no previous sessions or sign-in mode\r\n\t\t*/\r\n\r\n\t}", "private function resyncSessionIfNecessary() {\n if ($this->isLoggedIn()) {\n // the following session field may not have been initialized for sessions that had already existed before the introduction of this feature\n if (!isset($_SESSION[self::SESSION_FIELD_LAST_RESYNC])) {\n $_SESSION[self::SESSION_FIELD_LAST_RESYNC] = 0;\n }\n\n // if it's time for resynchronization\n if (($_SESSION[self::SESSION_FIELD_LAST_RESYNC] + $this->sessionResyncInterval) <= \\time()) {\n // fetch the authoritative data from the database again\n $authoritativeData = $this->CI->db\n ->query('SELECT email, username, status, roles_mask, force_logout\n FROM ' . $this->makeTableName('users')\n . ' WHERE id = ?',\n [ $this->getUserId() ]\n )\n ->row_array();\n\n // if the user's data has been found\n if (!empty($authoritativeData)) {\n // the following session field may not have been initialized for sessions that had already existed before the introduction of this feature\n if (!isset($_SESSION[self::SESSION_FIELD_FORCE_LOGOUT])) {\n $_SESSION[self::SESSION_FIELD_FORCE_LOGOUT] = 0;\n }\n\n // if the counter that keeps track of forced logouts has been incremented\n if ($authoritativeData['force_logout'] > $_SESSION[self::SESSION_FIELD_FORCE_LOGOUT]) {\n // the user must be signed out\n $this->logOut();\n }\n // if the counter that keeps track of forced logouts has remained unchanged\n else {\n // the session data needs to be updated\n $_SESSION[self::SESSION_FIELD_EMAIL] = $authoritativeData['email'];\n $_SESSION[self::SESSION_FIELD_USERNAME] = $authoritativeData['username'];\n $_SESSION[self::SESSION_FIELD_STATUS] = (int) $authoritativeData['status'];\n $_SESSION[self::SESSION_FIELD_ROLES] = (int) $authoritativeData['roles_mask'];\n\n // remember that we've just performed the required resynchronization\n $_SESSION[self::SESSION_FIELD_LAST_RESYNC] = \\time();\n }\n }\n // if no data has been found for the user\n else {\n // their account may have been deleted so they should be signed out\n $this->logOut();\n }\n }\n }\n }", "protected abstract function loadSessionData();", "abstract public function resetSession();", "abstract function updateSessionStateFinish($id);", "public function load()\n {\n if ($this->isLoaded()) {\n return;\n }\n \n // can't be loaded if the session has started\n if (! $this->isStarted()) {\n // not possible for anything to be loaded, then\n $this->unload();\n return;\n }\n \n // set up the value store.\n if (empty($_SESSION[$this->_segment])) {\n $_SESSION[$this->_segment] = array();\n }\n $this->_store =& $_SESSION[$this->_segment];\n \n // set up the flash store\n if (empty($_SESSION['Solar_Session']['flash'][$this->_segment])) {\n $_SESSION['Solar_Session']['flash'][$this->_segment] = array();\n }\n $this->_flash =& $_SESSION['Solar_Session']['flash'][$this->_segment];\n \n // done!\n $this->_is_loaded = true;\n }", "protected function checkSessionLifetime() {}", "public static function billingResumed($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('billingResumed', $callback);\n }", "public function resume($id)\n {\n return $this->sendrequest('resume', $id);\n }", "public function isResumed()\n {\n return $this->resumed;\n }", "public static function resumeById(int $id, mixed ...$data): mixed;", "function on_session_end() {\n}", "private function _sess_run() {\n\t\t// session\n\t\tini_set('session.save_handler', $this->sess_save_handler);\n\t\t$path = array();\n\t\tforeach ($this->sess_server as $server) {\n\t\t\tif (isset($server['host']) && isset($server['port'])) {\n\t\t\t\t$path[] = \"tcp://{$server['host']}:{$server['port']}?\" . http_build_query(isset($server['params']) ? $server['params'] : array());\n\t\t\t}\n\t\t}\n\t\tif (empty($path)) {\n\t\t\tshow_error('Session save_path is empty');\n\t\t}\n\t\tini_set('session.save_path', implode(',', $path));\n\n\t\tini_set('session.gc_maxlifetime', $this->sess_expiration);\t// 过期时间\n\t\t// cookie\n\t\tini_set('session.cookie_secure', 0);\t\t// 0 http:// 1 https://\n\t\tini_set('session.cookie_httponly', 1);\t\t// 不让JS读取session的cookie\n\t\tsession_name($this->sess_cookie_name);\n\n\t\tsession_start();\n\t\t// delete old flashdata (from last request)\n\t\t$this->_flashdata_sweep();\n\t\t// mark all new flashdata as old (data will be deleted before next request)\n\t\t$this->_flashdata_mark();\n\t}", "public function save()\n {\n // Session should be started\n if ($this->_pStorage->status() === PHP_SESSION_ACTIVE) {\n // Get and save current UID\n $this->_pStorage->setOffset(self::UID, $this->_iCRC, APPLICATION_NAME);\n } else {\n throw new \\Foundation\\Exception\\BadMethodCallException('The session was not successfully started.');\n }\n }", "abstract protected function doSuspend();", "private function do_restore($restore_code) {\n\t\t$serial = $this->plain_serial();\n\t\t$challenge = $this->send(self::$restore_uri, self::RESTORE_CHALLENGE_SIZE, $serial);\n\n\t\t$restore_code = Authenticator_Crypto::restore_code_from_char(strtoupper($restore_code));\n\t\t$mac = hash_hmac('sha1', $serial.$challenge, $restore_code, true);\n\t\t$enc_key = $this->create_key(20);\n\t\t$data = $serial.$this->encrypt($mac.$enc_key);\n\t\t$response = $this->send(self::$restore_validate_uri, self::RESTORE_VALIDATE_SIZE, $data);\n\n\t\t$data = $this->decrypt($response, $enc_key);\n\t\t$this->_set_secret($data);\n\t\t$this->synchronize();\n\t}", "function session_abort()\n{\n}", "public function handle($request, Closure $next) {\n\n $session = UserSession::whereId($request->session()->get('user_session'))->first();\n\n //Información del usuario que inicio sesión\n $user = Auth::user();\n\n if ($session->state_id === 10) {\n\n Auth::logout();\n\n session()->forget('user_session');\n\n return redirect()->route('quick.login.from')\n ->withErrors(['email' => trans('quick::text.another.login')])\n ->withInput(['email' => $user->email]);\n\n }\n\n\n // Configuraciones del usuario que inicio sesión\n $setting = UserSetting::whereUserId($user->id)->first();\n\n // Sesiones activas del usuario que inicio sesión\n $sessions = UserSession::whereUserId($user->id)\n ->whereMediumId(11)\n ->whereStateId(9)\n ->orderBy('id', 'desc')\n ->get();\n\n // Validamos que las sesiones activas no sean mayores a las sesiones permitida a la configuración del usuario\n if (count($sessions) > $setting->number_of_active_sessions_in_web) {\n\n foreach ($sessions as $index => $session) {\n\n if ($index !== 0) {\n $session->state_id = 10;\n $session->update();\n }\n\n }\n\n }\n\n\n return $next($request);\n }", "public function getSettingsBlockSessionResume(): ?bool {\n $val = $this->getBackingStore()->get('settingsBlockSessionResume');\n if (is_null($val) || is_bool($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'settingsBlockSessionResume'\");\n }", "protected function init()\n {\n // sessions that are new, written to or that have been destroyed should never be initialized\n if ($this->tokenExpiry === null || $this->writeMode === true || $this->destroyed === true) {\n // unexpected error that shouldn't occur\n throw new Exception(['translate' => false]); // @codeCoverageIgnore\n }\n\n // make sure that the session exists\n if ($this->sessions->store()->exists($this->tokenExpiry, $this->tokenId) !== true) {\n throw new NotFoundException([\n 'key' => 'session.notFound',\n 'data' => ['token' => $this->token()],\n 'fallback' => 'Session \"' . $this->token() . '\" does not exist',\n 'translate' => false,\n 'httpCode' => 404\n ]);\n }\n\n // get the session data from the store\n $data = $this->sessions->store()->get($this->tokenExpiry, $this->tokenId);\n\n // verify HMAC\n // skip if we don't have the key (only the case for moved sessions)\n $hmac = Str::before($data, \"\\n\");\n $data = trim(Str::after($data, \"\\n\"));\n if ($this->tokenKey !== null && hash_equals(hash_hmac('sha256', $data, $this->tokenKey), $hmac) !== true) {\n throw new LogicException([\n 'key' => 'session.invalid',\n 'data' => ['token' => $this->token()],\n 'fallback' => 'Session \"' . $this->token() . '\" is invalid',\n 'translate' => false,\n 'httpCode' => 500\n ]);\n }\n\n // decode the serialized data\n try {\n $data = unserialize($data);\n } catch (Throwable $e) {\n throw new LogicException([\n 'key' => 'session.invalid',\n 'data' => ['token' => $this->token()],\n 'fallback' => 'Session \"' . $this->token() . '\" is invalid',\n 'translate' => false,\n 'httpCode' => 500,\n 'previous' => $e\n ]);\n }\n\n // verify start and expiry time\n if (time() < $data['startTime'] || time() > $data['expiryTime']) {\n throw new LogicException([\n 'key' => 'session.invalid',\n 'data' => ['token' => $this->token()],\n 'fallback' => 'Session \"' . $this->token() . '\" is invalid',\n 'translate' => false,\n 'httpCode' => 500\n ]);\n }\n\n // follow to the new session if there is one\n if (isset($data['newSession'])) {\n $this->parseToken($data['newSession'], true);\n $this->init();\n return;\n }\n\n // verify timeout\n if (is_int($data['timeout'])) {\n if (time() - $data['lastActivity'] > $data['timeout']) {\n throw new LogicException([\n 'key' => 'session.invalid',\n 'data' => ['token' => $this->token()],\n 'fallback' => 'Session \"' . $this->token() . '\" is invalid',\n 'translate' => false,\n 'httpCode' => 500\n ]);\n }\n\n // set a new activity timestamp, but only every few minutes for better performance\n // don't do this if another call to init() is already doing it to prevent endless loops;\n // also don't do this for read-only sessions\n if ($this->updatingLastActivity === false && $this->tokenKey !== null && time() - $data['lastActivity'] > $data['timeout'] / 15) {\n $this->updatingLastActivity = true;\n $this->prepareForWriting();\n\n // the remaining init steps have been done by prepareForWriting()\n $this->lastActivity = time();\n $this->updatingLastActivity = false;\n return;\n }\n }\n\n // (re)initialize all instance variables\n $this->startTime = $data['startTime'];\n $this->expiryTime = $data['expiryTime'];\n $this->duration = $data['duration'];\n $this->timeout = $data['timeout'];\n $this->lastActivity = $data['lastActivity'];\n $this->renewable = $data['renewable'];\n\n // reload data into existing object to avoid breaking memory references\n if (is_a($this->data, 'Kirby\\Session\\SessionData')) {\n $this->data()->reload($data['data']);\n } else {\n $this->data = new SessionData($this, $data['data']);\n }\n }", "public function restart()\r\n\t{\r\n\t\tif ($this->_destroyed === FALSE)\r\n\t\t{\r\n\t\t\t// Wipe out the current session.\r\n\t\t\t$this->destroy();\r\n\t\t}\r\n\t\r\n\t\t// Allow the new session to be saved\r\n\t\t$this->_destroyed = FALSE;\r\n\t\r\n\t\treturn $this->_restart();\r\n\t}", "public function resetSession() {}", "public function handle()\n {\n Session::whereNull('user_id')->delete();\n }", "private function end() {\n if ($this->isSessionStarted()) {\n session_commit();\n $this->clear();\n }\n }", "function resume(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)\n\t{\n\t\t$displayobject->update_basic('displaymodules','FALSE');\n\t\t$t_db_type\t\t= $sessionobject->get_session_var('targetdatabasetype');\n\t\t$t_tb_prefix\t= $sessionobject->get_session_var('targettableprefix');\n\t\t$s_db_type\t\t= $sessionobject->get_session_var('sourcedatabasetype');\n\t\t$s_tb_prefix\t= $sessionobject->get_session_var('sourcetableprefix');\n\n\t\t// Per page vars\n\t\t$start_at\t\t= $sessionobject->get_session_var('startat');\n\t\t$per_page\t\t= $sessionobject->get_session_var('perpage');\n\t\t$class_num\t\t= substr(get_class($this) , -3);\n\t\t$idcache \t\t= new ImpExCache($Db_target, $t_db_type, $t_tb_prefix);\n\t\t$ImpExData\t\t= new ImpExData($Db_target, $sessionobject, 'attachment');\n\t\t$dir \t\t\t= $sessionobject->get_session_var('attachmentsfolder');\n\t\t\n\t\t// Start the timing\n\t\tif(!$sessionobject->get_session_var(\"{$class_num}_start\"))\n\t\t{\n\t\t\t$sessionobject->timing($class_num , 'start' ,$sessionobject->get_session_var('autosubmit'));\n\t\t}\n\n\t\t// Get an array data\n\t\tif ($s_db_type == 'mysql')\n\t\t{\n\t\t\t$data_array = $this->get_source_data($Db_source, $s_db_type, \"{$s_tb_prefix}attachments\", 'attach_id', 0, $start_at, $per_page);\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$data_array = $this->get_phpbb3_attach($Db_source, $s_db_type, $s_tb_prefix, $start_at, $per_page);\n\t\t}\t\t\n\t\t\n\n\t\t$displayobject->print_per_page_pass($data_array['count'], $displayobject->phrases['attachments'], $start_at);\n\n\t\tforeach ($data_array['data'] as $import_id => $data)\n\t\t{\n\t\t\t\t$try = (phpversion() < '5' ? $ImpExData : clone($ImpExData));\n\n\t\t\t\tif(!is_file($dir . '/' . $data['physical_filename']))\n\t\t\t\t{\n\t\t\t\t\t$displayobject->display_now(\"<br /><b>{$displayobject->phrases['source_file_not']} </b> :: {$data['real_filename']}\");\n\t\t\t\t\t$sessionobject->add_error($import_id, $displayobject->phrases['attachment_not_imported'], $data['real_filename'] . ' - ' . $displayobject->phrases['attachment_not_imported_rem_1']);\n\t\t\t\t\t$sessionobject->set_session_var($class_num . '_objects_failed',$sessionobject->get_session_var($class_num. '_objects_failed') + 1 );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$file = $this->vb_file_get_contents($dir . '/' . $data['physical_filename']);\n\n\t\t\t\t// Mandatory\n\t\t\t\t$try->set_value('mandatory', 'filename',\t\t\t\taddslashes($data['real_filename']));\n\t\t\t\t$try->set_value('mandatory', 'filedata',\t\t\t\t$file);\n\t\t\t\t$try->set_value('mandatory', 'importattachmentid',\t\t$import_id);\n\n\t\t\t\t// Non Mandatory\n\t\t\t\t$try->set_value('nonmandatory', 'userid',\t\t\t\t$idcache->get_id('user', $data['poster_id']));\n\t\t\t\t$try->set_value('nonmandatory', 'dateline',\t\t\t\t$data['filetime']);\n\t\t\t\t$try->set_value('nonmandatory', 'visible',\t\t\t\t'1');\n\t\t\t\t$try->set_value('nonmandatory', 'counter',\t\t\t\t$data['download_count']);\n\t\t\t\t$try->set_value('nonmandatory', 'filesize',\t\t\t\t$data['filesize']);\n\t\t\t\t$try->set_value('nonmandatory', 'postid',\t\t\t\t$data['post_msg_id']);\n\t\t\t\t$try->set_value('nonmandatory', 'filehash',\t\t\t\tmd5($file));\n\n\t\t\t\tif (!$file)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t// Check if object is valid\n\t\t\tif($try->is_valid())\n\t\t\t{\n\t\t\t\tif($try->import_attachment($Db_target, $t_db_type, $t_tb_prefix))\n\t\t\t\t{\n\t\t\t\t\t$displayobject->display_now('<br /><span class=\"isucc\"><b>' . $try->how_complete() . '%</b></span> ' . $displayobject->phrases['attachment'] . ' -> ' . $data['real_filename']);\n\t\t\t\t\t$sessionobject->add_session_var(\"{$class_num}_objects_done\",intval($sessionobject->get_session_var(\"{$class_num}_objects_done\")) + 1 );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sessionobject->add_session_var(\"{$class_num}_objects_failed\",intval($sessionobject->get_session_var(\"{$class_num}_objects_failed\")) + 1 );\n\t\t\t\t\t$sessionobject->add_error($Db_target, 'warning', $class_num, $import_id, $displayobject->phrases['attachment_import_error'], $displayobject->phrases['attachment_error_rem']);\n\t\t\t\t\t$displayobject->display_now(\"<br />{$displayobject->phrases['failed']} :: {$displayobject->phrases['attachment_not_imported']}\");\n\t\t\t\t}// $try->import_attachment\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sessionobject->add_session_var(\"{$class_num}_objects_failed\",intval($sessionobject->get_session_var(\"{$class_num}_objects_failed\")) + 1 );\n\t\t\t\t$sessionobject->add_error($Db_target, 'invalid', $class_num, $import_id, $displayobject->phrases['invalid_object'] . ' ' . $try->_failedon, $displayobject->phrases['invalid_object_rem']);\n\t\t\t\t$displayobject->display_now(\"<br />{$displayobject->phrases['invalid_object']}\" . $try->_failedon);\n\t\t\t}// is_valid\n\t\t\tunset($try);\n\t\t}// End foreach\n\n\t\t// Check for page end\n\t\tif ($data_array['count'] == 0 OR $data_array['count'] < $per_page)\n\t\t{\n\t\t\t$sessionobject->timing($class_num, 'stop', $sessionobject->get_session_var('autosubmit'));\n\t\t\t$sessionobject->remove_session_var(\"{$class_num}_start\");\n\n\t\t\t$displayobject->update_html($displayobject->module_finished($this->_modulestring,\n\t\t\t\t$sessionobject->return_stats($class_num, '_time_taken'),\n\t\t\t\t$sessionobject->return_stats($class_num, '_objects_done'),\n\t\t\t\t$sessionobject->return_stats($class_num, '_objects_failed')\n\t\t\t));\n\n\t\t\t$sessionobject->set_session_var($class_num , 'FINISHED');\n\t\t\t$sessionobject->set_session_var('module', '000');\n\t\t\t$sessionobject->set_session_var('autosubmit', '0');\n\t\t}\n\n\t\t$sessionobject->set_session_var('startat', $data_array['lastid']);\n\t\t$displayobject->update_html($displayobject->print_redirect('index.php',$sessionobject->get_session_var('pagespeed')));\n\t}", "public function restore_cart() {\n\t\t// delete current cart\n\t\tWC()->cart->empty_cart( true );\n\n\t\t// update user meta with saved persistent\n\t\t$saved_cart = get_user_meta( $this->userId, '_ebanx_persistent_cart', true );\n\n\t\t// then reload cart\n\t\tWC()->session->set( 'cart', $saved_cart );\n\t\tWC()->cart->get_cart_from_session();\n\t}", "public function restored(Media $media)\n {\n //\n }", "public static function reloadSession(){\n $auth = App_Auth::getInstance();\n\n $userModel = new FrontendUser();\n $user = $userModel->findById(self::getSession()->id);\n $user->groups = $user->findManyToManyRowset('Group', 'FrontendUserGroup');\n $user->group = $user->groups[0];\n\n $session = new stdClass();\n foreach($user as $k => $v){\n $session->{$k} = $v;\n }\n $session->group->name = $user->get('group')->name;\n\n $auth->getStorage()->write($session);\n }", "public static function sessionReadHandler();", "function suspend(): void\n {\n signal(fn (Closure $resume): mixed => $resume());\n }", "public function sessions_end()\n\t{\n\t\t// nothing to see here\n\t}", "public function read($id) \r\n {\r\n echo __METHOD__,'<BR>'; \r\n echo 'id = ',$id,'<br>'; \r\n echo 'session_id = ',session_id(),'<br>'; \r\n // $sessinfo = DB::table('session')->where('session_id',\"'$id'\")->first();\r\n // $sessinfo = Session::where('session_id',$id)->get();\r\n $rs =R::getAll('select * from session where session_id = :id',array(':id'=>$id));\r\n // var_dump($rs);\r\n // var_dump($sessinfo->session_data);\r\n // $queries = DB::getQueryLog();\r\n // print_r($queries);\r\n // return $sessinfo->session_data;\r\n return $rs[0]['session_data'];\r\n exit();\r\n echo 'afterexit()<br>';\r\n // global $SESS_DBH, $SESS_LIFE;\r\n // // var_dump($SESS_DBH);\r\n // $qry = \"select session_data from sessions where session_id = '$key' \";\r\n // $qid = mysql_query($qry, $SESS_DBH);\r\n // // var_dump($qid);\r\n // if (list ($value) = mysql_fetch_row($qid)) {\r\n // return $value;\r\n // }\r\n // return false;\r\n\r\n $sess_file = $this->_path.$this->_name.\"_$id\";\r\n if (!file_exists($sess_file)) {\r\n // echo 'read false<br>';\r\n return false;\r\n } \r\n // echo 'session file = ',$sess_file,'<br>';\r\n $data = file_get_contents($sess_file);\r\n // var_dump($data);\r\n list($hmac, $iv, $encrypted)= explode(':',$data);\r\n $iv = base64_decode($iv);\r\n $encrypted = base64_decode($encrypted);\r\n $newHmac = hash_hmac('sha256', $iv . $this->_algo . $encrypted, $this->_auth);\r\n if ($hmac !== $newHmac) {\r\n return false;\r\n }\r\n $decrypt = mcrypt_decrypt(\r\n $this->_algo,\r\n $this->_key,\r\n $encrypted,\r\n MCRYPT_MODE_CBC,\r\n $iv\r\n );\r\n return rtrim($decrypt, \"\\0\"); \r\n // echo 'data =';\r\n // var_dump($data);\r\n // return $data;\r\n }", "function getRespectStoragePage() ;", "public function onKernelTerminate()\n {\n $this->session = null;\n }", "public function handle($request, Closure $next) {\n\n if(! session('lastActivityTime'))\n $this->session->put('lastActivityTime', time());\n elseif(time() - $this->session->get('lastActivityTime') > $this->timeout){\n auth()->logout();\n return message('You had not activity in '.$this->timeout/60 .' minutes ago.', 'warning', 'login')->withInput(compact('email'))->withCookie($cookie);\n }\n\n// $bag = Session::getMetadataBag();\n//\n// $max = config('session.lifetime') * 60; // min to hours conversion\n//\n// if (($bag && $max < (time() - $bag->getLastUsed()))) {\n//\n// $request->session()->flush(); // remove all the session data\n//\n// Auth::logout(); // logout user\n//\n// }\n\n return $next($request);\n }", "public function fetchSessionData() {}", "public function restart($transientKey = '') {\n $this->checkAccess();\n if (!Gdn::session()->validateTransientKey($transientKey) && !Gdn::request()->isAuthenticatedPostBack()) {\n throw new Gdn_UserException('The CSRF token is invalid.', 403);\n }\n\n // Delete the individual table files.\n $imp = new ImportModel();\n try {\n $imp->loadState();\n $imp->deleteFiles();\n } catch (Exception $ex) {\n // Suppress exceptions from bubbling up.\n }\n $imp->deleteState();\n\n redirectTo(strtolower($this->Application).'/import');\n }", "public static function sessionRestart() {\n // the version for php7 should work for php5 too, but we let the working code untouched - maybe cleanup later\n if (PHP_MAJOR_VERSION < 7) {\n ini_set('session.use_only_cookies', false);\n ini_set('session.use_cookies', false);\n \t\tini_set('session.use_trans_sid', false);\n \t\tini_set('session.cache_limiter', null);\n \t\tsession_start();\n }\n else { // php >= 7\n @session_start();\n \t\tif (session_status() != PHP_SESSION_ACTIVE) { // == PHP_SESSION_NONE ???\n \t\t\tsession_start();\n \t\t}\n } // eo php7\n\t}", "public function resume_order_tracking() {\n global $wp, $wpdb;\n \n $order_id = isset( $wp->query_vars['order-received'] ) ? intval( $wp->query_vars['order-received'] ) : 0;\n if ($order_id) {\n WC_Gokeep_JS::get_instance()->resume_order( WC()->order_factory->get_order($order_id) );\n }\n }", "public function restored(Subscription $subscription)\n {\n //\n }", "public function next()\n {\n $this->valid = (false !== next($this->sessionData)); \n }", "public function handle($request, Closure $next)\n {\n \n $guestid = session('guestid');\n $expired = session('expired');\n $now = time();\n if(empty($guestid) || $now > $expired){\n session()->flush();\n return redirect('guest');\n }\n return $next($request);\n }", "protected function load()\n {\n $_SESSION[$this->name] = $_SESSION[$this->name]?? [];\n $_SESSION[SessionBlockInterface::FLASH_KEY] = $_SESSION[SessionBlockInterface::FLASH_KEY] ?? [];\n }", "function isResumeRequested()\n\t{\n\t\t$resp = $this->readDataFromServer();\n\t\tif(trim($resp) == \"\")\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$parts_from_spaces = explode(\" \", $resp);\n\t\t\tif(trim($parts_from_spaces[4]) == \"RESUME\")\n\t\t\t{\n\t\t\t\t$resume_position = trim($parts_from_spaces[7], \" \\x01\\r\\n\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\treturn $resume_position;\n\t}", "public function restore(User $user, Media $media)\n {\n //\n }", "public function renew()\n {\n if ($this->renewable() !== true) {\n throw new LogicException([\n 'key' => 'session.notRenewable',\n 'fallback' => 'Cannot renew a session that is not renewable, call $session->renewable(true) first',\n 'translate' => false,\n ]);\n }\n\n $this->prepareForWriting();\n $this->expiryTime = time() + $this->duration();\n $this->regenerateTokenIfNotNew();\n }", "public function restored(Job $job)\n {\n //\n }", "public function handle_exit_recovery_mode()\n {\n }", "protected function storeBeforeCartUrl()\n {\n if (!Str::contains($url = URL::previous(), $this->excludedUrl) & Str::contains($url, url('/'))) {\n session(['beforeCartUrl' => $url]);\n }\n }", "protected function forgetOldSessionData()\n {\n if (session()->has($this->sessionKey)) {\n session()->forget($this->sessionKey);\n }\n }", "public static function setAsSessionHandler()\n {\n session_set_save_handler(array('Eb_MemcacheSession', 'sessionOpen'),\n array('Eb_MemcacheSession', 'sessionClose'),\n array('Eb_MemcacheSession', 'sessionRead'),\n array('Eb_MemcacheSession', 'sessionWrite'),\n array('Eb_MemcacheSession', 'sessionDestroyer'),\n array('Eb_MemcacheSession', 'sessionGc'));\n }", "public function testResumeException()\n\t{\n\t\t// No Petri net set.\n\t\t$this->object->start();\n\t}", "private function onSession($result, $mail, $role) {\n if (intval($result)) {\n SSession::getInstance()->mail = $mail;\n SSession::getInstance()->role = $role;\n }\n }", "public function handle($request, Closure $next)\n {\n $request->session()->put('ttt', 'oooooooooooooooo');\n die(\"sdsds\");\n // Session::put('name', 'hayk');\n // Session:get('name');\n return $next($request);\n }", "protected function unlock_session() {\n \\core\\session\\manager::write_close();\n ignore_user_abort(true);\n }", "protected function getStorage()\n {\n return unserialize(Session::retrieve(__NAMESPACE__));\n }" ]
[ "0.6593769", "0.64541084", "0.63170624", "0.5898146", "0.5816854", "0.5702706", "0.5679089", "0.55064136", "0.54761916", "0.532542", "0.519935", "0.51822835", "0.5163038", "0.51530564", "0.5149109", "0.5094864", "0.5067312", "0.5043953", "0.5039106", "0.5039106", "0.49921083", "0.491338", "0.49121428", "0.49016637", "0.48968586", "0.48386553", "0.48371372", "0.48092327", "0.47898883", "0.47300792", "0.4690595", "0.46817255", "0.46657857", "0.4635071", "0.4625191", "0.46122333", "0.45998105", "0.45851007", "0.45775145", "0.45718458", "0.45654967", "0.4563525", "0.4562279", "0.4558032", "0.45542744", "0.45397156", "0.45216125", "0.4519419", "0.4510303", "0.45046422", "0.45022926", "0.45019686", "0.4498092", "0.44937202", "0.44932047", "0.4482531", "0.44743028", "0.44725138", "0.4469604", "0.44655755", "0.4463418", "0.4457262", "0.44541782", "0.4432687", "0.44323233", "0.44316462", "0.44299167", "0.44273838", "0.44260427", "0.4421947", "0.4421181", "0.44083306", "0.44037318", "0.44020715", "0.4395181", "0.43920696", "0.43902084", "0.4387757", "0.4374112", "0.4374094", "0.43586248", "0.4355932", "0.43434408", "0.43417764", "0.43371183", "0.43367028", "0.4332171", "0.4319623", "0.4287458", "0.42857045", "0.42856815", "0.42855397", "0.42800203", "0.42798725", "0.4269432", "0.4257156", "0.42543587", "0.42502874", "0.42484188", "0.42471272" ]
0.5409161
9
Check the credential input for completeness.
protected function checkInput($input) { if (empty($input['username'])) { throw new Exception\UsernameMissing; } if (empty($input['password'])) { throw new Exception\PasswordMissing; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function validCredentials(){\n $valid_credentials = !empty($this->consumerKey);\n $valid_credentials = ($valid_credentials && !empty($this->consumerSecret));\n $valid_credentials = ($valid_credentials && $this->consumerKey === variable_get('ebs_consumer_key', '')); \n $valid_credentials = ($valid_credentials && $this->consumerSecret === variable_get('ebs_consumer_secret', ''));\n \n return $valid_credentials;\n }", "public static function checkCredentials()\n {\n if (null === self::username() || null === self::password()) {\n echo self::errorMessage();\n die(1);\n }\n\n return true;\n }", "function validateApiCredentials() { \n if( $this->options['api_type'] == \"\" || $this->options['api_path'] == \"\" ) {\n $this->error_handler( 'Repository url not valid' );\n } elseif($this->options['username'] == \"\") {\n $this->error_handler( 'Username Required' );\n } else if($this->options['password'] == \"\") {\n $this->error_handler( 'Password Required' );\n }\n }", "private static function has_credentials() {\r\n\t\t\t$credentials = self::get_credentials();\r\n\r\n\t\t\treturn is_array($credentials)\r\n\t\t\t\t\t&& isset($credentials['api-key'])\r\n\t\t\t\t\t&& isset($credentials['email'])\r\n\t\t\t\t\t&& isset($credentials['id'])\r\n\t\t\t\t\t&& !empty($credentials['api-key'])\r\n\t\t\t\t\t&& !empty($credentials['email'])\r\n\t\t\t\t\t&& !empty($credentials['id']);\r\n\t\t}", "protected function checkCredentials() {\n $client = \\Drupal::service('akamai.edgegridclient');\n if ($client->isAuthorized()) {\n drupal_set_message('Authenticated to Akamai.');\n }\n else {\n drupal_set_message('Akamai authentication failed.', 'error');\n }\n }", "private function isCorrectCredentials ()\n {\n\n try {\n $this->httpClient->request (\"GET\", \"http://livescore-api.com/api-client/users/pair.json?key=\" . $this->apiKey . \"&secret=\" . $this->apiSecret);\n } catch (ClientException $e) {\n $response = json_decode ((string) $e->getResponse ()->getBody (), true);\n\n throw new WrongAPICredentialsException($response['error'], $e->getResponse ()->getStatusCode ());\n }\n }", "private function checkCredentials(array $args = []): bool\n {\n if (empty($args['credentials'])) {\n throw new VisacheckException('You did not provide the Visacheck client credentials in the configuration.', $args);\n }\n $id = data_get($args, 'credentials.id', null);\n $secret = data_get($args, 'credentials.secret', null);\n if (empty($id)) {\n throw new VisacheckException('The client \"id\" key is absent in the credentials configuration.', $args);\n }\n if (empty($secret)) {\n throw new VisacheckException('The client \"secret\" key is absent in the credentials configuration.', $args);\n }\n return true;\n }", "private function _validateCredentials($credentials){\n if(empty($credentials->username) || empty($credentials->password)) return false;\n $admin = $this->_getPassword($credentials->username);\n if(empty($admin)) return false;\n $decodedPassword = $this->encryption->decrypt($admin->password);\n return $credentials->password == $decodedPassword;\n }", "function is_validated($username = null, $password = null){\n return validate_cred($username, $password);\n}", "public function checkAuthentication() {}", "protected function _validateAccount() {\n\t\tif(!check($this->_username)) return;\n\t\tif(!check($this->_password)) return;\n\t\t$data = array(\n\t\t\t'username' => $this->_username,\n\t\t\t'password' => $this->_password\n\t\t);\n\t\tif($this->_md5Enabled) {\n\t\t\t$query = \"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_USERNM_.\" = :username AND \"._CLMN_PASSWD_.\" = [dbo].[fn_md5](:password, :username)\";\n\t\t} else {\n\t\t\t$query = \"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_USERNM_.\" = :username AND \"._CLMN_PASSWD_.\" = :password\";\n\t\t}\n\t\t\n\t\t$result = $this->db->queryFetchSingle($query, $data);\n\t\tif(!is_array($result)) return;\n\t\t\n\t\treturn true;\n\t}", "public function read_credentials(){\n $query='SELECT * FROM '.$this->table.' WHERE name=? and password=?';\n\n $stmt = $this->conn->prepare($query);\n\n \n $stmt->bindparam(1,$this->name);\n $stmt->bindparam(2,$this->password);\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->name=$row['name'];\n $this->email=$row['email'];\n $this->status=$row['status'];\n\n if($stmt->execute()) {\n return true;\n }\n \n // Print error \n printf(\"Error: %s.\\n\", \"invalid user\");\n \n return false;\n \n \n }", "public function checkAuthentication()\n {\n if (!$this->hash) {\n throw new OnePilotException('no-verification-key', 403);\n }\n\n if (!$this->private_key) {\n throw new OnePilotException('no-private-key-configured', 403);\n }\n\n $hash = hash_hmac('sha256', $this->stamp, $this->private_key);\n\n if (!$this->checkKey($hash, $this->hash)) {\n throw new OnePilotException('bad-authentification', 403);\n }\n\n $this->validateTimestamp();\n\n return true;\n }", "public function validate(array $credentials = []);", "function valid_production_credentials($api_url, $api_username, $api_password) {\n\tif (!empty($api_url) \n\t\t\t&& !empty($api_username) \n\t\t\t&& !empty($api_password)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "protected function verify_credentials() {\r\n\r\n\t\t$this->tmhOAuth->config['user_token']\t= $this->conf->TwitterOAuthToken;\r\n\t\t$this->tmhOAuth->config['user_secret']\t= $this->conf->TwitterOAuthSecret;\r\n\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'GET', $this->tmhOAuth->url('1.1/account/verify_credentials')\r\n\t\t);\r\n\r\n\t\t// print_r($this->tmhOAuth->response);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$resp = json_decode($this->tmhOAuth->response['response']);\r\n\t\t\t$this->addMsg(\r\n\t\t\t\t'<p>Authourised as ' . $resp->screen_name . '</p>' .\r\n\t\t\t\t'<p>The access level of this token is: ' . $this->tmhOAuth->response['headers']['x-access-level'] . '</p>'\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}", "function validateCredential(){\r\n\r\n\t\t$avsData = array('Street' => '1 Main St', 'City' => 'San Jose', 'PostalCode' => '95131');\r\n\t\t$cardData = array('cardowner' => 'Jane Doe', 'cardtype' => 'Visa', 'pan' => '4012888812348882', 'expire' => '1218', 'cvv' => '123');\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$obj_transaction = new VelocityProcessor( $this->applicationprofileid, $this->merchantprofileid, $this->workflowid, $this->isTestAccount, $this->identitytoken, null);\r\n\t\t\treturn array('status'=>1,'message'=>'Authentication Validated Successfully.');\r\n\t\t\t/* try {\r\n\t\t\t\t$response = $obj_transaction->verify(array(\r\n\t\t\t\t\t\t'amount' => 1.00,\r\n\t\t\t\t\t\t'avsdata' => $avsData,\r\n\t\t\t\t\t\t'carddata' => $cardData,\r\n\t\t\t\t\t\t'entry_mode' => 'Keyed',\r\n\t\t\t\t\t\t'IndustryType' => $this->IndustryType,\r\n\t\t\t\t\t\t'Reference' => 'Ezneterp',\r\n\t\t\t\t\t\t'EmployeeId' => '11'\r\n\t\t\t\t));\r\n\t\t\t\t\r\n\t\t\t\tif (is_array($response) && isset($response['Status']) && $response['Status'] == 'Successful') \r\n\t\t\t\t\treturn array('status'=>1,'message'=>'Authentication Validated Successfully.');\r\n\t\t\t\telse\r\n\t\t\t\t\treturn array('status'=>0,'errors'=>$response);\r\n\t\t\t\t\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\treturn array('status'=>0,'errors'=>$e->getMessage());\r\n\t\t\t} */\r\n\t\t\t\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\tif(strcmp($e->getMessage(), 'An invalid security token was provided') == 0)\r\n\t\t\t\treturn array('status'=>0,'errors'=>'An invalid security token was provided');\r\n\t\t\telse\r\n\t\t\t\treturn array('status'=>0,'errors'=>$e->getMessage());\r\n\t\t}\r\n\t}", "public function isValid()\n {\n foreach ($this->repo as $repository) {\n /**\n * @var Repository $repository\n */\n $repository->needAuth();\n }\n }", "function check(){\n\t\tif(empty($this->PRIVATE_KEY)){throw new Exception(\"Private Key not set\", 2)}\n\n\t\t// Ensure we have all required data\n\t\t$this->auto_detect_fields();\n\n\t\t$request_url = sprintf(\"%s?secret=%s&response=%s&remoteip=%s\",\n\t\t\t$this->VERIFY_URL,\n\t\t\t$this->PRIVATE_KEY,\n\t\t\t$this->RESPONSE,\n\t\t\t$this->REMOTE_ADDRESS\n\t\t);\n\n\t\t//Do it!\n\t\tif($this->USE_CURL){\n\t\t\t// Use CURL\n\t\t\t$this->RESULT = $this->get_json_curl($request_url);\n\t\t}\n\t\telse {\n\t\t\t// Use Built-in PHP fopen() functions\n\t\t\t$this->RESULT = $this->get_json_fopen($request_url);\n\t\t}\n\t\t$this->RESULT = json_decode($this->RESULT, true);\n\t}", "function check_requirements()\n\t{\n\t\tif (!$this->obj_chart->verify_id())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested account (\". $this->id .\") does not exist - possibly the account has been deleted.\");\n\t\t\treturn 0;\n\t\t}\n\n\t\tunset($sql_obj);\n\n\n\t\t// check the lock status of the account\n\t\t$this->locked = $this->obj_chart->check_delete_lock();\n\n\t\treturn 1;\n\t}", "static function isCredentialsValidErrorMessageForJob( $jobId ) {\n\n if (substr(php_uname(), 0, 7) != \"Windows\") {\n $logDirectory = get_option( 'hbo_log_directory' );\n if( empty($logDirectory )) {\n throw new ValidationException( \"log_directory not specified\" );\n }\n\n $command = \"grep -q 'Current credentials not valid' $logDirectory/job-$jobId.txt\";\n $returnval = 0;\n $output = array();\n exec( $command, $output, $returnval );\n if ( $returnval == 0 ) {\n return true;\n }\n\n $command = \"grep -q 'Incorrect password' $logDirectory/job-$jobId.txt\";\n exec( $command, $output, $returnval );\n if ( $returnval == 0 ) {\n return true;\n }\n }\n return false;\n }", "public function attempt(Credentials $credentials): bool\n {\n }", "public function analisarCredito()\n {\n return false;\n }", "function getCredentialsAreValid($username, $password) {\r\n global $db;\r\n\r\n //phpAlert(\"building query string\");\r\n // Query String\r\n $query = \"SELECT * FROM system_user WHERE system_user_name = '$username';\";\r\n\r\n //phpAlert(\"query string is: \" . $query);\r\n \r\n try {\r\n $statement = $db->prepare($query);\r\n $statement->execute();\r\n $result = $statement->fetch();\r\n $statement->closeCursor();\r\n // If user doesn't exist, return false\r\n if (empty($result))\r\n return false;\r\n\r\n //phpAlert(\"Account exists, verifying password\");\r\n // Validate using password_verify()\r\n return (password_verify($password, $result['system_user_password']));\r\n } catch (PDOException $ex) {\r\n echo $ex->getMessage();\r\n exit;\r\n }\r\n}", "public function checkCredentials(string $email, string $password):bool;", "public function checkAuth();", "public function checkAuth();", "public function valid()\n {\n return $this->validateUsername()\n and $this->validatePassword()\n and $this->validateHost()\n and $this->validatePort()\n and $this->validatePath()\n and $this->validateQuery()\n and $this->validateFragment();\n }", "private function check_auth() {\n if (empty($this->user_id) || empty($this->privatekey)) {\n $this->send_error('AUTH_FAIL');\n exit;\n } elseif ($this->users_model->validate_privatekey($this->user_id, $this->privatekey)) {\n return true;\n }\n }", "protected function abortIfSetupIncorrectly()\n {\n if(! $this->username OR ! $this->password OR ! $this->clientCode OR ! $this->url) throw new ErplySyncException('Missing parameters', self::MISSING_PARAMETERS);\n }", "protected function checkInstallToolPasswordNotSet() {}", "public function testCheckCredentials(){\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $result = $db->checkCredentials(\"owner@gmail.com\",\"owner\");\r\n $this->assertEquals(\"owner@gmail.com\",$result[\"emailId\"]);\r\n }", "public function maybe_received_credentials() {\n\t\tif ( ! is_admin() || ! is_user_logged_in() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Require the nonce.\n\t\tif ( empty( $_GET['wc_ppec_ips_admin_nonce'] ) || empty( $_GET['env'] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t$env = in_array( $_GET['env'], array( 'live', 'sandbox' ) ) ? $_GET['env'] : 'live';\n\n\t\t// Verify the nonce.\n\t\tif ( ! wp_verify_nonce( $_GET['wc_ppec_ips_admin_nonce'], 'wc_ppec_ips' ) ) {\n\t\t\twp_die( __( 'Invalid connection request', 'woocommerce-gateway-paypal-express-checkout' ) );\n\t\t}\n\n\t\twc_gateway_ppec_log( sprintf( '%s: returned back from IPS flow with parameters: %s', __METHOD__, print_r( $_GET, true ) ) );\n\n\t\t// Check if error.\n\t\tif ( ! empty( $_GET['error'] ) ) {\n\t\t\t$error_message = ! empty( $_GET['error_message'] ) ? $_GET['error_message'] : '';\n\t\t\twc_gateway_ppec_log( sprintf( '%s: returned back from IPS flow with error: %s', __METHOD__, $error_message ) );\n\n\t\t\t$this->_redirect_with_messages( __( 'Sorry, Easy Setup encountered an error. Please try again.', 'woocommerce-gateway-paypal-express-checkout' ) );\n\t\t}\n\n\t\t// Make sure credentials present in query string.\n\t\tforeach ( array( 'api_style', 'api_username', 'api_password', 'signature' ) as $param ) {\n\t\t\tif ( empty( $_GET[ $param ] ) ) {\n\t\t\t\twc_gateway_ppec_log( sprintf( '%s: returned back from IPS flow but missing parameter %s', __METHOD__, $param ) );\n\n\t\t\t\t$this->_redirect_with_messages( __( 'Sorry, Easy Setup encountered an error. Please try again.', 'woocommerce-gateway-paypal-express-checkout' ) );\n\t\t\t}\n\t\t}\n\n\t\t$creds = new WC_Gateway_PPEC_Client_Credential_Signature(\n\t\t\t$_GET['api_username'],\n\t\t\t$_GET['api_password'],\n\t\t\t$_GET['signature']\n\t\t);\n\n\t\t$error_msgs = array();\n\t\ttry {\n\t\t\t$payer_id = wc_gateway_ppec()->client->test_api_credentials( $creds, $env );\n\n\t\t\tif ( ! $payer_id ) {\n\t\t\t\t$this->_redirect_with_messages( __( 'Easy Setup was able to obtain your API credentials, but was unable to verify that they work correctly. Please make sure your PayPal account is set up properly and try Easy Setup again.', 'woocommerce-gateway-paypal-express-checkout' ) );\n\t\t\t}\n\t\t} catch ( PayPal_API_Exception $ex ) {\n\t\t\t$error_msgs[] = array(\n\t\t\t\t'warning' => __( 'Easy Setup was able to obtain your API credentials, but an error occurred while trying to verify that they work correctly. Please try Easy Setup again.', 'woocommerce-gateway-paypal-express-checkout' ),\n\t\t\t);\n\t\t}\n\n\t\t$error_msgs[] = array(\n\t\t\t'success' => __( 'Success! Your PayPal account has been set up successfully.', 'woocommerce-gateway-paypal-express-checkout' ),\n\t\t);\n\n\t\tif ( ! empty( $error_msgs ) ) {\n\t\t\twc_gateway_ppec_log( sprintf( '%s: returned back from IPS flow: %s', __METHOD__, print_r( $error_msgs, true ) ) );\n\t\t}\n\n\t\t// Save credentials to settings API\n\t\t$settings_array = (array) get_option( 'woocommerce_ppec_paypal_settings', array() );\n\n\t\tif ( 'live' === $env ) {\n\t\t\t$settings_array['environment'] = 'live';\n\t\t\t$settings_array['api_username'] = $creds->get_username();\n\t\t\t$settings_array['api_password'] = $creds->get_password();\n\t\t\t$settings_array['api_signature'] = is_callable( array( $creds, 'get_signature' ) ) ? $creds->get_signature() : '';\n\t\t\t$settings_array['api_certificate'] = is_callable( array( $creds, 'get_certificate' ) ) ? $creds->get_certificate() : '';\n\t\t\t$settings_array['api_subject'] = $creds->get_subject();\n\t\t} else {\n\t\t\t$settings_array['environment'] = 'sandbox';\n\t\t\t$settings_array['sandbox_api_username'] = $creds->get_username();\n\t\t\t$settings_array['sandbox_api_password'] = $creds->get_password();\n\t\t\t$settings_array['sandbox_api_signature'] = is_callable( array( $creds, 'get_signature' ) ) ? $creds->get_signature() : '';\n\t\t\t$settings_array['sandbox_api_certificate'] = is_callable( array( $creds, 'get_certificate' ) ) ? $creds->get_certificate() : '';\n\t\t\t$settings_array['sandbox_api_subject'] = $creds->get_subject();\n\t\t}\n\n\t\tupdate_option( 'woocommerce_ppec_paypal_settings', $settings_array );\n\n\t\t$this->_redirect_with_messages( $error_msgs );\n\t}", "function verifyUser ($username, $hash) {\r\n //TO-DO\r\n\r\n //if credentials match return true\r\n\r\n //else return false\r\n\r\n //dummy CODE\r\n return true;\r\n}", "public function check()\n {\n $context = Context::getInstance();\n// $context->setInitialized(true);\n// $context->setDeviceId('asdasd');\n// $context->setUserId('112');\n if (!$context->isInitialized()) {\n throw new ContextNotInitializedException();\n }\n\n if ($this->type === ContextCheck::TYPE_AUTH) {\n if (!$context->isAuth()){\n throw new ContextNotAuthorizedException();\n }\n }\n }", "private function compare_with_login()\n {\n }", "public function validate_account(){ \n\t\tif($this->data['Client']['account_holder'][0] != ''){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function validateUserInput() {\n\t\ttry {\n\t\t\t$this->clientUserName = $this->loginObserver->getClientUserName();\n\t\t\t$this->clientPassword = $this->loginObserver->getClientPassword();\n\t\t\t$this->loginModel->validateForm($this->clientUserName, $this->clientPassword);\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->message = $e->getMessage();\n\t\t}\n\t}", "public function checkCLIuser() {}", "public function valid(): bool\n {\n return !empty($this->clientId) || !empty($this->clientSecret);\n }", "abstract public function credentials();", "public function validateCredentials(Authenticatable $user, array $credentials) {}", "public function check();", "public function check();", "public function check();", "public function check();", "public function check();", "public function validate(array $credentials = []): bool\n {\n throw new \\RuntimeException('Cognito guard cannot be used for credential based authentication.');\n }", "function _verifyCredentials($ac_token) {\n $api = 'https://api.twitter.com/1/account/verify_credentials.json';\n return $this->_execTwApi($ac_token, $api, array(), 'get');\n }", "private function authenticate()\n {\n $this->_validator->setCredentials($this->_user, $this->_pass);\n if ($this->_validator->authenticate()) {\n $this->_accepted = true;\n }\n }", "public function validateCredentials(Authenticatable $user, array $credentials): bool;", "function check_entry($form, $course)\n {\n global $CFG;\n\n if (zero_cost($course) || (!empty($course->password) && !empty($form->enrol) && $form->enrol == 'manual')) {\n $manual = enrolment_factory::factory('manual');\n $manual->check_entry($form, $course);\n if (!empty($manual->errormsg)) {\n $this->errormsg = $manual->errormsg;\n }\n }\n }", "private function checkCookie()\n\t\t{\n\t\t\tif(!empty($_COOKIE['auth_username']) && !empty($_COOKIE['auth_password']))\n\t\t\t\treturn $this->check($_COOKIE['auth_username'], $_COOKIE['auth_password']);\n\t\t}", "public function authenticate()\n\t{\n\t\t$this->errorCode==self::ERROR_NONE;\n\t}", "function doPasskeyLoginValidate(){\n\t\t\n\t\tif(@$this->identification == \"\" | @$this->passkey == \"\"){\t\n\t\t\t$respArray = $this->makeResponse(\"ERROR\", \"Your Username and Password are required to complete this task.\", \"\");\t\t\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t}else{\n\t\t\t\n\t\t\t$this->basics->doPasskeyLogin(@$this->sanitize($this->identification) , @$this->obsfucate->makePass($this->sanitize($this->passkey)), $this->obsfucate->makeKey($this->sanitize($this->identification)) );\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function validate(array $credentials = [])\n {\n\n }", "public function analisarCredito()\n {\n return true;\n }", "public function analisarCredito()\n {\n return true;\n }", "public function verify()\n {\n switch ($this->type) {\n default:\n case self::AUTH_BASIC:\n\n if ($authorization = input()->server('HTTP_AUTHORIZATION')) {\n $authentication = unserialize(base64_decode($authorization));\n if ($this->login($authentication[ 'username' ], $authentication[ 'password' ])) {\n return true;\n }\n } else {\n $authentication = $this->parseBasic();\n }\n\n if ($this->login($authentication[ 'username' ], $authentication[ 'password' ])) {\n\n header('Authorization: Basic ' . base64_encode(serialize($authentication)));\n\n return true;\n } else {\n unset($_SERVER[ 'PHP_AUTH_USER' ], $_SERVER[ 'PHP_AUTH_PW' ]);\n $this->protect();\n }\n\n break;\n case self::AUTH_DIGEST:\n if ($authorization = input()->server('HTTP_AUTHORIZATION')) {\n $authentication = $this->parseDigest($authorization);\n } elseif ($authorization = input()->server('PHP_AUTH_DIGEST')) {\n $authentication = $this->parseDigest($authorization);\n }\n\n if (isset($authentication) AND\n false !== ($password = $this->login($authentication[ 'username' ]))\n ) {\n $A1 = md5($authentication[ 'username' ] . ':' . $this->realm . ':' . $password);\n $A2 = md5($_SERVER[ 'REQUEST_METHOD' ] . ':' . $authentication[ 'uri' ]);\n $response = md5(\n $A1\n . ':'\n . $authentication[ 'nonce' ]\n . ':'\n . $authentication[ 'nc' ]\n . ':'\n . $authentication[ 'cnonce' ]\n . ':'\n . $authentication[ 'qop' ]\n . ':'\n . $A2\n );\n\n if ($authentication[ 'response' ] === $response) {\n header(\n sprintf(\n 'Authorization: Digest username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", qop=%s, nc=%s, cnonce=\"%s\", response=\"%s\", opaque=\"%s\"',\n $authentication[ 'username' ],\n $this->realm,\n $authentication[ 'nonce' ],\n $authentication[ 'uri' ],\n $authentication[ 'qop' ],\n $authentication[ 'nc' ],\n $authentication[ 'cnonce' ],\n $response,\n $authentication[ 'opaque' ]\n )\n );\n\n return true;\n }\n }\n\n unset($_SERVER[ 'PHP_AUTH_DIGEST' ], $_SERVER[ 'HTTP_AUTHORIZATION' ]);\n $this->protect();\n\n break;\n }\n\n return false;\n }", "function validateSetup()\n\t{\n\t\tforeach ($this->setup->getClient()->status as $key => $val)\n\t\t{\n\t\t\tif ($key != \"finish\" and $key != \"access\")\n\t\t\t{\n\t\t\t\tif ($val[\"status\"] != true)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n//$this->setup->getClient()->setSetting(\"zzz\", \"V\");\n\t\t$clientlist = new ilClientList($this->setup->db_connections);\n//$this->setup->getClient()->setSetting(\"zzz\", \"W\");\n\t\t$list = $clientlist->getClients();\n//$this->setup->getClient()->setSetting(\"zzz\", \"X\");\n\t\tif (count($list) == 1)\n\t\t{\n\t\t\t$this->setup->ini->setVariable(\"clients\",\"default\",$this->setup->getClient()->getId());\n\t\t\t$this->setup->ini->write();\n\n\t\t\t$this->setup->getClient()->ini->setVariable(\"client\",\"access\",1);\n\t\t\t$this->setup->getClient()->ini->write();\n\t\t}\n//$this->setup->getClient()->setSetting(\"zzz\", \"Y\");\n\t\treturn true;\n\t}", "private function authCredUser(){\n\t\t\n\t\t// UC 3 1: User wants to authenticate with saved credentials\n\t\t\t// - System authenticates the user and presents that the authentication succeeded and that it happened with saved credentials\n\t\t$inpName = $this->view->getInputName(true);\t\n\t\t$inpPass = $this->view->getInputPassword(true);\n\n\t\t$answer = $this->model->loginCredentialsUser($inpName, $inpPass, $this->view->getServerInfo());\n\t\t\n\t\tif($answer == null){\n\t\t\t$this->view->showLogin(false);\n\t\t\t\n\t\t} else if($answer == true){\t\t\n\t\t\t$this->view->storeMessage(\"Inloggning lyckades via cookies\");\n\t\t\treturn $this->view->showLogin(true);\n\t\t} else {\t\t\n\t\t\t// 2a. The user could not be authenticated (too old credentials > 30 days) (Wrong credentials) Manipulated credentials.\n\t\t\t\t// 1. System presents error message\n\t\t\t\t// Step 2 in UC 1\t\t\t\t\n\t\t\t$this->view->removeCredentials();\n\t\t\t$this->view->storeMessage(\"Felaktig eller föråldrad information i cookie\");\n\t\t\treturn $this->view->showLogin(false);\n\t\t}\n\t}", "public static function check();", "public static function checkCredentials()\n {\n static $result = null;\n\n if ($result === null) {\n // Get merchant settings\n $merchantSettings = self::getMerchantSettings();\n\n $result = (is_array($merchantSettings) && !empty($merchantSettings['result']) && self::isValidResponse($merchantSettings));\n if ($result) {\n self::$merchantSettings = $merchantSettings;\n }\n }\n\n return $result;\n }", "public function Validate() {\n\t\t$blnToReturn = true;\n\t\tif (($this->txtUsername) && ($objLogin = Login::LoadByUsername($this->txtUsername->Text)) && ($objLogin->Id != $this->mctLogin->Login->Id )){\n\t\t\t\t$blnToReturn = false;\n\t\t\t\t$this->txtUsername->Warning = QApplication::Translate(\"This value is already in use.\");\n\t\t\t}\n\t\tif (($this->lstPerson) && ($objLogin = Login::LoadByPersonId($this->lstPerson->SelectedValue)) && ($objLogin->Id != $this->mctLogin->Login->Id )){\n\t\t\t\t$blnToReturn = false;\n\t\t\t\t$this->lstPerson->Warning = QApplication::Translate(\"This value is already in use.\");\n\t\t\t}\n\t\treturn $blnToReturn;\n\t}", "public static function attempt(array $credentials) : bool;", "function check(RequestInterface $request, ResponseInterface $response) {\n\n $digest = new HTTP\\Auth\\Digest(\n $this->realm,\n $request,\n $response\n );\n $digest->init();\n\n $username = $digest->getUsername();\n\n // No username was given\n if (!$username) {\n return [false, \"No 'Authorization: Digest' header found. Either the client didn't send one, or the server is mis-configured\"];\n }\n\n $hash = $this->getDigestHash($this->realm, $username);\n // If this was false, the user account didn't exist\n if ($hash === false || is_null($hash)) {\n return [false, \"Username or password was incorrect\"];\n }\n if (!is_string($hash)) {\n throw new DAV\\Exception('The returned value from getDigestHash must be a string or null');\n }\n\n // If this was false, the password or part of the hash was incorrect.\n if (!$digest->validateA1($hash)) {\n return [false, \"Username or password was incorrect\"];\n }\n\n\t$ret = $digest->getValidationString (); // Attention, rajouter cette fonction dans HTTP\\DigestAuth \n\t\n\t$str = $ret['part'];\n\t$result = $this->base->utilisateur_login_digest ($username, $str, $ret['response']);\n\t\n\tif ($result) {\n\t $this->token = $result;\n\t global $_SESSION;\n\t $_SESSION['token'] = $this->token;\n\t $this->currentUser = $username;\t \n\t} else {\n\t $digest->requireLogin();\n\t throw new DAV\\Exception\\NotAuthenticated('Incorrect username');\n\t return [false, \"Incorrect\"];\n\t}\n\t\n return [true, $this->principalPrefix . $username];\n\n }", "public function verifyPasswd($passwd_inp) {\n //if ($passwd_inp === $this->passwd_hash) {\n return password_verify($passwd_inp, $this->passwd_hash);\n }", "public function validate(array $credentials = [])\n {\n return false;\n }", "public function validate(array $credentials = [])\n {\n return false;\n }", "public function check() {}", "public function check($credentials, array $options = array()) {\n $conditions = $this->_filters($credentials->data);\n $options += $this->_config;\n\n /*\n try {\n if (!$this->openId->mode) {\n if(isset($_POST[$this->_field])) {\n $this->openId->identity = $_POST[$this->_field];\n\n # The following two lines request email, full name, and a nickname\n # from the provider. Remove them if you don't need that data.\n $this->openId->required = array('contact/email');\n $this->openId->optional = array('namePerson', 'namePerson/friendly');\n header('Location: ' . $this->openId->authUrl());\n }\n } elseif ($this->openId->mode == 'cancel') {\n return false;\n } elseif ($this->openId->validate()) {\n return true;\n //echo 'User ' . ($this->openId->validate() ? $this->openId->identity . ' has ' : 'has not ') . 'logged in.';\n //print_r($this->openId->getAttributes());\n }\n } catch(ErrorException $e) {\n echo $e->getMessage();\n return false;\n }\n */\n\n return false;\n }", "public function checkAuth()\n {\n return $this->api->check('GP', session('nxs_gp.username'));\n }", "public function checkAuthorizationData() {\n \n $config = Mage::getModel('storesms/config');\n \n if ($config->isApiEnabled()==0) return;\n \n try {\n $creditsXML = Mage::getModel('storesms/apiClient')->getCredits();\n $ExceptionMessage = $creditsXML->requestError->serviceException->messageId;\n\n if ($ExceptionMessage=='UNAUTHORIZED') {\n throw new Exception(Mage::helper('storesms')->__($config::WRONG_AUTH_DATA));\n }\n else {\n Mage::getSingleton('core/session')->addSuccess(Mage::helper('storesms')->__('Success. Logged into Storesms API.'));\n }\n\n }\n catch (Exception $e) {\n Mage::getSingleton('core/session')->addError($e->getMessage());\n }\n \n }", "function m_verifyEditPass()\n\t{\n\t\t$this->errMsg=MSG_HEAD.\"<br>\";\n\t\tif(empty($this->request['password']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif(empty($this->request['verify_pw']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_VERIFYPASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif($this->request['password']!=$this->request['verify_pw'])\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_NOTMATCHED.\"<br>\";\n\t\t}\n\t\treturn $this->err;\n\t}", "public static function maybe_update_credentials_error_flag() {\n\n\t\t// Check if the API credentials are being saved - we can't do this on the 'woocommerce_update_options_payment_gateways_paypal' hook because it is triggered after 'admin_notices'\n\t\tif ( ! empty( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-settings' ) && isset( $_POST['woocommerce_paypal_api_username'] ) || isset( $_POST['woocommerce_paypal_api_password'] ) || isset( $_POST['woocommerce_paypal_api_signature'] ) ) {\n\n\t\t\t$credentials_updated = false;\n\n\t\t\tif ( isset( $_POST['woocommerce_paypal_api_username'] ) && WCS_PayPal::get_option( 'api_username' ) != $_POST['woocommerce_paypal_api_username'] ) {\n\t\t\t\t$credentials_updated = true;\n\t\t\t} elseif ( isset( $_POST['woocommerce_paypal_api_password'] ) && WCS_PayPal::get_option( 'api_password' ) != $_POST['woocommerce_paypal_api_password'] ) {\n\t\t\t\t$credentials_updated = true;\n\t\t\t} elseif ( isset( $_POST['woocommerce_paypal_api_signature'] ) && WCS_PayPal::get_option( 'api_signature' ) != $_POST['woocommerce_paypal_api_signature'] ) {\n\t\t\t\t$credentials_updated = true;\n\t\t\t}\n\n\t\t\tif ( $credentials_updated ) {\n\t\t\t\tdelete_option( 'wcs_paypal_credentials_error' );\n\t\t\t}\n\t\t}\n\n\t\tdo_action( 'wcs_paypal_admin_update_credentials' );\n\t}", "public function authenticate()\n\t{\n\t if($this->pop_authenticate($this->username, $this->password,\"192.168.121.26\"))\n {\n\t\t\t$this->errorCode=self::ERROR_NONE;\n }\n else\n {\n\t\t\t$this->errorCode=self::ERROR_PASSWORD_INVALID;\n }\n\t\treturn !$this->errorCode;\n\t}", "public function check_availability() {\n \n if ( ( $this->client_id != '' ) AND ( $this->client_secret != '' ) ) {\n \n return true;\n \n } else {\n \n return false;\n \n }\n \n }", "public function accountDetailsNotFilledIn()\n {\n return (empty(Mage::getStoreConfig('easywebshopsms/api_connection/api_host'))\n || empty(Mage::getStoreConfig('easywebshopsms/api_connection/api_user'))\n || empty(Mage::getStoreConfig('easywebshopsms/api_connection/api_pass'))\n || empty(Mage::getStoreConfig('easywebshopsms/api_connection/api_port'))\n );\n }", "public function validate(array $credentials = []){\n\n return true;\n }", "abstract public function check();", "public function isLoginDataFilled()\n {\n $client = $this->Client();\n $credentials = $client->getCredentials();\n\n if (!empty($credentials['bearerToken']) || !empty($credentials['login']) || !empty($credentials['password'])) {\n return true;\n }\n\n return false;\n }", "function verify_bitly_login()\r\n\t{\r\n\t\t// Get bit.ly URL if API is set\r\n\t\t$bitly_options[CURLOPT_POSTFIELDS] = 'version=2.0.1&longUrl=http://www.google.com&login=' . $this->bitly_username . '&apiKey=' . $this->bitly_api_key;\r\n\t\t$bitly_options[CURLOPT_RETURNTRANSFER] = true;\r\n\r\n\t\t$bitly_curl = curl_init( 'http://api.bit.ly/shorten' );\r\n\t\tcurl_setopt_array($bitly_curl, $bitly_options);\r\n\t\t$bitly_response = curl_exec($bitly_curl);\r\n\r\n\t\t$bitly = json_decode($bitly_response);\r\n\r\n\t\t// Checks if an error message was returned\r\n\t\tif(!empty($bitly->errorMessage))\r\n\t\t{\r\n\t\t\techo('<div class=\"error\"><p><strong>Twitter Blog Plugin</strong> Bit.ly Authentication Failed. Please try check your Username (case sensitive) and API Key. <a href=\"options-general.php?page=twitter-blog-menu\">Settings Page</a></p></div>');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "function _inputCheck(){\n if (isset($_POST['verder']) && $this->_verify() == \"\") {\n return true;\n }\n else {\n return false;\n }\n }", "public function authIsOk() {\n return $this->userID !== 0;\n }", "public function passwordEntryIsValid() {\r\n \r\n //todo put logic here (same as email)\r\n // also check if it matches confirmpassword\r\n // set the var equal to function call of getpassword\r\n $password = $this->getPassword();\r\n // If the fields empty\r\n if ( empty($password) ) {\r\n // Will send it to errors as username and display the message to user\r\n $this->errors[\"password\"] = \"Password is missing.\";\r\n } \r\n // Calls the password function above and if its not equal to the orgincal password returns error\r\n else if ( $this->getConfirmpassword() !== $this->getPassword() ){\r\n // Message displayed to user\r\n $this->errors[\"password\"] = \"Password does not match confirmation password.\";\r\n }\r\n // Also goes test the password against the password is valid function in the validator class\r\n else if ( !Validator::passwordIsValid($this->getPassword()) ) {\r\n $this->errors[\"password\"] = \"Password is not valid.\"; \r\n }\r\n //Will return if its empty and whether any errors are contained\r\n return ( empty($this->errors[\"password\"]) ? true : false ) ;\r\n }", "function verifyAuth(){\n // on the config values. In this case we just check for user 0.\n $query = \"SELECT name FROM users WHERE user_id = 0\";\n try {\n $sth = $this->spdo->prepare($query);\n $sth->execute();\n }\n catch(PDOException $e) {\n endProcess(0,\"Could not get user information because \".pdoError($e));\n }\n if($this->spdo->query(\"SELECT FOUND_ROWS()\")->fetchColumn() != 1)\n return false;\n return true;\n }", "protected function validate() {\n if ($valid = isset($this->options['store_key']) && isset($this->options['store_secret']) && isset($this->options['store_container'])) {\n $valid = FALSE;\n print_msg(sprintf('Validating Azure connection using --store_key %s, --store_container %s', $this->options['store_key'], $this->options['store_container']), isset($this->options['verbose']), __FILE__, __LINE__); \n $curl = ch_curl($this->getUrl(NULL, array('restype' => 'container')), 'HEAD', $this->getHeaders(), NULL, NULL, '200,404');\n if ($curl === 200) {\n $valid = TRUE;\n print_msg(sprintf('Azure authentication and bucket validation successful'), isset($this->options['verbose']), __FILE__, __LINE__);\n }\n else if ($curl === 404) print_msg(sprintf('Azure authentication successful but bucket %s does not exist', $this->options['store_container']), isset($this->options['verbose']), __FILE__, __LINE__, TRUE);\n else print_msg(sprintf('Azure authentication failed'), isset($this->options['verbose']), __FILE__, __LINE__, TRUE);\n }\n else print_msg(sprintf('--store_key, --store_secret and --store_container are required'), isset($this->options['verbose']), isset($this->options['verbose']), __FILE__, __LINE__, TRUE);\n\n return $valid;\n }", "public function validateCredentials(UserContract $user, array $credentials)\n {\n return false;\n }", "public function checkSecurity() {\n }", "public function validateCredentials(Authenticatable $user, array $credentials){\n\n }", "private function check_auth( $var ) {\n\t\t\t\n\t\t\tif( $var != null ) {\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "protected function shouldFetchClientCredentials(): bool\n {\n return config('twitch-api.oauth_client_credentials.auto_generate')\n && $this->hasClientId()\n && $this->hasClientSecret();\n }", "function check_security() {\n global $wpdb, $publicKey, $secretKey, $currencySymbol;\n $state = true;\n \n $server_url_parts = explode('.', $_SERVER[\"SERVER_NAME\"]);\n if(!empty($this->url_specified) && $server_url_parts[count($server_url_parts)-1]!=='dev') {\n $url_parts = $this->url_specified;\n } else {\n $url_parts = $server_url_parts;\n }\n if((!isset($_SERVER[\"HTTPS\"]) || (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] != \"on\" && $_SERVER[\"HTTPS\"]!= 1)) && $url_parts[count($url_parts)-1]!=='dev' && !isset($_GET['devtest'])) {\n if(!empty($this->url_specified)) {\n $newurl = \"https://\" . $this->url_specified . $_SERVER[\"REQUEST_URI\"];\n } else {\n $newurl = \"https://\" . $_SERVER[\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\n }\n header(\"Location: $newurl\");\n exit();\n }\n \n $error = \"\";\n if( strlen($publicKey)==0) {\n $error .= \"<li>Public key is not set.</li>\";\n }\n if( strlen($secretKey)==0) {\n $error .= \"<li>Secret key is not set.</li>\";\n }\n if( strlen($currencySymbol)==0) {\n $error .= \"<li>Currency symbol is not set.</li>\";\n }\n\n if(strlen($error)>0) {\n $error = \"<div class='stripe-payment-config-errors'><p>Fix the following configuration errors before using the form.</p><ul>\".$error.\"</ul></div>\";\n $this->config_errors = $error;\n }\n \n return $state;\n }", "public function isValid()\n {\n $params = array_filter(\n [\n $this->host,\n $this->name,\n $this->user,\n $this->password,\n $this->port\n ],\n function($item) {\n return ! empty($item);\n }\n );\n\n return count($params) === 5;\n }", "public function validarCredenciales() {\n try {\n $host = $this->dataPost->getServer('HTTP_HOST');\n $dr = $this->dataPost->getServer('DOCUMENT_ROOT');\n if (!isset($this->dataSession->logged)) {\n header('HTTP/1.0 401 Unauthorized');\n header(\"Location: http://$host/comun/Security/Header/401.html\");\n exit();\n } else {\n if (isset($this->dataSession->lastAccess)) {\n $lastAccessed = $this->dataSession->lastAccess;\n $currentAccessed = $this->dataSession->currentAccess;\n $passedTime = (strtotime($currentAccessed) - strtotime($lastAccessed));\n $fileConfigSystem = $dr . \"/comun/comun/xml/system.xml\";\n $xmlConfigSystem = simplexml_load_file($fileConfigSystem);\n $sessiontime = ($xmlConfigSystem != false) ? (int) $xmlConfigSystem->environment->sessiontime : 900;\n if ($passedTime >= $sessiontime) {\n $this->dataSession->destroy();\n header(\"Location: http://$host/app/index/index.php/index/expired\");\n exit();\n } else {\n $this->dataSession->lastAccess = date(\"Y-n-j H:i:s\");\n }\n } else {\n $this->dataSession->lastAccess = date(\"Y-n-j H:i:s\");\n }\n }\n } catch (Exception $exc) {\n throw $exc;\n }\n }", "public function authenticate($input)\r\n\t{\r\n\t\tif(isset($input['ce_key'])) $this->set_baseDn($input['ce_key']);\n\t\t\r\n\t\tif(!is_array($input))\r\n\t\t{\t\t\t\n\t\t\treturn $this->invalidCredentials('Invalid input. Please set uid or mail and userPassword');\r\n\t\t}\n\t\t\n\t\tif(empty($input['uid']) && empty($input['mail']))\r\n\t\t{\r\n\t\t\treturn $this->invalidCredentials('Your input should contain one of these attributes: uid or mail');\r\n\t\t}\r\n\n\t\tif(empty($input['userPassword']))\r\n\t\t{\r\n\t\t\treturn $this->invalidCredentials('Your input should contain the userPassword attribute');\r\n\t\t}\n\t\t\n\t\t//be sure that input is well formed and doesn't contain unnecessary fields\n\t\t$tmp = array();\n\t\tif(isset($input['uid'])) $tmp['uid'] = trim($input['uid']);\n\t\tif(isset($input['mail'])) $tmp['mail'] = trim($input['mail']);\n\t\t$tmp['userPassword'] = trim($input['userPassword']);\n\t\t$input = $tmp;\n\t\tunset($tmp);\n\t\t\n\t\tif(!empty($input['mail'])) {\r\n\t\t\t//look for a person using the mail attribute\r\n\t\t\t$search = array();\r\n\t\t\t$search['filter'] = '(mail='.strtolower($input['mail']).')';\n\t\t}\n\t\t\n\t\tif(!empty($input['uid'])) {\r\n\t\t\t//look for a person using the mail attribute\r\n\t\t\t$search = array();\r\n\t\t\t$search['filter'] = '(uid='.strtolower($input['uid']).')';\r\n\t\t}\n\t\t\r\n\t\t$result = $this->read($search);\r\n\t\t\t\r\n\t\tif(count($result['data']) > 1) {\r\n\t\t\t$this->result = new Ce_Return_Object();\r\n\t\t\t$this->result->data = array();\r\n\t\t\t$this->result->status_code = '500';\r\n\t\t\t$this->result->message = 'Internal Server Error';\r\n\t\t\t\t\r\n\t\t\treturn $this->result->returnAsArray();\r\n\t\t}\r\n\t\t\t\r\n\t\tif(count($result['data']) == 0) return $this->invalidCredentials();\n\t\t\t\t\n\t\t$person = $result['data']['0'];\n\t\t$stored_password = $person['userPassword'][0];\n\t\t\n\t\t$authenticated = false;\n\t\t\n\t\t//case 1: password is stored in LDAP not encrypted\n\t\t$given_password = $input['userPassword'];\n\t\tif($given_password == $stored_password) $authenticated = true;\n\n\t\t//case 2: password is stored in LDAP with MD5 encryption\t\t\n\t\t$given_password = '{MD5}'.base64_encode(pack(\"H*\",md5($input['userPassword'])));\n\t\tif($given_password == $stored_password) $authenticated = true; \n\n\t\t//case 3: password is stored in LDAP with SHA encryption\t\t\n\t\t$given_password = '{SHA}'.base64_encode(pack(\"H*\",sha1($input['userPassword'])));\r\n\t\tif($given_password == $stored_password) $authenticated = true;\r\n\n\t\t//case 3: password is stored in LDAP with CRYPT encryption\n\t\t//TODO http://php.net/manual/en/function.crypt.php\n\t\t\t\t\n\t\tif(!$authenticated) $this->invalidCredentials();\n\t\t\n\t\t$result = $this->result->returnAsArray();\n\t\t\n\t\t//TODO should I give back all contact's attributes or only part of them?\r\n\t\treturn $result;\t\t\r\n\t}", "public function validateCredentials(Authenticatable $user, array $credentials)\n {\n }", "public function _check_login()\n {\n\n }", "public function _check()\n {\n }", "public function test_if_an_user_can_receive_valid_credentials() {\n $user = $this->createFakerUser($this->credentials);\n \n $this->postJson('/api/v1/auth/login', $this->credentials);\n \n $this->assertAuthenticatedAs($user);\n }" ]
[ "0.6443471", "0.63806075", "0.62712103", "0.62282515", "0.5978966", "0.5944714", "0.586886", "0.5849248", "0.58254063", "0.57983637", "0.57889503", "0.5782767", "0.57710564", "0.5746962", "0.57306397", "0.57115597", "0.56974137", "0.5662503", "0.5647671", "0.56451994", "0.5559546", "0.55515444", "0.5550474", "0.5548099", "0.5529204", "0.5495941", "0.5495941", "0.5490487", "0.54650944", "0.5464444", "0.5459747", "0.5452276", "0.5446434", "0.5446324", "0.5445546", "0.5444958", "0.5428823", "0.542669", "0.54195446", "0.5416848", "0.5415521", "0.5396077", "0.5388466", "0.5388466", "0.5388466", "0.5388466", "0.5388466", "0.53854644", "0.5384934", "0.53845465", "0.537573", "0.53698397", "0.536236", "0.53622264", "0.5360113", "0.5360108", "0.5349359", "0.5349359", "0.53406024", "0.5339702", "0.53311014", "0.5324545", "0.5320536", "0.53205246", "0.53195757", "0.5310281", "0.530633", "0.5296143", "0.5296143", "0.5293082", "0.5291018", "0.5279394", "0.5272323", "0.52674013", "0.5265132", "0.52556", "0.5253172", "0.52449954", "0.5244415", "0.52423435", "0.52393156", "0.5236932", "0.52368873", "0.5235223", "0.52345973", "0.5232866", "0.5231155", "0.5229225", "0.5223529", "0.5213548", "0.52114785", "0.52101576", "0.52070445", "0.5198701", "0.519494", "0.519246", "0.5182645", "0.5181149", "0.5180869", "0.51801217" ]
0.55989885
20
Method for translation of names from camelCase to underdash notation
public static function camelToUnderdash(string $s):string { $s = preg_replace('#(.)(?=[A-Z])#', '$1_', $s); $s = strtolower($s); $s = rawurlencode($s); return $s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function underdashToCamel(string $s):string {\n $s = strtolower($s);\n $s = preg_replace('#_(?=[a-z])#', ' ', $s);\n $s = substr(ucwords('x' . $s), 1);\n $s = str_replace(' ', '', $s);\n return $s;\n }", "public function underscore($camelCasedWord);", "function convertNamingFromUnderlineToCamelCase($text,$firstLetterLowerCase=true) {\n\t\t\tpreg_match_all('/(^[a-zA-Z])|(_[a-zA-Z])/', $text, $matches, PREG_PATTERN_ORDER);\n\t\n\t\t\tfor ($i = 0; $i < count($matches[0]); $i++) {\n\t\t\t\t\t$original=$matches[0][$i];\n\t\t\t\t\t$originals[]=$original;\n\t\t\t\t\tif ($i==0 and $firstLetterLowerCase)\n\t\t\t\t\t\t\t$replacement=str_replace('_','',$matches[0][$i]);\n\t\t\t\t\telse\n\t\t\t\t\t\t\t$replacement=strtoupper(str_replace('_','',$matches[0][$i]));\n\t\t\t\t\t$replacements[]=$replacement;\n\t\t\t}\n\t\n\t\t\treturn str_replace($originals,$replacements,$text);\n\t}", "public function camelCase($input)\n {\n return str_replace(' ', '', ucwords(str_replace(['_', '-'], ' ', $input)));\n }", "function to_camelCase($value)\n{\n\t$under_pos=mixed();\n\tdo\n\t{\n\t\t$under_pos=strpos($value,'_');\n\t\tif ($under_pos!==false)\n\t\t{\n\t\t\t$value=substr($value,0,$under_pos).ucfirst(substr($value,$under_pos+1));\n\t\t}\n\t}\n\twhile ($under_pos!==false);\n\treturn $value;\n}", "protected function convName($name){\n if(ctype_upper(substr($name, 0, 1))){\n $name = strtolower(preg_replace('/([^A-Z])([A-Z])/', \"$1_$2\", $name));\n }\n else{\n $name = preg_replace('/(?:^|_)(.?)/e',\"strtoupper('$1')\", $name);\n }\n return $name;\n }", "public function underscoredToUpperCamelCaseDataProvider() {}", "protected function _getCaseInsensitiveName($name) {\n\n return str_replace('_', '-', mb_strtolower($name));\n\n }", "function from_camelCase($value)\n{\n\t$out='';\n\t$len=strlen($value);\n\tfor ($i=0;$i<$len;$i++)\n\t{\n\t\t$char=$value[$i];\n\t\tif (strtolower($char)!=$char) $out.='_';\n\t\t$out.=strtolower($char);\n\t}\n\treturn $out;\n}", "private function transformName( $name ): string {\n\t\treturn lcfirst( implode( '', array_map( 'ucfirst', explode( '-', $name ) ) ) );\n\t}", "public function camel($word);", "function macro_convert_camel_to_human_readable($camel)\n{\n $camel = str_replace('_', ' ', $camel);\n $camel = str_replace('\\\\', ' ', $camel);\n $camel = preg_replace_callback(\n '/ ([A-Z])([a-z0-9])/Ss',\n function (array $matches) {\n return ' ' . strtolower($matches[1]) . $matches[2];\n },\n $camel\n );\n $camel = preg_replace_callback(\n '/([a-z0-9])([A-Z])([a-z0-9])/Ss',\n function (array $matches) {\n return $matches[1] . ' ' . strtolower($matches[2]) . $matches[3];\n },\n $camel\n );\n\n return ucfirst($camel);\n}", "public function underscoredToLowerCamelCaseDataProvider() {}", "function hyphensToCamel($value)\n {\n return preg_replace(\"/\\-(.)/e\", \"strtoupper('\\\\1')\", $value);\n }", "public function getCamelCaseName()\n {\n return lcfirst($this->getName());\n }", "public static function camelCase($str) {}", "static function camelCaseToUnderScore($string) \r\n {\r\n $start = 0;\r\n $data = array();\r\n $lower = strtolower($string);\r\n for ($k = 1; $k < strlen($string); $k++) {\r\n if ($lower[$k] != $string[$k]) {\r\n if ($k != $start) {\r\n $data[] = strtolower(substr($string, $start, $k - $start));\r\n $start = $k;\r\n }\r\n }\r\n }\r\n $data[] = strtolower(substr($string, $start, $k - $start));\r\n return implode('_', $data);\r\n }", "static public function underscored2camelcased($str) {\n $func = function ($c) {\n return strtoupper($c[1]);\n };\n return preg_replace_callback('/_([a-z])/', $func, $str);\n }", "public function camelize($str='') \n {\n return str_replace(' ', '', ucwords(str_replace(array('_', '-'), ' ', $str)));\n }", "public function camelCaseToLowerCaseUnderscoredDataProvider() {}", "function from_camel_case($input)\n{\n preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches);\n $ret = $matches[0];\n foreach ($ret as &$match) {\n $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match);\n }\n return implode('_', $ret);\n}", "public static function underscore2camelCase(string $key): string\n {\n return strtr($key, array_flip([\n 'A' => '_a', 'B' => '_b', 'C' => '_c', 'D' => '_d',\n 'E' => '_e', 'F' => '_f', 'G' => '_g', 'H' => '_h',\n 'I' => '_i', 'J' => '_j', 'K' => '_k', 'L' => '_l',\n 'M' => '_m', 'N' => '_n', 'O' => '_o', 'P' => '_p',\n 'Q' => '_q', 'R' => '_r', 'S' => '_s', 'T' => '_t',\n 'U' => '_u', 'V' => '_v', 'W' => '_w', 'X' => '_x',\n 'Y' => '_y', 'Z' => '_z',\n ]));\n }", "public function camelize($lowerCaseAndUnderscoredWord);", "private function underscore(string $name)\n {\n $name = preg_replace_callback(\n '/[A-Z][A-Z]+/',\n function ($matches) {\n if (strlen($matches[0]) === 2) {\n return ucfirst(strtolower($matches[0]));\n } else {\n $lastChar = substr($matches[0], strlen($matches[0]) - 1, 1);\n $subject = substr($matches[0], 0, strlen($matches[0]) - 1);\n\n return ucfirst(strtolower($subject)).$lastChar;\n }\n },\n $name\n );\n\n return Inflector::tableize($name);\n }", "function camelToHyphens($value)\n {\n return strtolower(preg_replace('/([a-zA-Z])(?=[A-Z])/', '$1-', $value));\n }", "function underscore_to_camelcase($string){\n\t$cameled = '';\n\tfor($i=0; $i < strlen($string); $i++){\n\t\tif($string[$i] == '_'){\n\t\t\t$cameled .= strtoupper($string[$i+1]);\n\t\t\t$i++;\n\t\t}else{\n\t\t\t$cameled .= $string[$i];\n\t\t}\n\t}\n\treturn $cameled;\n}", "function camelCaseToUnderscore($str) {\n $str[0] = strtolower($str[0]);\n $func = create_function('$c', 'return \"_\" . strtolower($c[1]);');\n return preg_replace_callback('/([A-Z])/', $func, $str);\n }", "function camel($string) {\r\n\t$parts = preg_split('/[\\s_\\-]+/i',strtolower($string));\r\n\t$camel = array_shift($parts) . str_replace(\" \",\"\",ucwords(implode(\" \",$parts)));\r\n\treturn $camel;\r\n}", "protected function _underscore($name) {\n return strtolower(preg_replace('/(.)([A-Z])/', \"$1_$2\", $name));\n }", "function _toCamel($str) {\r\n if (!is_string($str)) return '';\r\n $func = create_function('$c', 'return strtoupper($c[1]);');\r\n return ucfirst(preg_replace_callback('/_([a-z])/', $func, $str));\r\n}", "public static function dashesToCamelCase($dashes)\n {\n $words = explode('-', $dashes);\n $camelCase = '';\n foreach ($words as $word) {\n $camelCase .= ucfirst($word);\n }\n return $camelCase;\n }", "protected static function upperCamelCase($name)\n {\n /*\n $name = str_replace('-', ' ', $name);\n $name = ucwords($name);\n $name = str_replace(' ', '', $name);\n return $name;\n */\n\n return str_replace(' ', '', ucwords(str_replace('-', ' ', $name)));\n }", "function dashed($s) {\n return underscore($s, '-');\n }", "protected function camelCase($property){\n\t\t$split = explode('_', $property);\n\t\t$ucFirst = implode('', array_map('ucfirst', $split));\n\t\t$camelCase = lcfirst($ucFirst);\n\t\treturn $camelCase;\n\t}", "function getPuzzleName($name)\n {\n return str_replace(\"-\", \" \", ucwords($name));\n }", "static function camelcase_to_underscores($string)\r\n {\r\n if (! isset(self :: $camel_us_map[$string]))\r\n {\r\n self :: $camel_us_map[$string] = preg_replace(array('/^([A-Z])/e', '/([A-Z])/e'), array(\r\n 'strtolower(\"\\1\")',\r\n '\"_\".strtolower(\"\\1\")'), $string);\r\n }\r\n return self :: $camel_us_map[$string];\r\n }", "public function getNormalizedName() {\n\n $name = str_replace(' ', '_', $this->getName());\n $name = strtolower($name);\n\n return preg_replace('/[^a-z0-9_]/i', '', $name);\n }", "function unu_ ($s) {\n $s = preg_replace('/^u_/', '', $s);\n return v($s)->u_to_camel_case();\n}", "function camelCase( $value ) {\n\t\t$value = ucwords( str_replace( array( '-', '_' ), ' ', $value ) );\n\n\t\treturn str_replace( ' ', '', $value );\n\t}", "function underscoreToCamelCase($str, $capitalise_first_char = false) {\n if($capitalise_first_char) {\n $str[0] = strtoupper($str[0]);\n }\n $func = create_function('$c', 'return strtoupper($c[1]);');\n return preg_replace_callback('/_([a-z])/', $func, $str);\n }", "abstract function normalizedName();", "private function toCamelCase($action) {\n\t\tif (strpos($action, '-') !== false) {\n\t\t\t$camelCaseName = str_replace(' ', '', ucwords(str_replace('-', ' ', $action)));\n\t\t\t$camelCaseName[0] = strtolower($camelCaseName[0]);\n\t\t\t$action = $camelCaseName;\n\t\t}\n\t\treturn $action;\n\t}", "function snakeToCamelCase(string $validator_name): string\r\n {\r\n $str_arr = explode(\"_\", $validator_name);\r\n if (count($str_arr) === 1) {\r\n return $str_arr[0];\r\n }\r\n $func_name = array_reduce(\r\n $str_arr,\r\n function ($current, $word) use ($validator_name) {\r\n $pos = strpos($word, $validator_name);\r\n if (!empty($current)) {\r\n $word[0] = strtoupper($word[0]);\r\n }\r\n return $current . $word;\r\n },\r\n \"\"\r\n );\r\n\r\n return $func_name;\r\n }", "function camelCaseToSnakeCase(string $input): string\n{\n return preg_replace('/[-\\.]/', '_', strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $input)));\n}", "public static function camelize($lower_case_and_underscored_word) {\n \tif(strpos($lower_case_and_underscored_word, '_') === false)\n\t\t\treturn ucfirst($lower_case_and_underscored_word);\n\t\telse\n\t\t\treturn str_replace(' ','',ucwords(str_replace('_',' ',$lower_case_and_underscored_word)));\n }", "public static function normalizeHeaderName($name)\n {\n $result = str_replace(' ', '-', ucwords(str_replace(['-', '_'], ' ', strtolower($name))));\n return $result;\n }", "public function testToCamelCase() {\r\n $this->assertEquals('myTest', $this->_utils->toCamelCase('my test'));\r\n $this->assertEquals('myTest', $this->_utils->toCamelCase('my_test'));\r\n $this->assertEquals('myTest', $this->_utils->toCamelCase('my-test'));\r\n\r\n $this->assertEquals('myTestWithMoreWords', $this->_utils->toCamelCase('my test With-More_Words'));\r\n $this->assertEquals('myTestWithMoreWords', $this->_utils->toCamelCase('myTest_With-more_Words'));\r\n }", "protected function mangleMethodName($name) {\n // explode on _\n $parts = explode('_', $name);\n // beginning of name is lowercase\n $name = strtolower(array_shift($parts));\n // if our parts count is now 0, return\n if(count($parts) < 1) {\n return $name;\n }\n // strtolower the rest\n $parts = array_map('strtolower', $parts);\n // camelcase it\n $parts = array_map('ucfirst', $parts);\n return $name . implode($parts);\n }", "function cp_make_custom_name($cname) {\r\n\r\n\t$cname = preg_replace('/[^a-zA-Z0-9\\s]/', '', $cname);\r\n\t$cname = 'cp_' . str_replace(' ', '_', strtolower(substr(appthemes_clean($cname), 0, 30)));\r\n\r\n\treturn $cname;\r\n}", "protected function normalizeHeaderName($name)\n {\n return strtr(ucwords(strtr(strtolower($name), array('_' => ' ', '-' => ' '))), array(' ' => '-'));\n }", "static public function dasherize($str)\n\t{\n\t\t$str = lcfirst($str);\n\t\treturn strtolower(preg_replace('/([A-Z]+)/', '-$1', $str));\n\t}", "public static function toDashSeparated($input)\r\n {\r\n \t// Convert spaces and underscores to dashes.\r\n \t$input = preg_replace('#[ \\-_]+#', '-', $input);\r\n \r\n \treturn $input;\r\n }", "private static function optionToName($str) {\n return str_replace(' ', '', ucwords(str_replace('_', ' ', $str)));\n }", "public static function camelCase2underscore(string $key): string\n {\n $str = lcfirst($key);\n return strtr($str, [\n 'A' => '_a', 'B' => '_b', 'C' => '_c', 'D' => '_d',\n 'E' => '_e', 'F' => '_f', 'G' => '_g', 'H' => '_h',\n 'I' => '_i', 'J' => '_j', 'K' => '_k', 'L' => '_l',\n 'M' => '_m', 'N' => '_n', 'O' => '_o', 'P' => '_p',\n 'Q' => '_q', 'R' => '_r', 'S' => '_s', 'T' => '_t',\n 'U' => '_u', 'V' => '_v', 'W' => '_w', 'X' => '_x',\n 'Y' => '_y', 'Z' => '_z',\n ]);\n }", "protected static function normalizeHeaderName($name)\n {\n return str_replace(' ', '-', ucwords(str_replace('-', ' ', $name)));\n }", "function uncapitalize(){\n\t\t$first = $this->substr(0,1)->downcase();\n\t\treturn $first->append($this->substr(1));\n\t}", "static function camelize($word) {\n $parts = explode('/', $word);\n foreach ($parts as $key => $part) {\n $parts[$key] = str_replace(' ', '',\n ucwords(str_replace('_', ' ', $part)));\n }\n return join('_', $parts);\n }", "public static function snakeCaseToCamelcase(string $snakeCase): string\n {\n $terms = explode('_', $snakeCase);\n if (count($terms) === 1) {\n return $snakeCase;\n }\n $withoutFirstTerm = array_slice($terms, 1);\n $camelCase[] = $terms[0];\n foreach ($withoutFirstTerm as $term) {\n $camelCase[] = ucwords($term);\n }\n return implode('', $camelCase);\n }", "public static function dehyphenate($name, $ucfirst = false, $delimiter = '-')\n {\n $s = str_replace($delimiter, '', ucwords($name, $delimiter));\n return $ucfirst ? $s : lcfirst($s);\n }", "function azname($str) {\n $str = unaccent($str);\n $str = iconv('UTF-8', 'ASCII//TRANSLIT', $str);\n $str = str_replace('&', 'and', $str);\n return preg_replace('#[^A-Za-z0-9\\.\\-]#', '_', $str);\n}", "protected function _normalizeHeader($name) {\r\n\t\t$filtered = str_replace ( array (\r\n\t\t\t\t'-',\r\n\t\t\t\t'_' \r\n\t\t), ' ', ( string ) $name );\r\n\t\t$filtered = ucwords ( strtolower ( $filtered ) );\r\n\t\t$filtered = str_replace ( ' ', '-', $filtered );\r\n\t\treturn $filtered;\r\n\t}", "function camelize($options = array()){\n\t\t$options += array(\n\t\t\t\"lower\" => false,\n\t\t);\n\t\t$out = $this->_copy();\n\t\t$s = &$out->_String4;\n\t\t$s = preg_replace_callback(\"/_([a-z0-9\\p{Ll}])/ui\",function($matches){ return mb_strtoupper($matches[1]); },$this->_String4);\n\n\t\tif(mb_strlen($s)){\n\t\t\t$first = $out->substr( 0, 1);\n\t\t\t$first = $options[\"lower\"] ? mb_strtolower($first) : mb_strtoupper($first);\n\t\t\t$s = $first.$out->substr(1);\n\t\t}\n\n\t\treturn $out;\n\t}", "function from_camel_case($str) {\n return GHelper::from_camel_case($str);\n}", "function _wp_to_kebab_case($input_string)\n {\n }", "private static function toCamelCase($uri)\n {\n $name = '';\n $part_array = preg_split('/(-|_)/', $uri); // split string into parts\n foreach ($part_array as $p) // uppercase first letter\n $name .= ucfirst(strtolower($p));\n\n return $name;\n }", "public function getUcaseName() {\n return ucfirst($this->name);\n }", "protected function _normalizeHeader($name)\r\n\t{\r\n\t\t$filtered = str_replace(array('-', '_'), ' ', (string)$name);\r\n\t\t$filtered = ucwords(strtolower($filtered));\r\n\t\t$filtered = str_replace(' ', '-', $filtered);\r\n\t\treturn $filtered;\r\n\t}", "function humanize($str){\n return ucwords(preg_replace('/[_\\-]+/', ' ', strtolower(trim($str))));\n }", "static public function humanize($str)\n\t{\n\t\treturn ucfirst(str_replace(array('-', '_'), ' ', $str));\n\t}", "static public function underscored2readable($str) {\n $str = ucfirst($str);\n $str = str_replace(\"_\", \" \", $str);\n return $str;\n }", "function human_name($str, $is_class=false) {\n\t# best bet is to see if it has a cap, if so it's a classname\n\t$out = $str;\n\tif ((preg_match('|[A-Z]|', $str) == 1) || $is_class) {\n\t\t$out = preg_replace('/([a-zA-Z])([A-Z])/', '\\\\1 \\\\2', $str);\n\t}\n\t$out = str_replace('_', ' ', str_replace('-', ' ', $out));\n\treturn $out;\n}", "static function underscores_to_camelcase($string)\r\n {\r\n if (! isset(self :: $us_camel_map[$string]))\r\n {\r\n self :: $us_camel_map[$string] = ucfirst(preg_replace('/_([a-z])/e', 'strtoupper(\"\\1\")', $string));\r\n }\r\n return self :: $us_camel_map[$string];\r\n }", "public function underscoreLocale()\n {\n return str_replace('-', '_', $this->locale);\n }", "function nice_filename($name)\r\n{\r\n return preg_replace(\"(\\W)\", '_', strtolower($name));\r\n}", "static public function lc_( $name )\r\n {\r\n $name = lcfirst($name);\r\n $len = strlen($name);\r\n \r\n for( $i = 1; $i < $len; ++$i )\r\n {\r\n $ord = ord($name[$i]);\r\n if( $ord >= 65 && $ord <= 90 ) {\r\n $name = str_replace( $name[$i], '_'.lcfirst($name[$i]), $name );\r\n }\r\n }\r\n return $name;\r\n }", "public static function humanize($lower_case_and_underscored_word) {\n return ucwords(str_replace(\"_\",\" \",$lower_case_and_underscored_word));\n }", "public static function standardize( $name ) {\n\t\treturn self::firstUpper( self::lower( $name )) ;\n\t}", "private function _fieldNameToCamelCase($field) {\n $field_parts = explode('_', $field);\n $out = '';\n foreach ($field_parts as $part) {\n $out .= ucfirst($part);\n }\n return $out;\n }", "private function filterName($name)\n {\n $name = ucfirst($name);\n $name = str_replace('_', ' ', $name);\n \n return $name;\n }", "function str_camelcase($str, $capital_first_char = false)\n{\n $str = str_replace(' ', '', ucwords(str_replace('_', ' ', $str)));\n return $capital_first_char ? $str : lcfirst($str);\n}", "public function snakeCase($input)\n {\n return strtolower(preg_replace('/(.)([A-Z])/', '$1-$2', $input));\n }", "public static function urlToCamelCase($name)\n {\n $result = strtoupper(substr($name,0,1));\n $upper=false;\n for($x=1; $x<strlen($name); $x++){\n $digit = substr($name, $x,1);\n if($upper){\n $digit = strtoupper($digit);\n }\n if($digit=='-'){\n $upper = true;\n $digit='';\n }\n \n $result.=$digit;\n }\n return $result;\n }", "public static function underscoresToCamelCase($underscores)\n {\n $words = explode('_', $underscores);\n $camelCase = '';\n foreach ($words as $word) {\n $camelCase .= ucfirst($word);\n }\n return $camelCase;\n }", "function underscore(){\n\t\t$out = $this->_copy();\n\t\t$out->_String4 = mb_strtolower(preg_replace(\"/([a-z0-9\\p{Ll}])([A-Z\\p{Lu}])/u\",\"\\\\1_\\\\2\",$this->_String4));\n\t\treturn $out;\n\t}", "private function camelsSnake( $camel )\t{\n $this->debugBacktrace();\n\t\treturn strtolower( preg_replace( '/(?<=[a-z])([A-Z])|([A-Z])(?=[a-z])/', '_$1$2', $camel ) );\n\t}", "function convertNameToID($name) {\n $name = str_replace(\" \",\"-\",$name);\n $name = strtolower($name);\n return $name;\n}", "public function camelcase()\n {\n return new Name(Str::camel($this->name));\n }", "function acf_str_camel_case($string = '')\n{\n}", "protected function convertName($camel)\n {\n $snake = $this->camelToSnake($camel, '-');\n return preg_replace(\"/-/\", ':', $snake, 1);\n }", "function u_ ($s) {\n $out = preg_replace('/([^_])([A-Z])/', '$1_$2', $s);\n return 'u_' . strtolower($out);\n}", "function camelCase($input)\n{\n $words = \\__::words(preg_replace(\"/['\\x{2019}]/u\", '', $input));\n\n return array_reduce(\n $words,\n function ($result, $word) use ($words) {\n $isFirst = \\__::first($words) === $word;\n $word = \\__::toLower($word);\n return $result . (!$isFirst ? \\__::capitalize($word) : $word);\n },\n ''\n );\n}", "function makeNameLoud($name) {\n return strtoupper($name);\n }", "function p_url2name($url) {\n\treturn ucwords(\n\t\tstr_replace('~', ' / ',\n\t\tstr_replace('.', '-',\n\t\tstr_replace('-', ' ', $url))));\n}", "function title($title){\n\t$title = ucwords(str_replace(\"-\",\" \",$title));\n\treturn $title;\n}", "function pascal_case($value)\n {\n $value = ucwords(str_replace(['-', '_'], ' ', $value));\n\n return str_replace(' ', '', $value);\n }", "public static function camelToHuman($input)\n {\n return preg_replace('/([a-z])([A-Z])/', \"$1 $2\", $input);\n }", "function strtocapitalize($text) {\n\t$text = strtoupper(substr($text, 0, 1)) . substr($text, 1);\n\t$text = str_replace('_', ' ', $text);\n\treturn $text;\n}", "function field2name($field) {\n return str_replace(\n array('_a', '_b', '_c', '_d', '_e', '_f', '_g', '_h', '_i', '_j', '_k', '_l', '_m', '_n', '_o', '_p', '_q', '_r', '_s', '_t', '_u', '_v', '_w', '_x', '_y', '_z'), array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'), lcfirst($field)\n );\n}", "static function hyphenToUnderscore($string)\n {\n return str_replace('-', '_', $string);\n }", "public function urlToActionName($name){\n // just turn dash-format into upperCamelCaseFormat\n return preg_replace(\"/\\-(.)/e\", \"strtoupper('\\\\1')\", $name) . 'Action';\n }" ]
[ "0.74490577", "0.7393796", "0.69794315", "0.6956754", "0.6950425", "0.69501156", "0.68865997", "0.683025", "0.68098444", "0.6746379", "0.67367995", "0.6731833", "0.6728737", "0.67255443", "0.6722556", "0.6686416", "0.6675967", "0.667474", "0.6670215", "0.6659702", "0.66535217", "0.6648132", "0.66238064", "0.6616886", "0.66101825", "0.6598946", "0.6589793", "0.65771693", "0.655593", "0.6554246", "0.6550725", "0.6549364", "0.6523465", "0.651696", "0.65137964", "0.6494014", "0.64882004", "0.64876187", "0.6487041", "0.64868855", "0.6453799", "0.64527714", "0.6437746", "0.64346707", "0.6430238", "0.64205474", "0.64202225", "0.6384183", "0.6381461", "0.6365696", "0.63655245", "0.63559717", "0.6348374", "0.63437736", "0.63375795", "0.63361704", "0.632669", "0.63075817", "0.6300833", "0.62958086", "0.6292116", "0.6291998", "0.62803584", "0.62621766", "0.62601197", "0.62563324", "0.62513775", "0.62375265", "0.62323827", "0.6231081", "0.6225418", "0.62165445", "0.62108886", "0.61998457", "0.619516", "0.61944956", "0.61875254", "0.6185292", "0.61850435", "0.61745447", "0.61720645", "0.61647433", "0.616329", "0.61602604", "0.6159501", "0.61577165", "0.615732", "0.6155361", "0.61464876", "0.6144762", "0.61446303", "0.61432", "0.6142338", "0.61231107", "0.61160636", "0.6114755", "0.61093986", "0.61087763", "0.6107032", "0.61020744" ]
0.730191
2
Method for translation of names from underdash notation to camelCase
public static function underdashToCamel(string $s):string { $s = strtolower($s); $s = preg_replace('#_(?=[a-z])#', ' ', $s); $s = substr(ucwords('x' . $s), 1); $s = str_replace(' ', '', $s); return $s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function to_camelCase($value)\n{\n\t$under_pos=mixed();\n\tdo\n\t{\n\t\t$under_pos=strpos($value,'_');\n\t\tif ($under_pos!==false)\n\t\t{\n\t\t\t$value=substr($value,0,$under_pos).ucfirst(substr($value,$under_pos+1));\n\t\t}\n\t}\n\twhile ($under_pos!==false);\n\treturn $value;\n}", "public function camelCase($input)\n {\n return str_replace(' ', '', ucwords(str_replace(['_', '-'], ' ', $input)));\n }", "public function getCamelCaseName()\n {\n return lcfirst($this->getName());\n }", "public static function camelCase($str) {}", "public function underscore($camelCasedWord);", "protected function convName($name){\n if(ctype_upper(substr($name, 0, 1))){\n $name = strtolower(preg_replace('/([^A-Z])([A-Z])/', \"$1_$2\", $name));\n }\n else{\n $name = preg_replace('/(?:^|_)(.?)/e',\"strtoupper('$1')\", $name);\n }\n return $name;\n }", "protected function _getCaseInsensitiveName($name) {\n\n return str_replace('_', '-', mb_strtolower($name));\n\n }", "public static function camelToUnderdash(string $s):string {\n $s = preg_replace('#(.)(?=[A-Z])#', '$1_', $s);\n $s = strtolower($s);\n $s = rawurlencode($s);\n return $s;\n }", "function from_camelCase($value)\n{\n\t$out='';\n\t$len=strlen($value);\n\tfor ($i=0;$i<$len;$i++)\n\t{\n\t\t$char=$value[$i];\n\t\tif (strtolower($char)!=$char) $out.='_';\n\t\t$out.=strtolower($char);\n\t}\n\treturn $out;\n}", "public static function underscore2camelCase(string $key): string\n {\n return strtr($key, array_flip([\n 'A' => '_a', 'B' => '_b', 'C' => '_c', 'D' => '_d',\n 'E' => '_e', 'F' => '_f', 'G' => '_g', 'H' => '_h',\n 'I' => '_i', 'J' => '_j', 'K' => '_k', 'L' => '_l',\n 'M' => '_m', 'N' => '_n', 'O' => '_o', 'P' => '_p',\n 'Q' => '_q', 'R' => '_r', 'S' => '_s', 'T' => '_t',\n 'U' => '_u', 'V' => '_v', 'W' => '_w', 'X' => '_x',\n 'Y' => '_y', 'Z' => '_z',\n ]));\n }", "protected function camelCase($property){\n\t\t$split = explode('_', $property);\n\t\t$ucFirst = implode('', array_map('ucfirst', $split));\n\t\t$camelCase = lcfirst($ucFirst);\n\t\treturn $camelCase;\n\t}", "function hyphensToCamel($value)\n {\n return preg_replace(\"/\\-(.)/e\", \"strtoupper('\\\\1')\", $value);\n }", "function camelCase( $value ) {\n\t\t$value = ucwords( str_replace( array( '-', '_' ), ' ', $value ) );\n\n\t\treturn str_replace( ' ', '', $value );\n\t}", "function convertNamingFromUnderlineToCamelCase($text,$firstLetterLowerCase=true) {\n\t\t\tpreg_match_all('/(^[a-zA-Z])|(_[a-zA-Z])/', $text, $matches, PREG_PATTERN_ORDER);\n\t\n\t\t\tfor ($i = 0; $i < count($matches[0]); $i++) {\n\t\t\t\t\t$original=$matches[0][$i];\n\t\t\t\t\t$originals[]=$original;\n\t\t\t\t\tif ($i==0 and $firstLetterLowerCase)\n\t\t\t\t\t\t\t$replacement=str_replace('_','',$matches[0][$i]);\n\t\t\t\t\telse\n\t\t\t\t\t\t\t$replacement=strtoupper(str_replace('_','',$matches[0][$i]));\n\t\t\t\t\t$replacements[]=$replacement;\n\t\t\t}\n\t\n\t\t\treturn str_replace($originals,$replacements,$text);\n\t}", "public function underscoredToUpperCamelCaseDataProvider() {}", "function _toCamel($str) {\r\n if (!is_string($str)) return '';\r\n $func = create_function('$c', 'return strtoupper($c[1]);');\r\n return ucfirst(preg_replace_callback('/_([a-z])/', $func, $str));\r\n}", "public function camel($word);", "function underscore_to_camelcase($string){\n\t$cameled = '';\n\tfor($i=0; $i < strlen($string); $i++){\n\t\tif($string[$i] == '_'){\n\t\t\t$cameled .= strtoupper($string[$i+1]);\n\t\t\t$i++;\n\t\t}else{\n\t\t\t$cameled .= $string[$i];\n\t\t}\n\t}\n\treturn $cameled;\n}", "function camel($string) {\r\n\t$parts = preg_split('/[\\s_\\-]+/i',strtolower($string));\r\n\t$camel = array_shift($parts) . str_replace(\" \",\"\",ucwords(implode(\" \",$parts)));\r\n\treturn $camel;\r\n}", "function macro_convert_camel_to_human_readable($camel)\n{\n $camel = str_replace('_', ' ', $camel);\n $camel = str_replace('\\\\', ' ', $camel);\n $camel = preg_replace_callback(\n '/ ([A-Z])([a-z0-9])/Ss',\n function (array $matches) {\n return ' ' . strtolower($matches[1]) . $matches[2];\n },\n $camel\n );\n $camel = preg_replace_callback(\n '/([a-z0-9])([A-Z])([a-z0-9])/Ss',\n function (array $matches) {\n return $matches[1] . ' ' . strtolower($matches[2]) . $matches[3];\n },\n $camel\n );\n\n return ucfirst($camel);\n}", "private function transformName( $name ): string {\n\t\treturn lcfirst( implode( '', array_map( 'ucfirst', explode( '-', $name ) ) ) );\n\t}", "protected static function upperCamelCase($name)\n {\n /*\n $name = str_replace('-', ' ', $name);\n $name = ucwords($name);\n $name = str_replace(' ', '', $name);\n return $name;\n */\n\n return str_replace(' ', '', ucwords(str_replace('-', ' ', $name)));\n }", "public function camelize($str='') \n {\n return str_replace(' ', '', ucwords(str_replace(array('_', '-'), ' ', $str)));\n }", "static public function underscored2camelcased($str) {\n $func = function ($c) {\n return strtoupper($c[1]);\n };\n return preg_replace_callback('/_([a-z])/', $func, $str);\n }", "public static function dashesToCamelCase($dashes)\n {\n $words = explode('-', $dashes);\n $camelCase = '';\n foreach ($words as $word) {\n $camelCase .= ucfirst($word);\n }\n return $camelCase;\n }", "function underscoreToCamelCase($str, $capitalise_first_char = false) {\n if($capitalise_first_char) {\n $str[0] = strtoupper($str[0]);\n }\n $func = create_function('$c', 'return strtoupper($c[1]);');\n return preg_replace_callback('/_([a-z])/', $func, $str);\n }", "public function underscoredToLowerCamelCaseDataProvider() {}", "function from_camel_case($input)\n{\n preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches);\n $ret = $matches[0];\n foreach ($ret as &$match) {\n $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match);\n }\n return implode('_', $ret);\n}", "private function toCamelCase($action) {\n\t\tif (strpos($action, '-') !== false) {\n\t\t\t$camelCaseName = str_replace(' ', '', ucwords(str_replace('-', ' ', $action)));\n\t\t\t$camelCaseName[0] = strtolower($camelCaseName[0]);\n\t\t\t$action = $camelCaseName;\n\t\t}\n\t\treturn $action;\n\t}", "public function testToCamelCase() {\r\n $this->assertEquals('myTest', $this->_utils->toCamelCase('my test'));\r\n $this->assertEquals('myTest', $this->_utils->toCamelCase('my_test'));\r\n $this->assertEquals('myTest', $this->_utils->toCamelCase('my-test'));\r\n\r\n $this->assertEquals('myTestWithMoreWords', $this->_utils->toCamelCase('my test With-More_Words'));\r\n $this->assertEquals('myTestWithMoreWords', $this->_utils->toCamelCase('myTest_With-more_Words'));\r\n }", "function snakeToCamelCase(string $validator_name): string\r\n {\r\n $str_arr = explode(\"_\", $validator_name);\r\n if (count($str_arr) === 1) {\r\n return $str_arr[0];\r\n }\r\n $func_name = array_reduce(\r\n $str_arr,\r\n function ($current, $word) use ($validator_name) {\r\n $pos = strpos($word, $validator_name);\r\n if (!empty($current)) {\r\n $word[0] = strtoupper($word[0]);\r\n }\r\n return $current . $word;\r\n },\r\n \"\"\r\n );\r\n\r\n return $func_name;\r\n }", "public function camelCaseToLowerCaseUnderscoredDataProvider() {}", "static function camelCaseToUnderScore($string) \r\n {\r\n $start = 0;\r\n $data = array();\r\n $lower = strtolower($string);\r\n for ($k = 1; $k < strlen($string); $k++) {\r\n if ($lower[$k] != $string[$k]) {\r\n if ($k != $start) {\r\n $data[] = strtolower(substr($string, $start, $k - $start));\r\n $start = $k;\r\n }\r\n }\r\n }\r\n $data[] = strtolower(substr($string, $start, $k - $start));\r\n return implode('_', $data);\r\n }", "function camelCase($input)\n{\n $words = \\__::words(preg_replace(\"/['\\x{2019}]/u\", '', $input));\n\n return array_reduce(\n $words,\n function ($result, $word) use ($words) {\n $isFirst = \\__::first($words) === $word;\n $word = \\__::toLower($word);\n return $result . (!$isFirst ? \\__::capitalize($word) : $word);\n },\n ''\n );\n}", "function camelToHyphens($value)\n {\n return strtolower(preg_replace('/([a-zA-Z])(?=[A-Z])/', '$1-', $value));\n }", "public function camelize($lowerCaseAndUnderscoredWord);", "private static function toCamelCase($uri)\n {\n $name = '';\n $part_array = preg_split('/(-|_)/', $uri); // split string into parts\n foreach ($part_array as $p) // uppercase first letter\n $name .= ucfirst(strtolower($p));\n\n return $name;\n }", "public static function snakeCaseToCamelcase(string $snakeCase): string\n {\n $terms = explode('_', $snakeCase);\n if (count($terms) === 1) {\n return $snakeCase;\n }\n $withoutFirstTerm = array_slice($terms, 1);\n $camelCase[] = $terms[0];\n foreach ($withoutFirstTerm as $term) {\n $camelCase[] = ucwords($term);\n }\n return implode('', $camelCase);\n }", "function camelCaseToUnderscore($str) {\n $str[0] = strtolower($str[0]);\n $func = create_function('$c', 'return \"_\" . strtolower($c[1]);');\n return preg_replace_callback('/([A-Z])/', $func, $str);\n }", "function camelCaseToSnakeCase(string $input): string\n{\n return preg_replace('/[-\\.]/', '_', strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $input)));\n}", "public function makeCamelCaseName($name)\r\n\t{\r\n\t\t// Make new camelCase name without underscore\r\n\t\tfor ($i = 0; $i < strlen($name); $i++)\r\n\t\t{\r\n\t\t\tif ($i > 0 && $name[$i - 1] == '_')\r\n\t\t\t{\r\n\t\t\t\t$name[$i] = strtoupper($name[$i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$name = str_replace('_', '', $name);\r\n\t\treturn $name;\r\n\t}", "public function camelcase()\n {\n return new Name(Str::camel($this->name));\n }", "public static function camelize($lower_case_and_underscored_word) {\n \tif(strpos($lower_case_and_underscored_word, '_') === false)\n\t\t\treturn ucfirst($lower_case_and_underscored_word);\n\t\telse\n\t\t\treturn str_replace(' ','',ucwords(str_replace('_',' ',$lower_case_and_underscored_word)));\n }", "private function underscore(string $name)\n {\n $name = preg_replace_callback(\n '/[A-Z][A-Z]+/',\n function ($matches) {\n if (strlen($matches[0]) === 2) {\n return ucfirst(strtolower($matches[0]));\n } else {\n $lastChar = substr($matches[0], strlen($matches[0]) - 1, 1);\n $subject = substr($matches[0], 0, strlen($matches[0]) - 1);\n\n return ucfirst(strtolower($subject)).$lastChar;\n }\n },\n $name\n );\n\n return Inflector::tableize($name);\n }", "function camelize($options = array()){\n\t\t$options += array(\n\t\t\t\"lower\" => false,\n\t\t);\n\t\t$out = $this->_copy();\n\t\t$s = &$out->_String4;\n\t\t$s = preg_replace_callback(\"/_([a-z0-9\\p{Ll}])/ui\",function($matches){ return mb_strtoupper($matches[1]); },$this->_String4);\n\n\t\tif(mb_strlen($s)){\n\t\t\t$first = $out->substr( 0, 1);\n\t\t\t$first = $options[\"lower\"] ? mb_strtolower($first) : mb_strtoupper($first);\n\t\t\t$s = $first.$out->substr(1);\n\t\t}\n\n\t\treturn $out;\n\t}", "public static function normalizeHeaderName($name)\n {\n $result = str_replace(' ', '-', ucwords(str_replace(['-', '_'], ' ', strtolower($name))));\n return $result;\n }", "function camelCase($str, array $noStrip = [])\r\n{\r\n $str = preg_replace('/[^a-z0-9' . implode(\"\", $noStrip) . ']+/i', ' ', $str);\r\n $str = trim($str);\r\n // uppercase the first character of each word\r\n $str = ucwords($str);\r\n\r\n return $str;\r\n}", "function str_camelcase($str, $capital_first_char = false)\n{\n $str = str_replace(' ', '', ucwords(str_replace('_', ' ', $str)));\n return $capital_first_char ? $str : lcfirst($str);\n}", "public function getUcaseName() {\n return ucfirst($this->name);\n }", "function camel_case_with_initial_capital($s) {\n return camel_case($s, true);\n }", "public function camelize()\n {\n $encoding = $this->encoding;\n $stringy = $this->trim()->lowerCaseFirst();\n $stringy->str = preg_replace('/^[-_]+/', '', $stringy->str);\n\n $stringy->str = preg_replace_callback(\n '/[-_\\s]+(.)?/u',\n function($match) use ($encoding) {\n if (isset($match[1])) {\n return UTF8::strtoupper($match[1], $encoding);\n } else {\n return '';\n }\n },\n $stringy->str\n );\n\n $stringy->str = preg_replace_callback(\n '/[\\d]+(.)?/u',\n function($match) use ($encoding) {\n return UTF8::strtoupper($match[0], $encoding);\n },\n $stringy->str\n );\n\n return $stringy;\n }", "private function _fieldNameToCamelCase($field) {\n $field_parts = explode('_', $field);\n $out = '';\n foreach ($field_parts as $part) {\n $out .= ucfirst($part);\n }\n return $out;\n }", "public static function camelCase2underscore(string $key): string\n {\n $str = lcfirst($key);\n return strtr($str, [\n 'A' => '_a', 'B' => '_b', 'C' => '_c', 'D' => '_d',\n 'E' => '_e', 'F' => '_f', 'G' => '_g', 'H' => '_h',\n 'I' => '_i', 'J' => '_j', 'K' => '_k', 'L' => '_l',\n 'M' => '_m', 'N' => '_n', 'O' => '_o', 'P' => '_p',\n 'Q' => '_q', 'R' => '_r', 'S' => '_s', 'T' => '_t',\n 'U' => '_u', 'V' => '_v', 'W' => '_w', 'X' => '_x',\n 'Y' => '_y', 'Z' => '_z',\n ]);\n }", "protected function _underscore($name) {\n return strtolower(preg_replace('/(.)([A-Z])/', \"$1_$2\", $name));\n }", "static function underscores_to_camelcase($string)\r\n {\r\n if (! isset(self :: $us_camel_map[$string]))\r\n {\r\n self :: $us_camel_map[$string] = ucfirst(preg_replace('/_([a-z])/e', 'strtoupper(\"\\1\")', $string));\r\n }\r\n return self :: $us_camel_map[$string];\r\n }", "protected function normalizeHeaderName($name)\n {\n return strtr(ucwords(strtr(strtolower($name), array('_' => ' ', '-' => ' '))), array(' ' => '-'));\n }", "function getPuzzleName($name)\n {\n return str_replace(\"-\", \" \", ucwords($name));\n }", "static function camelize($word) {\n $parts = explode('/', $word);\n foreach ($parts as $key => $part) {\n $parts[$key] = str_replace(' ', '',\n ucwords(str_replace('_', ' ', $part)));\n }\n return join('_', $parts);\n }", "protected function mangleMethodName($name) {\n // explode on _\n $parts = explode('_', $name);\n // beginning of name is lowercase\n $name = strtolower(array_shift($parts));\n // if our parts count is now 0, return\n if(count($parts) < 1) {\n return $name;\n }\n // strtolower the rest\n $parts = array_map('strtolower', $parts);\n // camelcase it\n $parts = array_map('ucfirst', $parts);\n return $name . implode($parts);\n }", "protected static function normalizeHeaderName($name)\n {\n return str_replace(' ', '-', ucwords(str_replace('-', ' ', $name)));\n }", "public function getNormalizedName() {\n\n $name = str_replace(' ', '_', $this->getName());\n $name = strtolower($name);\n\n return preg_replace('/[^a-z0-9_]/i', '', $name);\n }", "function camelCase($str, array $noStrip = [])\n{\n $str = preg_replace('/[^a-z0-9' . implode(\"\", $noStrip) . ']+/i', ' ', $str);\n $str = trim($str);\n // uppercase the first character of each word\n $str = ucwords($str);\n $str = str_replace(\" \", \"\", $str);\n $str = lcfirst($str);\n\n return $str;\n}", "public static function camelCase($str) {\n $func = create_function('$c', 'return strtoupper($c[1]);');\n return preg_replace_callback('/_([a-z])/', $func, $str);\n }", "public static function urlToCamelCase($name)\n {\n $result = strtoupper(substr($name,0,1));\n $upper=false;\n for($x=1; $x<strlen($name); $x++){\n $digit = substr($name, $x,1);\n if($upper){\n $digit = strtoupper($digit);\n }\n if($digit=='-'){\n $upper = true;\n $digit='';\n }\n \n $result.=$digit;\n }\n return $result;\n }", "function to_camel_case($str, $capitalise_first_char = FALSE) {\n return GHelper::to_camel_case($str, $capitalise_first_char);\n}", "function uncapitalize(){\n\t\t$first = $this->substr(0,1)->downcase();\n\t\treturn $first->append($this->substr(1));\n\t}", "public static function standardize( $name ) {\n\t\treturn self::firstUpper( self::lower( $name )) ;\n\t}", "function acf_str_camel_case($string = '')\n{\n}", "function cp_make_custom_name($cname) {\r\n\r\n\t$cname = preg_replace('/[^a-zA-Z0-9\\s]/', '', $cname);\r\n\t$cname = 'cp_' . str_replace(' ', '_', strtolower(substr(appthemes_clean($cname), 0, 30)));\r\n\r\n\treturn $cname;\r\n}", "public static function underscoresToCamelCase($underscores)\n {\n $words = explode('_', $underscores);\n $camelCase = '';\n foreach ($words as $word) {\n $camelCase .= ucfirst($word);\n }\n return $camelCase;\n }", "function from_camel_case($str) {\n return GHelper::from_camel_case($str);\n}", "static function camelcase_to_underscores($string)\r\n {\r\n if (! isset(self :: $camel_us_map[$string]))\r\n {\r\n self :: $camel_us_map[$string] = preg_replace(array('/^([A-Z])/e', '/([A-Z])/e'), array(\r\n 'strtolower(\"\\1\")',\r\n '\"_\".strtolower(\"\\1\")'), $string);\r\n }\r\n return self :: $camel_us_map[$string];\r\n }", "function unu_ ($s) {\n $s = preg_replace('/^u_/', '', $s);\n return v($s)->u_to_camel_case();\n}", "static public function strToCamel($no_camel)\n {\n // do not alter string if there are no underscores\n if (stripos($no_camel, '_') == false)\n {\n return $no_camel;\n }\n $no_camel = strtolower($no_camel);\n $no_camel = str_replace('_', ' ', $no_camel);\n $no_camel = ucwords($no_camel);\n $array = explode(' ', $no_camel);\n $camel = '';\n foreach ($array as $key => $part)\n {\n if ($key == 0)\n {\n $camel .= strtolower($part);\n }\n else\n {\n $camel .= $part;\n }\n }\n return $camel;\n }", "protected function formatName($name)\n {\n return str_replace(['-', '_'], ' ', ucfirst(trim($name)));\n }", "function camel_case($s, $initialCapital = false) {\n\n $s = trim($s);\n if (!defined('PREG_BAD_UTF8_OFFSET_ERROR')) {\n $s = preg_replace('/([a-z\\d])([A-Z])/', '$1_$2', $s);\n } else {\n $s = preg_replace('/([\\p{Ll}\\d])(\\p{Lu})/', '$1_$2', $s);\n }\n\n $parts = preg_split('/[-_\\s]+/', $s);\n\n $result = '';\n foreach($parts as $part) {\n if ($result || $initialCapital) {\n $result .= strtoupper(substr($part, 0, 1)) . strtolower(substr($part, 1));\n } else {\n $result .= strtolower($part);\n }\n }\n\n return $result;\n }", "public static function toCamelCase($term)\n {\n $term = preg_replace_callback(\n '/[\\s_-](\\w)/',\n function ($matches) {\n return mb_strtoupper($matches[1]);\n },\n $term\n );\n $term[0] = mb_strtolower($term[0]);\n return $term;\n }", "public function uppercase()\n {\n return $this->getNameInstance()->uppercase();\n }", "public static function camelCase($val, $ucFirst = false): string\n {\n if (!$val || !\\is_string($val)) {\n return '';\n }\n\n $str = self::lowercase($val);\n\n if ($ucFirst) {\n $str = self::ucfirst($str);\n }\n\n return \\preg_replace_callback('/_+([a-z])/', function ($c) {\n return \\strtoupper($c[1]);\n }, $str);\n }", "function mdl_str_camelize(string $haystack, bool $capitalize = true)\n{\n $search_replace = static function (string $h, string $d) {\n return str_replace($d, '', ucwords($h, $d));\n };\n $first_capital = static function ($param) use ($capitalize) {\n return !$capitalize ? lcfirst($param) : $param;\n };\n return $first_capital($search_replace($haystack, '_'));\n}", "private function camelsSnake( $camel )\t{\n $this->debugBacktrace();\n\t\treturn strtolower( preg_replace( '/(?<=[a-z])([A-Z])|([A-Z])(?=[a-z])/', '_$1$2', $camel ) );\n\t}", "function _wp_to_kebab_case($input_string)\n {\n }", "static public function lc_( $name )\r\n {\r\n $name = lcfirst($name);\r\n $len = strlen($name);\r\n \r\n for( $i = 1; $i < $len; ++$i )\r\n {\r\n $ord = ord($name[$i]);\r\n if( $ord >= 65 && $ord <= 90 ) {\r\n $name = str_replace( $name[$i], '_'.lcfirst($name[$i]), $name );\r\n }\r\n }\r\n return $name;\r\n }", "function LetterCapitalize($str) { \r\n return ucwords($str); \r\n}", "private static function optionToName($str) {\n return str_replace(' ', '', ucwords(str_replace('_', ' ', $str)));\n }", "public static function toCamelCase($input)\n {\n return $input;\n }", "public static function camel($value)\n\t{\n\t\t$value = ucwords(str_replace(array('-', '_'), ' ', $value));\n\n\t\treturn str_replace(' ', '', $value);\n\t}", "private function filterName($name)\n {\n $name = ucfirst($name);\n $name = str_replace('_', ' ', $name);\n \n return $name;\n }", "public final function getName() { return strToUpper($this->name); }", "protected function formatClassName($name)\n {\n $name = ucwords(str_replace(['-', '_'], ' ', $name));\n\n return str_replace(' ', '', $name);\n }", "protected function _normalizeHeader($name) {\r\n\t\t$filtered = str_replace ( array (\r\n\t\t\t\t'-',\r\n\t\t\t\t'_' \r\n\t\t), ' ', ( string ) $name );\r\n\t\t$filtered = ucwords ( strtolower ( $filtered ) );\r\n\t\t$filtered = str_replace ( ' ', '-', $filtered );\r\n\t\treturn $filtered;\r\n\t}", "function camelCase($string, $delimiter){\n\t$exstring = explode($delimiter, $string);\n\t$exstringcam = array_map('ucwords', $exstring);\n\treturn implode($delimiter, $exstringcam);\n}", "final public function underscoreToCamelCase($string)\n {\n $callback = function($matches) { return strtoupper($matches[1]); };\n\n return preg_replace_callback('/_([a-z])/', $callback, $string);\n\n }", "function pascal_case($value)\n {\n $value = ucwords(str_replace(['-', '_'], ' ', $value));\n\n return str_replace(' ', '', $value);\n }", "function makeNameLoud($name) {\n return strtoupper($name);\n }", "public function lowercase()\n {\n return $this->getNameInstance()->lowercase();\n }", "public static function className($name)\n {\n $name = str_replace(array('-', '_'), ' ', $name);\n $name = ucwords(strtolower($name));\n $name = str_replace(' ', '', $name);\n\n return $name;\n }", "function fromCamelCase($str)\n{\n\t$str[0] = strtolower($str[0]);\n\t$func = create_function('$c', 'return \"_\" . strtolower($c[1]);');\n\treturn preg_replace_callback('/([A-Z])/', $func, $str);\n}", "function strtocapitalize($text) {\n\t$text = strtoupper(substr($text, 0, 1)) . substr($text, 1);\n\t$text = str_replace('_', ' ', $text);\n\treturn $text;\n}", "function camel_case($value)\n {\n return Str::camel($value);\n }" ]
[ "0.73825806", "0.7353722", "0.72965443", "0.7257356", "0.7240111", "0.7094033", "0.7087312", "0.70734143", "0.7046966", "0.7037271", "0.7032095", "0.70271367", "0.6998599", "0.6997931", "0.6978359", "0.6954778", "0.69258463", "0.6924489", "0.6917089", "0.69079334", "0.6905274", "0.68902826", "0.6870273", "0.68298256", "0.68179846", "0.68089736", "0.6804137", "0.6799667", "0.6798988", "0.6751879", "0.6742273", "0.6729126", "0.671309", "0.67076176", "0.6700788", "0.6699952", "0.6679791", "0.66772974", "0.6676076", "0.66755784", "0.6666228", "0.6633272", "0.6613054", "0.6604162", "0.6602186", "0.65999675", "0.6579735", "0.6576366", "0.6550132", "0.6532072", "0.6531357", "0.6519602", "0.6519111", "0.65179086", "0.65061516", "0.65017354", "0.64960545", "0.64809686", "0.6476273", "0.6475748", "0.64721805", "0.64692616", "0.6462951", "0.64591026", "0.64527977", "0.6452427", "0.6441953", "0.6435497", "0.64246553", "0.64076465", "0.64049286", "0.640178", "0.63962644", "0.63954407", "0.6351929", "0.63507926", "0.63477266", "0.634718", "0.63334095", "0.63293386", "0.63269866", "0.63194835", "0.6318477", "0.6307802", "0.63074046", "0.63028204", "0.63016003", "0.62973756", "0.62955797", "0.6291441", "0.6286689", "0.6285182", "0.62849027", "0.62808126", "0.6280361", "0.6278115", "0.62774056", "0.62728274", "0.62724775", "0.6268754" ]
0.75291705
0
Create a new blog.
public static function &create ($email, $name, $password) { global $papyrine; $sql = sprintf ( "INSERT INTO %s " . " (email, name, password) " . "VALUES " . " ('%s', '%s', '%s') " , self::TABLE, sqlite_escape_string ($email), sqlite_escape_string ($name), sqlite_escape_string (md5 ($password)) ); $result = $papyrine->database->connection->unbufferedQuery ($sql); return new SQliteUser ( $papyrine->database->connection->lastInsertRowid() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n\n if(!empty($this->data)){\n\n if($this->Blog->save($this->data)){\n $this->Session->setFlash(__('Your blog has been created'), 'success');\n $this->redirect(\"/blogs/edit/{$this->Blog->id}\");\n }else{\n $this->Session->setFlash(__('There was a problem creating your blog'), 'error');\n }\n }\n\n $this->set('syntaxes', $this->Blog->listSyntaxTypes());\n $this->set('postAccesses', $this->Blog->listPostAccess());\n $this->set('title_for_layout', 'Create a Blog');\n\n\n }", "public function create() {\n\t\t// new blog\n\t\t$blog = new BlogPost;\n\t\t// check if post\n\t\tif(Request::isMethod('post')) {\n\t\t\t// get input\n\t\t\t$blog = new BlogPost(Input::all());\n\t\t\t$blog->user_id = Auth::user()->id;\n\t\t\t// get file\n\t\t\tif(Input::hasFile('picture') && Input::file('picture')->isValid()) {\n\t\t\t\t$file = Input::file('picture');\n\t\t\t\t$filename = str_random(10) . \".\" . $file->getClientOriginalExtension();\n\t\t\t\t$file->move(\"assets/images/blog\", $filename);\n\t\t\t\t$blog->picture = $filename;\n\t\t\t} else {\n\t\t\t\t$blog->picture = null;\n\t\t\t}\n\t\t\t// save\n\t\t\tif($blog->save()) {\n\t\t\t\t// make name url\n\t\t\t\t$blog->name_url = str_replace(\".\", \"\", str_replace(\" \", \"-\", strtolower($blog->title))); \n\t\t\t\t$blog->save();\n\t\t\t\treturn Redirect::route('blog')->with(array('message' => 'Success!'));\n\t\t\t} else {\n\t\t\t\treturn View::make('blog.create')->with(array(\n\t\t\t\t\t'errors' => $blog->errors(), \n\t\t\t\t\t'blog' => $blog,\n\t\t\t\t\t'url' => 'blog/create',\n\t\t\t\t\t'method' => 'post'\n\t\t\t\t));\n\t\t\t}\n\t\t} else {\n\t\t\t// return edit page\n\t\t\treturn View::make('blog.create')->with(array(\n\t\t\t\t'blog' => $blog, \n\t\t\t\t'url' => 'blog/create',\n\t\t\t\t'method' => 'post'\n\t\t\t));\n\t\t}\n\t}", "public function create()\n\t{\n\t\treturn view('backend.blog.create');\n\t}", "public function actionCreate()\n\t{\t\t\n\t\t// Check Access\n\t\tcheckAccessThrowException('op_blog_addposts');\n\t\t\n\t\t$model = new BlogPost;\n\t\t\n\t\tif( isset( $_POST['BlogPost'] ) ) {\n\t\t\t$model->attributes = $_POST['BlogPost'];\n\t\t\tif( isset( $_POST['submit'] ) ) {\n\t\t\t\tif( $model->save() ) {\n\t\t\t\t\tfok(at('Page Created.'));\n\t\t\t\t\talog(at(\"Created Blog Post '{name}'.\", array('{name}' => $model->title)));\n\t\t\t\t\t$this->redirect(array('blog/index'));\n\t\t\t\t}\n\t\t\t} else if( isset( $_POST['preview'] ) ) {\n\t\t\t\t$model->attributes = $_POST['BlogPost'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$roles = AuthItem::model()->findAll(array('order'=>'type DESC, name ASC'));\n\t\t$_roles = array();\n\t\tif( count($roles) ) {\n\t\t\tforeach($roles as $role) {\n\t\t\t\t$_roles[ AuthItem::model()->types[ $role->type ] ][ $role->name ] = $role->name;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Add Breadcrumb\n\t\t$this->addBreadCrumb(at('Creating New Post'));\n\t\t$this->title[] = at('Creating New Post');\n\t\t\n\t\t// Display form\n\t\t$this->render('form', array( 'roles' => $_roles, 'model' => $model ));\n\t}", "public function create()\n {\n $obj['method'] = \"post\";\n return view('create_blog',$obj);\n }", "public function create() {\n\t\t\t\t$site_title = 'Create Blog Post';\n\t\t\t\t$blog = new Blog();\n\t\t\t\tif (is_post())\n\t\t\t\t\t{\n\t\t\t\t\t\t$blog->title =Input::get('title');\n\t\t\t\t\t\t$blog->content =Input::get('content');\n\t\t\t\t\t\t$blog->user_id = Auth::user()->id;\n\t\t\t\t\t\t$blog->save();\n\t\t\t\t\t\treturn Redirect::to('/admin/dashboard');\n\t\t\t\t\t}\n\n\t\t\t\treturn View::make('admin.form',compact('site_title', 'blog'));\n\t\t\t}", "public function create() {\n\t\t// Setup some variables\n\t\t$this->data['validation'] = '';\n\t\t$this->data['entry'] = array('title' => '', 'url_title' => '', 'content' => '', 'status' => '', 'category_id' => '');\n\t\t$this->data['statuses'] = array('' => '---', 'published' => 'Published', 'draft' => 'Draft', 'review' => 'Review');\n\t\t$this->data['categories'] = $this->mojo->blog_model->categories_dropdown();\n\t\t\n\t\t// Handle entry submission\n\t\tif ($this->mojo->input->post('entry')) {\n\t\t\t// Get the entry data and set some stuff\n\t\t\t$this->data['entry']\t\t \t\t= $this->mojo->input->post('entry');\n\t\t\t$this->data['entry']['author_id'] \t= $this->mojo->session->userdata('id');\n\t\t\t$this->data['entry']['date']\t\t= date('Y-m-d H:i:s');\n\t\t\t$this->data['entry']['status']\t\t= ($this->data['entry']['status']) ? $this->data['entry']['status'] : 'published';\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert($this->data['entry'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/index');\n\t\t\t\t$response['message'] = 'Successfully created new entry';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Load that bitchin' view\n\t\t$this->_view('create');\n\t}", "public function create()\n {\n $title = 'Create A Blog';\n return view('backend.blogs.create', compact('title'));\n }", "public function create()\n {\n //\n return view('blog.create');\n }", "public function create()\n {\n //\n return view('blog.create');\n\n }", "public function create()\n {\n //\n\n return view('blog.create');\n\n }", "public function create()\n {\n return view('dash.blog.create');\n }", "public function create()\n {\n return view('blog.create');\n //\n }", "public function create()\n {\n $data['menu'] = 'blog';\n $data['blog_categories'] = BlogCategory::get();\n return view('admin.blog.create', $data);\n }", "public function create() {\n // if it's a GET request display a blank form for creating a new product\n // else it's a POST so add to the database and redirect to readAll action\n if($_SERVER['REQUEST_METHOD'] == 'GET'){\n require_once('views/blogs/create.php');\n }\n else { \n BlogPost::add();\n $blogposts = BlogPost::all('BlogID', 'desc'); //$blogposts is used within the view\n require_once('views/blogs/readAll.php');\n }\n }", "public function create()\n {\n return view('backoffice.blog.create');\n }", "public function create()\n {\n return view('admin_panel.blog.create');\n }", "public function create()\n {\n return view('blog.create');\n }", "public function create()\n {\n return view('blog.create');\n }", "public function create()\n {\n return view('blog.create');\n }", "public function create()\n {\n return view('blog.create');\n }", "public function create()\n {\n return view('blog.create');\n }", "public function create()\n {\n return view('blog.create');\n }", "public function create()\n {\n return view('blog.create');\n }", "public function createAction(BlogEntry $newBlog) {\n\t\t$this->blogEntryRepository->add($newBlog);\n\t\t$this->flashMessageContainer->add('Created a new blog.');\n\t\t$this->redirect('index');\n\t}", "public function createPost(Request $request)\n {\n $validator = Validator::make($request->all(),[\n 'subject' => 'required|max:128',\n 'content' => 'required'\n ]);\n\n if ($validator->fails()) {\n return redirect('/blog/create')\n ->withInput()\n ->withErrors($validator);\n }\n\n $blog = new Blog;\n $blog->user_id = Auth::id();\n $blog->subject = $request['subject'];\n $blog->content = $request['content'];\n $blog->save();\n\n return redirect('blog/'.$blog->id);\n }", "function create()\n {\n helper('form');\n $model = new blogmodel();\n\n //To check if the textbox is not empty and length of text are within specific range\n if (! $this->validate([\n 'title' => 'required|min_length[3]|max_length[255]',\n 'description' => 'required',\n 'tag' => 'required',\n ])) { \n echo view('templates/header');\n echo view('blog/create');\n echo view('templates/footer');\n }else{\n $file = $this->request->getFile('userfile');\n //to upload image to public file if image is uploaded\n if ($file->isValid()) {\n $file->move('public/uploads');\n }\n //to save row to database with their keys\n $model->save(\n [\n 'title' => $this->request->getVar('title'),\n 'description' => $this->request->getVar('description'),\n 'tag' => $this->request->getVar('tag'),\n 'image'=> $file->getName(),\n 'name' => $this->request->getVar('name')\n ]\n );\n $session = \\Config\\Services::session();\n $session->setFlashdata('success', 'New post was successfully created');\n return redirect()->to('/'); //to go back to home page\n }\n }", "public function create()\n\t{\n\t\t$category=config('global.category');\n\t\t$radio=config('global.radio');\n\t\t$checkbox=config('global.checkbox');\n\t\treturn view('blog.create', compact('category', 'radio', 'checkbox'));\n\t}", "public function blogNewAction()\n {\n // Check if the blog was posted\n if ($this->request->isPost() && $this->security->checkToken()) {\n $post = new Blog();\n $post->url = $this->request->getPost('title');\n $post->title = $this->request->getPost('title');\n $post->text = $this->request->getPost('message');\n $post->author = $this->session->get('user')->name;\n $post->date = $this->request->getPost('date');\n\n // The form was sent\n $this->view->setVar(\"form_sent\", true);\n\n // Validation\n if ($post->validation()) {\n if ($post->save()) {\n $this->view->setVar(\"form_success\", true);\n $this->view->setVar(\"form_message\", \"Blog post successvol bijgewerkt / geplaatst.\");\n } else {\n $this->view->setVar(\"form_success\", false);\n $this->view->setVar(\"form_message\", \"Niet alle velden zijn correct ingevuld.\");\n error_log(\"\\nFailed to add blog message: \".print_r($post->getMessages(), true));\n }\n } else {\n $this->view->setVar(\"form_success\", false);\n $this->view->setVar(\"form_message\", \"Niet alle velden zijn correct ingevuld.\");\n error_log(\"\\nFailed to add blog message: \".print_r($post->getMessages(), true));\n }\n } else {\n $this->view->setVar(\"form_sent\", false);\n }\n\n // Render the view\n $this->assets->addJs('share/plugins/jquery/jquery.selection.js');\n $this->assets->addJs('assets/js/editor.js');\n $this->view->setVar('form_action', 'new');\n $this->view->setVar('action', 'new');\n $this->view->pick('pages/admin/blog/form');\n }", "public function create()\n {\n //\n return view('adminblog.create');\n }", "public function create()\n {\n return view('blog/create');\n }", "public function store(FormCreateBlog $request)\n {\n $request->validated();\n $obj = new Blog();\n $obj->title = $request->get('title');\n $obj->description = $request->get('description');\n $obj->details = $request->get('detail');\n $obj->author = $request->get('author');\n $obj->status = 1;\n $thumbnails = $request->get('thumbnails');\n foreach ($thumbnails as $thumbnail) {\n $obj->thumbnail .= $thumbnail . ',';\n }\n $obj->created_at = Carbon::now()->format('Y-m-d H:i:s');\n $obj->updated_at = Carbon::now()->format('Y-m-d H:i:s');\n $obj->save();\n return redirect('/admin/blogs');\n }", "public function create()\n {\n $title = \"Create Blog\";\n $tags = Tag::where('status', 1)->get();\n $blog = [];\n // $tag_name = Tag::where('id', $blog->id)->pluck('name')->first();\n return view('dashboard.blog.create', [\n 'title' => $title,\n 'blog' => $blog,\n 'tags' => $tags,\n // 'tag_name' => $tag_name,\n\n ]);\n }", "public function store(Request $request) {\n $submit = $_POST['post'];\n if(!empty($submit)) {\n if(isset($submit['id']) && !empty($submit['id'])) {\n $blog = Blog::find($submit['id']);\n if(!empty($blog)) {\n $blog->update(\n [\n 'title' => $submit['title'],\n 'description' => $submit['description']\n ]\n );\n return redirect()->route('blog.edit', $blog->id);\n }\n }\n else{\n// $blog = Blog::create(\n// [\n// 'title' => (isset($submit['title']) && $submit['title'] !== '') ? $submit['title'] : '',\n// 'description' => (isset($submit['description']) && $submit['description'] !== '') ? $submit['description'] : '',\n// ]);\n $blog = new Blog();\n $userId = Auth::id();\n $blog->title = (isset($submit['title']) && $submit['title'] !== '') ? $submit['title'] : '';\n $blog->description = (isset($submit['description']) && $submit['description'] !== '') ? $submit['description'] : '';\n $blog->created_by = (isset($userId) && $userId !== '') ? $userId : '';\n if($blog->save()) {\n return redirect()->route('blog.edit', $blog->id);\n }\n }\n }\n }", "public function post()\n\t{\n\t\t$crud = $this->generate_crud('blog_posts');\n\t\t$crud->columns('author_id', 'category_id', 'title', 'image_url', 'tags', 'publish_time', 'status');\n\t\t$crud->set_field_upload('image_url', UPLOAD_BLOG_POST);\n\t\t$crud->set_relation('category_id', 'blog_categories', 'title');\n\t\t$crud->set_relation_n_n('tags', 'blog_posts_tags', 'blog_tags', 'post_id', 'tag_id', 'title');\n\t\t\n\t\t$state = $crud->getState();\n\t\tif ($state==='add')\n\t\t{\n\t\t\t$crud->field_type('author_id', 'hidden', $this->mUser->id);\n\t\t\t$this->unset_crud_fields('status');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$crud->set_relation('author_id', 'admin_users', '{first_name} {last_name}');\n\t\t}\n\n\t\t$this->mPageTitle = 'Blog Posts';\n\t\t$this->render_crud();\n\t}", "public function create()\n {\n //\n\n return view('front.career-advisor.blog.add');\n }", "public function add($id=null) \n\t\t{\t\t\t\n\t\t\tif ($this->request->is('post')) \n\t\t\t{\t\n\t\t\t\n\t\t\t\t$insert['user_id']=$this->data['Blog']['user_id'];\n\t\t\t\t$insert['title']=htmlentities($this->data['Blog']['title']);\n\t\t\t\t$insert['comments']=htmlentities($this->data['Blog']['comments']);\t\n\t\t\t\n\t\t\t\t$this->Blog->create();\n\t\t\t\t \n\t\t\t\tif ($this->Blog->save($insert)) \n\t\t\t\t{\n\t\t\t\t\t$this->Session->setFlash('Your post has been saved.');\n\t\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$this->Session->setFlash('Unable to add your post.');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function create()\n {\n return view('backend.blogs.create');\n }", "public function create()\n {\n return view('backend.blogs.create');\n\n }", "public function wpmu_create_blog() {\n global $json_api;\n\n $this->_verify_admin();\n $this->_verify_nonce('wpmu_create_blog');\n\n extract( $_REQUEST );\n\n if(!isset($domain))\n $json_api->error(__(\"You must send the 'domain' parameter.\"));\n\n if(!isset($title))\n $json_api->error(__(\"You must send the 'title' parameter.\"));\n\n if(!isset($user_id))\n $json_api->error(__(\"You must send the 'user_id' parameter.\"));\n\n if(!isset($path))\n $path = '/';\n\n if(!isset($meta))\n $meta = '';\n\n $blog_id = wpmu_create_blog( $domain, $path, $title, $user_id, $meta );\n\n if ( is_wp_error( $blog_id ) )\n $json_api->error( $blog_id->get_error_message() );\n else\n return array( \"blog\" => get_blog_details( $blog_id ) );\n }", "public function create()\n {\n //\n\n return view('admin.blog_add_new');\n }", "public function postCreate(Request $request)\n\t{\n\t\t$date = jDate::forge('now')->format('%d %B ، %Y');\n\t\t$b=new tbl_blogs;\t\n\t\t$b->title=$request->title;\n\t\t$b->content=$request->messageArea;\n\t\t$b->categorizes=$request->item_id;\n\t\t$b->tag=$request->item_id;\n\t\t$b->date=$date;\n\t\t$b->save();\n\t\treturn redirect('home/blog');\n\t}", "public function store(BlogsCreateRequest $request)\n {\n\n $blog=Blog::create([\n 'blog_category_id'=>$request->blog_category_id,\n 'name'=>$request->name,\n 'description_short'=>$request->description_short,\n 'description_full'=>$request->description_full,\n 'tags'=>$request->tags,\n 'flag'=>'0',\n 'amount'=>$request->amount,\n ]);\n\n session()->flash('success','New Post added.');\n return redirect(route('bloggalleryview',$blog->id));\n }", "public function create()\n {\n return view('addblog');\n }", "public function create()\n {\n return view('blogs.create');\n }", "public function create()\n {\n return view('blogs.create');\n }", "public function create()\n {\n return view('blogs.create');\n }", "public function createAction(Request $request)\n {\n $blogItem = new BlogPost();\n $blogItem->setTitle('New blogposts');\n\n\n $form = $this->createFormBuilder($blogItem)\n ->add('title', TextType::class)\n ->add('header', TextType::class)\n ->add('body', TextType::class)\n ->add('categories', TextType::class)\n ->add('save', SubmitType::class, array('label' => 'Post Blog'))\n ->getForm();\n\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n // $form->getData() holds the submitted values\n // but, the original `$task` variable has also been updated\n $blogPost = $form->getData();\n\n // ... perform some action, such as saving the task to the database\n // for example, if Task is a Doctrine entity, save it!\n $em = $this->getDoctrine()->getManager();\n $em->persist($blogPost);\n $em->flush();\n\n return $this->redirectToRoute('blog_list');\n }\n\n // replace this example code with whatever you need\n return $this->render('default/createBlogPost.html.twig', [\n 'base_dir' => realpath($this->getParameter('kernel.project_dir')).DIRECTORY_SEPARATOR,\n 'form' => $form->createView()\n ]);\n\n\n }", "public function create()\n {\n return view('admin.blog.add');\n }", "public function store(CreateBlogPostRequest $request)\n {\n $input = $request->all();\n\n $blogPost = $this->blogPostRepository->create($input);\n\n Flash::success('Blog Post saved successfully.');\n\n return redirect(route('blogPosts.index'));\n }", "public function create()\n\t{\n\t\t//check if the user has signin or not, only signed in user has the authority to view the create page. If the user is not signed in and visit the 'create' page, redirect the user to the sign in page. \n\t\tif(!isset($_SESSION['email']))\n\t\t{\n\t\t\tredirect('admin/login');\n\t\t}\n\n\t\t// Get all the categories including the category's name and its introdcution.\n\t\t$data = $this->Service->get_latest_blogs();\n\n\t\t//If the data from the form is valid, we insert it into the database, then redirect to the 'show' page. If the data is not valid, we re-populate the data to the 'create' page.\n\n\t\t//set validation rules for the form input\n\t\t$config = array(\n\t array(\n\t 'field' => 'author',\n\t 'label' => 'Author',\n\t 'rules' => 'required'\n\t ),\n\t array(\n\t 'field' => 'category_id',\n\t 'label' => 'Category id',\n\t 'rules' => 'required',\n\t ),\n\t array(\n\t 'field' => 'title',\n\t 'label' => 'Blog title',\n\t 'rules' => 'required'\n\t ),\n\t array(\n\t 'field' => 'editor1',\n\t 'label' => 'CKEditor',\n\t 'rules' => 'required'\n\t )\n\t\t);\n\n\t\t$this->form_validation->set_rules($config);\n\n\t\t// if there is any invalid input, back to 'create' page\n\t\tif ($this->form_validation->run() === FALSE)\n \t{\n\t\t\t$this->load->view('templates/header', $data);\n\t $this->load->view('blogs/create');\n\t $this->load->view('templates/footer');\n \t}\n\n \t// if all form input data are valid, insert the data into databae, then redirect to page 'show'\n \telse\n \t{\n\t $this->Blogs_model->insert_blog(); // insert the blog into the databae table 'blogs'\n\n\t redirect('blogs/home');// redirect to page show\n \t} \n\t}", "public function create()\n {\n return view('quicksite::modules.blogs.create');\n }", "public function create()\n {\n //\n $cat = Category::where('type', 'blog')->get();\n return view('admin.blog.create',compact('cat'));\n }", "public function create()\n {\n return view('frontend.blog.post.create');\n }", "public function create()\n {\n return view('admin.blogs.create');\n }", "public function create()\n {\n return view('admin.blogs.create');\n }", "public function create()\n {\n return view('admin.blogs.create');\n }", "public function create()\n {\n return view('admin.blogs.create');\n }", "public function create()\n {\n $data['categories']=BlogCategory::get();\n \n return view('admin.blog.create',$data);\n }", "public function publishBlog(Request $request){\n $email = \\Auth::user()->email;\n $user_id = User::all()->where('email', $email)->first();\n \n Blog::create([\n 'user_id' => $user_id[\"id\"],\n 'title' => $request->title,\n 'content' => trim($request->content)\n ]);\n\n return redirect()->route('blogs');\n }", "public function create()\n {\n return view('admin.blogs.create',['title'=>trans('admin.create')]);\n }", "public function create()\n {\n\n return view('admin.blogs.create', [\n ]);\n }", "public function create()\n{ \n \n return view('blog.create');\n}", "public function store()\n\t{\n\t\t$input['author']=\"Gad Aaron A. Surop\";\n\t\t$input=Request::all();\n\t\tBlogs::create($input);\n\t\treturn redirect('bloggers');\n\n\t}", "public function create()\n {\n $categories = Category::get();\n return view('admin.pages.blog.create', compact('categories'));\n }", "public function create($data = array())\n\t{\n\n\t\t$blog = $this->prepareData($data);\n\n\t\tif ($blog->save()) {\n\t\t\t\n\t\t\t//ToDo : TagSave function\n\t\t\tHelper::tagSave($blog->id, $data['blog_tag']);\n\n\t\t\tif (\\Module::isEnabled('field')) {\n\n\t\t\t \\Field::save('blog', $blog);\n\n\t\t\t}\n\n\t\t\treturn $blog;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function create()\n {\n return view('blogposts.create');\n }", "public function actionCreate()\n {\n $model = new BlogComments();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function store(BlogCreateRequest $request)\n {\n if ($request->hasFile('image')) {\n $ext = $request->file('image')->getClientOriginalExtension();\n $this->blog->image = $request->file('image')->storeAs(\n 'public/blog_images', time() . '.' . $ext\n );\n }\n \n $title = $request['title'];\n $description = $request['description'];\n $content = $request['content'];\n $user_id = $request['user_id'];\n $image = $request['image'];\n\n $blog = Blog::create($request->only('title', 'description', 'content','user_id','image'));\n return redirect()->route('admin_blogs.index')\n ->with('flash_message','Blog successfully added.');\n }", "public function create()\n {\n return view('admin.blog_entries.create');\n }", "public function create()\n {\n $data= [];\n $data['page_title']=\"Blogs\";\n $data['action']=\"create\";\n return view('Blogs.manage',compact('data')); \n }", "public function create(Request $request)\n {\n \n return view('blog.create',['data' => $request->all()]);\n }", "public function create()\n {\n $result = $this->service->create();\n return view(getThemeView('blog.article.create'))->with($result);\n }", "protected function create(array $data)\n {\n return Blog::create([\n 'title' => $data['title'],\n 'small_desc' => $data['small_desc'],\n 'body' => $data['body'],\n 'imageurl' => $data['imageurl']\n ]);\n }", "public function create()\n {\n $blogPostCategories = BlogPostCategory::all();\n return view('admin.blog_post.create',compact('blogPostCategories'));\n }", "public static function create()\n {\n if(isset($_POST['create_post']) && Html::form()->validate())\n {\n $postId = Blog::post()->insert(array(\n 'user_id' => User::current()->id,\n 'title' => $_POST['title'],\n 'slug' => String::slugify($_POST['title']),\n 'body' => $_POST['body']\n ));\n\n if($postId)\n {\n foreach($_POST['category_id'] as $catId)\n {\n Db::table('categories_posts')->insert(array(\n 'category_id' => $catId,\n 'post_id' => $postId\n ));\n }\n\n Message::ok('Post created successfully.');\n $_POST = array(); // Clear form\n }\n else\n Message::error('Error creating post. Please try again.');\n }\n\n $formData[] = array(\n 'fields' => array(\n 'title' => array(\n 'title' => 'Title',\n 'type' => 'text',\n 'validate' => array('required')\n ),\n 'body' => array(\n 'title' => 'Body',\n 'type' => 'textarea',\n 'attributes' => array('class' => 'tinymce')\n ),\n 'category_id[]' => array(\n 'title' => 'Category',\n 'type' => 'select',\n 'options' => self::_getSelectCategories(),\n 'attributes' => array(\n 'multiple' => 'multiple'\n ),\n 'validate' => array('required')\n ),\n 'create_post' => array(\n 'type' => 'submit',\n 'value' => 'Create Post'\n )\n )\n );\n\n return array(\n 'title' => 'Create Post',\n 'content' => Html::form()->build($formData)\n );\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'story' => 'required'\n ]);\n \n $blog = new Blog;\n $blog->title = $request->input('title');\n $blog->story = $request->input('story');\n $blog->save();\n return redirect('/blog')->with('success', 'Blog Created');\n }", "public function create() {\n // we expect a url of form ?controller=comment&action=create\n // if it's a GET request display a blank form for creating a new comment\n // else it's a POST so add to the database using models/comment.php\n if($_SERVER['REQUEST_METHOD'] == 'GET'){\n require_once('views/blogs/read.php');\n }\n else { \n $blogcomment = Comment::addComment($_GET['blogid']);\n require('models/comment.php');\n }\n }", "function create_empty_blog($domain, $path, $weblog_title, $site_id = 1)\n {\n }", "public function create()\n {\n $blog = false;\n return view('admin.blog.form',compact('blog'));\n }", "public function create()\n {\n $category = CategoryModel::all();\n return view('backend.blog.create',compact('category'));\n }", "public function get_create($blog_post_id = null, $user_id = null)\n\t{\n\t\tAcl::can('get_comments_create');\n\n\t\t\t\t\n\t\t$blog_post = array('' => 'SELECIONE') + Blog_post::order_by('id', 'asc')->take(999999)->lists('id', 'id');\n\t\t\t\t\n\t\t$user = array('' => 'SELECIONE') + User::order_by('id', 'asc')->take(999999)->lists('id', 'id');\n\n\t\t$this->layout->title = 'New Blog Comment';\n\t\t$this->layout->content = View::make('blog.comments.create', array(\n\t\t\t\t\t\t\t\t\t'blog_post' => $blog_post,\n\t\t\t\t\t\t\t\t\t'user' => $user,\n\t\t\t\t\t\t\t\t));\n\t}", "public function create(Blog $blog)\n {\n return view('blog.create', compact('blog'));\n }", "public function blogAction()\n {\n\n \t$blogId = $this->_request->getParam(2);\n $page = $this->_request->getParam(3);\n\n $blog = Data::factory($blogId, Blog::ITEM_TYPE);\n\t\tif(empty($blog)){\n throw new Lib_Exception_NotFound(\"Blog '$blogId' not found\");\n }\n\n Zend_Registry::set('Category', $blog->getCategory());\n Zend_Registry::set('SubCategory', $blog->getSubCategory());\n\n $table = new Blog_Post();\n $select = $table->select();\n $select->where(\"blogId = $blog->id\");\n\n // Regular users only see valid posts\n if(!$blog->isEditableBy($this->_user, $this->_acl)){\n \t$select->where(\"status = '\".Data::VALID.\"'\");\n }\n $select->order(\"date DESC\");\n\n $posts = $this->_helper->dataPaginator($select, $page, 'commonviews/pagination.phtml', BLOGPOSTS_PER_PAGE);\n\n $this->view->blog = $blog;\n $this->view->dataType = 'Blog_Post';\n $this->view->posts = $posts;\n \n if($this->_user->getId() == $blog->getSubmitter()->getId()){\n \t$this->_useAdditionalContent = false;\n \t$this->_helper->layout->setLayout('one-column');\n } else {\n \t$this->_useAdditionalContent = true;\n \t$this->_helper->layout->setLayout('two-columns');\n \t$this->view->wrapperIsCard = true;\n }\n \n \n }", "public function create()\n {\n $blogCategory = BlogCategory::all();\n\n $data = [\n 'blogCategorys' => $blogCategory\n ];\n\n return view('blog_posts.create',$data);\n }", "public function storePost(Request $request)\n {\n $request->validate(\n [\n 'title' => 'required',\n 'body' => 'required',\n ]\n );\n $article = new Blog();\n $article->title = $request->get('title');\n $article->body = $request->get('body');\n $article->author = Auth::id();\n $article->save();\n return redirect()->route('all_posts')->with('status', 'New article has been successfully created!');\n }", "public function addAction()\n {\n $isSubmitted = $this->params()->fromPost('submitted', \n null);\n $model = new \\Application\\Model\\BlogPost();\n if($isSubmitted){\n $date = $this->params()->fromPost(\"date\");\n $date = new \\DateTime($date);\n $date = $date->format('Y-m-d');\n //add a new blog entry\n $model ->setBody($this->params()->fromPost('body'))\n ->setCreatedBy(\"Alana Thomas\")\n ->setDate($date)\n ->setTitle($this->params()->fromPost('title'))\n ->setTags($this->params()->fromPost('tags'));\n $model = $this->getServiceLocator()->get(\"Application\\Service\\BlogPost\")->insert($model);\n //redirect the user here\n return $this->redirect()->toRoute('blog-post');\n }\n $view = $this->acceptableViewModelSelector($this->acceptCriteria);\n $view->setVariables(array(\n 'model' => $model\n ));\n return $view;\n }", "public function create()\n {\n return view('frontend.customer.blog_create');\n }", "public function create()\n {\n// return view('user-production.form-tabs.blog-create', [\n// 'user' => auth()->user(),\n// ]);\n return view('admin.blog.create', [\n 'blog'=>Blog::all(),\n ]);\n }", "public function create()\n {\n $blog_categories = BlogCategory::all()->sortBy('name');\n $tags = array();\n\n foreach (Blog::all()->pluck('tags')->toArray() as $key) {\n if (!empty($key))\n $tags = array_merge($tags, $key);\n }\n $tags = array_unique($tags);\n\n\n return view('admin.blog_add')->with([\n 'blog_categories' => $blog_categories,\n 'tags' => $tags,\n ]);\n }", "public function create()\n {\n $data = array();\n $data['title'] = $_POST['title'];\n $data['content'] = $_POST['content'];\n $data['time'] = $_POST['time'];\n \n $this->model->create($data);\n header('location:'. URL .'index');\n }", "public function create()\n {\n return view('blog-post/blog-form');\n }", "public function create()\n {\n $inputs = $this->validate([\n 'title' => 'required|min_length[5]',\n 'description' => 'required|min_length[5]',\n ]);\n\n if (!$inputs) {\n return view('posts/create', [\n 'validation' => $this->validator\n ]);\n }\n\n $this->post->save([\n 'title' => $this->request->getVar('title'),\n 'description' => $this->request->getVar('description')\n ]);\n session()->setFlashdata('success', 'Success! post created.');\n return redirect()->to(site_url('/posts'));\n }", "public function post_create()\n\t{\n\t\tAcl::can('post_comments_create');\n\n\t\t$validation = Validator::make(Input::all(), array(\n\t\t\t'user_id' => array('required', 'integer'),\n\t\t\t'blog_post_id' => array('required', 'integer'),\n\t\t\t'content' => array('required'),\n\t\t));\n\n\t\tif($validation->valid())\n\t\t{\n\t\t\t$comment = new Blog_Comment;\n\n\t\t\t$comment->user_id = Input::get('user_id');\n\t\t\t$comment->blog_post_id = Input::get('blog_post_id');\n\t\t\t$comment->content = Input::get('content');\n\n\t\t\t$comment->save();\n\n\t\t\tCache::forget(Config::get('cache.key').'comments');\n\n\t\t\tSession::flash('message', 'Added comment #'.$comment->id);\n\n\t\t\treturn Redirect::to('blog/comments');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('blog/comments/create')\n\t\t\t\t\t->with_errors($validation->errors)\n\t\t\t\t\t->with_input();\n\t\t}\n\t}", "public function create()\n\t{\n\t\treturn view('bloggers.create');\n\t}", "public function create()\n {\n //\n $post['title'] = 'Create your post';\n //return view('blog.create',compact('post'));\n\n // adding data for the category element\n // get the columns name and id to choose a category\n $cats = Category::orderBy('name')->pluck('name', 'id');\n $tags = Tag::orderBy('name')->pluck('name', 'id');\n\n return view('blog.create', compact('cats','post','tags'));\n\n }", "public function makeblog($blogFields = [])\n {\n /** @var blogRepository $blogRepo */\n $blogRepo = App::make(blogRepository::class);\n $theme = $this->fakeblogData($blogFields);\n return $blogRepo->create($theme);\n }", "public function actionCreate() {\n $model = new Blog;\n if (!Yii::app()->params['blog_user_auto'])\n $model->scenario = 'bloguser';\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n $model->publish_date = date(\"m/d/Y H:i:s\");\n if (isset($_POST['Blog'])) {\n $model->attributes = $_POST['Blog'];\n $model->createdon = new CDbExpression('NOW()');\n $model->page_address_identifier = CommonFunctions::getUrlFriendlyString($model->title, $model->tableName(), 0, 'blog_id');\n $model->publish_date = (trim($_POST['Blog']['publish_date']) != '' ? date(Yii::app()->params['mysqlDateTimeFormat'], strtotime($_POST['Blog']['publish_date'])) : '');\n //Start a transaction in case something goes wrong\n if (Yii::app()->params['ajaxFileUpload'])\n $model->image = Yii::app()->user->getState(Yii::app()->params['blogajaxImageVar']);\n $transaction = $model->dbConnection->beginTransaction();\n try {\n //Save the model to the database\n if ($model->save()) {\n /* $fileurl = $model->blogImgBehavior->FileUrl;\n $filename = substr($fileurl,strrpos($fileurl, \"/\")+1);\n CommonFunctions::updateFileField($filename,$model->blog_id,'blog_id','image',$model->tableName()); */\n $file_name = CUploadedFile::getInstance($model, 'image');\n if ($file_name !== null) {\n $fileurl = $model->blogImgBehavior->FileUrl;\n $filemask = substr($fileurl, strrpos($fileurl, \"/\") + 1);\n CommonFunctions::updateFileField($filemask, $model->blog_id, 'blog_id', 'image', $model->tableName(), 'image_name_date', $file_name);\n }\n //update page identifier\n if (substr($model->page_address_identifier, -2) == '-0') {\n CommonFunctions::updatePageAddressField($model->tableName(), \"page_address_identifier\", substr($model->page_address_identifier, 0, strlen($model->page_address_identifier) - 1) . $model->blog_id, 'blog_id', $model->blog_id);\n }\n\n $transaction->commit();\n EUserFlash::setSuccessMessage(CommonFunctions::getText(MSG_RECORD_INSERT_SUCCESS));\n $this->redirect(array('admin'));\n }\n } catch (Exception $e) {\n $transaction->rollback();\n Yii::app()->handleException($e);\n $message = $e->getMessage();\n EUserFlash::setErrorMessage($message);\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function create()\n {\n $types = $this->postTypeRepository->getAllForSelect();\n\n return view('admin.blog.posts.create', compact('types'));\n }", "public function createBlog($blogNumber = 1) {\n\t\t\t// initialize blog\n\t\t$blog = $this->objectManager->create('ExtbaseTeam\\\\BlogExample\\\\Domain\\\\Model\\\\Blog');\n\t\t$blog->setTitle('Blog #' . $blogNumber);\n\t\t$blog->setDescription('A blog about TYPO3 extension development.');\n\n\t\t\t// create author\n\t\t$author = $this->objectManager->create('ExtbaseTeam\\\\BlogExample\\\\Domain\\\\Model\\\\Person', 'Stephen', 'Smith', 'foo.bar@example.com');\n\n\t\t\t// create administrator\n\t\t$administrator = $this->objectManager->create('ExtbaseTeam\\\\BlogExample\\\\Domain\\\\Model\\\\Administrator');\n\t\t$administrator->setName('John Doe');\n\t\t$administrator->setEmail('john.doe@example.com');\n\t\t$blog->setAdministrator($administrator);\n\n\t\t\t// create sample posts\n\t\tfor ($postNumber = 1; $postNumber < 6; $postNumber++) {\n\n\t\t\t\t// create post\n\t\t\t$post = $this->objectManager->create('ExtbaseTeam\\\\BlogExample\\\\Domain\\\\Model\\\\Post');\n\t\t\t$post->setTitle('The ' . $postNumber . '. post of blog #' . $blogNumber);\n\t\t\t$post->setAuthor($author);\n\t\t\t$post->setContent('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.');\n\n\t\t\t\t// create comments\n\t\t\t$comment = $this->objectManager->create('ExtbaseTeam\\\\BlogExample\\\\Domain\\\\Model\\\\Comment');\n\t\t\t$comment->setDate(new \\DateTime());\n\t\t\t$comment->setAuthor('Peter Pan');\n\t\t\t$comment->setEmail('peter.pan@example.com');\n\t\t\t$comment->setContent('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.');\n\t\t\t$post->addComment($comment);\n\n\t\t\t$comment = $this->objectManager->create('ExtbaseTeam\\\\BlogExample\\\\Domain\\\\Model\\\\Comment');\n\t\t\t$comment->setDate(new \\DateTime('2009-03-19 23:44'));\n\t\t\t$comment->setAuthor('John Smith');\n\t\t\t$comment->setEmail('john@matrix.org');\n\t\t\t$comment->setContent('Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.');\n\t\t\t$post->addComment($comment);\n\n\t\t\t\t// create some random tags\n\t\t\tif (rand(0, 1) > 0) {\n\t\t\t\t$tag = $this->objectManager->create('ExtbaseTeam\\\\BlogExample\\\\Domain\\\\Model\\\\Tag', 'MVC');\n\t\t\t\t$post->addTag($tag);\n\t\t\t}\n\t\t\tif (rand(0, 1) > 0) {\n\t\t\t\t$tag = $this->objectManager->create('ExtbaseTeam\\\\BlogExample\\\\Domain\\\\Model\\\\Tag', 'Domain Driven Design');\n\t\t\t\t$post->addTag($tag);\n\t\t\t}\n\t\t\tif (rand(0, 1) > 0) {\n\t\t\t\t$tag = $this->objectManager->create('ExtbaseTeam\\\\BlogExample\\\\Domain\\\\Model\\\\Tag', 'TYPO3');\n\t\t\t\t$post->addTag($tag);\n\t\t\t}\n\n\t\t\t\t// add the post to the current blog\n\t\t\t$blog->addPost($post);\n\t\t\t$post->setBlog($blog);\n\t\t}\n\n\t\treturn $blog;\n\t}", "public function saveBlogPost() {\r\n\t\t\r\n\t\t//$this->verifyID($toid);\r\n\t\t$html_tags = '<b><p><br></br><u><ul><li><table><tr><th><td><i>';\r\n\r\n\t\t// controleer of submit gepost is\r\n\t\tif (isset($_POST['admblogsubmit'])) {\r\n\t\t\t\r\n\t\t\t// check: velden voor titel en content zijn niet leeg\r\n\t\t\tif (!empty($_POST[\"admblogtitle\"] && $_POST['admblogcontent'])) {\r\n\r\n\t\t\t\t// schrijf post inputs weg naar variabelen\r\n\t\t\t\t$admblogtitle = strip_tags($_POST[\"admblogtitle\"], $html_tags);\r\n\t\t\t\t$admblogintro = strip_tags($_POST[\"admblogintro\"], $html_tags);\r\n\t\t\t\t$admblogcontent = strip_tags($_POST[\"admblogcontent\"], $html_tags);\r\n\t\t\t\t$admurl = strtolower(preg_replace('/[[:space:]]+/', '-', $_POST['admblogtitle']));\r\n\t\t\t\t\r\n\t\t\t\t// maak PDO connectie om weg te schrijven + set attributes voor error meldingen\r\n\t\t\t\t$stmt = new PDO(\"mysql:host=localhost;dbname=demo\", 'root', '');\r\n\t\t\t\t$stmt->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t\t\t\t\r\n\t\t\t\t// try query\r\n\t\t\t\ttry {\r\n\t\t\t\t\t\t$query = $stmt->prepare(\"INSERT INTO `evdnl_blog_posts_yc` (create_date, modify_date, title, intro, content, dashedtitle) VALUES(CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '$admblogtitle', '$admblogintro', '$admblogcontent', '$admurl')\");\r\n\t\t\t\t\t\t$query->execute();\r\n\t\t\t\t\t\t$this->createBlogPostFile();\r\n\r\n\t\t\t\t\t\t// sluit PDO connectie\r\n\t\t\t\t\t\t$query = NULL;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// catch error\r\n\t\t\t\t\tcatch (PDOException $e) {\r\n\t\t\t\t\t\techo $e->getMessage();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}" ]
[ "0.8135118", "0.79737824", "0.77590305", "0.7753429", "0.7659681", "0.76393026", "0.760142", "0.75600696", "0.7547385", "0.748623", "0.7474838", "0.7444864", "0.74052954", "0.73966813", "0.7394973", "0.7386151", "0.7360962", "0.7346637", "0.7346637", "0.7346637", "0.7346637", "0.7346637", "0.7346637", "0.7346637", "0.7340086", "0.733523", "0.73134065", "0.72710186", "0.7266579", "0.7255074", "0.7248752", "0.7211304", "0.7195102", "0.7181869", "0.717258", "0.7161635", "0.71502155", "0.7148034", "0.71477", "0.7146384", "0.71231633", "0.7122518", "0.71199465", "0.71172017", "0.7113306", "0.7113306", "0.7113306", "0.7102087", "0.70990294", "0.7089894", "0.7088475", "0.7079852", "0.7066588", "0.7065457", "0.7065454", "0.7065454", "0.7065454", "0.7065454", "0.7030212", "0.69961905", "0.6994772", "0.699355", "0.6984409", "0.6978173", "0.69772196", "0.6969743", "0.6962686", "0.6952528", "0.6948494", "0.6939627", "0.68952703", "0.6895268", "0.6891879", "0.6876123", "0.68603593", "0.6851924", "0.68486476", "0.68275046", "0.68158144", "0.6802472", "0.67981905", "0.67980546", "0.67964315", "0.67863387", "0.6781152", "0.67791355", "0.6772586", "0.6765615", "0.6753215", "0.6724332", "0.67176926", "0.6713885", "0.6707852", "0.670622", "0.67046344", "0.66782904", "0.667771", "0.66636205", "0.6651178", "0.66489863", "0.66390866" ]
0.0
-1
Handle an incoming request.
public function handle($request, Closure $next) { $ryhmaID = $request->route('ryhmaID'); $user = \Auth::user(); if (!$user->targetgroup_id) { return redirect('member/etusivu')->with('error', 'Pääsy estetty. Et ole varausryhmän jäsen. [Virhekoodi: 788]'); } else if ($ryhmaID != $user->targetgroup_id) { \Session::flash('operationfail', 'Pääsy estetty - hakemasi tiedot kuuluvat vieraaseen varausryhmään.'); return redirect('member/' . $user->targetgroup_id .'/etusivu')->with('error', 'Pääsy estetty. Et ole varausryhmän jäsen. [Virhekoodi: 792]'); } // Bind so we can use it in the controllers \Input::merge(['targetgroup_id' => $user->targetgroup_id]); return $next($request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $request);", "public function handle($request);", "public function handleRequest() {}", "function handleRequest() ;", "public function handle(Request $request);", "protected function handle(Request $request) {}", "public function handle(array $request);", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "abstract protected function process(Request $request);", "public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }", "abstract function handle(Request $request, $parameters);", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function handle(ServerRequestInterface $request);", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }", "function handle(Request $request = null, Response $response = null);", "public function processRequest();", "public abstract function processRequest();", "public function handleRequest(Request $request, Response $response);", "abstract public function processRequest();", "public function handle(array $request = []);", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }", "public function process(Request $request, Response $response, RequestHandlerInterface $handler);", "public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function handle(Request $request): Response;", "public static function process_http_request()\n {\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "abstract public function handle(ServerRequestInterface $request): ResponseInterface;", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}", "public function handle($request, $next);", "public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }", "public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }", "public function process($path, Request $request);", "public function handle(string $query, ServerRequestInterface $request);", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "public function handle($request)\n {\n $this->setRouter($this->app->compose('Cygnite\\Base\\Router\\Router', $request), $request);\n\n try {\n $response = $this->sendRequestThroughRouter($request);\n /*\n * Check whether return value is a instance of Response,\n * otherwise we will try to fetch the response form container,\n * create a response and return to the browser.\n *\n */\n if (!$response instanceof ResponseInterface && !is_array($response)) {\n $r = $this->app->has('response') ? $this->app->get('response') : '';\n $response = Response::make($r);\n }\n } catch (\\Exception $e) {\n $this->handleException($e);\n } catch (Throwable $e) {\n $this->handleException($e);\n }\n\n return $response;\n }", "public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }", "public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }", "final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }", "public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function handle(RequestInterface $request): ResponseInterface;", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function process(\n ServerRequestInterface $request,\n RequestHandlerInterface $handler\n );", "protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}", "public function handleHttpRequest($requestParams)\n\t{\n\t\t$action = strtolower(@$requestParams[self::REQ_PARAM_ACTION]);\t\t\n\t\t$methodName = $this->actionToMethod($action);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$this->$methodName($requestParams);\n\t\t} catch(Exception $e)\n\t\t{\n\t\t\techo \"Error: \".$e->getMessage();\n\t\t}\n\t}", "public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }", "public function handle(ClientInterface $client, RequestInterface $request, HttpRequest $httpRequest);", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public function serve_request()\n {\n }", "public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}", "function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }", "public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}", "public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }", "public function RouteRequest ();", "public function handle(ServerRequestInterface $request, $handler, array $vars): ?ResponseInterface;", "public function DispatchRequest ();", "protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "abstract public function request();", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function processAction(Request $request)\n {\n // Get the request Vars\n $this->requestQuery = $request->query;\n\n // init the hybridAuth instance\n $provider = trim(strip_tags($this->requestQuery->get('hauth_start')));\n $cookieName = $this->get('azine_hybrid_auth_service')->getCookieName($provider);\n $this->hybridAuth = $this->get('azine_hybrid_auth_service')->getInstance($request->cookies->get($cookieName), $provider);\n\n // If openid_policy requested, we return our policy document\n if ($this->requestQuery->has('get') && 'openid_policy' == $this->requestQuery->get('get')) {\n return $this->processOpenidPolicy();\n }\n\n // If openid_xrds requested, we return our XRDS document\n if ($this->requestQuery->has('get') && 'openid_xrds' == $this->requestQuery->get('get')) {\n return $this->processOpenidXRDS();\n }\n\n // If we get a hauth.start\n if ($this->requestQuery->has('hauth_start') && $this->requestQuery->get('hauth_start')) {\n return $this->processAuthStart();\n }\n // Else if hauth.done\n elseif ($this->requestQuery->has('hauth_done') && $this->requestQuery->get('hauth_done')) {\n return $this->processAuthDone($request);\n }\n // Else we advertise our XRDS document, something supposed to be done from the Realm URL page\n\n return $this->processOpenidRealm();\n }", "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "public function handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);", "public function handle(Request $request, Closure $next);", "public function handleGetRequest($id);", "abstract function doExecute($request);", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "abstract public function mapRequest($request);", "public function handle(ServerRequestInterface $request)\n {\n $router = $this->app->get(RouterInterface::class);\n $response = $router->route($request);\n\n if (! headers_sent()) {\n\n // Status\n header(sprintf(\n 'HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase()\n ));\n\n // Headers\n foreach ($response->getHeaders() as $name => $values) {\n foreach ($values as $value) {\n header(sprintf('%s: %s', $name, $value), false);\n }\n }\n }\n\n echo $response->getBody()->getContents();\n }", "abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);", "private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }", "public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}", "protected function handle(Request $request)\n {\n return 1;\n }", "public function __invoke(Request $request, RequestHandler $handler) {\n R::setup('mysql:host=127.0.0.1;dbname=cellar','root','');\n \n $response = $handler->handle($request);\n R::close();\n return $response;\n }", "public function handle($req)\n {\n $params = $req->post ?: [];\n\n $files = $this->transformFiles($req->files);\n\n $cookies = $req->cookie ?: [];\n\n $server = $this->transformHeadersToServerVars(array_merge($req->header, [\n 'PATH_INFO' => array_get($req->server, 'path_info'),\n ]));\n $server['X_REQUEST_ID'] = Str::uuid()->toString();\n\n $requestUri = $req->server['request_uri'];\n if (isset($req->server['query_string']) && $req->server['query_string']) {\n $requestUri .= \"?\" . $req->server['query_string'];\n }\n\n $resp = $this->call(\n strtolower($req->server['request_method']),\n $requestUri, $params, $cookies, $files,\n $server, $req->rawContent()\n );\n\n return [\n 'status' => $resp->getStatusCode(),\n 'headers' => $resp->headers,\n 'body' => $resp->getContent(),\n ];\n }", "public function handle(Request $request)\n {\n $route_params = $this->_router->match($request->getUri());\n $route = $route_params['route'];\n $params = $route_params['params'];\n\n $func = reset($route) . self::CONTROLLER_METHOD_SUFIX;\n $class_name = key($route);\n $controller = new $class_name($request);\n\n $response = call_user_func_array(\n [\n $controller,\n $func,\n ],\n [$params]\n );\n\n if ($response instanceof Response) {\n return $response;\n } else {\n throw new InvalidHttpResponseException();\n }\n }" ]
[ "0.8299201", "0.8147294", "0.8147294", "0.8147294", "0.8127764", "0.7993589", "0.7927201", "0.7912899", "0.7899075", "0.76317674", "0.75089735", "0.7485808", "0.74074036", "0.7377414", "0.736802", "0.7294553", "0.72389543", "0.7230166", "0.72108", "0.71808434", "0.7170364", "0.71463037", "0.7126907", "0.7122795", "0.71225274", "0.7116879", "0.70607233", "0.6981947", "0.6966695", "0.69393975", "0.6912079", "0.68985975", "0.6887614", "0.68774897", "0.6806274", "0.67969805", "0.67778915", "0.6762979", "0.67565143", "0.67533374", "0.67192745", "0.6683243", "0.66487724", "0.66395754", "0.6634629", "0.66283566", "0.6617558", "0.6610097", "0.6610011", "0.6544976", "0.653806", "0.6512757", "0.64682734", "0.64381886", "0.6416964", "0.63373476", "0.63359964", "0.6334543", "0.63308066", "0.6321675", "0.63176167", "0.631661", "0.6310991", "0.63108873", "0.6295945", "0.6279438", "0.62778515", "0.62508965", "0.62422955", "0.62321424", "0.62237644", "0.6203428", "0.61954546", "0.6191255", "0.61774665", "0.61682004", "0.6151806", "0.61271876", "0.61257905", "0.6116093", "0.61126447", "0.6112368", "0.6101652", "0.60893977", "0.60871464", "0.60862815", "0.60734737", "0.60535145", "0.6028341", "0.60250086", "0.60224646", "0.6011745", "0.6011483", "0.60106593", "0.5998867", "0.5997086", "0.5991233", "0.59844923", "0.59668386", "0.5961315", "0.5954762" ]
0.0
-1
Run the database seeds.
public function run() { $name = 'Mihai Pol'; Artist::create([ 'name' => $name, 'slug' => Helper::slugify($name), ]); $name = 'Suciu'; Artist::create([ 'name' => $name, 'slug' => Helper::slugify($name), ]); $name = 'Cristi Cons'; Artist::create([ 'name' => $name, 'slug' => Helper::slugify($name), ]); $name = 'Vlad Caia'; Artist::create([ 'name' => $name, 'slug' => Helper::slugify($name), ]); $name = 'Sit'; Artist::create([ 'name' => $name, 'band' => true, 'slug' => Helper::slugify($name), ])->artists()->saveMany([ Artist::where('name', 'Cristi Cons')->first(), Artist::where('name', 'Vlad Caia')->first(), ]); $name = 'Vlad Radu'; Artist::create([ 'name' => $name, 'slug' => Helper::slugify($name), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Lists the module's items
public function list_items($limit = NULL, $offset = 0, $col = 'id', $order = 'asc', $just_count = FALSE) { $this->db->order_by('datum', 'desc'); $this->db->join('pressarticle_sources', 'pressarticle_sources.id = pressarticles.source_id'); $this->db->select('pressarticles.id as id, pressarticles.name as name, pressarticle_sources.name as quelle, pressarticles.datum as datum, pressarticles.published as published'); $data = parent::list_items($limit, $offset, $col, $order, $just_count); if (!$just_count) { foreach ($data as $key => $val) { $data[$key]['datum'] = get_ger_date($data[$key]['datum']); } } if ($col == 'datum') array_sorter($data, $col, $order); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModulesList();", "public function index()\n {\n\t // here we use MY_Model's get_all() method to fetch everything\n\t $items = $this->ramstrg_sites_m->get_all();\n\n\n\t // Build the view with ramstrg/views/admin/items.php\n\t $this->template\n\t\t ->title($this->module_details['name'])\n\t\t ->set('items', $items)\n\t\t ->build('admin/items');\n }", "public function index() {\n\t\t$data = $this->load_module_info ();\n\t\t\n\t\t$this->layout->display_admin ( $this->folder . $this->module . \"-list\", $data );\n\t}", "function moduleContent()\t{\n\t\t$this->content .= $this->makeList();\n\t}", "public function listModules() {\n\t\t\t// to use languages\n\t\t\tglobal $language;\n\t\t\t$this->lang = $language[parse_lang()];\n\n\t\t\t// only open when directory really exists\n\t\t\t$handler = file_exists($this->dir) ? opendir($this->dir) : die($this->lang['nodirectory']);\n\n\t\t\twhile (false !== ($entry = readdir($handler))) {\n\t\t\t\tif(preg_match('/^[m][o][d][_][0-9][A-Za-z]{3,}[.][p][h][p]$/', $entry)) {\n\t\t\t\t\tinclude($this->dir.'/'.$entry);\n\t\t\t\t\tif($config['innav'] == true) $this->listArray[$entry] = $config;\n\t\t\t\t\t$this->listRequires[$config['name']] = $requires;\n\t\t\t\t\t$this->listAttributes[$config['name']] = $config;\n\t\t\t\t}\n\t\t\t\tksort($this->listArray);\n\t\t\t}\n\t\t}", "public function indexAction()\n {\n $active = Pi::registry('modulelist')->read('active');\n $inactive = Pi::registry('modulelist')->read('inactive');\n\n $modules = array_merge($active, $inactive);\n foreach ($modules as $name => &$data) {\n $meta = Pi::service('module')->loadMeta(\n $data['directory'],\n 'meta'\n );\n $author = Pi::service('module')->loadMeta(\n $data['directory'],\n 'author'\n );\n $data['description'] = $meta['description'];\n $data['author'] = $author;\n $data['active'] = isset($active[$name]) ? true : false;\n if (empty($meta['logo'])) {\n $data['logo'] = Pi::url('static/image/module.png');\n } elseif (empty($data['active'])) {\n $data['logo'] = Pi::url('script/browse.php') . '?' . sprintf(\n 'module/%s/asset/%s',\n $data['directory'],\n $meta['logo']\n );\n } else {\n $data['logo'] = Pi::service('asset')->getModuleAsset(\n $meta['logo'],\n $data['name']\n );\n }\n if (empty($data['update'])) {\n $data['update'] = __('Never updated.');\n } else {\n $data['update'] = _date($data['update']);\n }\n }\n $this->view()->assign('modules', $modules);\n //$this->view()->setTemplate('module-list');\n $this->view()->assign('title', __('Installed modules'));\n }", "function listitems($name)\r\n\t\t{\r\n\t\t \t\r\n\t\t}", "function qa_list_modules_info()\n{\n\tglobal $qa_modules;\n\treturn $qa_modules;\n}", "public function modload()\n\t{\n\t\tmodules::init_module( 'cs_list', self::MOD_VERSION, self::MOD_AUTHOR, 'chanserv', 'default' );\n\t\t// these are standard in module constructors\n\t\t\n\t\tchanserv::add_help( 'cs_list', 'help', &chanserv::$help->CS_HELP_LIST_1, true );\n\t\tchanserv::add_help( 'cs_list', 'help list', &chanserv::$help->CS_HELP_LIST_ALL, true );\n\t\t// add the help\n\t\t\n\t\tchanserv::add_command( 'list', 'cs_list', 'list_command' );\n\t\t// add the list command\n\t}", "public function listing();", "public function index()\n {\n $moduleitems = DB::table('downloads')\n ->leftjoin('downloadcats','downloads.category_id','=','downloadcats.id')\n ->select('downloads.id','downloads.title','downloads.download_count','downloads.filename as file_name','downloadcats.title as category')\n ->get();\n return $moduleitems;\n }", "public function items ()\n {\n }", "public function getModuleList(){\n $qb = $this->createQueryBuilder();\n $qb->module('system')->query('modulelistnames');\n return $this->execute($qb);\n }", "public function actionList() {\n $this->_getList();\n }", "public function indexAction() {\n $service = $this->getItemService();\n\n $items = $service->findAll();\n \n return array(\n 'items' => $items,\n );\n }", "function getItems();", "function getItems();", "public function index() {\n\t\t$mod = $this->MODULE;\n\t\t$modules = TableRegistry::get('Modules')->find('list')\n\t\t->where(['type'=> $this->MODULE])->toArray();\n\t\t$categories = $this->Categories->find('threaded')->toArray();\n\t\t$categories = Hash::combine($categories, '{n}.id', '{n}', '{n}.module_id');\n\t\t$this->set(compact('modules', 'mod', 'categories'));\n\t}", "public function index()\n {\n return $this->module_service->all();\n }", "public function availableAction()\n {\n $modules = array();\n //$modulesInstalled = $this->installedModules();\n $iterator = new \\DirectoryIterator(Pi::path('module'));\n foreach ($iterator as $fileinfo) {\n if (!$fileinfo->isDir() || $fileinfo->isDot()) {\n continue;\n }\n $directory = $fileinfo->getFilename();\n if (preg_match('/[^a-z0-9_]/i', $directory)) {\n continue;\n }\n $meta = Pi::service('module')->loadMeta($directory, 'meta');\n if (empty($meta)) {\n continue;\n }\n $author = Pi::service('module')->loadMeta($directory, 'author');\n //$clonable = isset($meta['clonable']) ? $meta['clonable'] : false;\n //$meta['installed'] = in_array($directory, $modulesInstalled);\n $meta['installed'] = Pi::registry('module')\n ->read($directory) ? true : false;\n if (empty($meta['clonable']) && $meta['installed']) {\n continue;\n }\n $meta['logo'] = !empty($meta['logo'])\n ? Pi::url('script/browse.php') . '?'\n . sprintf('module/%s/asset/%s', $directory, $meta['logo'])\n : Pi::url('static/image/module.png');\n $modules[$directory] = array(\n 'meta' => $meta,\n 'author' => $author,\n );\n }\n\n $this->view()->assign('modules', $modules);\n $this->view()->assign('title', __('Modules ready for installation'));\n }", "private function listModules() {\n\t\t\n\t\t$tabModules = array ();\n\t\t\n\t\t# search for modules in {appPath}/lib/modules/{module_name}/{module_name}.class.php\n\t\t$res = opendir(LIB_MOD);\n\t\t$i = 0;\n\t\twhile (false !== ($fModule = readdir($res))) {\n\t\t\tif (is_dir(LIB_MOD . $fModule) && $fModule != '.' && $fModule != '..') {\n\t\t\t\tif (is_file(LIB_MOD . $fModule .'/'. $fModule .'.class.php')) {\n\t\t\t\t\t$tabModules[$i]['name'] = $fModule;\n\t\t\t\t\t$tabModules[$i]['link'] = $this->conf['general']['appURL'] .'?action='. $fModule .'.show';\n\t\t\t\t\t++$i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($res);\n\t\t$ret = array (\n\t\t\t'modules'\t=> $tabModules\n\t\t);\n\t\t\n\t\treturn $ret;\n\t}", "function components_list(){\n\n\t\t?><li data-type=\"test\" title=\"Sample Title\"></li><?php\n\t}", "protected function generateModuleMenu() {}", "public function index()\n {\n $data['row'] = $this->items_m->get();\n $this->template->load('template', 'product/item/item_data', $data);\n }", "public function index()\n {\n $modules = Module::all();\n return view('modules.list', ['modules' => $modules]);\n }", "public function index()\n {\n $title = $this->title;\n $module_name = $this->module_name;\n $module_icon = $this->module_icon;\n\n $page_heading = \"All \" . $module_name;\n\n $$module_name = Permission::paginate(5);\n\n return view(\"backend.$module_name.index\", compact('title', 'page_heading', 'module_icon', \"module_name\", \"$module_name\"));\n }", "public function listAction() {}", "public function getModules();", "public function getModules();", "public function actionIndex()\n {\n $searchModel = new ModuleSearch();\n //$dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n /* show only modules whose with status = {published, archived} in list view */\n $qParams = Yii::$app->request->queryParams;\n $qParams['ModuleSearch']['statusList'] = ['published','archived'];\n $dataProvider = $searchModel->search($qParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function listar(){\n\trequire './moduloprestamos/modelos/prestamosModelo.php';\n\n\t//Le pide al modelo todos los items\n\t$items = buscarTodosLosItems();\n\n\t//Pasa a la vista toda la información que se desea representar\n\trequire './moduloprestamos/vistas/listar.php';\n}", "public function items()\n {\n \n }", "function listNavigationItems()\n{\n include('models/navigation.php');\n $items = getAllNavigationItems();\n return [\n 'page' => 'admin/lists/navigation.php',\n 'items' => $items,\n 'edit_link' => 'index.php?p=admin&module=navigation&action=edit&id=',\n 'delete_link' => 'index.php?p=admin&module=navigation&action=delete&id=',\n ];\n}", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n $modules = Module::paginate(8);\n $title = 'Category';\n $custom_cat = 'module';\n return view('admin.backend.module.module',compact('modules', 'title', 'custom_cat'));\n }", "function listContent()\n {\n }", "public function getItem_list()\r\n {\r\n return $this->item_list;\r\n }", "public function getModules()\n {\n return $this['module.list'];\n }", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n $searchData = $_POST['searchData'];\n $searchData['kind'] = 1;\n $searchData['login_user'] = $this->login_id;\n\n switch ($id) {\n case 1:\n $header = array(\"序号\", \"账号\", \"姓名\", \"角色\", \"新增时间\", \"操作\");\n $cols = 6;\n\n $contentList = $this->user_model->getItems($searchData);\n $footer = (count($contentList) == 0 || !isset($contentList)) ? $footer = \"没有数据.\" : '';\n break;\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }", "public function index()\n\t{\n\t\t// Modules in \"modules\" folder\n\t\t$found_modules = Modules()->get_modules();\n\n\t\t// ionize Modules config\n\t\t$modules = array();\n\t\tinclude APPPATH . 'config/modules.php';\n\n\t\t// Get all modules from folders\n\t\tforeach($found_modules as $folder => &$module)\n\t\t{\n\t\t\t// Does the module install tables in DB ?\n\t\t\t$module['uses_database'] = FALSE;\n\t\t\t$module['installed'] = FALSE;\n\t\t\t$module['uri_user_segment'] = $module['uri'];\n\n\t\t\tif (in_array($folder, $modules))\n\t\t\t{\n\t\t\t\t// Set installed to true\n\t\t\t\t$module['installed'] = TRUE;\n\n\t\t\t\t// Get the user segment\n\t\t\t\tforeach($modules as $segment => $f)\n\t\t\t\t{\n\t\t\t\t\tif ($f == $folder)\n\t\t\t\t\t\t$module['uri_user_segment'] = $segment;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->template['modules'] = $found_modules;\n\n\t\t$this->output('modules/index');\n\t}", "public function getItemsList(){\n return $this->_get(4);\n }", "public function get_modules( $status = 'all' );", "function view_items() {\n $items = \\Model\\Item::all();\n \n $this->SC->CP->load_view('stock/view_items',array('items'=>$items));\n }", "public function items()\n {\n $projects = new Item();\n $projects->select(\"*\")->select_func(\"DATE_FORMAT\", array(\"@create_date\", '[,]', '%d/%m/%Y'), 'create_date')\n ->where(array('type' => 1, 'status' => 0))\n ->order_by('create_date', 'desc')\n ->get();\n\n $breadcrumb = array(\n 'Home' => site_url('admin'),\n 'Curadoria' => \"#\",\n 'Projetos' => site_url('admin/curadoria/items')\n );\n\n $this->load->helper('html');\n\n $toview['items'] = $projects;\n\n $this->template->set_breadcrumb($breadcrumb);\n $this->template->load('admin', 'admin/curadoria/items', $toview);\n }", "public function display_items() {\n\t\t$wrap_class = str_replace( '_', '-', $this->parant_plugin_slug );\n\t\t?>\n\t\t<div id=\"wpaddons-io-wrap\" class=\"wrap <?php echo $wrap_class; ?>-wrap\">\n\n\t\t\t<?php\n\t\t\t// Get addon\n\t\t\t$addons = $this->get_addons();\n\n\t\t\t// Load the display template\n\t\t\tinclude_once( $this->view );\n\t\t\t?>\n\n\t\t</div>\n\t\t<?php\n\t}", "public function getItems()\n {\n }", "public function actionIndex()\r\n\t{\r\n\t\t$modules = ModuleModel::instance()->find();\r\n\t\t$this->render('index', array('modules' => $modules));\r\n\t}", "public function getItemList()\r\n {\r\n return $this->item_list;\r\n }", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "public function\r\n\tList() {\r\n\t\techo __METHOD__, PHP_EOL;\r\n\t}", "function listing() {\r\n\r\n }", "public function list();", "public function list();", "public function list();", "protected function getAllModules()\n {\n return Hook::getHookModuleExecList('displayHeader');\n }", "public function admincp_index(){\n\t\tmodules::run('admincp/chk_perm',$this->session->userdata('ID_Module'),'r',0);\n\t\t$default_func = 'status';\n\t\t$default_sort = 'ASC';\n\t\t$data = array(\n\t\t\t'module'=>$this->module,\n\t\t\t'module_name'=>$this->session->userdata('Name_Module'),\n\t\t\t'default_func'=>$default_func,\n\t\t\t'default_sort'=>$default_sort\n\t\t);\n\t\t$this->template->write_view('content','index',$data);\n\t\t$this->template->render();\n\t}", "public function modulesAction()\n {\n $moduleList = $this->gridModule->getList();\n\n return new \\Zend\\View\\Model\\JsonModel(\n [\n 'success' => true,\n 'modules' => $moduleList,\n 'total' => count($moduleList),\n ]\n );\n }", "function NaviModule() {\n $dir = BASE_DIR . \"/modules/\";\n $modules = array();\n\n $sql = $GLOBALS['db']->Query(\"SELECT ModulName,ModulPfad FROM \" . PREFIX . \"_module WHERE Status = '1' ORDER BY ModulName ASC\");\n while($row = $sql->fetchrow()) {\n $modul['AdminEdit'] = 0;\n if(!include($dir . $row->ModulPfad . \"/modul.php\")) {\n echo \"Ошибка доступа к файлам модуля \" . $row->ModulPfad . \"<br />\";\n } elseif (($modul['AdminEdit'] == 1) && cp_perm('mod_' . $row->ModulPfad)) {\n array_push($modules, $row);\n }\n }\n $GLOBALS['tmpl']->assign('modules', $modules);\n}", "function index() {\n\t\t$this->show_list();\n\t}", "public function getModules() {\n }", "function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n // get top10 datas\n // id: 1-top1, 2-top2, 3-top3, 4-top4, 5-top5\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n // get top list data in homepage\n switch ($id) {\n case 1:\n $header = array(\"序号\", \"轮播图片\", \"类型\", \"单品活动/餐装活动/区域总代理\", \"排序\", \"新增日期\", \"操作\",);\n $cols = 7;\n $contentList = $this->carousel_model->getItems();\n $footer = (count($contentList) == 0||$contentList=='') ? $footer = \"没有轮播图项目.\" : '';\n break; // get top1\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }", "public function listAction() {\n\n\t}", "public function admincp_index(){\n\t\tmodules::run('admincp/chk_perm',$this->session->userdata('ID_Module'),'r',0);\n\t\t$default_func = 'created';\n $default_sort = 'DESC';\n\n $this->load->model('product_types/product_types_model');\n $product_types = $this->product_types_model->getList();\n\n\t\t$data = array(\n\t\t\t'module'=>$this->module,\n\t\t\t'product_types'=>$product_types,\n\t\t\t'module_name'=>$this->session->userdata('Name_Module'),\n\t\t\t'default_func'=>$default_func,\n\t\t\t'default_sort'=>$default_sort\n\t\t);\n\t\t$this->template->write_view('content','index',$data);\n\t\t$this->template->render();\n\t}", "public function renderListContent() {}", "public function index()\n {\n // count\n $modules_count = Module::all();\n $modules_count = count($modules_count);\n\n // fetch all module and paginate\n $modules = Module::orderBy('module_title')\n ->paginate(5);\n\n return view('pages.admin.module.index', [\n 'modules' => $modules,\n 'modules_count' => $modules_count,\n ]);\n }", "function my_list()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['list'] = $this->_bid->my_list();\n\t\t\n\t\t$this->load->view('bids/my_list', $data);\n\t}", "function spyropress_builder_render_modules( $display_core = false ) {\n global $spyropress_builder;\n $sort = $spyropress_builder->modules->get_modules();\n \n if( empty( $sort ) ) return;\n \n $content = '';\n \n // Sorting\n usort( $sort, 'builder_module_name_sort' );\n $done = array();\n\n foreach ( $sort as $module ) {\n if ( $display_core && $module->is_core ) {\n $module_idbase = $module->id_base;\n if ( in_array( $module_idbase, $done, true ) )\n continue;\n\n $done[] = $module_idbase;\n $widget_obj = $module;\n $class = get_class( $widget_obj );\n\n /** Generate HTML **/\n $content .= sprintf( '\n <li class=\"module-item\">\n <a class=\"builder-module-insert\" href=\"#\" data-module-type=\"%1$s\">\n <span class=\"module-icon-widget\"></span>\n <span class=\"module-item-body\">\n <strong class=\"module-item-title\">%2$s</strong>\n <span class=\"module-item-description\">%3$s</span>\n </span>\n </a>\n </li>', $class, $widget_obj->name, esc_html( $widget_obj->widget_options['description'] )\n );\n }\n elseif ( ! $display_core && ! $module->is_core ) {\n $module_idbase = $module->id_base;\n if ( in_array( $module_idbase, $done, true ) )\n continue;\n\n $done[] = $module_idbase;\n $widget_obj = $module;\n $class = get_class( $widget_obj );\n\n /** Generate HTML **/\n $content .= sprintf( '\n <li class=\"module-item\">\n <a class=\"builder-module-insert\" href=\"#\" data-module-type=\"%1$s\">\n <span class=\"module-icon-widget\"></span>\n <span class=\"module-item-body\">\n <strong class=\"module-item-title\">%2$s</strong>\n <span class=\"module-item-description\">%3$s</span>\n </span>\n </a>\n </li>', $class, $widget_obj->name, esc_html( $widget_obj->widget_options['description'] )\n );\n }\n }\n\n echo tomato_html( $content );\n}", "public function index()\n {\n $modules = Module::orderBy('name')->get();\n return view('modules.index')->withModules($modules);\n }", "public function showList() {\n\t \treturn 0;\n\t }", "function components_list()\n\t{\n\t\t$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, 'Manage Components' );\n\t\t$this->ipsclass->admin->page_title = \"Components Manager\";\n\t\t$this->ipsclass->admin->page_detail = \"This section will allow you to manage your components.\";\n\n\t\t//-------------------------------\n\t\t// INIT\n\t\t//-------------------------------\n\n\t\t$content = \"\";\n\t\t$seen_count = 0;\n\t\t$total_items = 0;\n\t\t$rows = array();\n\n\t\t//-------------------------------\n\t\t// Get components\n\t\t//-------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'components', 'order' => 'com_position ASC' ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\twhile( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$total_items++;\n\t\t\t$rows[] = $r;\n\t\t}\n\n\t\tforeach( $rows as $r )\n\t\t{\n\t\t\t//-------------------------------\n\t\t\t// Version...\n\t\t\t//-------------------------------\n\n\t\t\t$r['_fullname'] = $r['com_title'];\n\n\t\t\tif ( $r['com_version'] )\n\t\t\t{\n\t\t\t\t$r['_fullname'] .= ' v'.$r['com_version'];\n\t\t\t}\n\n\t\t\t//-------------------------------\n\t\t\t// Author...\n\t\t\t//-------------------------------\n\n\t\t\t$r['_fullauthor'] = $r['com_author'];\n\n\t\t\tif ( $r['com_url'] )\n\t\t\t{\n\t\t\t\t$r['_fullauthor'] = \"<a href='{$r['com_url']}' title='{$r['com_url']}' target='_blank'>{$r['_fullauthor']}</a>\";\n\t\t\t}\n\n\t\t\t//-------------------------------\n\t\t\t// (Alex) Cross\n\t\t\t//-------------------------------\n\n\t\t\t$r['_enabled_img'] = $r['com_enabled'] ? 'aff_tick.png' : 'aff_cross.png';\n\n\t\t\t//-------------------------------\n\t\t\t// Work out position images\n\t\t\t//-------------------------------\n\n\t\t\t$r['_pos_up'] = $this->html->components_position_blank($r['com_id']);\n\t\t\t$r['_pos_down'] = $this->html->components_position_blank($r['com_id']);\n\n\t\t\t//-------------------------------\n\t\t\t// Work out position images\n\t\t\t//-------------------------------\n\n\t\t\tif ( ($seen_count + 1) == $total_items )\n\t\t\t{\n\t\t\t\t# Show up only\n\t\t\t\t$r['_pos_up'] = $this->html->components_position_up($r['com_id']);\n\t\t\t}\n\t\t\telse if ( $seen_count > 0 AND $seen_count < $total_items )\n\t\t\t{\n\t\t\t\t# Show both...\n\t\t\t\t$r['_pos_up'] = $this->html->components_position_up($r['com_id']);\n\t\t\t\t$r['_pos_down'] = $this->html->components_position_down($r['com_id']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t# Show down only\n\t\t\t\t$r['_pos_down'] = $this->html->components_position_down($r['com_id']);\n\t\t\t}\n\n\t\t\t$seen_count++;\n\n\t\t\t//-------------------------------\n\t\t\t// Is there an uninstall script\n\t\t\t//-------------------------------\n\t\t\tif ( file_exists( ROOT_PATH.'/resources/'.$r['com_section'].'/uninstall.xml' ) )\n\t\t\t{\n\t\t\t\t$r['com_hasuninstall'] = TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$r['com_hasuninstall'] = FALSE;\n\t\t\t}\n\n\t\t\t$content .= $this->html->component_row($r);\n\t\t}\n\n\t\t$this->ipsclass->html .= $this->html->component_overview( $content );\n\n\t\t$this->ipsclass->admin->output();\n\t}", "public function lister()\r\n {\r\n }", "protected function getModuleContent() {}", "public function blocklistAction()\n {\n // Module name\n $name = $this->params('name', '');\n\n $rowset = Pi::model('block')->select(['module' => $name]);\n $blocks = [];\n foreach ($rowset as $row) {\n if ('tab' == $row->type) {\n continue;\n }\n $blocks[] = [\n 'id' => $row->id,\n 'name' => $row->name,\n 'caption' => $row->title,\n 'description' => $row->description,\n ];\n }\n\n return [\n 'status' => 1,\n 'data' => $blocks,\n ];\n }", "public function testModuleListForm() {\n $this->drupalGet('admin/modules');\n\n // Check that system_test's configure link was rendered correctly.\n $this->assertSession()->elementExists('xpath', \"//a[contains(@href, '/system-test/configure/bar') and text()='Configure ']/span[contains(@class, 'visually-hidden') and text()='System test']\");\n\n // Check that system_test's permissions link was rendered correctly.\n $this->assertSession()->elementExists('xpath', \"//a[contains(@href, '/admin/people/permissions/module/system_test') and text()='Permissions ']/span[contains(@class, 'visually-hidden') and text()='for System test']\");\n\n // Check that system_test's help link was rendered correctly.\n $this->assertSession()->elementExists('xpath', \"//a[contains(@href, '/admin/help/system_test') and text()='Help ']/span[contains(@class, 'visually-hidden') and text()='for System test']\");\n\n // Ensure that the Database Logging module's machine name is printed. This\n // module is used because its machine name is different than its human\n // readable name.\n $this->assertSession()->pageTextContains('dblog');\n\n // Check that the deprecated module link was rendered correctly.\n $this->assertSession()->elementExists('xpath', \"//a[contains(@aria-label, 'View information on the Deprecated status of the module Deprecated module')]\");\n $this->assertSession()->elementExists('xpath', \"//a[contains(@href, 'http://example.com/deprecated')]\");\n\n // Check that obsolete modules are not displayed.\n $this->assertSession()->pageTextNotContains('(Obsolete)');\n }", "public function do_head_items()\n {\n }", "function getModuleList($add_extravars = false)\n {\n $args->sort_index = \"module_srl\";\n $args->page = 1;\n $args->list_count = 200;\n $args->page_count = 10;\n $args->s_module_category_srl = Context::get('module_category_srl');\n\n $output = executeQueryArray('xedocs.getManualList', $args);\n ModuleModel::syncModuleToSite($output->data);\n\n if(!$add_extravars){\n return $output->data;\n }\n\n $oModuleModel = &getModel('module');\n\n foreach($output->data as $module_info){\n $extra_vars = $oModuleModel->getModuleExtraVars($module_info->module_srl);\n foreach($extra_vars[$module_info->module_srl] as $k=>$v){\n $module_info->{$k} = $v;\n }\n }\n\n return $output->data;\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n $searchData = $_POST['searchData'];\n // get top list data in homepage\n switch ($id) {\n case 1:\n\n $header = array(\"优惠券编号\", \"优惠券金额\", \"所属终端便利店账号\", \"终端便利店\", \"状态\", \"赠送时间\", \"使用时间\");\n $cols = 7;\n\n $contentList = $this->coupon_model->getItems($searchData);\n $footer = (count($contentList) == 0 || !isset($contentList)) ? $footer = \"没有优惠券.\" : '';\n break; // get top1\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }", "function procMenuAdminAllActList()\n\t{\n\t\t$oModuleModel = getModel('module');\n\t\t$installed_module_list = $oModuleModel->getModulesXmlInfo();\n\t\tif(is_array($installed_module_list))\n\t\t{\n\t\t\t$currentLang = Context::getLangType();\n\t\t\t$menuList = array();\n\t\t\tforeach($installed_module_list AS $key=>$value)\n\t\t\t{\n\t\t\t\t$info = $oModuleModel->getModuleActionXml($value->module);\n\t\t\t\tif($info->menu) $menuList[$value->module] = $info->menu;\n\t\t\t\tunset($info->menu);\n\t\t\t}\n\t\t}\n\t\t$this->add('menuList', $menuList);\n\t}", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function listar(){\r\n }", "abstract public function items();", "public function index() {\r\n// $where = 'id=1';\r\n// $category = $module->getItems($where, 'id');\r\n// return $category;\r\n $this->tpl->draw('default/index');\r\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Module::find()->indexBy('id'),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }" ]
[ "0.73390317", "0.73185724", "0.72713846", "0.72534215", "0.70892215", "0.69748634", "0.6779163", "0.6729196", "0.6718313", "0.66505593", "0.66470194", "0.6613434", "0.6613382", "0.660803", "0.6590715", "0.65670806", "0.65670806", "0.6543381", "0.65294325", "0.6494295", "0.64896977", "0.6457579", "0.6427031", "0.6420346", "0.64171034", "0.6414587", "0.64093775", "0.6403675", "0.6403675", "0.64014393", "0.6395886", "0.6356159", "0.6342801", "0.6327347", "0.63212633", "0.63208115", "0.63118106", "0.63086516", "0.6307758", "0.6304386", "0.6304386", "0.6304386", "0.6304386", "0.6304386", "0.6304386", "0.6304386", "0.6304386", "0.6304386", "0.6304386", "0.6304386", "0.6304386", "0.6304386", "0.6293579", "0.6291656", "0.6289518", "0.6285742", "0.62756276", "0.6259059", "0.62483525", "0.6243755", "0.6234244", "0.6231508", "0.62298167", "0.62239295", "0.6222588", "0.6222588", "0.6218116", "0.62156355", "0.62102276", "0.62102276", "0.62102276", "0.6183433", "0.61804307", "0.61797714", "0.61777633", "0.6177134", "0.6174318", "0.6167914", "0.616522", "0.6150593", "0.61426514", "0.6127369", "0.6118572", "0.6118472", "0.6117592", "0.6116943", "0.61114085", "0.6096066", "0.60883945", "0.6085083", "0.6080774", "0.60776967", "0.6071517", "0.6068962", "0.6064855", "0.60541534", "0.605331", "0.60510397", "0.6046209", "0.6042006", "0.603126" ]
0.0
-1
Add specific changes to the form_fields method
public function form_fields($values = array(), $related = array()) { $fields = parent::form_fields($values, $related); $fields['name']['order'] = 1; $fields['category_id']['label'] = lang("form_label_category"); $fields['category_id']['order'] = 2; $fields['source_id']['label'] = lang('form_label_press_source'); $fields['source_id']['order'] = 3; $fields['datum']['order'] = 4; $fields['section_example'] = array('type' => 'section', 'tag' => 'h3', 'value' => lang("form_label_press_section")); $fields['section_example']['order'] = 5; $fields['online_article']['label'] = lang('form_label_press_link'); $fields['online_article']['comment'] = lang('form_comment_press_link'); $fields['online_article']['attributes'] = 'placeholder="http://"'; $fields['online_article']['order'] = 6; $fields['asset'] = array('label' => lang('form_label_file'), 'folder' => 'pressarticles', 'type' => 'asset', 'class' => 'file', 'order' => 7, 'comment' => lang('form_comment_press_asset'), 'hide_options' => true, 'accept' => 'jpg|jpeg|png|pdf'); $fields['published']['type'] = 'hidden'; return $fields; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createFormFields() {\n\t}", "function add_specific_form_fields() {\n\t\treturn false;\n\t}", "protected function _updatefields() {}", "public function hookForm() {\n if ($this->isCompanyForm()) {\n $this->setDefaultExpDate();\n $this->makeBillingAreaRequired();\n }\n elseif ($this->isCompanyViewsMultiSearchForm()) {\n $this->form['company_name']['#type'] = 'textarea';\n $this->duplicateField('sort_by');\n }\n }", "public function getFormCustomFields(){\n\t}", "public function set_fields() {\n $this->fields = apply_filters('wpucommentmetas_fields', $this->fields);\n foreach ($this->fields as $id => $field) {\n if (!is_array($field)) {\n $this->fields[$id] = array();\n }\n if (!isset($field['label'])) {\n $this->fields[$id]['label'] = ucfirst($id);\n }\n if (!isset($field['admin_label'])) {\n $this->fields[$id]['admin_label'] = $this->fields[$id]['label'];\n }\n if (!isset($field['type'])) {\n $this->fields[$id]['type'] = 'text';\n }\n if (!isset($field['help'])) {\n $this->fields[$id]['help'] = '';\n }\n if (!isset($field['required'])) {\n $this->fields[$id]['required'] = false;\n }\n if (!isset($field['admin_visible'])) {\n $this->fields[$id]['admin_visible'] = true;\n }\n if (!isset($field['admin_column'])) {\n $this->fields[$id]['admin_column'] = false;\n }\n if (!isset($field['admin_list_visible'])) {\n $this->fields[$id]['admin_list_visible'] = false;\n }\n if (!isset($field['display_hooks'])) {\n $this->fields[$id]['display_hooks'] = array(\n 'comment_form_logged_in_after',\n 'comment_form_after_fields'\n );\n }\n if (!is_array($this->fields[$id]['display_hooks'])) {\n $this->fields[$id]['display_hooks'] = array($this->fields[$id]['display_hooks']);\n }\n }\n }", "function wppb_multiple_forms_change_fields( $fields, $args ){\r\n\t//if we have a edit_profile form set up the post type and meta name accordingly\r\n\tif( $args['form_type'] == 'edit_profile' ){\r\n\t\t$meta_name = 'wppb_epf_fields';\r\n\t\t\r\n\t}elseif( $args['form_type'] == 'register' ){\r\n\t\t$meta_name = 'wppb_rf_fields';\r\n\t}\r\n\r\n // let's get the fields that we should display on that form\r\n if( isset( $args['ID'] ) ) {\r\n $this_forms_fields = get_post_meta($args['ID'], $meta_name, true);\r\n if (!empty($this_forms_fields)) {\r\n $this_forms_fields_ids = array();\r\n $returned_fields = array();\r\n\r\n // keep the ids of those fields as they are the \"unique key\" and we will search for them in all the fields\r\n foreach ($this_forms_fields as $this_forms_field) {\r\n $this_forms_fields_ids[] = $this_forms_field['id'];\r\n }\r\n\r\n // rearrange the fields based on the ids we got before. sort them and remove the ones we don't need.\r\n if (!empty($this_forms_fields_ids) && !empty($fields)) {\r\n foreach ($this_forms_fields_ids as $this_forms_fields_id) {\r\n foreach ($fields as $field) {\r\n if ($field['id'] == $this_forms_fields_id) {\r\n $returned_fields[] = $field;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n\t// if we have any rearranged fields return them else we return the original fields\r\n if( !empty( $returned_fields ) )\r\n\t\treturn $returned_fields;\r\n\r\n\telse\r\n\t\treturn $fields;\r\n}", "protected function _readFormFields() {}", "public function add_edit_form_fields() {\r\n\r\n\t\t?>\r\n\r\n\t\t<input type=\"hidden\" name=\"yz_edit_activity_nonce\" value=\"<?php echo wp_create_nonce( 'youzer-edit-activity' ); ?>\">\r\n\r\n\t\t<?php\r\n\r\n\t}", "function init_form_fields() {\n\n $this->form_fields = array(\n\n 'enabled' => array(\n 'title' => 'Активировать',\n 'type' => 'checkbox',\n 'description' => 'Активировать способ доставки КС2008',\n 'default' => 'yes'\n ),\n\n 'title' => array(\n 'title' => 'Заголовок',\n 'type' => 'text',\n 'description' => 'Заговок способа доствки КС2008',\n 'default' => 'Курьерская служба 2008 '\n ),\n\n 'description' => array(\n 'title' => 'Описание',\n 'type' => 'text',\n 'description' => 'Описание способа доставки КС2008',\n 'default' => 'Выберите для доставки через КС2008'\n ),\n\n );\n\n }", "function init_form_fields() {\n\t\t\t\n\t\t\t$abs_path = str_replace('/wp-admin', '', getcwd());\n\t\t\n\t\t\t$this->form_fields = array(\n\t\t\t\t'enabled' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Activer/Désactiver:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'checkbox', \n\t\t\t\t\t\t\t\t'label' => __( 'Activer le module de paiement Atos.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => 'yes'\n\t\t\t\t\t\t\t), \n\t\t\t\t'title' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Nom:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Intitulé affiché à l\\'utilisateur lors de la commande.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __( 'Paiement sécurisé par carte bancaire', 'woothemes' )\n\t\t\t\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Description:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'textarea', \n\t\t\t\t\t\t\t\t'description' => __( 'Description affichée à l\\'utilisateur lors de la commande.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Payez en toute sécurité grâce à notre système de paiement Atos.', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'merchant_id' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Identifiant commerçant:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Identifiant commerçant fourni par votre banque. Ex: 014295303911112', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('014295303911112', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'pathfile' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier pathfile:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier de configuration \"pathfile\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/param/pathfile', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'request_file' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier request:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier exécutable \"request\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/bin/request', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'response_file' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier response:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier exécutable \"response\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/bin/response', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'payment_means' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Cartes acceptées:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Moyens de paiement acceptés. Ex pour CB, Visa et Mastercard: CB,2,VISA,2,MASTERCARD,2', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('CB,2,VISA,2,MASTERCARD,2', 'woothemes')\n\t\t\t\t\t\t\t),\n\n\t\t\t\t'currency_code' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Devise:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'select', \n\t\t\t\t\t\t\t\t'description' => __( 'Veuillez sélectionner une devise pour les paiemenents.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => '978',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'840' => 'USD',\n\t\t\t\t\t\t\t\t\t'978' => 'EUR',\n\t\t\t\t\t\t\t\t\t'124' => 'CAD',\n\t\t\t\t\t\t\t\t\t'392' => 'JPY',\n\t\t\t\t\t\t\t\t\t'826' => 'GBP',\n\t\t\t\t\t\t\t\t\t'036' => 'AUD' \n\t\t\t\t\t\t\t\t ) \t\t\t\t\t\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\n\t\t\t\t'paybtn' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Texte bouton de paiement:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Texte affiché sur le bouton qui redirige vers le terminal de paiement.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Régler la commande.', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'paymsg' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Message page de paiement:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'textarea', \n\t\t\t\t\t\t\t\t'description' => __( 'Message affiché sur la page de commande validée, avant passage sur le terminal de paiement.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Merci pour votre commande. Veuillez cliquer sur le bouton ci-dessous pour effectuer le règlement.', 'woothemes')\n\t\t\t\t\t\t\t)\n\t\t\t\t/*'payreturn' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Texte bouton retour:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Texte affiché sur le bouton de retour ver la boutique.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Retour', 'woothemes')\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);\n\t\t\n\t\t}", "abstract public function get_gateway_form_fields();", "public function updateEditableFields() {\n\t\t$allowedFields = $this->config()->allowed_field_types;\n\t\tif ($allowedFields) {\n\t\t\t$fieldClasses = singleton('EditableFormField')->getEditableFieldClasses();\n\t\t\tforeach($fieldClasses as $fieldClass => $fieldTitle) {\n\t\t\t\tif (!in_array($fieldClass, $allowedFields)) {\n\t\t\t\t\tConfig::inst()->update($fieldClass, 'hidden', true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Explicitely allow fields, so subclasses show up\n\t\t\tforeach($allowedFields as $fieldClass) {\n\t\t\t\tConfig::inst()->update($fieldClass, 'hidden', false);\n\t\t\t}\n\t\t}\n\t}", "public function form_fields() {\n\t\treturn apply_filters( \"appthemes_{$this->box_id}_metabox_fields\", $this->form() );\n\t}", "function init_form_fields() {\r\n $this->form_fields = array(\r\n 'enabled' => array(\r\n 'title' => __('Enable/Disable', 'mondido'),\r\n 'type' => 'checkbox',\r\n 'label' => __('Enable mondido Payment Module.', 'mondido'),\r\n 'default' => 'no'),\r\n 'merchant_id' => array(\r\n 'title' => __('Merchant ID', 'mondido'),\r\n 'type' => 'text',\r\n 'description' => __('Merchant ID for Mondido')),\r\n 'secret' => array(\r\n 'title' => __('Secret', 'mondido'),\r\n 'type' => 'text',\r\n 'description' => __('Given secret code from Mondido', 'mondido'),\r\n ),\r\n 'test' => array(\r\n 'title' => __('Test', 'mondido'),\r\n 'type' => 'checkbox',\r\n 'label' => __('Set in testmode.', 'mondido'),\r\n 'default' => 'no')\r\n );\r\n }", "public function init_form_fields(){\n \n\t\t$this->form_fields = array(\n\t\t\t'enabled' => array(\n\t\t\t\t'title' => 'Enable/Disable',\n\t\t\t\t'label' => 'Enable Vortex Gateway',\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'description' => '',\n\t\t\t\t'default' => 'no'\n\t\t\t),\n\t\t\t'title' => array(\n\t\t\t\t'title' => 'Title',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => 'This controls the title which the user sees during checkout.',\n\t\t\t\t'default' => 'Vortex Payment',\n\t\t\t\t'desc_tip' => true,\n\t\t\t),\n\t\t\t'description' => array(\n\t\t\t\t'title' => 'Description',\n\t\t\t\t'type' => 'textarea',\n\t\t\t\t'description' => 'This controls the description which the user sees during checkout.',\n\t\t\t\t'default' => 'Paga con Vortex Payment.',\n\t\t\t),\n\t\t\t'BID' => array(\n\t\t\t\t'title' => 'Business ID',\n\t\t\t\t'type' => 'text'\n\t\t\t)\n\n\t\t\t);\n \n\t \t}", "abstract protected function getFormIntroductionFields();", "public function init_form_fields() {\n\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', $this->domain ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable Custom Payment', $this->domain ),\n 'default' => 'yes'\n ),\n 'title' => array(\n 'title' => __( 'Title', $this->domain ),\n 'type' => 'text',\n 'description' => __( 'This controls the title which the user sees during checkout.', $this->domain ),\n 'default' => __( 'Cartão de Crédito', $this->domain ),\n 'desc_tip' => true,\n ),\n 'order_status' => array(\n 'title' => __( 'Order Status', $this->domain ),\n 'type' => 'select',\n 'class' => 'wc-enhanced-select',\n 'description' => __( 'Choose whether status you wish after checkout.', $this->domain ),\n 'default' => 'wc-completed',\n 'desc_tip' => true,\n 'options' => wc_get_order_statuses()\n ),\n 'description' => array(\n 'title' => __( 'Description', $this->domain ),\n 'type' => 'textarea',\n 'description' => __( 'Payment method description that the customer will see on your checkout.', $this->domain ),\n 'default' => __('Informação do método de pagamento', $this->domain),\n 'desc_tip' => true,\n ),\n 'instructions' => array(\n 'title' => __( 'Instructions', $this->domain ),\n 'type' => 'textarea',\n 'description' => __( 'Instructions that will be added to the thank you page and emails.', $this->domain ),\n 'default' => '',\n 'desc_tip' => true,\n ),\n );\n }", "public function init_form_fields() {\n\n $gatewayids = $this->get_gatewayids();\n $this->form_fields = apply_filters( 'wc_fabric_form_fields', array(\n 'enabled' => array(\n 'title' => 'Enable/Disable',\n 'type' => 'checkbox',\n 'label' => 'Enable PayFabric',\n 'default' => 'yes',\n ),\n 'title' => array(\n 'title' => 'Title',\n 'type' => 'text',\n 'description' => '',\n 'default' => 'PayFabric',\n 'desc_tip' => true,\n ),\n 'description' => array(\n 'title' => 'Description',\n 'type' => 'textarea',\n 'description' => '',\n 'default' => 'Description here',\n 'desc_tip' => true,\n ),\n 'instructions' => array(\n 'title' => 'Instructions',\n 'type' => 'textarea',\n 'description' => '',\n 'default' => 'Instructions here',\n 'desc_tip' => true,\n ),\n 'deviceId' => array(\n 'title' => 'Device ID',\n 'type' => 'text',\n 'description' => '',\n 'default' => '',\n 'desc_tip' => true,\n ),\n 'password' => array(\n 'title' => 'Device Password',\n 'type' => 'password',\n 'description' => '',\n 'default' => '',\n 'desc_tip' => true,\n ),\n 'gatewayid' => array(\n 'title' => 'Gateway Account Name',\n 'type' => 'select',\n 'description' => 'Required set Device ID and Password',\n 'default' => '',\n 'desc_tip' => true,\n 'options' => $gatewayids,\n ),\n 'book' => array(\n 'title' => 'Book',\n 'type' => 'checkbox',\n 'default' => 'no',\n 'description' => 'Enable Pre-Authorization Only',\n ),\n 'production' => array(\n 'title' => 'Production',\n 'type' => 'checkbox',\n 'default' => 'no',\n 'description' => 'Enable Production',\n ),\n ));\n }", "public function init_form_fields() {\n\t\t$this->form_fields = array(\n\t\t\t'api_key' => array(\n\t\t\t\t'title' => __( 'API Key', PLUGIN_TXT ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'Enter with your API Key. You can find this in \"User Profile\" drop-down (top right corner) > API Keys.', PLUGIN_TXT ),\n\t\t\t\t'desc_tip' => true,\n\t\t\t\t'default' => ''\n\t\t\t),\n\t\t\t'debug' => array(\n\t\t\t\t'title' => __( 'Debug Log', PLUGIN_TXT ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable logging', PLUGIN_TXT ),\n\t\t\t\t'default' => 'no',\n\t\t\t\t'description' => __( 'Log events such as API requests', PLUGIN_TXT ),\n\t\t\t),\n\t\t);\n\t}", "public function init_form_fields() {\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', 'woocommerce' ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable this email notification', 'woocommerce' ),\n 'default' => 'yes'\n ),\n 'subject' => array(\n 'title' => __( 'Email Subject', 'woocommerce' ),\n 'type' => 'text',\n 'description' => sprintf( __( 'Defaults to <code>%s</code>', 'woocommerce' ), $this->subject ),\n 'placeholder' => '',\n 'default' => ''\n ),\n 'heading' => array(\n 'title' => __( 'Email Heading', 'woocommerce' ),\n 'type' => 'text',\n 'description' => sprintf( __( 'Defaults to <code>%s</code>', 'woocommerce' ), $this->heading ),\n 'placeholder' => '',\n 'default' => ''\n ),\n 'custom_message' => array(\n 'title' => __( 'Custom Message', 'yith-woocommerce-membership' ),\n 'type' => 'textarea',\n 'description' => sprintf( __( 'Defaults to <code>%s</code>', 'woocommerce' ), $this->custom_message ),\n 'placeholder' => '',\n 'default' => __( 'Dear Customer {firstname} {lastname}, your membership {membership_name} is cancelled.', 'yith-woocommerce-membership' )\n ),\n 'email_type' => array(\n 'title' => __( 'Email type', 'woocommerce' ),\n 'type' => 'select',\n 'description' => __( 'Choose which format of email to send.', 'woocommerce' ),\n 'default' => 'html',\n 'class' => 'email_type wc-enhanced-select',\n 'options' => $this->get_email_type_options()\n )\n );\n }", "abstract function fields_options();", "function init_form_fields() {\n /**\n * Build array of configurations that will be displayed on Admin Panel\n */\n parent::init_form_fields();\n WC_Midtrans_Utils::array_insert( $this->form_fields, 'enable_3d_secure', array(\n 'acquring_bank' => array(\n 'title' => __( 'Acquiring Bank', 'midtrans-woocommerce'),\n 'type' => 'text',\n 'label' => __( 'Acquiring Bank', 'midtrans-woocommerce' ),\n 'description' => __( 'You should leave it empty, it will be auto configured. </br> Alternatively may specify your card-payment acquiring bank for this payment option. </br> Options: BCA, BRI, DANAMON, MAYBANK, BNI, MANDIRI, CIMB, etc (Only choose 1 bank).' , 'midtrans-woocommerce' ),\n 'default' => ''\n )\n ));\n // Make this payment method enabled by default\n $this->form_fields['enabled']['default'] = 'yes';\n }", "function weldata_form_alter(&$form, &$form_state){\n\n}", "public function init_form_fields() {\n\n $this->form_fields = apply_filters( 'wc_barter_form_fields', array(\n\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', 'wc-gateway-barter' ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable Offline Payment', 'wc-gateway-barter' ),\n 'default' => 'yes'\n ),\n\n 'title' => array(\n 'title' => __( 'Title', 'wc-gateway-barter' ),\n 'type' => 'text',\n 'description' => __( 'This controls the title for the payment method the customer sees during checkout.', 'wc-gateway-barter' ),\n 'default' => __( 'Offline Payment', 'wc-gateway-barter' ),\n 'desc_tip' => true,\n ),\n\n 'description' => array(\n 'title' => __( 'Description', 'wc-gateway-barter' ),\n 'type' => 'textarea',\n 'description' => __( 'Payment method description that the customer will see on your checkout.', 'wc-gateway-barter' ),\n 'default' => __( 'Please remit payment to Store Name upon pickup or delivery.', 'wc-gateway-barter' ),\n 'desc_tip' => true,\n ),\n\n 'instructions' => array(\n 'title' => __( 'Instructions', 'wc-gateway-barter' ),\n 'type' => 'textarea',\n 'description' => __( 'Instructions that will be added to the thank you page and emails.', 'wc-gateway-barter' ),\n 'default' => '',\n 'desc_tip' => true,\n ),\n ) );\n }", "function _set_editable_fields()\n\t{\n\t\tif (empty($this->fields))\n\t\t{\n\t\t\t// pull the fields dynamically from the database\n\t\t\t$this->db->cache_on();\n\t\t\t$this->fields = $this->db->list_fields($this->primary_table);\n\t\t\t$this->db->cache_off();\n\t\t}\n\t}", "function form_alter(&$form, &$form_state) {\n }", "public static function form_fields(){\n\n \treturn [\n [\n \t'id'=> 'description',\n \t'name'=> 'description', \n \t'desc'=> 'Description', \n \t'val'=>\tnull, \n \t'type'=> 'text',\n \t'maxlength'=> 255,\n \t'required'=> 'required',\n ],\n\n [\n \t'id'=> 'rate',\n \t'name'=> 'rate', \n \t'desc'=> 'Discount Rate', \n \t'val'=>\tnull, \n \t'type'=> 'number',\n \t'min'=> 0,\n \t'max'=> 100,\n \t'step'=> '0.01',\n \t'required'=> 'required',\n ],\n\n [\n \t'id'=> 'stat',\n \t'name'=> 'stat', \n \t'desc'=> 'isActive', \n \t'val'=>1, \n \t'type'=> 'checkbox',\n ],\n ];\n\n }", "function edit_reg_form_fields_view(){\r\n\t\tglobal $current_user;\r\n\t\t$current_user = wp_get_current_user();\r\n\t\tif( !current_user_can( 'manage_options', $current_user->ID ) ){\r\n\t\t\twp_die( __( 'You do not have permissions to activate this plugin, sorry, check with site administrator to resolve this issue please!', 'user-registration-aide' ) );\r\n\t\t}else{\r\n\t\t\t$field = new FIELDS_DATABASE();\r\n\t\t\t$ura_fields = $field->get_all_fields();\r\n\t\t\t$options = get_option( 'csds_userRegAide_Options' );\r\n\t\t\t?>\r\n\t\t\t<table class=\"newFields\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th colspan=\"3\"><?php _e( 'Delete Fields & Change Fields Required for Registration Form:', 'user-registration-aide' );?> </th>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><?php\r\n\t\t\t\t\t//if( !empty( $newFields ) ){\r\n\t\t\t\t\tif( !empty( $ura_fields ) ){\r\n\t\t\t\t\t\techo '<p class=\"deleteFields\">'.__( 'Delete Fields: <br/>Here you can select the new additional fields you added that you want to delete.', 'user-registration-aide' ).'</p>';\r\n\t\t\t\t\t\techo '<select name=\"deleteNewFields\" id=\"csds_userRegMod_delete_Select\" title=\"'.__( 'Please choose a field to delete here, you can only select one field at a time to delete however', 'user-registration-aide' ).'\" size=\"8\" class=\"deleteFields\">';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tforeach( $ura_fields as $object ){\r\n\t\t\t\t\t\t\techo '<option value=\"'.$object->meta_key.'\">'.$object->field_name.'</option>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\techo '</select>';\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t<br/>\r\n\t\t\t\t\t\t<input type=\"submit\" class=\"button-primary\" name=\"delete_field\" value=\"<?php _e( 'Delete New Field', 'user-registration-aide' );?>\"/></p>\r\n\t\t\t\t\t\t<?php\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\techo '<p class=\"deleteFields\">'.__( 'No new fields currently exist, you have to add new fields on the main page before you can delete any!', 'user-registration-aide' ).'</p>';\r\n\t\t\t\t\t}?>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t<p class=\"adminPage\"><?php _e( 'By default, Wordpress will only require an email address and username to register an account. Here, you can select additional fields that will be added for new user registration.', 'user-registration-aide' );?>\r\n\t\t\t\t<br/>\r\n\t\t\t\t</p>\r\n\t\t\t\t<p class=\"adminPage\"><?php _e( 'Select Additional Fields to add to the Registration Form:', 'user-registration-aide' );?>\r\n\t\t\t\t<br/>\r\n\t\t\t\t<select name=\"additionalFields[]\" id=\"csds_userRegMod_Select\" title=\"<?php _e( 'You can select as many fields here as you want, just hold down the control key while selecting multiple fields. These fields are required on the registration form, so if you can do without them and just have them on the user profile page then leave them out of the registration form!', 'user-registration-aide' );?>\" size=\"8\" multiple style=\"height:100px\">\r\n\t\t\t\t<?php\r\n\t\t\t\t$regFields = get_option( 'csds_userRegAide_registrationFields' );\r\n\t\t\t\t$knownFields = get_option( 'csds_userRegAide_knownFields' );\r\n\t\t\t\t$field = new FIELDS_DATABASE();\r\n\t\t\t\t$ura_fields = $field->get_all_fields(); \r\n\t\t\t\tif( !empty( $knownFields ) ){\r\n\t\t\t\t\tif( !empty( $regFields ) ){\r\n\t\t\t\t\t\tif( is_array( $regFields ) ){\r\n\t\t\t\t\t\t\tforeach( $knownFields as $key1 => $value1 ){\r\n\t\t\t\t\t\t\t\tif( array_key_exists( $key1, $regFields ) ){\r\n\t\t\t\t\t\t\t\t\t$selected = \"selected=\\\"selected\\\"\";\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t$selected = NULL;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t<option value=\"<?php echo $key1 ;?>\" <?php echo $selected ;?> ><?php _e( $value1, 'user-registration-aide' );?></option>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<?php\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}else{\r\n\t\t\t\t\t\t\t//exit();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tforeach( $knownFields as $key1 => $value1 ){\r\n\t\t\t\t\t\t\t$selected = NULL;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t<option value=\"<?php echo $key1 ;?>\" <?php echo $selected ;?> ><?php _e( $value1, 'user-registration-aide' );?></option>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//echo \"<option value=\\\"$key1\\\" $selected >$value1</option>\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif( !empty( $ura_fields ) ){\r\n\t\t\t\t\t\t//foreach( $newFields as $key2 => $value2 ){\r\n\t\t\t\t\t\tforeach( $ura_fields as $object ){\r\n\t\t\t\t\t\t\t$meta_key = $object->meta_key;\r\n\t\t\t\t\t\t\t$name = $object->field_name;\r\n\t\t\t\t\t\t\t//$reg_form = $object->registration_form;\r\n\t\t\t\t\t\t\tif( $object->registration_field == 1 ){\r\n\t\t\t\t\t\t\t\t//exit( \"SELECTED\" );\r\n\t\t\t\t\t\t\t\t$selected = \"selected=\\\"selected\\\"\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t//exit( \"UNSELECTED\" );\r\n\t\t\t\t\t\t\t\t$selected = NULL;\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<option value=\"<?php echo $meta_key ;?>\" <?php echo $selected ;?> ><?php _e( $name, 'user-registration-aide' );?></option>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t//echo \"<option value=\\\"$meta_key\\\" $selected >$name</option>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t?>\t\r\n\t\t\t\t</select>\r\n\t\t\t\t<br/>\r\n\t\t\t\t<b><?php _e( 'Hold down \"Ctrl\" button on keyboard to select or unselect multiple options!', 'user-registration-aide' );?>\r\n\t\t\t\t</b>\r\n\t\t\t\t</p>\r\n\t\t\t\t<div class=\"submit\">\r\n\t\t\t\t<input type=\"submit\" name=\"select_none\" class=\"button-primary\" value=\"<?php _e('Select None', 'user-registration-aide'); ?>\" />\r\n\t\t\t\t</div>\r\n\t\t\t<div class=\"submit\"><input type=\"submit\" class=\"button-primary\" name=\"reg_fields_update\" value=\"<?php _e('Update Registration Form Fields', 'user-registration-aide');?>\"/></div>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t<p class=\"adminPage\"><?php _e( 'Here you can select whether Registration Form Fields are required or not', 'user-registration-aide' );?>\r\n\t\t\t\t<br/>\r\n\t\t\t\t</p>\r\n\t\t\t\t<p class=\"adminPage\"><?php _e( 'Select Registration Form Fields That Will NOT BE REQUIRED for Users to Fill out When Registering:', 'user-registration-aide' );?>\r\n\t\t\t\t<br/>\r\n\t\t\t\t<select name=\"requiredFields[]\" id=\"required_fields\" title=\"<?php _e( 'You can select as many fields here as you want, just hold down the control key while selecting multiple fields. Selecting these fields makes them so they are NOT REQUIRED FIELDS on the registration form!', 'user-registration-aide' );?>\" size=\"8\" multiple style=\"height:100px\">\r\n\t\t\t\t<?php\r\n\t\t\t\t$optional_fields = get_option( 'csds_ura_optionalFields' );\r\n\t\t\t\t$regFields = get_option( 'csds_userRegAide_registrationFields' );\r\n\t\t\t\t$knownFields = get_option( 'csds_userRegAide_knownFields' );\r\n\t\t\t\t$field = new FIELDS_DATABASE();\r\n\t\t\t\t$ura_fields = $field->get_registration_fields(); \r\n\t\t\t\t$opt_fields = $field->get_optional_fields();\r\n\t\t\t\tif( !empty( $regFields ) ){\r\n\t\t\t\t\tif( is_array( $regFields ) ){\r\n\t\t\t\t\t\t$cnt = count( $regFields );\r\n\t\t\t\t\t\tforeach( $knownFields as $key1 => $value1 ){\r\n\t\t\t\t\t\t\tif( !empty( $regFields ) ){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif( array_key_exists( 'user_pass', $regFields ) && $cnt == 1 && empty( $ura_fields ) ){\r\n\t\t\t\t\t\t\t\t\tif( $key1 == 'user_pass' ){\r\n\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t<option value=\"<?php _e( 'no_fields_0', 'user-registration-aide' );?>\"><?php _e( 'No Registration Form Fields', 'user-registration-aide' );?></option>\r\n\t\t\t\t\t\t\t\t\t\t<option value=\"<?php _e( 'no_fields_1', 'user-registration-aide' );?>\"><?php _e( 'Have Been Added Yet', 'user-registration-aide' );?></option>\r\n\t\t\t\t\t\t\t\t\t\t<option value=\"<?php _e( 'no_fields_1', 'user-registration-aide' );?>\"><?php _e( 'Except for the Password!', 'user-registration-aide' );?></option>\r\n\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\tif( !empty( $optional_fields ) ){\r\n\t\t\t\t\t\t\t\t\t\tif( array_key_exists( $key1, $optional_fields ) ){\r\n\t\t\t\t\t\t\t\t\t\t\t$selected = \"selected=\\\"selected\\\"\";\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t$selected = NULL;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t$selected = NULL;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif( $key1 != 'user_pass' ){\r\n\t\t\t\t\t\t\t\t\t\tif( array_key_exists( $key1, $regFields ) ){\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo $key1 ;?>\" <?php echo $selected ;?> ><?php _e( $value1, 'user-registration-aide' );?></option>\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t_e( 'There currently are no fields selected for the Registration Form, Select some fields for the Registration Form first before you can make them optional or required!', 'user-registration-aide' );\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t//exit();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif( !empty( $ura_fields ) ){\r\n\t\t\t\t\tforeach( $ura_fields as $object ){\r\n\t\t\t\t\t\t$meta_key = $object->meta_key;\r\n\t\t\t\t\t\t$name = $object->field_name;\r\n\t\t\t\t\t\t//$reg_form = $object->registration_field;\r\n\t\t\t\t\t\tif( $object->field_required == 0 ){\r\n\t\t\t\t\t\t\t//exit( \"SELECTED\" );\r\n\t\t\t\t\t\t\t$selected = \"selected=\\\"selected\\\"\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//exit( \"UNSELECTED\" );\r\n\t\t\t\t\t\t\t$selected = NULL;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $object->registration_field == 1 ){\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t<option value=\"<?php echo $meta_key ;?>\" <?php echo $selected ;?> ><?php _e( $name, 'user-registration-aide' );?></option>\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} // end foreach\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif( empty( $regFields ) ){\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t<option value=\"<?php _e( 'no_fields_0', 'user-registration-aide' );?>\"><?php _e( 'No Registration Form Fields', 'user-registration-aide' );?></option>\r\n\t\t\t\t\t\t<option value=\"<?php _e( 'no_fields_1', 'user-registration-aide' );?>\"><?php _e( 'Have Been Added Yet!', 'user-registration-aide' );?></option>\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t?>\t\t\t\t\t\t\t\r\n\t\t\t\t</select>\r\n\t\t\t\t<br/>\r\n\t\t\t\t<b><?php _e( 'Hold down \"Ctrl\" button on keyboard to select or unselect multiple options!', 'user-registration-aide' );?>\r\n\t\t\t\t</b>\r\n\t\t\t\t</p>\r\n\t\t\t\t<div class=\"submit\">\r\n\t\t\t\t<input type=\"submit\" name=\"select_required_none\" class=\"button-primary\" value=\"<?php _e( 'Select None', 'user-registration-aide' ); ?>\" /></div>\r\n\t\t\t\t<div class=\"submit\">\r\n\t\t\t\t<input type=\"submit\" class=\"button-primary\" name=\"required_fields_update\" value=\"<?php _e( 'Required Fields Update', 'user-registration-aide' );?>\"/>\r\n\t\t\t\t</div>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t<br/>\r\n\t\t\t<table class=\"style\">\t\r\n\t\t\t<tr>\r\n\t\t\t\t<th colspan=\"3\"><?php _e( 'Registration Form Field Title Punctuation', 'user-registration-aide' );?> </th>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"2\">\r\n\t\t\t\t<?php _e( 'Use the * ( Asterisk ) on the Registration Form to Designate a Field is Required', 'user-registration-aide' );?>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t<span title=\"<?php _e( 'Select this option to use the * ( Asterisk ) to Designate a Required Field on the Registration Form( Field Title:* ( if using colon, you can remove that too! ), otherwise Field Title* )', 'user-registration-aide' );?>\">\r\n\t\t\t\t<input type=\"radio\" name=\"use_asterisk\" id=\"use_asterisk\" value=\"1\" <?php\r\n\t\t\t\tif ( $options['designate_required_fields'] == 1 ) echo 'checked' ;?> /> <?php _e( 'Yes', 'user-registration-aide' );?>\r\n\t\t\t\t</span>\r\n\t\t\t\t<span title=\"<?php _e( 'Select this option not to use the * ( Asterisk ) to Designate a Required Field on the Registration Form ( Field Title: ( if using colon, you can remove that too! ), otherwise Field Title )', 'user-registration-aide' );?>\">\r\n\t\t\t\t<input type=\"radio\" name=\"use_asterisk\" id=\"use_asterisk\" value=\"2\" <?php\r\n\t\t\t\tif ( $options['designate_required_fields'] == 2 ) echo 'checked' ;?> /> <?php _e( 'No', 'user-registration-aide' ); ?>\r\n\t\t\t\t</span>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"2\">\r\n\t\t\t\t<?php _e( 'Use the : ( Colon ) on the Registration Form after Field Title', 'user-registration-aide' );?>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t<span title=\"<?php _e( 'Select this option to use the : ( Colon ) After the Field Title on the Registration Form ( Field Title: )', 'user-registration-aide' );?>\">\r\n\t\t\t\t<input type=\"radio\" name=\"use_colon\" id=\"use_colon\" value=\"1\" <?php\r\n\t\t\t\tif ( $options['reg_form_use_colon'] == 1 ) echo 'checked' ;?> /> <?php _e( 'Yes', 'user-registration-aide' );?>\r\n\t\t\t\t</span>\r\n\t\t\t\t<span title=\"<?php _e( 'Select this option to not use the : ( Colon ) After the Field Title on the Registration Form ( Field Title )', 'user-registration-aide' );?>\">\r\n\t\t\t\t<input type=\"radio\" name=\"use_colon\" id=\"use_colon\" value=\"2\" <?php\r\n\t\t\t\tif ( $options['reg_form_use_colon'] == 2 ) echo 'checked' ;?> /> <?php _e( 'No', 'user-registration-aide' ); ?>\r\n\t\t\t\t</span>\r\n\t\t\t\t</td>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"3\">\r\n\t\t\t\t<input type=\"submit\" class=\"button-primary\" name=\"update-asterisk-colon\" value=\"<?php _e( 'Update Field Title Punctuation Option', 'user-registration-aide' );?>\"/>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t<br/>\r\n\t\t<?php\r\n\t\t}\r\n\t}", "public static function add_form_fields() {\n\n\t\tforeach ( WC()->payment_gateways->payment_gateways as $key => $gateway ) {\n\n\t\t\tif ( WC()->payment_gateways->payment_gateways[ $key ]->id !== 'paypal' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Warn store managers not to change their PayPal Email address as it can break existing Subscriptions in WC2.0+\n\t\t\tWC()->payment_gateways->payment_gateways[ $key ]->form_fields['receiver_email']['desc_tip'] = false;\n\t\t\tWC()->payment_gateways->payment_gateways[ $key ]->form_fields['receiver_email']['description'] .= ' </p><p class=\"description\">' . __( 'It is <strong>strongly recommended you do not change the Receiver Email address</strong> if you have active subscriptions with PayPal. Doing so can break existing subscriptions.', 'woocommerce-subscriptions' );\n\t\t}\n\t}", "function init_form_fields()\n {\n\n $this->form_fields = array(\n\n 'enabled' => array(\n 'title' => __('Enable'),\n 'type' => 'checkbox',\n 'description' => __('Enable this shipping.'),\n 'default' => 'yes'\n ),\n 'title' => array(\n 'title' => __('Title'),\n 'type' => 'text',\n 'description' => __('Title to be display on site'),\n 'default' => __('CDEK Shipping')\n ),\n 'priceSet' => array(\n 'title' => __('Delivery cost'),\n 'type' => 'text',\n 'description' => __('Default delivery cost'),\n 'default' => __('405')\n ),\n );\n }", "public function onAddField()\n {\n return $this->makePartial('create_field_form');\n }", "protected function wrap_fields()\n {\n }", "function init_form_fields() {\n $enabled_field = array(\n 'title' => __('Enable/Disable', 'wcis'),\n 'type' => 'checkbox',\n 'label' => __('Enable Indo Shipping', 'wcis'),\n 'default' => 'yes'\n );\n\n $key_field = array(\n 'title' => __('API Key', 'wcis'),\n 'type' => 'text',\n 'description' => __('Signup at <a href=\"http://rajaongkir.com/akun/daftar\" target=\"_blank\">rajaongkir.com</a> and choose Pro license (Paid). Paste the API Key here', 'wcis'),\n );\n\n $city_field = array(\n 'title' => __('City Origin', 'wcis'),\n 'type' => 'select',\n // 'class' => 'wc-enhanced-select', // bugged!! doesn't save the value\n 'description' => __('Ship from where? <br> Change your province at General > Base Location <br> Save this to refresh the City selection', 'wcis'),\n 'options' => array()\n );\n\n $this->form_fields = array(\n 'key' => $key_field\n );\n\n // if key is valid, show the other setting fields\n if($this->check_key_valid() ) {\n $city_field['options'] = $this->get_cities_origin();\n\n $this->form_fields['enabled'] = $enabled_field;\n $this->form_fields['city'] = $city_field;\n\n // set service fields by each courier\n $couriers = WCIS_Data::get_couriers();\n foreach($couriers as $id => $name) {\n $this->form_fields[$id . '_services'] = array(\n 'title' => $name,\n 'type' => 'multiselect',\n 'class' => 'wc-enhanced-select',\n 'description' => __(\"Choose allowed services by { $name }.\", 'wcis'),\n 'options' => WCIS_Data::get_services($id, true)\n );\n }\n\n } // if valid\n }", "public function addMetaFieldsToEditForm()\n\t{\n\t\t$interval = $this->getMetaFields('interval');\n\t\t$animation = $this->getMetaFields('animation');\n\n\t\t?>\n\t\t\t<tr class=\"form-field\">\n\t\t\t\t<th scope=\"row\">\n\t\t\t\t\t<label for=\"interval\">Tijd tussen slides</label>\n\t\t\t\t</th>\n\t\t\t\t<td>\n\t\t\t\t\t<input name=\"interval\" id=\"interval\" type=\"text\" value=\"<?php echo $interval;?>\" size=\"40\">\n\t\t\t\t\t<p class=\"description\">De tijd tussen slides in milliseconden (1000ms = 1s).</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"form-field\">\n\t\t\t\t<th scope=\"row\">\n\t\t\t\t\t<label for=\"animation\">Animatie</label>\n\t\t\t\t</th>\n\t\t\t\t<td>\n\t\t\t\t\t<select name=\"animation\" id=\"animation\">\n\t\t\t\t\t\t<option <?php selected($animation, 'slide'); ?> value=\"slide\">Slide</option>\n\t\t\t\t\t\t<option <?php selected($animation, 'fade'); ?> value=\"fade\">Fade</option>\n\t\t\t\t\t</select>\n\t\t\t\t\t<p class=\"description\">Selecteer de animatie die gebruikt wordt door de slideshow.</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t<?php\n\t}", "public function formExtendFields($form)\n {\n /*\n * Add permissions tab\n */\n $form->addTabFields($this->generatePermissionsField());\n }", "public function testUpdateExtraFields(): void { }", "public function init_form_fields() {\n\t\t$this->form_fields = [\n\t\t\t'enabled' => [\n\t\t\t\t'title' => 'Enable/Disable',\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => 'Enable this email digest',\n\t\t\t\t'default' => 'no'\n\t\t\t],\n\t\t\t'recipient' => [\n\t\t\t\t'title' => 'Recipient(s)',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => 'Enter recipients (comma separated) for this email. Defaults to ' . get_option( 'admin_email' ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t],\n\t\t\t'schedule' => [\n\t\t\t\t'type' => 'select',\n\t\t\t\t'title' => 'Scheduled Frequency',\n\t\t\t\t'description' => 'Weekly emails will be sent on Mondays. All emails are sent at 7:00am.',\n\t\t\t\t'options' => [\n\t\t\t\t\t'daily' => 'Daily',\n\t\t\t\t\t'weekly' => 'Weekly'\n\t\t\t\t],\n\t\t\t\t'default' => 'daily'\n\t\t\t],\n\t\t\t'email_type' => [\n\t\t\t\t'title' => 'Email type',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'description' => 'Choose which format of email to send.',\n\t\t\t\t'default' => 'html',\n\t\t\t\t'class' => 'email_type wc-enhanced-select',\n\t\t\t\t'options' => $this->get_email_type_options(),\n\t\t\t\t'desc_tip' => true,\n\t\t\t],\n\t\t\t'send_now' => [\n\t\t\t\t'title' => 'Send now?',\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => 'Yes, send the email digest on save',\n\t\t\t\t'default' => 'no'\n\t\t\t]\n\t\t];\n\t}", "public function init_form_fields(){\n \n $this->form_fields = array(\n \n 'enabled' => array(\n 'title' => __( 'Enable/Disable', 'woocommerce-freight-calculator' ),\n 'type' => 'checkbox',\n 'label' => __( 'If checked, this option enables the Freight Calculator.', 'woocommerce-freight-calculator' ),\n 'default' => 'yes'\n ),\n 'title' => array(\n 'title' => __( 'Freight Name', 'woocommerce-freight-calculator' ),\n 'type' => 'text',\n 'description' => __( 'Set here the name of your freight service.', 'woocommerce-freight-calculator' ),\n 'default' => __( 'Freight', 'woocommerce-freight-calculator' ),\n ),\n 'title2' => array(\n 'title' => __( 'Freight and Cargo Unloading Name', 'woocommerce-freight-calculator' ),\n 'type' => 'text',\n 'description' => __( 'Set here the name of your freight service with the optional unloading', 'woocommerce-freight-calculator' ),\n 'default' => __( 'Freight and Unloading', 'woocommerce-freight-calculator' ), \n ),\n 'priceperkm' => array(\n 'title' => __( 'Price per kilometer', 'woocommerce-freight-calculator'),\n 'description' => __( 'Set your price rate. (Ex.: 1.40)', 'woocommerce-freight-calculator' ),\n 'type' => 'text',\n 'default' => __( '1.40', 'woocommerce-freight-calculator' ),\n ),\n 'minimumprice' => array(\n 'title' => __( 'Minimum Freight Price', 'woocommerce-freight-calculator'),\n 'description' => __( 'Set your minimum price rate for the freight service. (Ex.: 5.00)', 'woocommerce-freight-calculator' ),\n 'type' => 'text',\n 'default' => __( '5.00', 'woocommerce-freight-calculator' ),\n ),\n 'unloadingprice' => array(\n 'title' => __( 'Cargo Unloading Service Price', 'woocommerce-freight-calculator' ),\n 'description' => __( 'Set here the price percentage to be applied over the total value for the optional unloading service. (Ex.: 20)', 'woocommerce-freight-calculator' ),\n 'type' => 'text',\n 'default' => __( '20', 'woocommerce-freight-calculator' ),\n ),\n 'originaddress' => array(\n 'title' => __( 'Address of Origin', 'woocommerce-freight-calculator' ),\n 'description'=> __( 'Set here the address of your warehouse. (Ex.: Street, 000, Neighborhood, P.O. Box, City, State, Country.)', 'woocommerce-freight-calculator' ),\n 'type' => 'text',\n 'default' => __( 'Street, 000, Neighborhood, P.O. Box, City, State, Country', 'woocommerce-freight-calculator' ),\n ),\n 'maxdistance' => array(\n 'title' => __( 'Maximum Distance of Coverage', 'woocommerce-freight-calculator' ),\n 'description'=> __( 'Set here, in KM, the maximum distance of coverage for the freight service. (Ex.: 50)', 'woocommerce-freight-calculator' ),\n 'type' => 'text',\n 'default' => __( '50' ),\n )\n );\n }", "public function init_form_fields() {\n $this->form_fields = require( dirname(__FILE__) . '/../class/midtrans-admin-settings.php' );\n // Currency conversion rate if currency is not IDR\n if (get_woocommerce_currency() != 'IDR') {\n $this->form_fields['to_idr_rate'] = array(\n 'title' => __(\"Current Currency to IDR Rate\", 'midtrans-woocommerce'),\n 'type' => 'text',\n 'description' => 'The current currency to IDR rate',\n 'default' => '10000',\n );\n }\n }", "function image_attachment_fields_to_edit($form_fields, $post)\n {\n }", "public function init_form_fields() {\n\n\t\t\t\t$this->form_fields = array(\n\t\t\t\t\t'enabled' => array(\n\t\t\t\t\t\t'title' => __( 'Enable/Disable', 'havanao' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'label' => __( 'Enable havanao payments', 'havanao' ),\n\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t),\n\t\t\t\t\t'title' => array(\n\t\t\t\t\t\t'title' => __( 'Title', 'havanao' ),\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'description' => __( 'This controls the title which the user sees during checkout.', 'havanao' ),\n\t\t\t\t\t\t'default' => __( 'Havanao Payments', 'havanao' ),\n\t\t\t\t\t\t'desc_tip' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'description' => array(\n\t\t\t\t\t\t'title' => __( 'Description', 'havanao' ),\n\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t'description' => __( 'Payment method description that the customer will see on your checkout.', 'havanao' ),\n\t\t\t\t\t\t'default' => __( 'Please have your phone ready to confirm payment', 'havanao' ),\n\t\t\t\t\t\t'desc_tip' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'instructions' => array(\n\t\t\t\t\t\t'title' => __( 'Instructions', 'havanao' ),\n\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t'description' => __( 'Instructions that will be added to the thank you page and emails.', 'havanao' ),\n\t\t\t\t\t\t'default' => __( 'Dial *182*7# on MTN to confirm pending payment', 'havanao' ),\n\t\t\t\t\t\t'desc_tip' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'success_payment_status' => array(\n\t\t\t\t\t\t'title' => __( 'Successful Payment Order Status', 'havanao' ),\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'default' => 'wc-completed',\n\t\t\t\t\t\t'options' => wc_get_order_statuses(),\n\t\t\t\t\t),\n\t\t\t\t\t'pending_payment_status' => array(\n\t\t\t\t\t\t'title' => __( 'Pending Payment Order Status', 'havanao' ),\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'default' => 'wc-on-hold',\n\t\t\t\t\t\t'options' => wc_get_order_statuses(),\n\t\t\t\t\t),\n\t\t\t\t\t'errored_payment_status' => array(\n\t\t\t\t\t\t'title' => __( 'Errored Payment Order Status', 'havanao' ),\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'default' => 'wc-pending',\n\t\t\t\t\t\t'options' => wc_get_order_statuses(),\n\t\t\t\t\t),\n\t\t\t\t\t'test_enabled' => array(\n\t\t\t\t\t\t'title' => __( 'Enable/Disable Test Mode', 'havanao' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'label' => __( 'Enable Test Mode', 'havanao' ),\n\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t),\n\t\t\t\t\t'havanao_api_key' => array(\n\t\t\t\t\t\t'title' => __( 'Havanao API Key', 'havanao' ),\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'description' => __( 'Havanao API Key required for authentication.' ),\n\t\t\t\t\t\t'default' => '',\n\t\t\t\t\t\t'desc_tip' => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}", "public function populateForm() {}", "function init_form_fields() {\n\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => '启用',\n 'type' => 'checkbox',\n 'label' => '启用交通银行支付',\n 'default' => 'no'\n ),\n 'title' => array(\n 'title' => '',\n 'type' => 'text',\n 'description' => '支付过程中所显示的支付名称',\n 'default' => '交通银行支付'\n ),\n 'description' => array(\n 'title' => '交通银行',\n 'type' => 'textarea',\n 'default' => '',\n ),\n 'merchantID' => array(\n 'title' => '商户编号',\n 'type' => 'text',\n 'description' => '',\n 'css' => 'width:400px'\n ),\n 'debug' => array(\n 'title' => 'debug模式',\n 'type' => 'checkbox',\n 'label' => '启用log',\n 'default' => 'no',\n 'description' => '选项无效,LOG始终启用,woocommerce/logs/bocpay',\n )\n );\n }", "function media_single_attachment_fields_to_edit($form_fields, $post)\n {\n }", "public function init_form_fields() {\r\n\r\n $this->form_fields = array(\r\n 'enabled' => array(\r\n 'title' => __('Enable/Disable', 'azericard'),\r\n 'type' => 'checkbox',\r\n 'label' => __('Enable Azericard Payment Module.', 'azericard'),\r\n 'default' => 'no'),\r\n 'title' => array(\r\n 'title' => __('Title:', 'azericard'),\r\n 'type'=> 'text',\r\n 'description' => __('This controls the title which the user sees during checkout.', 'azericard'),\r\n 'default' => __('Azericard', 'azericard')),\r\n 'description' => array(\r\n 'title' => __('Description:', 'azericard'),\r\n 'type' => 'textarea',\r\n 'description' => __('This controls the description which the user sees during checkout.', 'azericard'),\r\n 'default' => __('Pay securely by Credit or Debit card or internet banking through Azericard Secure Servers.', 'azericard')),\r\n\r\n 'select_mode' => array(\r\n 'title' => __( 'Sale mode', 'azericard' ),\r\n 'type' => 'select',\r\n 'description' => __( 'Select which mode do you want to use.', 'azericard' ),\r\n 'options' => array(\r\n 'test' => 'Test mode',\r\n 'production' => 'Production mode'\r\n ),\r\n 'default' => 'Authorize &amp; Capture'\r\n ),\r\n\r\n 'url_test' => array(\r\n 'title' => __('Azericard url (Test mode):', 'azericard'),\r\n 'type' => 'text',\r\n 'class' => 'test-mode',\r\n 'description' => __('Azericard url.', 'azericard'),\r\n 'default' => __('https://213.172.75.248/cgi-bin/cgi_link', 'azericard')),\r\n 'terminal_test' => array(\r\n 'title' => __('Terminal (Test mode)', 'azericard'),\r\n 'type' => 'text',\r\n 'class' => 'test-mode',\r\n 'description' => __('This terminal id use at Azericard.'),\r\n 'default' => __('77777777', 'azericard')),\r\n 'key_for_sign_test' => array(\r\n 'title' => __('Key for sign (Test mode)', 'azericard'),\r\n 'type' => 'text',\r\n 'class' => 'test-mode',\r\n 'description' => __('Given to key by Azericard', 'azericard'),\r\n 'default' => __('00112233445566778899AABBCCDDEEFF', 'azericard')),\r\n\r\n 'url_production' => array(\r\n 'title' => __('Azericard url (Production mode):', 'azericard'),\r\n 'type'=> 'text',\r\n 'class' => 'production-mode',\r\n 'description' => __('Azericard url.', 'azericard'),\r\n 'default' => __('https://213.172.75.248/cgi-bin/cgi_link', 'azericard')),\r\n 'terminal_production' => array(\r\n 'title' => __('Terminal (Production mode)', 'azericard'),\r\n 'type' => 'text',\r\n 'class' => 'production-mode',\r\n 'description' => __('This terminal id use at Azericard.'),\r\n 'default' => __('77777777', 'azericard')),\r\n 'key_for_sign_production' => array(\r\n 'title' => __('Key for sign (Production mode)', 'azericard'),\r\n 'type' => 'text',\r\n 'class' => 'production-mode',\r\n 'description' => __('Given to key by Azericard', 'azericard'),\r\n 'default' => __('00112233445566778899AABBCCDDEEFF', 'azericard')),\r\n\r\n 'redirect_page_id' => array(\r\n 'title' => __('Return Page'),\r\n 'type' => 'select',\r\n 'options' => $this -> get_pages_az('Select Page'),\r\n 'description' => \"URL of success page\"\r\n )\r\n );\r\n }", "function update_profile_fields()\n {\n if ( ! Session::access('can_admin_members')) {\n return Cp::unauthorizedAccess();\n }\n\n $fields = [\n \"m_field_id\",\n \"cur_field_name\",\n \"m_field_name\",\n \"m_field_label\",\n \"m_field_description\",\n \"m_field_order\",\n \"m_field_width\",\n \"m_field_type\",\n \"m_field_maxl\",\n \"m_field_ta_rows\",\n \"m_field_list_items\",\n \"m_field_required\",\n \"m_field_public\",\n \"m_field_reg\"\n ];\n\n\n $input = request()->only($fields);\n\n // If the $m_field_id variable is present we are editing existing\n $edit = (bool) request()->has('m_field_id');\n\n // Check for required fields\n if (empty($input['m_field_name'])) {\n $errors[] = __('members.no_field_name');\n }\n\n if (empty($input['m_field_label'])) {\n $errors[] = __('members.no_field_label');\n }\n\n // Is the field one of the reserved words?\n if (in_array($input['m_field_name'], Cp::unavailableFieldNames())) {\n $errors[] = __('members.reserved_word');\n }\n\n // Does field name have invalid characters?\n if ( ! preg_match(\"#^[a-z0-9\\_]+$#i\", $input['m_field_name'])) {\n $errors[] = __('members.invalid_characters');\n }\n\n // Is the field name taken?\n $field_count = DB::table('member_fields')\n ->where('m_field_name', $input['m_field_name'])\n ->count();\n\n if ($field_count > 0) {\n if ($edit === false) {\n $errors[] = __('members.duplicate_field_name');\n }\n\n if ($edit === true && $input['m_field_name'] != $input['cur_field_name']) {\n $errors[] = __('members.duplicate_field_name');\n }\n }\n\n // Are there errors to display?\n if (!empty($errors)) {\n return Cp::errorMessage(implode(\"\\n\", $errors));\n }\n\n if (!empty($input['m_field_list_items'])) {\n $input['m_field_list_items'] = Regex::convert_quotes($input['m_field_list_items']);\n }\n\n $n = 100;\n\n $f_type = 'text';\n\n if ($input['m_field_type'] == 'text') {\n if ( !empty($input['m_field_maxl']) && is_numeric($input['m_field_maxl'])) {\n $n = '100';\n }\n\n $f_type = 'string';\n }\n\n if ($edit === true) {\n\n if ($input['cur_field_name'] !== $input['m_field_name']) {\n\n Schema::table('member_data', function ($table) use ($input) {\n $table->renameColumn('m_field_'.$input['cur_field_name'], 'm_field_'.$input['m_field_name']);\n });\n }\n\n // ALTER\n Schema::table('member_data', function($table) use ($input, $f_type, $n)\n {\n if ($f_type == 'string') {\n $table->string('m_field_'.$input['m_field_name'], $n)->change();\n } else {\n $table->text('m_field_'.$input['m_field_name'])->change();\n }\n });\n\n unset($input['cur_field_name']);\n\n DB::table('member_fields')\n ->where('m_field_id', $input['m_field_id'])\n ->update($input);\n }\n\n if ($edit === false) {\n if (empty($input['m_field_order'])) {\n $total = DB::table('member_fields')->count() + 1;\n\n $input['m_field_order'] = $total;\n }\n\n unset($input['m_field_id']); // insure empty\n unset($input['cur_field_name']);\n\n $field_id = DB::table('member_fields')->insertGetId($input);\n\n // Add Field\n Schema::table('member_data', function($table) use ($input, $f_type, $n)\n {\n if ($f_type == 'string') {\n $table->string('m_field_'.$input['m_field_name'], $n);\n } else {\n $table->text('m_field_'.$input['m_field_name']);\n }\n });\n }\n\n // Insure every member has member data row?\n $query = DB::table('members')\n ->leftJoin('member_data', 'members.member_id', '=', 'member_data.member_id')\n ->whereNull('member_data.member_id')\n ->select('members.member_id')\n ->get();\n\n foreach ($query as $row)\n {\n DB::table('member_data')->insert(['member_id' => $row->member_id]);\n }\n\n return $this->custom_profile_fields();\n }", "public function updateMemberFormFields(FieldList $fields)\n {\n //\n }", "protected function addFormFieldNamesToViewHelperVariableContainer() {}", "function init_form_fields() {\n parent::init_form_fields();\n WC_Midtrans_Utils::array_insert( $this->form_fields, 'enable_3d_secure', array(\n 'method_enabled' => array(\n 'title' => __( 'Allowed Payment Method', 'midtrans-woocommerce' ),\n 'type' => 'text',\n 'description' => __( 'Customize allowed payment method, separate payment method code with coma. e.g: bank_transfer,credit_card. <br>Leave it default if you are not sure.', 'midtrans-woocommerce' ),\n 'default' => 'credit_card'\n ),\n 'bin_number' => array(\n 'title' => __( 'Allowed CC BINs', 'midtrans-woocommerce'),\n 'type' => 'text',\n 'label' => __( 'Allowed CC BINs', 'midtrans-woocommerce' ),\n 'description' => __( 'Fill with CC BIN numbers (or bank name) that you want to allow to use this payment button. </br> Separate BIN number with coma Example: 4,5,4811,bni,mandiri', 'midtrans-woocommerce' ),\n 'default' => ''\n ),\n 'promo_code' => array(\n 'title' => __( 'Promo Code', 'midtrans-woocommerce' ),\n 'type' => 'text',\n 'description' => __( 'Promo Code that would be used for discount. Leave blank if you are not using promo code.', 'midtrans-woocommerce' ),\n 'default' => 'onlinepromomid'\n )\n ));\n }", "function init_form_fields() {\n\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', 'esewa-payment-gateway-for-woocommerce' ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable eSewa Payment Method', 'esewa-payment-gateway-for-woocommerce' ),\n 'default' => 'yes',\n ),\n 'title' => array(\n 'title' => __( 'Title', 'esewa-payment-gateway-for-woocommerce' ),\n 'type' => 'text',\n 'description' => __( 'This controls the title which the user sees during checkout.', 'esewa-payment-gateway-for-woocommerce' ),\n 'default' => __( 'eSewa', 'esewa-payment-gateway-for-woocommerce' ),\n 'desc_tip' => true,\n ),\n 'description' => array(\n 'title' => __( 'Customer Message', 'esewa-payment-gateway-for-woocommerce' ),\n 'type' => 'textarea',\n 'description' => __( 'Enter description of payment gateway', 'esewa-payment-gateway-for-woocommerce' ),\n 'default' => __( 'eSewa is the first online payment gateway of Nepal. It facilitates its users to pay and get paid online.', 'esewa-payment-gateway-for-woocommerce' ),\n ),\n 'merchant' => array(\n 'title' => __( 'Merchant ID', 'esewa-payment-gateway-for-woocommerce' ),\n 'type' => 'text',\n 'description' => __( 'Enter Merchant ID. Eg. 0000ETM', 'esewa-payment-gateway-for-woocommerce' ),\n 'default' => '',\n 'placeholder' => __( 'Enter Merchant ID', 'esewa-payment-gateway-for-woocommerce' ),\n ),\n 'testing' => array(\n 'title' => __( 'For Developers', 'esewa-payment-gateway-for-woocommerce' ),\n 'type' => 'title',\n 'description' => '',\n ),\n 'testmode' => array(\n 'title' => __( 'Test mode', 'esewa-payment-gateway-for-woocommerce' ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable Test mode', 'esewa-payment-gateway-for-woocommerce' ),\n 'default' => 'no',\n 'description' => __( 'Used for development purpose', 'esewa-payment-gateway-for-woocommerce' ),\n ),\n 'debug' => array(\n 'title' => __( 'Debug Log', 'esewa-payment-gateway-for-woocommerce' ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable logging', 'esewa-payment-gateway-for-woocommerce' ),\n 'default' => 'no',\n 'description' => sprintf( __( 'Log eSewa events, inside <code>%s</code>', 'esewa-payment-gateway-for-woocommerce' ),\n wc_get_log_file_path( 'esewa' )\n ),\n ),\n );\n\n\t\t}", "private function fields_supports( $form_field )\n\t{\n\t\t$this->field = new stdClass();\n\t\tforeach ( $form_field as $prop => $value ) {\n\t\t\tswitch ( $prop ) {\n\t\t\t\tcase 'opt':\n\t\t\t\t\tif ( $value ) {\n\t\t\t\t\t\t$this->field->$prop = new stdClass();\n\t\t\t\t\t\tforeach ( $value as $val => $label ) {\n\t\t\t\t\t\t\tif ( !empty( $val ) ) {\n\t\t\t\t\t\t\t\t$this->field->$prop->$label = $val;\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\tbreak;\n\t\t\t\tcase 'required':\n\t\t\t\t\t$this->field->$prop = $value ? 'required=\"true\"' : '';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'name':\n\t\t\t\t\t$this->field->$prop = $value ? $value : $this->id;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'multiple':\n\t\t\t\t\t$this->field->$prop = $value ? 'multiple=\"true\"' : '';\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->field->$prop = $value;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function buildFields() {\n }", "public function init_form_fields()\n {\n $this->form_fields = array(\n\n 'enabled' => array(\n 'title' => __('Of/Off', 'woocommerce'),\n 'type' => 'checkbox',\n 'label' => __('On', 'woocommerce'),\n 'default' => 'yes',\n ),\n\n 'title' => array(\n 'title' => __('Name of payment method', 'woocommerce'),\n 'type' => 'text',\n 'description' => __('User see this title in order checkout.', 'woocommerce'),\n 'default' => __('Paysto', 'woocommerce'),\n ),\n\n 'paysto_x_description' => array(\n 'title' => __('Comment for payment', 'woocommerce'),\n 'type' => 'text',\n 'required' => true,\n 'description' => __('Fill this field obligatory', 'woocommerce'),\n 'default' => __('Payment in my store throw Paysto payment system', 'woocommerce'),\n ),\n\n 'paysto_x_login' => array(\n 'title' => __('Code of your store', 'woocommerce'),\n 'type' => 'text',\n 'required' => true,\n 'description' => __('Please find your merchant id in merchant in Paysto merchant backoffice',\n 'woocommerce'),\n 'default' => '',\n ),\n\n 'paysto_secret' => array(\n 'title' => __('Secret', 'woocommerce'),\n 'type' => 'password',\n 'description' => __('Paysto secret word, please set it also in Paysto merchant backoffice',\n 'woocommerce'),\n 'default' => '',\n ),\n\n 'paysto_order_status' => array(\n 'title' => __('Order status', 'woocommerce'),\n 'type' => 'select',\n 'options' => wc_get_order_statuses(),\n 'description' => __('Setup order status after successfull payment', 'woocommerce'),\n ),\n\n 'paysto_vat_products' => array(\n 'title' => __('VAT for products', 'woocommerce'),\n 'type' => 'select',\n 'options' => array(\n 1 => __('With VAT', 'woocommerce'),\n 0 => __('Without VAT', 'woocommerce')\n ),\n 'description' => __('Set VAT for products in checkout', 'woocommerce'),\n 'default' => '0',\n ),\n\n 'paysto_vat_delivery' => array(\n 'title' => __('VAT for delivery', 'woocommerce'),\n 'type' => 'select',\n 'options' => array(\n 1 => __('With VAT', 'woocommerce'),\n 0 => __('Without VAT', 'woocommerce')\n ),\n 'description' => __('Set VAT for delivery in checkout', 'woocommerce'),\n 'default' => '0',\n ),\n\n 'paysto_ips_servers' => array(\n 'title' => __('IPs Addresses of Paysto callback servers', 'woocommerce'),\n 'type' => 'textarea',\n 'description' => __('This options need for security reason. Each server IP must begin in new line.',\n 'woocommerce'),\n 'default' => '95.213.209.218\n95.213.209.219\n95.213.209.220\n95.213.209.221\n95.213.209.222',\n ),\n\n 'paysto_only_from_ips' => array(\n 'title' => __('Only approved server', 'woocommerce'),\n 'type' => 'checkbox',\n 'label' => __('Use only callbacks from approved Paysto servers', 'woocommerce'),\n 'default' => 'yes',\n ),\n\n 'debug' => array(\n 'title' => __('Debug', 'woocommerce'),\n 'type' => 'checkbox',\n 'label' => __('Switch on logging in file (<code>woocommerce/logs/paysto.txt</code>)',\n 'woocommerce'),\n 'default' => 'no',\n ),\n\n 'description' => array(\n 'title' => __('Description', 'woocommerce'),\n 'type' => 'textarea',\n 'description' => __('Description of payment method which user can see in you site.',\n 'woocommerce'),\n 'default' => __('Payment with Paysto service.', 'woocommerce'),\n ),\n\n 'instructions' => array(\n 'title' => __('Instructions', 'woocommerce'),\n 'type' => 'textarea',\n 'description' => __('Instructions which can added in page of thank-you-payment page.',\n 'woocommerce'),\n 'default' => __('Payment with Paysto service. Thank you very much for you payment.',\n 'woocommerce'),\n ),\n );\n }", "public function create_fields() {\n\t\tif ( count( $this->sections ) > 0 ) {\n\t\t\tforeach ( $this->fields as $k => $v ) {\n\t\t\t\t$method = $this->determine_method( $v, 'form' );\n\t\t\t\t$name = $v['name'];\n\t\t\t\tif ( $v['type'] == 'info' ) { $name = ''; }\n\t\t\t\tadd_settings_field( $k, $name, $method, $this->token, $v['section'], array( 'key' => $k, 'data' => $v ) );\n\n\t\t\t\t// Let the API know that we have a colourpicker field.\n\t\t\t\tif ( $v['type'] == 'range' && $this->_has_range == false ) { $this->_has_range = true; }\n\t\t\t}\n\t\t}\n\t}", "protected abstract function setFields();", "public function set_fields() {\n\n\t\t$this->fields = Pngx__Meta__Fields::get_fields();\n\t}", "public function _editFieldView() {\n\n\t\t/* Call in Smarty to display template */\n\t\tbfLoad ( 'bfSmarty' );\n\n\t\t$tmp = bfSmarty::getInstance ( 'com_form' );\n\t\t$tmp->caching = false;\n\t\t$tmp->assignFromArray ( $this->_config );\n\n\t\t$disabled = bfHTML::yesnoRadioList ( 'disabled', '', $this->_config ['disabled'] );\n\t\t$tmp->assign ( 'DISABLED', $disabled );\n\t\t$tmp->assign ( 'CONFIG', $this->_config );\n\n\t\t/* Yes No Answers */\n\t\t$qs = array ('verify_brazil_cpf', 'verify_brazil_cnpj', 'filter_strtoupper', 'filter_strtolower', 'verify_isvalidvatnumber', 'verify_isexistingusername', 'verify_isnotexistingusername', 'verify_isinteger', 'verify_isvalidurl', 'verify_isvalidcreditcardnumber', 'verify_isvalidukpostcode', 'published', 'allowsetbyget', 'allowbyemail', 'filter_a2z', 'filter_StripTags', 'filter_StringTrim', 'filter_Alnum', 'filter_Digits', 'required', 'verify_isemailaddress', 'verify_isblank', 'verify_isnotblank', 'verify_isipaddress', 'verify_isvalidukninumber', 'verify_isvalidssn', 'verify_isvaliduszip' );\n\t\tforeach ( $qs as $q ) {\n\t\t\t$tmp->assign ( strtoupper ( $q ), bfHTML::yesnoRadioList ( $q, '', $this->_config [$q] ) );\n\t\t}\n\n\t\t$OPTIONS = array (bfHTML::makeOption ( '0', 'Public' ), bfHTML::makeOption ( '1', 'Registered' ), bfHTML::makeOption ( '2', 'Special' ) );\n\n\t\t$access = bfHTML::selectList2 ( $OPTIONS, 'access', '', 'value', 'text', $this->_config ['access'] );\n\t\t$tmp->assign ( 'ACCESS', $access );\n\n\t\t$params = bfHTML::yesnoRadioList ( 'params', '', $this->_config ['params'] );\n\t\t$tmp->assign ( 'PARAMS', $params );\n\n\t\t$OPTIONS = array ();\n\t\t$dir = new DirectoryIterator ( bfcompat::getAbsolutePath () . '/components/com_form/plugins/fields/datepicker/jscalendar-1.0/lang' );\n\t\tforeach ( $dir as $file ) {\n\t\t\tif ($file->isDot ())\n\t\t\t\tcontinue;\n\t\t\t\t// Do something with $file\n\t\t\t$OPTIONS [] = bfHTML::makeOption ( $file->getFilename (), $file->getFilename () );\n\t\t}\n\n\t\t$LANG = bfHTML::selectList2 ( $OPTIONS, 'lang', '', 'value', 'text', $this->_config ['lang'] );\n\t\t$tmp->assign ( 'LANG', $LANG );\n\n\t\t$OPTIONS = array (bfHTML::makeOption ( 'calendar-blue.css', 'calendar-blue.css' ), bfHTML::makeOption ( 'calendar-blue2.css', 'calendar-blue2.css' ), bfHTML::makeOption ( 'calendar-brown.css', 'calendar-brown.css' ), bfHTML::makeOption ( 'calendar-green.css', 'calendar-green.css' ), bfHTML::makeOption ( 'calendar-system.css', 'calendar-system.css' ), bfHTML::makeOption ( 'calendar-tas.css', 'calendar-tas.css' ), bfHTML::makeOption ( 'calendar-win2k-1.css', 'calendar-win2k-1.css' ), bfHTML::makeOption ( 'calendar-win2k-2.css', 'calendar-win2k-2.css' ), bfHTML::makeOption ( 'calendar-win2k-cold-1.css', 'calendar-win2k-cold-1.css' ), bfHTML::makeOption ( 'calendar-win2k-cold-2.css', 'calendar-win2k-cold-2.css' ) );\n\n\t\t$CSSFILE = bfHTML::selectList2 ( $OPTIONS, 'cssfile', '', 'value', 'text', $this->_config ['cssfile'] );\n\t\t$tmp->assign ( 'CSSFILE', $CSSFILE );\n\n\t\t$tmp->display ( dirname ( __FILE__ ) . DS . 'editView.tpl' );\n\t}", "function init_form_fields() {\n\n \tinclude ( SUMO_SAGEPLUGINPATH . 'includes/sagepay-form-admin.php' );\n\n }", "function extraFields() {\n\t\n\t\t$file_id = JRequest::getVar('id');\n\t\t$filename = JRequest::getVar('filename');\n\t\t\n\t\tif (!$filename) {\n\t\t\texit();\n\t\t}\n\t\t\n\t\t$model = $this->getModel();\n\t\t$form = $model->getFieldForm($file_id, 'bulk');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\">';\n\t\techo '<legend>Edit '.$filename.'</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "function edit_profile_field_form()\n {\n if ( ! Session::access('can_admin_members'))\n {\n return Cp::unauthorizedAccess();\n }\n\n $type = ($m_field_id = Request::input('m_field_id')) ? 'edit' : 'new';\n\n // Fetch language file\n // There are some lines in the publish administration language file\n // that we need.\n\n $total_fields = '';\n\n if ($type == 'new')\n {\n $total_fields = DB::table('member_fields')->count() + 1;\n }\n\n $query = DB::table('member_fields')\n ->where('m_field_id', $m_field_id)\n ->first();\n\n if (!$query) {\n\n $m_field_name='';\n $m_field_label='';\n $m_field_description='';\n $m_field_type='text';\n $m_field_list_items='';\n $m_field_ta_rows=8;\n $m_field_maxl='';\n $m_field_width='';\n $m_field_search='y';\n $m_field_required='n';\n $m_field_public='y';\n $m_field_reg='n';\n $m_field_order='';\n } else {\n foreach ($query as $key => $val) {\n $$key = $val;\n }\n }\n\n $r = <<<EOT\n\n <script type=\"text/javascript\">\n <!--\n\n function showhide_element(id)\n {\n if (id == 'text')\n {\n document.getElementById('text_block').style.display = \"block\";\n document.getElementById('textarea_block').style.display = \"none\";\n document.getElementById('select_block').style.display = \"none\";\n }\n else if (id == 'textarea')\n {\n document.getElementById('textarea_block').style.display = \"block\";\n document.getElementById('text_block').style.display = \"none\";\n document.getElementById('select_block').style.display = \"none\";\n }\n else\n {\n document.getElementById('select_block').style.display = \"block\";\n document.getElementById('text_block').style.display = \"none\";\n document.getElementById('textarea_block').style.display = \"none\";\n }\n }\n\n -->\n </script>\nEOT;\n\n $title = ($type == 'edit') ? 'members.edit_member_field' : 'members.create_member_field';\n\n $i = 0;\n\n // Form declaration\n\n $r .= Cp::formOpen(array('action' => 'C=Administration'.AMP.'M=members'.AMP.'P=update_profile_fields'.AMP.'U=1'));\n $r .= Cp::input_hidden('m_field_id', $m_field_id);\n $r .= Cp::input_hidden('cur_field_name', $m_field_name);\n\n $r .= Cp::table('tableBorder', '0', '10', '100%').\n '<tr>'.PHP_EOL.\n Cp::td('tableHeading', '', '2').__($title).'</td>'.PHP_EOL.\n '</tr>'.PHP_EOL;\n\n\n // ------------------------------------\n // Field name\n // ------------------------------------\n\n $r .= '<tr>'.PHP_EOL;\n $r .= Cp::tableCell('', Cp::quickSpan('defaultBold', Cp::required().NBS.__('members.fieldname')).Cp::quickDiv('littlePadding', __('members.fieldname_cont')), '40%');\n $r .= Cp::tableCell('', Cp::input_text('m_field_name', $m_field_name, '50', '60', 'input', '300px'), '60%');\n $r .= '</tr>'.PHP_EOL;\n\n // ------------------------------------\n // Field label\n // ------------------------------------\n\n $r .= '<tr>'.PHP_EOL;\n $r .= Cp::tableCell('', Cp::quickSpan('defaultBold', Cp::required().NBS.__('members.fieldlabel')).Cp::quickDiv('littlePadding', __('members.for_profile_page')), '40%');\n $r .= Cp::tableCell('', Cp::input_text('m_field_label', $m_field_label, '50', '60', 'input', '300px'), '60%');\n $r .= '</tr>'.PHP_EOL;\n\n // ------------------------------------\n // Field Description\n // ------------------------------------\n\n $r .= '<tr>'.PHP_EOL;\n $r .= Cp::tableCell('', Cp::quickSpan('defaultBold', __('members.field_description')).Cp::quickDiv('littlePadding', __('members.field_description_info')), '40%');\n $r .= Cp::tableCell('', Cp::input_textarea('m_field_description', $m_field_description, '4', 'textarea', '100%'), '60%');\n $r .= '</tr>'.PHP_EOL;\n\n // ------------------------------------\n // Field order\n // ------------------------------------\n\n if ($type == 'new')\n $m_field_order = $total_fields;\n\n $r .= '<tr>'.PHP_EOL;\n $r .= Cp::tableCell('', Cp::quickSpan('defaultBold', __('admin.field_order')), '40%');\n $r .= Cp::tableCell('', Cp::input_text('m_field_order', $m_field_order, '4', '3', 'input', '30px'), '60%');\n $r .= '</tr>'.PHP_EOL;\n\n // ------------------------------------\n // Field type\n // ------------------------------------\n\n $sel_1 = ''; $sel_2 = ''; $sel_3 = '';\n $text_js = ($type == 'edit') ? 'none' : 'block';\n $textarea_js = 'none';\n $select_js = 'none';\n $select_opt_js = 'none';\n\n switch ($m_field_type)\n {\n case 'text' : $sel_1 = 1; $text_js = 'block';\n break;\n case 'textarea' : $sel_2 = 1; $textarea_js = 'block';\n break;\n case 'select' : $sel_3 = 1; $select_js = 'block'; $select_opt_js = 'block';\n break;\n }\n\n // ------------------------------------\n // Create the pull-down menu\n // ------------------------------------\n\n $typemenu = \"<select name='m_field_type' class='select' onchange='showhide_element(this.options[this.selectedIndex].value);' >\".PHP_EOL;\n $typemenu .= Cp::input_select_option('text', __('admin.text_input'), $sel_1)\n .Cp::input_select_option('textarea', __('admin.textarea'), $sel_2)\n .Cp::input_select_option('select', __('admin.select_list'), $sel_3)\n .Cp::input_select_footer();\n\n\n // ------------------------------------\n // Field width\n // ------------------------------------\n\n if ($m_field_width == '') {\n $m_field_width = '100%';\n }\n\n $r .= '<tr>'.PHP_EOL;\n $r .= Cp::tableCell('', Cp::quickSpan('defaultBold', __('members.field_width')).Cp::quickDiv('littlePadding', __('members.field_width_cont')), '40%');\n $r .= Cp::tableCell('', Cp::input_text('m_field_width', $m_field_width, '8', '6', 'input', '60px'), '60%');\n $r .= '</tr>'.PHP_EOL;\n\n // ------------------------------------\n // Max-length Field\n // ------------------------------------\n\n if ($m_field_maxl == '') $m_field_maxl = '100';\n\n $typopts = '<div id=\"text_block\" style=\"display: '.$text_js.'; padding:0; margin:5px 0 0 0;\">';\n $typopts .= Cp::quickDiv('defaultBold', __('members.max_length')).Cp::quickDiv('littlePadding', Cp::input_text('m_field_maxl', $m_field_maxl, '4', '3', 'input', '30px'));\n $typopts .= '</div>'.PHP_EOL;\n\n // ------------------------------------\n // Textarea Row Field\n // ------------------------------------\n\n if ($m_field_ta_rows == '') $m_field_ta_rows = '10';\n\n $typopts .= '<div id=\"textarea_block\" style=\"display: '.$textarea_js.'; padding:0; margin:5px 0 0 0;\">';\n $typopts .= Cp::quickDiv('defaultBold', __('members.text_area_rows')).Cp::quickDiv('littlePadding', Cp::input_text('m_field_ta_rows', $m_field_ta_rows, '4', '3', 'input', '30px'));\n $typopts .= '</div>'.PHP_EOL;\n\n // ------------------------------------\n // Select List Field\n // ------------------------------------\n\n $typopts .= '<div id=\"select_block\" style=\"display: '.$select_js.'; padding:0; margin:5px 0 0 0;\">';\n $typopts .= Cp::quickDiv('defaultBold', __('members.pull_down_items')).Cp::quickDiv('default', __('members.field_list_instructions')).Cp::input_textarea('m_field_list_items', $m_field_list_items, 10, 'textarea', '400px');\n $typopts .= '</div>'.PHP_EOL;\n\n\n // ------------------------------------\n // Generate the above items\n // ------------------------------------\n\n $r .= '<tr>'.PHP_EOL;\n $r .= Cp::tableCell('', Cp::quickDiv('littlePadding', Cp::quickSpan('defaultBold', __('admin.field_type'))).$typemenu, '50%', 'top');\n $r .= Cp::tableCell('', $typopts, '50%', 'top');\n $r .= '</tr>'.PHP_EOL;\n\n // ------------------------------------\n // Is field required?\n // ------------------------------------\n\n if ($m_field_required == '') $m_field_required = 'n';\n\n $r .= '<tr>'.PHP_EOL;\n $r .= Cp::tableCell('', Cp::quickSpan('defaultBold', __('members.is_field_required')), '40%');\n $r .= Cp::tableCell('', __('cp.yes').'&nbsp;'.Cp::input_radio('m_field_required', 'y', ($m_field_required == 'y') ? 1 : '').'&nbsp;'.__('cp.no').'&nbsp;'.Cp::input_radio('m_field_required', 'n', ($m_field_required == 'n') ? 1 : ''), '60%');\n $r .= '</tr>'.PHP_EOL;\n\n\n // ------------------------------------\n // Is field public?\n // ------------------------------------\n\n if ($m_field_public == '') $m_field_public = 'y';\n\n $r .= '<tr>'.PHP_EOL;\n $r .= Cp::tableCell('', Cp::quickSpan('defaultBold', __('members.is_field_public')).Cp::quickDiv('littlePadding', __('members.is_field_public_cont')), '40%');\n $r .= Cp::tableCell('', __('cp.yes').'&nbsp;'.Cp::input_radio('m_field_public', 'y', ($m_field_public == 'y') ? 1 : '').'&nbsp;'.__('cp.no').'&nbsp;'.Cp::input_radio('m_field_public', 'n', ($m_field_public == 'n') ? 1 : ''), '60%');\n $r .= '</tr>'.PHP_EOL;\n\n // ------------------------------------\n // Is field visible in reg page?\n // ------------------------------------\n\n if ($m_field_reg == '') $m_field_reg = 'n';\n\n $r .= '<tr>'.PHP_EOL;\n $r .= Cp::tableCell('', Cp::quickSpan('defaultBold', __('members.is_field_reg')).Cp::quickDiv('littlePadding', __('members.is_field_public_cont')), '40%');\n $r .= Cp::tableCell('', __('cp.yes').'&nbsp;'.Cp::input_radio('m_field_reg', 'y', ($m_field_reg == 'y') ? 1 : '').'&nbsp;'.__('cp.no').'&nbsp;'.Cp::input_radio('m_field_reg', 'n', ($m_field_reg == 'n') ? 1 : ''), '60%');\n $r .= '</tr>'.PHP_EOL;\n\n\n $r .= '</table>'.PHP_EOL;\n\n $r .= Cp::div('littlePadding');\n $r .= Cp::required(1).BR.BR;\n\n if ($type == 'edit')\n $r .= Cp::input_submit(__('members.update'));\n else\n $r .= Cp::input_submit(__('cp.submit'));\n\n $r .= '</div>'.PHP_EOL;\n\n $r .= '</form>'.PHP_EOL;\n\n Cp::$title = __('members.edit_member_field');\n Cp::$crumb = Cp::anchor(BASE.'?C=Administration'.AMP.'area=members_and_groups', __('admin.members_and_groups')).\n Cp::breadcrumbItem(Cp::anchor(BASE.'?C=Administration'.AMP.'M=members'.AMP.'P=profile_fields', __('members.custom_member_fields'))).\n Cp::breadcrumbItem(__('members.edit_member_field'));\n Cp::$body = $r;\n }", "function alter_comment_form_fields($fields){\n \n $fields = array(\n 'author' =>\n '<div class=\"row\"><div class=\"col-md-6 comment-form-author \"><div class=\"action-wrapper\">' . \n '<input id=\"author\" name=\"author\" type=\"text\" value=\"' . esc_attr( $commenter['comment_author'] ) .\n '\" size=\"30\"' . $aria_req . ' />' . \n '<label for=\"author\">' . __( 'Name', 'domainreference' ) . '</label> ' .\n '</div></div>',\n\n 'email' =>\n '<div class=\"col-md-6 comment-form-email\"><div class=\"action-wrapper\">' . \n '<input id=\"email\" name=\"email\" type=\"text\" value=\"' . esc_attr( $commenter['comment_author_email'] ) .\n '\" size=\"30\"' . $aria_req . ' />' . \n '<label for=\"email\">' . __( 'Email', 'domainreference' ) . '</label> ' .\n '</div></div></div>',\n\n 'url' => '',\n );\n\n return $fields;\n}", "public function hookForm() {\n }", "public function init_form_fields() {\n global $woocommerce;\n\n $this->form_fields = [\n 'enabled' => [\n 'title' => __( 'Enabled/Disabled', $this->id ),\n 'type' => 'checkbox',\n 'label' => 'Enable this shipping method'\n ],\n\n 'usertitle' => [\n 'title' => __( 'Shipping method label', $this->id ),\n 'type' => 'text',\n 'description' => __( 'The label that is visible to the user.', $this->id ),\n 'default' => __( 'Tiered Flat Rate', $this->id )\n ],\n\n 'availability' => [\n 'title' => __( 'Availability', $this->id ),\n 'type' => 'select',\n 'class' => 'wc-enhanced-select availability',\n 'options' => [\n 'all' => 'All allowed countries',\n 'except' => 'All allowed countries, except...',\n 'specific' => 'Specific countries'\n ],\n 'default' => __( 'all', $this->id )\n ],\n\n 'countries' => [\n 'title' => __( 'Countries', $this->id ),\n 'type' => 'multiselect',\n 'class' => 'wc-enhanced-select',\n 'options' => $woocommerce->countries->countries,\n 'default' => __( '', $this->id )\n ],\n\n 'basefee' => [\n 'title' => __( 'Base shipping fee ($)', $this->id ),\n 'type' => 'text',\n 'description' => __( 'Flat shipping fee that is applied automatically to the cart total for any number of items.', $this->id )\n ],\n\n 'tierfee' => [\n 'title' => __( 'Tier shipping fee ($)', $this->id ),\n 'type' => 'text',\n 'description' => __( 'Additional shipping fee added to the base fee if the number of items in the cart exceeds a specified number.', $this->id )\n ],\n\n 'quantity' => [\n 'title' => __( 'Number of items to activate tier shipping fee', $this->id ),\n 'type' => 'text',\n 'description' => __( 'Number of items in the cart needed to activate the additional tier shipping fee.', $this->id )\n ],\n\n 'progressive' => [\n 'title' => __( 'Incremental fee?', $this->id ),\n 'type' => 'checkbox',\n 'label' => __( 'Make the tiered shipping fee incremental' ),\n 'description' => __( 'If this option is checked, the tiered shipping fee will be applied incrementally in multiples of the tier item quantity; otherwise, the tiered shipping fee will be a flat fee if the cart is above the specified quantity.', $this->id )\n ]\n ];\n }", "function init_extra_fields() {\n $temp = $this->uc->CallMethod('PickupLocations', array(), 'GET', $this->token);\n $pickups = array();\n if (is_array($temp)) {\n foreach ($temp as $t) {\n $pickups[$t['LocationId']] = $t['Name'];\n }\n }\n\n // obtine lista planurilor tarifare\n $temp = $this->uc->CallMethod('PriceTables', array(), 'GET', $this->token);\n\n $prices = array();\n if (is_array($temp)) {\n foreach ($temp as $t) {\n $prices[$t['PriceTableId']] = empty($t['Name']) ? $t['PriceTableId'] : $t['Name'];\n }\n }\n\n $this->form_fields += array(\n 'pickup' => array(\n 'title' => __('Punct de ridicare', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(null => 'Alege punctul de ridicare') + $pickups\n ),\n 'priceplan' => array(\n 'title' => __('Plan tarifar', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(null => 'Alege planul tarifar') + $prices\n ),\n 'insurance' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Asigurare', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'saturday' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Livrare sambata', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'morning' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Livrare dimineata', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'open' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Deschidere colet', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'repayment' => array(\n 'title' => __('Incasare ramburs', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 'cash' => 'Numerar',\n 'bank' => 'Transfer bancar'\n )\n ),\n 'payer' => array(\n 'title' => __('Platitor expeditie', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 'sender' => 'Expeditor',\n 'recipient' => 'Destinatar'\n )\n ),\n 'type' => array(\n 'title' => __('Tip expeditie', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 'parcel' => 'Colet',\n 'envelope' => 'Plic'\n )\n ),\n 'free' => array(\n 'title' => __('Plafon transport gratuit', 'urgentcargus'),\n 'type' => 'text',\n ),\n 'fixed' => array(\n 'title' => __('Cost fix transport', 'urgentcargus'),\n 'type' => 'text',\n ),\n 'height' => array(\n 'title' => __('Inaltime', 'urgentcargus'),\n 'type' => 'number',\n ),\n 'width' => array(\n 'title' => __('Latime', 'urgentcargus'),\n 'type' => 'number',\n ),\n 'length' => array(\n 'title' => __('Lungime', 'urgentcargus'),\n 'type' => 'number',\n ),\n 'service' => array(\n 'title' => __('Serviciu', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 0 => 'Inactiv',\n 1 => 'Activ'\n )\n ),\n );\n }", "function my_update_fields($fields) {\n\n\t$commenter = wp_get_current_commenter();\n\t$req = get_option( 'require_name_email' );\n\t$aria_req = ( $req ? \" aria-required='true'\" : '' );\n\n\t$fields['author'] =\n\t\t'<p class=\"comment-form-author\">\n\t\t\t<input required minlength=\"3\" maxlength=\"30\" placeholder=\"Your Name*\" id=\"author\" name=\"author\" type=\"text\" value=\"' . esc_attr( $commenter['comment_author'] ) .\n '\" size=\"30\"' . $aria_req . ' />\n \t</p>';\n\n $fields['email'] =\n \t'<p class=\"comment-form-email\">\n \t\t<input required placeholder=\"Your Email*\" id=\"email\" name=\"email\" type=\"email\" value=\"' . esc_attr( $commenter['comment_author_email'] ) .\n '\" size=\"30\"' . $aria_req . ' />\n \t</p>';\n\n\t$fields['url'] =\n\t\t'<p class=\"comment-form-url\">\n\t\t\t<input placeholder=\"Your URL\" id=\"url\" name=\"url\" type=\"url\" value=\"' . esc_attr( $commenter['comment_author_url'] ) .\n '\" size=\"30\" />\n \t</p>';\n\n\treturn $fields;\n}", "function fill_in_additional_list_fields()\r\n\t{\r\n\t}", "function init_form_fields() {\n\n $default_site_name = home_url() ;\n\n\t\t\t$this->form_fields = array(\n\n\t\t\t\t'enabled' => array(\n\t\t\t\t\t'title' => __( 'Enable/Disable', 'woothemes' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'label' => __( 'Enable Payment Express', 'woothemes' ),\n\t\t\t\t\t'default' => 'yes'\n\t\t\t\t),\n\n\t\t\t\t'title' => array(\n\t\t\t\t\t'title' => __( 'Title', 'woothemes' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'description' => __( 'This controls the title which the user sees during checkout.', 'woothemes' ),\n\t\t\t\t\t'default' => __( 'Payment Express', 'woothemes' ),\n\t\t\t\t\t'css' => 'width: 400px;'\n\t\t\t\t),\n\n\t\t\t\t'description' => array(\n\t\t\t\t\t'title' => __( 'Description', 'woothemes' ),\n\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t'description' => __( 'This controls the description which the user sees during checkout.', 'woothemes' ),\n\t\t\t\t\t'default' => __(\"Allows credit card payments by Payment Express PX-Pay method\", 'woothemes')\n\t\t\t\t),\n\n\t\t\t\t'site_name' => array(\n\t\t\t\t\t//'title' => __( 'Px-Pay Access Key', 'woothemes' ),\n 'title' => 'Merchant Reference',\n 'description' => 'A name (or URL) to identify this site in the \"Merchant Reference\" field (shown when viewing transactions in the site\\'s Digital Payment Express back-end). This name <b>plus</b> the longest Order/Invoice Number used by the site must be <b>no longer than 53 characters</b>.',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => $default_site_name,\n\t\t\t\t\t'css' => 'width: 400px;',\n 'custom_attributes' => array( 'maxlength' => '53' )\n ),\n\n\t\t\t\t'access_userid' => array(\n\t\t\t\t\t//'title' => __( 'Access User Id', 'woothemes' ),\n\t\t\t\t\t'title' => __( 'Px-Pay Access User ID', 'woothemes' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'css' => 'width: 400px;'\n\t\t\t\t),\n\n\t\t\t\t'access_key' => array(\n\t\t\t\t\t//'title' => __( 'Access Key', 'woothemes' ),\n\t\t\t\t\t'title' => __( 'Px-Pay Access Key', 'woothemes' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'css' => 'width: 400px;'\n\t\t\t\t)\n\n\t\t\t);\n\n\t\t}", "protected function prepare_fields()\n {\n }", "public function init_form_fields() {\n\t\t$this->form_fields = array(\n\t\t\t'enabled' => array(\n\t\t\t\t'title' => __( 'Enable/Disable', 'woocommerce' ),\n\t\t\t\t'label' => __( 'Enable Simplify Commerce', 'woocommerce' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'description' => '',\n\t\t\t\t'default' => 'no'\n\t\t\t),\n\t\t\t'title' => array(\n\t\t\t\t'title' => __( 'Title', 'woocommerce' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ),\n\t\t\t\t'default' => __( 'Pay with Card', 'woocommerce' ),\n\t\t\t\t'desc_tip' => true\n\t\t\t),\n\t\t\t'description' => array(\n\t\t\t\t'title' => __( 'Description', 'woocommerce' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce' ),\n\t\t\t\t'default' => 'Pay with your card via Simplify Commerce by Mastercard.',\n\t\t\t\t'desc_tip' => true\n\t\t\t),\n\t\t\t'modal_color' => array(\n\t\t\t\t'title' => __( 'Modal Color', 'woocommerce' ),\n\t\t\t\t'type' => 'color',\n\t\t\t\t'description' => __( 'Set the color of the buttons and titles on the modal dialog.', 'woocommerce' ),\n\t\t\t\t'default' => '#a46497',\n\t\t\t\t'desc_tip' => true\n\t\t\t),\n\t\t\t'sandbox' => array(\n\t\t\t\t'title' => __( 'Sandbox', 'woocommerce' ),\n\t\t\t\t'label' => __( 'Enable Sandbox Mode', 'woocommerce' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'description' => __( 'Place the payment gateway in sandbox mode using sandbox API keys (real payments will not be taken).', 'woocommerce' ),\n\t\t\t\t'default' => 'yes'\n\t\t\t),\n\t\t\t'sandbox_public_key' => array(\n\t\t\t\t'title' => __( 'Sandbox Public Key', 'woocommerce' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'Get your API keys from your Simplify account: Settings > API Keys.', 'woocommerce' ),\n\t\t\t\t'default' => '',\n\t\t\t\t'desc_tip' => true\n\t\t\t),\n\t\t\t'sandbox_private_key' => array(\n\t\t\t\t'title' => __( 'Sandbox Private Key', 'woocommerce' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'Get your API keys from your Simplify account: Settings > API Keys.', 'woocommerce' ),\n\t\t\t\t'default' => '',\n\t\t\t\t'desc_tip' => true\n\t\t\t),\n\t\t\t'public_key' => array(\n\t\t\t\t'title' => __( 'Public Key', 'woocommerce' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'Get your API keys from your Simplify account: Settings > API Keys.', 'woocommerce' ),\n\t\t\t\t'default' => '',\n\t\t\t\t'desc_tip' => true\n\t\t\t),\n\t\t\t'private_key' => array(\n\t\t\t\t'title' => __( 'Private Key', 'woocommerce' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'Get your API keys from your Simplify account: Settings > API Keys.', 'woocommerce' ),\n\t\t\t\t'default' => '',\n\t\t\t\t'desc_tip' => true\n\t\t\t),\n\t\t);\n\t}", "public function addMetaFields()\n\t{\n\t\tadd_action('slideshow_add_form_fields', [$this, 'addMetaFieldsToAddForm']);\n\t\tadd_action('slideshow_edit_form_fields', [$this, 'addMetaFieldsToEditForm']);\n\t}", "public function get_edit_form_fields()\n\t{\n\t\t$creditsInputted = optional_param('credits', 0, PARAM_TEXT);\n\t\tif($creditsInputted == 0)\n\t\t{\n if(isset($this->id) && $this->id != -1)\n {\n $creditsInputted = $this->credits;\n }\n else\n {\n $creditsInputted = $this->get_default_credits();\n }\n\t\t}\n\t\treturn '<div class=\"inputContainer\"><div class=\"inputLeft\">'.\n '<label for=\"credits\">'.$this->get_credits_display_name(). \n ' : </label></div><div class=\"inputRight\"><input type=\"text\"'.\n 'name=\"credits\" id=\"credits\" value=\"'.$creditsInputted.'\"/></div></div>';\n\t}", "function imbaf_properties_create_add_fields(){\n ?>\n <div class=\"form-field\">\n <label for=\"term_meta[imbaf_property_type]\">Typ</label>\n\n <select name=\"term_meta[imbaf_property_type]\">\n\n <?php\n\n foreach($this -> property_types as $property){\n\n ?> <option style=\"width:100%;\" value=\"<?php echo $property['value']; ?>\"><?php echo $property['label']; ?></option> <?php\n\n }\n\n\n ?>\n </select>\n\n <p class=\"description\"><?php _e('Vergleichswert-Typ','imb_affiliate'); ?></p>\n\n\n\n <label for=\"term_meta[imbaf_property_icon]\">Icon</label>\n <input type=\"text\" name=\"term_meta[imbaf_property_icon]\">\n\n <p class=\"description\"><?php _e('Font Awesome Icon','imb_affiliate'); ?></p>\n\n\n <label for=\"term_meta[imbaf_property_prefix]\"><?php _e('Präfix','imb_affiliate'); ?></label>\n <input type=\"text\" name=\"term_meta[imbaf_property_prefix]\">\n\n <p class=\"description\"><?php _e('Vorgestellter Wert (ca.)','imb_affiliate'); ?></p>\n\n <label for=\"term_meta[imbaf_property_suffix]\"><?php _e('Suffix','imb_affiliate'); ?></label>\n <input type=\"text\" name=\"term_meta[imbaf_property_suffix]\">\n <p class=\"description\"><?php _e('Nachgestellter Wert (z.B. kg, MhZ etc.)','imb_affiliate'); ?></p>\n\n\n\n </div>\n <?php\n\n\n }", "public function conversational_form_hooks() {\n\n\t\t\\add_filter( 'template_include', array( $this, 'get_form_template' ), PHP_INT_MAX );\n\t\t\\add_filter( 'document_title_parts', array( $this, 'change_form_page_title' ) );\n\t\t\\add_filter( 'post_type_link', array( $this, 'modify_permalink' ), 10, 2 );\n\n\t\t\\remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10 );\n\n\t\t\\add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );\n\n\t\t\\add_action( 'wpforms_wp_footer', array( $this, 'dequeue_scripts' ) );\n\t\t\\add_action( 'wpforms_frontend_confirmation', array( $this, 'dequeue_scripts' ) );\n\t\t\\add_action( 'wp_print_styles', array( $this, 'css_compatibility_mode' ) );\n\t\t\\add_action( 'wp_head', array( $this, 'print_form_styles' ) );\n\t\t\\add_filter( 'body_class', array( $this, 'set_body_classes' ) );\n\n\t\t\\add_filter( 'wpseo_opengraph_desc', array( $this, 'yoast_seo_description' ) );\n\t\t\\add_filter( 'wpseo_twitter_description', array( $this, 'yoast_seo_description' ) );\n\n\t\t\\add_filter( 'wpforms_frontend_form_data', array( $this, 'ignore_pagebreaks' ) );\n\t\t\\add_filter( 'wpforms_field_data', array( $this, 'ignore_date_dropdowns' ), 10, 2 );\n\t\t\\add_filter( 'wpforms_field_properties', array( $this, 'ignore_multi_column_layout' ), 10, 3 );\n\t\t\\add_filter( 'wpforms_field_properties', array( $this, 'add_data_field_type_attr' ), 10, 3 );\n\t\t\\add_action( 'wpforms_display_field_after', array( $this, 'add_file_upload_html' ), 10, 2 );\n\n\t\t\\add_action( 'wpforms_conversational_forms_content_before', array( $this, 'form_loader_html' ) );\n\t\t\\add_action( 'wpforms_conversational_forms_content_before', array( $this, 'form_header_html' ) );\n\t\t\\add_action( 'wpforms_conversational_forms_footer', array( $this, 'form_footer_html' ) );\n\t}", "public function addMetaFieldsToAddForm()\n\t{\n\t\t$interval = $this->getMetaFields('interval');\n\t\t$animation = $this->getMetaFields('animation');\n\n\t\t?>\n\t\t\t<div class=\"form-field\">\n\t\t\t\t<label for=\"interval\">Tijd tussen slides</label>\n\t\t\t\t<input name=\"interval\" id=\"interval\" type=\"text\" value=\"<?php echo $interval;?>\" size=\"40\">\n\t\t\t\t<p class=\"description\">De tijd tussen slides in milliseconden (1000ms = 1s).</p>\n\t\t\t</div>\n\t\t\t<div class=\"form-field\">\n\t\t\t\t<label for=\"animation\">Animatie</label>\n\t\t\t\t<select name=\"animation\" id=\"animation\">\n\t\t\t\t\t<option <?php selected($animation, 'slide'); ?> value=\"slide\">Slide</option>\n\t\t\t\t\t<option <?php selected($animation, 'fade'); ?> value=\"fade\">Fade</option>\n\t\t\t\t</select>\n\t\t\t\t<p class=\"description\">Selecteer de animatie die gebruikt wordt door de slideshow.</p>\n\t\t\t</div>\n\t\t<?php\n\t}", "public function init_form_fields()\n {\n\n // Get available placeholders for this email\n $placeholder_text = sprintf(__('Available placeholders: %s', 'subscriptio'), '<code>' . esc_html(implode('</code>, <code>', array_keys($this->placeholders))) . '</code>');\n\n // Define form fields\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __('Enable/Disable', 'subscriptio'),\n 'type' => 'checkbox',\n 'label' => __('Enable this email notification', 'subscriptio'),\n 'default' => 'yes',\n ),\n 'send_to_admin' => array(\n 'title' => __('Send to admin', 'subscriptio'),\n 'type' => 'checkbox',\n 'label' => __('Send BCC copy to admin', 'subscriptio'),\n 'default' => 'no',\n ),\n 'subject' => array(\n 'title' => __('Subject', 'subscriptio'),\n 'type' => 'text',\n 'desc_tip' => true,\n 'description' => $placeholder_text,\n 'placeholder' => $this->get_default_subject(),\n 'default' => '',\n ),\n 'heading' => array(\n 'title' => __('Email heading', 'subscriptio'),\n 'type' => 'text',\n 'desc_tip' => true,\n 'description' => $placeholder_text,\n 'placeholder' => $this->get_default_heading(),\n 'default' => '',\n ),\n 'additional_content' => array(\n 'title' => __('Additional content', 'subscriptio'),\n 'description' => __( 'Text to appear to appear below the main email content.', 'subscriptio' ) . ' ' . $placeholder_text,\n 'css' => 'width: 400px; height: 75px;',\n 'placeholder' => __('N/A', 'subscriptio'),\n 'type' => 'textarea',\n 'default' => $this->get_default_additional_content(),\n 'desc_tip' => true,\n ),\n 'email_type' => array(\n 'title' => __('Email type', 'subscriptio'),\n 'type' => 'select',\n 'description' => __('Choose which format of email to send.', 'subscriptio'),\n 'default' => 'html',\n 'class' => 'email_type wc-enhanced-select',\n 'options' => $this->get_email_type_options(),\n 'desc_tip' => true,\n ),\n );\n }", "public function buildFormFields()\n {\n $this->addField(\n SharpFormTextField::make('title')\n ->setLabel('Title')\n )->addField(\n SharpFormUploadField::make('cover')\n ->setLabel('Cover')\n ->setFileFilterImages()\n ->setCropRatio('1:1')\n ->setStorageBasePath('data/service')\n )->addField(\n SharpFormNumberField::make('price')\n ->setLabel('Price')\n )->addField(\n SharpFormMarkdownField::make('description')->setToolbar([\n SharpFormMarkdownField::B, SharpFormMarkdownField::I,\n SharpFormMarkdownField::SEPARATOR,\n SharpFormMarkdownField::IMG,\n SharpFormMarkdownField::SEPARATOR,\n SharpFormMarkdownField::A,\n ])\n )->addField(\n SharpFormTagsField::make('tags',\n Tag::orderBy('label')->get()->pluck('label', 'id')->all()\n )->setLabel('Tags')\n ->setCreatable(true)\n ->setCreateAttribute('name')\n );\n }", "public function formFields($fields) {\r\n $this->fields = $fields;\r\n return $this;\r\n }", "public function extra_form_fields() {\n\t?>\n\t\t<tr valign=\"top\">\n\t\t\t<th scope=\"row\"><?php _e( 'Make slider featured randomly?', $this->textdomain ); ?></th>\n\t\t\t<td><input type=\"checkbox\" name=\"slider_featured\" value=\"1\" checked=\"checked\" /></td>\n\t\t</tr>\n\t<?php\n\t}", "function media_post_single_attachment_fields_to_edit($form_fields, $post)\n {\n }", "function settingsForm($field, $instance, $view_mode, $form, &$form_state);", "public function init_form_fields(){\n \n $this->form_fields = apply_filters( 'wc_pay_on_credit_form_fields', array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', $this->domain ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable Pay On Credit', $this->domain ),\n 'default' => 'yes'\n ),\n 'title' => array(\n 'title' => __( 'Title', $this->domain ),\n 'type' => 'text',\n 'description' => __( 'This controls the title for the payment method the customer sees during checkout.', $this->domain ),\n 'default' => __( 'Pay On Credit', $this->domain ),\n 'desc_tip' => true,\n ),\n 'description' => array(\n 'title' => __( 'Description', $this->domain ),\n 'type' => 'textarea',\n 'description' => __( 'Payment method description that the customer will see on your checkout.', $this->domain ),\n 'default' => __( 'Split your cost over a period and pay', $this->domain ),\n 'desc_tip' => true,\n ),\n 'instructions' => array(\n 'title' => __( 'Instructions', $this->domain ),\n 'type' => 'textarea',\n 'description' => __( 'Instructions that will be added to the thank you page and emails.', $this->domain ),\n 'default' => '', // Empty by default\n 'desc_tip' => true,\n ),\n 'order_status' => array(\n 'title' => __( 'Order Status', $this->domain ),\n 'type' => 'select',\n 'description' => __( 'Choose whether order status you wish after checkout.', $this->domain ),\n 'default' => 'wc-completed',\n 'desc_tip' => true,\n 'class' => 'wc-enhanced-select',\n 'options' => wc_get_order_statuses()\n ),\n 'status_text' => array(\n 'title' => __( 'Order Status Text', $this->domain ),\n 'type' => 'text',\n 'description' => __( 'Set the text for the selected order status.', $this->domain ),\n 'default' => __( 'Order is completed', $this->domain ),\n 'desc_tip' => true,\n ),\n ) );\n }", "public function createFormFields()\n {\n return array(\n 'tab' => 'sepacredittransfer',\n 'fields' => array(\n array(\n 'name' => 'enabled',\n 'label' => $this->getTranslatedString('text_enable'),\n 'type' => 'onoff',\n 'doc' => $this->getTranslatedString('enable_heading_title_sepact'),\n 'default' => 0,\n ),\n array(\n 'name' => 'merchant_account_id',\n 'label' => $this->getTranslatedString('config_merchant_account_id'),\n 'type' => 'text',\n 'default' => $this->credentialsConfig->getMerchantAccountId(),\n 'required' => true,\n ),\n array(\n 'name' => 'secret',\n 'label' => $this->getTranslatedString('config_merchant_secret'),\n 'type' => 'text',\n 'default' => $this->credentialsConfig->getSecret(),\n 'required' => true,\n ),\n array(\n 'name' => 'base_url',\n 'label' => $this->getTranslatedString('config_base_url'),\n 'type' => 'text',\n 'doc' => $this->getTranslatedString('config_base_url_desc'),\n 'default' => $this->credentialsConfig->getBaseUrl(),\n 'required' => true,\n ),\n array(\n 'name' => 'http_user',\n 'label' => $this->getTranslatedString('config_http_user'),\n 'type' => 'text',\n 'default' => $this->credentialsConfig->getHttpUser(),\n 'required' => true,\n ),\n array(\n 'name' => 'http_pass',\n 'label' => $this->getTranslatedString('config_http_password'),\n 'type' => 'text',\n 'default' => $this->credentialsConfig->getHttpPassword(),\n 'required' => true,\n ),\n\n array(\n 'name' => 'test_credentials',\n 'type' => 'linkbutton',\n 'required' => false,\n 'buttonText' => $this->getTranslatedString('test_config'),\n 'id' => 'SepaCreditTransferConfig',\n 'method' => 'sepacredittransfer',\n 'send' => array(\n 'WIRECARD_PAYMENT_GATEWAY_SEPACREDITTRANSFER_BASE_URL',\n 'WIRECARD_PAYMENT_GATEWAY_SEPACREDITTRANSFER_HTTP_USER',\n 'WIRECARD_PAYMENT_GATEWAY_SEPACREDITTRANSFER_HTTP_PASS'\n )\n )\n )\n );\n }", "public function actionAdd()\n\t{\n\t\t$formId = $this->_input->filterSingle('form_id', XenForo_Input::UINT);\n\t\t$type = $this->_input->filterSingle('type', XenForo_Input::STRING);\n\t\t\n\t\t$fieldModel = $this->_getFieldModel();\n\t\t$fieldTypes = $fieldModel->getCountByType();\n\t\t\n\t\t$options = array();\n\t\t$options[] = array(\n\t\t 'value' => 'user',\n\t\t 'label' => new XenForo_Phrase('field'),\n\t\t 'selected' => true\n\t\t);\n\t\t\n\t\t// if global fields exist, include in the types\n\t\tif (array_key_exists('global', $fieldTypes))\n\t\t{\n\t\t\t$options[] = array(\n\t\t\t 'value' => 'global',\n\t\t\t 'label' => new XenForo_Phrase('global_field')\n\t\t\t);\n\t\t}\n\t\t\n\t\t// if template fields exist, include in the types\n\t\tif (array_key_exists('template', $fieldTypes))\n\t\t{\n\t\t\t$options[] = array(\n\t\t\t 'value' => 'template',\n\t\t\t 'label' => new XenForo_Phrase('template_field') \n\t\t\t);\n\t\t}\n\t\t\n\t\t// if there are no options other than user, just send them to the add field page\n\t\tif (!$type && count($options) == 1)\n\t\t{\n\t\t\t$type = 'user';\n\t\t}\n\t\t\n\t\t// association a field to a form\n\t\tif ($formId && $type)\n\t\t{\n\t\t\t$default = array(\n\t\t\t\t'field_id' => null,\n\t\t\t\t'form_id' => $this->_input->filterSingle('form_id', XenForo_Input::UINT),\n\t\t\t\t'display_order' => $this->_getFieldModel()->getGreatestDisplayOrderByFormId($formId) + 10,\n\t\t\t\t'field_type' => 'textbox',\n\t\t\t\t'field_choices' => '',\n\t\t\t\t'match_type' => 'none',\n\t\t\t\t'match_regex' => '',\n\t\t\t\t'match_callback_class' => '',\n\t\t\t\t'match_callback_method' => '',\n\t\t\t\t'max_length' => 0,\n\t\t\t\t'min_length' => 0,\n\t\t\t\t'required' => 0,\n\t\t\t\t'type' => $type,\n\t\t\t\t'active' => 1,\n\t\t\t\t'pre_text' => '',\n\t\t\t\t'post_text' => ''\n\t\t\t);\n\t\t\t\n\t\t\tswitch ($type)\n\t\t\t{\n\t\t\t case 'global':\n\t\t {\n\t\t return $this->responseReroute('KomuKu_SimpleForms_ControllerAdmin_Form', 'add-global-field');\n\t\t }\n\t\t\t case 'template':\n\t\t {\n\t\t return $this->responseReroute('KomuKu_SimpleForms_ControllerAdmin_Form', 'add-template-field');\n\t\t }\n\t\t\t default:\n\t\t {\n\t\t return $this->_getFieldAddEditResponse($default);\n\t\t }\n\t\t\t}\n\t\t}\n\t\t\n\t\t// adding a global/template field\n\t\telse if (!$formId && $type)\n\t\t{\n\t\t $default = array(\n\t 'field_id' => null,\n\t 'field_type' => 'textbox',\n\t 'field_choices' => '',\n\t 'match_type' => 'none',\n\t 'match_regex' => '',\n\t 'match_callback_class' => '',\n\t 'match_callback_method' => '',\n\t 'max_length' => 0,\n\t\t \t'min_length' => 0,\n\t 'type' => $type,\n\t\t \t'pre_text' => '',\n\t\t \t'post_text' => ''\n\t\t );\n\t\t \n\t\t if ($type != 'global')\n\t\t {\n\t\t \t$default['display_order'] = 1;\n\t\t \t$default['required'] = 0;\n\t\t \t$default['active'] = 1;\n\t\t }\n\t\t \n\t\t return $this->_getFieldAddEditResponse($default);\n\t\t}\n\t\t\n\t\t// association type\n\t\telse\n\t\t{\n\t\t\t$viewParams = array(\n\t\t\t\t'formId' => $formId,\n\t\t\t\t'options' => $options\n\t\t\t);\n\t\t\t\n\t\t\treturn $this->responseView('KomuKu_SimpleForms_ViewAdmin_Field_AddType', 'kmkform__field_add_type', $viewParams);\n\t\t}\n\t}", "private function setupFieldsAttributes() {\n\n\t\tforeach ( $this->form as $field ) {\n\n\t\t\tif ( ! $field->hasAttribute( 'id' ) ) {\n\t\t\t\t$field->setAttribute( 'id', esc_attr( sanitize_title( $field->getName() ) ) );\n\t\t\t}\n\t\t}\n\n\t}", "public function personalizeFormFields()\n\t{\n\t\t$form = '';\n\t\t$warn = '';\n\t\t\n\t\t// Load the Default value from the configuration\n\t\t$addr1 = (Configuration::get('PS_MR_SHOP_NAME')) ? \n\t\t\tConfiguration::get('PS_MR_SHOP_NAME') : \n\t\t\tConfiguration::get('PS_SHOP_NAME');\n\t\t\n\t\t// Check if a request exist and if errors occured, use the post variable\n\t\tif (Tools::isSubmit('PS_MRSubmitFieldPersonalization') && count($this->_postErrors))\n\t\t\t$addr1 = Tools::getValue('Expe_ad1');\n\t\t\t\n\n\t\tif (!Configuration::get('PS_MR_SHOP_NAME'))\n\t\t\t$warn .= '<div class=\"warn\">'.\n\t\t\t\t$this->l('Its seems you updated Mondialrelay without use the uninstall / install method, \n\t\t\t\tyou have to set up this part to make working the generating ticket process').\n\t\t\t\t'</div>';\t\t\t\n\t\t// Form\n\t\t$form = '<form action=\"'.$_SERVER['REQUEST_URI'].'\" method=\"post\" class=\"form\">';\n\t\t$form .= '\n\t\t\t<fieldset class=\"PS_MRFormStyle\">\n\t\t\t\t<legend>\n\t\t\t\t\t<img src=\"../modules/mondialrelay/images/logo.gif\" />'.$this->l('Fields personalization').\n\t\t\t'</legend>'.\n\t\t\t$warn.'\n\t\t\t<label for=\"PS_MR_SHOP_NAME\">'.$this->l('Main Address').'</label>\n\t\t\t<div class=\"margin-form\">\n\t\t\t\t<input type=\"text\" name=\"Expe_ad1\" value=\"'.$addr1.'\" /><br />\n\t\t\t\t<p>'.$this->l('The key used by Mondialrelay is').' <b>Expe_ad1</b> '.$this->l('and has this default value').'\n\t\t\t \t: <b>'.Configuration::get('PS_SHOP_NAME').'</b></p>\n\t\t\t</div>\n\t\t\n\t\t<div class=\"margin-form\">\n\t\t\t<input type=\"submit\" name=\"PS_MRSubmitFieldPersonalization\" value=\"' . $this->l('Save') . '\" class=\"button\" />\n\t\t</div>\n\t\t</form><br />';\n\t\treturn $form;\n\t}", "protected function restrict_fields()\n {\n }", "function render_fields( $form, $args ) {\n // Increase the form view counter\n if ( $form['post_id'] && ! $args['filter_mode'] ) {\n $views = get_post_meta( $form['post_id'], 'form_num_of_views', true );\n $views = $views ? $views + 1 : 1;\n update_post_meta( $form['post_id'], 'form_num_of_views', $views );\n }\n \n \n // Get field groups for the form and display their fields\n $field_groups = af_get_form_field_groups( $form['key'] );\n \n \n echo sprintf( '<div class=\"af-fields acf-fields acf-form-fields -%s\">', $args['label_placement'] );\n \n \n do_action( 'af/form/before_fields', $form, $args );\n do_action( 'af/form/before_fields/id=' . $form['post_id'], $form, $args );\n do_action( 'af/form/before_fields/key=' . $form['key'], $form, $args );\n \n\n // Form data required by ACF for validation to work.\n acf_form_data(array( \n 'screen' => 'acf_form',\n 'post_id' => false,\n 'form' => false,\n ));\n\n // Hidden fields to identify form\n echo '<div class=\"acf-hidden\">';\n\n $nonce = wp_create_nonce( 'acf_nonce' );\n echo sprintf( '<input type=\"hidden\" name=\"_acfnonce\" value=\"%s\">', $nonce );\n echo sprintf( '<input type=\"hidden\" name=\"nonce\" value=\"%s\">', $nonce );\n \n echo sprintf( '<input type=\"hidden\" name=\"af_form\" value=\"%s\">', $form['key'] );\n echo sprintf( '<input type=\"hidden\" name=\"af_form_args\" value=\"%s\">', base64_encode( json_encode( $args ) ) );\n echo sprintf( '<input type=\"hidden\" name=\"_acf_form\" value=\"%s\">', base64_encode( json_encode( $args ) ) );\n\n // Add honeypot field that is not visible to users.\n // Bots should hopefully fill this in allowing them to be detected.\n if ( $args['honeypot'] ) {\n echo '<input type=\"text\" name=\"email_for_non_humans\" tabindex=\"-1\" autocomplete=\"off\" />';\n }\n \n do_action( 'af/form/hidden_fields', $form, $args );\n do_action( 'af/form/hidden_fields/id=' . $form['post_id'], $form, $args );\n do_action( 'af/form/hidden_fields/key=' . $form['key'], $form, $args );\n \n echo '</div>';\n \n \n foreach ( $field_groups as $field_group ) {\n $this->render_field_group( $field_group, $form, $args );\n }\n \n do_action( 'af/form/after_fields', $form, $args );\n do_action( 'af/form/after_fields/id=' . $form['post_id'], $form, $args );\n do_action( 'af/form/after_fields/key=' . $form['key'], $form, $args );\n\n $this->render_submit_button( $form, $args );\n \n // End fields wrapper\n echo '</div>';\n }", "public static function input_fields()\n {\n }", "public function init_form_fields() {\n\n\t\t\t$this->form_fields = array(\n\t\t\t\t'enabled' => array(\n\t\t\t\t\t'title' => __( 'Enable/Disable', 'storefront-child' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'label' => __( 'Enable Gold Payment', 'storefront-child' ),\n\t\t\t\t\t'default' => 'yes'\n\t\t\t\t),\n\t\t\t\t'title' => array(\n\t\t\t\t\t'title' => __( 'Title', 'storefront-child' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'description' => __( 'This controls the title which the user sees during checkout.', 'storefront-child' ),\n\t\t\t\t\t'default' => __( 'Gold Payment', 'storefront-child' ),\n\t\t\t\t\t'desc_tip' => true,\n\t\t\t\t),\n\t\t\t\t'order_status' => array(\n\t\t\t\t\t'title' => __( 'Order Status', 'storefront-child' ),\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'class' => 'wc-enhanced-select',\n\t\t\t\t\t'description' => __( 'Choose whether status you wish after checkout.', 'storefront-child' ),\n\t\t\t\t\t'default' => 'wc-completed',\n\t\t\t\t\t'desc_tip' => true,\n\t\t\t\t\t'options' => wc_get_order_statuses()\n\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t'title' => __( 'Description', 'storefront-child' ),\n\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t'description' => __( 'Payment method description that the customer will see on your checkout.', 'storefront-child' ),\n\t\t\t\t\t'default' => __( 'Payment Information', 'storefront-child' ),\n\t\t\t\t\t'desc_tip' => true,\n\t\t\t\t),\n\t\t\t\t'instructions' => array(\n\t\t\t\t\t'title' => __( 'Instructions', 'storefront-child' ),\n\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t'description' => __( 'Instructions that will be added to the thank you page and emails.', 'storefront-child' ),\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'desc_tip' => true,\n\t\t\t\t),\n\t\t\t);\n\t\t}", "protected function addFields()\n {\n $groupCustomOptionsName = CustomOptions::GROUP_CUSTOM_OPTIONS_NAME;\n $optionContainerName = CustomOptions::CONTAINER_OPTION;\n $commonOptionContainerName = CustomOptions::CONTAINER_COMMON_NAME;\n\n // Add fields to the option\n $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n [$optionContainerName]['children'][$commonOptionContainerName]['children'] = array_replace_recursive(\n $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n [$optionContainerName]['children'][$commonOptionContainerName]['children'],\n $this->getOptionFieldsConfig()\n );\n\n // Add fields to the values\n // $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n // [$optionContainerName]['children']['values']['children']['record']['children'] = array_replace_recursive(\n // $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n // [$optionContainerName]['children']['values']['children']['record']['children'],\n // $this->getValueFieldsConfig()\n // );\n }", "public function init_form_fields() {\n\t\t\t$this->form_fields = array(\n\t\t\t\t\t// required plugin entries\n\t\t\t\t\t'enabled' => array(\n\t\t\t\t\t\t'title'=>__('Enable/disable', 'woocommerce'),\n\t\t\t\t\t\t'type'=>'checkbox',\n\t\t\t\t\t\t'label'=>__('Enable CoinSimple payments for woocommerce', 'woocommerce'),\n\t\t\t\t\t\t'default'=>'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t'notes'=>array(\n\t\t\t\t\t\t'title'=>__('Invoice Notes', 'woocommerce'),\n\t\t\t\t\t\t'type'=>'textarea',\n\t\t\t\t\t\t'placeholder'=>__('Replace this text with your message!', 'woocommerce'),\n\t\t\t\t\t\t'description'=>__('Message customer will see on the invoice', 'woocommerce'),\n\t\t\t\t\t\t'default'=>__('Thank you for using CoinSimple.', 'woocommerce'),\n\t\t\t\t\t\t'desc_tip'=>true,\n\t\t\t\t\t\t),\n\t\t\t\t\t'api_key'=>array(\n\t\t\t\t\t\t'title'=>__('API key', 'woocommerce'),\n\t\t\t\t\t\t'type'=>'text',\n\t\t\t\t\t\t'placeholder'=>__('Replace this text with your API key!', 'woocommerce'),\n\t\t\t\t\t\t'description'=>__('The API key can be found on the setting page of a business on CoinSimple.', 'woocommerce'),\n\t\t\t\t\t\t'desc_tip'=>true,\n\t\t\t\t\t\t),\n\t\t\t\t\t'redirect_url'=>array(\n\t\t\t\t\t\t\t'title'=>__('Redirect URL', 'woocommerce'),\n\t\t\t\t\t\t\t'type'=>'text',\n\t\t\t\t\t\t\t'placeholder'=>__('Replace this text with the redirect url', 'woocommerce'),\n\t\t\t\t\t\t\t'description'=>__('This is the page where the customer will be redirected to after payment', 'woocommerce'),\n\t\t\t\t\t\t\t'default'=> '',\n\t\t\t\t\t\t\t'desc_tip'=>true,\n\t\t\t\t\t\t),\n\t\t\t\t\t'business_id'=>array(\n\t\t\t\t\t\t'title'=>__('Business ID', 'woocommerce'),\n\t\t\t\t\t\t'type'=>'text',\n\t\t\t\t\t\t'placeholder'=>__('Replace this text with your Business ID!', 'woocommerce'),\n\t\t\t\t\t\t'description'=>__('The Business ID can be found on the setting page of a business on CoinSimple.', 'woocommerce'),\n\t\t\t\t\t\t'desc_tip'=>true,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t}", "abstract public function fields(AdminRequest $request);", "private function _set_fields()\n {\n @$this->form_data->question_id = 0;\n\n $this->form_data->category_id = 0;\n $this->form_data->sub_category_id = 0;\n $this->form_data->sub_two_category_id = 0;\n $this->form_data->sub_three_category_id = 0;\n $this->form_data->sub_four_category_id = 0;\n\n $this->form_data->ques_text = '';\n $this->form_data->survey_weight = '';\n $this->form_data->ques_type = '';\n $this->form_data->qus_fixed = 0;\n $this->form_data->ques_expiry_date = '';\n\n\n $this->form_data->filter_question = '';\n $this->form_data->filter_category = 0;\n $this->form_data->filter_type = '';\n $this->form_data->filter_expired = '';\n }", "public function alterForm(Form $form)\n {\n }", "public function init_form_fields() {\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', 'dokan' ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable this email notification', 'dokan' ),\n 'default' => 'yes',\n ),\n 'subject' => array(\n 'title' => __( 'Subject', 'dokan' ),\n 'type' => 'text',\n 'desc_tip' => true,\n /* translators: %s: list of placeholders */\n 'description' => sprintf( __( 'Available placeholders: %s', 'dokan' ), '<code>{site_name},{amount},{seller_name},{order_id},{status}</code>' ),\n 'placeholder' => $this->get_default_subject(),\n 'default' => '',\n ),\n 'heading' => array(\n 'title' => __( 'Email heading', 'dokan' ),\n 'type' => 'text',\n 'desc_tip' => true,\n /* translators: %s: list of placeholders */\n 'description' => sprintf( __( 'Available placeholders: %s', 'dokan' ), '<code>{site_name},{amount},{seller_name},{order_id},{status}</code>' ),\n 'placeholder' => $this->get_default_heading(),\n 'default' => '',\n ),\n 'email_type' => array(\n 'title' => __( 'Email type', 'dokan' ),\n 'type' => 'select',\n 'description' => __( 'Choose which format of email to send.', 'dokan' ),\n 'default' => 'html',\n 'class' => 'email_type wc-enhanced-select',\n 'options' => $this->get_email_type_options(),\n 'desc_tip' => true,\n ),\n );\n }", "function _field($field, $custom_options = array()) \n {\n $required = '';\n if ($field['required'] == 1) {\n $required = 'required';\n }\n $options = array();\n $out = '';\n if (!empty($field['type'])) {\n $class = '';\n if (empty($this->request->data['UserProfile']['address']) and empty($this->request->data['Project']['address'])) {\n $class = 'hide';\n }\n if (!empty($field['name'])) {\n if ($field['name'] == 'Project.name') {\n $options['class'] = \"js-preview-keyup js-no-pjax {'display':'js-name'}\";\n }\n if ($field['name'] == 'Project.needed_amount') {\n $options['info'] = sprintf(__l('Minimum Amount: %s%s <br/> Maximum Amount: %s') , Configure::read('site.currency') , $this->Html->cCurrency(Configure::read('Project.minimum_amount')) , Configure::read('site.currency') . $this->Html->cCurrency(Configure::read('Project.maximum_amount')));\n }\n if ($field['name'] == 'Pledge.is_allow_over_funding') {\n if ($_SESSION['Auth']['User']['role_id'] != ConstUserTypes::Admin && !Configure::read('Project.is_allow_user_to_set_overfunding')) {\n return;\n }\n }\n if ($field['name'] == 'Project.project_end_date') {\n $options['info'] = sprintf(__l('Ending date should be within %s days from today.') , Configure::read('maximum_project_expiry_day'));\n }\n if ($field['name'] == 'Project.country_id' || $field['name'] == 'State.name') {\n $options['class'] = 'location-input';\n }\n if ($field['name'] == 'Project.address') {\n $out.= '<div class=\"profile-block clearfix\"><div class=\"mapblock-info mapblock-info1\"><div class=\"clearfix address-input-block required col-md-9 no-pad\">';\n $options['class'] = 'js-preview-address-change';\n $options['id'] = 'ProjectAddressSearch';\n }\n if ($field['name'] == 'Pledge.min_amount_to_fund' || $field['name'] == 'Donate.min_amount_to_fund') {\n $out.= '<div class=\"js-min-amount hide\">';\n $options['class'] = 'js-min-amount-needed';\n }\n if ($field['name'] == 'Pledge.pledge_type_id' || $field['name'] == 'Donate.pledge_type_id') {\n $options['class'] = 'js-pledge-type';\n }\n if ($field['name'] == 'Attachment.filename') {\n if (!empty($this->request->data['Attachment']) && !empty($this->request->data['Project']['name'])) {\n $options['class'] = 'browse-field js-remove-error';\n $options['info'] = __l('Maximum allowed size ') . Configure::read('Project.image.allowedSize') . Configure::read('Project.image.allowedSizeUnits');\n $options['size'] = 33;\n $out.= '<div class=\"upload-image navbar-btn\">';\n $out.= $this->Html->showImage('Project', $this->request->data['Attachment'], array(\n 'dimension' => 'big_thumb',\n 'alt' => sprintf('[Image: %s]', $this->Html->cText($this->request->data['Project']['name'], false)) ,\n 'title' => $this->Html->cText($this->request->data['Project']['name'], false)\n ));\n $out.= '</div>';\n }\n $options['class'] = (!empty($options['class'])) ? $options['class'] : '';\n $options['class'].= \" {'UmimeType':'jpg,jpeg,png,gif', 'Uallowedsize':'5','UallowedMaxFiles':'1'}\";\n }\n if ($field['name'] == 'Project.address1') {\n $out.= '<div id=\"js-geo-fail-address-fill-block\" class=\"' . $class . '\"><div class=\"clearfix\"><div class=\"map-address-left-block address-input-block\">';\n $options['class'] = 'js-preview-address-change';\n $options['id'] = 'js-street_id';\n $out.= '</div>';\n }\n if ($field['name'] == 'Project.description') {\n $options['class'] = 'js-editor col-md-8 descblock {\"is_html\":\"false\"}';\n $options['rows'] = false;\n $options['cols'] = false;\n }\n if ($field['name'] == 'Pledge.is_allow_over_funding' || $field['name'] == 'Donate.is_allow_over_funding') {\n $options['before'] = '<div>';\n $options['after'] = '</div>';\n }\n if ($field['name'] == 'Project.country_id') {\n $options['id'] = 'js-country_id';\n }\n if (!empty($field['class'])) {\n $options['class'] = $field['class'];\n }\n if ($field['name'] == 'Project.feed_url') {\n $options['class'] = 'js-remove-error';\n }\n }\n switch ($field['type']) {\n case 'fieldset':\n if ($this->openFieldset == true) {\n $out.= '</fieldset>';\n }\n $out.= '<fieldset>';\n $this->openFieldset = true;\n if (!empty($field['name'])) {\n $out.= '<legend>' . Inflector::humanize($field['label']) . '</legend>';\n $out.= $this->Form->hidden('fs_' . $field['name'], array(\n 'value' => $field['name']\n ));\n }\n break;\n\n case 'textonly':\n $out = $this->Html->para('textonly', __l($field['label']));\n break;\n\n default:\n $options['type'] = $field['type'];\n $options['info'] = $field['info'];\n if (in_array($field['type'], array(\n 'select',\n 'checkbox',\n 'radio'\n ))) {\n if (!empty($field['options']) && !is_array($field['options'])) {\n $field['options'] = str_replace(', ', ',', $field['options']);\n $field['options'] = $this->explode_escaped(',', $field['options']);\n }\n if ($field['type'] == 'checkbox') {\n if (count($field['options']) > 1) {\n $options['type'] = 'select';\n $options['multiple'] = 'checkbox';\n $options['options'] = $field['options'];\n } else {\n\t\t\t\t\t\t\t\tif($field['name'] == 'Pledge.is_allow_over_funding' && isset($this->request->data['Pledge']) && $this->request->data['Pledge']['is_allow_over_funding'] == 1)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->request->data['Pledge']['is_allow_over_funding'] = $field['name'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif($field['name'] == 'Donate.is_allow_over_donating' && isset($this->request->data['Pledge']) && $this->request->data['Donate']['is_allow_over_donating'] == 1)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->request->data['Donate']['is_allow_over_donating'] = $field['name'];\n\t\t\t\t\t\t\t\t}\n $options['value'] = $field['name'];\n }\n } else {\n $options['options'] = $field['options'];\n }\n if ($field['type'] == 'select' && !empty($field['multiple']) && $field['multiple'] == 'multiple') {\n $options['multiple'] = 'multiple';\n } elseif ($field['type'] == 'select') {\n $options['empty'] = __l('Please Select');\n }\n }\n if (!empty($field['depends_on']) && !empty($field['depends_value'])) {\n $options['class'] = 'dependent';\n $options['dependsOn'] = $field['depends_on'];\n $options['dependsValue'] = $field['depends_value'];\n }\n $options['info'] = str_replace(\"##MULTIPLE_AMOUNT##\", Configure::read('equity.amount_per_share') , $options['info']);\n $options['info'] = str_replace(\"##SITE_CURRENCY##\", Configure::read('site.currency') , $options['info']);\n $field['label'] = str_replace(\"##SITE_CURRENCY##\", Configure::read('site.currency') , $field['label']);\n if (!empty($field['label'])) {\n $options['label'] = __l($field['label']);\n if ($field['type'] == 'radio') {\n $options['legend'] = __l($field['label']);\n }\n }\n if ($field['type'] == 'file') {\n if ($field['name'] != 'Attachment.filename') {\n\t\t\t\t\t\t\t\t$options['class'] = 'upload';\n $options['class'] = (!empty($options['class'])) ? $options['class'] : '';\n $options['class'].= \" {'UmimeType':'*', 'Uallowedsize':'5','UallowedMaxFiles':'1'}\";\n }\n }\n if ($field['type'] == 'radio') {\n $options['div'] = true;\n $options['legend'] = false;\n $options['multiple'] = 'radio';\n }\n if ($field['type'] == 'slider') {\n for ($num = 1; $num <= 100; $num++) {\n $num_array[$num] = $num;\n }\n $options['div'] = 'input select slider-input-select-block clearfix' . ' ' . $required;\n $options['options'] = $num_array;\n $options['type'] = 'select';\n $options['class'] = 'js-uislider';\n $options['label'] = false;\n $i = 0;\n if (!empty($field['options'])) {\n foreach($field['options'] as $value) {\n if ($i == 0) {\n $options['before'] = '<div class=\"clearfix\"><span class=\"grid_left uislider-inner\">' . $value . '</span>';\n } else {\n $options['after'] = '<span class=\"grid_left uislider-right\">' . $value . '</span></div>';\n }\n $i++;\n }\n }\n $out.= $this->Html->div('label-block slider-label ' . $required, $field['label']);\n }\n if ($field['type'] == 'date') {\n $options['div'] = $required;\n $options['orderYear'] = 'asc';\n $options['minYear'] = date('Y') -10;\n $options['maxYear'] = date('Y') +10;\n }\n if ($field['type'] == 'datetime') {\n $options['div'] = 'clearfix';\n $options['div'] = 'input text ' . ' ' . $required;\n $options['orderYear'] = 'asc';\n $options['minYear'] = date('Y') -10;\n $options['maxYear'] = date('Y') +10;\n }\n if ($field['type'] == 'time') {\n $options['div'] = 'clearfix';\n $options['div'] = 'input text js-time' . ' ' . $required;\n $options['orderYear'] = 'asc';\n $options['timeFormat'] = 12;\n $options['type'] = 'time';\n }\n if ($field['type'] == 'color') {\n $options['div'] = 'input text clearfix' . ' ' . $required;\n $options['class'] = 'js-colorpick';\n if (!empty($field['info'])) {\n $info = $field['info'] . ' <br>Comma separated RGB hex code. You can use color picker.';\n } else {\n $info = 'Comma separated RGB hex code. You can use color picker.';\n }\n $options['info'] = __l($info);\n $options['type'] = 'text';\n }\n if ($field['type'] == 'thumbnail') {\n $options['div'] = 'clearfix';\n $options['div'] = 'input text' . ' ' . $required;\n }\n if (!empty($field['default']) && empty($this->data['Form'][$field['name']])) {\n $options['value'] = $field['default'];\n }\n if ($field['type'] == 'text') {\n $options['div'] = 'clearfix';\n $options['div'] = 'input text' . ' ' . $required;\n }\n if ($field['type'] == 'textarea') {\n $options['div'] = 'clearfix';\n $options['div'] = 'input textarea' . ' ' . $required;\n }\n if ($field['type'] == 'select') {\n $options['div'] = 'clearfix';\n $options['div'] = 'input select' . ' ' . $required;\n if (!empty($field['multiple']) && $field['multiple'] == 'multiple') {\n $options['div'].= ' multi-select';\n }\n }\n $options = Set::merge($custom_options, $options);\n if ($field['type'] == 'date' || $field['type'] == 'datetime' || $field['type'] == 'time') {\n if ($field['name'] == 'Project.project_end_date') {\n $date_display = date('Y-m-d', strtotime('+' . Configure::read('maximum_project_expiry_day') . ' days'));\n } else {\n $date_display = date('Y-m-d');\n }\n if ($field['type'] == 'datetime') {\n $out.= '<div class=\"input js-datetimepicker clearfix ' . $required . '\"><div class=\"js-cake-date\">';\n } else {\n $out.= '<div class=\"input js-datetime clearfix ' . $required . '\"><div class=\"js-cake-date\">';\n }\n }\n if ($field['type'] == 'radio') {\n $out.= '<div class=\"input select radio-block clearfix\">';\n $out.= '<label class=\"label-block pull-left ' . $required . '\" for=\"' . $field['name'] . '\">' . __l($field['label']) . '</label>';\n }\n if ($field['name'] == 'Project.short_description') {\n $options['class'] = 'js-preview-keyup js-no-pjax js-description-count {\"display\":\"js-short-description\",\"field\":\"js-short-description-count\",\"count\":\"' . Configure::read('Project.project_short_description_length') . '\"}';\n $options['info'] = __l($field['info']) . ' ' . '<span class=\"character-info\">' . __l('You have') . ' ' . '<span id=\"js-short-description-count\"></span>' . ' ' . __l('characters left') . '</span>';\n }\n if (!empty($field['name']) && $field['name'] == 'Project.description') {\n $options['label'] = false;\n $options['info'] = false;\n $out.= '<div>';\n $out.= '<label class=\"control-label pull-left\" for=\"ProjectDescription\">' . __l('Description') . '</label>';\n $out.= '<div class=\"help\">';\n }\n if (!empty($field['name']) && $field['name'] == 'Project.needed_amount') {\n $options['label'] = __l('Needed amount') . ' (' . Configure::read('site.currency') . ')';\n }\n $out.= $this->Form->input($field['name'], $options);\n if (!empty($field['name']) && $field['name'] == 'Project.description') {\n $out.= '</div>';\n $out.= '<span class=\"info hor-space\"><i class=\"fa fa-info-circle\"></i> ' . __l('Entered description will display in view page') . '</span>';\n $out.= '</div>';\n }\n if ($field['type'] == 'date' || $field['type'] == 'datetime' || $field['type'] == 'time') {\n $out.= '</div></div>';\n }\n if ($field['type'] == 'radio') {\n $out.= '</div>';\n }\n if (!empty($field['name']) && $field['name'] == 'City.name') {\n $out.= '</div></div></div><div class=\"pull-left js-side-map-div col-md-3 ' . $class . '\"><h5>' . __l('Point Your Location') . '</h5><div class=\"js-side-map\"><div id=\"js-map-container\"></div><span>' . __l('Point the exact location in map by dragging marker') . '</span></div></div><div id=\"mapblock\"><div id=\"mapframe\"><div id=\"mapwindow\"></div></div></div></div></div>';\n }\n if (!empty($field['name']) && $field['name'] == 'Pledge.min_amount_to_fund' || $field['name'] == 'Donate.min_amount_to_fund') {\n $out.= '</div>';\n }\n break;\n }\n }\n return $out;\n }", "public function buildForm()\n {\n }", "abstract function setupform();", "function facebook_instant_articles_field_ui_fields($entity_type, $bundle, $view_mode, array &$form, array &$form_state) {\n\n // Do not add the fields if there is no layout.\n if (!isset($form['#fbia_layout'])) {\n return;\n }\n\n // Get the fields and put them on the form.\n $fields = facebook_instant_articles_get_fields($entity_type, FALSE);\n\n // Get field settings.\n $field_settings = facebook_instant_articles_get_field_settings($entity_type, $bundle, $view_mode, FALSE);\n $form['#field_settings'] = $field_settings;\n\n $table = &$form['fields'];\n $form['#fbia_fields'] = array();\n\n $field_label_options = array(\n 'above' => t('Above'),\n 'inline' => t('Inline'),\n 'hidden' => t('<Hidden>'),\n );\n drupal_alter('facebook_instant_articles_label_options', $field_label_options);\n\n foreach ($fields as $key => $field) {\n\n $form['#fbia_fields'][] = $key;\n\n // Check on formatter settings.\n if (isset($form_state['formatter_settings'][$key])) {\n $field['formatter_settings'] = $form_state['formatter_settings'][$key];\n }\n elseif (isset($field_settings[$key]['formatter_settings'])) {\n $field['formatter_settings'] = $field_settings[$key]['formatter_settings'];\n $form_state['formatter_settings'][$key] = $field['formatter_settings'];\n }\n\n if (!isset($field_settings[$key]['ft']) && isset($field_settings[$key]['ft'])) {\n $form_state['formatter_settings'][$key]['ft'] = $field_settings[$key]['ft'];\n }\n\n $hidden = array('hidden' => t('<Hidden>'));\n $formatters = isset($field['properties']['formatters']) ? $hidden + $field['properties']['formatters'] : $hidden + array('default' => t('Default'));\n\n $table[$key] = array(\n '#row_type' => 'field',\n '#js_settings' => array('field'),\n '#region_callback' => 'field_ui_display_overview_row_region',\n '#attributes' => array('class' => array('draggable', 'tabledrag-leaf')),\n 'human_name' => array(\n '#markup' => check_plain($field['title']),\n ),\n 'weight' => array(\n '#type' => 'textfield',\n '#default_value' => isset($field_settings[$key]['weight']) ? $field_settings[$key]['weight'] : 0,\n '#size' => 3,\n '#attributes' => array('class' => array('field-weight')),\n ),\n 'parent_wrapper' => array(\n 'parent' => array(\n '#type' => 'select',\n '#empty_value' => '',\n '#options' => array(),\n '#attributes' => array('class' => array('field-parent')),\n '#parents' => array('fields', $key, 'parent'),\n ),\n 'hidden_name' => array(\n '#type' => 'hidden',\n '#default_value' => $key,\n '#attributes' => array('class' => array('field-name')),\n ),\n ),\n 'label' => array(\n '#type' => 'select',\n '#options' => $field_label_options,\n '#default_value' => isset($field_settings[$key]['label']) ? $field_settings[$key]['label'] : 'hidden',\n ),\n 'format' => array(\n 'type' => array(\n '#type' => 'select',\n '#options' => $formatters,\n '#default_value' => isset($field_settings[$key]['format']) ? $field_settings[$key]['format'] : 'hidden',\n '#attributes' => array('class' => array('field-formatter-type')),\n ),\n ),\n 'settings_summary' => array(),\n 'settings_edit' => array(),\n );\n\n $field['name'] = $key;\n $field['entity_type'] = $entity_type;\n $field['bundle'] = $bundle;\n $field['view_mode'] = $view_mode;\n }\n\n // Add fields submit handler.\n $form['#submit'][] = 'facebook_instant_articles_field_ui_fields_save';\n}", "public function addCustomFields()\n {\n if (!($enabled_custom_fields = $this->getDataManager()->getOption('custom_fields'))) {\n $enabled_custom_fields = array();\n }\n if (!($enabled_profile_fields = $this->getDataManager()->getOption('custom_fields_additional'))) {\n $enabled_profile_fields = array();\n }\n ?>\n <fieldset data-rm-target=\"#custom-fields .custom-field-select option\" id=\"profile-fields\" class=\"checkbox-list rm-ctrl syncstate\"<?php echo !$this->getDataManager()->getOption('enable_sync') ? ' disabled=\"disabled\"' : '' ?>>\n <?php foreach ($this->custom_fields as $custom_field): ?>\n <div>\n <label>\n <input class=\"profile-field-checkbox\" type=\"checkbox\" name=\"<?php echo $this->getViewKey().'[custom_fields_additional][]' ?>\" value=\"<?php echo $custom_field->getId() ?>\"<?php echo in_array($custom_field->getId(), $enabled_profile_fields) ? ' checked=\"checked\"' : '' ?> />\n <?php echo $custom_field->getName() ?> (<?php _e('customfield.type.'.$custom_field->getFieldType(), 'mgrt-wordpress') ?>)\n </label>\n </div>\n <?php endforeach; ?>\n </fieldset>\n <p class=\"description\"><?php _e('form.sync.field.custom.more.help', 'mgrt-wordpress') ?></p>\n <?php\n }" ]
[ "0.756773", "0.74993324", "0.7260943", "0.7049153", "0.6881871", "0.67072964", "0.6666791", "0.6632309", "0.6622898", "0.6615972", "0.6584045", "0.6582296", "0.6519907", "0.65156037", "0.6514488", "0.65120834", "0.6488026", "0.64651674", "0.64604604", "0.6445784", "0.64309275", "0.6430418", "0.6408651", "0.63909054", "0.6377796", "0.6375237", "0.6371533", "0.63663685", "0.6359068", "0.63534486", "0.6350412", "0.6349552", "0.6335538", "0.6327977", "0.6327048", "0.6325772", "0.63138896", "0.6312215", "0.63103944", "0.6306802", "0.63060814", "0.6302889", "0.6292436", "0.6290239", "0.62788194", "0.6272092", "0.6260764", "0.62572634", "0.62539977", "0.62495136", "0.6226867", "0.6226344", "0.6216818", "0.62162864", "0.62088436", "0.62085336", "0.6206713", "0.62027776", "0.6196133", "0.61930704", "0.61918944", "0.618943", "0.61816955", "0.61760885", "0.6154036", "0.61502343", "0.614264", "0.61387956", "0.6135425", "0.6133925", "0.61282754", "0.61257845", "0.61224955", "0.61202854", "0.61170805", "0.6112102", "0.6106843", "0.61062986", "0.61061174", "0.610555", "0.60949945", "0.60940975", "0.6092718", "0.6089197", "0.6086896", "0.60833925", "0.6079762", "0.60748065", "0.60679555", "0.6059871", "0.6052227", "0.6049502", "0.60449106", "0.6044158", "0.6043703", "0.6037153", "0.6036847", "0.6036539", "0.60323673", "0.6030376", "0.60283047" ]
0.0
-1
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function create() {}", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315901", "0.6248427", "0.6241929", "0.6194334", "0.6081284", "0.6075819", "0.6069913", "0.60685146", "0.6055616", "0.6027874", "0.60132784", "0.60118896", "0.6011778", "0.5969603", "0.59618074", "0.5954538", "0.59404427", "0.59388787", "0.5929363", "0.5910562", "0.590651", "0.589658", "0.589658", "0.589658", "0.58692765", "0.58665586", "0.5866528", "0.58663124", "0.5852474", "0.5852405", "0.58442044", "0.58391577", "0.58154446", "0.58055794", "0.5795853", "0.5780188", "0.57653266", "0.57640004", "0.57584697", "0.575748", "0.5742612", "0.5739361", "0.5732979", "0.572247", "0.5701043", "0.5686879", "0.5685233", "0.56819254", "0.5675983", "0.56670785", "0.56606543", "0.5659307", "0.56567776", "0.56534046", "0.56343585", "0.56290466", "0.5626615", "0.56255764", "0.5608852", "0.5608026", "0.56063116", "0.56026554", "0.5599553", "0.5599351", "0.55640906", "0.55640906", "0.5561977", "0.5559745", "0.5555084", "0.5551485", "0.5544597", "0.55397296", "0.5529626", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908" ]
0.0
-1
Execute the console command.
public function handle() { Log::info("Allocating diary items: " . date('Y-m-d H:i:s')); // $diary_items_to_allocate = DiaryItem::where('followup_date', date('Y-m-d')) /* Current date */ // ->where('status_id', 1) /* Open status */ // ->whereRaw('(allocated_user_id is null or followup_user_id <> allocated_user_id)') // ->get(); // $now = new DateTime(); // Log::info("Now: " . date_format($now, 'Y-m-d H:i:s')); $this_morning = new DateTime('today'); // Log::info("Today: " . date_format($today, 'Y-m-d H:i:s')); $tomorrow_morning = new DateTime('tomorrow'); // Log::info("Tomorrow: " . date_format($tomorrow, 'Y-m-d H:i:s')); $diary_items_to_allocate = DiaryItem::whereBetween('followup_date', [$this_morning, $tomorrow_morning]) /* Current date */ ->where('status_id', 1) /* Open status */ ->whereRaw('(allocated_user_id is null or followup_user_id <> allocated_user_id)') ->get(); /* Loop and allocate */ if ($diary_items_to_allocate && count($diary_items_to_allocate) > 0) { foreach ($diary_items_to_allocate as $diary_item_to_allocate) { DiaryItem::where('id' , '=', $diary_item_to_allocate->id) ->where('followup_user_id', '=', $diary_item_to_allocate->followup_user_id) ->where('status_id', '=', 1) ->update(['allocated_user_id' => $diary_item_to_allocate->followup_user_id]); Log::info("Allocated diary item " . $diary_item_to_allocate->id . " for property flip " . $diary_item_to_allocate->property_flip_id . " to user " . $diary_item_to_allocate->allocated_user_id); } } else { Log::info("No diary items to allocate"); } Log::info("Done Allocating: " . date('Y-m-d H:i:s')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.61484164", "0.6146793", "0.6139144", "0.61347336", "0.6131662", "0.61164206", "0.61144686", "0.61109483", "0.61082935", "0.6105106", "0.6103338", "0.6102162", "0.61020017", "0.60962653", "0.6095482", "0.6091584", "0.60885274", "0.6083864", "0.6082142", "0.6077832", "0.60766655", "0.607472", "0.60739267", "0.607275", "0.60699606", "0.6069931", "0.6068753", "0.6067665", "0.6061175", "0.60599935", "0.6059836", "0.605693", "0.60499364", "0.60418284", "0.6039709", "0.6031963", "0.6031549", "0.6027515", "0.60255647", "0.60208166", "0.6018581", "0.60179937", "0.6014668", "0.60145515", "0.60141796", "0.6011772", "0.6008498", "0.6007883", "0.60072047", "0.6006732", "0.60039204", "0.6001778", "0.6000803", "0.59996396", "0.5999325", "0.5992452", "0.5987503", "0.5987503", "0.5987477", "0.5986996", "0.59853584", "0.5983282", "0.59804505", "0.5976757", "0.5976542", "0.5973796", "0.5969228", "0.5968169", "0.59655035", "0.59642595", "0.59635514", "0.59619296", "0.5960217", "0.5955025", "0.5954439", "0.59528315", "0.59513766", "0.5947869", "0.59456027", "0.5945575", "0.5945031" ]
0.0
-1
devnote use this filter to add address
function create_customer_card($customer_instance, $customer_id, $nonce) { $card_body = apply_filters('id_square_card_params', array( 'card_nonce' => $nonce, ) ); $card_body = apply_filters('id_square_card_params', $card_body); try { $customer_card = $customer_instance->createCustomerCard($customer_id, $card_body); // $result = $api_instance->createCustomerCard($customer_id, $body); } catch (\SquareConnect\ApiException $e) { // #devnote fail here $message = $e->getMessage().' '.__LINE__; print_r(json_encode(array('response' => __('failure', 'memberdeck'), 'message' => $message))); exit; } return $customer_card; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addAddress($address);", "public function addAddress()\n\t{\n\t\treturn $this->editAddress();\n\t}", "function setAddress($add) {\n if ( strpos($add->value, \"BEGIN:VCARD\") || strpos($add->value, \"begin:vcard\") )\n $add->type = 'text/directory';\n else\n $add->type = 'text/plain';\n $this->address = $add;\n $changed = true;\n }", "function roomify_conversations_add_booking_address() {\n field_info_cache_clear();\n\n // \"booking_address\" field.\n if (field_read_field('booking_address') === FALSE) {\n $field = array(\n 'field_name' => 'booking_address',\n 'type' => 'addressfield',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(),\n );\n field_create_field($field);\n }\n\n field_cache_clear();\n\n // \"booking_address\" field instance.\n if (field_read_instance('bat_booking', 'booking_address', 'conversation_booking') === FALSE) {\n $instance = array(\n 'field_name' => 'booking_address',\n 'entity_type' => 'bat_booking',\n 'label' => 'Address',\n 'bundle' => 'conversation_booking',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'addressfield_standard',\n 'settings' => array(\n 'default_country' => '',\n ),\n ),\n );\n field_create_instance($instance);\n }\n}", "public function addAddress($address, $name = '')\n {\n }", "public function addAddress(){\n\t\t$name = $_REQUEST['name'];\n\t\t$address = $_REQUEST['address'];\n $stuid = $_REQUEST['stuid'];\n\t\t$phone = $_REQUEST['phone'];\n\t\t$form = M(\"addressinfo\");\n\t\t$data['name'] = $name;\n \t$data['address'] = $address;\n \t$data['phone'] = $phone;\n $data['stuid'] = $stuid;\n \t$result = $form->add($data);\n\t\tif ($result) {$this->redirect('/fastfood/index.php/Admin/admin');}\n\t\t\telse {$this->error('添加失败');}\n }", "public function addAddress($address, $name = ''){ \n $this->adresses[$address]= $name;\n }", "public function parseAddressesProvider() {}", "public function addAddress()\r\n {\r\n if ($this->_helper()->checkSalesVersion('1.4.0.0')) {\r\n # Community after 1.4.1.0 and Enterprise\r\n $salesFlatOrderAddress = $this->_helper()->getSql()->getTable('sales_flat_order_address');\r\n $this->getSelect()\r\n ->joinLeft(array('flat_order_addr_ship' => $salesFlatOrderAddress), \"flat_order_addr_ship.parent_id = main_table.entity_id AND flat_order_addr_ship.address_type = 'shipping'\", array())\r\n ->joinLeft(array('flat_order_addr_bill' => $salesFlatOrderAddress), \"flat_order_addr_bill.parent_id = main_table.entity_id AND flat_order_addr_bill.address_type = 'billing'\", array())\r\n ->columns(array('country_id' => 'IFNULL(flat_order_addr_ship.country_id, flat_order_addr_bill.country_id)'))\r\n ->group('country_id');\r\n } else {\r\n # Old Community\r\n $entityValue = $this->_helper()->getSql()->getTable('sales_order_entity_varchar');\r\n $entityAtribute = $this->_helper()->getSql()->getTable('eav_attribute');\r\n $entityType = $this->_helper()->getSql()->getTable('eav_entity_type');\r\n $orderEntity = $this->_helper()->getSql()->getTable('sales_order_entity');\r\n\r\n $this->getSelect()\r\n ->joinLeft(array('_eavType' => $entityType), \"_eavType.entity_type_code = 'order_address'\", array())\r\n ->joinLeft(array('_addrTypeAttr' => $entityAtribute), \"_addrTypeAttr.entity_type_id = _eavType.entity_type_id AND _addrTypeAttr.attribute_code = 'address_type'\", array())\r\n ->joinLeft(array('_addrValueAttr' => $entityAtribute), \"_addrValueAttr.entity_type_id = _eavType.entity_type_id AND _addrValueAttr.attribute_code = 'country_id'\", array())\r\n\r\n # Shipping values\r\n ->joinRight(array('_orderEntity_ship' => $orderEntity), \"_orderEntity_ship.entity_type_id = _eavType.entity_type_id AND _orderEntity_ship.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_ship' => $entityValue), \"_addrTypeVal_ship.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_ship.entity_id = _orderEntity_ship.entity_id AND _addrTypeVal_ship.value = 'shipping'\", array())\r\n ->joinRight(array('_addrCountryVal_ship' => $entityValue), \"_addrCountryVal_ship.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_ship.entity_id = _orderEntity_ship.entity_id\", array())\r\n\r\n # Billing values\r\n ->joinRight(array('_orderEntity_bill' => $orderEntity), \"_orderEntity_bill.entity_type_id = _eavType.entity_type_id AND _orderEntity_bill.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_bill' => $entityValue), \"_addrTypeVal_bill.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_bill.entity_id = _orderEntity_bill.entity_id AND _addrTypeVal_bill.value = 'billing'\", array())\r\n ->joinRight(array('_addrCountryVal_bill' => $entityValue), \"_addrCountryVal_bill.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_bill.entity_id = _orderEntity_bill.entity_id\", array())\r\n\r\n ->columns(array('country_id' => 'IFNULL(_addrCountryVal_ship.value, _addrCountryVal_bill.value)'))\r\n ->group('country_id');\r\n }\r\n return $this;\r\n }", "public function findAddress()\n {\n $regex = '/.{1,100}[A-Z]{1,2}[0-9]{1}[A-Z0-9]*\\s+[0-9]{1}[A-Z]{2}/si';\n\n if (preg_match_all($regex, $this->data, $matches)) {\n $uniques = array_values(array_unique($matches[0]));\n foreach ($uniques as $key => $address) {\n $uniques[$key] = preg_replace(\"/[\\s\\r\\n]*[|]+[\\s\\r\\n]*/\", \", \", $address);\n }\n $this->address = $uniques;\n }\n }", "public function setAddress(?CustomerAddressFilter $address): void\n {\n $this->address = $address;\n }", "public function addAddressParams()\n {\n $oUser = $this->getUser();\n if (!$oUser) {\n return;\n }\n $oRequest = $this->getPayPalRequest();\n\n $oRequest->setParameter(\"EMAIL\", $oUser->oxuser__oxusername->value);\n\n $sAddressId = $oUser->getSelectedAddressId();\n if ($sAddressId) {\n $oAddress = oxNew(\"oxAddress\");\n $oAddress->load($sAddressId);\n\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTONAME\", getStr()->html_entity_decode($oAddress->oxaddress__oxfname->value . \" \" . $oAddress->oxaddress__oxlname->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTREET\", getStr()->html_entity_decode($oAddress->oxaddress__oxstreet->value . \" \" . $oAddress->oxaddress__oxstreetnr->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCITY\", $oAddress->oxaddress__oxcity->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOZIP\", $oAddress->oxaddress__oxzip->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOPHONENUM\", $oAddress->oxaddress__oxfon->value);\n\n $oCountry = oxNew(\"oxCountry\");\n $oCountry->load($oAddress->oxaddress__oxcountryid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE\", $oCountry->oxcountry__oxisoalpha2->value);\n\n if ($oAddress->oxaddress__oxstateid->value) {\n $oState = oxNew(\"oxState\");\n $oState->load($oAddress->oxaddress__oxstateid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTATE\", $oState->oxstates__oxisoalpha2->value);\n }\n } else {\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTONAME\", getStr()->html_entity_decode($oUser->oxuser__oxfname->value . \" \" . $oUser->oxuser__oxlname->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTREET\", getStr()->html_entity_decode($oUser->oxuser__oxstreet->value . \" \" . $oUser->oxuser__oxstreetnr->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCITY\", $oUser->oxuser__oxcity->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOZIP\", $oUser->oxuser__oxzip->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOPHONENUM\", $oUser->oxuser__oxfon->value);\n\n $oCountry = oxNew(\"oxCountry\");\n $oCountry->load($oUser->oxuser__oxcountryid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE\", $oCountry->oxcountry__oxisoalpha2->value);\n\n if ($oUser->oxuser__oxstateid->value) {\n $oState = oxNew(\"oxState\");\n $oState->load($oUser->oxuser__oxstateid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTATE\", $oState->oxstates__oxisoalpha2->value);\n }\n }\n }", "private function addAddress($options)\n {\n $address = $options['billing_address']\n ?: $options['address'];\n\n $this->post['card']['address_line1'] = $address['address1'];\n $this->post['card']['address_line2'] = $address['address2'];\n $this->post['card']['address_city'] = $address['city'];\n $this->post['card']['address_postcode'] = $address['zip'];\n $this->post['card']['address_state'] = $address['state'];\n $this->post['card']['address_country'] = $address['country'];\n }", "function profile_cct_add_secondary_address_fields_filter($type_of= null){\n\t// if(in_array($type_of, array('page','list')) )\n\tadd_filter( 'profile_cct_dynamic_fields', 'profile_cct_add_secondary_address_fields' );\n\t\t\n\tadd_action('profile_cct_display_shell_secondary_address', 'profile_cct_address_display_shell',10, 3);\n\tadd_action('profile_cct_field_shell_secondary_address', 'profile_cct_address_field_shell',10, 3);\n\t\n}", "public function modifyAddress(){\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n $stuid = $_REQUEST['stuid'];\n\t\t$address = $_REQUEST['address'];\n\t\t$phone = $_REQUEST['phone'];\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$form = M(\"addressinfo\");\n \t$data = $form->where($condition)->find();\n \t$data['name'] = $name;\n \t$data['address'] = $address;\n $data['stuid'] = $stuid;\n \t$data['phone'] = $phone;\n \t//echo $data;\n\t\t$result = $form->add($data);\n\t\tif ($result) {$this->redirect('/fastfood/index.php/Admin/admin');}\n\t\t\telse {$this->error('添加失败');}\n }", "function hook_commerce_adyen_shopper_address_alter(\\Commerce\\Adyen\\Payment\\Composition\\Address $address, \\EntityDrupalWrapper $profile, array $checkout_values, \\EntityDrupalWrapper $order) {\n if ('Dnipropetrovsk' === $address->getCity()) {\n $address->setCity('Dnipro');\n }\n}", "public function addAdditionalDataToAddress(Varien_Event_Observer $observer)\n {\n $event = $observer->getEvent();\n $address = $event['address'];\n $orderData = $address->getOrder()->getData();\n $address->setData(\n array_merge(\n $address->getData(),\n array(\n 'vat_id' => $orderData['customer_taxvat'],\n )\n ));\n }", "public function validAddresses() {}", "public function add($address, $list, $type);", "private function _createAddressField()\n {\n $address = new Zend_Form_Element_Text('address');\n $address->setLabel('bankAddress')\n ->addFilter(new Zend_Filter_StringTrim())\n ->addFilter(new Zend_Filter_StripTags())\n ->addValidator(new Zend_Validate_StringLength(array(2, 150)));\n\n return $address;\n }", "protected function addAnAddress($kind, $address, $name = '')\n {\n }", "public function idc_authnet_add_address($customer_payment_profile, $fields, $line) {\r\n\t\tglobal $avs;\r\n\t\t// if AVS (Address verification system) is turned on, add address in billing\r\n\t\tif (isset($avs) && $avs) {\r\n\t\t\t// echo \"fields: \"; print_r($fields); echo \"\\n\";\r\n\t\t\tforeach ($fields as $field) {\r\n\t\t\t\t// Address 1 field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_1\") {\r\n\t\t\t\t\t$idc_address_1 = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// Address 2 field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_2\") {\r\n\t\t\t\t\tif (!empty($field['value'])) {\r\n\t\t\t\t\t\t$idc_address_2 = sanitize_text_field($field['value']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// State field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_city\") {\r\n\t\t\t\t\t$idc_address_city = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// City field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_state\") {\r\n\t\t\t\t\t$idc_address_state = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// Zip code field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_zip_code\") {\r\n\t\t\t\t\t$idc_address_zip_code = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$address_1 = apply_filters('idc_authnet_address_1_filter', $idc_address_1);\r\n\t\t\t$address_2 = apply_filters('idc_authnet_address_2_filter', ((isset($idc_address_2)) ? $idc_address_2 : ''));\r\n\t\t\t$address_city = apply_filters('idc_authnet_address_city_filter', $idc_address_city);\r\n\t\t\t$address_state = apply_filters('idc_authnet_address_state_filter', $idc_address_state);\r\n\t\t\t$address_zip_code = apply_filters('idc_authnet_address_zip_code_filter', $idc_address_zip_code);\r\n\r\n\t\t\t// Adding it to payment_profile\r\n\t\t\t$customer_payment_profile->billTo->address = $address_1 . \" \" . $address_2;\r\n\t\t\t$customer_payment_profile->billTo->city = $address_city;\r\n\t\t\t$customer_payment_profile->billTo->state = $address_state;\r\n\t\t\t$customer_payment_profile->billTo->zip = $address_zip_code;\r\n\r\n\t\t\tunset ($customer_payment_profile->payment->bankAccount);\r\n\t\t}\r\n\t\t// echo \"customer_payment_profile: \"; print_r($customer_payment_profile); echo \"\\n\";\r\n\r\n\t\treturn $customer_payment_profile;\r\n\t}", "public function collectAddressData()\n {\n try {\n $components = collect($this->response->address_components);\n\n $this->address_data = $components->filter(function ($element) {\n $types = collect($element->types);\n\n return $types->search('street_number') !== false ||\n $types->search('route') !== false ||\n $types->search('locality') !== false ||\n $types->search('administrative_area_level_1') !== false || // province, normalement, short et long form\n $types->search('country') !== false ||\n $types->search('postal_code') !== false;\n })->mapWithKeys(function ($item) {\n return [$item->types[0] => $item->long_name];\n });\n } catch (\\Exception $e) {\n $this->address_data = null;\n }\n\n return $this;\n }", "public function set_list_address($add)\n\t{\n\t\t$this->list_address = $add;\n\t\treturn TRUE;\n\t}", "public function getAddress() {}", "public function allowedAddress()\n {\n return array(array('country' => 'rus'));\n }", "public static function address($address){\n $addre = Address::where('user_id',Auth::id())->where('address_type',$address['address_type'])->first();\n if ($addre){\n $addre->update($address);\n }else{\n Address::create($address);\n }\n }", "public function invalidAddresses() {}", "function ShipToAddress()\r\n\t{\r\n\t\r\n\t}", "private function addAddress($options)\n {\n if (!isset($options['address'])\n || !isset($options['billing_address'])\n ) {\n return false;\n }\n\n $address = isset($options['billing_address'])\n ? $options['billing_address']\n : $options['address'];\n\n $this->post['BillingStreet'] = isset($address['address1']) ? $address['address1'] : null;\n $this->post['BillingHouseNumber'] = isset($address['address2']) ? $address['address2'] : null;\n $this->post['BillingCity'] = isset($address['city']) ? $address['city'] : null;\n $this->post['BillingState'] = isset($address['state']) ? $address['state'] : null;\n $this->post['BillingPostCode'] = isset($address['zip']) ? $address['zip'] : null;\n }", "public function append_to_approved($address)\n\t{\n\t\t$this->approved_array[] = $address;\n\t}", "function add_address() {\n\t\t //$mailchimpform = mailchimpSF_signup_form();\n $cont .= '<span class=\"logo-address\">507 Kent Street, Utica, NY 13501 | (315) 797-2233 toll free (877) 719-9996</span>';\n\t \n\t echo $cont;\n }", "public function AddAddress($address, $name = '') {\n\t return $this->AddAnAddress('to', $address, $name);\n\t}", "public function setAddress($address);", "public function setAddress($address);", "public function testAddAddress()\n {\n\n }", "public function addAddress($i = '')\n {\n $index = $this->getIndex($i);\n $index_text = $this->getIndexText($i);\n $this->setCols(3, 9, 'md');\n $this->addTextarea('address' . $index, '', 'Address' . $index_text, 'required');\n $this->groupInputs('zip_code' . $index, 'city' . $index);\n $this->setCols(3, 4, 'md');\n $this->addInput('text', 'zip_code' . $index, '', 'Zip Code' . $index_text, 'required');\n $this->setCols(2, 3, 'md');\n $this->addInput('text', 'city' . $index, '', 'City' . $index_text, 'required');\n $this->setCols(3, 9, 'md');\n $this->addCountrySelect('country' . $index, 'Country' . $index_text, 'class=no-autoinit, data-width=100%, required');\n\n return $this;\n }", "public function add_recipient(EmailAddress $address);", "private function addInputFilter()\n {\n // Create main input filter\n $inputFilter = new InputFilter();\n $this->setInputFilter($inputFilter);\n\n // Add input for \"pin\" field\n $inputFilter->add([\n 'name' => 'pin',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'],\n ],\n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'max' => 14\n ],\n ],\n ],\n ]);\n\n }", "public function getAddress();", "public function getAddress();", "public function AddAddress($email,$name = \"\")\n {\n $this->addresses[$email] = $name;\n }", "public function setAddress($value)\n {\n \t$this->address = $value;\n \treturn $this;\n }", "public function addAction() {\r\n \t$this->checkRight();\r\n \t$gid = $this->getInput('gid');\r\n \t$title = \"添加收货人地址\";\r\n \t$this->assign('title', $title);\r\n \t$this->assign('gid', $gid);\r\n }", "public function actionAddressAdd() {\r\n\r\n $customer_id = Yii::$app->user->getId();\r\n\r\n $address_name = Yii::$app->request->getBodyParam(\"address_name\");\r\n $address_data = Yii::$app->request->getBodyParam(\"address_data\");\r\n $address_type_id = Yii::$app->request->getBodyParam(\"address_type_id\");\r\n $address_archived = Yii::$app->request->getBodyParam(\"address_archived\");\r\n $questions_answers = Yii::$app->request->getBodyParam(\"questions_answers\");\r\n\r\n $area_id = Yii::$app->request->getBodyParam(\"area_id\");\r\n\r\n $QuestionsList = AddressQuestion::find()\r\n ->select(['ques_id','question','required'])\r\n ->where([\r\n 'address_type_id'=>$address_type_id,\r\n 'trash' => 'Default',\r\n 'status' => 'Active'\r\n ])\r\n ->asArray()\r\n ->all();\r\n\r\n foreach ($QuestionsList as $question) {\r\n if ($question['required']) {\r\n if(!isset($questions_answers[$question['ques_id']])) {\r\n return [\r\n \"operation\" => \"error\",\r\n \"message\" => Yii::t(\"api\", \"Please provide answer of question {question}\", [\r\n 'question' => $question['question']\r\n ]),\r\n 'detail' => $question['question']\r\n ];\r\n exit;\r\n }\r\n }\r\n }\r\n\r\n //save address\r\n $customer_address = new CustomerAddress();\r\n $customer_address->address_name = $address_name;\r\n $customer_address->address_data = $address_data;\r\n $customer_address->address_type_id = $address_type_id;\r\n $customer_address->address_archived = $address_archived;\r\n $customer_address->area_id = $area_id;\r\n $customer_address->customer_id = $customer_id;\r\n $customer_address->created_by = $customer_id;\r\n $customer_address->modified_by = $customer_id;\r\n\r\n $location = Location::findOne($customer_address->area_id);\r\n\r\n $customer_address->city_id = $location->city_id;\r\n $customer_address->country_id = $location->country_id;\r\n if ($customer_address->save(false)) {\r\n\r\n $address_id = $customer_address->address_id;\r\n\r\n //save address questions\r\n foreach ($QuestionsList as $question) {\r\n $customer_address_response = new CustomerAddressResponse();\r\n $customer_address_response->address_id = $address_id;\r\n $customer_address_response->address_type_question_id = $question['ques_id'];\r\n $customer_address_response->response_text = $questions_answers[$question['ques_id']];\r\n $customer_address_response->save(false);\r\n }\r\n\r\n return [\r\n \"operation\" => \"success\",\r\n \"message\" => Yii::t(\"api\", \"Address Saved Successfully\"),\r\n \"address_id\" => $customer_address->address_id\r\n ];\r\n\r\n } else {\r\n return [\r\n \"operation\" => \"error\",\r\n \"message\" => Yii::t(\"api\", \"Error While Saving Address\"),\r\n 'detail' => $customer_address->errors\r\n ];\r\n }\r\n }", "public function invoiceAddress() {\r\n $result = $this->clients->flatInvoice();\r\n foreach ($result as $key => $value) {\r\n $getAdress = $this->clients->companyAddress($value->CustomerCompanyID);\r\n $data = array('Params' => $getAdress[0]->Params);\r\n $response = $this->clients->invoiceAdressupdate($value->InvoiceID, $data);\r\n echo $response . \"<br/>\";\r\n }\r\n }", "public function addAddress(array $data)\n {\n $address = new Address($data);\n $address->is_editable = true;\n return $this->addresses()->save($address);\n }", "function get_contact_address_markup() {\n\t$address = get_theme_mod( 'organization_address' );\n\tif ( !empty( $address ) ) {\n\t\tob_start();\n\t?>\n\t<address class=\"address\">\n\t\t<?php echo wptexturize( nl2br( $address ) ); ?>\n\t</address>\n\t<?php\n\t\treturn ob_get_clean();\n\t}\n\treturn;\n}", "function additional_paragraph_after_billing_address_1( $field, $key, $args, $value ){\r\n if ( is_checkout() && $key == 'billing_address_1' ) {\r\n $field .= '<p class=\"form-row red_text\" style=\"color:red;\">\r\n Ingresa tu dirección y pon \"Buscar\" o usa el mapa para ubicar tu dirección de envío</p>\r\n ';\r\n \r\n }\r\n return $field;\r\n}", "public function renderAddress()\n {\n echo $this->getAddressStringSingleLine();\n }", "function getFieldPortalAddressStreet($value1 = null, $value2 = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_street');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_street');\n\t\t$tooltip = setToolTipNotification(\"street\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('street') === 'street' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><input type='text' name='streetNo' value='\".$value1.\"' id='streetNo' size='4' style='width:28%;'>\";\n\t\t\t$form_ret .= \"<input type='text' name='streetName' value='\".$value2.\"' id='streetName' size='12' class='srms-field \".(get_axl_req_fields('street') === 'street' ? 'input-text-required' : '').\"' style='width:70%;'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "public function add_postAction() {\r\n \t$this->checkRight();\r\n \t//现只保留一个收货地址\r\n \t$gid = $this->getInput('gid');\r\n \t$info = $this->getPost(array('realname','province','city','country','detail_address','postcode', 'mobile','phone'));\r\n \t$info['user_id'] = $this->userInfo['id'];\r\n \t$info['isdefault'] = 1;\r\n \t$info = $this->_cookData($info);\r\n\t\t$result = Gc_Service_UserAddress::addUserAddress($info);\r\n\t\tif (!$result) $this->output(-1, '操作失败.');\r\n\t\tif($gid) {\n\t\t\t$url = $webroot.'/order/detail/?id='.$gid;\n\t\t} else {\n\t\t\t$url = $webroot.'/user/setting/index';\n\t\t}\r\n\t\t$this->output(0, '添加成功.', array('type'=>'redirect', 'url'=>$url));\r\n }", "public function AddAddress($address, $name = '') {\n return $this->AddAnAddress('to', $address, $name);\n }", "public function addrFormat($addr)\n {\n }", "private function formatAddress()\n\t{\n\t\t$address = '';\n\n\t\t// street + number\n\t\t$address .= $this->street;\n\t\tif ($this->number)\n\t\t{\n\t\t\tif ($this->language === 'cs')\n\t\t\t{\n\t\t\t\t$address .= ' ' . $this->number;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$address = $this->number . ' ' . $address;\n\t\t\t}\n\t\t}\n\n\t\t// use \"Praha 1\" instead of \"Praha 1, Praha\"\n\t\tif (substr($this->quarter, 0, strlen($this->town)) === $this->town)\n\t\t{\n\t\t\t$useQuarter = TRUE;\n\t\t}\n\n\t\tif (!$address)\n\t\t{\n\t\t\t// [neighborhood]\n\t\t\t$address .= $this->neighborhood;\n\n\t\t\t// [quarter]\n\t\t\tif (!isset($useQuarter))\n\t\t\t{\n\t\t\t\t$address .= $this->quarter;\n\t\t\t}\n\t\t}\n\n\t\t// town [+ zip]\n\t\tif ($address)\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\tif ($this->language === 'cs' && $this->postalCode)\n\t\t{\n\t\t\t$address .= $this->postalCode . ' ';\n\t\t}\n\t\t$address .= isset($useQuarter) ? $this->quarter : $this->town;\n\n\t\t// [district]\n\t\tif (!$address)\n\t\t{\n\t\t\t$address .= $this->district;\n\t\t}\n\n\t\t// [region]\n\t\tif (!$address)\n\t\t{\n\t\t\t$address .= $this->region;\n\t\t}\n\n\t\t// state\n\t\tif ($address && ($this->state || $this->stateCode))\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\t$address .= $this->stateCode ?: $this->state;\n\n\t\t// [zip]\n\t\tif ($address && $this->language !== 'cs' && $this->postalCode)\n\t\t{\n\t\t\tif (!$this->state && !$this->stateCode)\n\t\t\t{\n\t\t\t\t$address .= ',';\n\t\t\t}\n\t\t\t$address .= ' ' . $this->postalCode;\n\t\t}\n\n\t\t// country\n\t\tif ($address)\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\t$address .= $this->country;\n\n\t\t$this->formatedAddress = $address;\n\t}", "public function testAddress()\n {\n $this->assertTrue(RuValidation::address1('Московский пр., д. 100'));\n $this->assertTrue(RuValidation::address1('Moskovskiy ave., bld. 100'));\n\n $this->assertFalse(RuValidation::address1('I would not tell'));\n }", "function create_address($patient_id, $tag, $bldg, $street, $brgy, $city, $prov, $zip, $ctry) {\n\n $data = array(\n 'patient_id' => $patient_id,\n 'tag' => $tag,\n 'building' => $bldg,\n 'street' => $street,\n 'barangay' => $brgy,\n 'city' => $city,\n 'province' => $prov,\n 'zip' => $zip,\n 'country' => $ctry\n );\n\n return $this->db->insert('patients_address', $data);\n\n }", "public function exchange_add_address($username, $emailaddress, $default=FALSE, $isGUID=false) {\n if ($username===NULL){ return (\"Missing compulsory field [username]\"); } \n if ($emailaddress===NULL) { return (\"Missing compulsory fields [emailaddress]\"); }\n \n $proxyvalue = 'smtp:';\n if ($default === true) {\n $proxyvalue = 'SMTP:';\n }\n \n // Find the dn of the user\n $user=$this->user_info($username,array(\"cn\",\"proxyaddresses\"),$isGUID);\n if ($user[0][\"dn\"]===NULL){ return (false); }\n $user_dn=$user[0][\"dn\"];\n \n // We need to scan existing proxy addresses and demote the default one\n if (is_array($user[0][\"proxyaddresses\"]) && $default===true) {\n $modaddresses = array();\n for ($i=0;$i<sizeof($user[0]['proxyaddresses']);$i++) {\n if (strstr($user[0]['proxyaddresses'][$i], 'SMTP:') !== false) {\n $user[0]['proxyaddresses'][$i] = str_replace('SMTP:', 'smtp:', $user[0]['proxyaddresses'][$i]);\n }\n if ($user[0]['proxyaddresses'][$i] != '') {\n $modaddresses['proxyAddresses'][$i] = $user[0]['proxyaddresses'][$i];\n }\n }\n $modaddresses['proxyAddresses'][(sizeof($user[0]['proxyaddresses'])-1)] = 'SMTP:' . $emailaddress;\n \n $result=@ldap_mod_replace($this->_conn,$user_dn,$modaddresses);\n if ($result==false){ return (false); }\n \n return (true);\n }\n else {\n // We do not have to demote an email address from the default so we can just add the new proxy address\n $attributes['exchange_proxyaddress'] = $proxyvalue . $emailaddress;\n \n // Translate the update to the LDAP schema \n $add=$this->adldap_schema($attributes);\n \n if (!$add){ return (false); }\n \n // Do the update\n // Take out the @ to see any errors, usually this error might occur because the address already\n // exists in the list of proxyAddresses\n $result=@ldap_mod_add($this->_conn,$user_dn,$add);\n if ($result==false){ return (false); }\n \n return (true);\n }\n }", "public function setAddress($value)\n {\n $this->_address = $value;\n }", "function makeAddress($label){\n\t\t\t$addressdata = $this -> makeRequest('GET', '/new_address', array(\n\t\t\t\t'password'=>$_SESSION['walletpass'],\n\t\t\t\t'label'=>$label\n\t\t\t\t));\n\t\t\treturn $addressdata['address'];\n\t\t\t\n\t\t}", "public function setAutoResponderToAddressField($value) { $this->_autoResponderToAddressField = $value; }", "public function appendAddressDataToBillingStep($observer)\n {\n if( false === Mage::getModel('postident/config')->isEnabled()\n || false === Mage::getModel('postident/config')->getAddressDataUsage()) {\n return;\n }\n \n if ($observer->getBlock() instanceof Mage_Checkout_Block_Onepage_Billing \n && false == $observer->getBlock() instanceof Mage_Paypal_Block_Express_Review_Billing\n ) {\n $transport = $observer->getTransport();\n $block = $observer->getBlock();\n $layout = $block->getLayout();\n $html = $transport->getHtml();\n $addAddressTemplateHtml = $layout->createBlock(\n 'postident/checkout_onepage_billing', 'postident_onepage_billing')\n ->renderView();\n $html = $html . $addAddressTemplateHtml;\n $transport->setHtml($html);\n }\n }", "public function getFiltersAddresses()\n {\n return $this->hasMany(FilterAddress::className(), ['address_id' => 'id']);\n }", "public function address($value)\n {\n $this->setProperty('address', $value);\n return $this;\n }", "private function AddAnAddress($kind, $address, $name = '') {\n\t if (!preg_match('/^(to|cc|bcc|ReplyTo)$/', $kind)) {\n\t echo 'Invalid recipient array: ' . kind;\n\t return false;\n\t }\n\t $address = trim($address);\n\t $name = trim(preg_replace('/[\\r\\n]+/', '', $name)); //Strip breaks and trim\n\t if (!self::ValidateAddress($address)) {\n\t //$this->SetError($this->Lang('invalid_address').': '. $address);\n\t if ($this->exceptions) {\n\t \t\techo 'invalid_address';\n\t }\n\t // echo $this->Lang('invalid_address').': '.$address;\n\t return false;\n\t }\n\t if ($kind != 'ReplyTo') {\n\t if (!isset($this->all_recipients[strtolower($address)])) {\n\t array_push($this->$kind, array($address, $name));\n\t $this->all_recipients[strtolower($address)] = true;\n\t return true;\n\t }\n\t } else {\n\t if (!array_key_exists(strtolower($address), $this->ReplyTo)) {\n\t $this->ReplyTo[strtolower($address)] = array($address, $name);\n\t return true;\n\t }\n\t }\n\t return false;\n\t}", "public function addStandardAddress($map,$wmo,$rcp)\n\t{\n\t\tglobal $ilUser,$lng;\n\t\t\n\t\tinclude_once './Services/ADN/MD/classes/class.adnWMO.php';\n\t\tinclude_once './Services/Calendar/classes/class.ilCalendarUtil.php';\n\t\t$wmo = new adnWMO($wmo);\n\n\t\t$map['sender_wmo_name'] = $wmo->getName();\n\t\t$map['sender_wmo_address'] = \n\t\t\t$wmo->getPostalStreet().' '.$wmo->getPostalStreetNumber().' '.\n\t\t\t$wmo->getPostalZip().' '.$wmo->getPostalCity();\n\t\t\n\t\tinclude_once './Services/ADN/ES/classes/class.adnCertifiedProfessional.php';\n\t\t$cand = new adnCertifiedProfessional($rcp);\n\t\t\n\t\t\n\t\t// Base fields\n\t\t$sal = $lng->txt('salutation_'.$cand->getSalutation());\n\t\t$name = $cand->getFirstName().' '.$cand->getLastName();\n\t\t$street = $cand->getPostalStreet().' '.$cand->getPostalStreetNumber();\n\t\t\n\t\t$city = '';\n\t\t\t\n\t\tinclude_once './Services/ADN/MD/classes/class.adnCountry.php';\n\t\t$country = new adnCountry($cand->getPostalCountry());\t\t\t\t\n\t\tif($country->getCode() != 'DE')\n\t\t{\n\t\t\t$city .= $country->getCode().'-';\n\t\t}\n\t\t\n\t\t$city .= $cand->getPostalCode().' '.$cand->getPostalCity();\n\t\t\n\t\t// Overwrite with shipping adress if available and enabled\n\t\tif($cand->isShippingActive())\n\t\t{\n\t\t\t$sal = $lng->txt('salutation_'.$cand->getShippingSalutation());\n\t\t\t$name = $cand->getShippingFirstName().' '.$cand->getShippingLastName();\n\t\t\t$street = $cand->getShippingStreet().' '.$cand->getShippingStreetNumber();\n\t\t\t\t\t\t\t\t\t\n\t\t\t$city = '';\n\t\t\t\n\t\t\t$country = new adnCountry($cand->getShippingCountry());\n\t\t\tif($country->getCode() != 'DE')\n\t\t\t{\n\t\t\t\t$city .= $country->getCode().'-';\n\t\t\t}\n\t\t\t\n\t\t\t$city .= $cand->getShippingCode().' '.$cand->getShippingCity();\n\t\t}\n\t\t\n\t\t$map['rcp_address'] = $sal.\"\\n\".$name.\"\\n\".$street.\"\\n\".$city;\n\t\t#$GLOBALS['ilLog']->write(print_r($map,true));\n\t\t\n\t\treturn $map;\t\t\n\t}", "public function addToAddress($item)\n {\n // validation for constraint: itemType\n if (!false) {\n throw new \\InvalidArgumentException(sprintf('The Address property can only contain items of anyType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->Address[] = $item;\n return $this;\n }", "public function addShippingAddress($shiptoname, $shiptostreet, $shiptocity, $shiptostate, $shiptozip, $shiptocountrycode, $shiptophonenum = null)\n\t{\n\t\t$address = func_get_args();\n\n\t\t// Validate fields\n\t\tif (strlen($shiptoname) > 32) throw new PayPalException('Shipping address name cannot exceed 32 characters!');\n\t\tif (strlen($shiptostreet) > 200) throw new PayPalException('Shipping street address cannot exceed 200 characters!');\n\t\telse if (strlen($shiptostreet) > 100) {\n\t\t\t$words = explode(\" \", $shiptostreet);\n\t\t\t$address['shiptostreet'] = \"\";\n\t\t\twhile(strlen($address['shiptostreet']) < 100 && $words) $address['shiptostreet'] += array_shift($words) . \" \";\n\t\t\tif ($words) $address['shiptostreet2'] = implode(\" \", $words);\n\t\t}\n\t\tif (strlen($shiptocity) > 40) throw new PayPalException('Shipping address city cannot exceed 40 characters!');\n\t\tif (strlen($shiptozip) > 20) throw new PayPalException('Shipping address postal code/ZIP cannot exceed 20 characters!');\n\t\tif (strlen($shiptocountrycode) > 2) throw new PayPalException('Shipping address country must be a 2 character code!');\n\t\tif ($shiptophonenum && strlen($shiptophonenum) > 20) throw new PayPalException('Shipping address phone number cannot exceed 20 characters!');\n\t\telse if (is_null($shiptophonenum)) unset($address['shiptophonenum']);\n\n\t\t$this->_payment_fields = array_merge($this->_payment_fields, compact('shiptoname', 'shiptostreet', 'shiptocity', 'shiptostate', 'shiptozip', 'shiptocountrycode', 'shiptophonenum'));\n\t\t$this->addroverride = 1;\n\t}", "public function addAddress($data){\n\t\tglobal $dbh;\n\t\t$fields = array(\n\t\t\t\"nombre\",\n\t\t\t\"receptorNombre\",\n\t\t\t\"receptorApellido\",\n\t\t\t\"nombreEmpresa\",\n\t\t\t\"facturacion\",\n\t\t\t\"principal\",\n\t\t\t\"idCliente\",\n\t\t\t\"direccion\",\n\t\t\t\"fono\",\n\t\t\t\"cel\",\n\t\t\t\"idZona\"\n\t\t);\n\t\t$query = \"INSERT INTO direccion(nombre,receptorNombre,receptorApellido,nombreEmpresa,facturacion,principal,idCliente,direccion,fono,cel,idZona) VALUES(?,?,?,?,?,?,?,?,?,?,?)\";\n\t\t$update = array();\n\t\tif( $data!=null && is_array($data) ){\n\t\t\tforeach( $fields as $field ){\n\t\t\t\tif( $field == 'idCliente' ){\n\t\t\t\t\t$update[$field] = $this->id;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$update[$field] = null;\n\t\t\t\tif( isset($data[$field]) && !empty($data[$field]) ){\n\t\t\t\t\t$update[$field] = $data[$field];\n\t\t\t\t} else {\n\t\t\t\t\t//$update[$field] = $old[$field];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$res = $dbh->query($query,$update);\n\t\t\treturn $res;\n\t\t}\n\t\treturn false;\n\t}", "public function addAddress(Address $address, $id = null)\n {\n $packageId = $id !== null ? $id : ((count($this->postFields)+1));\n $postFields = $this->postFields;\n if (empty($postFields['Address'])) $postFields['Address'] = [];\n $postFields['Address'][] = array_merge(array('@attributes' => array('ID' => $packageId)), $address->data());\n $this->postFields = $postFields;\n }", "public function add_user_address($data) {\n $this->db->insert('shop_user_address', $data);\n }", "function setAddress( $postoffice='', $extended='', $street='', $city='', $region='', $zip='', $country='', $type='HOME;POSTAL' )\n {\n // $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. \"WORK;PARCEL;POSTAL\"\n $key = 'ADR';\n if ( $type != '' ) {\n $key .= ';'. $type;\n }\n $key.= ';ENCODING=QUOTED-PRINTABLE';\n $this->properties[$key] = encode( $postoffice ) . ';' . encode( $extended ) .';'. encode( $street ) .';'. encode( $city ) .';'. encode( $region) .';'. encode( $zip ) .';'. encode( $country );\n }", "public function append_to_resend_to($address)\n\t{\n\t\t$this->resend_to_array[] = $address;\n\t}", "public function setAddress(Address $address);", "public function add_address($wallet_id, $address, $userid = 0, $is_change_address = 0, $address_num = 0, $key_id = 0) { \n\n\t// Initialize\n\tglobal $config;\n\t\n\t// Add address to db\n\tDB::insert('coin_addresses', array(\n\t\t'wallet_id' => $wallet_id, \n\t\t'key_id' => $key_id, \n\t\t'userid' => $userid, \n\t\t'is_change_address' => $is_change_address, \n\t\t'address_num' => $address_num, \n\t\t'address' => $address)\n\t);\n\n\t// Init RPC client\n\tinclude_once(SITE_PATH . '/data/lib/jsonRPCClient.php');\n\t$rpc_url = 'http://' . $config['btc_rpc_user'] . ':' . $config['btc_rpc_pass'] . '@' . $config['btc_rpc_host'] . ':' . $config['btc_rpc_port'];\n\t$client = new jsonRPCClient($rpc_url);\n\n\t// Import address to bitcoind\n\ttry {\n\t\t$client->importaddress($address, \"\", false);\n\t} catch (Exception $e) { \n\t\ttrigger_error(\"Unable to import address into Bitcoin Core as a watch only address, $address. Please ensure Bitcoin Core is running, and in the correct mode (mainnet / testnet).\", E_USER_ERROR);\n\t}\n\n}", "public function AddAddress($addr)\n\t\t{\n\t\t\tif (!isset($this->Addresses))\n\t\t\t{\n\t\t\t\t$this->Addresses = array();\n\t\t\t}\n\n\t\t\tif ($addr instanceof DataPushAddress && !in_array($addr, $this->Addresses))\n\t\t\t{\n\t\t\t\tarray_push($this->Addresses, $addr);\n\t\t\t}\n\t\t}", "public function fullAddress(){\n\n return ' '.$this->house. ' '. $this->address. ', '. $this->postcode;\n }", "public function setAddress($value)\n {\n return $this->set('Address', $value);\n }", "public function setAddress($value)\n {\n return $this->set('Address', $value);\n }", "public function setAddress($value)\n {\n return $this->set('Address', $value);\n }", "public function disableSelectingDifferentAddressInPayPal()\n {\n $this->getPayPalRequest()->setParameter(\"ADDROVERRIDE\", \"1\");\n }", "public function setAddress($var)\n {\n GPBUtil::checkString($var, True);\n $this->address = $var;\n\n return $this;\n }", "public function setAddress($var)\n {\n GPBUtil::checkString($var, True);\n $this->address = $var;\n\n return $this;\n }", "public function setAddress($var)\n {\n GPBUtil::checkString($var, True);\n $this->address = $var;\n\n return $this;\n }", "public function setAddress($var)\n {\n GPBUtil::checkString($var, True);\n $this->address = $var;\n\n return $this;\n }", "public function setAddress($value)\n {\n return $this->set('Address', $value);\n }", "public function __construct() {\n\t\t$this->addresses = array();\n\t}", "public function addAddress($address, $name = '')\n {\n if (is_string($address)) {\n $this->options['addAddress'][$address] = $name;\n }\n \n return $this;\n }", "public function addAddress($address) {\n\t\t$userAddress = new MUserAddress();\n\t\t$userAddress->userId = $this->id;\n\t\t$userAddress->name = $address['name'];\n\t\t$userAddress->detail = $address['detail'];\n\t\t$userAddress->longitude = $address['longitude'];\n\t\t$userAddress->latitude = $address['latitude'];\n\t\t$userAddressList = $userAddress->find();\n\t\tif (count($userAddressList) > 0) {\n\t\t\tthrow new \\Exception('不可以添加重复的地址哦~');\n\t\t} else {\n\t\t\t$userAddress->insert();\n\t\t}\n\t}", "public function add_delivery_address(){\n $save_data['customer_id'] = $_REQUEST['customer_id'];\n $save_data['address_title'] = $_REQUEST['address_title'];\n $save_data['address'] = $_REQUEST['address'];\n $save_data['country_id'] = $_REQUEST['country_id'];\n $save_data['state_id'] = $_REQUEST['state_id'];\n $save_data['city_id'] = $_REQUEST['city_id'];\n $save_data['pincode'] = $_REQUEST['pincode'];\n\n $is_default = $_REQUEST['is_default'];\n $customer_id = $_REQUEST['customer_id'];\n\n $address_id = $this->User_Model->save_data('delivery_address', $save_data);\n if ($address_id) {\n if($is_default == 1){\n $up_data1['is_default'] = 0;\n $this->User_Model->update_info('customer_id', $customer_id, 'delivery_address', $up_data1);\n $up_data2['is_default'] = 1;\n $this->User_Model->update_info('address_id', $address_id, 'delivery_address', $up_data2);\n }\n $response[\"status\"] = TRUE;\n $response[\"msg\"] = \"Address Saved Successfuly\";\n } else {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = \"Address Not Saved\";\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "public function addAddress($address, $name = '')\n {\n return $this->addOrEnqueueAnAddress('to', $address, $name);\n }", "public function convertAddress(array $data, $type = 'billing')\n {\n $address = Mage::getModel('customer/address');\n $address->setId(null);\n $address->setIsDefaultBilling(true);\n $address->setIsDefaultShipping(false);\n if ($type == 'shipping') {\n $address->setIsDefaultBilling(false);\n $address->setIsDefaultShipping(true);\n }\n Mage::helper('core')->copyFieldset('lengow_convert_' . $type . '_address', 'to_' . $type . '_address', $data,\n $address);\n if ($type == 'shipping') {\n $type = 'delivery';\n }\n $address_1 = $data[$type . '_address'];\n $address_2 = $data[$type . '_address_2'];\n // Fix address 1\n if (empty($address_1) && !empty($address_2)) {\n $address_1 = $address_2;\n $address_2 = null;\n }\n // Fix address 2\n if (!empty($address_2)) {\n $address_1 = $address_1 . \"\\n\" . $address_2;\n }\n $address_3 = $data[$type . '_address_complement'];\n if (!empty($address_3)) {\n $address_1 = $address_1 . \"\\n\" . $address_3;\n }\n // adding relay to address\n if (isset($data['tracking_relay'])) {\n $address_1 .= ' - Relay : ' . $data['tracking_relay'];\n }\n $address->setStreet($address_1);\n $tel_1 = $data[$type . '_phone_office'];\n $tel_2 = $data[$type . '_phone_mobile'];\n // Fix tel\n $tel_1 = empty($tel_1) ? $tel_2 : $tel_1;\n\n if (!empty($tel_1)) {\n $this->setTelephone($tel_1);\n }\n if (!empty($tel_1)) {\n $address->setFax($tel_1);\n } else {\n if (!empty($tel_2)) {\n $address->setFax($tel_2);\n }\n }\n $codeRegion = (integer)substr(str_pad($address->getPostcode(), 5, '0', STR_PAD_LEFT), 0, 2);\n $id_region = Mage::getModel('directory/region')->getCollection()\n ->addRegionCodeFilter($codeRegion)\n ->addCountryFilter($address->getCountry())\n ->getFirstItem()\n ->getId();\n $address->setRegionId($id_region);\n $address->setCustomer($this);\n return $address;\n }", "private function __paramAddress( $param ){\n //if( isset( $input ) ){\n //list( $province,$city ) = explode( ',',$input );\n //isset( $input ) && $result = getAreaInfo( $province).\" \".getAreaInfo($city);\n //}\n //return $result;\n }", "public function dept_address_callback()\n {\n printf(\n '<textarea id=\"dept_address\" rows=\"10\" cols=\"40\" name=\"my_option_name[dept_address]\" placeholder=\"Enter department address here\">%s</textarea>',\n isset( $this->options['dept_address'] ) ? esc_attr( $this->options['dept_address']) : ''\n );\n }", "public function addPostalCode($postalCode);", "public function addAddress($address)\r\n {\r\n if (!$this->getAddresses()) {\r\n return $this->setAddresses(array($address));\r\n } else {\r\n return $this->setAddresses(\r\n array_merge($this->getAddresses(), array($address))\r\n );\r\n }\r\n }", "public function new_address() {\n\t\t$address = new Address();\n\n\t\t/*\n\t\t * Twinfield requires one default address:\n\t\t * \"There has to be one default address.\"\n\t\t */\n\t\tif ( empty( $this->addresses ) ) {\n\t\t\t$address->set_default( true );\n\t\t}\n\n\t\t$this->addresses[] = $address;\n\n\t\treturn $address;\n\t}", "public function setEventAddress($value) \n {\n $this->_fields['EventAddress']['FieldValue'] = $value;\n return;\n }", "public function newPaymentAddress() {\n $result = $this->newAPIRequest('POST', '/addresses', []);\n return $result;\n }", "public function setAddress($address)\n {\n $this->mail->addAddress(Helper::sanitizeInput($address));\n }", "public function check_address($add){\n\t\t$this->db->select('*');\n\t\t$this->db->from('user_address');\n\t\t$this->db->where('user_id',$this->session->userdata('sgcurrency_user_id'));\n\t\t$this->db->where('active',1);\n\t\t$this->db->where('uaddress',$add);\n\t\t$query = $this->db->get();\n\t\treturn $query->row_array();\n\t}" ]
[ "0.6796155", "0.6701885", "0.6665717", "0.6651129", "0.6588874", "0.6551023", "0.6546432", "0.6494391", "0.646627", "0.6407025", "0.6328408", "0.6240976", "0.6230136", "0.6220734", "0.61619186", "0.6106333", "0.6087452", "0.60758686", "0.60734504", "0.60606354", "0.60155857", "0.59889305", "0.5980032", "0.597857", "0.59500146", "0.59450823", "0.594182", "0.59296256", "0.5881878", "0.5875675", "0.5860704", "0.5844443", "0.5831582", "0.5795196", "0.5795196", "0.5780769", "0.5780159", "0.5758382", "0.575444", "0.5754347", "0.5754347", "0.57284695", "0.57170486", "0.57096475", "0.57079154", "0.56838423", "0.5679603", "0.56748354", "0.5662031", "0.56436753", "0.56109065", "0.5608749", "0.56019765", "0.55834866", "0.558311", "0.55721027", "0.5571736", "0.55643594", "0.556313", "0.55615", "0.555302", "0.5545683", "0.55408067", "0.55395406", "0.5536122", "0.5533512", "0.5532337", "0.5516879", "0.5513512", "0.5506189", "0.54995143", "0.5491513", "0.5487308", "0.5486771", "0.5483947", "0.54821247", "0.54744846", "0.5466157", "0.5466157", "0.5466157", "0.54649794", "0.5464134", "0.5464134", "0.5464134", "0.5464134", "0.54631746", "0.54560506", "0.5437907", "0.543352", "0.54288155", "0.5421714", "0.54206043", "0.54154223", "0.5414235", "0.54034925", "0.5403284", "0.5402351", "0.5396919", "0.5394274", "0.53941005", "0.53902495" ]
0.0
-1
Run the database seeds.
public function run() { $faker = Faker\Factory::create(); $speakers = [ [ 'name' => 'Brenden Legros', 'description' => 'Quas alias incidunt', 'twitter' => '#', 'facebook' => '#', 'linkedin' => '#', 'full_description' => $faker->paragraph ], [ 'name' => 'Hubert Hirthe', 'description' => 'Consequuntur odio aut', 'twitter' => '#', 'facebook' => '#', 'linkedin' => '#', 'full_description' => $faker->paragraph ], [ 'name' => 'Cole Emmerich', 'description' => 'Fugiat laborum et', 'twitter' => '#', 'facebook' => '#', 'linkedin' => '#', 'full_description' => $faker->paragraph ], [ 'name' => 'Jack Christiansen', 'description' => 'Debitis iure vero', 'twitter' => '#', 'facebook' => '#', 'linkedin' => '#', 'full_description' => $faker->paragraph ], [ 'name' => 'Alejandrin Littel', 'description' => 'Qui molestiae natus', 'twitter' => '#', 'facebook' => '#', 'linkedin' => '#', 'full_description' => $faker->paragraph ], [ 'name' => 'Willow Trantow', 'description' => 'Non autem dicta', 'twitter' => '#', 'facebook' => '#', 'linkedin' => '#', 'full_description' => $faker->paragraph ], ]; foreach($speakers as $key => $speaker) { $photo_id = $key+1; $speaker = Speaker::create($speaker); $speaker->addMedia(storage_path()."/seeders/speakers/$photo_id.jpg")->preservingOriginal()->toMediaCollection('photo'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Igual que un setter
public function canviarModel($string) { $this->model = $string; //Retornem el propi objecte return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function set();", "public static function setters();", "abstract public function set($in): void;", "public function __set($name, $value){\r\n echo \"You are trying to direct set property \".$name.\" to value \".$value.\" and thats not possible use set\".$name.\"(\\$value) method.\";\r\n echo \"<br/> At line \".__LINE__.\" in file \".__FILE__;\r\n }", "protected function doSet($value)\n {\n }", "public function set()\n {\n if ( ! $this->value ) {\n $this->generate();\n }\n }", "public function __SET($attr, $value){ //Establece valor y atributo\n\n\t\t\t$this->$attr=$value;\n\t\t}", "public function __SET($att, $valor){\r\n $this->$att = $valor;\r\n}", "function set_property(){\n }", "abstract public function setValue($value);", "function __set ( $name , $value )\n {\n $this->$name=$value;\n }", "function __set($name, $value)\n {\n // TODO: Implement __set() method.\n }", "private function __set($name, $value)\n {\n// \tprint(\"Property set for [$name]<br/>\");\n if (method_exists($this, ($method = 'set_'.$name)))\n {\n $this->$method($value);\n }\n }", "public function __set($name, $value) {\r\n\r\n\t\t/* Call setter only if setter exists */\r\n\t\tif (method_exists($this, \"set_\" . $name)) {\r\n\t\t\t$methodName = \"set_\" . $name;\r\n\t\t\t$this->$methodName($value);\r\n\t\t}\r\n\t\t/**\r\n\t\t * Set property value only if property does not exists (in order to do not revrite privat or protected properties),\r\n\t\t * it will craete dynamic property, like usually does PHP\r\n\t\t */ else if (!property_exists($this, $name)) {\r\n\t\t\t/**\r\n\t\t\t * Disallow add new properties dynamicly (cause of its change type of object to stdObject, i dont want that)\r\n\t\t\t */\r\n\t\t\t$this->$name = $value;\r\n\t\t}\r\n\t\t/**\r\n\t\t * property exists and private or protected, do not touch. Keep OOP\r\n\t\t */ else {\r\n\t\t\t//Do nothing\r\n\t\t}\r\n\t}", "public function __set($prop, $valor){\n\t\tif( !property_exists($this, $prop))\t{\n\t\t\tthrow new exception(\"la propiedad $prop no existe\"); \t\t\t\n\t\t}\t\t\n\t\t$this->$prop = $valor;\n\t\t//$this->(\"set\".ucfirst($prop))($valor);\n\t\t\n\t}", "final public function __set($name, $value)\n {\n }", "public function __set($_name, $_value);", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function __set($name, $value)\n {\n }", "public function __set($name, $value)\n\t{\n\t\t$method = 'set' . $name;\n\t\tif (!method_exists($this, $method)) \n\t{\n\t\tthrow new \\Exception('Class Entity: Ttcidi Invalid specified property: set'.$name);\n\t}\n\t$this->$method($value);\n\t}", "public function set($name, $value){}", "public function __set($param, $value);", "public function __set($name, $value);", "public function __set($name, $value);", "abstract protected function handle_set($name,$value);", "public function __set($property, $value) {}", "public function set($value = null);", "public function __set($name,$value)\r\n {\r\n $this->set($name,$value);\r\n }", "abstract protected function alter_set($name,$value);", "public function __set($name, $value)\n {\n // Don't allow to set attributes\n }", "final public function __set($field, $value)\n\t\t{\n\t\t\tswitch($field)\n\t\t\t{\n\t\t\t\tcase \"IsPersistent\":\n\t\t\t\t\t\n\t\t\t\t\tif($value == true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->stored = true;\n\t\t\t\t\t\t$this->changedfields = array();\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$this->stored = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\t$method = \"Set\".$field;\n\t\t\t\t\t$class = get_called_class();\n\t\t\t\t\t\n\t\t\t\t\t// Check if the current value (if any) equals the new value\n\t\t\t\t\t// If it doesn't, the field is to be declared as changed\n\t\t\t\t\t$currentValue = null;\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t$currentValue = $this->__get($field);\n\t\t\t\t\t}\n\t\t\t\t\tcatch(ValueCannotBeNullException $e)\n\t\t\t\t\t{\n\t\t\t\t\t\t// ignore\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($currentValue <> $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->changedfields[] = $field;\n\t\t\t\t\t\t$this->stored = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!method_exists($this, $method))\n\t\t\t\t\t{\n\t\t\t\t\t\t$logcode = LogManager::_(\"No Setter defined in '\".$class.\"->\".$method.\"'\");\n\t\t\t\t\t\tthrow new SetterNotDeclaredException($logcode);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Check the parameters\n\t\t\t\t\tFunctionCheck::CheckMethodParameters($class.\"::\".$method, array($value));\n\t\t\t\t\t\n\t\t\t\t\t// Find the method\n\t\t\t\t\t$method = new \\ReflectionMethod($class, $method);\n\t\t\t\t\t\n\t\t\t\t\t$method->setAccessible(true);\n\t\t\t\t\t\n\t\t\t\t\t// And execute it\n\t\t\t\t\t$method->invokeArgs($this, array($value));\n\t\t\t\t\t$method->setAccessible(false);\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}", "public function set($data);", "public function __set($name, $value)\n {\n }", "public function __set($name, $value)\n {\n }", "public function __set($name, $value)\n {\n }", "public function __set($name, $value)\n {\n }", "public function __set($name, $value)\n {\n }", "public function __set($name, $value)\n {\n }", "public function __set($name, $value)\n {\n }", "public function __set($name, $value)\n {\n }", "public function __set($name, $value)\n {\n }", "public function __set($name, $value)\n {\n }", "public function __set($key, $value){\n \t$this->$key = $value;\n }", "function __set( $name, $value ) {\n\t\t$this->$name = $value;\n\t}", "function __set( $key, $value ) {\n\t\t$this->{$key} = $value;\n\t}", "public function set($params) {}", "public function __set($name, $value)\n\t{\n\t\t$method = 'set' . $name;\n\t\tif (!method_exists($this, $method)) \n\t{\n\t\tthrow new \\Exception('Class Entity: Trmsus Invalid specified property: set'.$name);\n\t}\n\t$this->$method($value);\n\t}", "public function __set($name, $value){\n\t\t\t//echo $name.'<br>'.$value.'<br>';\n\t\t\t//IMP po tozi na4in zadavam klu4 imeto na promenlivata ! i stoinost \n\t\t\t//ravna na stoinostta na promenlivata !!!\n\t\t\t//oba4e ne mi dava da go 4eta i polzvam __GET !\n\t\t\t$this->data[$name] = $value;\n\t\t}", "public function __set($atributo, $valor) {\n\t\t\t// $this->modelo = $valor;\n\t\t\t$this->$atributo = $valor;\n\t\t}", "public function __set($atrib, $value){\n\t\t$this->$atrib = $value;\n\t}", "function __set($name, $value){\n //var_dump($value);\n\n $this->_properties[$name] = $value;\n }", "public function __set($name, $value)\n {\n\n /* Call setter only if setter exists */\n if (method_exists($this, \"set_\" . $name)) {\n $methodName = \"set_\" . $name;\n $this->$methodName($value);\n }\n /*\n * Set property value only if property does not exists (in order to do not revrite privat or protected properties),\n * it will craete dynamic property, like usually does PHP\n */ else if (!property_exists($this, $name)) {\n $this->$name = $value;\n }\n /*\n * property exists and private or protected, do not touch. Keep OOP\n */ else {\n //Do nothing\n }\n }", "public function __set($name, $value) {\r\n\t\t$method = 'set' . $name;\r\n\t\tif ('mapper' == $name || ! method_exists ( $this, $method )) {\r\n\t\t\tthrow new Zend_Exception ( 'Invalid property specified \"'.$method.'\"', Zend_Log::ERR );\r\n\t\t}\r\n\t\t$this->$method ( $value );\r\n\t}", "public function __construct($daten = array())\n{\n if ($daten) {\n foreach ($daten as $k => $v) {\n $setterName = 'set' . ucfirst($k);\n // wenn ein ungültiges Attribut übergeben wurde\n // (ohne Setter), ignoriere es\n if (method_exists($this, $setterName)) {\n $this->$setterName($v);\n }\n }\n }\n}", "function setValue ($value) {\n\t\t$this->_value = $value;\n\t}", "public function setX($x) {}", "public function __set($name, $value)\n { \n //set the attribute with the value\n $this->$name = $value;\n }", "public function __set($key, $value) {\n\t}", "function read_set()\n\t{\n\t\tglobal $REQUEST;\n\t\tif (!$this->writeable)\n\t\t{\n\t\t\tpage_error('Read only attribute ' . $this->name);\n\t\t}\n\t\t$this->value = $REQUEST->read($this->id, $this->mandatory);\n\t\t\n\t\tUtilLogging::getInstance()->debug(\"read_set - Attribute: \". $this->id . \" - value set: \" . $this->value);\n\t}", "public function __set($name, $value)\n {\n // if the property is not declared (automatically not public), it can be created\n if (!property_exists($this, $name)) {\n $this->$name = $value;\n } else {\n // otherwise we indicate that we must go through the setter\n trigger_error(\"You are trying to rewrite an existing protected or private attribute without going through its setter! (__set)\", E_USER_NOTICE);\n }\n }", "function __set($attr_name, $value) {\n // in $attr_name, replace _ with \" \"\n $attr_name = str_replace('_', ' ', $attr_name);\n $attr_name = ucwords($attr_name);\n $attr_name = str_replace(' ', '', $attr_name);\n $function = \"set$attr_name\";\n //var_dump($function);\n $this->$function($value);\n }", "function setValue($value) {\n $this->value = $value;\n }", "public function __set($name,$value)\n {\n $this->set($name, $value);\n }", "public function __set($key, $value)\n {\n }", "public function __set($key, $value)\n {\n }", "public function __set($key, $value)\n {\n }", "public function __set($key, $value)\n {\n }", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "protected abstract function setFields();", "final function set($value){\n if(is_object($value) and get_class($value)===get_class($this)){\n $this->value = $value->get();\n $this->isset = TRUE;\n return $this->_ok();\n }\n\n // use accept for type-check\n $this->isset = FALSE;\n $typ = $this->get_type($value,FALSE,FALSE);\n if($this->accept($value,$typ)!==TRUE) \n return $this->_err(array(3,strval($value)),FALSE);\n\n // get method responisble for this type\n $mth = 'set_' . (method_exists($this,'set_' . $typ)?$typ:'default');\n $res = $this->$mth($value);\n $this->isset = $this->isok();\n return $res;\n }", "function __set($name,$value){\r\n try{\r\n return parent::__set($name,$value);\r\n }catch(exception $e){\r\n return $this->_options[$name]=$value;\r\n }\r\n }", "public function setUnmodified()\n {\n\t$this->modified= false;\n }", "function __set($name, $value)\r\n\t{\r\n\t\t$this->{$name} = $value;\r\n\t}", "function __set($name, $value)\n {\n $this->set($name, $value);\n }", "public function __set($name, $value) {\r\n\t\t$method = \"set\" . $name;\r\n\t\tif (\"mapper\" == $name || !method_exists($this, $method)) {\r\n\t\t\tthrow new Exception(\"Invalid property specified\");\r\n\t\t}\r\n\t\t$this->$method($value);\r\n\t}", "function __set($name, $value) {\n $this->$name = $value;\n }", "public function setValue($value){\n $this->_value = $value;\n }", "abstract protected function propertySet($name, $value);", "function set_value($value)\n\t{\n\t\t$this->value = $value;\n\t}" ]
[ "0.7900664", "0.76998204", "0.71098155", "0.7106765", "0.7065924", "0.70524174", "0.7009662", "0.69810116", "0.6947319", "0.6860196", "0.68358195", "0.6804474", "0.67952436", "0.67651397", "0.6757776", "0.6757431", "0.6748105", "0.6740193", "0.6740193", "0.6740193", "0.6740193", "0.6740193", "0.6740193", "0.6740193", "0.6740193", "0.6740193", "0.6740193", "0.6740193", "0.6739731", "0.6739731", "0.67372864", "0.6718732", "0.668096", "0.6656238", "0.6655236", "0.6655236", "0.66532826", "0.6652581", "0.66370296", "0.66339", "0.66023755", "0.6600923", "0.6580139", "0.6575282", "0.6560012", "0.6536051", "0.6536051", "0.6536051", "0.6536051", "0.6536051", "0.65354836", "0.6535271", "0.6535249", "0.6535249", "0.6535249", "0.6523565", "0.651585", "0.6514306", "0.65139705", "0.6509861", "0.650926", "0.65083504", "0.6498866", "0.6496823", "0.6485013", "0.6478187", "0.6474568", "0.64738584", "0.6471834", "0.6468876", "0.6468357", "0.6464202", "0.64567155", "0.6442526", "0.64358", "0.6424829", "0.6423222", "0.6423203", "0.6423203", "0.6419409", "0.6406407", "0.6406407", "0.6406407", "0.6406407", "0.6406407", "0.6406407", "0.6406407", "0.6406407", "0.6406407", "0.6406407", "0.63952976", "0.63723266", "0.6368724", "0.63594955", "0.63523537", "0.6352248", "0.63464147", "0.63392836", "0.6329175", "0.63267", "0.6326573" ]
0.0
-1
Extract the name from a command
public function extract($command);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getName() {\n return $this->commandName;\n }", "public function getCommand(string $command);", "public function getNameForCommand($command): string\n {\n return get_class($command);\n }", "abstract public function getCommand(string $name): string;", "public function extract($query)\n {\n $queryName = get_class($query);\n\n if (!$queryName) {\n throw CannotDetermineCommandNameException::forCommand($query);\n }\n\n return $queryName;\n }", "abstract protected function getClassName(CommandInterface $command);", "public function getCommand(): string\n {\n return $this->attributes->get('command', '');\n }", "public function command()\n {\n return $this->parseCommand()[0];\n }", "public function guessCommandName()\n {\n $prefix = $this->makePrefix();\n if ($prefix) {\n $prefix = sprintf('%s:', $prefix);\n }\n return sprintf('%s%s', $prefix, $this->makeName());\n }", "protected function extractCommand() {\n\t\t$queryPath = $this->getQueryPath();\n\t#\tif( count( $queryPath ) >= 2 )\n\t\t\treturn array_pop( $queryPath );\n\t#\treturn current( $queryPath );\n\t}", "public function getHandlerNameForCommandName(string $commandName): string;", "public function getCommandIdentifier() {}", "protected function resolveCommandMethodName() {}", "public function getCommand(): string\n {\n return $this->command;\n }", "public function getCommand(): string\n {\n return $this->command;\n }", "public function getFullCommand(): string\n {\n return \"/{$this->request->command} {$this->name}\";\n }", "protected function getCommandName($name)\n {\n if (!Str::startsWith($name, 'command.')) {\n $name = \"command.$name\";\n }\n\n return str_replace(':', '.', $name);\n }", "public static function getCliName();", "public function getCommand() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"command\", NULL);\n\t}", "protected function getName()\n {\n return $this->arguments['name'];\n }", "public function hookAddCommandName($result, CommandData $commandData)\n {\n $annotationData = $commandData->annotationData();\n return \"$result from \" . $annotationData['command'];\n }", "abstract public function getCommandName();", "protected function getNameInput()\n {\n switch (trim($this->argument('name'))) {\n case 'repository':\n return 'Repository';\n break;\n case 'service':\n return 'Service';\n break;\n }\n }", "public function getCommand();", "public function getName()\n\t{\n\t\treturn $this->process;\n\t}", "private function get_current_command() {\n\t\t$runner = new RunnerInstance();\n\n\t\treturn implode( ' ', (array) $runner()->arguments );\n\t}", "public function clientGetname() {\n return $this->returnCommand(['CLIENT', 'GETNAME']);\n }", "public function nameCommand()\n {\n $userName = $this->getFromName();\n if (!empty($this->e->getParams())) {\n $newName = implode(' ', $this->e->getParams());\n $this->reply($userName . ' теперь известен как ' . $newName);\n } else {\n $newName = $userName;\n $this->reply($userName . ' теперь использует имя по-умолчанию');\n }\n $this->setUserName($this->getUserId(), $newName);\n }", "protected function getSetupName()\n {\n return strtolower($this->argument('name'));\n }", "public function getCommand() {}", "public function getCommandText();", "public function getCommand()\n {\n return $this->getPath() . \" -\" . $this->getFlags();\n }", "protected function getNameInput()\n {\n return class_basename(trim($this->argument('name')));\n }", "protected function getNameInput()\n {\n return preg_replace('/Endpoint$/', '', trim($this->argument('name'))) . \"Endpoint\";\n }", "protected function getCommandName(InputInterface $input)\n {\n $name = $input->getFirstArgument('command');\n return $name ? $name : 'project:run';\n }", "function cli_get_process_title()\n{\n}", "public function getCommand() {\n return $this->getValue(self::FIELD_COMMAND);\n }", "protected function _getTaskName()\n {\n $name = explode(':', $this->getName());\n\n return $name[1];\n }", "public function getToolCommand(): string;", "public static function getToolName();", "abstract protected function getCommand();", "protected function getNameInput(): string\n {\n return trim($this->argument('name')) . $this->type;\n }", "protected function getCommandName(InputInterface $input)\n {\n try {\n $this->find($input->getFirstArgument());\n return parent::getCommandName($input);\n } catch (\\InvalidArgumentException $e) {\n $this->getDefinition()->setArguments(array());\n return 'phlexget';\n }\n }", "public function command(): string;", "function getCommand($text)\r\n{\r\n\t$cmd = strtolower(substr($text, 0, 4));\r\n\tswitch ($cmd)\r\n\t{\r\n\t\tcase '/me ':\r\n\t\tcase '\\me ':\r\n\t\t\t$command = 'action';\r\n\t\t\tbreak;\r\n\t\tcase 'http':\r\n\t\tcase 'www.':\r\n\t\t\t$command = 'link';\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t$command = false;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\treturn $command;\r\n}", "public function getCommand()\n {\n return $this->command;\n }", "public function getCommand()\n {\n return $this->command;\n }", "public function getCommand()\n {\n return $this->command;\n }", "public function getCommand()\n {\n return $this->command;\n }", "public function getCommandName(): string;", "public function getCommand() {\n return $this->command;\n }", "public function getCommand() {\n\t\t$command = $this->extractCommand() .'Action';\n\n\t\tif( $this->_verbose )\n\t\t\t$this->set( '_command', $command );\n\n\t\treturn $command;\n\t}", "public function getCommand()\n {\n }", "public function getTargetCmd() {\n if(!$this->isTargetInternal())\n return null;\n\n $c = $this->cutTarget();\n return strtolower($c['cmd']);\n }", "private function _getFullCommand()\n {\n $parts = preg_split('/\\s+/', $this->job);\n reset($parts);\n $first = current($parts);\n unset($parts[key($parts)]);\n ob_start();\n passthru(\"which $first\", $ret);\n $fullcommand = trim(ob_get_clean());\n if ($ret == 0 && substr($fullcommand, 0, 1) == '/') {\n return trim($fullcommand . ' ' . join(' ', $parts));\n } else {\n $root = $this->_root;\n if ($this->_root) {\n $root = rtrim($this->_root, DIRECTORY_SEPARATOR);\n $root .= DIRECTORY_SEPARATOR;\n }\n return trim($root . $this->job);\n }\n }", "public function getCommand() {\n\t\treturn $this->command;\n\t}", "public function command()\n {\n return $this->command;\n }", "public function getNameInput()\n {\n return trim($this->argument('name'));\n }", "protected function getNameInput()\n {\n return trim($this->argument('name'));\n }", "public function getCommand()\n {\n return $this->_command;\n }", "public function get_name();", "public function get_name();", "public function get_name();", "function get_name() {\n\t\treturn $this->get_name_from_vtec();\t\n\t}", "public static function get_name() : string ;", "public static function get_name() : string ;", "protected function getNameInput()\n {\n return trim($this->argument('name') . 'Controller');\n }", "public function getCommand() {\n\t\treturn $this->_command;\n\t}", "public function getCommandCaption()\n {\n return $this->commandCaption;\n }", "abstract public function get_name();", "abstract public function get_name();", "abstract public function get_name();", "protected function getNameInput()\n {\n $name = trim($this->argument('name'));\n $name = ends_with($name, config('adr.postfix.responders', '')) ? $name : $name . config('adr.postfix.responders', '');\n\n return $name;\n }", "public function getMigrationName()\n {\n return $this->argument('name');\n }", "public function getCommand()\n {\n return sprintf('use %s', $this->_tube);\n }", "public static function classify($command) {\n\t\treturn str_classify($command) . 'Command';\n\t}", "protected function getServiceName()\n {\n return $this->argument('service');\n }", "protected function getTaskName()\n {\n return str_replace(' ', '', lcfirst(ucwords(str_replace('-', ' ', $this->executableName))));\n }", "public function getTokenName();", "public function getParameterName();", "function getName() ;", "function getName() ;", "function getName() ;", "function getName() ;", "public function getName(){\n return $this->game->get_current_turn()->ReturnName();\n }", "public function inflect(ICommand $command);", "public static function getCmd($name, $default = '', $hash = 'default')\n {\n return static::getVar($name, $default, $hash, 'cmd');\n }", "private function getCommandClassName($name)\r\n {\r\n $name = mb_convert_case($name[0], MB_CASE_UPPER, 'utf-8') . mb_substr($name, 1, mb_strlen($name));\r\n $drivername = $this->getDriverName();\r\n\r\n $classnameLocal = sprintf('\\MrsJoker\\Trade\\%s\\Commands\\%s', $drivername, ucfirst($name));\r\n\r\n if (class_exists($classnameLocal)) {\r\n return $classnameLocal;\r\n }\r\n\r\n throw new NotSupportedException(\r\n \"Command ({$name}) is not available for driver ({$drivername}).\"\r\n );\r\n\r\n }", "public function get_name($multicall = false, $update = false)\n\t{\n\t\treturn $this->get_info('d.get_name', $multicall, $update);\n\t}", "public function getArgument(string $name);", "public function translate($command)\n {\n $args = explode('-', $command);\n foreach ($args as & $a) {\n $a = ucfirst($a);\n }\n return join('', $args) . 'Command';\n }", "public function getNodename();", "public function getName()\n {\n return $this->__call(__FUNCTION__, func_get_args());\n }", "protected function getNameInput()\n {\n if ($this->option('r')) {\n $name = trim($this->argument('name'));\n } else {\n $explode = explode('.', trim($this->argument('name')));\n $name = $explode[count($explode) - 1];\n }\n return Str::slug($name);\n }", "public function command()\n\t{\n\t\treturn $this->command;\n\t}", "public function command()\n\t{\n\t\treturn $this->command;\n\t}", "public function findCommand($name) {\n $query = $this->pdo->prepare('SELECT * FROM yubnub.commands WHERE lowercase_name = :lowercaseName');\n $query->bindValue(':lowercaseName', mb_strtolower($name), PDO::PARAM_STR);\n $query->execute();\n if ($query->rowCount() > 0) {\n $row = $query->fetch(PDO::FETCH_ASSOC);\n return $this->createCommand($row);\n }\n return null;\n }", "public function getTaskCmd()\n {\n return $this->get(self::TASK_CMD);\n }", "public function getCommand()\n {\n return $this->oCommand;\n }", "public function getNamedStringArgument($name);" ]
[ "0.73453", "0.68253034", "0.6812682", "0.67464113", "0.673621", "0.6676813", "0.66433746", "0.66301733", "0.65133256", "0.64394903", "0.6413281", "0.63884133", "0.6374593", "0.63556343", "0.63556343", "0.6349746", "0.631577", "0.62117666", "0.619223", "0.61601424", "0.6114623", "0.6095688", "0.6089816", "0.6072319", "0.6067837", "0.60592896", "0.60495055", "0.60457325", "0.6042438", "0.60332495", "0.60168165", "0.59923434", "0.59830034", "0.59769946", "0.5959107", "0.59428", "0.59417325", "0.5913416", "0.5901229", "0.5861964", "0.5857901", "0.58398855", "0.5812609", "0.57984215", "0.57934886", "0.5789199", "0.5789199", "0.5789199", "0.5789199", "0.5783997", "0.5755896", "0.5745506", "0.5738751", "0.57379514", "0.5736539", "0.5735691", "0.5733185", "0.5723432", "0.57105017", "0.5705118", "0.56989634", "0.56989634", "0.56989634", "0.5692348", "0.5671702", "0.5671702", "0.5669579", "0.56473404", "0.5646946", "0.56467843", "0.56467843", "0.56467843", "0.56408817", "0.5640578", "0.5640218", "0.56356955", "0.5631464", "0.56311375", "0.5624952", "0.56108326", "0.560999", "0.560999", "0.560999", "0.560999", "0.5606333", "0.5601012", "0.5596523", "0.5588363", "0.55876315", "0.55732703", "0.5569877", "0.5569726", "0.5566493", "0.5565481", "0.5558244", "0.5558244", "0.55538243", "0.5550882", "0.55478907", "0.55418706" ]
0.60944587
22
Method returning the class name
public function __toString() { return __CLASS__; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClassName();", "public function getClassName();", "public function getClassName() ;", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName()\n {\n return __CLASS__;;\n }", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}", "public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}", "public function getClassName() { return __CLASS__; }", "public static function getClassName() {\n\t\treturn get_called_class();\n\t}", "public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "public static function getClassName()\n {\n return get_called_class();\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public static function className() : string {\n return get_called_class();\n }", "public function getName()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "public function getClassName()\n {\n return $this->class_name;\n }", "public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}", "public function getName(): string\n {\n return __CLASS__;\n }", "public static function getClassName() {\n return get_called_class();\n }", "public function getClassname(){\n\t\treturn $this->classname;\n\t}", "public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}", "public function getClassName()\n {\n return $this->_sClass;\n }", "public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}", "protected function getClassName(): string\n {\n return $this->className;\n }", "public static function getClassName() {\n return self::$className;\n }", "public function getClassName(): string;", "public function getClassName() : string;", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function getClassName() : string\n {\n return $this->className;\n }", "public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }", "public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}", "public function getClassName() : string\n {\n\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public static function staticGetClassName()\n {\n return __CLASS__;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }", "public function getClassName() {\n\t\treturn $this->_className;\n\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }", "function getClassName()\n {\n // TODO: Implement getClassName() method.\n }", "public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }", "function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }", "public function getClass()\n {\n return $this->_className;\n }", "private function getClassName() {\n return (new \\ReflectionClass(static::class))->getShortName();\n }", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }", "public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }", "private function className () {\n $namespacedClass = explode(\"\\\\\", get_class($this));\n\n return end($namespacedClass);\n }", "public function getClass(): string\n {\n return $this->class;\n }", "public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }", "public function getClassName()\n\t{\n\t\tif (null === $this->_className) {\n\t\t\t$this->setClassName(get_class($this));\n\t\t}\n\t\t\n\t\treturn $this->_className;\n\t}", "public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }", "public static function className()\n\t{\n\t\treturn static::class;\n\t}", "public function toClassName(): string\n {\n return ClassName::full($this->name);\n }", "public function getName()\n {\n return static::CLASS;\n }", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "function getName()\n {\n return get_class($this);\n }", "public function className(): string\n {\n return $this->taskClass->name();\n }", "public static function getClassName($class)\n {\n return static::splitClassName($class)[1];\n }", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function toString()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "public function getNamespacedName()\n {\n return get_class();\n }", "protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}", "protected function getClassName()\n {\n return ucwords(camel_case($this->getNameInput())) . 'TableSeeder';\n }", "function getClassName($name)\n{\n return str_replace('_', ' ', snake_case(class_basename($name)));\n}", "public function getClassName(): ?string {\n\t\treturn Hash::get($this->_config, 'className');\n\t}", "public function __toString() {\n\t\treturn $this->className();\n\t}", "public static function name()\n {\n return lcfirst(self::getClassShortName());\n }" ]
[ "0.87522393", "0.87522393", "0.8751158", "0.87397957", "0.87397957", "0.87397957", "0.87397957", "0.8731564", "0.8696754", "0.8673495", "0.8638432", "0.8615335", "0.8603119", "0.8566906", "0.8562364", "0.8555002", "0.85503733", "0.85503733", "0.85425884", "0.8533183", "0.8529981", "0.85237026", "0.8502733", "0.8493115", "0.8491238", "0.8488943", "0.8484194", "0.847459", "0.8441478", "0.8418852", "0.8399611", "0.83950585", "0.83949184", "0.83853173", "0.8378261", "0.837777", "0.8372544", "0.8355432", "0.8355432", "0.83479965", "0.8325877", "0.8325877", "0.8312873", "0.83027107", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.82474744", "0.8242934", "0.8202995", "0.8185409", "0.8184752", "0.81829107", "0.81829107", "0.8176191", "0.81761754", "0.8162896", "0.8142928", "0.81323636", "0.8062757", "0.80528253", "0.8045769", "0.8033823", "0.8026215", "0.8001116", "0.79949147", "0.79779136", "0.79672754", "0.7957633", "0.790449", "0.78617185", "0.7860126", "0.7847096", "0.78195953", "0.7817044", "0.780094", "0.780094", "0.780094", "0.780094", "0.780094", "0.780094", "0.77821547", "0.7761565", "0.77588034", "0.7747239", "0.77409905", "0.77409905", "0.7710985", "0.76808393", "0.7670475", "0.76640886", "0.76514393", "0.76499707", "0.76323646", "0.76005036", "0.75937456" ]
0.0
-1
Handle search of users.
public function search(Request $request) { return User::where('email', 'like', $request->get('search_query').'%')->paginate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchUsers()\n {\n # Set tables to search to a variable.\n $tables = $this->getTables();\n # Set fields to search to a variable.\n $fields = $this->getFields();\n # Set search terms to a variable.\n $search_terms = $this->getSearchTerms();\n # Perform search.\n $this->performSearch($search_terms, $tables, $fields);\n }", "public abstract function find_users($search);", "function findusers() {\n $this->auth(SUPPORT_ADM_LEVEL);\n $search_word = $this->input->post('search');\n if($search_word == '-1'){ //initial listing\n $data['records'] = $this->m_user->getAll(40);\n } else { //regular search\n $data['records'] = $this->m_user->getByWildcard($search_word);\n }\n $data['search_word'] = $search_word;\n $this->load->view('/admin/support/v_users_search_result', $data);\n }", "public function search()\n {\n if (!$this->current_user->has_permission('USER_LIST')) {\n return redirect();\n }\n\n $view_data = [\n 'menu_active' => 'li_user'\n ];\n\n $pagination = [\n 'page' => (int) $this->input->get_or_default('p', 1),\n 'limit' => (int) $this->input->get_or_default('limit', PAGINATION_DEFAULT_LIMIT)\n ];\n\n $pagination['offset'] = ($pagination['page'] - 1) * $pagination['limit'];\n\n // Get list users\n $users = $this->_api('user')->search_list(array_merge($this->input->get(), [\n 'limit' => $pagination['limit'],\n 'offset' => $pagination['offset'],\n 'sort_by' => 'id',\n 'sort_position' => 'desc'\n ]), [\n 'with_deleted' => TRUE,\n 'point_remain_admin' => TRUE\n ]);\n\n if (isset($users['result'])) {\n $view_data['users'] = $users['result']['items'];\n $pagination['total'] = $users['result']['total'];\n }\n\n $view_data['search'] = $pagination['search'] = $this->input->get();\n $view_data['pagination'] = $pagination;\n $view_data['csv_download_string'] = '/user/download_csv?' . http_build_query($this->input->get());\n\n $this->_breadcrumb = [\n [\n 'link' => '/user/search',\n 'name' => 'ユーザー検索'\n ]\n ];\n\n return $this->_render($view_data);\n }", "public function searchUser_post()\n\t{\n\t\t$tokenData = validateAuthorizationToken($this->input->get_request_header('Authorization'));\n\t\tif($tokenData[\"status\"]) {\n\t\t\t$userId = $tokenData[\"data\"][\"userId\"];\n\t\t\t$user = $this->UserModel->getUserById($userId); // i dati dell'utente.\n\t\t\tif(count($user) <= 0) // utente non trovato con questo id\n\t\t\t\treturn $this->response(buildServerResponse(false, \"Token di accesso non valido. #5\"), 200);\n\n\t\t\t$searchQuery = $this->input->post('query');\n\t\t\t$result = $this->UserModel->searchUser($searchQuery, $userId);\n\t\t\treturn $this->response(buildServerResponse(true, \"ok\", array(\"searchResult\" => $result)));\n\t\t}\n\t\treturn $this->response(buildServerResponse(false, \"Errore autorizzazione.\"), 200);\n\t}", "public function advance_search($request,$user_id)\n\t{\n\t\t\t\n\t\t // USER/ANALYST NOT ABLE TO ACCESS THIS \n\t\t//\taccess_denied_user_analyst();\n\t\t\t$number_of_records =$this->per_page;\n\t\t\t$name = $request->name;\n\t\t\t$business_name = $request->business_name;\n\t\t\t$email = $request->email;\n\t\t\t$role_id = $request->role_id;\n\t\t\t\n\t\t\t//pr($request->all());\n\t\t\t//USER SEARCH START FROM HERE\n\t\t\t$result = User::where(`1`, '=', `1`);\n\t\t//\t$result = User::where('id', '!=', user_id());\n\t\t\t$roleIdArr = Config::get('constant.role_id');\n\t\t\t\n\t\t\t\n\t\t\tif($business_name!='' || $name!='' || $email!=''|| trim($role_id)!=''){\n\t\t\t\t\n\t\t\t\t$user_name = '%' . $request->name . '%';\n\t\t\t\t$business_name = '%' . $request->business_name . '%';\n\t\t\t\t$email_q = '%' . $request->email .'%';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// check email \n\t\t\t\tif(isset($email) && !empty($email)){\n\t\t\t\t\t$result->where('email','LIKE',$email_q);\n\t\t\t\t} \n\t\t\t\t// check name \n\t\t\t\tif(isset($name) && !empty($name)){\n\t\t\t\t\t\n\t\t\t\t\t$result->where('owner_name','LIKE',$user_name);\n\t\t\t\t}\n\t\t\t\tif(isset($business_name) && !empty($business_name)){\n\t\t\t\t\t\n\t\t\t\t\t$result->where('business_name','LIKE',$business_name);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//If Role is selected \n\t\t\t\tif(isset($role_id) && !empty($role_id)){\n\t\t\t\t\t$result->where('role_id',$role_id);\n\t\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t\t//\techo $result->toSql();\n\t\t\t\t\n\t\t\t // USER SEARCH END HERE \n\t\t\t }\n\t\t\t\n\t\t\tif($user_id){\n\t\t\t\t$result->where('created_by', '=', $user_id);\n\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t $users = $result->orderBy('created_at', 'desc')->paginate($number_of_records);\n\t\t\t\n\t\t\treturn $users ;\n\t}", "function searchAction() {\n\t\t$this->getModel()->setPage($this->getPageFromRequest());\n\t\t$this->getInputManager()->setLookupGlobals(utilityInputManager::LOOKUPGLOBALS_GET);\n\t\t$inData = $this->getInputManager()->doFilter();\n\t\t$this->addInputToModel($inData, $this->getModel());\n\t\t$oView = new userView($this);\n\t\t$oView->showSearchLeaderboard();\n\t}", "public function searchUsers(){\n\t\t$validator = Validator::make(Request::all(), [\n 'accessToken' => 'required',\n 'userId' => 'required',\n 'searchUser' => 'required',\n 'searchOption' => 'required'\n ]);\n if ($validator->fails()) {\n #display error if validation fails \n $this->status = 'Validation fails';\n $this->message = 'arguments missing';\n } else {\n \t$siteUrl=URL::to('/');\n\t\t\t$result=Request::all();\n\t\t\t$accesstoken = Request::get('accessToken');\n\t $user_id = Request::get('userId');\n\t\t\t$user_info = User::find($user_id);\n\t\t\tif(isset($user_info)){\n\t\t\t\t$user_id = $user_info->id;\n\t\t\t\t$location = $user_info->location;\t\n\t\t\t}else{\n\t\t\t\t$user_id = 0;\n\t\t\t\t$location = '';\n\t\t\t}\n\t\t\t$searchresult = array();\n\t\t\t$start =0; $perpage=10;\n\t\t\tif(!empty($user_info)){\n\t\t\t\tif($accesstoken == $user_info->site_token){\n\t\t\t\tif(!empty($result)) \n\t\t\t\t{\n\t\t\t\t\t$search = Request::get('searchUser');\n\t\t \t$searchOption = Request::get('searchOption');\n\t\t\t\t\tif($searchOption == 'People'){\n\t\t\t\t\t $searchqueryResult =User::where('id','!=',$user_id)->where('fname', 'LIKE', '%'.$search.'%')->orWhere('lname','LIKE', '%'.$search.'%')->orWhere('location','LIKE', '%'.$search.'%')->orWhere('summary','LIKE', '%'.$search.'%')->orWhere('headline','LIKE', '%'.$search.'%')->where('userstatus','=','approved')->orderBy('karmascore','DESC')->get();\n\t\t\t\t\t\tif(!empty($searchqueryResult)){\n\t\t\t\t\t \t\tforeach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t\t$receiver=$value->id;\n\t\t\t\t\t \t\t\t$receiverDetail = User::find($receiver);\n\t\t\t\t\t \t\t\t$meetingRequestPending = $receiverDetail->Giver()->Where('status','=','pending')->count();\n\t\t\t\t\t \t\t\t$commonConnectionData=KarmaHelper::commonConnection($user_id,$value->id);\n\t\t\t\t\t \t\t\t$getCommonConnectionData=array_unique($commonConnectionData);\n\t\t\t\t\t \t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\t\t$searchquery[$key]['meetingRequestPending']=$meetingRequestPending;\n\t\t\t\t\t \t\t\t$searchquery[$key]['noofmeetingspm']=$value->noofmeetingspm;\n\t\t\t\t\t \t\t}\n\t\t\t\t\t \t}\n\t\t\t\t\t \tif(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t\t\t\t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t\t\t\t\t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\t\t\t\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}elseif($searchOption == 'Skills'){\n\t\t\t\t\t\t$skillTag = array(); \n\t\t \t \t$searchqueryResult = DB::table('tags')\n\t\t\t\t\t ->join('users_tags', 'tags.id', '=', 'users_tags.tag_id')\n\t\t\t\t\t ->join('users', 'users.id', '=', 'users_tags.user_id')\n\t\t\t\t\t ->where('name', 'LIKE', $search)\n\t\t\t\t\t ->where('users.userstatus', '=', 'approved')\n\t\t\t\t\t ->where('users.id', '!=', $user_id)\t\t\t \n\t\t\t\t\t ->groupBy('users_tags.user_id')\n\t\t\t\t\t ->orderBy('users.karmascore','DESC')\n\t\t\t\t\t ->select('tags.name', 'tags.id', 'users_tags.user_id', 'users.fname', 'users.lname','users.karmascore', 'users.email', 'users.piclink', 'users.linkedinid', 'users.linkedinurl', 'users.location', 'users.headline')\n\t\t\t\t\t //->skip($start)->take($perpage)\n\t\t\t\t\t ->get();\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['name']=$value->name;\n\t\t\t\t\t \t\t$searchquery[$key]['id']=$value->id;\n\t\t\t\t\t \t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t if(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t\t\t\t foreach ($searchquery as $key => $value) {\n\t\t\t\t\t\t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($value->user_id)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\t\t\t\n\t\t\t\t\t\t\t\tforeach ($tags as $skillkey => $skillvalue) {\n\t\t\t \t \t\t\t$skillTag[$skillkey]['name'] = $skillvalue->name;\n\t\t\t \t \t\t}\n\t\t\t\t\t\t\t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $skillTag;\n\t\t\t \t \t\t//echo \"<pre>\";print_r($searchresult);echo \"</pre>\";die;\n\t\t \t \t\t}\t\n\t\t \t \t\t\n\t\t \t \t\t\n\t\t \t \t}\n\t\t \t}elseif($searchOption == 'Location'){\n\t\t\t\t\t\t$searchqueryResult = DB::select(DB::raw( 'select * from (select `users`.`fname`, `users`.`lname`, `users`.`piclink`, `users`.`linkedinid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`karmascore`, `users`.`headline`, `users`.`location`, `users`.`id` As user_id from \n\t\t\t\t\t\t\t\t\t\t\t\t`users` where location LIKE \"%'.$search.'%\" and `users`.`id` != '.$user_id.' and\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`userstatus` = \"approved\" union select `connections`.`fname`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`lname`, `connections`.`piclink`, `connections`.`networkid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`linkedinurl`, `connections`.`headline`, `connections`.`location`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users_connections`.`connection_id` from `connections`\n\t\t\t\t\t\t\t\t\t\t\t\t inner join `users_connections` on `connections`.`id` = `users_connections`.`connection_id`\n\t\t\t\t\t\t\t\t\t\t\t\t where location LIKE \"%'.$search.'%\" and `users_connections`.`user_id` = '.$user_id.') as \n\t\t\t\t\t\t\t\t\t\t\t\tresult group by result.linkedinid order by result.location limit 10 offset '.$start )); \t\n\t\t\t\t\t // print_r($searchqueryResult);die;\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t if(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}\n\t\t\t\t\telseif($searchOption == 'Groups'){\t\t\t\t\n\t\t\t\t\t\t$searchqueryResult = DB::table('groups')\n\t\t\t\t\t ->join('users_groups', 'groups.id', '=', 'users_groups.group_id')\n\t\t\t\t\t ->join('users', 'users.id', '=', 'users_groups.user_id')\n\t\t\t\t\t ->where('name', '=', $search)\n\t\t\t\t\t ->where('users.userstatus', '=', 'approved')\n\t\t\t\t\t ->where('users.id','<>',$user_id)\t\n\t\t\t\t\t ->groupBy('users_groups.user_id')\n\t\t\t\t\t ->orderBy('users.karmascore','DESC')\n\t\t\t\t\t ->select('groups.name', 'groups.id', 'users_groups.user_id', 'users.fname', 'users.lname', 'users.email', 'users.piclink', 'users.linkedinid', 'users.karmascore', 'users.location', 'users.headline')\n\t\t\t\t\t ->get();\n\t\t\t\t\t // print_r($searchqueryResult);die;\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n \t\t\t\t\t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t \t$searchquery[$key]['name']=$value->name;\n\t\t\t\t\t \t$searchquery[$key]['id']=$value->id;\n\t\t\t\t\t \t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t // echo \"<pre>\";print_r($searchquery);echo \"</pre>\";die;\n\t\t \t \tif(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}\n\t\t\t\t\telseif($searchOption == 'Tags'){\n\t\t\t\t\t\t$searchquery = DB::select(DB::raw( 'select * from (select `users`.`fname`, `users`.`lname`, `users`.`piclink`, `users`.`linkedinid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`linkedinurl`, `users`.`headline`, `users`.`location`, `users`.`id` from \n\t\t\t\t\t\t\t\t\t\t\t\t`users` where headline LIKE \"%'.$search.'%\" and `users`.`id` != '.$user_id.' and\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`userstatus` = \"approved\" union select `connections`.`fname`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`lname`, `connections`.`piclink`, `connections`.`networkid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`linkedinurl`, `connections`.`headline`, `connections`.`location`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users_connections`.`connection_id` from `connections`\n\t\t\t\t\t\t\t\t\t\t\t\t inner join `users_connections` on `connections`.`id` = `users_connections`.`connection_id`\n\t\t\t\t\t\t\t\t\t\t\t\t where headline LIKE \"%'.$search.'%\" and `users_connections`.`user_id` = '.$user_id.') as \n\t\t\t\t\t\t\t\t\t\t\t\tresult group by result.linkedinid order by result.location = \"'.$location.'\" desc limit 10 offset'.$start )); \t\n\t\t\t\t\t //echo \"<pre>\";print_r($searchresult);echo \"</pre>\";die;\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value->linkedinid;\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->status='Failure';\n\t\t\t\t\t\t$this->message='There is no such category';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'message'=>$this->message\n\t\t\t\t \t\n\t\t\t\t \t));\t\n\t\t\t\t\t}\n\t\t\t\t\tif(!empty($searchquery)){\n\t\t\t\t\t\t$this->status='Success';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'searchresult'=>$searchquery\n\t\t\t\t \t));\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->status='Success';\n\t\t\t\t\t\t$this->message='There is no data available';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'message'=>$this->message,\n\t\t\t\t \t'searchresult'=>$searchquery\n\t\t\t\t \t));\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//return $searchresult;exit;\n\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->status = 'Failure';\n\t \t$this->message = 'You are not a login user.';\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}else{\n\t\t\t\t$this->status = 'Failure';\n \t$this->message = 'You are not a current user.';\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn Response::json(array(\n\t\t\t \t'status'=>$this->status,\n\t\t\t \t'message'=>$this->message\n\t\t));\t\n\t\t\t\n\t}", "public function search()\n {\n $user = User::search('');\n dd($user);\n dd(request('keyword'));\n return ResponseHelper::createSuccessResponse([], 'Operation Successful');\n }", "public function users() {\n $matches = array();\n if ($name = $this->input->get('q')) {\n $users = ORM::factory('user')->where('site_id', $this->site->id)->like('searchname', text::searchable($name))->where('status', 1)->find_all();\n foreach ($users as $user) {\n if ($user->id != $this->user->id) { // Can't send a message to yourself.\n $matches[] = (object) array('id' => $user->id, 'name' => $user->name());\n }\n }\n }\n print json_encode($matches);\n die();\n }", "public function post_search(){\n\n\t\t$income_data \t\t= \tFiledb::_rawurldecode(json_decode(stripcslashes(Input::get('data')), true));\n\t\t$data \t\t\t\t= \tarray();\n\t\t$data[\"page\"] \t\t= \t'admin.users.search';\n\t\t$data[\"listing_columns\"] = static::$listing_fields;\n\t\t$data[\"users\"] \t\t= \tarray();\n\n\t\tif($income_data[\"value\"] && $income_data[\"field\"]){\n\n\t\t\t$type = (in_array($income_data[\"type\"], array('all', 'equal', 'like', 'soundex', 'similar'))) ? $income_data[\"type\"] : 'all';\n\t\t\t$type = ($type == 'equal') ? '=' : $type;\n\n\t\t\tif($type == 'all'){\n\t\t\t\t\n\t\t\t\t$data[\"users\"] \t= \tUsers::where($income_data[\"field\"], 'like', $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->or_where($income_data[\"field\"], 'soundex', $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->or_where($income_data[\"field\"], 'similar', $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->get(array_merge(static::$listing_fields, array('id')));\n\t\t\t\n\t\t\t}else{\n\n\t\t\t\t$data[\"users\"] \t= \tUsers::where($income_data[\"field\"], $type, $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->get(array_merge(static::$listing_fields, array('id')));\n\t\t\t}\n\n\n\t\t\tif(Admin::check() != 777 && $data[\"users\"]){\n\t\t\t\t\n\t\t\t\tforeach($data[\"users\"] as $row => $column) {\n\n\t\t\t\t\tif(isset($column->email)){\n\n\t\t\t\t\t \tlist($uemail, $domen) \t\t\t= \texplode(\"@\", $column->email);\n\t\t\t\t\t\t$data[\"users\"][$row]->email \t= \t\"******@\".$domen;\n\t\t\t\t\t\t$data[\"users\"][$row]->name \t\t= \t\"***in\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!$data[\"users\"]){\n\n\t\t\t\t$data[\"message\"] = Utilites::fail_message(__('forms_errors.search.empty_result'));\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t$data[\"message\"] = Utilites::fail_message(__('forms_errors.search.empty_request'));\n\t\t}\n\n\t\treturn (Request::ajax()) ? View::make($data[\"page\"], $data) : View::make('admin.assets.no_ajax', $data);\n\t}", "public function postSearchUsers()\n {\n \n \n $q = Input::get('q');\n $f = User::where( 'name' , 'LIKE' , '%'.$q.'%' )->get();\n \n return Response::json( $f );\n \n }", "function _search_user($params, $fields = array(), $return_sql = false) {\n\t\t$params = $this->_cleanup_input_params($params);\n\t\t// Params required here\n\t\tif (empty($params)) {\n\t\t\treturn false;\n\t\t}\n\t\t$fields = $this->_cleanup_input_fields($fields, \"short\");\n\n\t\t$result = false;\n\t\tif ($this->MODE == \"SIMPLE\") {\n\t\t\t$result = $this->_search_user_simple($params, $fields, $return_sql);\n\t\t} elseif ($this->MODE == \"DYNAMIC\") {\n\t\t\t$result = $this->_search_user_dynamic($params, $fields, $return_sql);\n\t\t}\n\t\treturn $result;\n\t}", "public function search()\n {\n $user = UserAccountController::getCurrentUser();\n if ($user === null) {\n return;\n }\n $view = new View('search');\n echo $view->render();\n }", "function search_user(){\n\t\trequire_once(\"dbconnection.php\");\n\t\t$obj=new dbconnection();\n\t\t$con=$obj->getcon();\n\t\t\n\t\t\n\t\t$dbh=$obj->get_pod();\n\n\t\t$search_by = $_POST['search_by'];\n\n\t\t$sqlget = \"SELECT * FROM users WHERE uname='$search_by';\";\n\t\t$resultget = mysqli_query($con,$sqlget) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget= mysqli_fetch_assoc($resultget);\n\n\t\techo json_encode($recget);\n\t\t\n\t}", "public function userSearch (Request $request)\n { $user = User::find(Auth::id());\n \n if($request->search != null){\n $search = family::ilike($request->search);\n \n return response()->json($search);\n }\n }", "public function search_user(Request $request){\n $search = $request->input('term');\n $users = User::where('name', 'like' , \"%$search%\")\n ->orwhere('username', 'like', \"%$search%\")\n ->get();\n return response()->json($users, 200);\n }", "public function searchUsersByQuery($request)\n {\n return $this->start()->uri(\"/api/user/search\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function incSearch() {\n\t\t$result = array();\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\tif ( $this->input->get( 'term' ) ) {\n\t\t\t\t/** @var \\wpdb $wpdb */\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$query = '%' . $this->input->get( 'term' ) . '%';\n\t\t\t\t$sql = <<<SQL\n\t\t\t\t\tSELECT SQL_CALC_FOUND_ROWS\n\t\t\t\t\t\tID, user_login, display_name\n\t\t\t\t\tFROM {$wpdb->users}\n\t\t\t\t\tWHERE user_login LIKE %s\n\t\t\t\t\t OR user_email LIKE %s\n\t\t\t\t\t OR display_name LIKE %s\n ORDER BY display_name ASC\n\t\t\t\t\tLIMIT 10\nSQL;\n\t\t\t\t$result = array_map( function ( $user ) {\n\t\t\t\t\t$user->avatar = get_avatar( $user->ID, '48', '', $user->display_name );\n\n\t\t\t\t\treturn $user;\n\t\t\t\t}, $wpdb->get_results( $wpdb->prepare( $sql, $query, $query, $query ) ) );\n\t\t\t}\n\t\t}\n\t\twp_send_json( $result );\n\t}", "public function searchUser()\n\t{\n\t\t$url = sprintf('%sUserSearch/search', self::HTTP_URL);\n\t\t$args = array(\n\t\t\t'query'\t\t=>\t$query,\n\t\t\t'offset'\t=>\t$offset\n\t\t);\n\n\t\t$this->setResultType(PlurkResponseParser::RESULT_SEARCH_USER);\n\t\treturn $this->sendRequest($url, $args);\n\t}", "public function actionSearch(){\n $q = htmlentities($_GET['q']);\n if(!empty($q)){\n $result = array();\n $users = Users::find()->where('display_name LIKE \"'.$q.'%\" AND active = 1 AND authKey IS NULL')->limit(5)->all();\n $ul = '<ul class=\"search-results-ul col-md-3\">';\n foreach ($users as $key => $value) {\n $ul .= '<li><a href=\"' . Url::to(['user/profile/'.$value->display_name]) . '\"><img src=\"' . \\Yii::getAlias('@web/images/users/'.$value->profilePic) . '\" height=\"30\" class=\"img-circle\" style=\"margin-right: 10px\"> '.$value->display_name.'</a></li>';\n }\n $ul .= '</ul>';\n echo $ul;\n }\n }", "public function users() {\n // Only works for ajax requests\n $this->onlyAjaxRequests();\n\n $search = $_POST['data'];\n $json['users'] = $this->userModel->searchUsers($search);\n\n if (!$json['users'])\n $json['message'] = 'No results';\n echo json_encode($json);\n }", "public function postSearching()\n\t{\n $latitude = Input::get('latitude');\n $longitude = Input::get('longitude');\n\n $latitude_range = $latitude * 2;\n\n\t\t$users = User::whereBetween('latitude', array($latitude, $latitude_range))->get();\n\n if (count($users)) {\n return Response::json(array('users' => $users,\n 'status' => 1));\n }\n\n return Response::json(array('messages' => 'No se encontraron usuarios',\n 'status' => 0));\n\n\t}", "public function userSearch()\n {\n $query = $this->input->post('query');\n $data['results'] = $this->admin_m->search($query);\n $data['query'] = $query;\n $data['content'] = 'admin/searchResults';\n $this->load->view('components/template', $data);\n }", "public function search(Request $request)\n {\n $searchTerm = $request->get('searchTerm');\n $users = UserResource::collection(User::searchUsersBySearchTerm($searchTerm)->get());\n if ($users->isEmpty()) {\n return JsonService::jsonError(\n 'There is no users found with this name!',\n 404\n );\n }\n return JsonService::jsonSuccess('Returning all for a users!', $users);\n }", "function search(){\n if ( $this->RequestHandler->isAjax() ) {\n Configure::write ( 'debug', 0 );\n $this->autoRender=false;\n $users=$this->User->find('all',array('conditions'=>array('User.name LIKE'=>'%'.$_GET['term'].'%')));\n $i=0;\n foreach($users as $user){\n $response[$i]['value']=$user['User']['name'];\n $response[$i]['label']=$user['User']['name'];\n $i++;\n }\n echo json_encode($response);\n }else{\n if (!empty($this->data)) {\n $this->set('users',$this->paginate(array('User.name LIKE'=>'%'.$this->data['User']['name'].'%')));\n }\n }\n }", "public function searchUser(){\n $this->validate(request(),[\n 'name' => 'required'\n ]);\n $users =User::where('name',request('name'))->orWhere('name', 'like', '%' . request('name') . '%')->get();\n return response()->json($users);\n }", "function lendingform_search_user($search = NULL) {\r\n \r\n $users = array();\r\n if (empty($search)) {\r\n $users = entity_load('user');\r\n } else {\r\n // Search users\r\n $users = entity_get_controller(PROJECT_ENTITY)->search_users($search);\r\n }\r\n \r\n $users_name_and_id = array();\r\n foreach ($users as $user) {\r\n $users_name_and_id[] = array(\r\n 'uid' => $user->uid,\r\n 'name' => lendingform_siemens_format_username($user),\r\n );\r\n }\r\n\r\n echo json_encode($users_name_and_id);\r\n \r\n exit();\r\n}", "public function search(){}", "private function searchMembers() {\n $searchStr = $this->postVars['memberSearch'];\n $searchStrArr = array();\n if(preg_match('/\\s/',$searchStr)) {\n $searchStrArr = explode(\" \", $searchStr);\n }\n \n if(empty($searchStrArr)) {\n $query = \"SELECT u.id\n FROM {$this->db->prefix}users AS u\n WHERE u.user_email = '$searchStr'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id AND n.nhc_pin = '$searchStr'\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name' AND um1.meta_value like '%$searchStr%'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name' AND um2.meta_value like '%$searchStr%'\";\n //JOIN {$this->db->prefix}usermeta um4 ON um4.user_id = u.id AND um4.meta_key = 'expiration_date' AND um4.meta_value = '$expireDate'\";\n }\n else { // looking specifically for a full name\n $query = \"SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name' AND um1.meta_value like '%{$searchStrArr[0]}%'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name' AND um2.meta_value like '%{$searchStrArr[1]}%'\";\n \n }\n \n $membersArr = $this->db->get_results($query, ARRAY_A);\n \n // filter through to weed out any duplicates\n $showArr = array();\n foreach($membersArr as $member) {\n if(!in_array($member['id'], $showArr)) {\n $showArr[] = $member['id'];\n }\n }\n $idStr = implode(\",\", $showArr);\n \n $query = \"SELECT DISTINCT u.id, n.nhc_pin, um1.meta_value AS first_name, um2.meta_value AS last_name, u.user_email, um3.meta_value AS level\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n JOIN {$this->db->prefix}usermeta um3 ON um3.user_id = u.id AND um3.meta_key = 'member_level'\n WHERE u.id IN ($idStr)\n ORDER BY n.nhc_pin\";\n \n $this->showResults($query, 'search', true);\n }", "function userListing()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n { \n $searchText = $this->security->xss_clean($this->input->post('searchText'));\n $data['searchText'] = $searchText;\n \n $this->load->library('pagination');\n \n $count = $this->user_model->userListingCount($searchText);\n\n\t\t\t$returns = $this->paginationCompress ( \"userListing/\", $count, 5 );\n \n $data['userRecords'] = $this->user_model->userListing($searchText, $returns[\"page\"], $returns[\"segment\"]);\n \n $this->global['pageTitle'] = 'Garuda Informatics : User Listing';\n \n $this->loadViews($this->view.\"users\", $this->global, $data, NULL);\n }\n }", "public function searchUsers(Request $request)\n {\n $searchText = $request->get('searchText');\n\n $searchTerms = explode(' ', $searchText);\n\n $query = DB::table('users');\n\n foreach($searchTerms as $term)\n {\n $query->where('name', 'LIKE', '%'. $term .'%');\n }\n\n $results = $query->take(10)->get();\n\n return response()->json($results, 200);\n }", "public function handle() {\n\t\tmylisting_check_ajax_referrer();\n\n\t\ttry {\n\t\t\t$page = ! empty( $_REQUEST['page'] ) ? ( absint( $_REQUEST['page'] ) - 1 ) : 0;\n\t\t\t$search = ! empty( $_REQUEST['search'] ) ? sanitize_text_field( $_REQUEST['search'] ) : '';\n\t\t\t$per_page = 25;\n\n\t\t\t$args = [\n\t\t\t\t'number' => $per_page,\n\t\t\t\t'offset' => $page * $per_page,\n\t\t\t\t'fields' => [ 'ID', 'user_login', 'display_name' ],\n\t\t\t\t'orderby' => 'display_name',\n\t\t\t\t'order' => 'ASC',\n\t\t\t];\n\n\t\t\tif ( ! empty( trim( $search ) ) ) {\n\t\t\t\t$args['search'] = '*'.trim( $search ).'*';\n\t\t\t}\n\n\t\t\t$users = get_users( $args );\n\t\t\tif ( empty( $users ) || is_wp_error( $users ) ) {\n\t\t\t\tthrow new \\Exception( _x( 'No users found.', 'Users dropdown list', 'my-listing' ) );\n\t\t\t}\n\n\t\t\t$results = [];\n\t\t\tforeach ( $users as $user ) {\n\t\t\t\t$results[] = [\n\t\t\t\t\t'id' => $user->ID,\n\t\t\t\t\t'text' => $user->display_name,\n\t\t\t\t];\n\t\t\t}\n\n\t\t\twp_send_json( [\n\t\t\t\t'success' => true,\n\t\t\t\t'results' => $results,\n\t\t\t\t'more' => count( $results ) === $per_page,\n\t\t\t\t'args' => \\MyListing\\is_dev_mode() ? $args : [],\n\t\t\t] );\n\t\t} catch ( \\Exception $e ) {\n\t\t\twp_send_json( [\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t] );\n\t\t}\n\t}", "public function getSearchUser($value)\n {\n $users = User::where(function ($q) use ($value) {\n return $q->where('username', 'like', '%' . $value . '%');\n })->latest()->take(10)->get(); //end of users obj\n if ($value == '*.*') {\n return redirect()->route('user.getUser');\n }\n return response()->json($users);\n }", "public function actionSearch($s) {\n //redirect a user if not super admin\n if (!Yii::$app->CustomComponents->check_permission('all_users')) {\n return $this->redirect(['site/index']);\n }\n $s = trim($s);\n if (preg_match(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$^\", $s)) {\n $squery = DvUsers::find()->where(['email' => $s, \"status\" => 1])->all();\n } else {\n $sq = explode(\" \", $s);\n $size = sizeof($sq);\n if ($size > 1) {\n $squery = DvUsers::find()->orWhere(['first_name' => $sq[0]])->orWhere(['first_name' => $sq[1]])->orWhere(['last_name' => $sq[0]])->orWhere(['last_name' => $sq[1]])->andWhere([\"status\" => 1])->all();\n } else {\n $squery = DvUsers::find()->orWhere(['first_name' => $s])->orWhere(['last_name' => $s])->andWhere([\"status\" => 1])->all();\n }\n }\n return $this->render('index', [ 'users' => $squery, 'total_records' => '1']);\n }", "public function searchUsersByQueryString($request)\n {\n return $this->start()->uri(\"/api/user/search\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function findUsers();", "public function findUsers();", "public function searchReader()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$text = $_POST['text'];\n\t\t\t$type = $_POST['type'];\n\t\t\t//$return = array();\n\t\t\t$book = D('User');\n\n\t\t\t$sql = \"SELECT * FROM lib_user\n\t\t\t\t\t where {$type} like '%{$text}%' ORDER BY register_time DESC;\";\n\t\t\t$return = $book->query($sql);\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'No Result'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "public function admin_get_users(){\n $limit = $this->input->get('length');\n $offset = $this->input->get('start');\n $search = $this->input->get('search')['value'];\n echo $this->usm->get_users($limit, $offset, $search);\n }", "public function search(Request $request){//+\n // Get the search value from the request\n $authid = Auth::user()->id;\n $search = $request->input('search');\n\n // Search in the title and body columns from the posts table\n $users = User::select('id','name', 'surname', 'email')->where(DB::raw('concat(name,\" \",surname)'), 'LIKE', \"%{$search}%\")\n ->whereNotIn('id', Auth::user()->notFriendSender->modelKeys())->whereNotIn('id', Auth::user()->notFriendReceiver->modelKeys())->get();\n\n // Return the search view with the resluts compacted\n return view('users.search', compact('users','authid'));\n }", "public function actionSearch()\n {\n $model = new User(['scenario' => User::SCENARIO_SEARCH]);\n\n return $this->renderAjax('search', [\n 'model' => $model,\n ]);\n }", "function index()\n\t{\n\t\t$this->form_validation->set_rules('search', 'search field', 'required');\n\t\tif ($this->form_validation->run() == true) {\n\t\t\t$search = $this->input->post('search');\n\t\t\tredirect('/user/search/' . urlencode($search));\n\t\t}\n\t\t$user = $this->auth->user();\n\t\tif($user) {\n\t\t\tredirect('/user/' . $user->id);\n\t\t} else {\n\t\t\tredirect('/user/register');\n\t\t}\n\t}", "public function retrieve_users()\n {\n $search_query = Request::post(self::PARAM_SEARCH_QUERY);\n \n // Set the conditions for the search query\n if ($search_query && $search_query != '')\n {\n $conditions[] = Utilities::query_to_condition(\n $search_query, \n array(\n new PropertyConditionVariable(User::class_name(), User::PROPERTY_USERNAME), \n new PropertyConditionVariable(User::class_name(), User::PROPERTY_FIRSTNAME), \n new PropertyConditionVariable(User::class_name(), User::PROPERTY_LASTNAME)));\n }\n \n // Only include active users\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(User::class_name(), User::PROPERTY_ACTIVE), \n new StaticConditionVariable(1));\n \n // Combine the conditions\n $count = count($conditions);\n if ($count > 1)\n {\n $condition = new AndCondition($conditions);\n }\n \n if ($count == 1)\n {\n $condition = $conditions[0];\n }\n \n $this->user_count = DataManager::count(User::class_name(), $condition);\n $parameters = new DataClassRetrievesParameters(\n $condition, \n 100, \n $this->get_offset(), \n array(\n new OrderBy(new PropertyConditionVariable(User::class_name(), User::PROPERTY_LASTNAME)), \n new OrderBy(new PropertyConditionVariable(User::class_name(), User::PROPERTY_FIRSTNAME))));\n \n return DataManager::retrieves(User::class_name(), $parameters);\n }", "function search_for_users($needle)\n {\n $needle = trim($needle);\n if ($needle != '')\n {\n $user = $this->ion_auth->get_user();\n\n $query_string = \"SELECT user_meta.user_id, user_meta.first_name, user_meta.last_name, user_meta.grad_year, school_data.school\n FROM user_meta LEFT JOIN school_data ON user_meta.school_id = school_data.id\n WHERE MATCH(user_meta.first_name, user_meta.last_name) AGAINST (? IN BOOLEAN MODE)\n AND user_meta.user_id <> ?\";\n\n // Generate a string to exclude people the user is already following.\n $following_ids = $this->get_following_ids();\n if (count($following_ids) > 0)\n {\n $query_string .= \" AND user_meta.user_id <> '\" . implode(\"' AND user_meta.user_id <> '\", $following_ids) . \"'\";\n }\n $query_string .= ' LIMIT 15';\n\n $query = $this->db->query($query_string, array(str_replace(' ', '* ', $needle) . '*', $user->id));\n\n // Echo the results\n foreach ($query->result() as $row)\n {\n $this->echo_user_entry($row, 'add following', $profile_links_enabled = false);\n }\n }\n }", "Public Function searchUsers($Search = false)\n\t{\n\t\t$Output = array();\n\t\tif($Search === false)\n\t\t\treturn $Output;\n\t\t\t\n\t\t$Users = $this->_db->fetchAll(\"SELECT bevomedia_user.id as id FROM bevomedia_user LEFT JOIN bevomedia_user_info ON bevomedia_user_info.id = bevomedia_user.id\n\t\t\t\t\tWHERE (\tfirstName LIKE '%$Search%' OR lastName LIKE '%$Search%' OR \n\t\t\t\t\t\t\temail LIKE '%$Search%' OR comments LIKE '%$Search%' OR \n\t\t\t\t\t\t\twebsite LIKE '%$Search%' OR messengerHandle LIKE '%$Search%'\n\t\t\t\t\t\t\t)\");\n\t\tforeach($Users as $User)\n\t\t\t$Output[] = new User($User->id);\n\t\t\t\n\t\treturn $Output;\n\t}", "public function manage(){\n if($this->request->data!=null){\n $search = '%'.$this->request->data['User']['searchstring'].'%';\n } else {\n $search ='%%';\n }\n\n $this->paginate = array (\n 'conditions' => array(\n 'User.status' => 1,\n 'User.role' =>'author',\n 'User.username LIKE' => $search\n ),\n 'limit' => 10,\n 'order' => array('User.created'=>'DESC')\n );\n\n $this->set('users',$this->paginate());\n }", "public function index(Request $request)\n {\n if(Auth::user()->level == 1) {\n $keyword = '';\n if($keyword=$request->search){\n $list=User::orderBy('id','ASC')\n ->where(function ($query) use ($keyword){\n $query->orwhere('name','like',\"%$keyword%\")\n ->orwhere('email','like',\"%$keyword%\"); \n })\n ->paginate(5);\n } else {\n $list=User::orderBy( 'id', 'ASC' )\n ->paginate(5);\n }\n \n return view('admin.user.list',['list'=>$list,'keyword'=>$keyword]);\n } else {\n return redirect('admin');\n }\n }", "function userSearch($query, $count = null) {\n\n \t$user_search_request_url = sprintf($this->api_urls['user_search'], $query, $this->access_token, $count);\n \t\n \treturn $this->__apiCall($user_search_request_url);\n \t\n }", "public function search(Request $request)\n {\n try {\n $username = $request->name;\n $user_id = Auth::user()->id;\n\n $users = DB::select(\"SELECT o.name AS 'occupation', u.name, u.id, ru.accepted, u.profile_image_thumbnail_filename FROM users AS u\n INNER JOIN occupations AS o ON o.id = u.occupation_id\n LEFT JOIN relationships_users AS ru ON (u.id = ru.requester_id OR u.id = ru.responder_id) AND (ru.responder_id = ? OR ru.requester_id = ?)\n WHERE u.name LIKE '{$username}%'\", [$user_id, $user_id, $username]);\n\n $relationship_options = Relationship::all();\n\n $html = view('snippets.dashboard.relationships.user_search_result', compact('users', 'relationship_options'))->render();\n return response()->json(array('status' => 'success', 'html' => $html, 'users' => $users));\n } catch(Exception $e) {\n return response()->json(array('status' => 'error'));\n }\n\n }", "public function searchUsers($ids)\n {\n return $this->start()->uri(\"/api/user/search\")\n ->urlParameter(\"ids\", $ids)\n ->get()\n ->go();\n }", "public function search() {\n if (!Request::get('s')) {\n return view('home.layout');\n }\n\n SearchHistory::record_user_search(\n Request::get('s'),\n Auth::user() ? Auth::user()->id : -1\n );\n\n return view('search.layout', [\n 'results' => $this->get_search_results(\n Request::get('s')\n )\n ]);\n }", "public function index(request $request)\n { \n $empid = $request->input('search-id');\n $users = $empid ? User::searchId($empid)->paginate(10) : User::paginate(10);\n return view('admin.user.index')->withUsers($users)->withSearch($empid);\n }", "public function searchUser($input) {\n $q = User::query()\n ->with('profilepic')\n ->with('UserInfo')\n ->with('roles');\n $q->OfKeyword($input);\n $roles = array('ServiceProvider', 'Distributor');\n $q->OfRolesin($roles);\n return $q->get();\n }", "private function _searchUsers( array $aGet=array() ) {\n \n $_aArgs = $aGet + array(\n 'number' => 100, // the maximum number to return.\n );\n \n // Set the callback to modify the database query string.\n add_action( 'pre_user_query', array( $this, '_replyToModifyMySQLWhereClauseToSearchUsers' ) );\n \n $_oResults = new WP_User_Query( $_aArgs );\n\n // Format the data\n $_aData = array();\n foreach( $_oResults->results as $_iIndex => $_oUser ) {\n $_aData[ $_iIndex ] = array(\n 'id' => $_oUser->ID,\n 'name' => $_oUser->data->display_name,\n );\n } \n return $_aData;\n \n }", "public function search() {\n\t\t// Use the list members view\n\t\t$this->view = 'list_members';\n\n\t\t// If search term is not set, list all the members\n\t\tif (!isset($this->params['url']['query'])) {\n\t\t\treturn $this->redirect( array('controller' => 'members', 'action' => 'listMembers') );\n\t\t}\n\n\t\t$keyword = trim($this->params['url']['query']);\n\n\t\t$this->__paginateMemberList($this->Member->getMemberSummaryForSearchQuery(true, $keyword));\n\t}", "public function searchUsers($search) {\n $userDAO = new UserDAO();\n return $userDAO->retrieveUserSearch($search);\n }", "public function index()\n {\n $search = request()->query('search');\n if ($search) {\n $users = DB::table('users')\n ->select('id', 'name', 'email', 'created_at')\n ->where('name', 'LIKE', '%' . $search . '%')\n ->orWhere('email', 'LIKE', '%' . $search . '%')\n ->paginate(30);\n } else {\n $users = DB::table('users')\n ->select('id', 'name', 'email', 'created_at')\n ->paginate(30);\n }\n\n return view('admin.user.index', ['users' => $users])->with('no', 1);\n }", "public function search_user(Request $request, User $user){\n if ((Gate::allows('admin'))) {\n $data_form = $request->except('_token');\n $users = $user->search_user($data_form)->get();\n $action = $data_form['action'];\n return view('admin.records.employee_record', compact('users', 'action'));\n } else {\n return redirect()->route('navigation.home');\n }\n }", "public function search();", "public function search();", "public function search(Request $request)\n\t{\n\t\t$status = 'error';\n\t\t$message = 'user_not_found';\n\t\t$code = 500;\n\t\t$data = null;\n\n\t\t$user = User::where('document', $request->document)\n\t\t\t->where('phone', $request->phone)\n\t\t\t->first();\n\n\t\tif ($user) {\n\t\t\t$user->wallet = Wallet::where('user_id', $user->id)->first();\n\t\t\t$data = $user;\n\n\t\t\t$code = 200;\n\t\t\t$status = 'success';\n\t\t\t$message = 'user_found';\n\t\t}\n\n\t\treturn response()->json([\n\t\t\t'status' => $status,\n\t\t\t'message' => $message,\n\t\t\t'data' => $data\n\t\t], $code);\n\t}", "public function index()//Request $request)\n {\n /*\n $search_entry = $request -> search_entry;\n if ($search_entry != NULL OR $search_entry != '')\n {\n $search_values = preg_split('/\\s+/', $search_entry, -1, PREG_SPLIT_NO_EMPTY);\n $users = User::where(function($query) use($search_values) {\n foreach ($search_values as $value) {\n $query -> orWhere('first_name', 'like', \"%{$value}%\")\n ->orWhere('first_surname', 'like', \"%{$value}%\")\n ->orWhere('email', 'like', \"%{$value}%\")\n ->orWhere('document', 'like', \"%{$value}%\");\n }\n })-> paginate(8)->unique('document_number') ;\n $search_placeholder = 'Results for '.$search_entry;\n return view('applications.index') -> with('applications', $applications) -> with('search_placeholder', $search_placeholder);\n } else\n {\n */\n $users = User::all();//::paginate(8)->all();\n //->unique('document_number');\n return view('applications.index') -> with('users', $users);\n //}\n }", "public function searchUsers(Request $request)\n {\n //\n $ids = collect(User::search($request->q)->take(500)->get())->pluck('id');\n\n $data = User::orderBy('created_at', 'desc')\n ->whereIn('id', $ids)\n ->whereHas('roles', function ($q) {\n $q->where('name', '<>', 'Super-admin');\n })\n ->with('roles')\n ->with(['tokens' => function ($q) {\n $q->where('revoked', false);\n }])\n ->withTrashed()\n ->paginate(10);\n\n return new UserCollection($data, User::getActiveUsers(), User::getTotalUsersCount(), User::getNewUsersToday()); \n }", "public function refreshUserSearchIndex()\n {\n return $this->start()->uri(\"/api/user/search\")\n ->put()\n ->go();\n }", "public function searchUserAction($header_data,$unique_id){\n try {\n if(empty($unique_id)) {\n Library::output(false, '0', WRONG_UNIQUE_ID, null);\n } else {\n $db = Library::getMongo();\n \n $user_info = $db->execute('return db.users.find({ $or:[ {\"unique_id\" : \"'.$unique_id.'\"},{\"unique_id\" : \"'.strtolower($unique_id).'\"}], is_searchable : 1, is_active:1, is_deleted : 0 }).toArray()');\n if($user_info['ok'] == 0) {\n Library::logging('error',\"API : searchUser (user info) , mongodb error: \".$user_info['errmsg'].\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n if(isset($user_info['retval'][0])) {\n if( empty($user_info['retval'][0][\"hidden_contacts\"]) || !in_array( $header_data['id'], $user_info['retval'][0][\"hidden_contacts\"]) ){\n $isFriend = false;\n $result['id'] = (string)$user_info['retval'][0]['_id'];\n $result['username'] = $user_info['retval'][0]['username'];\n $result['profile_pic'] = FORM_ACTION.$user_info['retval'][0][\"profile_image\"];\n if(isset($user_info['retval'][0][\"running_groups\"])) {\n foreach($user_info['retval'][0][\"running_groups\"] as $user_ids) {\n if($user_ids['user_id'] == $header_data['id']) {\n $isFriend = true; \n break;\n }\n }\n }\n $result['isFriend'] = $isFriend;\n Library::output(true, '1', \"No Error\", $result);\n }\n }\n Library::output(false, '0', NO_USER_FOUND, null);\n }\n } catch(Exception $e) {\n Library::logging('error',\"API : searchUser : \".$e.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n }", "private function searchUsers($userCollection, $filter)\t{\n trace('[CMD] '.__METHOD__);\n\n\t\t$filterlist = $filter->getDataArray();\n\t\t$searchlist = array();\n\t\t$exactMatch = false;\n\t\t$specified = false;\n\t\t$result = '';\n\t\tforeach ($filterlist as $key => $value) {\n\t\t\tif ($value == '') {\n\t\t\t\t// ignore empty search fields\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tswitch ($key) {\n\t\t\t\tcase 'gsa_kundnr':\n\t\t\t\t\t// special case; find gsauid by gsa_kundnr\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'exactMatch':\n\t\t\t\t\t// switch match mode\n\t\t\t\t\t$exactMatch = $value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t// copy field to searchlist\n\t\t\t\t\t$specified = true;\n\t\t\t\t\t$searchlist[$key] = $value;\n\t\t\t}\n\t\t}\n\t\tif (! $specified) {\n\t\t\t$result = $this->pi_getLL('msg_searchreq', '[msg_searchreq]');\n\t\t}\n\t\telse {\n\t\t\t$cnt = $userCollection->loadBySearchlist($searchlist, $exactMatch, self::MAX_SEARCHRESULTS);\n\t\t\tif ($cnt > self::MAX_SEARCHRESULTS) {\n\t\t\t\t// to many hits, complain\n\t\t\t\t$result = $this->pi_getLL('msg_toomany', '[msg_toomany]');\n\t\t\t}\n\t\t\telse if (! $cnt) {\n\t\t\t\t// nothing found, complain\n\t\t\t\t$result = $this->pi_getLL('msg_notfound', '[msg_notfound]');\n\t\t\t}\n\t\t}\n\t\ttrace($result);\n\t\treturn $result;\n\t}", "public function testSearchUser()\n {\n echo \"\\nTesting user search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users?search=Vicky\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/users?search=Vicky\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "function userListing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $searchText = $this->input->post('searchText');\n $searchStatus = $this->input->post('searchStatus');\n\n $this->load->library('pagination');\n\n $count = $this->user_model->userListingCount($this->global['level'], $searchText);\n\n $returns = $this->paginationCompress(\"userListing/\", $count, 5);\n\n $data['userRecords'] = $this->user_model\n ->userListing($this->global['level'], $searchText, $searchStatus, $returns[\"page\"], $returns[\"segment\"]);\n\n $this->global['pageTitle'] = '人员管理';\n $data['searchText'] = $searchText;\n $data['searchStatus'] = $searchStatus;\n\n $this->loadViews(\"systemusermanage\", $this->global, $data, NULL);\n }\n }", "public function searchAction(Request $request){\n $em = $this->getDoctrine()->getManager();\n //Query en lenguaje sql\n \n $search = $request->query->get(\"search\",null);\n if($search == null){\n return $this->redirect($this->generateUrl(\"home_publication\"));\n }\n //notese el parametro search como es introducido en el query,\n //ojo con los espacios en los queries searchORDER BY (MAL), search ORDER BY (BIEN).\n $dql = \"SELECT u FROM BackendBundle:User u \"\n . \"WHERE u.name LIKE :search OR u.surname LIKE :search OR u.nick LIKE :search\"\n . \" ORDER BY u.id ASC\";\n //hacemos la consulta y la guardamos en $query\n $query = $em->createQuery($dql)->setParameter(\"search\",\"%$search%\");\n \n //obtenemos una instancia de paginator d knpPaginator\n $paginator = $this->get('knp_paginator');\n $pagination = $paginator->paginate(\n $query,\n $request->query->getInt('page',1),\n 5);\n return $this->render('AppBundle:User:users.html.twig',array(\n 'pagination'=> $pagination\n )\n );\n //var_dump(\"Esta es la lista de gente que tienes como contacto\");\n //die();\n }", "function master_sidebar_author_quick_search( $request = array() ) {\n\n\n\tif ( ! empty( $request ) && isset( $request['q'] ) ) {\n\n\t\t// Define query args for author query \n\t\t$roles = array( 'Administrator', 'Editor', 'Author' ); \n\t\t$db_id = -9999;\n\n\t\t// Get all users that have author priviledges\n\t\tforeach ( $roles as $role ) {\n\n\t\t\t$search_query = $request['q'];\n\n\t\t\t$args = array(\n\t\t\t\t'search_columns' => array( 'ID', 'user_login', 'user_nicename', 'user_email' ),\n\t\t\t\t'role' => $role,\n\t\t\t);\n\t\n\t\t\t// The Query\n\t\t\t$user_query = new WP_User_Query( $args );\n\n\t\t\t// Output search results\n\t\t\tif ( ! empty( $user_query->results ) ) {\n\t\t\t\tforeach ( $user_query->results as $user ) {\n\t\t\t\t\tif ( false !== stripos( $user->data->display_name, $search_query ) ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<label class=\"menu-item-title\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" value =\"1\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-object-id]\" class=\"menu-item-checkbox\"> <?php echo $user->data->display_name; ?>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t<input class=\"menu-item-db-id\" type=\"hidden\" value=\"0\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-db-id]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-object\" type=\"hidden\" value=\"<?php echo $user->data->ID; ?>\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-object]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-parent-id\" type=\"hidden\" value=\"0\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-parent-id]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-type\" type=\"hidden\" value=\"author_archive\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-type]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-title\" type=\"hidden\" value=\"<?php echo $user->data->display_name; ?>\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-title]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-url\" type=\"hidden\" value=\"<?php echo $user->data->user_url; ?>\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-url]\">\n\t\t\t\t\t\t</li>\t\t\t\t\t\t\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\n\t\t\t\t\t$db_id++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} // endif\n}", "public function search_members(Request $request) {\n\n \t$name = $request->name;\n \t$from_ranking = ($request->from_ranking != 'from') ? $request->from_ranking : null;\n \t$to_ranking = ($request->to_ranking != 'to') ? $request->to_ranking : null;\n \t$from_birth_date = ($request->from_birth_year != 'from') ? $request->from_birth_year . '-01-01 00:00:00' : null;\n \t$to_birth_date = ($request->to_birth_year != 'to') ? $request->to_birth_year . '-12-31 23:59:59' : null;\n \t$search_results = User::orderBy('last_name')->orderBy('first_name');\n\n //search by name: first name, last name, first name + last name, last name + first name\n \tif($name) {\n \t\t$search_results = $search_results->where(function($query) use ($name) {\n $query->where('first_name', 'like', '%'.$name.'%')\n ->orWhere('last_name', 'like', '%'.$name.'%')\n ->orWhere(DB::raw(\"CONCAT(`first_name`, ' ', `last_name`)\"), 'like', '%'.$name.'%')\n ->orWhere(DB::raw(\"CONCAT(`last_name`, ' ', `first_name`)\"), 'like', '%'.$name.'%');\n });\n \t}\n \tif($from_ranking && $to_ranking) {\n \t\t$from_passed = false;\n \t\t$to_passed = false;\n \t\t$allowed_rankings = array();\n \t\tforeach ($this->rankings_array() as $ranking) {\n \t\t\tif($ranking == $from_ranking) {\n \t\t\t\t$from_passed = true;\n \t\t\t}\n \t\t\tif($from_passed && !$to_passed) {\n \t\t\t\tarray_push($allowed_rankings, $ranking);\n \t\t\t}\n \t\t\tif($ranking == $to_ranking) {\n \t\t\t\t$to_passed = true;\n \t\t\t}\n \t\t}\n \t}\n \telseif($from_ranking) {\n \t\t$from_passed = false;\n \t\t$allowed_rankings = array();\n \t\tforeach ($this->rankings_array() as $ranking) {\n \t\t\tif($ranking == $from_ranking) {\n \t\t\t\t$from_passed = true;\n \t\t\t}\n \t\t\tif($from_passed) {\n \t\t\t\tarray_push($allowed_rankings, $ranking);\n \t\t\t}\n \t\t}\n \t}\n \telseif($to_ranking) {\n \t\t$to_passed = false;\n \t\t$allowed_rankings = array();\n \t\tforeach ($this->rankings_array() as $ranking) {\n \t\t\tif(!$to_passed) {\n \t\t\t\tarray_push($allowed_rankings, $ranking);\n \t\t\t}\n \t\t\tif($ranking == $to_ranking) {\n \t\t\t\t$to_passed = true;\n \t\t\t}\n \t\t}\n \t}\n \tif(isset($allowed_rankings)) {\n \t\t$search_results = $search_results->where(function($query) use ($allowed_rankings) {\n $query->where(function($query) use ($allowed_rankings) {\n\t $query->whereIn('ranking_singles', $allowed_rankings);\n\t })\n\t ->orWhere(function($query) use ($allowed_rankings) {\n\t $query->whereIn('ranking_doubles', $allowed_rankings);\n\t });\n });\n \t}\n \tif($from_birth_date && $to_birth_date) {\n \t\t$search_results = $search_results->whereBetween('birth_date', [$from_birth_date, $to_birth_date]);\n \t}\n \telseif($from_birth_date) {\n \t\t$search_results = $search_results->where('birth_date', '>', $from_birth_date);\n \t}\n \telseif($to_birth_date) {\n \t\t$search_results = $search_results->where('birth_date', '<', $to_birth_date);\n \t}\n\n \t$search_results = $search_results->paginate(50)->appends(['name' => $request->name,\n 'from_ranking' => $request->from_ranking,\n 'to_ranking' => $request->to_ranking,\n 'from_birth_year' => $request->from_birth_year,\n 'to_birth_year' => $request->to_birth_year,\n 'searching' => $request->searching]);\n\n return $search_results;\n }", "function search($text){\ninclude '../imp/call.php';\n \n // let's filter the data that comes in\n $text = htmlspecialchars($text);\n \n\n // prepare the mysql query to select the users \n /* $get_name = $conn->prepare(\"SELECT * FROM u WHERE name LIKE concat('%', :name, '%')\");*/\n $stmtSelect = $conn->prepare(\"SELECT * FROM tbl_user WHERE user_age LIKE concat(:user_age ,'%')\");\n // execute the query\n $stmtSelect -> execute(array('user_age' => $text));\n // show the users on the page\n echo'<div class=\"scrollable\">\n <table>\n <thead>\n <tr>\n <th>S.N</th>\n <th>Name</th>\n <th>Age</th>\n <th>Action</th>\n </tr>\n </thead>\n <tbody>\n ';\n while($names = $stmtSelect->fetch(PDO::FETCH_ASSOC)){\n // show each user as a link\n \n echo ' <tr>\n <td>'.$names['user_name'].'</td>\n <td>'.$names['user_email'].'</td>\n <td>'.$names['user_age'].'</td>\n <td>\n <div align=\"center\">\n <a href=\"\" data-toggle=\"modal\" data-target=\"#mailModal'.$names['id'].'\"><i class=\"fa fa-envelope\" aria-hidden=\"true\"></i>\n </a>\n </div>\n </td>\n </tr>';\n \n }\n echo '</tbody>';\n}", "public function index(Request $request)\n {\n $resource = User::when($request->keyword, function ($q) use ($request) {\n $q->where(function ($q) use ($request) {\n $q->where('name', 'LIKE', \"%{$request->keyword}%\")\n ->orWhere('email', 'LIKE', \"%{$request->keyword}%\");\n });\n })->orderBy('name', 'asc')->get();\n\n return new UserCollection($resource);\n }", "public function index()\n {\n $q = request()->query('q');\n $paginate = request()->query('paginate') != null ? request()->query('paginate') : 15;\n\n $users = User::orderBy('id', 'DESC')\n ->where(function ($query) use ($q) {\n $query->where(\"name\", \"like\", \"%$q%\")\n ->orWhere(\"email\", \"like\", \"%$q%\");\n });\n\n if(!auth()->user() || !auth()->user()->hasRole('Staff')){\n $users->where('id', '!=', 1);\n }\n\n return UserResource::collection($users->paginate($paginate));\n }", "function index() {\n\t\n\t\t$users = $this->user->getAll();\n\t\t\n\t\t// if user is logged in, remove them from the list\n\t\tif($this->session->has_userdata(\"user_id\"))\n\t\t{\n\t\t\t$i = 0;\n\t\t\t$row = null;\n\t\t\tforeach($users as $u)\n\t\t\t{\n\t\t\t\tif($u['userid'] == $this->session->userdata(\"user_id\"))\n\t\t\t\t{\n\t\t\t\t\t$row = $i;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\n\t\t\tunset($users[$row]);\n\t\t}\n\t\t\n\t\t// set data for display and linking to profiles\n\t\t$i = 0;\n\t\tforeach($users as $u)\n\t\t{\t\t\t\n\t\t\tif($u['type'] == 1)\n\t\t\t{\n\t\t\t\t$users[$i]['typename'] = 'user';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$users[$i]['typename'] = 'organization';\n\t\t\t}\n\t\t\t\n\t\t\t$users[$i]['matchPercent'] = $this->matchPercentage( $u['userid'], $u['type'], $u['typeid'] );\n\t\t\t\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\tusort($users, function($a, $b) {\n\t\t\treturn $b['matchPercent'] - $a['matchPercent'];\n\t\t});\n\t\t\n\t\t$this->data['users'] = $users;\n $this->data['pagebody'] = 'search'; // this is the view we want shown\n\t\t\n $this->render();\n }", "public function action_search_member()\n\t{\n\t\tglobal $context;\n\n\t\t// @todo once Action.class is changed\n\t\t$_REQUEST['sa'] = 'query';\n\n\t\t// Set the query values\n\t\t$this->_req->post->sa = 'query';\n\t\t$this->_req->post->membername = un_htmlspecialchars($context['search_term']);\n\t\t$this->_req->post->types = '';\n\n\t\t$managemembers = new ManageMembers(new EventManager());\n\t\t$managemembers->setUser(User::$info);\n\t\t$managemembers->pre_dispatch();\n\t\t$managemembers->action_index();\n\t}", "public function Search($criteria, $userId);", "public function search(Request $request) {\n\n try {\n\n $validator = Validator::make(\n $request->all(),\n array(\n 'term' => 'required',\n )\n );\n \n if ($validator->fails()) {\n\n $error = implode(',', $validator->messages()->all());\n\n throw new Exception($error, 101);\n \n } else {\n\n $data = [];\n\n // users list\n\n $users = [];\n\n\n $results = Helper::search_user($request->id, $request->term, $request->skip, 5);\n\n if(count($results)) {\n \n foreach ($results as $key => $suggestion) {\n\n \n // Blocked Users by You\n $blockedUsersByYou = BlockList::where('user_id', $request->id)\n ->where('block_user_id', $suggestion->id)->first();\n\n // Blocked By Others\n $blockedUsersByOthers = BlockList::where('user_id', $suggestion->id)\n ->where('block_user_id', $request->id)->first();\n\n if (!$blockedUsersByYou && !$blockedUsersByOthers) {\n\n $model = Follower::where('follower', $request->id)->where('user_id', $suggestion->id)->first();\n\n $is_follow = DEFAULT_FALSE;\n\n if($model) {\n\n $is_follow = DEFAULT_TRUE;\n\n }\n\n $no_of_followers = Follower::where('user_id', $suggestion->id)->count();\n\n $users[] = [\n 'id'=>$request->id, \n 'follower_id'=>$suggestion->id, \n 'name'=> $suggestion->name, \n 'description'=>$suggestion->description, \n 'picture'=> $suggestion->picture, \n 'is_follow'=>$is_follow,\n 'no_of_followers'=>$no_of_followers ? $no_of_followers : 0\n ];\n\n }\n\n }\n \n } \n\n $data[USERS]['term'] = $request->term;\n\n $data[USERS]['name'] = USERS;\n\n $data[USERS]['see_all_url'] = route('search.users');\n\n $data[USERS]['data'] = $users ? $users : [];\n\n // live videos List\n\n $live_videos = LiveVideo::videoResponse()\n ->leftJoin('users', 'users.id', '=', 'live_videos.user_id')\n ->where('title','like', '%'.$request->term.'%')\n ->skip(0)\n ->take(4)\n ->where('live_videos.is_streaming', DEFAULT_TRUE)\n ->where('live_videos.status', DEFAULT_FALSE)\n ->get();\n\n\n $data[LIVE_VIDEOS]['term'] = $request->term;\n\n $data[LIVE_VIDEOS]['name'] = LIVE_VIDEOS;\n\n $data[LIVE_VIDEOS]['see_all_url'] = route('search.live_videos');\n\n $data[LIVE_VIDEOS]['data'] = $live_videos ? $live_videos : [];\n\n // custom live videos\n\n $live_tv = CustomLiveVideo::liveVideoResponse()\n ->where('custom_live_videos.title','like', '%'.$request->term.'%')\n ->skip(0)\n ->take(4)\n ->where('custom_live_videos.status', APPROVED)\n ->get();\n\n $data[LIVE_TV]['term'] = $request->term;\n\n $data[LIVE_TV]['name'] = LIVE_TV;\n\n $data[LIVE_TV]['see_all_url'] = route('search.live_tv');\n\n $data[LIVE_TV]['data'] = $live_tv ? $live_tv : [];\n\n $response_array = [\n\n 'success' => true,\n\n 'code' => 200,\n\n 'data' => $data\n\n ];\n \n }\n\n return response()->json($response_array , 200);\n\n } catch(Exception $e) {\n\n $error = $e->getMessage();\n\n $error_code = $e->getCode();\n\n $response_array = ['success' => false , 'error' => $error , 'error_code' => $error_code];\n\n return response()->json($response_array , 200);\n }\n\n }", "public function index(Request $request)\n {\n $users = User::latest()->with('roles');\n\n if (!empty($request->keyword)) {\n $this->keyword = $request->keyword;\n \n $users = $users->where('name','like',\"%\".$this->keyword.\"%\");\n $users = $users->orWhere('email','like',\"%\".$this->keyword.\"%\");\n\n $users = $users->orWhereHas('roles', function ($query) {\n $query->where('name', 'like', \"%\".$this->keyword.\"%\");\n });\n \n }\n \n return view('users.index')->with('users', $users->paginate(10));\n }", "public function index(Request $request)\n {\n $users = User::paginate($this->perPage);\n\n if($request->has('search')) {\n $searchTerm = $request->get('search');\n $users = User::where('name', 'like', \"%\" . $searchTerm . \"%\")\n ->orWhere('email', 'like', \"%\" . $searchTerm . \"%\")\n ->paginate($this->perPage);\n return view('admin.user.index')\n ->with(['users' => $users, 'search' => $searchTerm])\n ->withMessage('Search result');\n }\n return view('admin.user.index')\n ->with('users',$users);\n }", "public function index()\n {\n\t\t$user_id = Session::get('id');\n\t\t$user \t = User::find($user_id);\n\t\t$locality = $user->address['city'];\n\t\t$genres = $user->artist_genre;\n\t\t$user_type = $user->user_type;\n\t\t$zipCode = $user->address['zipcode'];\n\t\t$centerLat = $user->latlon['lat'];\n\t\t$centerLon = $user->latlon['lng'];\n\t\t\n\t\t// Index view for search\n\t\tInput::merge(array_map('trim', Input::all()));\n\t\t$input = filter_var_array(Input::all(), FILTER_SANITIZE_STRIPPED);\n\n\t\t$type_filter = null;\n\t\t$age_filter = null;\n\t\t$distance_filter = null;\n\n\t\tif ($user_type == \"artist\") {\n\n\t\t\t$users = User::where('user_type', 'artist')->where('address.city', $locality)->get();\n\t\t\tif (isset($input['params'])) {\n\t\t\t\t$type = $input['type'];\n\t\t\t\t$params = $input['params'];\n\t\t\t\tif ($type == \"age\") {\n\t\t\t\t\t$users = User::where('user_type', 'artist')\n\t\t\t\t\t\t->where('address.city', $locality)\n\t\t\t\t\t\t->where('ages', 'LIKE', '%'.$params.'%')->get();\n\t\t\t\t\t$age_filter = $params;\n\t\t\t\t}\n\t\t\t\tif ($type == \"distance\") {\n\n\t\t\t\t\t$users = User::where('user_type', 'artist')->where('address.city', $locality)->get();\n\t\t\t\t\tforeach ($users as $user) {\n\t\t\t\t\t\t$lat = $user->latlon['lat'];\n\t\t\t\t\t\t$lon = $user->latlon['lng'];\n\t\t\t\t\t\t$distance = $this->distanceAsMile((double)$centerLat, (double)$centerLon, (double)$lat, (double)$lon);\n\t\t\t\t\t\t$user ->distance = $distance;\n\t\t\t\t\t\t$user->save();\n\t\t\t\t\t}\n\t\t\t\t\t$users = User::where('user_type', 'artist')->where('address.city', $locality)\n\t\t\t\t\t\t->where('distance', '<', (double)$params)->get();\n\t\t\t\t\t$distance_filter = $params;\n\t\t\t\t}\n\t\t\t}\n\t \t$books = array(); \n\t \tforeach ($users as $user)\n\t \t{\n\t \t\t$user_id = $user->id;\n\t \t\t$name = $user->name;\n\t\t\t\t$artist_id = $user->id;\n\n\t\t\t\t$confirmed_events1 = Service::servicesByReceiverId($user_id)->confirmed()->count();\n\n\t\t\t\t$pending_events1 = Service::servicesByReceiverId($user_id)->pending()->count();\n\t\t\t\t$rejected_events1 = Service::servicesByReceiverId($user_id)->rejected()->count();\n\n\t\t\t\t$confirmed_events2 = Service::servicesBySenderId($user_id)->confirmed()->count();\n\n\t\t\t\t$pending_events2 = Service::servicesBySenderId($user_id)->pending()->count();\n\t\t\t\t$rejected_events2 = Service::servicesBySenderId($user_id)->rejected()->count();\n\n\t\t\t\t$confirmed_events = $confirmed_events1 + $confirmed_events2;\n\t\t\t\t$pending_events = $pending_events1 + $pending_events2;\n\t\t\t\t$rejected_events = $rejected_events1 + $rejected_events2;\n\n\t\t\t\t$book = array(\"id\" => $user_id, \"name\" => $name, \"confirmed\" => $confirmed_events, \n\t\t\t\t\t\"pending\" => $pending_events, \"rejected\" => $rejected_events);\n\t\t\t\tarray_push($books, $book);\n\t \t}\n\t \t$books = collect($books);\n\t\t\treturn View::make('ourscene.art-dashboard', compact('books', 'age_filter', 'distance_filter'));\n\t\t}\n\t\telse {\n\n\t\t\t$users = User::where('user_type', 'venue')\n\t\t\t\t->where('address.city', $locality)->get();\n\t\t\t// $users = User::where('user_type', 'venue')->get();\n\t\t\tif (isset($input['params'])) {\n\t\t\t\t$type = $input['type'];\n\t\t\t\t$params = $input['params'];\n\t\t\t\tif ($type == \"type\") {\n\t\t\t\t\t$users = User::where('user_type', 'venue')\n\t\t\t\t\t\t->where('address.city', $locality)\n\t\t\t\t\t\t->where('venue_type.0', $params)\n\t\t\t\t\t\t->orWhere('venue_type.0', $params)->get();\n\t\t\t\t\t$type_filter = $params;\n\t\t\t\t}\n\t\t\t\tif ($type == \"distance\") {\n\n\t\t\t\t\t$users = User::where('user_type', 'venue')->where('address.city', $locality)->get();\n\t\t\t\t\tforeach ($users as $user) {\n\t\t\t\t\t\t$lat = $user->latlon['lat'];\n\t\t\t\t\t\t$lon = $user->latlon['lng'];\n\t\t\t\t\t\t$distance = $this->distanceAsMile((double)$centerLat, (double)$centerLon, (double)$lat, (double)$lon);\n\t\t\t\t\t\t$user ->distance = $distance;\n\t\t\t\t\t\t$user->save();\n\t\t\t\t\t}\n\t\t\t\t\t$users = User::where('user_type', 'venue')->where('address.city', $locality)\n\t\t\t\t\t\t->where('distance', '<', (double)$params)->get();\n\t\t\t\t\t$distance_filter = $params;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$books = array(); \n\t \tforeach ($users as $user)\n\t \t{\n\t \t\t$name = $user->name;\n\t \t\t$user_id = $user->id;\n\t\t\t\t$venue_id = $user->id;\n\n\t\t\t\t$confirmed_events1 = Service::servicesByReceiverId($user_id)->confirmed()->count();\n\n\t\t\t\t$pending_events1 = Service::servicesByReceiverId($user_id)->pending()->count();\n\t\t\t\t$rejected_events1 = Service::servicesByReceiverId($user_id)->rejected()->count();\n\n\t\t\t\t$confirmed_events2 = Service::servicesBySenderId($user_id)->confirmed()->count();\n\n\t\t\t\t$pending_events2 = Service::servicesBySenderId($user_id)->pending()->count();\n\t\t\t\t$rejected_events2 = Service::servicesBySenderId($user_id)->rejected()->count();\n\n\t\t\t\t$confirmed_events = $confirmed_events1 + $confirmed_events2;\n\t\t\t\t$pending_events = $pending_events1 + $pending_events2;\n\t\t\t\t$rejected_events = $rejected_events1 + $rejected_events2;\n\n\t\t\t\t$seating_capacity = $user->seating_capacity;\n\t\t\t\t$book = array(\"id\" => $user_id, \"name\" => $name, \"confirmed\" => $confirmed_events, \n\t\t\t\t\t\"pending\" => $pending_events, \"rejected\" => $rejected_events, \"seating_capacity\" => $seating_capacity);\n\t\t\t\tarray_push($books, $book);\n\t \t}\n\t \t$books = collect($books);\n\t\t\treturn View::make('ourscene.venue-dashboard', compact('books', 'type_filter', 'distance_filter'));\n\n\t\t}\n\n \t\n }", "public function search()\n\t{\n\t\t\n\t}", "public function index(Request $request)\n {\n if ($textSearch = $request->input('search')) {\n return $this->userRepository->search($textSearch);\n }\n return $this->userRepository->all();\n }", "public function index(Request $request)\n {\n $items = User::with('role')->OrderBy('id', 'asc');\n \n // if($request->name) {\n // $items->where(function($q) use ($request) {\n // $q->where('name', 'like', '%' . $request->name . '%');\n // });\n // }\n\n // if($request->email) {\n // $items->where(function($q) use ($request) {\n // $q->where('email', 'like', '%' . $request->email . '%');\n // });\n // }\n\n if($request->term){\n $term = '%'.$request->term.'%';\n $items->where(function($q) use ($term) {\n $q->where('email', 'LIKE',$term)\n ->orWhere('name','LIKE',$term);\n });\n\n }\n\n $users = $items->paginate(10);\n\n return response()->json(['users' => $users]);\n }", "public function index()\n\t{\n $search_value = Input::get('s');\n \n if(!empty($search_value)):\n $users = User::where('username', 'LIKE', '%'.$search_value.'%')->orWhere('email', 'LIKE', '%'.$search_value.'%')->orderBy('created_at', 'desc')->get();\n else:\n $users = User::all();\n endif;\n\n\t\t$data = array(\n\t\t\t'users' => $users,\n\t\t\t'admin_user' => Auth::user()\n\t\t\t);\n\t\treturn View::make('admin.users.index', $data);\n\t}", "public function findUsers($args)\n {\n // Need read access to call this function\n if (!SecurityUtil::checkPermission(\"{$this->name}::\", '::', ACCESS_READ)) {\n return false;\n }\n\n $profileModule = System::getVar('profilemodule', '');\n $useProfileMod = (!empty($profileModule) && ModUtil::available($profileModule));\n\n $dbtable = DBUtil::getTables();\n $userstable = $dbtable['users'];\n $userscolumn = $dbtable['users_column'];\n\n // Set query conditions (unless some one else sends a hardcoded one)\n $where = array();\n if (!isset($args['condition']) || !$args['condition']) {\n // Do not include anonymous user\n $where[] = \"({$userscolumn['uid']} != 1)\";\n\n foreach ($args as $arg => $value) {\n if ($value) {\n switch($arg) {\n case 'uname':\n // Fall through to next on purpose--no break\n case 'email':\n $where[] = \"({$userscolumn[$arg]} LIKE '%\".DataUtil::formatForStore($value).\"%')\";\n break;\n case 'ugroup':\n $uidList = UserUtil::getUsersForGroup($value);\n if (is_array($uidList) && !empty($uidList)) {\n $where[] = \"({$userscolumn['uid']} IN (\" . implode(', ', $uidList) . \"))\";\n }\n break;\n case 'regdateafter':\n $where[] = \"({$userscolumn['user_regdate']} > '\"\n . DataUtil::formatForStore($value) . \"')\";\n break;\n case 'regdatebefore':\n $where[] = \"({$userscolumn['user_regdate']} < '\"\n . DataUtil::formatForStore($value) . \"')\";\n break;\n case 'dynadata':\n if ($useProfileMod) {\n $uidList = ModUtil::apiFunc($profileModule, 'user', 'searchDynadata', array(\n 'dynadata' => $value\n ));\n if (is_array($uidList) && !empty($uidList)) {\n $where[] = \"({$userscolumn['uid']} IN (\" . implode(', ', $uidList) . \"))\";\n }\n }\n break;\n default:\n // Skip unknown values--do nothing, and no error--might be other legitimate arguments.\n }\n }\n }\n }\n // TODO - Should this exclude pending delete too?\n $where[] = \"({$userscolumn['activated']} != \" . Users_Constant::ACTIVATED_PENDING_REG . \")\";\n $where = 'WHERE ' . implode(' AND ', $where);\n\n $permFilter = array();\n $permFilter[] = array(\n 'realm' => 0,\n 'component_left' => $this->name,\n 'component_middle' => '',\n 'component_right' => '',\n 'instance_left' => 'uname',\n 'instance_middle' => '',\n 'instance_right' => 'uid',\n 'level' => ACCESS_READ,\n );\n $objArray = DBUtil::selectObjectArray('users', $where, 'uname', null, null, null, $permFilter);\n\n return $objArray;\n }", "public function searchUsersByIds($ids)\n {\n return $this->start()->uri(\"/api/user/search\")\n ->urlParameter(\"ids\", $ids)\n ->get()\n ->go();\n }", "public function search($args)\n {\n // Security check\n if (!SecurityUtil::checkPermission('Users::', '::', ACCESS_READ)) {\n return false;\n }\n\n if (!isset($args['q']) || empty($args['q'])) {\n return true;\n }\n\n // decide if we have to load the DUDs from the Profile module\n $profileModule = System::getVar('profilemodule', '');\n $useProfileMod = (!empty($profileModule) && ModUtil::available($profileModule));\n\n // get the db and table info\n $dbtable = DBUtil::getTables();\n $userscolumn = $dbtable['users_column'];\n\n $q = DataUtil::formatForStore($args['q']);\n $q = str_replace('%', '\\\\%', $q); // Don't allow user input % as wildcard\n\n // build the where clause\n $where = array();\n $where[] = \"({$userscolumn['activated']} != \" . Users_Constant::ACTIVATED_PENDING_REG . ')';\n\n $unameClause = Search_Api_User::construct_where($args, array($userscolumn['uname']));\n\n // invoke the current profilemodule search query\n if ($useProfileMod) {\n $uids = ModUtil::apiFunc($profileModule, 'user', 'searchDynadata',\n array('dynadata' => array('all' => $q)));\n\n $tmp = $unameClause;\n if (is_array($uids) && !empty($uids)) {\n $tmp .= \" OR {$userscolumn['uid']} IN (\" . implode(', ', $uids) . ')';\n }\n $where[] = \"({$tmp}) \";\n } else {\n $where[] = $unameClause;\n }\n\n $where = implode(' AND ', $where);\n\n $users = DBUtil::selectObjectArray ('users', $where, '', -1, -1, 'uid');\n\n if (!$users) {\n return true;\n }\n\n $sessionId = session_id();\n\n foreach ($users as $user) {\n if ($user['uid'] != 1 && SecurityUtil::checkPermission('Users::', \"$user[uname]::$user[uid]\", ACCESS_READ)) {\n if ($useProfileMod) {\n $qtext = $this->__(\"Click the user's name to view his/her complete profile.\");\n } else {\n $qtext = '';\n }\n $items = array('title' => $user['uname'],\n 'text' => $qtext,\n 'extra' => $user['uid'],\n 'module' => 'Users',\n 'created' => null,\n 'session' => $sessionId);\n $insertResult = DBUtil::insertObject($items, 'search_result');\n if (!$insertResult) {\n $this->registerError($this->__(\"Error! Could not load the results of the user's search.\"));\n return false;\n }\n }\n }\n return true;\n }", "public function WP_User_Search($search_term = '', $page = '', $role = '')\n {\n }", "function getSearchUser(Request $request)\n {\n $username = $request->username_input;\n\n $status = 'error';\n $message = 'No user existed of this username - ' . $username;\n\n $status_code = 400;\n\n if ($username != '') {\n\n $member = User::select('username', 'id', 'group_id', 'user_details_id')->where('username', $username)->first();\n\n if ($member) {\n\n $data = [\n 'id' => $member->id,\n 'group_id' => $member->group_id,\n 'username' => $member->username,\n 'photo' => $member->details->thePhoto,\n 'fullname' => $member->details->fullName,\n 'upline' => isset($member->account->uplineUser->id) ? $member->account->uplineUser->username . PHP_EOL . '(' . strtoupper($member->account->uplineUser->account->code->account_id) . ')' : ''\n ];\n\n $status = 'success';\n\n $status_code = 200;\n\n $message = $data;\n $message['message'] = 'Successfully found a user';\n }\n }\n\n return response()->json(['status' => $status, 'message' => $message], $status_code);\n }", "public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }", "public function index($search = null) {\n if (!empty($search)) {\n $users = User::where('nick', 'LIKE', '%' . $search . '%')\n ->orWhere('name', 'LIKE', '%' . $search . '%')\n ->orWhere('surname', 'LIKE', '%' . $search . '%')\n ->orderBy('id', 'desc')\n ->paginate(5);\n } else {\n $users = User::orderBy('id', 'desc')->paginate(5);\n }\n return view(\"user.index\", [\n 'users' => $users\n ]);\n }", "public function search() {\n // without an entry we just redirect to the error page as we need the entry to find it in the database\n if (!isset($_POST['submit-search']))\n return call('pages', 'error');\n \n //try{\n // we use the given entry to get the correct post\n $userentry = filter_input(INPUT_POST,'search', FILTER_SANITIZE_SPECIAL_CHARS);\n $results = Search::find($_POST['search']);\n require_once('views/pages/SearchResults.php');\n //}\n //catch (Exception $ex){\n // $ex->getMessage();\n // return call('pages','error');\n }", "public function searchUsers($str) {\n return user_find($str);\n }", "public function searchUsers(Request $request)\n {\n //\n if (session('user')[\"rol\"] == \"V\") {\n return redirect()->route('dashvende');\n }\n\n $name = session('user')[\"Nombres\"] . \" \" . session('user')[\"Apellidos\"];\n $aviso = 0;\n\n $matrizuser = User::searchuser($request->search, $request->rol);\n\n return view('Usuarios.index', compact('name', 'aviso', 'matrizuser'));\n }", "public function search(Request $request){\n \t$user = Auth::user();\n if(isset($request->searchCode)){\n $search = $request->searchCode;\n $member = User::whereHas('raffles', function ($query) use ($search) {\n $query->where('code', $search);\n })->get();\n if(count($member) == 0){\n $code = Code::where('code',$search)->first();\n if($code != null){\n $member = User::find($code->user_id);\n }\n }\n }\n elseif(isset($request->searchUser)){\n $search = $request->searchUser;\n $member = User::where('firstname','like','%'.$search.'%')\n ->orWhere('lastname','like','%'.$search.'%')\n ->orWhere(DB::raw(\"CONCAT(`firstname`, ' ', `lastname`)\"), 'LIKE', \"%\".$search.\"%\")\n ->orWhere(DB::raw(\"CONCAT(`lastname`, ' ', `firstname`)\"), 'LIKE', \"%\".$search.\"%\")\n ->get();\n if(count($member) == 0){\n $d = DateTime::createFromFormat(trans('global.dateformat'), $search);\n if($d && $d->format(trans('global.dateformat')) == $search){\n $member = User::whereBetween('birthday', [strtotime($search)-86400, strtotime($search)+86400])->get();\n }\n }\n }\n else{\n return redirect('operator')->with('msg', 'Geben Sie einen Suchbegriff ein!')->with('msgState', 'alert');\n }\n\n \tif(count($member) == 1){\n if($member[0] != null){ $member = $member[0]; }\n \t\treturn redirect('operator/'.$member->id);\n \t}\n \telseif(count($member) > 1){\n $members = $member;\n \t\treturn view('operator.result', compact('user','members'));\n \t}\n \telse{\n \t\treturn redirect('operator')->with('msg', 'Es konnte kein entsprechender Benutzer gefunden werden.')->with('msgState', 'alert');\n \t}\n\t}", "public function index(Request $request)\n {\n $users = DB::table('users')\n ->select('*')\n ->where('users.status', 'activo')\n ->where('first_name', 'LIKE', \"%$request->search%\")\n ->get();\n //$users = user::get();\n return view('user.index', ['items' => $users]\n );\n }", "public function invokeUsers()\r\n {\r\n if (!isset($_GET['users'])) {\r\n $users = $this->model->getUsers();\r\n include 'view/userslist.php';\r\n }\r\n }", "public function index()\n {\n $users = \\App\\User::all();\n\n // if($request->has('q'){\n // $search = $request->q;\n // $users = User::search($search);\n // } \n\n $data['users'] = $users;\n return view('users.index' , $data);\n\n\n // })\n }" ]
[ "0.82230175", "0.77143145", "0.7667823", "0.7402793", "0.72645706", "0.7199494", "0.7158248", "0.71168727", "0.71089554", "0.7089041", "0.705963", "0.70475173", "0.7014929", "0.70042795", "0.69903374", "0.69813174", "0.6970774", "0.6931101", "0.69230765", "0.69171786", "0.690443", "0.69034874", "0.6875437", "0.6858969", "0.6819727", "0.6814859", "0.6789668", "0.6763404", "0.6757247", "0.6747922", "0.67326456", "0.6729533", "0.67142445", "0.67044574", "0.67003983", "0.669639", "0.66867244", "0.66867244", "0.6681155", "0.6680377", "0.6670828", "0.660069", "0.65910405", "0.6579325", "0.65495354", "0.6546882", "0.654571", "0.65303844", "0.65213495", "0.6470061", "0.64624363", "0.64605874", "0.64596516", "0.64542425", "0.6447515", "0.6444651", "0.6442342", "0.6439159", "0.6436384", "0.6436377", "0.6436377", "0.6434649", "0.64327496", "0.64319175", "0.64195824", "0.64146787", "0.64108413", "0.6404909", "0.64031774", "0.6396189", "0.6386964", "0.6383323", "0.6382227", "0.6376632", "0.635352", "0.6352807", "0.63484824", "0.63336843", "0.63263345", "0.63178205", "0.6315462", "0.63145137", "0.6306931", "0.62939864", "0.62794155", "0.6279056", "0.6278205", "0.6275908", "0.6270448", "0.62636644", "0.62630475", "0.62554157", "0.62540966", "0.6252317", "0.6240587", "0.6235819", "0.6234792", "0.62303245", "0.62293637", "0.622331" ]
0.6474902
49
Render user details page.
public function user($userId) { return view('pages.admin-center.user')->with('userId', $userId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function profile()\n {\n $user = User::find(Auth::id());\n return view('layouts.showuser_details')->with(['user' => $user]);\n }", "public function displayDetails() {\n \n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-show-details') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n $id = $this->uri->segment(3);\n $user = $this->UserModel->getRecord($id);\n $permission_group = $this->UserModel->getUserType($user->id);\n $user->user_role = $permission_group->group_name;\n $this->data['result'] = $user;\n $this->set_view('user/more_details_page', $this->data);\n } else {\n echo \"access denied\";\n }\n }", "public function show()\n {\n $user = User::find($this->guard()->id());\n $properties = $user->properties;\n\n return view(config('const.template.user.mypage'), compact('user', 'properties'));\n }", "public function actionUserInfo()\n {\n $data['userInfos'] = Fly::m('blog.models.BlogModel')->getUser(1);\n $this->render('user_info', $data);\n }", "public function profile() {\n\tif(!$this->user) {\n\t\tRouter::redirect(\"/users/login\");\n\t\t\n\t\t# Return will force this method to exit here so the rest of \n\t\t# the code won't be executed and the profile view won't be displayed.\n\t\treturn false;\n\t}\n \n # Setup view\n\t$this->template->content = View::instance('v_users_profile');\n\t$this->template->title = \"Profile of \".$this->user->first_name;\n \n #var_dump($this->user);\n \t\n\t# Render template\n\techo $this->template;\n }", "public function getUserDetailsAction($userId)\n {\n $service = $this->get('users.users_service_cache');\n try {\n $userDetails = $service->getUserDetails($userId);\n } catch (\\Exception $ex) {\n throw $ex;\n }\n\n return $this->render('UsersBundle:Users:details.html.twig',\n array('userDetails' => $userDetails));\n }", "public function profileAction() {\r\n $user = $this->getCurUser();\r\n return $this->render('AlbatrossUserBundle:User:profile.html.twig', array(\r\n 'userInfo' => $user,\r\n )\r\n );\r\n }", "public function detailsAction()\n {\n return $this->render('MySecurityBundle:MyProfile:account_details.html.twig');\n }", "function show() {\n // Process request with using of models\n $user = Service::get_authorized_user();\n // Make Response Data\n if ($user !== NULL) {\n $data = [\n 'profile' => $user,\n ];\n $view = 'user/show';\n return $this->render($view, $data);\n } else {\n return Application::error403();\n }\n}", "public function actionProfile()\n {\n $this->layout = 'headbar';\n $model = new User();\n $model = User::find()->where(['id' => 1])->one();\n $name = $model->name;\n $email = $model->email;\n $mobile = $model->contact;\n return $this->render('profile', [\n 'model' => $model,\n 'name' => $name,\n 'email' => $email,\n 'mobile' => $mobile,\n ]);\n }", "public function show()\n {\n $user_identifier = $this->session->userdata('identifier');\n $user_details = $this->user_m->read($user_identifier);\n $this->data['user_details'] = $user_details;\n $this->load_view('Profil Akun', 'user/profil');\n }", "public function userPage()\n {\n return view('user.user');\n }", "public function info()\n {\n $this->isUser();\n\n $this->data['noCabinetOrAdmin'] = true;\n\n $userModel = new UserModel();\n\n $userInfo = $userModel->getUserByEmail(Session::get('login'));\n\n $this->data['info'] = $userInfo;\n\n $this->render('info');\n }", "public function profile() {\n\t\tif($this->checkLoggedIn()) {\n\t\t\treturn $this->view->render('profile_view');\n\t\t}\n\t}", "public function view_user_data()\n {\n $data['user'] = $this->Admin_Insert->userlist_data();\n $data['user_address'] = $this->Admin_Insert->useraddress_data();\n $this->load->view('header');\n $this->load->view('footer');\n $this->load->view('user_details', $data);\n }", "public function show()\n {\n $user = Auth::user();\n\n // dd($user);\n return view('pages.user.profile')->withUser($user);\n }", "public function index()\n {\n //Gladys: Get all the user info.\n \t$user = $this->userRepo->getAllUserInfo(Auth::user()->getId());\n \n return view('pages.profile.profile')->with('userData', $user);\n }", "public function profile($user_name = NULL) {\n\n\n if(!$this->user){\n //Router::redirect('/');\n die('Members Only <a href=\"/users/login\">Login</a>');\n\n }\n\n $this->template->content=View::instance('v_users_profile'); \n // $content=View::instance('v_users_profile'); \n $this->template->title= APP_NAME. \" :: Profile :: \".$user_name;\n \n $q= 'Select * \n From users \n WHERE email=\"'.$user_name.'\"';\n $user= DB::instance(DB_NAME)->select_row($q);\n\n $this->template->content->user=$user;\n \n # Render View \n echo $this->template;\n\n \n }", "public function showUser()\n\t{\n $data = [\n 'userData' => $this->user->getUserInfo(),\n \"positionData\" => $this->positions->getAllPositions(),\n \"departmentData\" => $this->departments->getAllDepartments(),\n \n ];\n\t\treturn view('employees/index', $data);\n\t}", "public function information()\n {\n $user = Auth::user();\n return view('user.profileInfo', compact('user'));\n }", "public function show()\n {\n $id = Auth::user()->id;\n $user = User::find($id);\n return view('user.detail', compact('user'));\n }", "function profile()\n\t{\n\t\t$userId = $this->Auth->user('id');\n\t\t$user = $this->User->findById($userId);\n\n\t\t// Set the client information to display in the view\n\t\t$this->set(compact('user'));\n\t}", "public function show()\n {\n $user = User::findOrFail($this->auth->user()->id);\n return view('admin.admin-users.profile', compact('user'));\n }", "public function userDetail()\n {\n return view('admin.show_users')->with('users',User::all());\n \n }", "public function index()\n {\n return view('pages.user')->with(['userinfo' => $this->getUserInfo(),\n 'boardinfo' => $this->getBoardInfo()\n ]);\n }", "public function __invoke()\n {\n return view('client.profile', ['user' => User::findOrFail(auth()->user()->id)]);\n }", "public function profile()\n { \n $customerInfo = Auth::guard('customer')->user();\n return view('website::customer.profile', ['customerInfo' => $customerInfo]);\n }", "public function index()\n {\n $data = User::find(Auth::id());\n return view('layouts.profile')->with('data',$data);\n }", "function get_user_information_view($user_id)\n\t {\n\t $data = $this->User_data->get_user_info_data($user_id);\n\t return $this->load->view('q2a/userInformation',$data,true);\n\t }", "public function my_profile()\n { \n $user_id = \\Auth::user()->id;\n $user = User::find($user_id);\n return view ('backend.pages.my_profile', compact('user'));\n }", "function showdetails(EUtente &$user, $avatar)\n {\n $this->smarty->assign('UtenteType', lcfirst(substr(get_class($user), 1)));\n $this->smarty->registerObject('user', $user);\n\n $this->smarty->assign('avatar', $avatar);\n\n //mostro il contenuto della pagine\n $this->smarty->display('TVGAvatarDetails.tpl');\n }", "public function displayUserPage() {\n\t if(!isset($_SESSION['userID'])) {\n\t \t//redirect\n\t \theader('Location:index.php?page=home');\n\t }\t\n\t\tif(!isset($_POST['logout'])) {\n\n\t\t\t$html = '<h2 class=\"redhead\">' . $_SESSION['firstName'] .' Page <br/> Welcome to your Account!</h2>'; \n\t\t\t\t\n\t\t\t$html .= '<div class=\"left half\"><h3>Start Rating Childcare Centres Now!</h3><p>The system of rating uses averaging. The parents rates the center with 5 as the highest and 1 is the lowest. The Centre with the highest score is ranked as no. 1 and so forth. </p>';\t\n\t\t\n\t\t\t$html .= '<form method=\"POST\" action=\"'. $_SERVER['REQUEST_URI'] .'\" class=\"left\">';\n\t\t\t$html .= '<input type=\"submit\" name=\"logout\" value=\"Logout\" class=\"blue whitefont\">';\n\t\t\t$html .= '</form> </div><br/>';\t\t\t\n\n\t\t\treturn $html;\t\t \t\t\t\t\t\n\t\t} else {\n\t\t\t\t$this -> model -> processLogout();\t\t\t\t\t\n\t\t\t\theader('Location:index.php?page=login');\n\t\t}\n\t\t\t\n\t}", "public function get_profile_details_view() {\n $html = '';\n if ( $this->get_access_token() ) {\n $uri = 'https://www.googleapis.com/oauth2/v2/userinfo';\n $params = array(\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->get_access_token(),\n ),\n );\n\n $response = wp_remote_get( $uri, $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $html = $this->get_view( 'profile-details.php', array( 'name' => $body->name, 'picture' => $body->picture ) );\n\n $this->debug( 'Profile Details retrieved successfully', $body );\n } else {\n $this->error( 'Error while retrieving user information: ', $response );\n }\n }\n\n return $html;\n }", "function index() \n { \n $data['profile_info'] = $this->tank_auth->get_user_by_id($this->tank_auth->get_user_id(),TRUE);\n $data['profile_detail'] = $this->tank_auth->get_user_profile_detail($this->tank_auth->get_user_id()); \t \n $this->_template($data,$templatename='profile'); \n }", "public function userAccount()\n {\n $recipes= $this->getDoctrine()\n ->getRepository(Recipe::class)\n ->findAll();\n $user = $this->getUser();\n $reviews= $this->getDoctrine()\n ->getRepository(Review::class)\n ->findAll();\n $user = $this->getUser();\n return $this->render('user/show.html.twig', [\n 'user' => $user,\n 'recipes' => $recipes,\n 'reviews' => $reviews,\n ]);\n\n }", "public function profile()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('profile');\n\n return $this->loadPublicView('user.profile', $breadCrumb['data']);\n }", "public function actionDetails()\n\t{\n\t $this->layout='main';\n\t \n $user_data = Users::model()->findByPk(Yii::app()->user->id);\n $step_completed = $user_data->step_completed;\n\n if($user_data->user_role == 2 && $step_completed < 5){\n $this->render('start', ['step_completed' =>$step_completed]);\n }else{ $this->render('details'); }\t\n\t}", "public static function render_user_detail($userDetailStat, $topRatingMovies) {\n ?>\n <div class=\"row\" style=\"margin-top: 30px\">\n <!-- User infos -->\n <div class=\"one-half column\">\n <h4>User information:</h4>\n <p>User ID: <?php echo LoginManager::getLoggedinUser()->getUserID(); ?></p>\n <p>User Name: <?php echo LoginManager::getLoggedinUser()->getUserName(); ?></p>\n <p>Email: <?php echo LoginManager::getLoggedinUser()->getEmail(); ?></p>\n </div>\n\n <!-- User Activity Statistic -->\n <div class=\"one-half column\">\n <h4>User Activity:</h4>\n <p>Movies Created: <?php echo $userDetailStat->moviesCount; ?></p>\n <p>Reviewed: <?php echo $userDetailStat->reviewsCount; ?></p>\n </div>\n </div> \n\n <!-- User favorite movies --> \n <div class=\"row\" style=\"margin-top: 30px\">\n <div class=\"one-full column\">\n <h4>Favorite Movies:</h4>\n </div>\n <?php \n self::render_movies_rows($topRatingMovies);\n ?>\n </div>\n <?php\n }", "public function viewUser($userid)\n {\n $user = $this->user->find($userid);\n if ($user) {\n $this->show('admin/userdetails.php', ['user' => $user]);\n } else {\n $this->showNotFound();\n }\n }", "public function index()\n {\n $users = UserDetail::all();\n return view ('admin.user_details.index', compact('users'));\n }", "public function show()\r\n\t{\r\n\t\t\r\n\t\t$model = $this->getProfileView();\r\n\t\t$data = array('model'=> $model);\r\n\t\t\r\n\t\treturn $this->render($data);\r\n\t\t\r\n\t}", "public function profile()\n {\n $user = $this->user;\n return view('user.profile', compact('user'));\n }", "public function show()\n {\n $orders = Auth::user()->orders;\n return view ('users.profile', compact('orders', 'reservations'));\n }", "public function userDetails(){\n\t\t\techo $this->name .\"<br>\";\n\t\t\techo $this->age .\"<br>\";\n\t\t\techo $this->dept .\"<br>\";\n\t\t}", "public function index()\n {\n $user = $this->getAuthenticatedUser();\n\n $this->setTitle(\"Profile - {$user->full_name}\");\n $this->addBreadcrumbRoute($user->full_name, 'admin::auth.profile.index');\n\n return $this->view('admin.profile.index', compact('user'));\n }", "public function index()\n {\n $user = Auth::user();\n return view('profile-user', ['user' => $user]);\n }", "public function index()\n {\n return view('profile')->with( 'user', auth()->user() );\n }", "public function index()\n {\n $this->context['data'] = $this->usersRepo->getAll();\n $this->render($this->context);\n }", "public function profile()\n\t{\n\t\t$user = $this->userRepo->get(Auth::user()->id);\n\n\t\treturn View::make('user.profile', compact('user'))->withShowTab(Input::get('tab'));\n\t}", "public function information_user()\n {\n //Model\n $username = $_SESSION['username'];\n $rs = $this->Nhansu->get_information_user($username);\n if ($rs) {\n $this->view(\"master_page\", [\n \"page\" => \"information_user\",\n \"url\" => \"../\",\n \"info_user\" => $rs,\n \"phongban\" => $this->Phongban->ListAll(),\n \"chucvu\" => $this->Chucvu->ListAll(),\n\n ]);\n }\n }", "public function showProfile()\n\t{\n\n\t\t$user = User::with('consultant','consultantNationality')->find(Auth::user()->get()->id);\n\t\t$nationalities = $user->nationalities();\n\t\t$specialization = $user->specialization();\n\t\t$workedcountries = $user->workedcountries();\n\t\t$skills = $user->skills();\n\t\t$languages = $user->languages();\t\n\t\t$agencies = $user->agencies();\n\n\t\treturn View::make('user.profile.show', compact('user', 'nationalities','specialization','workedcountries','skills','languages','agencies'));\n\t}", "public function info() {\n $data = array();\n if ($this->user->is_logged_in()) {\n\n $this->user->get_user($this->user->getMyId());\n $data['user'] = $this->user;\n }\n $this->load->view('account/account_info', $data);\n }", "public function profile() {\n $user = Auth::user();\n return view('site.profile', compact('user'));\n }", "public function profile()\n {\n $user= Auth::user();\n return view('admin.users.edit-profile-details',compact('user'));\n }", "public function getUser(){\n \t\n \treturn view('user/info/info_user');\n }", "public function index()\n {\n $user = $this->userProfileService->findUser()->getUser();\n $carts = $this->userProfileService->findCartByUser($user)->getCart();\n $userorders = $this->userProfileService->findUserOrderByUser($user, 3)->getUserOrder();\n\n $agent = $this->agentService->agent();\n return view($agent . '.user.profile', ['user' => $user, 'carts' => $carts, 'userorders' => $userorders]);\n }", "private function userDisplay() {\n $showHandle = $this->get('username');\n if (isset($showHandle)) {\n echo '<li class=\"user-handle\">'.$showHandle.'</li>';\n }\n }", "function show_page() {\n\t$query = 'SELECT *, DATE_FORMAT(creation_date, \"%M %e, %Y\") AS formatted_creation FROM users WHERE id=\"' . mysqli_real_escape_string(DB::get(),$_GET['ID']) . '\" LIMIT 1';\n\t$result = DB::queryRaw($query);\t// have MySQL format the date for us\n\t\n\tif (mysqli_num_rows($result) != 1)\n\t\ttrigger_error('User not found', E_USER_ERROR);\n\t\n\t// ** User Found, info valid at this point **\n\t\n\t$row = mysqli_fetch_assoc($result);\n\t\n\t\n\t// Page header\n\tglobal $use_rel_external_script;\t// direct page_header to include some javascript that will make links\n\t$use_rel_external_script = true;\t// marked as rel=\"external\" open in a new tab while remaining XHTML-valid\n\t\n\tpage_header($row['name']);\t// the title of the page is the user's name; helpful if you open multiple users in different tabs\n\t\n\techo <<<HEREDOC\n <h1>View User</h1>\n \n\nHEREDOC;\n\t\n\t\n\t// Format Data\n\t$email_verified = 'No';\n\tif ($row['email_verification'] == '1')\n\t\t$email_verified = 'Yes';\n\t\t\n\t$cell = format_phone_number($row['cell']);\n\t\n\t$permissions = $row['permissions'];\n\t$account_type = 'Regular';\n\tif ($permissions == 'C')\n\t\t$account_type = 'Captain';\n\telse if ($permissions == 'A')\n\t\t$account_type = 'Non-Captain Admin';\n\telse if ($permissions == 'L')\n\t\t$account_type = 'Alumnus';\n\telse if ($permissions == 'T')\n\t\t$account_type = 'Temporary';\n\t\n\t// mailing list status\n\t$mailings = 'No';\n\tif ($row['mailings'] == '1')\n\t\t$mailings = 'Yes';\n\t\n\t\n\t// Format Approval Status line\n\t//\n\t// depending on whether the user is approved, banned, or in limbo, the link next to that\n\t// information needs to un-approve, un-ban, or approve/ban the user\n\t// eg. \"Approval Status: Approved (to un-approve, click here)\"\n\tif ($row['approved'] == '-1') {\n\t\t$approval_status = 'Banned';\n\t\t$approval_line = \"&nbsp;<span class=\\\"small\\\">(<a href=\\\"Edit_User?Approve&amp;ID={$row['id']}&amp;xsrf_token={$_SESSION['xsrf_token']}&amp;Return=View\\\">approve</a> | <a href=\\\"Edit_User?Unapprove&amp;ID={$row['id']}&amp;xsrf_token={$_SESSION['xsrf_token']}&amp;Return=View\\\">make pending</a>)</span>\";\n\t}\n\telse if ($row['approved'] == '0') {\n\t\t$approval_status = 'Pending';\n\t\t$approval_line = \"&nbsp;<span class=\\\"small\\\">(<a href=\\\"Edit_User?Approve&amp;ID={$row['id']}&amp;xsrf_token={$_SESSION['xsrf_token']}&amp;Return=View\\\">approve</a> | <a href=\\\"Edit_User?Ban&amp;ID={$row['id']}&amp;xsrf_token={$_SESSION['xsrf_token']}&amp;Return=View\\\">ban</a>)</span>\";\n\t}\n\telse if ($row['approved'] == '1') {\n\t\t$approval_status = 'Approved';\n\t\t$approval_line = \"&nbsp;<span class=\\\"small\\\">(<a href=\\\"Edit_User?Ban&amp;ID={$row['id']}&amp;xsrf_token={$_SESSION['xsrf_token']}&amp;Return=View\\\">ban</a>)</span>\";\n\t}\n\t\t\n\techo <<<HEREDOC\n <table class=\"spacious\">\n <tr>\n <td>Name:</td>\n <td>\n <span class=\"b\">{$row['name']}</span>\n &nbsp;<span class=\"small\">(<a href=\"Edit_User?Change_Name&amp;ID={$row['id']}&amp;Return=View\">change</a>)</span>\n </td>\n </tr><tr>\n <td>Email Address:</td>\n <td class=\"b\"><a href=\"mailto:{$row['email']}\" rel=\"external\">{$row['email']}</a></td>\n </tr><tr>\n <td>Cell Phone Number:&nbsp;</td>\n <td class=\"b\">$cell</td>\n </tr><tr>\n <td>Year of Graduation:</td>\n <td>\n <span class=\"b\">{$row['yog']}</span>\n &nbsp;<span class=\"small\">(<a href=\"Edit_User?Change_YOG&amp;ID={$row['id']}&amp;Return=View\">change</a>)</span>\n <br /><br />\n </td>\n </tr><tr>\n <td>ID:</td>\n <td><span class=\"b\">{$row['id']}</span></td>\n </tr><tr>\n <td>Account Type:</td>\n <td>\n <span class=\"b\">$account_type</span>\n &nbsp;<span class=\"small\">(<a href=\"Edit_User?Change_Permissions&amp;ID={$row['id']}&amp;Return=View\">change</a>)</span>\n </td>\n </tr><tr>\n <td>Mailing List:</td>\n <td><span class=\"b\">$mailings</span></td>\n </tr><tr>\n <td>Approval Status:</td>\n <td>\n <span class=\"b\">$approval_status</span>\n $approval_line\n </td>\n </tr><tr>\n <td>Email Verified:</td>\n <td class=\"b\">$email_verified</td>\n </tr><tr>\n <td>Creation Date:</td>\n <td><span class=\"b\">{$row['formatted_creation']}</span></td>\n </tr><tr>\n <td>Registered From:</td>\n <td class=\"b\">{$row['registration_ip']}</td>\n </tr>\n </table>\n <br />\n <span class=\"small i\">Only users are able to edit their email address and cell phone number.</span>\nHEREDOC;\n\t\n\t// Show test scores\n\t$query = 'SELECT test_scores.score AS score, tests.name AS name, tests.total_points AS total, DATE_FORMAT(tests.date, \"%M %e, %Y\") AS formatted_date, test_scores.score_id AS score_id'\n\t\t\t. ' FROM test_scores'\n\t\t\t. ' INNER JOIN tests ON tests.test_id=test_scores.test_id'\n\t\t\t. ' WHERE test_scores.user_id=\"' . mysqli_real_escape_string(DB::get(),$_GET['ID']) . '\" AND archived=\"0\"'\n\t\t\t. ' ORDER BY tests.date DESC';\n\t$result = DB::queryRaw($query);\n\t\n\tif (mysqli_num_rows($result) > 0) {\n\t\techo <<<HEREDOC\n\n \n <br /><br /><br /><br /><br />\n <h4>Recent Test Scores</h4>\n <table class=\"contrasting\">\n <tr>\n <th>Test</th>\n <th>Score</th>\n <th>Maximum</th>\n <th>Date</th>\n <th></th>\n </tr>\n\nHEREDOC;\n\t\t\n\t\t$row = mysqli_fetch_assoc($result);\n\t\twhile ($row) {\n\t\t\techo <<<HEREDOC\n <tr>\n <td>{$row['name']}</td>\n <td class=\"text-centered\">{$row['score']}</td>\n <td class=\"text-centered\">{$row['total']}</td>\n <td>{$row['formatted_date']}</td>\n <td><a href=\"Delete_Score?ID={$row['score_id']}&amp;xsrf_token={$_SESSION['xsrf_token']}\">Delete</a></td>\n </tr>\n\nHEREDOC;\n\t\t\t$row = mysqli_fetch_assoc($result);\n\t\t}\n\t\t\n\t\techo <<<HEREDOC\n </table>\nHEREDOC;\n\t}\n\t\n\t$query = 'SELECT test_scores.score AS score, tests.name AS name, tests.total_points AS total, DATE_FORMAT(tests.date, \"%M %e, %Y\") AS formatted_date, test_scores.score_id AS score_id'\n\t\t\t. ' FROM test_scores'\n\t\t\t. ' INNER JOIN tests ON tests.test_id=test_scores.test_id'\n\t\t\t. ' WHERE test_scores.user_id=\"' . mysqli_real_escape_string(DB::get(),$_GET['ID']) . '\" AND archived=\"1\"'\n\t\t\t. ' ORDER BY tests.date DESC';\n\t$result = DB::queryRaw($query);\n\t\n\tif (mysqli_num_rows($result) > 0) {\n\t\techo <<<HEREDOC\n\n \n <br /><br />\n <h4>Old Test Scores</h4>\n <table class=\"contrasting\">\n <tr>\n <th>Test</th>\n <th>Score</th>\n <th>Maximum</th>\n <th>Date</th>\n <th></th>\n </tr>\n\nHEREDOC;\n\t\t\n\t\t$row = mysqli_fetch_assoc($result);\n\t\twhile ($row) {\n\t\t\techo <<<HEREDOC\n <tr>\n <td>{$row['name']}</td>\n <td class=\"text-centered\">{$row['score']}</td>\n <td class=\"text-centered\">{$row['total']}</td>\n <td>{$row['formatted_date']}</td>\n <td><a href=\"Delete_Score?ID={$row['score_id']}&amp;xsrf_token={$_SESSION['xsrf_token']}\">Delete</a></td>\n </tr>\n\nHEREDOC;\n\t\t\t$row = mysqli_fetch_assoc($result);\n\t\t}\n\t\t\n\t\techo <<<HEREDOC\n </table>\nHEREDOC;\n\t}\n}", "public function actionPersonal()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t\n\t\t$record = SiteUser::model()->findByAttributes(array('id'=> Yii::app()->user->id));\n\t\t$this->render('personal',array('user'=>$record));\n\t}", "public function show(UserPersonalInfo $userPersonalInfo)\n {\n //\n }", "public function user()\n\t{\n\n\t\t$data['data_user'] = $this->model_admin->get_user();\n\t\t$data['halaman'] = 'view_user';\n\t\t$this->load->view('admin/page', $data);\n\t}", "public function pageUser($user_id){\n // Get the user to view\n $target_user = UserLoader::fetch($user_id); \n \n // Access-controlled resource\n if (!$this->_app->user->checkAccess('uri_users') && !$this->_app->user->checkAccess('uri_group_users', ['primary_group_id' => $target_user->primary_group_id])){\n $this->_app->notFound();\n }\n \n // Get a list of all groups\n $groups = GroupLoader::fetchAll();\n \n // Get a list of all locales\n $locale_list = $this->_app->site->getLocales();\n \n // Determine which groups this user is a member of\n $user_groups = $target_user->getGroups();\n foreach ($groups as $group_id => $group){\n $group_list[$group_id] = $group->export();\n if (isset($user_groups[$group_id]))\n $group_list[$group_id]['member'] = true;\n else\n $group_list[$group_id]['member'] = false;\n } \n \n // Determine authorized fields\n $fields = ['display_name', 'email', 'title', 'locale', 'groups', 'primary_group_id'];\n $show_fields = [];\n $disabled_fields = [];\n $hidden_fields = [];\n foreach ($fields as $field){\n if ($this->_app->user->checkAccess(\"view_account_setting\", [\"user\" => $target_user, \"property\" => $field]))\n $disabled_fields[] = $field;\n else\n $hidden_fields[] = $field;\n } \n \n // Always disallow editing username\n $disabled_fields[] = \"user_name\";\n \n // Hide password fields for editing user\n $hidden_fields[] = \"password\"; \n \n $this->_app->render('user_info.html', [\n 'page' => [\n 'author' => $this->_app->site->author,\n 'title' => \"Users | \" . $target_user->user_name,\n 'description' => \"User information page for \" . $target_user->user_name,\n 'alerts' => $this->_app->alerts->getAndClearMessages()\n ],\n \"box_id\" => 'view-user',\n \"box_title\" => $target_user->user_name,\n \"target_user\" => $target_user,\n \"groups\" => $group_list,\n \"locales\" => $locale_list,\n \"fields\" => [\n \"disabled\" => $disabled_fields,\n \"hidden\" => $hidden_fields\n ],\n \"buttons\" => [\n \"hidden\" => [\n \"submit\", \"cancel\"\n ]\n ],\n \"validators\" => \"{ none: ''}\" \n ]); \n }", "public function index(){\n $user_data = User::find(Auth::user() -> id);\n return view(\"admin.user-profile\",[\n \"user_data\" => $user_data,\n \"social\" => json_decode($user_data -> social)\n ]);\n }", "public function myProfile()\n {\n //make sure user is logged in\n Auth::checkAuthentication();\n \n //loads profile from session\n $this->View->render('user/myProfile'); \n }", "public function getProfile()\n\t{\n\t\t$user = Auth::user();\n $user->userReferee = User::find($user->referee->pid);\n\n /*if($user->accepter)\n $user->userAccepter = User::find($user->accepter->pid);\n */\n \n\t\t$region = User::find($user->region);\n\t\treturn View::make($this->views, compact('user','region'));\n\t}", "public function profile()\n {\n $loginUser = Auth::user();\n \n return view('mypage.profile', ['loginUser' => $loginUser]);\n }", "public function list_page_content () {\n // Check permissions\n if ( ! current_user_can( 'list_users' ) ) {\n return;\n }\n\n // Main listing query\n $this->list_query_users();\n\n // Set urls for column sorting links.\n $sort_link_username = $this->sort_link( 'user_name', $this->orderby, $this->order );\n $sort_link_displayname = $this->sort_link( 'display_name', $this->orderby, $this->order );\n\n // Include template\n include CTAL_PATH.'/admin/templates/users-page.php';\n }", "public function index()\n {\n $UserLocated = $this->UserData->FUserLogedInData(); \n\n $dados = [\n 'titulo' => 'WarnerAcademy | My Profile.',\n 'UserData' =>$UserLocated\n ]; \n \n \n /* Se nao Estiver Logado Mostrar a Home Page como Default.*/\n $template = $this->twig->loadTemplate('MyProfile.html');\n $template->display($dados); \n }", "public function index()\n {\n $user_details=User::all();\n\n return view('admin.pages.allusers.user_display',['user_details'=>$user_details]);\n }", "public function index()\n {\n $user = Auth::user();\n return view('user.profile', compact('user'));\n }", "public function showProfile()\n {\n\t\t$user = User::all();\n\n return View::make('users', array('users' => $user));\n }", "public function show(UserData $userData)\n {\n //\n }", "public function index()\n {\n\n $user_name = auth()->user()->name;\n\n return view('profile', [\"name\" => $user_name]);\n }", "public function index()\n\t{\n\t\treturn view('profile', ['user' => Auth::user()]);\n\t}", "public function show()\n {\n $id = Auth::user()->id;\n $user = User::findOrFail($id);\n\n return view('profile.show', compact('user'));\n }", "public function index()\n {\n $user = Auth::user();\n\n return view('profile', compact('user'));\n }", "public function pageProfile()\r\n {\r\n if (!user()) {\r\n $this->redirect('/login?r=' . urlencode('/profile'));\r\n }\r\n\r\n return $this->view('profile');\r\n }", "public function show()\n {\n $user = Auth::user();\n\n return view('profile/show', compact('user'));\n }", "public function index()\n {\n $personalInfo = PersonalInfo::where('user_id', Auth::user()->id)->first();\n if ($personalInfo) {\n return view('user.personal_info', compact('personalInfo'));\n }\n else {\n $personalInfo = new PersonalInfo();\n return view('user.personal_info', compact('personalInfo'));\n }\n }", "public function usersInfo(int $uid)\n {\n \t$user = User::where('uid', $uid)->with('addresses')->first();\n \t\n\t\tif($user === null) return response()->view(\"errors.404\", [], 404);\n\n\t\t$userAddressBook = $user->addresses;\n\n \t$data = [\n \t\t'userAddressBook'=> $userAddressBook,\n \t\t'user'=> $user\n \t];\n\n \treturn view('page.userInfo', $data);\n }", "public function index()\n {\n return view('admin.users.profile')->with('user', Auth::user());\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $user = $this->get('security.token_storage')->getToken()->getUser();\n $profile = $em->getRepository('AppBundle:UserProfile')->findOneBy(array('userId' => $user));\n\n if ($profile == null) {\n $profile = new UserProfile();\n $profile->setUserId($user);\n }\n\n return $this->render('custom_views/profile.html.twig', array(\n 'profile' => $profile,\n ));\n }", "public function profile()\r\n {\r\n // get the current user info\r\n $user = Auth::user();\r\n $data['item'] = [\r\n 'email' => $user->email,\r\n 'first_name' => $user->first_name,\r\n 'middle_name' => $user->middle_name,\r\n 'last_name' => $user->last_name,\r\n 'phone_1' => $user->phone_1,\r\n 'phone_2' => $user->phone_2,\r\n ];\r\n\r\n return View::make('user/profile')->with('data', $data);\r\n }", "public function getIndex()\n {\n $tricks = $this->tricks->findAllForUser($this->user, 12);\n\n $this->view('user.profile', compact('tricks'));\n }", "public function profile()\n\t{\n\t\t// echo $this->fungsi->user_login()->nik;\n\t\t$query = $this->user_m->get($this->fungsi->user_login()->nik);\n\t\t$data['data'] = $query->row();\n\t\t$this->template->load('template2', 'profile', $data);\n\t}", "public function admin_profile() {\n\n // nothing done here, everything happens in the view\n\n $user = $this->User->findById($this->Auth->user('id'));\n $this->set(compact('user'));\n }", "public function getUserDetail($uId){ \n\t\n\t $data = $this->User_model->getUser($uId);\n\t\tif(!empty($data)) {\n\t\t $this->load->view('admin/user_mgt/view_user', $data);\n\t\t return;\n\t\t}\n\t\techo '<h3 class=\"text-danger\">Record not found!</h3>';\n\t\t\n\t}", "public function user_profile() {\n $data['title'] = 'User Profile';\n return view('user-dashboard.user-profile', $data);\n }", "function view() \n {\n $api = new Module_UserManagement_API();\n\n /* TODO: Check if administrator */\n $users = $api->getUsers();\n $view = Core_View::factory('users');\n\n $view->users = $users;\n echo $view->render();\n }", "public final function display(){\n echo \"Username is{$this->user} and user id is{$this->userId}\";\n }", "public function showSingleUser(array $context) {\n\n echo $this->render('show_user.html', array(\n $this->user => $context[$this->user],\n $this->repos => $context[$this->repos],\n $this->followers => $context[$this->followers],\n $this->auth => $context[$this->auth],\n $this->search_q => $this->searchFieldName\n ));\n }", "public function userInformation(User $user)\n {\n return view('other.user.profileInfo', compact('user'));\n }", "public function viewUserAction()\n {\n \tif($this->getRequest()->getParam('id')){\n \t\t$db = new RsvAcl_Model_DbTable_DbUser();\n \t\t$user_id = $this->getRequest()->getParam('id');\n \t\t$rs=$db->getUser($user_id);\n \t\t//print_r($rs); exit;\n \t\t$this->view->rs=$rs;\n \t} \t \n \t\n }", "public function show()\n {\n $user = User::where('id',auth()->id())->first();\n return view('super.profile.show', [\n 'index' => $user,\n ]);\n }", "public function userAction()\n {\n \n $request = $this->getRequest();\n\n $inline\t= $request->getParam('inline');\n \n if($inline){\n\t $pix\t= Point_Model_Picture::getInstance();\n\t //$pix->makeThumbnail('');\n\t /*\n\t * Check if user is logged-in and act accordingly\n\t */\n\t $viewRenderer\t= Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setNoRender(true);\n\t \t$viewRenderer->setResponseSegment('userPane');\n\t \t\n\t \t$auth\t= Zend_Auth::getInstance();\n\t \t$this->view->username = Point_Model_User::getInstance()->fullname();\n\t\n\t \tif ($auth->hasIdentity()){ // We are to render the login profile menu\n\t \t\n\t \t$this->_helper->viewRenderer->render('userminipane');\n\t \n\t } else { // render 'Sign in' page\n\t\t \n\t\t /* create the dialog for user */\n\t\t \t$this->_prepareLoginDialog();\n\t\t \t$this->_helper->viewRenderer->render('-login');\n\t }\n\t \n } else { // accidentally called!!!\n \t$this->_helper->viewRenderer->setNoRender();\n \t$this->_redirect('/');\n }\n \n $this->_helper->viewRenderer->setNoRender(true);\n// $this->_helper->layout->disableLayout();\n\n }", "public function profile() {\n \t$data = array(\n \t\t'title' => \"PROFILE PAGE!\",\n \t\t'abstract' => \"Proin quis dui massa. Morbi scelerisque iaculis orci sed dictum. Suspendisse condimentum laoreet justo. Fusce imperdiet leo a dui rutrum, ac sollicitudin leo rutrum. Ut nec sapien ac turpis rhoncus fringilla non iaculis dolor. Morbi convallis purus nec elementum finibus. Morbi nisi ligula, interdum vitae est venenatis, accumsan efficitur leo. Donec dapibus nulla non lorem ullamcorper, quis rutrum erat hendrerit.\",\n \t\t'skills' => ['rails', 'github', 'mysql', 'laravel', 'seo', 'bla']\n \t);\n \t// return view(\"pages.profile\", compact('title'));\n \t\n \t// return view(\"pages.profile\")->with('title', $title);\n \treturn view(\"pages.profile\")->with($data);\n }", "public function show() {\n if (!auth()->check()) {\n return redirect()->route('/home');\n }\n\n $user = User::find(auth()->id());\n $userTickets = $user->tickets;\n $activeTickets = [];\n $historyTickets = [];\n foreach ($userTickets as $ticket) {\n $ticket->event->start_date >= Carbon::today() ? array_push($activeTickets, $ticket) : array_push($historyTickets, $ticket);\n }\n\n return view('pages.profile', ['user' => $user, 'activeTickets' => $activeTickets, 'historyTickets' => $historyTickets]);\n }", "public function showAction($userId) {\r\n\t\t$this->view->user = Users::findFirst ( $userId );\r\n\t}", "public function byuserAction()\n\t{\n\t\t$username = $this->_getParam('id');\n\t\t$this->view->username = $username;\n\t\t$this->view->comments = $this->_commentMapper->findByUser($username);\n\t\t$this->render('byuser');\n\t}", "public function View_My_Profile()\n\t{\n\t\t$this->_CheckLogged();\n\t\t\n\t\t$this->_processInsert($this->instructors_model->getMyPostId(),'view');\n\t}", "public function profile(){\n \t $student = User::where('id',Auth::user()->id)->first();\n \t return view('admission.profilebtechstudent', compact('student'));\n }" ]
[ "0.7224135", "0.71626943", "0.7110303", "0.69327706", "0.6925435", "0.69073224", "0.68932986", "0.6885799", "0.6861901", "0.6833864", "0.6778654", "0.67609996", "0.6750328", "0.6722173", "0.6695869", "0.66719735", "0.6646341", "0.6627301", "0.658597", "0.6581641", "0.6575476", "0.65716094", "0.65528977", "0.65270656", "0.65233004", "0.6517425", "0.65152997", "0.6510669", "0.6509607", "0.6502155", "0.6488816", "0.64880365", "0.6479483", "0.64673746", "0.6467301", "0.64569855", "0.64539087", "0.6453088", "0.6435124", "0.64285845", "0.6418358", "0.6411569", "0.64106464", "0.6410569", "0.6402415", "0.64018774", "0.6390396", "0.6376906", "0.6376814", "0.6372317", "0.63721114", "0.6362938", "0.63626295", "0.6362447", "0.635322", "0.634621", "0.63451993", "0.6339964", "0.63272583", "0.6324472", "0.63178605", "0.6305323", "0.6304848", "0.6301178", "0.6300882", "0.6298318", "0.6293105", "0.6288579", "0.6283238", "0.62808263", "0.6277031", "0.62732494", "0.626642", "0.62647045", "0.62618333", "0.6251857", "0.62477684", "0.6246725", "0.6243641", "0.624127", "0.62359625", "0.6235822", "0.6235341", "0.6233791", "0.6233231", "0.6230211", "0.62234205", "0.62218773", "0.6220427", "0.6218884", "0.6213611", "0.62012273", "0.6198623", "0.61985123", "0.61979467", "0.61921144", "0.6178496", "0.61752206", "0.61739516", "0.61678046", "0.61576456" ]
0.0
-1
Allow admin to disable user accounts.
public function disableAccount($userId) { if (Auth::user()->id == $userId) { return response()->json([ 'title' => 'Ooops.', 'message' => 'Nu îți poți dezactiva contul tău.', ], 422); } User::where('id', $userId)->update([ 'disabled' => true ]); return response()->json([ 'title' => 'Succes!', 'message' => 'Contul a fost dezactivat!' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function admin_disable($id = null) {\n\n\t\t$user = $this->User->read(null, $id);\n\n\t\t/**\n\t\t * Read the \"Status\" component for more informations.\n\t\t * Dir : controllers/components/status.php\n\t\t */\n\t\tif (!empty($user)) {\n\n\t\t\t$user['User']['status'] = 1;\n\n\t\t\t/**\n\t\t\t * Change the user status.\n\t\t\t * Redirect the administrator to index page.\n\t\t\t */\n\t\t\tif ($this->User->save($user)) {\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has been disabled.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t}\n\t\t}\n\n\t}", "public function disable_user() \n {\n $conn = $this->conn;\n $login = $this->login;\n \n $params = array($login);\n $query = \"UPDATE users SET enabled = -1 WHERE login = ?\";\n \n $rs = $conn->Execute($query, $params);\n \n if (!$rs) \n { \n return FALSE;\n }\n \n $infolog = array($login);\n Log_action::log(93, $infolog);\n \n return TRUE;\n }", "public function disable()\n {\n $id=$this->seguridad->verificateInt($_REQUEST['delete_id']);\n $token = $_REQUEST['token'];\n $option = $this->seguridad->verificateInt(intval($_REQUEST['option']));\n if($id && $token && $option)\n {\n parent::DisableUser($id,$token,$option);\n }\n return;\n }", "function disableAdministrator($id) {\r\n\r\n\t\t$this->query('UPDATE admins SET `enabled` = 0 WHERE id= '. $id .';');\r\n\r\n\t}", "Public Function disableUser($ID)\n\t{\n\t\t$this->_db->exec(\"UPDATE bevomedia_user SET enabled = 0 WHERE id = $ID\");\n\t}", "public function disable();", "public function disable()\n {\n $user = User::where('idPerson', '=', \\Auth::user()->idPerson)->first();\n $user->status = 2;\n $user->confirmation_code = NULL;\n $user->save();\n return Redirect::to('logout');\n }", "public function disable() {}", "function disable($target_username) {\n $this->stmnt('UPDATE USERS SET DISABLED=\\'yes\\', TIMESTAMP_CHANGE = NOW() WHERE MONK_ID = \\'' . $target_username . '\\'');\n }", "public function user_disable($username,$isGUID=false){\n if ($username===NULL){ return (\"Missing compulsory field [username]\"); }\n $attributes=array(\"enabled\"=>0);\n $result = $this->user_modify($username, $attributes, $isGUID);\n if ($result==false){ return (false); }\n \n return (true);\n }", "function disableAccount($accountId)\n\t\t{\n\t\t\tmysql_query(\"UPDATE argus_accounts SET status = 'DISABLED' WHERE account_id = '\".$accountId.\"' AND status = 'ENABLED'\") or die(mysql_error());\n\t\t\t\n\t\t\treturn;\n\t\t}", "public function disable_adminbar(){\t\t\n\t\tif( ! current_user_can('manage_options') ){\n\t\t\tshow_admin_bar(false);\n\t\t}\n\t}", "public function adminOnly();", "public function adminOnly();", "private function __allowSuperAdminOnly() {\n\t\t$isSuperAdmin = $this->_isSuperAdmin();\n\t\tif ($isSuperAdmin === false) {\n\t\t\t$this->redirect('/admin/users/accessDenied');\n\t\t}\n\t}", "public function onDisable() {\n\t}", "function disableAccount($userID, $enabled)\n {\n if ($enabled)\n {\n $newStatus = 0;\n }\n else\n {\n $newStatus = 1;\n }\n return $this->data->updateUserStatus($userID, $newStatus);\n }", "public function disable($user_id = 0)\n {\n header('Content-Type: application/json'); //set response type to be json\n admin_session_check();\n if(!$user_id) show_404();\n $user = $this->users_model->get_record($user_id);\n if(!isset($user->user_id))\n {\n $ajax_response = array('type' => AJAX_RESPONSE_TYPE_ERROR, 'message' => get_alert_html($this->lang->line('error_invalid_request'), ALERT_TYPE_ERROR));\n echo json_encode($ajax_response);\n exit();\n }\n if($user->user_id == $this->session->userdata('user_id'))\n {\n $ajax_response = array('type' => AJAX_RESPONSE_TYPE_ERROR, 'message' => get_alert_html($this->lang->line('error_disable_self'), ALERT_TYPE_ERROR));\n echo json_encode($ajax_response);\n exit();\n }\n $this->users_model->update_user_status($user_id, USER_STATUS_INACTIVE);\n $ajax_response = array('type' => AJAX_RESPONSE_TYPE_SUCCESS, 'message' => get_alert_html($this->lang->line('success_user_disabled'), ALERT_TYPE_SUCCESS));\n echo json_encode($ajax_response);\n }", "public function is_admin_only()\n\t{\n\t\treturn false;\n\t}", "public static function disable(){\n self::$disabled = true; \n self::$enabled = false;\n }", "protected function isAdminUser() {}", "function disable_user($email) {\n // Build the query\n $query = \"UPDATE UserAccount SET enabled=0 WHERE email = ?\";\n // Execute the query\n $result = $this->db->query($query, $email);\n // Check if the row was affected\n if ($this->db->affected_rows() == 1) {\n $message = \"Success: account disabled.\";\n } else {\n $message = \"Error: failed to disable account.\";\n }\n // Return the result message\n return $message;\n }", "public function is_user_disabled() \n {\n $conn = $this->conn;\n $login = $this->login;\n \n $clogin = $conn->GetOne(\"SELECT login FROM users WHERE login = '\".$login.\"' AND expires > '\".gmdate('Y-m-d H:i:s').\"'\");\n \n if ($clogin == '') \n {\n $this->conn->Execute(\"UPDATE users SET enabled=0 WHERE login= '\".$login.\"'\");\n }\n \n $conf = $GLOBALS['CONF'];\n $lockout_duration = intval($conf->get_conf(\"unlock_user_interval\")) * 60; \n \n \n $params = array($login);\n $query = \"SELECT * FROM users WHERE login = ? AND enabled <= 0\";\n \n $rs = $conn->Execute($query, $params); \n \n if (!$rs) \n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n \n return FALSE;\n }\n \n if (!$rs->EOF) \n {\n // User must be unlocked by admin\n if ($lockout_duration == 0 || $rs->fields['enabled'] == 0) \n { \n return TRUE; \n }\n \n //Auto-enable if account lockout duration expires\n if (time() - strtotime($rs->fields['last_logon_try']) >= $lockout_duration) \n {\n $conn->Execute('UPDATE users SET enabled = 1 WHERE login=?', $params);\n \n return FALSE;\n }\n \n return TRUE;\n }\n \n return FALSE;\n }", "public static function denyAccess()\n {\n static::redirect(static::adminPath(), cbTrans('denied_access'));\n }", "public function banUser(){\n if($this->adminVerify()){\n\n }else{\n echo \"Vous devez avoir les droits administrateur pour accéder à cette page\";\n }\n }", "public function admin_disable($id = null) {\n\n\t\t\t/*disable rendering of view*/\n\t\t\t$this->autoRender = false;\n\n\t\t\t/*set activity as \"Disable\"*/\n\t\t\t$act=array('activ'=>'0');\n\n\t\t\t/*save activity parameter to table \"modules\"*/\n\t\t\t$this->Module->id=$id;\n\t\t\t$this->Module->save($act);\n\n\t\t\t/*back to method \"admin_index\"*/\n\t\t\t$this->redirect(array('action' => 'admin_index'));\n\t\t\t}", "function btwp_restrict_admin_access() {\n\t\n\tglobal $current_user;\n\tget_currentuserinfo();\n\t\n\tif( !array_key_exists( 'administrator', $current_user->caps ) ) {\n\t\twp_redirect( get_bloginfo( 'url' ) );\n\t\texit;\n\t}\n\n}", "public function disabled();", "public function disabled();", "public function disable_user(Request $request)\n {\n $user = User::findOrFail($request->id);\n $user->estado = '0';\n $user->save();\n }", "public function disable(): void\n {\n $this->disabled = true;\n }", "function admin_enable($id = null) {\n\n\t\t$user = $this->User->read(null, $id);\n\n\t\t/**\n\t\t * Read the \"Status\" component for more informations.\n\t\t * Dir : controllers/components/status.php\n\t\t */\n\t\tif (!empty($user)) {\n\n\t\t\t$user['User']['status'] = 0;\n\n\t\t\t/**\n\t\t\t * Change the user status.\n\t\t\t * Redirect the administrator to index page.\n\t\t\t */\n\t\t\tif ($this->User->save($user)) {\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has been enabled.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t}\n\t\t}\n\n\t}", "function wbcDisabled() {\n if ( ! current_user_can('edit_posts') ) {\n add_filter('show_admin_bar', '__return_false');\n }\n}", "public function mustbeadmin()\n {\n if (!$this->hasadmin())\n {\n $this->web()->noaccess();\n }\n }", "public function disable()\n {\n $this->enabled = false;\n }", "function authorizedAdminOnly(){\n global $authenticatedUser;\n if(!$authenticatedUser['admin']){\n header(\"HTTP/1.1 403 Forbidden\");\n header(\"Location: https://eso.vse.cz/~frim00/marvelous-movies/error-403\");\n exit();\n }\n }", "protected function toggleDisableAction() {}", "function dokan_disable_admin_bar( $show_admin_bar ) {\n global $current_user;\n\n if ( $current_user->ID !== 0 ) {\n $role = reset( $current_user->roles );\n\n if ( in_array( $role, array( 'seller', 'customer' ) ) ) {\n return false;\n }\n }\n\n return $show_admin_bar;\n}", "protected static function isAdminUser() {\r\n throw new \\Excpetion('yet to implement');\r\n }", "function admin_disable($id = null) {\n\n\t\t$subdomain = $this->Subdomain->read(null, $id);\n\n\t\t/**\n\t\t * Read the \"Status\" component for more informations.\n\t\t * Dir : controllers/components/status.php\n\t\t */\n\t\tif (!empty($subdomain)) {\n\n\t\t\t$subdomain['Subdomain']['status'] = 1;\n\n\t\t\t/**\n\t\t\t * Select the subdomain name with the ID.\n\t\t\t * It's necessary for the insert in the \"robot\" table.\n\t\t\t * @var string\n\t\t\t */\n\t\t\t$data = $this->Robot->search($id, 'Subdomain');\n\n\t\t\t/**\n\t\t\t * Change the subdomain status.\n\t\t\t * Redirect the administrator to index page.\n\t\t\t */\n\t\t\tif ($this->Subdomain->save($subdomain)) {\n\n\t\t\t\t/**\n\t\t\t\t * Insert the delete action in the \"robot\" table.\n\t\t\t\t * The Perl robot will check in this table.\n\t\t\t\t */\n\t\t\t\t$this->Robot->insert($data['Subdomain']['name'], 'SUBDOMAIN', $data['User']['name'], NULL, $data['Subdomain']['domain_id'], NULL, 4);\n\n\t\t\t\t/**\n\t\t\t\t * Insert the disable action in the \"logs\" table.\n\t\t\t\t */\n\t\t\t\t$this->Logs->insert($this->Auth->user('id'), '<strong>[ ' . $data['Subdomain']['name'] . ' ]</strong> ' . __d('domain', 'Subdomain disabled by (' . $this->Auth->user('name') . ').', true) , 'DNS', $_SERVER[\"REMOTE_ADDR\"]);\n\n\t\t\t\t$this->Session->setFlash(__d('domain', 'The subdomain has been disabled.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t}\n\t\t}\n\n\t}", "public function isAdministrador(){ return false; }", "public function disableTwoFactorAuth(): void\n {\n $this->twoFactorAuth->flushAuth()->delete();\n\n event(new Events\\TwoFactorDisabled($this));\n }", "public static function disable()\n {\n self::$_enabled = FALSE;\n }", "public function disable() {\n\t\t$this->update(TRUE);\n\t}", "public function disable(): bool {}", "public function disable_couch_user() {\n $query = 'UPDATE couchs ';\n $query .= 'SET enabled=FALSE ';\n $query .= 'WHERE user_id=' . $this->id;\n\n $connection = get_connection();\n $query_result = $connection->query($query);\n\n $connection->close();\n\n return $query_result;\n }", "public function isDisabled()\n {\n // TODO AccessControl or checking Role?\n /*if (Yii::$app->user->username !== 'admin') {\n return true;\n }*/\n\n return $this->parentIsDisabled();\n }", "public static function disable(): void\n {\n static::$_enabled = false;\n }", "function IsAdmin()\n{\n\treturn false;\n}", "public function enableUserAndGroupSupport(){\n\t\treturn false;\n\t}", "public static function disable() {\n\t\tself::$enabled = false;\n\t}", "public function executeDisabled()\n {\n }", "public static function disable(): void\n {\n self::$isEnabled = false;\n }", "public function logAdminOff()\n {\n //session must be started before anything\n session_start ();\n\n // Add the session name user_id to a variable $id\n $id = $_SESSION['user_id'];\n\n //if we have a valid session\n if ( $_SESSION['logged_in'] == TRUE )\n {\n $lastActive = date(\"l, M j, Y, g:i a\");\n $online= 'OFF';\n $sql = \"SELECT id,online, last_active FROM users WHERE id = '\".$id.\"'\";\n $res = $this->processSql($sql);\n if ($res){\n $update = \"UPDATE users SET online ='\".$online.\"', last_active ='\".$lastActive.\"' WHERE id = '\".$id.\"'\";\n $result = $this->processSql($update);\n }\n //unset the sessions (all of them - array given)\n unset ( $_SESSION );\n //destroy what's left\n session_destroy ();\n\n header(\"Location: \".APP_PATH.\"admin_login\");\n }\n\n\n \t\t//It is safest to set the cookies with a date that has already expired.\n \t\tif ( isset ( $_COOKIE['cookie_id'] ) && isset ( $_COOKIE['authenticate'] ) ) {\n \t\t\t/**\n \t\t\t\t* uncomment the following line if you wish to remove all cookies\n \t\t\t\t* (don't forget to comment or delete the following 2 lines if you decide to use clear_cookies)\n \t\t\t*/\n \t\t\t//clear_cookies ();\n \t\t\tsetcookie ( \"cookie_id\", '', time() - 3600);\n \t\t\tsetcookie ( \"authenticate\", '', time() - 3600 );\n \t\t}\n\n \t}", "function allowPasswordChange() {\n return false;\n }", "function is_user_admin()\n {\n }", "function revoke_super_admin($user_id)\n {\n }", "public function disableAccountForAuthFailures($user_id){\r\n\tglobal $pdo;\r\n\ttry{\r\n\t$update = $pdo->prepare(\"UPDATE users \r\n\tSET `status_reason` = ?, `status` = 0\r\n\tWHERE id = ?\");\r\n\t$update->execute(array('auth_failure', $user_id));\r\n\t}\r\n\tcatch(PDOException $e){\r\n\t\t$this->setError($e->getMessage());\r\n\t\treturn false;\r\n\t}\r\n\t// Also remove failed login attempts\r\n\t// from the log table\r\n\t$this->user_id = $user_id;\r\n $this->removeFailedLoginAttempts();\r\n\t$this->user_id = null;\r\n\treturn true;\r\n}", "public function disable(User $user){\n return $this->respond($user->disable());\n }", "public function setAsAdmin()\n {\n if (!in_array('admin', $this->roles)) {\n $this->roles[] = 'admin';\n }\n }", "function allow_admin_privileges() {\n\tif($_SESSION['role']!=='administrator'):\n\t\theader('Location: ?q=start');\n\tendif;\n}", "public function disableTwoFactorAuth()\n {\n if (! Authy::isEnabled($this->theUser)) {\n return redirect()->route('profile')\n ->withErrors(trans('app.2fa_not_enabled_for_this_user'));\n }\n\n Authy::delete($this->theUser);\n\n $this->theUser->save();\n\n event(new TwoFactorDisabled);\n\n return redirect()->route('profile')\n ->withSuccess(trans('app.2fa_disabled'));\n }", "function isDisabled($useraccountcontrol) {\n\t$accountdisable = 0x0002 & $useraccountcontrol;\t\n\n if ($accountdisable == 2) {\n\t\treturn true;\n } \t\t\n \n return false;\n}", "public function disabledEnabled(Users $user)\n {\n if ($user->isEnabled()) {\n $user->setEnabled(false);\n } else {\n $user->setEnabled(true);\n }\n\n $this->getEntityManager()->flush($user);\n }", "function block_wp_admin() {\n\tif ( is_admin() && ! current_user_can( 'administrator' ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {\n\t\twp_safe_redirect( home_url() );\n\t\texit;\n\t}\n}", "protected function isCurrentUserAdmin() {}", "protected function isCurrentUserAdmin() {}", "function restrict_users_from_changeing_admin_theme () {\n\t$users = get_users();\n\tforeach ($users as $user) {\n\t\tremove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );\n\t\tupdate_user_meta($user->ID, 'admin_color', 'brightlight');\n\t}\n\tif (!current_user_can('manage_options')) {\n\t\tremove_action('admin_color_scheme_picker','admin_color_scheme_picker');\n\t}\n}", "public function disable_user(User $user)\n {\n $this->authorize('disable_user', User::class);\n $user->active = 0;\n $user->save();\n\n if($user->verify_if_current_user_account_is_disabled())\n {\n auth()->logout();\n return redirect('/');\n }\n\n return redirect()->route('edit_user_path', $user->id);\n }", "private function notAdmin() : void\n {\n if( intval($this->law) === self::CREATOR_LAW_LEVEL)\n {\n (new Session())->set('user','error','Impossible d\\'effectuer cette action');\n header('Location:' . self::REDIRECT_HOME);\n die();\n }\n }", "function disable()\n{\n\t$args = func_get_args();\n\tif (is_array($args[0])) $args = $args[0];\n\t$this->enable($args, false);\n}", "function carton_disable_admin_bar( $show_admin_bar ) {\n\t\tif ( get_option('carton_lock_down_admin')=='yes' && ! ( current_user_can('edit_posts') || current_user_can('manage_carton') ) ) {\n\t\t\t$show_admin_bar = false;\n\t\t}\n\n\t\treturn $show_admin_bar;\n\t}", "public function disable($crypt_id)\n\t{\n\t\t$user_id = Crypt::decrypt($crypt_id);\n\n\t\tif (!$this->userService->disable($user_id))\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($this->userService->errors())->withInput();\n\t\t}\n\n\t\tAlert::success('User successfully disabled!')->flash();\n\n\t\treturn Redirect::route('dashboard.users.index');\n\t}", "public function adminUserConditionDoesNotMatchRegularUser() {}", "function wpcom_vip_disable_zemanta_for_all_users() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "function enableAdministrator($id) {\r\n\r\n\t\t$this->query('UPDATE admins SET `enabled` = 1 WHERE id= '. $id .';');\r\n\r\n\t}", "function disable_salesperson($user_id) {\n\n $conn = db_connect();\n\n // Prepared statement for selecting salesperson dropdown options\n $disable_salesperson_stmt = pg_prepare(\n $conn,\n \"disable_salesperson_stmt\",\n \"UPDATE users SET enabled = false, type = 'd' WHERE id = $user_id;\"\n );\n\n $result = pg_execute($conn, \"disable_salesperson_stmt\", array());\n}", "public function disablePostAuthentication()\n {\n $this->sessionStorage->user['twofactor_activated'] = false;\n }", "function _deactivate_user() {\n\t\t$sql=\"SELECT GROUP_CONCAT(id_user) as id FROM \".TABLE_PREFIX.\"user WHERE DATEDIFF(current_date(),last_login) = \".$this->_input['day'].\" AND id_admin <> 1 \";\n\t\t$ids= getsingleindexrow($sql);\n\t\tif($this->_input['day'] && $this->_input[\"flag\"] == 1){\n\t\t if($ids['id']!=\"\"){\n\t\t\t $arr['user_status']=0;\n\t\t\t $this->obj_user->update_this(\"user\",$arr,\"id_user IN (\".$ids['id'].\")\");\n\t\t\t $this->obj_user->update_this(\"meme\",$arr,\"id_user IN (\".$ids['id'].\")\");\n\t\t\t $this->obj_user->update_this(\"reply\",$arr,\"id_user IN (\".$ids['id'].\")\");\n\t\t\t $this->obj_user->update_this(\"caption\",$arr,\"id_user IN (\".$ids['id'].\")\");\n\t\t\t print \"Succesfully Done\";\n\t\t }else{\n\t\t\t print \"No user found\";\n\t\t\t exit;\n\t\t }\n\t\t }else{\n\t\t if($ids['id']!=\"\"){\n\t\t\t $arr=explode(\",\", $ids['id']);\n\t\t\t for($x=0;$x<count($arr);$x++){\n\t\t\t $del=$this->unlink_files($arr[$x]);\n\t\t\t }\n\t\t\t $this->obj_user->deleteuser($ids['id']);\n\t\t }\n\t\t}\n\t}", "public function is_disabled()\n {\n }", "public function isUserAdmin()\n\t{\n\t\treturn (Bn::getValue('user_type') == 'A');\n\t}", "function admin_protect() {\n global $user_data;\n if($user_data['type'] != 1) {\n header(\"location: index.php\");\n exit();\n }\n }", "public function disable($disabledByUserId = null)\n\t{\n\t\tif (!$disabledByUserId) {\n\t\t\tif (auth()->user()) $disabledByUserId = auth()->id();\n\t\t}\n\n\t\tif ($disabledByUserId) {\n\t\t\t$this->disabled_by_user_id = $disabledByUserId;\n\t\t}\n\n\t\t$this->disabled_at = now();\n\t\t$this->setRememberToken(null);\n\n\t\t$this->save();\n\t}", "public function disable_powered_by() {\n\t\tupdate_option( 'algolia_powered_by_enabled', 'no' );\n\t}", "public function _isAdmin() {\n\t\t$user_id = $this->Auth->user('id');\n\t\t$aro = array('model' => 'User', 'foreign_key' => $user_id); \n\t\t$aco = 'role/super/admin';\n\t\treturn $this->Acl->check($aro, $aco);\n\t}", "public function removeUserAdminPermissions ( Request $request )\n {\n \n $id = $request['id'];\n $user = User::find( $id );\n\n if( $user->id == \\Auth::user()->id )\n {\n return(\n back()\n ->with( [ 'flash_error' => 'You cannot update your own admin access.' ] )\n );\n }\n\n $user->is_admin = false;\n $user->save();\n\n return(\n back()\n ->with( [ 'flash_success' => 'You have successfully removed this users admin access.' ] )\n );\n \n }", "function pilau_edit_user_cap_protect_admins( $allcaps, $cap, $args ) {\n\n\t// If the check is about editing or deleting users and the user is specified\n\tif ( in_array( $args[0], array( 'edit_user', 'delete_user' ) ) && ! empty( $args[2] ) ) {\n\n\t\t// Get the user\n\t\t$user = new WP_User( $args[2] );\n\n\t\t// If the user in question is an admin and the current user isn't...\n\t\tif ( user_can( $user, 'update_core' ) && ! user_can( $args[1], 'update_core' ) ) {\n\t\t\t$allcaps[ $args[0] . 's' ] = false;\n\t\t}\n\n\t}\n\n\treturn $allcaps;\n}", "public static function isAllowed() {\r\n\t\treturn TodoyuAuth::isAdmin();\r\n\t}", "function enableUser()\n {\n if($this->isAdmin() == TRUE)\n {\n echo(json_encode(array('status'=>'access')));\n }\n else\n {\n $userId = $this->input->post('userId');\n $userInfo = array('isDeleted'=>0,'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:s'));\n \n $result = $this->user_model->deleteUser($userId, $userInfo);\n \n if ($result > 0) { echo(json_encode(array('status'=>TRUE))); }\n else { echo(json_encode(array('status'=>FALSE))); }\n }\n }", "private function action_adminAccount()\n\t{\n\t\tglobal $txt, $db_type, $db_connection, $databases, $incontext, $db_prefix, $db_passwd, $webmaster_email;\n\t\tglobal $db_persist, $db_server, $db_user, $db_port;\n\t\tglobal $db_type, $db_name, $mysql_set_mode;\n\n\t\t$incontext['sub_template'] = 'admin_account';\n\t\t$incontext['page_title'] = $txt['user_settings'];\n\t\t$incontext['continue'] = 1;\n\n\t\t// Need this to check whether we need the database password.\n\t\trequire(TMP_BOARDDIR . '/Settings.php');\n\t\tif (!defined('ELK'))\n\t\t{\n\t\t\tdefine('ELK', 1);\n\t\t}\n\t\tdefinePaths();\n\n\t\t// These files may be or may not be already included, better safe than sorry for now\n\t\trequire_once(SOURCEDIR . '/Subs.php');\n\n\t\t$db = load_database();\n\n\t\tif (!isset($_POST['username']))\n\t\t{\n\t\t\t$_POST['username'] = '';\n\t\t}\n\n\t\tif (!isset($_POST['email']))\n\t\t{\n\t\t\t$_POST['email'] = '';\n\t\t}\n\n\t\t$incontext['username'] = htmlspecialchars(stripslashes($_POST['username']), ENT_COMPAT, 'UTF-8');\n\t\t$incontext['email'] = htmlspecialchars(stripslashes($_POST['email']), ENT_COMPAT, 'UTF-8');\n\t\t$incontext['require_db_confirm'] = empty($db_type) || !empty($databases[$db_type]['require_db_confirm']);\n\n\t\t// Only allow create an admin account if they don't have one already.\n\t\t$db->skip_next_error();\n\t\t$request = $db->query('', '\n\t\t\tSELECT \n\t\t\t\tid_member\n\t\t\tFROM {db_prefix}members\n\t\t\tWHERE id_group = {int:admin_group} \n\t\t\t\tOR FIND_IN_SET({int:admin_group}, additional_groups) != 0\n\t\t\tLIMIT 1',\n\t\t\tarray(\n\t\t\t\t'admin_group' => 1,\n\t\t\t)\n\t\t);\n\t\t// Skip the step if an admin already exists\n\t\tif ($request->num_rows() != 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t$request->free_result();\n\n\t\t// Trying to create an account?\n\t\tif (isset($_POST['password1']) && !empty($_POST['contbutt']))\n\t\t{\n\t\t\t// Wrong password?\n\t\t\tif ($incontext['require_db_confirm'] && $_POST['password3'] != $db_passwd)\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_db_connect'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Not matching passwords?\n\t\t\tif ($_POST['password1'] != $_POST['password2'])\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_user_settings_again_match'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// No password?\n\t\t\tif (strlen($_POST['password1']) < 4)\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_user_settings_no_password'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (!file_exists(SOURCEDIR . '/Subs.php'))\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_subs_missing'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Update the main contact email?\n\t\t\tif (!empty($_POST['email']) && (empty($webmaster_email) || $webmaster_email == 'noreply@myserver.com'))\n\t\t\t{\n\t\t\t\tupdateSettingsFile(array('webmaster_email' => $_POST['email']));\n\t\t\t}\n\n\t\t\t// Work out whether we're going to have dodgy characters and remove them.\n\t\t\t$invalid_characters = preg_match('~[<>&\"\\'=\\\\\\]~', $_POST['username']) != 0;\n\t\t\t$_POST['username'] = preg_replace('~[<>&\"\\'=\\\\\\]~', '', $_POST['username']);\n\n\t\t\t$db->skip_next_error();\n\t\t\t$result = $db->query('', '\n\t\t\t\tSELECT \n\t\t\t\t\tid_member, password_salt\n\t\t\t\tFROM {db_prefix}members\n\t\t\t\tWHERE member_name = {string:username} \n\t\t\t\t\tOR email_address = {string:email}\n\t\t\t\tLIMIT 1',\n\t\t\t\tarray(\n\t\t\t\t\t'username' => stripslashes($_POST['username']),\n\t\t\t\t\t'email' => stripslashes($_POST['email']),\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ($result->num_rows() != 0)\n\t\t\t{\n\t\t\t\tlist ($incontext['member_id'], $incontext['member_salt']) = $result->fetch_row();\n\t\t\t\t$result->free_result();\n\n\t\t\t\t$incontext['account_existed'] = $txt['error_user_settings_taken'];\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (trim($_POST['username']) === '' || strlen($_POST['username']) > 25)\n\t\t\t{\n\t\t\t\t// Try the previous step again.\n\t\t\t\t$incontext['error'] = $_POST['username'] == '' ? $txt['error_username_left_empty'] : $txt['error_username_too_long'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ($invalid_characters || $_POST['username'] == '_' || $_POST['username'] == '|' || strpos($_POST['username'], '[code') !== false || strpos($_POST['username'], '[/code') !== false)\n\t\t\t{\n\t\t\t\t// Try the previous step again.\n\t\t\t\t$incontext['error'] = $txt['error_invalid_characters_username'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (empty($_POST['email']) || !filter_var(stripslashes($_POST['email']), FILTER_VALIDATE_EMAIL) || strlen(stripslashes($_POST['email'])) > 255)\n\t\t\t{\n\t\t\t\t// One step back, this time fill out a proper email address.\n\t\t\t\t$incontext['error'] = sprintf($txt['error_valid_email_needed'], $_POST['username']);\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// All clear, lets add an admin\n\t\t\trequire_once(SUBSDIR . '/Auth.subs.php');\n\n\t\t\t$incontext['member_salt'] = substr(base64_encode(sha1(mt_rand() . microtime(), true)), 0, 16);\n\n\t\t\t// Format the username properly.\n\t\t\t$_POST['username'] = preg_replace('~[\\t\\n\\r\\x0B\\0\\xA0]+~', ' ', $_POST['username']);\n\t\t\t$ip = isset($_SERVER['REMOTE_ADDR']) ? substr($_SERVER['REMOTE_ADDR'], 0, 255) : '';\n\n\t\t\t// Get a security hash for this combination\n\t\t\t$password = stripslashes($_POST['password1']);\n\t\t\t$incontext['passwd'] = validateLoginPassword($password, '', $_POST['username'], true);\n\n\t\t\t$request = $db->insert('',\n\t\t\t\t$db_prefix . 'members',\n\t\t\t\tarray(\n\t\t\t\t\t'member_name' => 'string-25', 'real_name' => 'string-25', 'passwd' => 'string', 'email_address' => 'string',\n\t\t\t\t\t'id_group' => 'int', 'posts' => 'int', 'date_registered' => 'int', 'hide_email' => 'int',\n\t\t\t\t\t'password_salt' => 'string', 'lngfile' => 'string', 'avatar' => 'string',\n\t\t\t\t\t'member_ip' => 'string', 'member_ip2' => 'string', 'buddy_list' => 'string', 'pm_ignore_list' => 'string',\n\t\t\t\t\t'message_labels' => 'string', 'website_title' => 'string', 'website_url' => 'string',\n\t\t\t\t\t'signature' => 'string', 'usertitle' => 'string', 'secret_question' => 'string',\n\t\t\t\t\t'additional_groups' => 'string', 'ignore_boards' => 'string',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tstripslashes($_POST['username']), stripslashes($_POST['username']), $incontext['passwd'], stripslashes($_POST['email']),\n\t\t\t\t\t1, 0, time(), 0,\n\t\t\t\t\t$incontext['member_salt'], '', '',\n\t\t\t\t\t$ip, $ip, '', '',\n\t\t\t\t\t'', '', '',\n\t\t\t\t\t'', '', '',\n\t\t\t\t\t'', '',\n\t\t\t\t),\n\t\t\t\tarray('id_member')\n\t\t\t);\n\n\t\t\t// Awww, crud!\n\t\t\tif ($request->hasResults() === false)\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_user_settings_query'] . '<br />\n\t\t\t\t<div style=\"margin: 2ex;\">' . nl2br(htmlspecialchars($db->last_error($db_connection), ENT_COMPAT, 'UTF-8')) . '</div>';\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$incontext['member_id'] = $db->insert_id(\"{$db_prefix}members\", 'id_member');\n\n\t\t\t// If we're here we're good.\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function disable( $name );", "function toggle_user($username,$force_disable=false){\n\n\t//Toggle enable status\n\t$my_row=array();\n\t$row =_user_load_user($username);\n\t//var_dump($row);\n\tif ($row['STATUS']==\"1\"){\n\t\t$my_row['ABILITATO']=\"0\";\n\t\t$enab = \"DISABLED\";\n\t}else{\n\t\t$my_row['ABILITATO']=\"1\";\n\t\t$enab = \"ENABLED\";\n\t}\n\tif($force_disable){\n\t\t$my_row['ABILITATO']=\"0\";\n\t\t$enab = \"DISABLED\";\n\t}\n\t$my_row['USERID'] = $row['USERID'];\n\t//var_dump($my_row);\n\t$retval = true;\n\t$table = \"UTENTI\";\n\t$action = ACT_MODIFY;\n\t$keys = array('USERID');\n\t//common_add_message(print_r($row,true),INFO);\n\tif (db_form_updatedb($table, $my_row, $action, $keys)){\n\t\t//common_add_message(\"Privilege $enab\", INFO);\n\t}else{\n\t\t//common_add_message(\"Error during privilege toggling\", ERROR);\n\t\t$retval = false;\n\t}\n\tif($retval){\n\t\tdb_commit();\n\n\t}\n\tif(isAjax()){\n\t\techo json_encode(array(\"sstatus\" => $retval ? \"ok\" : \"ko\", \"return_value\"=>$retval));\n\t\tdb_close();die();\n\t}\n\telse {\n\t\tdb_close();\n\t\treturn $retval;\n\t}\n}", "public function allowPasswordChange()\n {\n return false;\n }", "function disableAuth($value = true){\n\t\t$GLOBALS['amfphp']['disableAuth'] = $value;\n\t}", "protected function _disable_staff_filter()\n {\n return true;\n }", "public function disable_reservation_user() {\n $query = 'UPDATE reservations ';\n $query .= 'SET state_id = 3 ';\n $query .= 'WHERE state_id IN (1,2) ';\n $query .= 'AND user_id=' . $this->id;\n\n $connection = get_connection();\n $query_result = $connection->query($query);\n\n $connection->close();\n\n return $query_result;\n }", "function remove_admin_bar() {\n\tif ( !current_user_can ( 'delete_users' ) ) {\n\t\tshow_admin_bar(false);\n\t}\n}", "public function isDisabled() {}", "public function administrador()\n {\n return false;\n }", "public function requireAdmin(){\n if( ! Authentifiacation::isAdmin()){\n Authentifiacation::rememberRequestedPage();\n Flash::addMessage('You need to have admin status to access this page', Flash::INFO);\n self::redirect('/login/new');\n }\n }" ]
[ "0.7792646", "0.75059634", "0.7499085", "0.72509485", "0.71306163", "0.6904304", "0.6858361", "0.6809353", "0.6746325", "0.67331994", "0.6719726", "0.67124057", "0.66813743", "0.66813743", "0.6623237", "0.6592215", "0.65843683", "0.65485245", "0.6543908", "0.654315", "0.6527282", "0.651117", "0.6504834", "0.6479432", "0.6474809", "0.64408535", "0.64203995", "0.64128375", "0.64128375", "0.64044744", "0.639746", "0.637321", "0.6358373", "0.6335594", "0.6328443", "0.63075316", "0.6281088", "0.6259004", "0.6242291", "0.6237723", "0.62351906", "0.6229893", "0.62298495", "0.62226367", "0.62037563", "0.61881554", "0.6185633", "0.6178844", "0.61694014", "0.616466", "0.61564213", "0.61333656", "0.612489", "0.6120596", "0.6114245", "0.6095932", "0.60872483", "0.6086897", "0.6086559", "0.6079647", "0.6078325", "0.6076195", "0.6073573", "0.6061473", "0.6057124", "0.6054999", "0.60487515", "0.6043405", "0.60201836", "0.6001498", "0.59884906", "0.59847224", "0.5979893", "0.59792984", "0.59777397", "0.59768933", "0.59761673", "0.596869", "0.59666556", "0.5954801", "0.5940711", "0.5933262", "0.59306186", "0.5920737", "0.5908263", "0.58959395", "0.5894511", "0.58930767", "0.58923626", "0.5889704", "0.58813447", "0.5880259", "0.58697563", "0.5867795", "0.58667594", "0.5866312", "0.58659923", "0.5856152", "0.58544534", "0.5840487" ]
0.63003576
36
Allow admin to enable user accounts.
public function enableAccount($userId) { User::where('id', $userId)->update([ 'disabled' => false ]); return response()->json([ 'title' => 'Succes!', 'message' => 'Contul a fost activat!' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function admin_enable($id = null) {\n\n\t\t$user = $this->User->read(null, $id);\n\n\t\t/**\n\t\t * Read the \"Status\" component for more informations.\n\t\t * Dir : controllers/components/status.php\n\t\t */\n\t\tif (!empty($user)) {\n\n\t\t\t$user['User']['status'] = 0;\n\n\t\t\t/**\n\t\t\t * Change the user status.\n\t\t\t * Redirect the administrator to index page.\n\t\t\t */\n\t\t\tif ($this->User->save($user)) {\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has been enabled.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t}\n\t\t}\n\n\t}", "protected function isAdminUser() {}", "function enableAdministrator($id) {\r\n\r\n\t\t$this->query('UPDATE admins SET `enabled` = 1 WHERE id= '. $id .';');\r\n\r\n\t}", "private function action_adminAccount()\n\t{\n\t\tglobal $txt, $db_type, $db_connection, $databases, $incontext, $db_prefix, $db_passwd, $webmaster_email;\n\t\tglobal $db_persist, $db_server, $db_user, $db_port;\n\t\tglobal $db_type, $db_name, $mysql_set_mode;\n\n\t\t$incontext['sub_template'] = 'admin_account';\n\t\t$incontext['page_title'] = $txt['user_settings'];\n\t\t$incontext['continue'] = 1;\n\n\t\t// Need this to check whether we need the database password.\n\t\trequire(TMP_BOARDDIR . '/Settings.php');\n\t\tif (!defined('ELK'))\n\t\t{\n\t\t\tdefine('ELK', 1);\n\t\t}\n\t\tdefinePaths();\n\n\t\t// These files may be or may not be already included, better safe than sorry for now\n\t\trequire_once(SOURCEDIR . '/Subs.php');\n\n\t\t$db = load_database();\n\n\t\tif (!isset($_POST['username']))\n\t\t{\n\t\t\t$_POST['username'] = '';\n\t\t}\n\n\t\tif (!isset($_POST['email']))\n\t\t{\n\t\t\t$_POST['email'] = '';\n\t\t}\n\n\t\t$incontext['username'] = htmlspecialchars(stripslashes($_POST['username']), ENT_COMPAT, 'UTF-8');\n\t\t$incontext['email'] = htmlspecialchars(stripslashes($_POST['email']), ENT_COMPAT, 'UTF-8');\n\t\t$incontext['require_db_confirm'] = empty($db_type) || !empty($databases[$db_type]['require_db_confirm']);\n\n\t\t// Only allow create an admin account if they don't have one already.\n\t\t$db->skip_next_error();\n\t\t$request = $db->query('', '\n\t\t\tSELECT \n\t\t\t\tid_member\n\t\t\tFROM {db_prefix}members\n\t\t\tWHERE id_group = {int:admin_group} \n\t\t\t\tOR FIND_IN_SET({int:admin_group}, additional_groups) != 0\n\t\t\tLIMIT 1',\n\t\t\tarray(\n\t\t\t\t'admin_group' => 1,\n\t\t\t)\n\t\t);\n\t\t// Skip the step if an admin already exists\n\t\tif ($request->num_rows() != 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t$request->free_result();\n\n\t\t// Trying to create an account?\n\t\tif (isset($_POST['password1']) && !empty($_POST['contbutt']))\n\t\t{\n\t\t\t// Wrong password?\n\t\t\tif ($incontext['require_db_confirm'] && $_POST['password3'] != $db_passwd)\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_db_connect'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Not matching passwords?\n\t\t\tif ($_POST['password1'] != $_POST['password2'])\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_user_settings_again_match'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// No password?\n\t\t\tif (strlen($_POST['password1']) < 4)\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_user_settings_no_password'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (!file_exists(SOURCEDIR . '/Subs.php'))\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_subs_missing'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Update the main contact email?\n\t\t\tif (!empty($_POST['email']) && (empty($webmaster_email) || $webmaster_email == 'noreply@myserver.com'))\n\t\t\t{\n\t\t\t\tupdateSettingsFile(array('webmaster_email' => $_POST['email']));\n\t\t\t}\n\n\t\t\t// Work out whether we're going to have dodgy characters and remove them.\n\t\t\t$invalid_characters = preg_match('~[<>&\"\\'=\\\\\\]~', $_POST['username']) != 0;\n\t\t\t$_POST['username'] = preg_replace('~[<>&\"\\'=\\\\\\]~', '', $_POST['username']);\n\n\t\t\t$db->skip_next_error();\n\t\t\t$result = $db->query('', '\n\t\t\t\tSELECT \n\t\t\t\t\tid_member, password_salt\n\t\t\t\tFROM {db_prefix}members\n\t\t\t\tWHERE member_name = {string:username} \n\t\t\t\t\tOR email_address = {string:email}\n\t\t\t\tLIMIT 1',\n\t\t\t\tarray(\n\t\t\t\t\t'username' => stripslashes($_POST['username']),\n\t\t\t\t\t'email' => stripslashes($_POST['email']),\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ($result->num_rows() != 0)\n\t\t\t{\n\t\t\t\tlist ($incontext['member_id'], $incontext['member_salt']) = $result->fetch_row();\n\t\t\t\t$result->free_result();\n\n\t\t\t\t$incontext['account_existed'] = $txt['error_user_settings_taken'];\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (trim($_POST['username']) === '' || strlen($_POST['username']) > 25)\n\t\t\t{\n\t\t\t\t// Try the previous step again.\n\t\t\t\t$incontext['error'] = $_POST['username'] == '' ? $txt['error_username_left_empty'] : $txt['error_username_too_long'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ($invalid_characters || $_POST['username'] == '_' || $_POST['username'] == '|' || strpos($_POST['username'], '[code') !== false || strpos($_POST['username'], '[/code') !== false)\n\t\t\t{\n\t\t\t\t// Try the previous step again.\n\t\t\t\t$incontext['error'] = $txt['error_invalid_characters_username'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (empty($_POST['email']) || !filter_var(stripslashes($_POST['email']), FILTER_VALIDATE_EMAIL) || strlen(stripslashes($_POST['email'])) > 255)\n\t\t\t{\n\t\t\t\t// One step back, this time fill out a proper email address.\n\t\t\t\t$incontext['error'] = sprintf($txt['error_valid_email_needed'], $_POST['username']);\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// All clear, lets add an admin\n\t\t\trequire_once(SUBSDIR . '/Auth.subs.php');\n\n\t\t\t$incontext['member_salt'] = substr(base64_encode(sha1(mt_rand() . microtime(), true)), 0, 16);\n\n\t\t\t// Format the username properly.\n\t\t\t$_POST['username'] = preg_replace('~[\\t\\n\\r\\x0B\\0\\xA0]+~', ' ', $_POST['username']);\n\t\t\t$ip = isset($_SERVER['REMOTE_ADDR']) ? substr($_SERVER['REMOTE_ADDR'], 0, 255) : '';\n\n\t\t\t// Get a security hash for this combination\n\t\t\t$password = stripslashes($_POST['password1']);\n\t\t\t$incontext['passwd'] = validateLoginPassword($password, '', $_POST['username'], true);\n\n\t\t\t$request = $db->insert('',\n\t\t\t\t$db_prefix . 'members',\n\t\t\t\tarray(\n\t\t\t\t\t'member_name' => 'string-25', 'real_name' => 'string-25', 'passwd' => 'string', 'email_address' => 'string',\n\t\t\t\t\t'id_group' => 'int', 'posts' => 'int', 'date_registered' => 'int', 'hide_email' => 'int',\n\t\t\t\t\t'password_salt' => 'string', 'lngfile' => 'string', 'avatar' => 'string',\n\t\t\t\t\t'member_ip' => 'string', 'member_ip2' => 'string', 'buddy_list' => 'string', 'pm_ignore_list' => 'string',\n\t\t\t\t\t'message_labels' => 'string', 'website_title' => 'string', 'website_url' => 'string',\n\t\t\t\t\t'signature' => 'string', 'usertitle' => 'string', 'secret_question' => 'string',\n\t\t\t\t\t'additional_groups' => 'string', 'ignore_boards' => 'string',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tstripslashes($_POST['username']), stripslashes($_POST['username']), $incontext['passwd'], stripslashes($_POST['email']),\n\t\t\t\t\t1, 0, time(), 0,\n\t\t\t\t\t$incontext['member_salt'], '', '',\n\t\t\t\t\t$ip, $ip, '', '',\n\t\t\t\t\t'', '', '',\n\t\t\t\t\t'', '', '',\n\t\t\t\t\t'', '',\n\t\t\t\t),\n\t\t\t\tarray('id_member')\n\t\t\t);\n\n\t\t\t// Awww, crud!\n\t\t\tif ($request->hasResults() === false)\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_user_settings_query'] . '<br />\n\t\t\t\t<div style=\"margin: 2ex;\">' . nl2br(htmlspecialchars($db->last_error($db_connection), ENT_COMPAT, 'UTF-8')) . '</div>';\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$incontext['member_id'] = $db->insert_id(\"{$db_prefix}members\", 'id_member');\n\n\t\t\t// If we're here we're good.\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public static function activate()\n {\n $role = get_role('administrator');\n if (!empty($role)) {\n $role->add_cap('my_plugin_manage');\n }\n }", "public function adminOnly();", "public function adminOnly();", "Public Function enableUser($ID)\n\t{\n\t\t$this->_db->exec(\"UPDATE bevomedia_user SET enabled = 1 WHERE id = $ID\");\n\t\t\n\t}", "function enableUser()\n {\n if($this->isAdmin() == TRUE)\n {\n echo(json_encode(array('status'=>'access')));\n }\n else\n {\n $userId = $this->input->post('userId');\n $userInfo = array('isDeleted'=>0,'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:s'));\n \n $result = $this->user_model->deleteUser($userId, $userInfo);\n \n if ($result > 0) { echo(json_encode(array('status'=>TRUE))); }\n else { echo(json_encode(array('status'=>FALSE))); }\n }\n }", "protected function isCurrentUserAdmin() {}", "protected function isCurrentUserAdmin() {}", "function grant_super_admin($user_id)\n {\n }", "function is_user_admin()\n {\n }", "private function grantAdminAccess()\n {\n if ($this->checkColumn(\"shopgate\", TABLE_ADMIN_ACCESS)) {\n // Create column shopgate in admin_access...\n xtc_db_query(\n \"alter table \" . TABLE_ADMIN_ACCESS\n . \" ADD shopgate INT( 1 ) NOT NULL\"\n );\n\n // ... grant access to to shopgate for main administrator\n xtc_db_query(\n \"update \" . TABLE_ADMIN_ACCESS\n . \" SET shopgate=1 where customers_id=1 LIMIT 1\"\n );\n\n if (!empty($_SESSION['customer_id'])\n && $_SESSION['customer_id'] != 1\n ) {\n // grant access also to current user\n xtc_db_query(\n \"update \" . TABLE_ADMIN_ACCESS\n . \" SET shopgate = 1 where customers_id='\"\n . $_SESSION['customer_id']\n . \"' LIMIT 1\"\n );\n }\n\n xtc_db_query(\n \"update \" . TABLE_ADMIN_ACCESS\n . \" SET shopgate = 5 where customers_id = 'groups'\"\n );\n }\n }", "public function requireAdmin(){\n if( ! Authentifiacation::isAdmin()){\n Authentifiacation::rememberRequestedPage();\n Flash::addMessage('You need to have admin status to access this page', Flash::INFO);\n self::redirect('/login/new');\n }\n }", "public function canManageUsers()\n {\n return true;\n }", "public function adminAuthentication()\n {\n /* Get logined user informations */\n $user = Auth::user();\n if ($user[\"role\"] === 2)\n {\n /* give a admin session */\n return true;\n } else {\n return abort('404');\n }\n }", "public static function authAdmin() {\n if (Yii::$app->user->can(\"administrator\") || Yii::$app->user->can(\"adminsite\")) {\n return TRUE; //admin ใหญ่\n }\n }", "public function user_enable($username,$isGUID=false){\n if ($username===NULL){ return (\"Missing compulsory field [username]\"); }\n $attributes=array(\"enabled\"=>1);\n $result = $this->user_modify($username, $attributes, $isGUID);\n if ($result==false){ return (false); }\n \n return (true);\n }", "function allow_admin_privileges() {\n\tif($_SESSION['role']!=='administrator'):\n\t\theader('Location: ?q=start');\n\tendif;\n}", "function activate ()\n\t{\n\t\tswitch ($this->getAction ())\n\t\t{\n\t\t\tcase 'modifyUser':\n\t\t\t\tif ($this->getUserName () == 'test')\n\t\t\t\t{\n\t\t\t\t\tdie ('not allowed for test user');\n\t\t\t\t}\n\t\t\t\t$checkPasswd = true;\n\t\t\t\t$user = $this->itemFactory->requestToUser ($checkPasswd);\n\t\t\t\t$this->operations->modifyUser ($this->getUserName(), $user);\n\t\t\t\tHeader (\"Location: index.php\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tHeader (\"Location: index.php\");\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function mustbeadmin()\n {\n if (!$this->hasadmin())\n {\n $this->web()->noaccess();\n }\n }", "private function authorizeAdmins() {\n\n $authorizedRoleIds = Configure::read('acl.role.access_plugin_role_ids');\n $authorizedUserIds = Configure::read('acl.role.access_plugin_user_ids');\n\n $modelRoleFk = $this->_getRoleForeignKeyName();\n\n if (in_array($this->Auth->user($modelRoleFk), $authorizedRoleIds) || in_array(\n $this->Auth->user($this->getUserPrimaryKeyName()),\n $authorizedUserIds)) {\n // Allow all actions. CakePHP 2.0\n $this->Auth->allow('*');\n\n // Allow all actions. CakePHP 2.1\n $this->Auth->allow();\n }\n }", "protected static function isAdminUser() {\r\n throw new \\Excpetion('yet to implement');\r\n }", "protected function requiresAdmin() {\n if (!$this->evaluateACLS(self::ACL_ADMIN)) {\n $this->unauthorizedAccess();\n }\n }", "function acf_current_user_can_admin()\n{\n}", "private function __allowSuperAdminOnly() {\n\t\t$isSuperAdmin = $this->_isSuperAdmin();\n\t\tif ($isSuperAdmin === false) {\n\t\t\t$this->redirect('/admin/users/accessDenied');\n\t\t}\n\t}", "public function checkAdmin();", "function visible_to_admin_user()\n\t{\n\t\treturn true;\n\t}", "protected function ensureAdminRoleIfRequested() {}", "public function setAsAdmin()\n {\n if (!in_array('admin', $this->roles)) {\n $this->roles[] = 'admin';\n }\n }", "function enableAccount($accountId)\n\t\t{\n\t\t\tmysql_query(\"UPDATE argus_accounts SET status = 'ENABLED' WHERE account_id = '\".$accountId.\"' AND status = 'DISABLED'\") or die(mysql_error());\n\t\t\t\n\t\t\treturn;\n\t\t}", "public function enableUserAccessCheck($a_status)\n\t{\n\t\t$this->user_access_check = $a_status;\n\t}", "public function setupAdmin() {\n\t\t$answer = strtoupper($this->in('Would you like to [c]reate a new user, or use an [e]xisting user?', array('C', 'E')));\n\n\t\t// New User\n\t\tif ($answer === 'C') {\n\t\t\t$this->install['username'] = $this->_newUser('username');\n\t\t\t$this->install['password'] = $this->_newUser('password');\n\t\t\t$this->install['email'] = $this->_newUser('email');\n\n\t\t\t$result = $this->db->execute(sprintf(\"INSERT INTO `%s` (`%s`, `%s`, `%s`, `%s`) VALUES (%s, %s, %s, %s);\",\n\t\t\t\t$this->install['table'],\n\t\t\t\t$this->config['userMap']['username'],\n\t\t\t\t$this->config['userMap']['password'],\n\t\t\t\t$this->config['userMap']['email'],\n\t\t\t\t$this->config['userMap']['status'],\n\t\t\t\t$this->db->value(Sanitize::clean($this->install['username'])),\n\t\t\t\t$this->db->value(Security::hash($this->install['password'], null, true)),\n\t\t\t\t$this->db->value($this->install['email']),\n\t\t\t\t$this->db->value($this->config['statusMap']['active'])\n\t\t\t));\n\n\t\t\tif ($result) {\n\t\t\t\t$this->install['user_id'] = $this->db->lastInsertId();\n\t\t\t} else {\n\t\t\t\t$this->out('An error has occured while creating the user.');\n\n\t\t\t\treturn $this->setupAdmin();\n\t\t\t}\n\n\t\t// Old User\n\t\t} else if ($answer === 'E') {\n\t\t\t$this->install['user_id'] = $this->_oldUser();\n\n\t\t// Redo\n\t\t} else {\n\t\t\treturn $this->setupAdmin();\n\t\t}\n\n\t\t$result = $this->db->execute(sprintf(\"INSERT INTO `%saccess` (`access_level_id`, `user_id`, `created`) VALUES (4, %d, NOW());\",\n\t\t\t$this->install['prefix'],\n\t\t\t$this->install['user_id']\n\t\t));\n\n\t\tif (!$result) {\n\t\t\t$this->out('An error occured while granting administrator access.');\n\n\t\t\treturn $this->setupAdmin();\n\t\t}\n\n\t\treturn true;\n\t}", "public function enableUserAndGroupSupport(){\n\t\treturn false;\n\t}", "public function isUserAdmin()\n\t{\n\t\treturn (Bn::getValue('user_type') == 'A');\n\t}", "public function enable_user(Request $request)\n {\n $user = User::findOrFail($request->id);\n $user->state = '1';\n $user->save();\n }", "function require_administrator() {\n if ($this->auth->is_administrator())\n return TRUE;\n\n $this->setFlash('error', 'Area is restricted to administrators only.');\n $this->redirect('admin/login');\n }", "function userAdmin(){\r\n if(userConnect() && $_SESSION['user']['privilege']==1) return TRUE; else return FALSE;\r\n }", "function btwp_restrict_admin_access() {\n\t\n\tglobal $current_user;\n\tget_currentuserinfo();\n\t\n\tif( !array_key_exists( 'administrator', $current_user->caps ) ) {\n\t\twp_redirect( get_bloginfo( 'url' ) );\n\t\texit;\n\t}\n\n}", "public function _isAdmin() {\n\t\t$user_id = $this->Auth->user('id');\n\t\t$aro = array('model' => 'User', 'foreign_key' => $user_id); \n\t\t$aco = 'role/super/admin';\n\t\treturn $this->Acl->check($aro, $aco);\n\t}", "public function isAccountAdmin() {\n return $this->isStoreAdmin() || $this->authorise('account.admin', 'account');\n }", "public static function requireAdmin() {\n\t$status = (Yii::$app->user->identity->roles == 'admin') ? true : false;\n return $status\n }", "protected function addAdminAccount()\n {\n //disconnect existing DB connection to reconnect with new updated config variables.\n\n $this->line(\"Deleting any existing admin accounts.\");\n //empty users table.\n User::truncate();\n\n $this->line(\"Creating admin account.\");\n $username = 'admin';\n $password = 'AccessManager3';\n\n $user = new User([\n 'username' => $username,\n 'password' => $password,\n 'name' => 'Administrator',\n 'email' => 'access@manager',\n ]);\n $user->saveOrFail();\n\n $this->line(\"Account successfully created.\");\n $this->info(\"Username: $username\");\n $this->info(\"Password: $password\");\n $this->line(\"Run 'php artisan admin:reset' to reset admin password.\");\n }", "public function activate_user() {\n global $database;\n $sql = \"UPDATE user SET is_active = 1 WHERE id = \";\n $sql .= $database->escape_value($this->id);\n $database->query($sql);\n }", "function user_can_access_admin_page()\n {\n }", "public function allowAccountAccess()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->checkAccountAccess();\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function install_root_user() {\n $fields = array(\n 'username' => $site_config['adminUser'],\n 'password' => $site_config['adminPassword'],\n 'role' => DEFAULT_ADMIN_RID,\n 'email' => $site_config['adminEmail'],\n 'name' => $site_config['adminName'],\n 'language' => Session::get('lang'),\n 'active' => 1\n );\n $new_user = new User();\n if($new_user->create($fields)) {\n return true;\n }\n else {\n System::addMessage('error', rt('The site administrator could not be created. Please verify that your server meets the requirements for the application and that your database user has sufficient permissions ot make changes in the database'));\n }\n}", "public function isAdmin(){\n\t\tparent::isAdmin();\n\t}", "public function admin_enable($id = null) {\n\n\t\t\t/*disable rendering of view*/\n\t\t\t$this->autoRender = false;\n\n\t\t\t/*set activity as \"Enable\"*/\n\t\t\t$act=array('activ'=>'1');\n\n\t\t\t/*save activity parameter to table \"modules\"*/\n\t\t\t$this->Module->id=$id;\n\t\t\t$this->Module->save($act);\n\n\t\t\t/*back to method \"admin_index\"*/\n\t\t\t$this->redirect(array('action' => 'admin_index'));\n\t\t\t}", "function enable_user($email) {\n // Build the query\n $query = \"UPDATE UserAccount SET enabled=1 WHERE email = ?\";\n // Execute the query\n $result = $this->db->query($query, $email);\n // Check if the row was affected\n if ($this->db->affected_rows() == 1) {\n $message = \"Success: account enabled.\";\n } else {\n $message = \"Error: failed to enable account.\";\n }\n // Return the result message\n return $message;\n }", "protected function setupAdminUser()\n {\n $GLOBALS['current_user'] = \\BeanFactory::getBean('Users')->getSystemUser();\n }", "public function actionAdmin()\n {\n if (User::findOne(['email' => 'admin@efko.ru'])) {\n echo \"Руководитель уже существует\\n\";\n\n return ExitCode::USAGE;\n }\n\n $user = new User();\n $user->email = 'admin@efko.ru';\n $user->full_name = 'Тестовый Руководитель';\n $user->is_admin = 1;\n $user->password = Yii::$app->security->generatePasswordHash('test');\n $user->save();\n echo \"Руководитель создан\\n\";\n\n return ExitCode::OK;\n }", "public function adminControl()\n {\n $row = $this->currentUserData();\n if(isset($_SESSION['sess_user_type']) &&\n $_SESSION['sess_user_type'] == 'admin' && $row['user_type'] == 'admin'){\n return true;\n }\n }", "function checkAdmin()\n\t {\n\t \tif(!$this->checkLogin())\n\t \t{\n\t \t\treturn FALSE;\n\t \t}\n\t \treturn TRUE;\n\t }", "public function is_admin_only()\n\t{\n\t\treturn false;\n\t}", "function AdminUsers_install()\n\t{\n\t}", "public function relatorio4(){\n $this->isAdmin();\n }", "public function isAllowedForUser(){\n\t\treturn true;\n\t}", "public static function isAllowed() {\r\n\t\treturn TodoyuAuth::isAdmin();\r\n\t}", "public function checkAdmin()\n {\n // there ..... need\n // END Check\n $auth = false;\n if($auth) {\n return true;\n }\n else{\n return false;\n }\n }", "public function check_admin() {\n return current_user_can('administrator');\n }", "public static function requireAdmin()\n {\n if(!SessionHelper::isAdmin()){\n header('location: ' . (string)getenv('URL') . '/');\n }\n }", "public function isAdmin();", "public function enableAccount($uid, $flag = true)\n {\n return parent::enableAccount($uid, $flag);\n }", "public function enable($id)\n {\n $user = User::find($id);\n $user->is_enable = 1;\n $user->save();\n\n return redirect()->route('user.index');\n }", "public function makeAdministrator()\n {\n $this->setRole('administrator');\n }", "public function isAdmin() {}", "function admin_protect() {\n global $user_data;\n if($user_data['type'] != 1) {\n header(\"location: index.php\");\n exit();\n }\n }", "public static function allowUserSignUp()\n {\n return false;\n }", "function allow_create_users() {\n\t\treturn apply_filters( 'import_allow_create_users', true );\n\t}", "public function isAdmin()\n {\n }", "public function is_admin(){\n\t\treturn $this->account_type == \"manager\";\n\t}", "public function action_activateaccount()\n\t{\n\t\tglobal $context, $modSettings;\n\n\t\tisAllowedTo('moderate_forum');\n\n\t\tif (isset($this->_req->query->save, $this->_profile['is_activated'])\n\t\t\t&& $this->_profile['is_activated'] != 1)\n\t\t{\n\t\t\trequire_once(SUBSDIR . '/Members.subs.php');\n\n\t\t\t// If we are approving the deletion of an account, we do something special ;)\n\t\t\tif ($this->_profile['is_activated'] == 4)\n\t\t\t{\n\t\t\t\tdeleteMembers($context['id_member']);\n\t\t\t\tredirectexit();\n\t\t\t}\n\n\t\t\t// Actually update this member now, as it guarantees the unapproved count can't get corrupted.\n\t\t\tapproveMembers(array('members' => array($context['id_member']), 'activated_status' => $this->_profile['is_activated']));\n\n\t\t\t// Log what we did?\n\t\t\tlogAction('approve_member', array('member' => $this->_memID), 'admin');\n\n\t\t\t// If we are doing approval, update the stats for the member just in case.\n\t\t\tif (in_array($this->_profile['is_activated'], array(3, 4, 13, 14)))\n\t\t\t{\n\t\t\t\tupdateSettings(array('unapprovedMembers' => ($modSettings['unapprovedMembers'] > 1 ? $modSettings['unapprovedMembers'] - 1 : 0)));\n\t\t\t}\n\n\t\t\t// Make sure we update the stats too.\n\t\t\trequire_once(SUBSDIR . '/Members.subs.php');\n\t\t\tupdateMemberStats();\n\t\t}\n\n\t\t// Leave it be...\n\t\tredirectexit('action=profile;u=' . $this->_memID . ';area=summary');\n\t}", "public function actionIndex()\n {\n $authManager = \\Yii::$app->authManager;\n $adminRole = $authManager->createRole(\"admin\");\n $authManager->add($adminRole);\n $adminUser = new AccountUser();\n $adminUser->username = \"admin\";\n $adminUser->password = \"pf3Zt49nsgoPFbr\";\n $adminUser->authKey= uniqid();\n $adminUser->accessToken = uniqid();\n if ($adminUser->save()) {\n $authManager->assign($adminRole, $adminUser->id);\n /*assign the role */\n }\n }", "static function adminGateKeeper() {\n if (!loggedIn() || !adminLoggedIn()) {\n new SystemMessage(translate(\"system_message:not_allowed_to_view\"));\n forward(\"home\");\n }\n }", "public function isAdmin()\n\t{\n\t\t$this->reply(true);\n\t}", "function install()\n {\n $query = parent::getList( 'user_name = \\'admin@test.com\\'' );\n \n if( $query->num_rows() == 0 )\n {\n $data = array(\n 'user_name' => 'admin@test.com',\n 'password' => sha1('rkauqkf.'),\n 'role' => 'admin',\n 'is_active' => '1',\n 'd_o_c'=>date(\"Y/m/d\"),\n );\n \n parent::add($data);\n }\n }", "function adminUsers()\n {\n $userLogged = Auth::check(['administrateur']);\n \n $userManager = new UserManager();\n $listUsers = $userManager->getListUsers();\n require'../app/Views/backViews/user/backAdminUsersView.php';\n }", "protected function isUserAllowedToLogin() {}", "public function enable($user_id = 0 )\n {\n header('Content-Type: application/json'); //set response type to be json\n admin_session_check();\n if(!$user_id) show_404();\n $user = $this->users_model->get_record($user_id);\n if(!isset($user->user_id))\n {\n $ajax_response = array('type' => AJAX_RESPONSE_TYPE_ERROR, 'message' => get_alert_html($this->lang->line('error_invalid_request'), ALERT_TYPE_ERROR));\n echo json_encode($ajax_response);\n exit();\n }\n $this->users_model->update_user_status($user_id, USER_STATUS_ACTIVE);\n $ajax_response = array('type' => AJAX_RESPONSE_TYPE_SUCCESS, 'message' => get_alert_html($this->lang->line('success_user_enabled') , ALERT_TYPE_SUCCESS));\n echo json_encode($ajax_response);\n }", "function admin_disable($id = null) {\n\n\t\t$user = $this->User->read(null, $id);\n\n\t\t/**\n\t\t * Read the \"Status\" component for more informations.\n\t\t * Dir : controllers/components/status.php\n\t\t */\n\t\tif (!empty($user)) {\n\n\t\t\t$user['User']['status'] = 1;\n\n\t\t\t/**\n\t\t\t * Change the user status.\n\t\t\t * Redirect the administrator to index page.\n\t\t\t */\n\t\t\tif ($this->User->save($user)) {\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has been disabled.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t}\n\t\t}\n\n\t}", "public function setEnabled( $enabled ){\r\n $this->enabled = $enabled;\r\n \r\n $sqlQuery = \"UPDATE users SET enable = \" . $enabled . \" WHERE user_id = \" . $this->getID() . \" AND role = '\" . AGENT_ROLE_ID . \"';\";;\r\n $result = $this->dbcomm->executeQuery($sqlQuery);\r\n\r\n if ($result != true)\r\n {\r\n echo \"<br><b>\" . $this->dbcomm->giveError() . \"</b>\";\r\n return 0;\r\n }\r\n else\r\n {\r\n if ( $this->dbcomm->affectedRows() == 1) \r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return 0;\r\n }\r\n\r\n } \r\n }", "public function page_activate_users()\n\t{\n\t\t$id = intval(Http::request('id'));\n\t\tif ($id)\n\t\t{\n\t\t\t User::confirm_account($id);\n\t\t}\n\n\t\tHttp::redirect('index.' . PHPEXT);\n\t}", "function mysql_auth_usermanagement()\n{\n return 1;\n}", "public function register_user()\n {\n \n return true;\n \n }", "public function administrador()\n {\n return false;\n }", "protected function startup()\n\t{\n\t\tparent::startup();\n\n\t\tif (!$this->getUser()->isAllowed($this->getName(), $this->getAction())) {\n\t\t\t$this->flashMessage('Daná sekcia alebo akcia je dostupná len po prihlásení.\n\t\t\t\tAk ste prihlásený požiadajte administrátora o pridelenie\n\t\t\t\toprávnení pre túto sekciu.');\n\n\t\t\tif ($this->loginPresenter) {\n\t\t\t\t$this->redirect('Administration:default');\n\t\t\t}\n\t\t}\n\t}", "function setUserAdmin( $value )\n {\n $this->UserAdmin = $value;\n }", "function authorizedAdminOnly(){\n global $authenticatedUser;\n if(!$authenticatedUser['admin']){\n header(\"HTTP/1.1 403 Forbidden\");\n header(\"Location: https://eso.vse.cz/~frim00/marvelous-movies/error-403\");\n exit();\n }\n }", "function isAdmin(){\n$user = $this->loadUser(Yii::app()->user->user_id);\nreturn intval($user->user_role_id) == 1;\n}", "public function enable();", "public function enable();", "function admin()\n{\n return current_user_can('manage_options');\n}", "function is_admin()\n {\n //is a user logged in?\n\n //if so, check admin status\n\n //returns true/false\n\n }", "public function isAdmin()\n {\n return ($this->username === \"admin\");\n }", "public function isAdmin()\n {\n return $this->hasCredential('admin');\n }", "function isa_editor_manage_users()\n{\n if (get_option('isa_add_cap_editor_once') != 'done') {\n // let editor manage users\n $edit_editor = get_role('editor'); // Get the user role\n $edit_editor->add_cap('edit_users');\n $edit_editor->add_cap('list_users');\n $edit_editor->add_cap('promote_users');\n $edit_editor->add_cap('create_users');\n $edit_editor->add_cap('add_users');\n $edit_editor->add_cap('delete_users');\n\n update_option('isa_add_cap_editor_once', 'done');\n }\n}", "public function run()\n {\n $this->disableForeignKeys();\n\n $user = User::query()->find(1);\n $user->assignRole(config('access.users.app_admin_role'));\n\n $this->enableForeignKeys();\n \n }", "public function isUserOnAdminArea()\n\t{\n\t\treturn is_admin();\n\t}" ]
[ "0.75244206", "0.6960847", "0.69204473", "0.68573445", "0.6802267", "0.6763566", "0.6763566", "0.67351615", "0.6729622", "0.6648832", "0.66417485", "0.66413516", "0.66400707", "0.66375476", "0.66078675", "0.6601692", "0.658789", "0.65749735", "0.65662503", "0.654914", "0.6548512", "0.65350294", "0.65233535", "0.652185", "0.6510501", "0.64804786", "0.6470087", "0.646507", "0.6463646", "0.64624643", "0.6451549", "0.6448772", "0.6448699", "0.6434099", "0.6409919", "0.6406239", "0.6372887", "0.6367691", "0.6367603", "0.6356793", "0.63420427", "0.6338905", "0.6337753", "0.6335687", "0.6328417", "0.63209206", "0.63191223", "0.6311581", "0.6302385", "0.62964344", "0.62913287", "0.6286611", "0.628629", "0.62829566", "0.6278754", "0.6277074", "0.62650645", "0.6244065", "0.6212869", "0.62116003", "0.62048316", "0.62026596", "0.6201324", "0.61742276", "0.6166084", "0.6165989", "0.616427", "0.6151744", "0.61498004", "0.6146259", "0.6142502", "0.6134565", "0.6132477", "0.6130604", "0.6130267", "0.612168", "0.61207867", "0.6120221", "0.6117972", "0.6112036", "0.61096334", "0.61075485", "0.6105896", "0.6101285", "0.6101174", "0.6097117", "0.60909724", "0.6075894", "0.6074316", "0.60669243", "0.6061311", "0.605908", "0.605908", "0.6057414", "0.6049263", "0.60454863", "0.6035475", "0.60349554", "0.6031579", "0.60311824" ]
0.61306834
73
Allow admin to delete accounts.
public function deleteAccount($userId) { if (Auth::user()->id == $userId) { return response()->json([ 'title' => 'Oooops.', 'message' => 'Nu îți poți șterge contul tău.', ], 422); } User::where('id', $userId)->delete(); return response()->json([ 'title' => 'Succes!', 'message' => 'Contul a fost șters.' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function deleteAccount(){\n\n //if user is logged in proceed, else send them to login\n if(login::isLoggedIn()){\n \n //if user clicked submit proceed\n if(isset($_POST['delete-account'])) {\n \n //grab the user's id and proceed to deletion\n $userId = login::isLoggedIn();\n \n database::query(\"DELETE FROM login_tokens WHERE fk_users_id = :userId\", array(':userId'=>$userId));\n database::query(\"DELETE FROM users WHERE users_id = :userId\", array(':userId'=>$userId));\n\n controller::redirectTo('login');\n \n }\n \n } else {\n controller::redirectTo('login');\n }\n }", "public function action_deleteaccount()\n\t{\n\t\tglobal $txt, $context, $modSettings, $cur_profile;\n\n\t\tif (!$context['user']['is_owner'])\n\t\t{\n\t\t\tisAllowedTo('profile_remove_any');\n\t\t}\n\t\telseif (!allowedTo('profile_remove_any'))\n\t\t{\n\t\t\tisAllowedTo('profile_remove_own');\n\t\t}\n\n\t\t// Permissions for removing stuff...\n\t\t$context['can_delete_posts'] = !$context['user']['is_owner'] && allowedTo('moderate_forum');\n\n\t\t// Can they do this, or will they need approval?\n\t\t$context['needs_approval'] = $context['user']['is_owner'] && !empty($modSettings['approveAccountDeletion']) && !allowedTo('moderate_forum');\n\t\t$context['page_title'] = $txt['deleteAccount'] . ': ' . $cur_profile['real_name'];\n\n\t\t// make sure the sub-template is set...\n\t\ttheme()->getTemplates()->load('ProfileAccount');\n\t\t$context['sub_template'] = 'deleteAccount';\n\t}", "public function delete()\n {\n $this->getMasterApiClient()->deleteSubUser($this->getSubAccountUsername());\n LaravelLog::info('Sub account deleted: ' . $this->getSubAccountUsername());\n parent::delete();\n }", "public function deleting(Admin $admin){\n\t\t$admin->users()->delete();\n\t}", "public function deleteAdmin() {\n\t\t$numRows = $this->db->delete();\n\t\tif($numRows===1) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function deleteAction() {\r\n if (isset($_SESSION['Connected']))\r\n if (($_SESSION['Connected'] == 1) and ($_SESSION['admin'] == 1))//secure\r\n Users::deleteMember($_GET['id']);\r\n\r\n $this->redirect(\"/Members/index\");\r\n }", "public function deleteAccount()\n {\n if ($this->checkLoggedIn()) {\n $this->userDAO->deleteAccount($this->session->get('user'));\n $this->session->destroy();\n $this->session->start();\n $this->session->set('delete_account', 'Votre compte à bien été supprimé');\n header('Location: ../public/index.php');\n }\n }", "public function post_delete() {\n //try to delete the account\n $status = AuxUser::deleteUser();\n if ($status[0]) {\n //if the delete user process worked, log out\n echo '<script>alert(\"Account Deleted\");</script>';\n Response::redirect('/profile/logOut');\n } else {\n //if not, print the error message\n echo '<script>alert(\"'.$status[1].'\");</script>';\n Response::redirect('/profile');\n }\n }", "public function adminDestroy($id)\n {\n $user = \\App\\User::find($id);\n\n $user->delete();\n \n return redirect()->action('SearchController@getTopAdvertisements')->with('status', 'Account deleted!');\n }", "public function delete() {\r\n\r\n if ( ! current_user_can( 'activate_plugins' ) ) {\r\n return;\r\n }\r\n\r\n $this->deleteOrdersTable();\r\n delete_option( 'ce_option' );\r\n delete_option( 'ce_coins_alerts' );\r\n delete_transient( 'ce_flush_rules' );\r\n flush_rewrite_rules();\r\n\r\n }", "public function destroy()\n {\n $userId = Helper::getIdFromUrl('user');\n \n if ((Helper::checkUrlIdAgainstLoginId($userId)) !== 'super-admin') {\n Usermodel::load()->destroy($userId);\n } else { \n View::render('errors/403.view', [\n 'message' => 'You cannot delete yourself!',\n ]);\n }\n }", "public function actionDelete() {}", "public function actionDelete() {}", "abstract function allowDeleteAction();", "public function beforeDelete() {\n // Console doesn't have Yii::$app->user, so we skip it for console\n if (php_sapi_name() != 'cli') {\n // Don't let delete yourself\n if (Yii::$app->user->id == $this->id) {\n return false;\n }\n\n // Don't let non-superadmin delete superadmin\n if (!Yii::$app->user->isSuperadmin AND $this->superadmin == 1) {\n return false;\n }\n }\n\n return parent::beforeDelete();\n }", "public function admin_delete($id)\n {\n $users = User::where('id',$id) ->delete();\n\n Session::flash('message', 'Succesfully delete admin!');\n return Redirect::to('admin_index');\n }", "private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}", "function permissions_delete()\n{\n // Deletion not allowed\n return false;\n}", "public function admin_delete($id = false) {\r\n\t\tif($id) {\r\n\t\t\t$this->{$this->modelClass}->delete($id);\t\t\t\r\n\t\t}\r\n\t\tif(isset($this->data)) {\r\n\t\t\t$this->{$this->modelClass}->delete($this->data[$this->modelClass]['id']);\r\n\t\t\t$message = $this->modelClass . ' deleted';\r\n\t\t\t$this->_message($message, array('action' => 'index'));\r\n\t\t} else {\r\n\t\t\t$this->viewPath = 'shared';\r\n\t\t}\r\n }", "public function delete($account);", "function deleteAdmin($id) {\r\n\r\n\t\treturn ($this->query('DELETE FROM admins WHERE admins.id = '. $id .';'));\r\n\r\n\t}", "public function deleteAccountAction() {\n //get the request object\n $request = $this->getRequest();\n //check if form is posted\n if ($request->getMethod() == 'POST') {\n //get the session object\n $session = $request->getSession();\n //get the user object from the firewall\n $user = $this->getUser();\n //set the delete flag\n $user->setEnabled(FALSE);\n //get the entity manager\n $em = $this->getDoctrine()->getManager();\n //get the social accounts object\n $socialAccounts = $user->getSocialAccounts();\n //remove the social accounts object if exist\n if ($socialAccounts) {\n $em->remove($socialAccounts);\n }\n //save the changes\n $em->flush();\n //logout the user\n $this->get('security.context')->setToken(null);\n //invalidate the current user session\n $session->invalidate();\n //set the success flag\n $session->getFlashBag()->set('success', $this->get('translator')->trans('Your account has been deleted'));\n //redirect to the login page\n return $this->redirect($this->generateUrl('login'));\n }\n return $this->render('ObjectsUserBundle:User:delete_account.html.twig');\n }", "public function deleteAction() {\n \n }", "public function delete_subadmin()\n\t{\n\t\tif ($this->checkLogin('A') == '') \n\t\t{\n\t\t\tredirect('admin');\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$subadmin_id = $this->uri->segment(4, 0);\n\t\t\t$condition = array('id' => $subadmin_id);\n\t\t\t$this->subadmin_model->commonDelete(SUBADMIN, $condition);\n\t\t\t$this->setErrorMessage('success', 'Subadmin deleted successfully');\n\t\t\tredirect('admin/subadmin/display_sub_admin');\n\t\t}\n\t}", "public function userDeleted();", "protected function confirmDelete() {\n\t}", "function delAdminHandler() {\n global $inputs;\n $sql = \"DELETE FROM `admin` WHERE id = \" . $inputs['id'];\n execSql($sql);\n formatOutput(true, 'delete success');\n}", "function admin_delete($id = null) {\n\n\t\t/**\n\t\t * If $id is not set an error message is displayed.\n\t\t * $id = The user ID\n\t\t */\n\t\tif (!$id) {\n\t\t\t$this->Session->setFlash(__d('core', 'Invalid user.', true), 'default', array('class' => 'error'));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\n\t\t/**\n\t\t * Delete the user.\n\t\t * Redirect the administrator to index page.\n\t\t */\n\t\tif ($this->User->delete($id)) {\n\t\t\t$this->Session->setFlash(__d('core', 'The user has been deleted.', true));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\t}", "public function deleteUser()\n {\n $this->delete();\n }", "protected function deleteAction()\n {\n }", "public function delete(){\n\t\t\t$id = $_GET['id'];\n\t\t\t$result = $this->userrepository->delete($id);\n\t\t\tif($result = true){\n\t\t\t\theader(\"Location: index.php/admin/index/delete\");\n\t\t\t}\n\t\t}", "function DeleteAdminUser($id)\n {\n $this->db->where('id', $id);\n $this->db->delete('users');\n }", "public function delete() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"UPDATE users SET state='DELETED' WHERE id = ?\");\n\t\t$stmt->execute(array($this->id));\n\t}", "public function delete() {\n try {\n $db = Database::getInstance();\n $sql = \"DELETE FROM `User` WHERE username = :username\";\n $stmt = $db->prepare($sql);\n $stmt->execute([\"username\" => $this->username]);\n } catch (PDOException $e) {\n exitError(500, \"Internal error.\");\n }\n }", "public function Delete(){\n $query = \"DELETE FROM user where id=\".$this->id;\n\n $result = $this->dbh->exec($query);\n if ($result) {\n Message::setMessage(\"<div class='yes'>Removed Permanently</div>\");\n } else {\n\n Message::setMessage(\"<div class='no'>Failed to Remove</div>\");\n }\n Utility::redirect(\"volunteers.php\");\n }", "public function test_users_destroy_admin_403(){\n $this->signInUser();\n $response = $this->delete(route('users.destroy', ['user' => 1]));\n $response->assertStatus(403);\n }", "public function admin_delete($id = null) {\n if ($this->isAuthorized()) {\n if (!$id) {\n $this->Session->setFlash('Please provide a user id');\n return $this->redirect(array(\n 'action' => 'admin_dashboard',\n ));\n }\n\n $this->User->id = $id;\n if (!$this->User->exists()) {\n $this->Session->setFlash('Invalid user id provided');\n return $this->redirect(array(\n 'action' => 'admin_dashboard',\n ));\n }\n\n if ($this->User->saveField('status', 0)) {\n $this->Session->setFlash(__('User deleted'));\n return $this->redirect(array(\n 'action' => 'admin_dashboard',\n ));\n }\n\n $this->Session->setFlash(__('User was not deleted'));\n return $this->redirect(array(\n 'action' => 'admin_dashboard',\n ));\n } else {\n $this->Session->setFlash(__('You do not have permission to do this'));\n return $this->redirect(array(\n 'action' => 'admin_dashboard',\n ));\n }\n }", "public function deleteAdmins($id)\n {\n DB::table('administrators')->where('id', $id)->delete();\n return redirect('list/admins');\n }", "protected function delete() {\n\t}", "static function deleteAdmin($idAdmin)\n {\n\n $con=Database::getConnection();\n $req=$con->prepare('DELETE FROM admin WHERE _idAdmin=?');\n $req->execute(array($idAdmin));\n\n }", "function delete(){\n $user_id = $this->uri->rsegment('3');\n $this->_del($user_id);\n redirect(admin_url('user'));\n\n }", "public function admin_delete($id)\n {\n $admin = Admin::findOrFail($id);\n $admin->delete();\n toastr()->success('تم الحذف بنجاح');\n return back();\n }", "public function delete(){\n $this->update(['deleted_by', Auth::user()->id]);\n return parent::delete();\n }", "public function delete_delete()\n {\n $response = $this->UserM->delete_user(\n $this->delete('id')\n );\n $this->response($response);\n }", "public function delete()\n\n {\n Customers::find($this->deleteId)->delete();\n session()->flash('message', 'Post Deleted Successfully.');\n\n }", "function onesignin_client_handle_delete_notification($account) {\n watchdog('onesignin', 'Deleting user %name on request of One Signin server.', array('%name' => $account->name), WATCHDOG_INFO);\n user_delete($account->uid);\n}", "public static function deleteAdmin($id){\n return (new Database('admin'))->delete('id = ' . $id);\n }", "public function deleteAction()\n {\n \n }", "protected function deleteAdminUserFixture()\n {\n if ($this->userName) {\n $users = Mage::getModel('admin/user')->getCollection();\n $users->addFieldToFilter('username', array( 'eq' => $this->userName));\n $users->load();\n foreach ( $users as $user ) {\n $user->delete();\n }\n }\n \n if ($this->roleName) {\n $roles = Mage::getModel('api/roles')->getCollection();\n $roles->addFieldToFilter('role_name', array('eq' => $this->roleName));\n $roles->load();\n foreach ( $roles as $role ) {\n $role->delete();\n }\n }\n }", "public function deleteAccount(Request $request)\n {\n// $accounts = $this->adminRepository->getAllByCompanyId($q);\n return $this->adminRepository->delete($request['accountId']);\n// return view('company-account-list')->with('accounts', $accounts);\n }", "public function postAction() {\n $this->_adminUserRepository->getUsersDeleteAll ();\n return redirect ( StringLiterals::ADMIN_USERS )->withSuccess ( trans ( 'adminuser.selected_deleted' ) );\n }", "public function admin_user_delete($id) {\n $this->User->deleteUser($id);\n $this->redirect(array(\n 'action' => 'user_list',\n ));\n }", "function deleteAction(){\n/*--------------------------------------------------------------*/\n\t$CheckUser = CheckUser($_COOKIE['login'], $_COOKIE['password']);\n if(!$CheckUser)\n return header('Location: /authorization/?status=ошибка авторизации');\n\n if($CheckUser['login'] == 'spjkee1488' OR $CheckUser['login'] == 'milky'){}\n else{\n $GetPrivilege = GetPrivilege($CheckUser['class']);\n if(!$GetPrivilege)\n return header('Location: /index/?status=Ошибка привилегии');\n\n\n if($GetPrivilege['flags']['access_site'] != 1)\n return header('Location: /index/?status=Забанен');\n\n if($GetPrivilege['flags']['access_adminpanel'] != 1)\n return header('Location: /index/?status=Нет доступа.');\n }\n\n\t//if($GetPrivilege['flags']['delete_user'] != 1)\n\t\t//return header('Location: /error/?error=privilege accesss denied');\n/* !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!- \t*/\n\n\n\t$id = $_GET['id'] ? $_GET['id'] : 0;\n\n\tif($id)\n\t\tdeleteLog($id);\n\n\theader('Location: ' . $_SERVER['HTTP_REFERER']);\n}", "public function actionDelete($id)\n\t{\n\t\tif ($id > 3) {\n\t\t\t$this->loadModel($id)->delete();\n\t\t} else {\n\t\t\tYii::app()->user->setFlash('failed','Cannot delete the administrators');\n\t\t}\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}", "public function destroy($id)\n {\n\t\tif(Gate::allows('administradores', Auth::user())){\n\t\t\tCita::find($id)->delete();\n\t\t\techo \"success\";\n\t\t}else{\n\t\t\treturn \"desautorizado\";\n\t\t}\t\n }", "public function deleting()\n {\n # code...\n }", "function canDelete() {\n return true;\n }", "public function deleteUser()\n {\t\t\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\t\n\t\t\t$userModel = UserModel::find($user->id);\n\t\t\t$userModel->destroy();\n\t\t\t$this->expireToken($userModel);\n\t\t\treturn $this->sendResponse('Your account has been deleted');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to delete this account');\n }", "public function destroy($id) {\n if (Auth::guard('admin')->user()->hasRole('admin') || Auth::guard('admin')->user()->hasPermission(['admin-admins-delete'])) {\n if (Auth::guard('admin')->user()->id == $id) {\n Session::flash('error', 'You cannot delete your own account');\n\n return redirect()->route('admin.admins.index');\n } else {\n $admin = Admin::findOrFail($id);\n $admin->update([\n 'admin_id' => Auth::guard('admin')->user()->id,\n ]);\n\n $admin->permissions()->sync([]);\n $admin->syncRoles([]);\n\n $admin->delete();\n\n Session::flash('success', 'The Admin has been deleted');\n\n return redirect()->route('admin.admins.index');\n }\n } else {\n return view('error.admin-unauthorized');\n }\n }", "public function deleteUser()\n {\n\n $this->displayAllEmployees();\n $id = readline(\"Unesite broj ispred zaposlenika kojeg želite izbrisati :\");\n $check = readline(\"Jeste li sigurni? da/ne: \");\n\n if ($check === 'da'){\n $this->employeeStorage->deleteEmployee($id);\n }\n\n }", "public function testAllowDelete()\n {\n $this->logOut();\n $deleteFalse = LogEntry::create()->canDelete(null);\n $this->assertFalse($deleteFalse);\n\n $this->logInWithPermission('ADMIN');\n $deleteTrue = LogEntry::create()->canDelete();\n $this->assertTrue($deleteTrue);\n }", "public function deleteUser() {\r\n\t\tif($this->session->userdata('SISBW')['level'] === 'superAdmin') {\r\n\t\t\t$this->user->deleteUser();\r\n\t\t\tredirect('adminUser');\r\n\t\t} else {\r\n\t\t\tredirect('adminUser');\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "function delete() {\n\t\t\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\tConfigure::write('debug', 0);\n\t\t\n\t\t$id = $this->Session->read('Member.memberid');\n\t\t\n\t\t// id 4 means trash\n\t\t\n\t\t$activeid = 4;\n\t\t\t$this->Member->updateAll(array(\n\t\t\t\t'Member.active' => \"'\" . $activeid . \"'\"\n\t\t\t), array(\n\t\t\t\t'Member.id' => $id\n\t\t\t));\n\t\t\n\t\techo \"deleted\";\n\t\t\t\n\t\n\t/*\tif ($id) {\n\t\t\t\n\t\t\t$delete = $this->Member->delete($id);\n\t\t\t\n\t\t \tif ($delete) {\n\t\t\t\t$meta = $this->userMeta->deleteAll(array(\n\t\t\t\t\t'userMeta.member_id' => $id\n\t\t\t\t));\n\t\t\t\t$course = $this->TutCourse->deleteAll(array(\n\t\t\t\t\t'TutCourse.member_id' => $id\n\t\t\t\t));\n\t\t\t\t$event = $this->TutEvent->deleteAll(array(\n\t\t\t\t\t'TutEvent.tutor_id' => $id\n\t\t\t\t));\n\t\t\t\t$image = $this->UserImage->deleteAll(array(\n\t\t\t\t\t'UserImage.user_id' => $id\n\t\t\t\t));\n\t\t\t\t\n\t\t\t}\n\t\t\tif ($meta) {\n\t\t\t\techo \"deleted\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} */\n\t\t\n\t\t\n\t\n\t\n\t}", "public function delete()\n {\n $this->administrador()->delete();\n $this->vendedor()->delete();\n return parent::delete();\n }", "public function deleteAction() {\n return $this->getResponse()->setHttpResponseCode(403);\n }", "Public Function PermanentDelete()\n\t{\n\t\t$this->_db->delete('bevomedia_user', 'ID = ' . $this->id);\n\t\t$this->_db->delete('bevomedia_user_info', 'ID = ' . $this->id);\n\t}", "public function delete() {\n\t\t$query = \"DELETE FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $this->userData['userId']);\n\t\texecuteSQL($query, $query_params);\n\t}", "public function actionDelete($id)\n {\n try{\n \t\t//$model = $this->findModel($id)->delete();\n \t$aduserinfo = User::find()->where(['id' => $id])->one();\n \t$aduserinfo->status ='In-active';\n \t$aduserinfo->update();\n \t\tYii::$app->getSession()->setFlash('success', 'You are successfully deleted admin user.');\n \t\t\n \t}\n \t\n \tcatch(\\yii\\db\\Exception $e){\n \t\tYii::$app->getSession()->setFlash('error', 'This Admin user is not deleted.');\n \t\t\n \t}\n \t\n \treturn $this->redirect(['index']);\n }", "public function destroy()\n\t{\n\t\t/* Delete Single Record */\n\t\tif(Input::get('name') == 'destroy')\n\t\t{\n\t\t\t$role_id = Input::get('id');\n\t\t\t$acl_group_permission_delete = AclGroupPermission::where('group_id',$role_id)->delete();\n\t\t\tAclGroup::where('id','=',$role_id)->delete();\n\t\t}\n\t\t/* Delete Multiple Records */\n\t\telse\n\t\t{\n\t\t\t$ids = Input::get('id');\n\t\t\tAclGroup::whereIn('id',$ids)->forceDelete();\n\t\t\tforeach ($ids as $id) {\n\t\t\t\t$acl_group_permission_delete = AclGroupPermission::where('group_id',$id)->delete();\n\t\t\t}\n\t\t}\n\n\t\treturn Response::json(array('msg' => 'AkdnUser deleted permanently','success'=>true), 200);\n\t}", "public function deleteAdmin($a_id){\n $sql = \"DELETE FROM `tbl_admin` WHERE `a_id` = '$this->a_id'\";\n // echo $sql; exit;\n return $this->connect->qry($sql);\n }", "public function deleteAction()\n {\n }", "public function delete() {\r\n $this->db->delete(\"assets_permissions\", $this->db->quoteInto(\"id = ?\", $this->model->getId()));\r\n }", "public function delete()\n {\n if(!isset($_SESSION['login']) || $_SESSION['login'] != 'admin123') {\n return redirect('page-not-found');\n }\n $this->task->delete($_GET['id']);\n\n return redirect('');\n }", "public function destroy($id) {\n $request->user()->authorizeRoles('Admin');\n //\n }", "function hapus_admin($id_admin)\n\t\t{\n\t\t\t$this->db->where('id_admin', $id_admin);\n\t\t\t$this->db->delete('admin');\n\t\t}", "public function delete(){\n $bd = Db::getInstance();\n $sql = \"DELETE FROM login WHERE id= :id\";\n $stmt = $bd->prepare($sql);\n $stmt->execute([\":id\" => $this->id]);\n }", "public function destroy($id)\n {\n $admin = User::find($id);\n $adminCountBeforeDelete = User::count();\n $admin->delete();\n $adminCountAfterDelete = User::count();\n if ($adminCountAfterDelete < $adminCountBeforeDelete) {\n return redirect()->back();\n } else {\n abort(404);\n }\n }", "public function destroy($id)\n\t{\n\t\t$admin = User::where(\"id\", \"=\" , $id)->firstOrFail();\n\n\t\t$admin->delete();\n\n\n\n\t\treturn redirect('superadmin');\n\t}", "public function deleteAdmin(Request $request)\n {\n $conditions = ['id' => $request->admin_id];\n $admin = $this->commonObj->find('Admin', $conditions);\n if(!$admin) {\n return jsonResponse('not found', 201, []);\n }\n $this->commonObj->destroy('CommitteeMember', ['admin_id' => $request->admin_id]);\n $this->commonObj->destroy('Admin', $conditions);\n\n addLog('admin',$this->user->name.' deleted Admin '.$admin->nam);\n\n return jsonResponse('done', 201, []);\n }", "public function testAdminCanDeleteUser()\n {\n $user = factory(User::class)->create();\n $admin = factory(User::class)->create();\n $admin->activate();\n $admin->assignRole('administrator');\n Auth::login($admin);\n \n $this->delete('/api/v1/user/'.$user->id, ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'message' => 'successful'\n ]);\n $this->assertDatabaseMissing('users', [\n 'name' => $user->name,\n 'email' => $user->email,\n 'activated' => true\n ]);\n $this->assertDatabaseMissing('user_activations', [\n 'email' => $user->email,\n ]);\n }", "function delete($id)\n\t{\n\t\tglobal $connect;\n\t\t$sql = \"DELETE FROM USER WHERE ID='\".$id.\"'\";\n\t\t$req = $connect->prepare($sql);\n\t\t$req->execute() or die(print_r($connect->erroInfo()));\n\t\theader('Location: adminShowUser.php');\n\t}", "public function deleteUser(){\n\t\t$sql = \"SELECT COUNT(aid) AS theCount FROM administrator where uid=:uid\";\n\n\t\tif($stmt = $this->_db->prepare($sql)){\n\t\t\t$stmt->bindParam(\":uid\", $_SESSION['UID'], PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t\t$row = $stmt->fetch();\n\t\t\tif($row['theCount']==0){\n\t\t\t\treturn \"<h2> Error </h2>\" . \n\t\t\t\t\t\"<p> Only administrators can do this. </p>\";\n\t\t\t}\n\t\t\t$stmt ->closeCursor();\n\t\t}\n\t\telse{\n\t\t\treturn \"Something went wrong checking the admin table.\";\n\t\t}\n\t\t\n\t\t//TODO: send the deleted user an email telling them they have been deleted\n\t\t\n\t\t$sql = \"DELETE FROM user WHERE uid=:uid\";\n\t\tif($stmt = $this->_db->prepare($sql)){\n\t\t\t$stmt->bindParam(\":uid\", $_GET['u'], PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t}\n\t\telse{\n\t\t\treturn \"Something went wrong deleting the user.\";\n\t\t}\n\n\t\treturn \"done\";\n\t}", "public function deleteAction() {\n parent::deleteAction();\n }", "public function destroy(AdminAccount $adminAccount)\n {\n //\n }", "function deleteUserAccount(){\n\t\t\t$id = $_POST[\"id\"];\n\t\t\t$this->db->set('status', 'Deactivated');\n\t\t\t$this->db->where('userID', $id);\n\t\t\t$query = $this->db->update('users');\n\t\t\t\n\t\t\tif($query){\n\t\t\t\techo \"done\";\n\t\t\t}\n\t\t\t\n\t\t}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "function delete()\n {\n if($this->checkAccess('permission.delete') == 1)\n {\n echo(json_encode(array('status'=>'access')));\n }\n else\n {\n $permissionId = $this->input->post('permissionId');\n $permissionInfo = array('isDeleted'=>1,'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:s'));\n \n $result = $this->permission_model->deletePermission($permissionId, $permissionInfo);\n \n if ($result > 0) { echo(json_encode(array('status'=>TRUE))); }\n else { echo(json_encode(array('status'=>FALSE))); }\n }\n }", "public function delete() {}", "public function destroy($id)\n {\n //\n // dd ('delete admin user');\n $admin = Admin::findOrFail($id)->delete();\n return redirect()->route(\"admin.list\");\n }", "public function destroy($id)\n {\n if(is_null($this->user) || !$this->user->can('admin.delete')){\n abort(403,\"The User Cant Access this Page\");\n }\n $user=Admin::find($id);\n if(!is_null($user)){\n $user->delete();\n }\n return back()->with('success','Admin delete');\n }", "public function delete(Admin $admin, User $model)\n {\n return $admin->hasAccess(['users.delete']);\n\n }", "public function delete()\n {\n \n }", "public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }", "public function admin_remove($id){\n\t\t\t$user = User::find($id);\n\t\t\t$role_id = $user->role_id;\n\t\t\tif($user->is_deleted==1){\n\t\t\t\t$user->is_deleted = 0;\n\t\t\t\t}else {\n\t\t\t\t$user->is_deleted = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif($user->save()){\n\t\t\t\tSession::flash('message', 'Company account has been deleted successfully.');\n\t\t\t\treturn Redirect::to('admin/users/'.$role_id);\n\t\t\t}\n\t\t\t\n\t\t}", "public function destroy(User $admin)\n {\n $adminsCount=User::where('isAdmin',1)->where(\"isActive\",1)->count();\n if ($adminsCount < 2) { //admin cant delete themselves but still;\n return back()->withErrors(\"At least one Admin should exist at all times \");\n }elseif (Auth::id() == $admin->id) {\n return back()->withErrors(\"You can't delete yourself\");\n } \n $admin->delete();\n return redirect()->route('admins.index')->with('status','Admin deleted successfully');\n \n }", "public function testDeleteUserForNonAdminUser()\n {\n $user = User::factory()->create([\n 'type' => 'user',\n ]);\n\n $response = $this->actingAs($user, 'api')\n ->deleteJson('/api/user/' . $user->id);\n\n $response->assertStatus(403);\n }", "public function postDelete()\n {\n self::getConnection()->delete('@system_user_role', ['user_id' => $this->getId()]);\n }", "public function delete(): void\n {\n $id = $this->id;\n $this->fetch(\n 'DELETE FROM user WHERE id = ?;',\n [$id]\n );\n }", "public function destroy()\n\t{\n\t\t/* Delete Single Record */\n\t\tif(Input::get('name') == 'destroy')\n\t\t{\n\t\t\tAkdn::where('id','=',Input::get('id'))->delete();\n\t\t}\n\t\t/* Delete Multiple Records */\n\t\telse\n\t\t{\n\t\t\t$ids = Input::get('id');\n\t\t\tAkdn::whereIn('id',$ids)->forceDelete();\n\t\t}\n\n\t\treturn Response::json(array('msg' => 'AkdnUser deleted permanently','success'=>true), 200);\n\t}" ]
[ "0.72971344", "0.7295645", "0.6956762", "0.69077563", "0.6843319", "0.67923164", "0.67902625", "0.67823565", "0.67532635", "0.67378485", "0.67276907", "0.6697487", "0.6697487", "0.668871", "0.66581947", "0.6656194", "0.66373247", "0.65758634", "0.6563176", "0.65427256", "0.6539829", "0.653592", "0.6527895", "0.65061545", "0.6505507", "0.65047437", "0.650199", "0.65003103", "0.64960754", "0.6490748", "0.64735305", "0.6468934", "0.64674413", "0.6436999", "0.64356357", "0.6432245", "0.6425015", "0.64089525", "0.6398393", "0.6396583", "0.6395657", "0.6383029", "0.6377391", "0.6375323", "0.6373567", "0.63730395", "0.6370692", "0.63648516", "0.6343789", "0.6340757", "0.6338442", "0.6336896", "0.6326573", "0.6325307", "0.63123107", "0.631206", "0.63089454", "0.6307485", "0.6305872", "0.63015544", "0.63008296", "0.6298068", "0.62952596", "0.6293728", "0.62930036", "0.6292478", "0.6287639", "0.62870824", "0.6284222", "0.62748885", "0.62724054", "0.6271465", "0.62700564", "0.6250051", "0.62392265", "0.62383384", "0.6234987", "0.6234514", "0.6234278", "0.6226474", "0.622018", "0.6204684", "0.6204056", "0.61918205", "0.6190217", "0.6179864", "0.6179509", "0.6179509", "0.6179424", "0.6179025", "0.6176768", "0.6176682", "0.617636", "0.61714303", "0.61712676", "0.61683184", "0.6165471", "0.6163477", "0.6163025", "0.6161682", "0.6161516" ]
0.0
-1
Allow admin to change account password.
public function changePassword($userId, Request $request) { dsadsa(); $this->validateChangePasswordData($request); // Make sure user don't change password of current account if (Auth::user()->id == $userId) { return response()->json([ 'title' => 'Ooops.', 'message' => 'Nu poți schimba parola acestui cont. Folosește secțiunea dedicată.' ], 422); } User::where('id', $userId)->update([ 'password' => bcrypt($request->get('new_password')) ]); return response()->json([ 'title' => 'Succes!', 'message' => 'Parola contului a fost schimbată.' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function changePassword() {}", "function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}", "public function setPassword($newPassword);", "public function changeAdminUserPassword() {\n\t\t$data = $this->request->data['User'];\n\n\t\t$this->User->id = $userId = $data['id'];\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$isPasswordChanged = ($data['current_password'] !== $data['new_password']) ? true : false;\n\t\t\tif ($isPasswordChanged && ($userId !== $this->Auth->User('id'))) {\n\t\t\t\t$this->__sendPasswordChangedEmail($data);\n\t\t\t}\n\t\t\t$this->Session->setFlash(__('Password changed successfully.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change the password due a server problem, try again later.'), 'error');\n\t\t}\n\n\t\t$this->redirect('/admin/users/editAdmin/' . $userId);\n\t}", "public function can_change_password() {\n return false;\n }", "public function changeUserPassword($uid,$newPassword);", "public function setPassword(){\n\t}", "function can_change_password() {\n return false;\n }", "function allowPasswordChange() {\r\n\t\treturn true;\r\n\t}", "function can_change_password() {\n\t\treturn false;\n\t}", "public function setPassword($newPassword){\n\t}", "public function changePassword()\n {\n if( ! Session::isLoggedIn() )\n {\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $user = User::find(Session::getCurrentUserID());\n\n View::make('templates/front/change-password.php',array());\n }", "public function account_change_password()\n\t{\n\t\t$data = array('password' => $this->input->post('new_password'));\n\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t{\n\t\t\t$messages = $this->ion_auth->messages();\n\t\t\t$this->system_message->set_success($messages);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errors = $this->ion_auth->errors();\n\t\t\t$this->system_message->set_error($errors);\n\t\t}\n\n\t\tredirect('admin/panel/account');\n\t}", "public function actionChangePassword()\n {\n $username = $this->prompt(Console::convertEncoding(Yii::t('app', 'Username')) . ':', ['required' => true]);\n $model = $this->findModel($username);\n $model->setPassword($this->prompt(Console::convertEncoding(Yii::t('app', 'New password')) . ':', [\n 'required' => true,\n 'pattern' => '#^.{4,255}$#i',\n 'error' => Console::convertEncoding(Yii::t('app', 'More than {:number} symbols', [':number' => 4])),\n ]));\n $this->log($model->save());\n }", "public function setPassword($value);", "function allowPasswordChange() {\n return false;\n }", "function changepassword() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n $this->viewData['hash'] =User::userid();\n // Render the action with template\n $this->renderWithTemplate('users/changepassword', 'AdminPageBaseTemplate');\n }", "public function allowPasswordChange()\n {\n return false;\n }", "public function change_password()\n\t{\n\t\t$this->load->model('admin_user_model', 'admin_users');\n\t\t$updated = $this->admin_users->change_password($this->mUser->id, $this->input->post('new_password'));\n\n\t\tif ($updated)\n\t\t{\n\t\t\tset_alert('success', 'Successfully changed password.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tset_alert('danger', 'Failed to changed password.');\n\t\t}\n\n\t\tredirect('admin/account');\n\t}", "function update_password()\n {\n }", "public function account_change_password()\n\t{\n\t\t$user_session = $this->session->all_userdata();\n\t\t$user_id = $user_session['user_id'];\n\t\t\n\t\t// print_r($user_id);\n\t\t// die;\n\n\t\t$new_password = $this->input->post('new_password');\n\t\t$retype_password = $this->input->post('retype_password');\n\n\t\tif ($new_password != $retype_password)\n\t\t{\n\t\t\t$this->system_message->set_error(\"Password Miss Match\");\n\n\t\t}\n\t\telse{\n\t\t\t$data = array('password' => $this->input->post('new_password'));\n\t\t\tif (!empty($new_password) && !empty($retype_password))\n\t\t\t{\n\t\t\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t\t\t{\n\t\t\t\t\t$this->custom_model->my_update(array('password_show'=>$new_password),array('id' => $user_id),'admin_users');\n\t\t\t\t\techo \"success\"; die;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"error\"; die;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"error\"; die;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function admin_change_password() {\n\t\t\n\t\tConfigure::write('debug', 0);\n\t\t$this->layout = \"admin\";\n\t\t$this->set(\"changepassword\", \"selected\"); //set main navigation class\n\t\t$this->set('manageClass', 'selected');\n\t\t$uid = $this->Session->read('Admin.id');\n\t\t$email = $this->Session->read('Admin.email');\n\t\t$userdata = $this->Member->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Member.id' => $this->Session->read('Admin.id'),\n\t\t\t\t'Member.email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\tif ($userdata) {\n\t\t\tif (!empty($this->data)) {\n\t\t\t\t$this->Member->updateAll(array(\n\t\t\t\t\t'Member.pwd' => \"'\" . md5($this->data['Member']['pwd']) . \"'\",\n\t\t\t\t\t'Member.email' => \"'\" . $this->data['Member']['email'] . \"'\"\n\t\t\t\t), array(\n\t\t\t\t\t'Member.email' => $email,\n\t\t\t\t\t'Member.id' => $this->Session->read('Admin.id')\n\t\t\t\t) //(conditions) where userid=schoolid\n\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$this->Session->setFlash('Password changed successfully');\n\t\t\t\t$this->redirect(array(\n\t\t\t\t\t'action' => 'change_password',\n\t\t\t\t\t'admin' => true\n\t\t\t\t));\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\telse {\n\t\t}\n\t\t\n\t}", "public function change(string $password): void;", "public static function edit_account() {\n\t\t$user_id = get_current_user_id();\n\t\t$form_id = ur_get_form_id_by_userid( $user_id );\n\t\t$enable_strong_password = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_enable_strong_password' );\n\t\t$minimum_password_strength = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_minimum_password_strength' );\n\n\t\tif ( 'yes' === $enable_strong_password || '1' === $enable_strong_password ) {\n\t\t\twp_enqueue_script( 'ur-password-strength-meter' );\n\t\t}\n\n\t\tur_get_template(\n\t\t\t'myaccount/form-edit-password.php',\n\t\t\tarray(\n\t\t\t\t'user' => get_user_by( 'id', get_current_user_id() ),\n\t\t\t\t'enable_strong_password' => $enable_strong_password,\n\t\t\t\t'minimum_password_strength' => $minimum_password_strength,\n\t\t\t)\n\t\t);\n\t}", "public function changePassword(User $user, string $newPassword): void;", "public function resetAdminUserPwdAction()\n\t{\n\t // \t $return = $user->resetPassword('admin');\n\t // \t var_export($return);\n\t // \t echo PHP_EOL;\n\t // \t echo $return['password'];\n\t // \t return false;\n\t}", "public function changePassword($username, $password);", "public function change_password() {\n\t\treturn view( 'provider.profile.change_password' );\n\t}", "public function changePassword()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('change-password');\n\n return $this->loadPublicView('user.change-password', $breadCrumb['data']);\n }", "function request_admin_password_change() {\n\t\tif (isset($this->data['User']['forgot_password_email'])) {\n\t\t\t$forgot_password_email = $this->data['User']['forgot_password_email'];\n\t\t\t\n\t\t\t\n\t\t\t// check to make sure the email is a valid email for a user\n\t\t\t$change_password_user = $this->User->find('first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'User.email_address' => $forgot_password_email,\n\t\t\t\t\t'User.admin' => true,\n\t\t\t\t),\n\t\t\t\t'contain' => false,\n\t\t\t));\n\t\t\t\n\t\t\tif (empty($change_password_user)) {\n\t\t\t\t$this->Session->setFlash(__('Email does not belong to a valid user', true), 'admin/flashMessage/warning', array(), 'auth');\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Check your email to change your password', true), 'admin/flashMessage/success', array(), 'auth');\n\t\t\t\t$this->FotomatterEmail->send_forgot_password_email($this, $change_password_user);\n\t\t\t}\n\t\t}\n\t\t$this->redirect('/admin');\n\t}", "function eventUpdatePassword(){\r\n\t\t$userid = util::getData(\"id\");\r\n\t\t$password1 = util::getData(\"password1\");\r\n\t\t$password2 = util::getData(\"password2\");\r\n\r\n\t\tif(!$this->canUpdateUser($userid))\r\n\t\t\treturn $this->setEventResult(false, \"You cannot update this account\");\r\n\r\n\t\t$result = dkpAccountUtil::SetOfficerAccountPassword($this->guild->id, $userid, $password1, $password2);\r\n\r\n\t\tif($result != dkpAccountUtil::UPDATE_OK)\r\n\t\t\t$this->setEventResult(false, dkpAccountUtil::GetErrorString($result));\r\n\t\telse\r\n\t\t\t$this->setEventResult(true,\"Password Changed!\");\r\n\r\n\t}", "public function testUpdatePasswordNotGiven(): void { }", "public function isPasswordChangeEnabled();", "public function setPasswordField($password = true) {}", "public function change_pass()\n\t{\n\t\t$form = array();\n\n\t\t$form['validation']['params'] = array('password_old', 'password', 'password_confirm');\n\n\t\t$form['submit'] = function ($params) {\n\t\t\treturn $this->_change_pass_submit();\n\n\n\t\t};\n\n\t\t$form['form'] = function () {\n\t\t\tpage_info('title', lang('title_change_pass'));\n\n\t\t\t$this->_display();\n\t\t};\n\n\t\t$this->_form($form);\n\t}", "function admin_password($id = null) {\n\n\t\t/**\n\t\t * If $id is not set and $this->data is empty, an error message is displayed.\n\t\t * $this->data = Datas from the form\n\t\t * $id = The user ID\n\t\t */\n\t\tif (!$id && empty($this->data)) {\n\t\t\t$this->Session->setFlash(__d('core', 'Invalid user.', true), 'default', array('class' => 'error'));\n\t\t\t$this->redirect(array('action' => 'password'));\n\t\t}\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t/**\n\t\t\t * Save the user password after edit.\n\t\t\t */\n\t\t\tif ($this->User->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * Select the subdomain name with the ID.\n\t\t\t\t * It's necessary for the insert in the \"robot\" table.\n\t\t\t\t * @var string\n\t\t\t\t */\n\t\t\t\t$data = $this->Robot->search($id, 'User');\n\n\t\t\t\t/**\n\t\t\t\t * Insert the edit action in the \"logs\" table.\n\t\t\t\t */\n\t\t\t\t$this->Logs->insert($this->Auth->user('id'), '<strong>[ ' . $data['User']['name'] . ' ]</strong> ' . __d('core', 'User password changed by (' . $this->Auth->user('name') . ').', true) , 'CORE', $_SERVER[\"REMOTE_ADDR\"]);\n\n\t\t\t\t/**\n\t\t\t\t * If the new user password is edited, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user password has been changed.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the user password is not edited, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user password has not been changed.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Display datas.\n\t\t */\n\t\tif (empty($this->data)) {\n\t\t\t$this->data = $this->User->read(null, $id);\n\t\t}\n\n\t}", "public function change_password() {\n\t\tif (!empty($this->request->data)) {\n\t\t\t$this->request->data['User']['id'] = $this->Auth->user('id');\n\t\t\tif ($this->User->changePassword($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Password changed.', true));\n\t\t\t\t$this->redirect('/');\n\t\t\t}\n\t\t}\n\t}", "protected function changePassword()\n {\n if (empty($this->password)) {\n return;\n }\n $this->validateOnly('password', ['password' => 'min:8|confirmed']);\n $this->user->update([\n 'password' => Hash::make($this->password),\n ]);\n $this->password = null;\n $this->password_confirmation = null;\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->btwServer->adminSetServerPassword('secret'));\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->btwServer->adminSetServerPassword('secret'));\n }", "function changePass() {\n\t\t$id = $this->AuthExt->User('id');\n\t\tif (!$id && empty($this->data)) {\n\t\t\t$this->Session->setFlash(__('Invalid user', true));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\t\t\n\t\tif (!empty($this->data)) {\n\t\t\t//don't allow hidden variables tweaking get the group and username \n\t\t\t//form the system in case an override occured from the hidden fields\n\t\t\t$this->data['User']['role_id'] = $this->AuthExt->User('role_id');\n\t\t\t$this->data['User']['username'] = $this->AuthExt->User('username');\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash('The password change has been saved', 'flash_success');\n\t\t\t\t$this->redirect(array('action' => 'index', 'controller' => ''));\n\t\t\t} else {\n\t\t\t\tprint_r($this->data);\n\t\t\t\t$this->data = $this->User->read(null, $id);\n\t\t\t\t$this->data['User']['password'] = null;\n\t\t\t\t$this->data['User']['confirm_passwd'] = null;\n\t\t\t\t$this->Session->setFlash('The password could not be saved. Please, try again.', 'flash_failure');\n\t\t\t}\n\t\t}\n\t\tif (empty($this->data)) {\n\t\t\t$this->data = $this->User->read(null, $id);\n\t\t\t$this->data['User']['password'] = null;\n\t\t}\n\t\t$roles = $this->User->Role->find('list');\n\t\t$this->set(compact('roles'));\n\t}", "function allowPasswordChange() {\n global $shib_pretend;\n\n return $shib_pretend;\n\n }", "function admin_change_password() {\n\t\t/*\techo '<pre>';\n\t\tprint_r($this->data);\n\t\tdie;*/\n\t\t\n\t\tConfigure::write('debug', 0);\n\t\t$this->layout = \"admin\";\n\t\t$this->set(\"changepassword\", \"selected\"); //set main navigation class\n\t\t$this->set('manageClass', 'selected');\n\t\t$uid = $this->Session->read('Admin.id');\n\t\t$email = $this->Session->read('Admin.email');\n\t\t$userdata = $this->Member->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Member.id' => $this->Session->read('Admin.id'),\n\t\t\t\t'Member.email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\tif ($userdata) {\n\t\t\tif (!empty($this->data)) {\n\t\t\t\t$this->Member->updateAll(array(\n\t\t\t\t\t'Member.pwd' => \"'\" . md5($this->data['Member']['pwd']) . \"'\",\n\t\t\t\t\t'Member.email' => \"'\" . $this->data['Member']['email'] . \"'\"\n\t\t\t\t), array(\n\t\t\t\t\t'Member.email' => $email,\n\t\t\t\t\t'Member.id' => $this->Session->read('Admin.id')\n\t\t\t\t) //(conditions) where userid=schoolid\n\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$this->Session->setFlash('Password changed successfully');\n\t\t\t\t$this->redirect(array(\n\t\t\t\t\t'action' => 'change_password',\n\t\t\t\t\t'admin' => true\n\t\t\t\t));\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\telse {\n\t\t}\n\t\t\n\t}", "public function actionChangePassword()\n {\n $this->render('changePassword');\n }", "public function setNewPassword($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_92'));\n\t\tif(!Validator::AccountPassword($value)) throw new Exception(lang('error_92'));\n\t\t\n\t\t$this->_newPassword = $value;\n\t}", "public function actionChangepassword()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t\n\t\t$record = SiteUser::model()->findByAttributes(array('id'=> Yii::app()->user->id));\n\t\n\t\tif(isset($_POST['SiteUser']))\n\t\t{\t\n\t\t\tif(trim($_POST['SiteUser']['password']) != '') {\n\t\t\t\t$record->password = $_POST['SiteUser']['password'];\n\t\t\t\t\n\t\t\t} \t\t\n\t\t\tif(trim($_POST['SiteUser']['password']) == trim($_POST['SiteUser']['repeat_password'])) {\n\t\t\t\t$record->repeat_password = $record->password;\n\t\t\t}\t\n\t\t\t\n\t\t\tif($record->validate()) {\n\t\t\t\t$record->repeat_password = $record->password = crypt($record->password);\n\t\t\t\tif($record->save())\n\t\t\t\t\t$this->redirect(array('personal'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$record->repeat_password = $record->password = '';\n\t\t\t}\n\n\t\t}\t\n\n\t\t$this->render('changepassword',array('record'=>$record));\n\t}", "function change_pwd_update_register(){\n\t\tglobal $CFG;\n\t\t$old_password = $this->My_addslashes(md5($_POST[\"old_password\"]));\n\t\t \n\t\t$new_password = md5($_POST[\"new_password\"]);\n\t \n\t\tif($this->chkPasswordInAdmin($old_password,$_SESSION['adminid'])){\n\t\t\t\t$UpQuery = \"UPDATE \".$CFG['table']['admin'].\" SET password = '\".$this->filterInput($new_password).\"' WHERE admin_id = \". $this->filterInput($_SESSION['adminid']);\n\t\t\t\t$UpResult = mysql_query($UpQuery) or die($this->mysql_error($UpQuery));\n\t\t\t}\n\t\telse{\t\n\t\t\techo \"Invalid_Old_Pwd\";\t\t\t\n\t\t\texit();\n\t\t\t}\n\t}", "Public Function changePassword($NewPassword)\n\t{\n\t\t$this->_db->exec(\"UPDATE bevomedia_user SET Password = md5('$NewPassword') WHERE ID = $this->id\");\n\t}", "public function changePasswordAction()\r\n\t{\r\n\t\t$this->_view->_title = 'Thay đổi mật khẩu';\r\n\r\n\t\tif ($this->_arrParam['form']['token'] > 0) {\r\n\r\n\t\t\t$new = $this->_arrParam['form']['new-password'];\r\n\t\t\t$enter = $this->_arrParam['form']['enter-password'];\r\n\r\n\t\t\tif ($new != $enter) {\r\n\t\t\t\t$this->_view->error = 'Mật khẩu không khớp. Xin kiểm tra lại';\r\n\t\t\t} else {\r\n\r\n\t\t\t\t$this->_model->changePassword($this->_arrParam);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// URL::redirect($this->_arrParam['module'], $this->_controller, 'index');\r\n\r\n\r\n\r\n\t\t$this->_view->render(\"{$this->_controller}/change_password\");\r\n\t}", "public function setPassword ( $uid, $password ) {\n\t\tOC_Log::write('OC_USER_LIST', 'Not possible to change password for users from web frontend using the List user backend', 3);\n\t\treturn false;\n\t}", "public function change_password()\n {\n $currentPassword = $this->input->post('currentPassword');\n $newPassword = $this->input->post('newPassword');\n\n $isPasswordChanged = $this->CustomModel->changePassword(\n $_SESSION['u_id'], $currentPassword, $newPassword\n );\n\n if ($isPasswordChanged) {\n echo 'success';\n }\n }", "public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "public function post_changePassword() {\n //try to change the password\n $status = AuxUser::changePassword();\n if ($status[0]) {\n //if the password change process worked, redirect to the profile page\n echo '<script>alert(\"Password Changed\");</script>';\n Response::redirect('/profile');\n } else {\n //if not, print the error message\n echo '<script>alert(\"'.$status[1].'\");</script>';\n Response::redirect('/profile');\n }\n }", "public function change_admin_password_form() {\n\t if ($this->lang->line('admin_menu_change_password') != '') \n\t\t$this->data['heading']= stripslashes($this->lang->line('admin_menu_change_password')); \n\t\telse $this->data['heading'] = 'Change Password';\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n \n $this->load->view(ADMIN_ENC_URL.'/templates/header.php', $this->data);\n $this->load->view(ADMIN_ENC_URL.'/adminsettings/changepassword.php', $this->data);\n $this->load->view(ADMIN_ENC_URL.'/templates/footer.php', $this->data);\n }\n }", "public function modifpassword($user,$passwd){\n \n }", "public function actionChangePassword()\n {\n \t$user = UserAdmin::findOne(Yii::$app->request->get('id'));\n \t$model = new ChangeForcePasswordForm($user);\n \tif ($model->load(Yii::$app->request->post()) && $model->applyChanges()) \n \t{\n \t\tYii::$app->getSession()->setFlash('success', \n \t\t\t\"The user password has been changed\"\n \t\t);\n \t\treturn $this->redirect([\"/admin/crud/user-admin/view\", 'id' => $user->id]);\n \t}\n \t\n \t$this->layout = '@app/layouts/layout-popup-sm';\n \treturn $this->render('change-password', ['model' => $model]);\n }", "private function __changePassword() {\n\t\t$data = $this->request->data['User'];\n\t\t$this->User->id = $this->Auth->user('id');\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$this->Session->setFlash(__('Your password changed successfully.'), 'success');\n\t\t\t$this->redirect($this->referer());\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change your password due to a server problem, try again later.'), 'error');\n\t\t}\n\t}", "public function change_password() {\n $flash = null;\n // if the user has tried logging in\n if(isset($_POST['login'])){\n // try verifying the user\n if($this->User->login($_POST['username'], $_POST['old_pass'])) {\n if($_POST['new_pass']==$_POST['new_pass_verify']){\n $this->User->setPassword($User->getId(), $_POST['new_pass']);\n session_write_close();\n header(\"Location: \".app::site_url(''));\n exit(0);\n } else {\n $flash = \"I'm sorry, but the new passwords did not match.\";\n }\n } else {\n $flash = \"That username and/or password is not valid.\";\n }\n }\n return array('flash' => $flash);\n }", "public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }", "function allowPasswordChange()\n\t{\n\t\tglobal $ilUser, $ilSetting;\n\t\t\n\t\t\n\t\treturn ilAuthUtils::isPasswordModificationEnabled($ilUser->getAuthMode(true));\n\t\t\n\t\t// Moved to ilAuthUtils\n\t\t\n\t\t// do nothing if auth mode is not local database\n\t\tif ($ilUser->getAuthMode(true) != AUTH_LOCAL &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_CAS || !$ilSetting->get(\"cas_allow_local\")) &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || !$ilSetting->get(\"shib_auth_allow_local\")) &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_SOAP || !$ilSetting->get(\"soap_auth_allow_local\")) &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_OPENID)\n\t\t\t)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (!$this->userSettingVisible('password') ||\n\t\t\t$this->ilias->getSetting('usr_settings_disable_password'))\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\n\t\treturn true;\n\t}", "public function test_admin_set_password()\n {\n $this->assertTrue($this->postScriptumServer->adminSetServerPassword('secret'));\n }", "public function actionPassword()\n {\n if (is_null($this->password)) {\n self::log('Password required ! (Hint -p=)');\n return ExitCode::NOUSER;\n }\n\n if (is_null($this->email) && is_null($this->id)) {\n self::log('User ID or Email required ! (Hint -e= or -i=)');\n return ExitCode::DATAERR;\n }\n\n $model = User::find()->where([\n 'OR',\n [\n 'email' => $this->email\n ],\n [\n 'id' => $this->id\n ]\n ])->one();\n\n if (is_null($model)) {\n\n self::log('User not found');\n\n return ExitCode::NOUSER;\n }\n\n $validator = new TPasswordValidator();\n\n $model->password = $this->password;\n\n $validator->validateAttribute($model, \"password\");\n\n if ($model->errors) {\n\n self::log($model->errorsString);\n\n return ExitCode::DATAERR;\n }\n\n $model->setPassword($this->password);\n\n if (! $model->save()) {\n\n self::log('Password not changed ');\n\n return ExitCode::DATAERR;\n }\n\n self::log($this->email . ' = Password successfully changed !');\n\n return ExitCode::OK;\n }", "public function actionchangePassword() {\n if (isset($_POST['password'])) {\n\n $userid = Yii::app()->user->getState('userid');\n $model = HhUsers::model()->findByPk($userid);\n if ($model->password == md5($_POST['password'])) {\n\n $model->password = md5($_POST['newpassword']);\n if ($model->save()) {\n $this->redirect('index');\n }\n }\n }\n $this->render('changePassword');\n }", "public function setPassword($password);", "public function setPassword($password);", "public function setPassword($password);", "function changePassword( $name, $pw ) {\n $d = loadDB();\n \n $found = false;\n foreach ($d['users'] as &$user) {\n if ($name == $user['name'] || $name == $user['email']) {\n $user[\"password\"] = $pw;\n saveDB( $d );\n $found = true;\n break;\n }\n }\n if (!$found)\n return FALSE;\n audit( \"changePassword done\", $name );\n return TRUE;\n }", "public function changePasswordAction(){\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['password']) && isset($data['repeat_password'])){\n if($data['password'] === $data['repeat_password']){\n $user->setPassword($data['password']);\n } else {\n $this->setErrorResponse('password and repeat_password should match!');\n }\n } else {\n $this->setErrorResponse('password and repeat_password is mandatory fields!');\n }\n $this->_helper->json(array('updated' => true));\n }", "public function change_password()\n {\n $view_data = [\n 'form_errors' => []\n ];\n // Check input data\n if ($this->input->is_post()) {\n\n // Call API to register for parent\n $res = $this->_api('user')->change_password($this->input->post());\n\n if ($res['success'] && !isset($res['invalid_fields'])) {\n $this->_flash_message('パスワードを変更しました');\n redirect('setting');\n return;\n }\n // Show error if form is incorrect\n $view_data['form_errors'] = $res['invalid_fields'];\n $view_data['post'] = $this->input->post();\n }\n\n $this->_render($view_data);\n }", "private function setEncryptPassword(){\n // Encode the new users password\n $encrpyt = $this->get('security.password_encoder');\n $password = $encrpyt->encodePassword($this->user, $this->user->getPassword());\n $this->user->setPassword($password);\n }", "public function changePassword()\n {\n $this->validateOnly('password', [\n 'password' => 'bail|nullable|required_with:password_confirmation|string|confirmed',\n 'current_password' => 'bail|required',\n ]);\n\n if (!Hash::check($this->current_password, $this->user->password)) {\n $this->addError('current_password', 'Your current password is incorrect.');\n return;\n }\n\n $this->user->password = bcrypt($this->password);\n $this->user->save();\n $this->toast('Password has been changed!', 'success');\n $this->emit('password-updated');\n $this->reset(['password', 'password_confirmation', 'current_password']);\n }", "public static function password() {\n if ( !isset($_POST['email']) ) {\n return;\n }\n \n $password = substr(Helper::hash(rand(0,16^32).$_POST['email']),0,12);\n \n $result = Database::checkUser($_POST['email']);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Unbekannter Benutzer!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n return;\n }\n \n $id = $result[0]['id'];\n $passwordold = $result[0]['password'];\n \n $pw = Helper::hash($password.$_POST['email']);\n \n $success = Database::setPassword($id,$passwordold,$pw);\n if ( $success !== false ) {\n self::passwordMail($_POST['email'],$password);\n self::setError('Ein neues Passwort wurde dir zugeschickt!<br>');\n } else {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n }\n }", "private function changePassword()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($request['old_pass']) || $request['old_pass']==\"\")\n throw_error_msg(\"provide old_pass\");\n\n //new_pass\n if(!isset($request['new_pass']) || $request['new_pass']==\"\")\n throw_error_msg(\"provide new_pass\");\n\n //c_new_pass\n if(!isset($request['c_new_pass']) || $request['c_new_pass']==\"\")\n throw_error_msg(\"provide c_new_pass\");\n\n if($request['c_new_pass']!=$request['c_new_pass'])\n throw_error_msg(\"new password and confirm password do not match\");\n\n $request['userid'] = userid();\n $userquery->change_password($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"password has been changed successfully\");\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function change_password()\n\t{\n\t \n\t \n \t\t/* Breadcrumb Setup Start */\n\t\t\n\t\t$link = breadcrumb();\n\t\t\n\t\t$data['breadcrumb'] = $link;\n\t\t\n\t\t/* Breadcrumb Setup End */\n\t\n\t\t$data['page_content']\t=\t$this->load->view('changepwd',$data,true);\n\t\t$this->load->view('page_layout',$data);\n\t}", "public function selfChangePassword()\n\t{\n\t\tif (!$this->userService->changePassword(Input::all()))\n\t\t{\n\t\t\treturn Redirect::route('user-profile', array('tab' => 'account'))->withErrors($this->userService->errors())->withInput();\n\t\t}\n\n\t\tAlert::success('Your password has been successfully changed.')->flash();\n\n\t\treturn Redirect::route('user-profile', array('tab' => 'account'));\n\t}", "public function &setIsPasswordChangeEnabled($value);", "function user_changed_password($user_id, $new_password) {\n \n }", "function change_passwd($Username, $old_Password, $new_Password){\n $new_Password = encrypt_pwd($new_Password);\n $SQL = \"UPDATE User SET Password = '$new_Password' WHERE Username='$Username'\";\n mysqli_query($this->db_link, $SQL);\n }", "function update_password() {\n\t\t$old_password = $_POST['old_password'];\n\t\t$new_password = $_POST['new_password'];\n\t\tif (!empty($old_password) && !empty($new_password)) {\n\t\t\t$admin_records = $this -> conn -> get_table_row_byidvalue('pg_track_admin', 'admin_password', md5($old_password));\n\t\t\tif (!empty($admin_records)) {\n\t\t\t\t$data['admin_password'] = md5($new_password);\n\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('pg_track_admin', 'admin_status', 1, $data);\n\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Password changed successfully\");\n\t\t\t} else {\n\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid Old Password\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Missing parameter\", 'old_password' => $old_password, 'new_password' => $new_password);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "function change_password()\n {\n if ($user = $this->authorized(USER))\n {\n $descriptive_names = array(\n 'current_password' => 'Current Password',\n 'new_password' => 'New Password',\n 'new_password_confirm' => 'Confirm Password'\n );\n\n $rules = array(\n 'current_password' => ($user['group_id']==0)?'clean':'required|clean',\n 'new_password' => 'required|clean',\n 'new_password_confirm' => 'required|clean'\n );\n\n $this->loadLibrary('form.class');\n $form = new Form();\n\n $form->dependencies['title'] = \"Change Password\";\n $form->dependencies['form'] = 'application/views/change-password.php';\n $form->dependencies['admin_reset'] = false;\n $form->dependencies['client_id'] = $user['id'];\n $form->form_fields = $_POST;\n $form->descriptive_names = $descriptive_names;\n $form->view_to_load = 'form';\n $form->rules = $rules;\n\n if ($fields = $form->process_form())\n {\n\n $this->loadModel('UserAuthentication');\n\n\n if ($this->UserAuthentication->change_password($user['id'], $fields['current_password'], $fields['new_password'], $fields['new_password_confirm']))\n {\n $this->alert(\"Password Updated\", \"success\");\n $this->redirect(\"portal/home\");\n }\n else\n {\n $this->alert(\"Error: Password Not Updated\", \"error\");\n $this->redirect(\"portal/home\");\n }\n }\n }\n }", "public function changePassword(PasswordChangeForm $form, User $user);", "public function changePasswordAction()\n {\n $errors = [];\n if(!empty($_POST)){\n $user = Auth::getUser();\n\n $userValidation = new UserValidation($_POST, ['password']);\n $errors = $userValidation->getNamedErrors();\n\n if(empty($errors)){\n if(password_verify($_POST['oldpass'], $user->password)){\n $user->changePassword($_POST['password']);\n Extra::setMessageCookie(\"Password changed successfully.\");\n $this->redirect(\"/manage-account/\");\n }\n $errors['oldpass'] = \"Password you entered is incorrect.\";\n }\n }\n View::renderTemplate(\"LoggedUser/change-password.html\", [\n 'errors' => $errors\n ]);\n }", "public function passwordPage() {\n return view('admin.account.change_password');\n }", "public function changePasswordAction()\n {\n $form = new Form\\Password();\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $userModel = new Model\\Users();\n $identity = $this->_auth ->getIdentity();\n $userId = $identity->getId();\n $user = $userModel->getUser($userId);\n $result = $userModel->savePassword($user, $form->getValue('new_password'), $form->getValue('password'));\n\n if ($result) {\n $this->_helper->getHelper('FlashMessenger')->addMessage('Your password was changed.'); \n } else {\n $this->_helper->getHelper('FlashMessenger')->addMessage('Your password was NOT changed.');\n }\n $this->_redirect($this->getRequest()->getRequestUri());\n }\n $this->view->passwordForm = $form;\n }", "public function change_password()\n {\n return view('backend.profile.change-password');\n }", "public function change()\r\n {\r\n// var_dump($this->validate());die;\r\n if ($this->validate()) {\r\n $user = $this->_user; \r\n $user->setPassword($this->newPwd);\r\n $user->removePasswordResetToken();\r\n return $user->save(false);\r\n }\r\n \r\n return false;\r\n }", "public function Change_user_password() {\n\t\t$this->load->helper('pass');\n\t\t$user = $this->administration->getMyUser($this->user_id);\n\t\t//password\n\t\t$old_pass = $this->input->post('oldPassword');\n\t\t$newPass = $this->input->post('newPassword');\n\t\t$confirmNewPass = $this->input->post('confirmNewPassword');\n\t\tif($newPass == $confirmNewPass) {\n\t\t\t//check if old password is corrent\n\t\t\t$verify = $this->members->validateUser($user->Username,$old_pass);\n\t\t\tif($verify) {\n\t\t\t\t//validate if the password is in the correct format\n\t\t\t\t$valid_new_pass = checkPasswordCharacters($newPass);\n\t\t\t\tif($valid_new_pass) {\n\t\t\t\t\t$change_pass = $this->members->simple_pass_change($user->ID,$newPass);\n\t\t\t\t\tif($change_pass) {\n\t\t\t\t\t\techo '1';\n\t\t\t\t\t}else {\n\t\t\t\t\t\techo '6';\t\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\techo '7';\t\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\techo '8';\t\n\t\t\t}\n\t\t}else {\n\t\t\techo '9';\t\n\t\t}\n\t}", "public function changepassword()\n { \n return view('admin.profile.changepassword');\n }", "function setPassword($password) {\n return false;\n }", "public function setPassword($value)\r\n\t{\r\n\t\t$this->password = $value;\r\n\t}", "public function postChangepassword() {\n if ($this->_adminUserRepository->updatePassword ()) {\n return redirect ( 'users/changepassword' )->withSuccess ( trans ( 'user::adminuser.changepassword.success' ) );\n } else {\n return redirect ( 'users/changepassword' )->withErrors ( trans ( 'user::adminuser.changepassword.incorrect' ) );\n }\n }", "public function changePasswordAction()\n {\n $message = array();\n $message['success'] = \"\";\n $message['verify'] = $this->customerVerify($_SESSION['userName'], $_POST['currentPass']);\n if (!$message['verify']) {\n $message['confirm'] = $this->checkConfirm($_POST['newPass'], $_POST['confirmPass']);\n if (!$message['confirm']) {\n $this->model->chagePass($_SESSION['userName'], password_hash($_POST['newPass'], PASSWORD_DEFAULT));\n $message['success'] = \"Your password has been changed\";\n }\n }\n echo json_encode($message);\n }", "public function editPassword($pword)\n\t\t{\n\t\t\tglobal $password;\n\t\t\tglobal $user_id;\n\t\t\n\t\t\t$pword = addslashes($pword);\n\n\t\t\tif(strlen($pword) <= 32)\n\t\t\t{\n\t\t\t$qry = 'UPDATE admin_table SET password = \"' . $pword . '\" WHERE user_id = '. $user_id;\n\t\t\t$result = mysql_query($qry, $GLOBALS['connection']);\n\t\t\t}\n\t\t\n\t\t\t$password = $pword;\n\t\t}", "public function setPassword(string $password): void\n {\n }", "public function password_change()\n\t{\n\t\t$data['title'] = \"Change Password\";\n\t\t$this->load->view('admin/user/_header');\n\t\t$this->load->view('admin/user/_left_sideber');\n\t\t$this->load->view('admin/user/view_change_password');\n\t\t$this->load->view('admin/user/_footer');\n\t\t\t\n\t}", "public function setPassword($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_1'));\n\t\tif(!Validator::AccountPassword($value)) throw new Exception(lang('error_1'));\n\t\t\n\t\t$this->_password = $value;\n\t}", "function changepass_firsttime()\n {\n $userId = $this->userInfo('user_id');\n \n $result = $this->update('user', array('password' => $this->value('password'), 'modified' => date('Y-m-d H:i:s')), \" user_id = \".$userId);\n \n if($result === TRUE)\n {\n //this will prevent user from being logged out automatically. (as it happens in old implementation)\n $_SESSION['password'] = $this->value('password');\n \n //update the patient_history table with \"password change\" action to 'complete'\n $data = array(\n 'patient_id' => $userId,\n 'action_type' => 'first time login',\n 'action' => 'password change', \n 'action_status' => 'complete',\n 'action_time' => date('Y-m-d H:i:s')\n );\n $this->insert('patient_history', $data);\n \n echo \"{success:true, message:'Password updated successfully'}\";\n }\n else\n {\n echo \"{success:false, message:'Password update failure'}\";\n }\n }", "function mysql_auth_can_change_password($username = \"\")\n{\n /*\n * By default allow the password to be modified, unless the existing\n * user is explicitly prohibited to do so.\n */\n\n if (empty($username) || !mysql_auth_user_exists($username))\n {\n return 1;\n } else {\n return dbFetchCell(\"SELECT `can_modify_passwd` FROM `users` WHERE `username` = ?\", array($username));\n }\n}", "public function setPassword($value)\n {\n $this->_password = $value;\n }", "public function password()\n {\n $this->isUser();\n\n $this->data['noCabinetOrAdmin'] = true;\n\n if ($_POST) {\n\n if (!$_POST['old-password'] && !$_POST['new-password']) {\n\n $userModel = new UserModel();\n\n $validateResult = $userModel->validate($_POST);\n\n if ($validateResult === true) {\n\n $checkPassword = $userModel->checkOldPassword($_POST['old-password']);\n\n if ($checkPassword) {\n\n if ($userModel->refreshPassword($_POST)) {\n\n $this->data['success'] = 'Пароль успешно изменен';\n\n } else {\n\n $this->data['warning'] = 'Произошла ошибка';\n }\n\n } else {\n\n $this->data['warning'] = 'Старый пароль введен не правильно';\n }\n\n } else {\n\n $this->data['warning'] = $validateResult;\n }\n\n } else {\n\n $this->data['warning'] = 'Все поля должны быть заполнены';\n }\n }\n\n $this->render('password');\n }", "public static function setPassword(string $newPassword): void\n {\n self::writeConfiguration(['password' => password_hash($newPassword, PASSWORD_DEFAULT)]);\n }" ]
[ "0.83558816", "0.79263043", "0.76377237", "0.7580012", "0.75723493", "0.7563001", "0.7537797", "0.75117743", "0.74716485", "0.7471457", "0.7424254", "0.7387802", "0.73528516", "0.73068184", "0.728269", "0.7248704", "0.7238826", "0.7208702", "0.72020173", "0.7196615", "0.7193163", "0.71529204", "0.7149684", "0.71378934", "0.7129339", "0.7124817", "0.7114214", "0.70860654", "0.707889", "0.70622915", "0.7032281", "0.7017828", "0.701492", "0.7012714", "0.7007377", "0.6999303", "0.6969772", "0.6969427", "0.6962147", "0.6962147", "0.6958158", "0.69578546", "0.6950054", "0.6949213", "0.6947756", "0.69474864", "0.694497", "0.69394183", "0.693096", "0.693065", "0.6922975", "0.692292", "0.6913121", "0.68980724", "0.68841124", "0.6882731", "0.68799406", "0.68789476", "0.68695825", "0.6869359", "0.6866114", "0.68632317", "0.6857707", "0.6856164", "0.6856164", "0.6856164", "0.68540305", "0.6853558", "0.6849158", "0.6842396", "0.68412274", "0.68386406", "0.683538", "0.6831531", "0.6800773", "0.6800639", "0.6785377", "0.67819595", "0.67745733", "0.6761369", "0.6758071", "0.6752856", "0.6749581", "0.6747477", "0.6722572", "0.6721427", "0.6713228", "0.671077", "0.670604", "0.67055357", "0.67030746", "0.66982067", "0.66886723", "0.66814226", "0.6669269", "0.6665379", "0.6660702", "0.665527", "0.66494817", "0.6640723", "0.6638377" ]
0.0
-1
Validate the data used to change user password.
protected function validateChangePasswordData($request) { $this->validate($request, [ 'new_password' => ['required', 'string', 'between:6,50', 'confirmed'], 'new_password_confirmation' => ['required', 'string', 'between:6,50'] ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->oldPassword)) {\n $this->addError('oldPassword', 'Incorrect old password.');\n }\n }", "public function validatePassword() {\n if (!$this->hasErrors()) {\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password_old)) {\n // $this->addError('password_old', 'Incorrect current password.');\n }\n }\n }", "public function validatePassword()\n {\n if (!$this->hasErrors()) {\n if (!$this->user->validatePassword($this->old_password)) {\n $this->addError('old_password', 'Incorrect email or password.');\n }\n }\n }", "function validate_resetPwd($data)\n {\n \n $errors=array();\n \n if(trim($data['Users']['password'])==\"\")\n {\n $errors['password'][]= \"Please enter your password\";\n }\n else \n {\n $length=strlen($data['Users']['password']);\n if($length < 6)\n {\n $errors['password'][]= \"Please enter minimum 6 characters\";\n }\n\n \n }\n if(trim($data['Users']['re_password'])==\"\")\n {\n $errors['re_password'][]=\"Please enter your Confirm password\";\n }\n else \n {\n if($data['Users']['password'] != $data['Users']['re_password'])\n {\n $errors['re_password'][] = \"Password does not match\";\n }\n }\n \n return $errors;\n }", "public function vxUserPasswordUpdateCheck() {\n\t\t$rt = array();\n\t\t\n\t\t$rt['errors'] = 0;\n\t\t\n\t\t$rt['pswitch'] = 'a';\n\t\t\n\t\t$rt['usr_password_value'] = '';\n\t\t$rt['usr_confirm_value'] = '';\n\t\t/* usr_password_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow (32 sbs)\n\t\t3 => invalid characters\n\t\t4 => not identical\n\t\t5 => modify empty\n\t\t999 => unspecific */\n\t\t$rt['usr_password_error'] = 0;\n\t\t$rt['usr_password_touched'] = 0;\n\t\t$rt['usr_password_error_msg'] = array(1 => '你忘记填写密码了', 2 => '你的这个密码太长了,缩减一下吧', 3 => '你填写的密码中包含了不被允许的字符', 4 => '你所填写的两个密码不匹配', 5 => '你修改密码时需要将新密码输入两遍');\n\t\t/* usr_confirm_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow (32 sbs)\n\t\t3 => invalid characters(should not reach here in final rendering)\n\t\t4 => not identical\n\t\t5 => modify empty\n\t\t999 => unspecific */\n\t\t$rt['usr_confirm_error'] = 0;\n\t\t$rt['usr_confirm_touched'] = 0;\n\t\t$rt['usr_confirm_error_msg'] = array(1 => '你忘记填写密码确认了', 2 => '你的这个密码确认太长了,缩减一下吧', 3 => '你填写的密码中包含了不被允许的字符', 4 => '你所填写的两个密码不匹配', 5 => '你修改密码时需要将新密码输入两遍');\n\n\t\t/* S check: usr_password and usr_confirm */\n\t\t\n\t\tif (isset($_POST['usr_password'])) {\n\t\t\t$rt['usr_password_value'] = $_POST['usr_password'];\n\t\t\tif (strlen($rt['usr_password_value']) == 0) {\n\t\t\t\t$rt['usr_password_touched'] = 0;\n\t\t\t\t$rt['usr_password_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t} else {\n\t\t\t\t$rt['usr_password_touched'] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_password_touched'] = 0;\n\t\t\t$rt['usr_password_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\tif (isset($_POST['usr_confirm'])) {\n\t\t\t$rt['usr_confirm_value'] = $_POST['usr_confirm'];\n\t\t\tif (strlen($rt['usr_confirm_value']) == 0) {\n\t\t\t\t$rt['usr_confirm_touched'] = 0;\n\t\t\t\t$rt['usr_confirm_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t} else {\n\t\t\t\t$rt['usr_confirm_touched'] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_confirm_touched'] = 0;\n\t\t\t$rt['usr_confirm_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 0) && ($rt['usr_confirm_touched'] == 0)) {\n\t\t\t$rt['pswitch'] = 'a'; /* both blank */\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 1) && ($rt['usr_confirm_touched'] == 1)) {\n\t\t\t$rt['pswitch'] = 'b'; /* both touched */\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 1) && ($rt['usr_confirm_touched'] == 0)) {\n\t\t\t$rt['pswitch'] = 'c'; /* first touched */\n\t\t}\n\t\t\t\n\t\tif (($rt['usr_password_touched'] == 0) && ($rt['usr_confirm_touched'] == 1)) {\n\t\t\t$rt['pswitch'] = 'd'; /* second touched */\n\t\t}\n\t\t\n\t\tswitch ($rt['pswitch']) {\n\t\t\tdefault:\n\t\t\tcase 'a':\n\t\t\t\t/* nothing will happen */\n\t\t\t\tbreak;\n\t\t\tcase 'b':\n\t\t\t\t/* a lot check here */\n\t\t\t\tif (strlen($rt['usr_password_value']) > 32) {\n\t\t\t\t\t$rt['usr_password_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif (strlen($rt['usr_confirm_value']) > 32) {\n\t\t\t\t\t$rt['usr_confirm_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (($rt['usr_password_error'] == 0) && ($rt['usr_confirm_error'] == 0)) {\n\t\t\t\t\tif ($rt['usr_password_value'] != $rt['usr_confirm_value']) {\n\t\t\t\t\t\t$rt['usr_confirm_error'] = 4;\n\t\t\t\t\t\t$rt['errors']++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t$rt['usr_confirm_error'] = 5;\n\t\t\t\t$rt['errors']++;\n\t\t\t\tbreak;\n\t\t\tcase 'd':\n\t\t\t\t$rt['usr_password_error'] = 5;\n\t\t\t\t$rt['errors']++;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $rt;\n\t}", "private function validator_changepass($data)\n {\n return Validator::make($data, [\n 'old_password' => 'required',\n 'new_password' => 'required|min:6',\n 'confirm_pass' => 'required|min:6|same:new_password',\n ]);\n }", "public function Change_Password_Validation($sorce){\r\n\r\n if (empty($sorce['current_password']))\r\n {\r\n \t$this->_flag = false;\r\n\r\n Session::put('e_password', 'You must enter your old password');\r\n }\r\n if($this->_flag){\r\n\r\n // Copy send values into local instances\r\n $password1 = $sorce['password1'];\r\n $password2 = $sorce['password2'];\r\n\r\n // Check if password is too long\r\n if(self::check_Max($password1)){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_password1', 'Your new password is too long, max '.$this->_max.' chars!');\r\n }\r\n\r\n // Check if password is too short\r\n else if(self::check_Min($password1)){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_password1', 'Your new password is too short , min '.$this->_min.' chars!');\r\n }\r\n\r\n // Check if passwords are the same\r\n else if(self::check_If_The_Same_Passwords($password1,$password2)){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_password1', 'Different new passwords!');\r\n }\r\n }\r\n }", "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password)) {\n $this->addError('password', 'Incorrect password.');\n }\n }", "public function validatePasswordChange($input){\n $userData = array();\n $error=array();\n\n\n if(empty($input['oldpassword'])){\n $error = array_merge($error,array('oldpassword' => 'This field is required.'));\n }\n else{\n $cleanData = $this->cleanInput($input['oldpassword']);\n require_once('../app/Core/Database.php');\n $db = new Database();\n $conn = $db->setConnection();\n if($conn !== null){\n $stmt = $conn->query(\"SELECT username,password FROM user where username='\".$_SESSION['username'].\"'\");\n if($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n if(!password_verify($cleanData,$row['password']) ){\n $error = array_merge($error,array('oldpassword' => 'Incorrect password.'));\n }\n } \n } \n }\n\n if(empty($input['newpassword'])){\n $error = array_merge($error,array('newpassword' => 'This field is required.'));\n }\n else{\n $cleanData = $this->cleanInput($input['newpassword']); \n $uppercase = preg_match('@[A-Z]@', $cleanData);\n $lowercase = preg_match('@[a-z]@', $cleanData);\n $number = preg_match('@[0-9]@', $cleanData);\n $specialChars = preg_match('@[^\\w]@', $cleanData);\n\n if (!$uppercase || !$lowercase || !$number || !$specialChars || strlen($cleanData) < 8) {\n $error = array_merge($error,array('newpassword' => 'Password should be at least 8 characters in length and should include at least one upper case letter, one number, and one special character.'));\n }\n else{\n $userData = array_merge($userData,array('newpassword' => password_hash($cleanData,PASSWORD_DEFAULT)));\n } \n }\n\n if(empty($input['confirmpassword'])){\n $error = array_merge($error,array('confirmpassword' => 'This field is required.'));\n }\n else{\n $cleanData = $this->cleanInput($input['confirmpassword']);\n\n if ($cleanData!=$this->cleanInput($input['newpassword'])) {\n $error = array_merge($error,array('confirmpassword' => 'Password does not match with the new password'));\n } \n }\n\n if(empty($error)){\n return array('valid'=>1 ,'data'=>$userData);\n }\n else{\n return array('valid'=>0,'error'=>$error);\n }\n\n \n }", "function m_verifyEditPass()\n\t{\n\t\t$this->errMsg=MSG_HEAD.\"<br>\";\n\t\tif(empty($this->request['password']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif(empty($this->request['verify_pw']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_VERIFYPASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif($this->request['password']!=$this->request['verify_pw'])\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_NOTMATCHED.\"<br>\";\n\t\t}\n\t\treturn $this->err;\n\t}", "public function validatePassword()\n {\n if (!$this->hasErrors()) {\n $user = $this->getUser();\n\n if (!$user || !$user->validatePassword($this->password)) {\n $this->addError('password', Yii::t('app','Falscher Benutzername oder falsches Passwort.'));\n }\n }\n }", "public function changePassword($data){\n\t\tif(isset($data['User']['current_password']) && isset($data['User']['id'])){\n\t\t\tif($this->checkPassword($data['User']['id'], $data['User']['current_password'])){\n\t\t\t\tunset($data['User']['current_password']);\n\t\t\t\treturn $this->save($data);\n\t\t\t}\telse {\n\t\t\t\t$this->invalidate('current_password', 'Your current password is not correct.');\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static function changePassword($data)\n {\n $msgValidate = [];\n $rule = [\n 'password' => 'required|confirmed|min:6'\n ];\n $validateRs = Frontend::validateForm($data, $rule, $msgValidate);\n if ($validateRs['rs'] == System::FAIL) {\n return $validateRs;\n } else {\n $user = Auth::guard('users')->user();\n $user->update(['password' => Hash::make($data['password'])]);\n Session::flash(System::FLASH_SUCCESS, STheme::lang('lang.msg.change_password_success'));\n return [\n 'rs'=>System::SUCCESS,\n 'msg'=>'',\n 'redirect_url'=>'/user/change-password'\n ];\n }\n }", "public function password($data){\n\n\n \t$q = \"SELECT password FROM user_table WHERE password='$data[current_pass]'\";\n\n \t$result = $this->connection->query($q);\n\n \t // check if current password is correct\n\n \tif($result->num_rows >0){\n\n \n \t\t$id = $_SESSION['id'];\n\n\t \t\tif($data['new_pass']==$data['re_pass'])\n\t \t\t{\n\n\t \t\t\tif(strlen($data['new_pass'])<8){\n\n\t\t\t\t$_SESSION['message'] = \"Password must contain 8 letters\";\n\t\t\t\t $_SESSION['msg_type'] = \"danger\";\n\t\t\t\t}else{\n\n\t \t\t$q=\"UPDATE user_table SET password='$data[new_pass]' WHERE id='$id'\";\n\n\t \t\t$result = $this->connection->query($q);\n\n\t \t\t$_SESSION['message'] = \"Successfully changed\";\n\t \t\t$_SESSION['msg_type'] = \"success\";\n\n\t\t \t}\n\t \n\n\t \t}\n\t \telse\n\t \t{\n\n\t \t\t$_SESSION['message'] = \"New password does not match\";\n\t \t\t$_SESSION['msg_type'] = \"warning\";\n \n\t \t}\n\t }\n\t else\n\t {\n\n\t \t$_SESSION['message']= \"Invalid current password\";\n\t \t$_SESSION['msg_type'] = \"danger\";\n \n\t }\n }", "function changePassword($data){\r\n if(!empty($this->user_id) || $this->matchPasswordForUsername($data['userName'],$data['code'])){\r\n if(!empty($this->user_id)){\r\n $data['userName'] = $this->user_profile['username'];\r\n }\r\n if($data['newpwd']==$data['newpwdagn']){\r\n\r\n\t\t\t// check if the password is strong\r\n\t\t\tif(!$this->isPasswordStrong($data['newpwd'])){\r\n\t\t\t\t$this->setStdError('weak_password');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n // if the password is one of last n passwords\r\n if($this->isOneOfLastNPasswords($data['newpwd'])){\r\n $this->setError('Your password is one of last '.$this->app_config['password_no_repeat'].' passwords.');\r\n return false;\r\n }\r\n\r\n global $pdo;\r\n try{\r\n $update=$pdo->prepare(\"UPDATE users SET `password`=?, `status` = 1 WHERE id= ?\");\r\n $userid = $this->getUserIdFromUsername($data['userName']);\r\n $update->execute(array($this->getPasswordHashOfUser($data['userName'],$data['newpwd']), $userid));\r\n //update the password log\r\n if(empty($this->user_id)){\r\n $this->user_id = $userid;\r\n }\r\n $this->updatePasswordLog($this->getPasswordHashOfUser($data['userName'],$data['newpwd']));\r\n\r\n $this->updatePasswordResetQueue($userid);\r\n\t\t\t\t\t$log = debug_backtrace();\r\n\t\t\t\t\t$this->createActionLog($log);\r\n return true;\r\n }\r\n catch(PDOException $e){\r\n $this->setError($e->getMessage());\r\n return false;\r\n }\r\n\r\n }else{\r\n $this->setError(\"Passwords entered do not match. Please check and type again.\");\r\n return false;\r\n }\r\n }\r\n else{\r\n $this->setError(\"Password was not reset.\");\r\n return false;\r\n }\r\n }", "public function password()\n {\n $this->isUser();\n\n $this->data['noCabinetOrAdmin'] = true;\n\n if ($_POST) {\n\n if (!$_POST['old-password'] && !$_POST['new-password']) {\n\n $userModel = new UserModel();\n\n $validateResult = $userModel->validate($_POST);\n\n if ($validateResult === true) {\n\n $checkPassword = $userModel->checkOldPassword($_POST['old-password']);\n\n if ($checkPassword) {\n\n if ($userModel->refreshPassword($_POST)) {\n\n $this->data['success'] = 'Пароль успешно изменен';\n\n } else {\n\n $this->data['warning'] = 'Произошла ошибка';\n }\n\n } else {\n\n $this->data['warning'] = 'Старый пароль введен не правильно';\n }\n\n } else {\n\n $this->data['warning'] = $validateResult;\n }\n\n } else {\n\n $this->data['warning'] = 'Все поля должны быть заполнены';\n }\n }\n\n $this->render('password');\n }", "public function isUpdateValid($data, $user)\n {\n $valid = parent::isValid($data);\n\n $hasErrors = false;\n if (!empty($data[User::INPUT_PASSWORD_OLD])) {\n /**\n * Something was typed in the old password field\n */\n if ($user->{User::COLUMN_PASSWORD} != md5($data[User::INPUT_PASSWORD_OLD])) {\n /**\n * Old password is incorrect, stop right here\n */\n $this->getElement(User::INPUT_PASSWORD_OLD)->clearErrorMessages()->addError('wrongPassword');\n $hasErrors = true;\n } else {\n /**\n * Old password is correct, check for updates in new password fields\n */\n if ($data[User::INPUT_PASSWORD_CONFIRM] !== $data[User::INPUT_PASSWORD]) {\n $this->getElement(User::INPUT_PASSWORD)->clearErrorMessages();\n $this->getElement(User::INPUT_PASSWORD_CONFIRM)->clearErrorMessages()\n ->addError(Zend_Validate_Identical::NOT_SAME);\n $hasErrors = true;\n }\n }\n } else {\n /**\n * Nothing was typed in the old password field\n */\n if (!empty($data[User::INPUT_PASSWORD_CONFIRM]) || !empty($data[User::INPUT_PASSWORD])) {\n /**\n * New passwords were given, but we need the old one !\n */\n $this->getElement(User::INPUT_PASSWORD_OLD)->clearErrorMessages()->addError('isEmpty');\n $hasErrors = true;\n }\n }\n\n $valid = $valid && !$hasErrors;\n return $valid;\n }", "public function password(){\r\n\r\n\t\t\t$user_info = Helper_User::get_user_by_id($this->user_id);\r\n\r\n\t\t\tif($_POST){\r\n\r\n\t\t\t\t$formdata = form_post_data(array(\"old_password\", \"new_password\", \"repeat_new_password\"));\r\n\t\t\t\t\r\n\t\t\t\t$old_password = trim($formdata[\"old_password\"]);\r\n\t\t\t\t$new_password = trim($formdata[\"new_password\"]);\r\n\t\t\t\t$repeat_new_password = trim($formdata[\"repeat_new_password\"]);\r\n\r\n\t\t\t\t$error_flag = false;\r\n\r\n\t\t\t\tif(strlen($old_password) <= 0){\r\n\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the old password\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif(strlen($new_password) > 0 && strlen($repeat_new_password) > 0){\r\n\t\t\t\t\t\t// if both fields are not empty\r\n\r\n\t\t\t\t\t\tif(strlen($new_password) < 6){\r\n\t\t\t\t\t\t\t// the password cannot be less than 6 characters\r\n\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\tTemplate::notify(\"error\", \"Too short password. Password must be at least 6 characters long.\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// now compare the two new passwords\r\n\t\t\t\t\t\t\tif(strcmp($new_password, $repeat_new_password) !== 0){\r\n\t\t\t\t\t\t\t\t// both passwords are not same\r\n\t\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"error\", \"New Passwords do not match. Please try again.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the new password\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!$error_flag){\r\n\t\t\t\t\t// means there are no any errors\r\n\t\t\t\t\t// get the current user account from the database\r\n\t\t\t\t\t// if the old password matches with the one that the user entered\r\n\t\t\t\t\t// change the password, else throw an error\r\n\r\n\t\t\t\t\t$old_password_hash = Config::hash($old_password);\r\n\r\n\t\t\t\t\tif(strcmp($old_password_hash, trim($user_info->password)) === 0){\r\n\r\n\t\t\t\t\t\t\tif($this->change_password($new_password, $user_info)){\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"success\", \"Password changed successfully\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tredirect(Config::url(\"account\"));\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Wrong Old Password. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tConfig::set(\"active_link\", \"password\");\r\n\t\t\tConfig::set(\"page_title\", \"Change Account Password\");\r\n\r\n\t\t\t$view_data[\"user_info\"] = $user_info;\r\n\r\n\t\t\tTemplate::setvar(\"page\", \"account/password\");\r\n\t\t\tTemplate::set(\"account/template\", $view_data);\r\n\t\t}", "public function testPasswordChange(): void\n {\n // Test strong password - should pass.\n $this->setUpUserPostData(Constants::SAFE_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Test weak password - should pass as well.\n $this->setUpUserPostData(Constants::PWNED_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Clean up.\n $this->tearDownUserPostData();\n }", "public function validatePassword()\n {\n $validator = new Validator(array(\n 'password' => $this->password,\n 'password2' => $this->password2,\n self::$primaryKey => $this->id(),\n ));\n\n $validator\n ->required()\n ->set('password2', 'Confirm password');\n\n $validator\n ->required()\n ->minLength(6)\n ->callback(function ($password, $password2) {\n return $password === $password2;\n }, 'Password is not matching confirm password', array($this->password2))\n ->set('password', 'Password');\n\n return $validator->validate();\n }", "public function password_verifies() {\n\t\treturn AuthComponent::password($this->data[$this->alias]['old_password']) === $this->data[$this->alias]['password'];\n\t}", "function changeUserPassword($argArrPOST) {\n //print_r($argArrPOST);\n $objValid = new Validate_fields;\n $objCore = new Core();\n $objValid->check_4html = true;\n\n $objValid->add_text_field('Current Password', $argArrPOST['frmPassword'], 'text', 'y', 20);\n $objValid->add_text_field('New Password', strip_tags($argArrPOST['frmNewPassword']), 'text', 'y', 20);\n $objValid->add_text_field('Confirm New password', strip_tags($argArrPOST['frmNewConfPassword']), 'text', 'y', 20);\n\n if ($objValid->validation()) {\n $varErrorMsgFirst = 'Please enter required fields!';\n } else {\n $varErrorMsg = $objValid->create_msg();\n }\n\n if ($varErrorMsg) {\n $objCore->setErrorMsg($varErrorMsg);\n return false;\n }\n\n $arrUserFlds = array('Password');\n $varUserWhere = ' 1 AND pkUserID = \\'' . $_SESSION['ASP_UserID'] . '\\'';\n $arrUserList = $this->select(TABLE_USERS, $arrUserFlds, $varUserWhere);\n //echo $arrUserList[0]['Password'];echo \"<br/>\";\n //echo $argArrPOST['frmPassword'];die;\n if ($arrUserList[0]['Password'] == md5(trim($argArrPOST['frmPassword']))) {\n $varUsersWhere = ' pkUserID =' . $_SESSION['ASP_UserID'];\n $arrColumnAdd = array(\n 'Password' => md5(trim($argArrPOST['frmNewPassword'])),\n 'UserModifiedDate' => 'now()'\n );\n\n $varUserID = $this->update(TABLE_USERS, $arrColumnAdd, $varUsersWhere);\n\n $objCore->setSuccessMsg(FRONT_END_PASSWORD_SUCC_CHANGE);\n return true;\n } else {\n $objCore->setErrorMsg(FRONT_END_INVALID_CURENT_PASSWORD);\n return false;\n }\n }", "public function password_change_verification() {\n\n $criteria = array(\"id\" => $this->ci->input->post(\"id\"));\n\n $passed = $this->verify_password($criteria, $this->ci->input->post(\"old_password\")); // variable to mark the user is allowed to pass or not.\n\n if (!$passed) {\n $this->ci->form_validation->set_message(\"password_change_verification\", \"Invalid password.\");\n }\n\n return $passed;\n }", "public function passwordEntryIsValid() {\r\n \r\n //todo put logic here (same as email)\r\n // also check if it matches confirmpassword\r\n // set the var equal to function call of getpassword\r\n $password = $this->getPassword();\r\n // If the fields empty\r\n if ( empty($password) ) {\r\n // Will send it to errors as username and display the message to user\r\n $this->errors[\"password\"] = \"Password is missing.\";\r\n } \r\n // Calls the password function above and if its not equal to the orgincal password returns error\r\n else if ( $this->getConfirmpassword() !== $this->getPassword() ){\r\n // Message displayed to user\r\n $this->errors[\"password\"] = \"Password does not match confirmation password.\";\r\n }\r\n // Also goes test the password against the password is valid function in the validator class\r\n else if ( !Validator::passwordIsValid($this->getPassword()) ) {\r\n $this->errors[\"password\"] = \"Password is not valid.\"; \r\n }\r\n //Will return if its empty and whether any errors are contained\r\n return ( empty($this->errors[\"password\"]) ? true : false ) ;\r\n }", "public function testInvalidConfirmPassword()\n\t{\n\t\t$this->validator->isPassword(self::USER1_PASSWORD, self::INVALID_PASSWORD);\n\t}", "protected function changePassword() {}", "public function enforceRulePassword($data){\n if (strlen($data) >= 8){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t/*if (preg_match (\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-zA-Z]).*$/\", $data)){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}*/\n\t\t\t\n\t\t\treturn $validPassword;\n }", "public function validate_old_password(){\n\t\t\t\n\t\t\t$username = $this->session->userdata('admin_username');\n\t\t\t$old_password = $this->input->post('old_password');\n\t\t\t$hashed_password = '';\n\t\t\t\n\t\t\t//get users info frm db using username\n\t\t\t$user_array = $this->Admin->get_user($username);\n\t\t\tif($user_array){\n\t\t\t\t//get stored password\n\t\t\t\tforeach($user_array as $user){\n\t\t\t\t\t$hashed_password = $user->admin_password;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// If the password inputs matched the hashed password in the database\n\t\t\tif (password_verify($old_password, $hashed_password)){\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->form_validation->set_message('validate_old_password', 'The Old Password is invalid');\n\t\t\t\treturn FALSE;\n\t\t\t\t\n\t\t\t}\n\t\t}", "function validateCurrentPassword(&$Model, $data) {\r\n\t\t$key = key($data);\r\n\t\t$value = $data[$key];\r\n\t\tif (!$value) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\textract($this->settings[$Model->alias]);\r\n\t\treturn (Security::hash($value, null, true) === $Model->field($fields['password']));\r\n\t}", "public function editUserPasswordChk() {\r\n\r\n $table_to_pass = 'mst_users';\r\n $fields_to_pass = array('user_id', 'user_password');\r\n $condition_to_pass = array(\"user_password\" => base64_encode($this->input->post('old_user_password')));\r\n $arr_login_data = $this->user_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\r\n if (count($arr_login_data)) {\r\n echo 'true';\r\n } else {\r\n echo 'false';\r\n }\r\n }", "function is_password_valid ($password, $user_data) {\n // the one in the user records.\n $is_valid = $password == $user_data['password'];\n return $is_valid;\n}", "public function checkPassword($value);", "public function validar_old_passwords(){\r\n\t\tif($_POST['old_password'] != $_POST['old_password2']){\r\n\t\t\t$this->error = $this->errores[16];\r\n\t\t}\r\n\t}", "protected function validateReset($data)\n\t{\n\t\t/** \n\t\t* Validate input field on server side\n\t\t* Check if email and password contains valid phrases\n\t\t**/\n\t\tif ((strlen(trim($data['hash'])) < 10) || (strlen(trim($data['hash'])) > 255)) {\n\t\t\t/** \n\t\t\t* If First name is not valid ( min 2 character or max 48 ) \n\t\t\t* Return false\n\t\t\t**/\n\t\t\treturn false;\n\t\t} elseif ((strlen($data['mail']) > 96) || !filter_var($data['mail'], FILTER_VALIDATE_EMAIL)) {\n\t\t\t/** \n\t\t\t* If email is not valid\n\t\t\t* Return false\n\t\t\t**/\n\t\t\treturn false;\n\t\t} elseif (strlen($data['password']) < 6) {\n\t\t\t/** \n\t\t\t* If Password is not valid ( min 6 character ) \n\t\t\t* Return false\n\t\t\t**/\n\t\t\treturn false;\n\t\t} elseif ($data['confirmpassword'] != $data['password']) {\n\t\t\t/** \n\t\t\t* If Password does not match with confirmpassword \n\t\t\t* Return false\n\t\t\t**/\n\t\t\treturn false;\n\t\t} else {\n\t\t\t/** \n\t\t\t* Everything looks good \n\t\t\t* Return True\n\t\t\t**/\n\t\t\treturn true;\n\t\t}\n\t}", "public function change_password($data, $user_id) {\r\n\r\n // Start Backend Validation\r\n if (empty($data['old-pwd'])) {\r\n $this->errors['old-pwd'] = 'رجاء لا تترك هذا الحقل فارغا';\r\n }\r\n\r\n if (empty($data['new-pwd'])) {\r\n $this->errors['new-pwd'] = 'رجاء لا تترك هذا الحقل فارغا';\r\n } elseif (strlen($data['new-pwd']) < 8) {\r\n $this->errors['new-pwd'] = 'يجب على كلمة السر أن تتكون من 8 أحرف فأكثر';\r\n }\r\n\r\n if ($data['confirm-pwd'] != $data['new-pwd']) {\r\n $this->errors['confirm-pwd'] = 'كلمتا السر غير متطابقتان';\r\n }\r\n\r\n if (empty($this->errors)) {\r\n // Sanitize Data\r\n $old_pwd = sha1(filter_var($data['old-pwd'], FILTER_SANITIZE_STRING));\r\n $new_pwd = sha1(filter_var($data['new-pwd'], FILTER_SANITIZE_STRING));\r\n\r\n $user = $this->select('users', 'id', $user_id)->fetch_assoc();\r\n\r\n if ($user['password'] === $old_pwd) { // If Passwords Are Mached\r\n $connection = DB::connect();\r\n\r\n // Update The Password\r\n $stmt = \"UPDATE users SET password = '$new_pwd' WHERE id = '$user_id'\";\r\n $result = $connection->query($stmt);\r\n\r\n // Redirect To Profile Page\r\n $profile_url = DB::MAIN_URL . 'profile.php';\r\n header('location: ' . $profile_url);\r\n\r\n } else {\r\n $this->errors['old-pwd'] = 'كلمة السر غير صحيحة';\r\n }\r\n\r\n }\r\n\r\n }", "public function changesPassword($data = array())\n\t{\n\t\tif(!empty($data))\n\t\t{\n\t\t\tif($data['new_password']=='' || strlen($data['new_password'])<6)\n\t\t\t{\n\t\t\t\treturn array(false,Yii::app()->params->msg['_PASSWORD_LENGTH_ERROR_'],68);\n\t\t\t}\n\t\t\tif($data['new_password']!=$data['c_password'])\n\t\t\t{\n\t\t\t\treturn array(false,Yii::app()->params->msg['_BOTH_PASSWORD_NOT_METCH_'],70);\n\t\t\t}\n\t\t\tif($data['old_password']==$data['new_password'])\n\t\t\t{\n\t\t\t\treturn array(false,Yii::app()->params->msg['_OLD_NEW_PASSWORD_SAME_'],114);\n\t\t\t}\n\t\t\t\n\t\t\tif(!is_numeric($data['user_id'])){\n\t\t\t\t$algoencryptionObj\t=\tnew Algoencryption();\n\t\t\t\t$data['user_id']\t=\t$algoencryptionObj->decrypt($data['user_id']);\n\t\t\t}\n\t\t\t$userData = $this->getUserById($data['user_id'],'userId,password');\n\t\t\t$generalObj = new General();\n\t\t\t$res = $generalObj->validate_password($data['old_password'],$userData['password']);\n\t\t\t\t\t\n\t\t\tif($res==true)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$user_data[\"password\"] = $generalObj->encrypt_password($data['new_password']);\t\n\t\t\t\t$this->setData(array('password'=>$user_data['password']));\n\t\t\t\t$this->insertData($data['user_id']);\n\t\t\t\t\n\t\t\t\treturn array(true,Yii::app()->params->msg['_PASSWORD_CHANGE_SUCCESS_'],0);\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array(false,Yii::app()->params->msg['_OLD_PASSWORD_NOT_METCH_'],69);\n\t\t\t}\n\t\t}\n\t}", "public function change()\r\n {\r\n// var_dump($this->validate());die;\r\n if ($this->validate()) {\r\n $user = $this->_user; \r\n $user->setPassword($this->newPwd);\r\n $user->removePasswordResetToken();\r\n return $user->save(false);\r\n }\r\n \r\n return false;\r\n }", "public function passwordChangeValidator() {\n //echo \"%%%%\"; exit;\n return Validator::make($this->request->all(), [\n 'old_password' => 'required||string',\n 'new_password' => 'required||string',\n 'confirm_password' => 'required|string',\n ]);\n }", "public function validation($data)\n {\n \t$this->load->library('encrypt');\n\t\t$user = $this->db->select('email, password, status_register')->where('email', $data['email'])->get('ec_client')->result_array();\n if (count($user) > 0) {\n\t\t\t\t$password_decode = $this->encrypt->decode($user[0]['password']);\n\t\t\t\t\tif ($password_decode == $data['password']) {\n\t\t\t\t\t\tif ($user[0]['status_register'] == 0) {\n return 2;\n }\n return 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 0; # Usuario o clave de acceso incorrectos\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn 0; # Usuario o clave de acceso incorrectos\n\t\t\t}\n }", "public function validatePassword(User $user, $password);", "public function changepassword() {\n // Fetch the request data in JSON format and convert it into object\n $request_data = $this->request->input('json_decode');\n switch (true) {\n // When request is not made using POST method\n case!$this->request->isPost() :\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Wrong request method.';\n break;\n // Request is valid and phone no and name are present\n case!empty($request_data) && !empty($request_data->phone_no) && !empty($request_data->user_token) && !empty($request_data->old_password) && !empty($request_data->new_password) && !empty($request_data->confirm_password):\n\n // Check if phone no exists\n $data = $this->User->findUser($request_data->phone_no);\n\n // Check if record exists\n if (count($data) != 0) {\n // Check uuid entered is valid\n if ($data[0]['User']['verified'] === false) {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'User not verified';\n } elseif ($request_data->user_token != $data[0]['User']['user_token']) { // User Token is not valid\n $success = false;\n $status = UNAUTHORISED;\n $message = 'User Token is invalid';\n } elseif (md5($request_data->old_password) != $data[0]['User']['password']) { // User password is matching or not.\n $success = false;\n $status = UNAUTHORISED;\n $message = 'Password did not match';\n } elseif (trim($request_data->new_password) == trim($request_data->old_password)) { // New password is not equal to old password.\n $success = false;\n $status = UNAUTHORISED;\n $message = 'New Password is not equal to old password.';\n } elseif (trim($request_data->new_password) != trim($request_data->confirm_password)) { // New password is not equal to confirm password.\n $success = false;\n $status = UNAUTHORISED;\n $message = 'New Password is not equal to confirm password.';\n } else {\n\n $dataArray = array();\n $dataArray['User']['_id'] = $data[0]['User']['_id'];\n $dataArray['User']['password'] = md5(trim($request_data->new_password));\n\n if ($this->User->save($dataArray)) {\n $success = true;\n $status = SUCCESS;\n $message = 'Settings has been changed.';\n } else {\n $success = false;\n $status = ERROR;\n $message = 'There was a problem in processing your request';\n }\n }\n }\n // Return false if record not found\n else {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'Phone no. not registered.';\n }\n break;\n // User Token blank in request\n case!empty($request_data) && empty($request_data->user_token):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'User Token cannot be blank.';\n break;\n // Phone no. blank in request\n case!empty($request_data) && empty($request_data->phone_no):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Phone no. cannot be blank.';\n break;\n // Old Password blank in request\n case!empty($request_data) && empty($request_data->old_password):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Old password cannot be blank.';\n break;\n // New Password blank in request\n case!empty($request_data) && empty($request_data->new_password):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'New password cannot be blank.';\n break;\n // Confirm Password blank in request\n case!empty($request_data) && empty($request_data->confirm_password):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Confirm password cannot be blank.';\n break;\n // Parameters not found in request\n case empty($request_data):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Request cannot be empty.';\n break;\n }\n\n $out = array(\n \"success\" => $success,\n \"message\" => $message\n );\n\n return new CakeResponse(array('status' => $status, 'body' => json_encode($out), 'type' => 'json'));\n }", "public function validatePasswords()\n {\n $passwd = $this->_sanitized_data['password'];\n $passwd2 = $this->_sanitized_data['password2'];\n\n if ($passwd == '' || $passwd2 == '') {\n $this->_addErrorMessage(\"Missing passwords\");\n return false;\n }\n\n if ($passwd !== $passwd2) {\n $this->_addErrorMessage(\"The submitted passwords do not match\");\n return false;\n }\n\n if (strlen($passwd) < 5 && strlen($passwd2) < 5) {\n $this->_addErrorMessage(\"The submitted password must be at least 5 characters long\");\n return false;\n }\n\n return true;\n }", "public function processPassword($data)\n {\n try\n {\n # Bring the alert-title variable into scope.\n global $alert_title;\n # Bring the login variable into scope. Use this User Object instance for user info not submitted in the form.\n global $login;\n # Set the Document instance to a variable.\n $doc=Document::getInstance();\n # Get the PasswordFormPopulator Class.\n require_once Utility::locateFile(MODULES.'Form'.DS.'PasswordFormPopulator.php');\n\n # Reset the form if the \"reset\" button was submitted.\n $this->processReset('send', 'password');\n\n # Instantiate a new instance of PasswordFormPopulator.\n $populator=new PasswordFormPopulator();\n # Populate the form and set the Password data members for this post.\n $populator->populatePasswordForm($data);\n # Set the Populator object to the data member.\n $this->setPopulator($populator);\n\n # Get the User object from the PasswordFormPopulator object and set it to a variable for use in this method.\n $user_obj=$populator->getUserObject();\n\n # Set the User's email to a variable.\n $email=$login->getEmail();\n # Set the email password value to a variable.\n $email_password=$populator->getEmailPassword();\n # Set the User's ID to a variable.\n $id=$login->getID();\n # Set the new password to a variable.\n $password=$user_obj->getPassword();\n # Set the password confirmation to a variable.\n $password_confirmed=$populator->getPasswordConfirmed();\n\n # Check if the form has been submitted.\n if(array_key_exists('_submit_check', $_POST) && (isset($_POST['send']) && ($_POST['send']=='Change Password')))\n {\n # Create a session that holds all the POST data (it will be destroyed if it is not needed.)\n $this->setSession();\n\n # Instantiate FormValidator object\n $fv=new FormValidator();\n\n # Validate if the display name is empty.\n $empty_password=$fv->validateEmpty('password', 'Please enter a password that is at least 6 characters long and contain at least one number as well as letters. It is good practice to use a mix of CAPITAL and lowercase letters with at least 1 number and/or special characters (ie. !,@,#,$,%,^,&, etc.). For assistance creating a password you may go to: <a href=\"http://strongpasswordgenerator.com/\" target=\"_blank\">StrongPasswordGenerator.com</a>', 6, 64);\n # Check if the password name was not empty.\n if($empty_password===FALSE)\n {\n $acceptable_password=$fv->validateAlphanum('password', 'Your new password must be at least 6 characters long and contain at least one number as well as letters. It is good practice to use a mix of CAPITAL and lowercase letters with at least 1 number and/or special characters (ie. !,@,#,$,%,^,&, etc.). For assistance creating a password you may go to: <a href=\"http://strongpasswordgenerator.com/\" target=\"_blank\">StrongPasswordGenerator.com</a>');\n }\n\n # Validate if the password confirmation is empty.\n $empty_password_conf=$fv->validateEmpty('password_confirmed', 'Please confirm your new password.', 6, 64);\n\n # Validate that the password and password confirmation matches.\n if(($empty_password===FALSE)&&($empty_password_conf===FALSE))\n {\n if($password!=$password_confirmed)\n {\n $fv->setErrors('The passwords you entered did not match. Please try again.');\n }\n }\n\n # Check for errors to display so that the script won't go further.\n if($fv->checkErrors()===TRUE)\n {\n # Create a variable to the error heading.\n $alert_title='Resubmit the form after correcting the following errors:';\n # Concatenate the errors to the heading.\n $error=$fv->displayErrors();\n # Set the error message to the Document object datamember so that it me be displayed on the page.\n $doc->setError($error);\n }\n else\n {\n # Update the User's password.\n $login->updatePassword($id, $password);\n\n $session_message='You password has been updated.';\n $_SESSION['message']=$session_message;\n\n # Check if the USer wanted the password emailed to them.\n if($email_password=='checked')\n {\n $user_obj->sendAccountInfo($email, TRUE);\n }\n $doc->redirect(REDIRECT_AFTER_LOGIN);\n }\n }\n return NULL;\n }\n catch(Exception $e)\n {\n throw $e;\n }\n }", "public function validate_password()\n\t{\n\t\t//Load language from user component\n\t\t$lang = JFactory::getLanguage();\n\t\t$tag = $lang->getTag();\n\n\t\tif (!$tag)\n\t\t{\n\t\t\t$tag = 'en-GB';\n\t\t}\n\n\t\t$lang->load('com_users', JPATH_ROOT, $tag);\n\t\t$value = $this->input->get('fieldValue', '', 'none');\n\t\t$validateId = $this->input->get('fieldId', '', 'none');\n\t\t$params = JComponentHelper::getParams('com_users');\n\t\t$minimumIntegers = $params->get('minimum_integers');\n\t\t$minimumSymbols = $params->get('minimum_symbols');\n\t\t$minimumUppercase = $params->get('minimum_uppercase');\n\t\t$validPassword = true;\n\t\t$errorMessage = '';\n\n\t\tif (!empty($minimumIntegers))\n\t\t{\n\t\t\t$nInts = preg_match_all('/[0-9]/', $value, $imatch);\n\n\t\t\tif ($nInts < $minimumIntegers)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N', $minimumIntegers);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($validPassword && !empty($minimumSymbols))\n\t\t{\n\t\t\t$nsymbols = preg_match_all('[\\W]', $value, $smatch);\n\n\t\t\tif ($nsymbols < $minimumSymbols)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N', $minimumSymbols);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\n\t\tif ($validPassword && !empty($minimumUppercase))\n\t\t{\n\t\t\t$nUppercase = preg_match_all(\"/[A-Z]/\", $value, $umatch);\n\n\t\t\tif ($nUppercase < $minimumUppercase)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N', $minimumUppercase);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\t$arrayToJs = array();\n\t\t$arrayToJs[0] = $validateId;\n\n\t\tif (!$validPassword)\n\t\t{\n\t\t\t$arrayToJs[1] = false;\n\t\t\t$arrayToJs[2] = $errorMessage;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrayToJs[1] = true;\n\t\t}\n\n\t\techo json_encode($arrayToJs);\n\n\t\t$this->app->close();\n\t}", "public function testUpdatePasswordNotGiven(): void { }", "public static function password($data=''){\n\t\t\treturn true;\n\t\t}", "public function changePassword() {\n if ($this->passwordChangeValidator()->fails()) {\n $errors[\"status\"] = false;\n $errors[\"message\"] = $this->passwordChangeValidator()->errors()->all();\n return $errors;\n }\n //$responseMessage = array();\n $userId = $this->request->session()->get('user_id');\n $where = [[\"users.user_id\", \"=\", $userId]];\n $this->usersModel->setWhere($where);\n $user = $this->usersModel->getUsers();\n\n if ($user == null) {\n return false;\n }\n\n $oldPassword = $this->request->input(\"old_password\");\n $oldHashedPassword = $user[0]->password;\n $status = Hash::check($oldPassword, $oldHashedPassword);\n if ($status) {\n //change to new password\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $userId]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n } else {\n $errors[\"status\"] = false;\n $errors[\"message\"] = [\"Invalid Password\"];\n return $errors;\n }\n return true;\n }", "public function passwordValidation($data)\n {\n $rules = array(\n 'password' => 'required | min:6 | max:20 | same:confirm',\n 'confirm' => 'required | same:password'\n );\n\n $messages = array(\n 'password.required' => 'the :attribute is required.',\n 'password.min' => 'the :attribute must between 6 and 20 characters.',\n 'password.max' => 'the :attribute must between 6 and 20 characters.',\n 'password.same' => 'the fields :attribute and confirm password must be the same.',\n 'confirm.required' => 'the :attribute is required.',\n 'confirm.same' => 'the fields password and confirm password must be the same.'\n );\n $validator = Validator::make($data, $rules, $messages);\n return $validator;\n }", "public function changePassword(){\n require_once \"./application/models/input_manager.php\";\n\n //Genero un array che conterà gli eventuali errori\n $errors = array();\n\n //Verifico il metodo di richiesta\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n //Verifico che tutti i campi siano stati compilati e che non siano vuoti\n if(isset($_POST['password']) && !empty($_POST['password']) &&\n isset($_POST['repassword']) && !empty($_POST['repassword']) &&\n isset($_POST['email']) && !empty($_POST['email'])){\n\n //Creo un nuovo input manager e testo i campi inseriti\n $im = new input_manager();\n\n $email = filter_var($im->checkInput($_POST['email']), FILTER_SANITIZE_EMAIL);\n $password = filter_var($im->checkInput($_POST['password']), FILTER_SANITIZE_STRING);\n $repassword = filter_var($im->checkInput($_POST['repassword']), FILTER_SANITIZE_STRING);\n\n //Verifico che la lunghezza dei campi corrisponda con quella consentita e che non contengano valori non validi\n if(!(strlen($email) > 0 && strlen($email) <= 50) || !filter_var($email, FILTER_VALIDATE_EMAIL)){\n array_push($errors, \"L'email deve essere formattata nel seguente modo: indirizzo@dominio.xx\");\n }\n if(!(strlen($password) >= 8) || !preg_match('/^[\\p{L}a-zA-Z\\d._\\-*%&!?$@+#+,;:]+$/', $password)){\n array_push($errors, \"La password deve essere almeno lunga 8 caratteri\");\n }\n\n //Se sono di lunghezze sbagliate o contengono caratteri illegali ritorno l'errore\n if(count($errors) != 0){\n $_SESSION['errors'] = $errors;\n header('Location: ' . URL . 'firstLogin');\n exit();\n }\n\n //Verifico che la password sia di almeno 8 caratteri\n if(!(strlen($password) >= 8)){\n //Genero l'errore\n array_push($errors, \"La password deve essere almeno lunga 8 caratteri\");\n $_SESSION['errors'] = $errors;\n\n //Riporto l'utente alla pagina per mostrargli l'errore\n header('Location: ' . URL . 'firstLogin');\n exit();\n }\n\n //Verifico che le due password siano uguali\n if($password == $repassword){\n //Imposto la nuova password nel database\n (new utente_model)->setPassword($email, $password);\n (new utente_model)->setFirstLogin($email);\n\n //Indirizzo l'utente alla pagina di login\n header('Location: ' . URL . 'login');\n exit();\n }else{\n //Se sono diverse genero l'errore\n array_push($errors, \"Le password devono essere uguali\");\n $_SESSION['errors'] = $errors;\n\n //Riporto l'utente alla pagina per mostrargli l'errore\n header('Location: ' . URL . 'firstLogin');\n exit();\n }\n }else{\n //Se non vengono inseriti tutti i dati genero l'errore\n array_push($errors, \"Inserire la nuova password\");\n $_SESSION['errors'] = $errors;\n\n //Riporto l'utente alla pagina per mostrargli l'errore\n header('Location: ' . URL . 'firstLogin');\n exit();\n }\n }\n }", "public static function password() {\n if ( !isset($_POST['email']) ) {\n return;\n }\n \n $password = substr(Helper::hash(rand(0,16^32).$_POST['email']),0,12);\n \n $result = Database::checkUser($_POST['email']);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Unbekannter Benutzer!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n return;\n }\n \n $id = $result[0]['id'];\n $passwordold = $result[0]['password'];\n \n $pw = Helper::hash($password.$_POST['email']);\n \n $success = Database::setPassword($id,$passwordold,$pw);\n if ( $success !== false ) {\n self::passwordMail($_POST['email'],$password);\n self::setError('Ein neues Passwort wurde dir zugeschickt!<br>');\n } else {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n }\n }", "function validate_password($new_password, $new_password_again, $db, $uid, $mode, $old_password=\"\")\n{\n\tif($mode==\"register\")\n\t{\n\t\t//Compare the new_password and new_password_again\n\t\tif($new_password!=$new_password_again)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t//if the user is logging in\n\telse if($mode==\"login\")\n\t{\n\t\t\n\t\t//Get the hashed password and salt stored in the database for that user id\n\t\ttry{\n\t\t\t$query=\"SELECT `password`, `salt` FROM `users` WHERE `id`=:uid\";\n\t\t\t$query_params=array(\":uid\"=>$uid);\n\t\t\t$stmt=$db->prepare($query);\n\t\t\t$result=$stmt->execute($query_params);\n\t\t}\n\t\tcatch(PDOException $ex)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$row=$stmt->fetch();\n\n\t\t//Hash the old_password concat with the salt\n\t\t$old_password = hash('sha256', $old_password . $row[\"salt\"]);\n\t\t//Compare the hashed old_password and the hashed password in the database\n\t\tif($old_password!=$row[\"password\"])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t//return true\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "function admin_change_password() {\r\n\r\n $this->layout = 'default';\r\n\r\n $this->checklogin();\r\n\r\n// echo ' e10adc39491e240';\r\n// echo \"<br>\".$new = $this->encrypt_data(123456);\r\n// echo \"<br>old \".$old = $this->decrypt_data($new);\r\n\r\n if(!empty($this->data))\r\n {\r\n //$this->pre($this->data);\r\n //exit;\r\n\r\n $errorarray = array();\r\n\r\n if (isset($this->data['User']['oldpwd']) && (trim($this->data['User']['oldpwd']) == '' || trim($this->data['User']['oldpwd']=='Password'))) {\r\n $errorarray['enter_oldpwd'] = ENTER_OLD_PASSWORD;\r\n }\r\n else\r\n {\r\n $check_len_pass = strlen(trim($this->data['User']['oldpwd']));\r\n\r\n if($check_len_pass<5)\r\n $errorarray['oldpwd_minlen'] = PASSWORD_LENGTH;\r\n else\r\n {\r\n $check_user = $this->User->find('first', array('conditions' => array('status' => 0, 'password'=>md5($this->data['User']['oldpwd']) ,'id'=>$this->Session->read(md5(SITE_TITLE).'USERID'))));\r\n\r\n// $this->pre($check_user);\r\n// exit;\r\n if(empty($check_user))\r\n {\r\n $errorarray['pass_not_match'] = OLDNOTMATCH;\r\n }\r\n }\r\n }\r\n\r\n if (isset($this->data['User']['newpwd']) && (trim($this->data['User']['newpwd']) == '' || trim($this->data['User']['newpwd']=='Password'))) {\r\n $errorarray['newpass'] = ENTER_NEW_PASSWORD;\r\n }\r\n else\r\n {\r\n $check_len_pass = strlen(trim($this->data['User']['newpwd']));\r\n\r\n if($check_len_pass<5)\r\n $errorarray['newpass_minlen'] = NEW_PASSWORD_LENGTH;\r\n }\r\n if (isset($this->data['User']['confirmpwd']) && (trim($this->data['User']['confirmpwd']) == '' || trim($this->data['User']['confirmpwd']) == 'Password')) {\r\n $errorarray['confpass'] = ENTER_CONFPASS;\r\n }\r\n else\r\n {\r\n $check_len_confpass = strlen(trim($this->data['User']['confirmpwd']));\r\n\r\n if($check_len_confpass<5)\r\n $errorarray['confpass_minlen'] = CONF_PASSWORD_LENGTH;\r\n }\r\n\r\n if (trim($this->data['User']['newpwd']) != '' && trim($this->data['User']['confirmpwd']) != '' && strlen(trim($this->data['User']['newpwd']))>=5 && strlen(trim($this->data['User']['confirmpwd']))>=5 && trim($this->data['User']['newpwd']) != trim($this->data['User']['confirmpwd'])) {\r\n $errorarray['conflict'] = NEWCONFPASS;\r\n }\r\n\r\n\r\n $this->set('errorarray',$errorarray);\r\n\r\n if(empty($errorarray))\r\n {\r\n// $this->pre($errorarray);\r\n// exit;\r\n\r\n $update_user_dtl['User']['id'] = $this->Session->read(md5(SITE_TITLE).'USERID');\r\n $update_user_dtl['User']['password'] = md5($this->data['User']['newpwd']);\r\n $update_user_dtl['User']['encrypt_password'] = $this->encrypt_pass($this->data['User']['newpwd']);\r\n\r\n //$this->pre($this->Session->read());\r\n\r\n $name = $this->Session->read(md5(SITE_TITLE).'USERNAME');\r\n $email = $this->Session->read(md5(SITE_TITLE).'USEREMAIL');\r\n $new_pass = $this->data['User']['newpwd'];\r\n\r\n //$this->email_client_changepassword($name,$email,$new_pass);\r\n// $this->pre($update_user_dtl);\r\n// exit;\r\n\r\n $this->User->save($update_user_dtl);\r\n $this->redirect(DEFAULT_ADMINURL . 'users/change_password/succhange');\r\n }\r\n// $this->pre($errorarray);\r\n// exit;\r\n }\r\n }", "public function passwordValide () {\n $password = $this->donnees[self::PASSWORD_REF];\n // Le champ password ne doit pas ?tre vide\n if ($password == null) {\n $this->erreur[self::PASSWORD_REF] = \"Veuillez remplir le champ password\";\n return false;\n }\n // Si le password entr? correspond au password contenu dans la base de donn?es on retourne true\n if ($this->utilisateurs->identificationUser($this->donnees[self::LOGIN_REF], $this->donnees[self::PASSWORD_REF])) {\n return true;\n // Sinon on cr?e une erreur et on renvoie false\n } else {\n $this->erreur[self::PASSWORD_REF] .= \"Mot de passe erron?\";\n return false;\n }\n }", "protected function afterValidate()\n {\n \tparent::afterValidate();\n \tif(!$this->hasErrors())\n \t\t$this->password = $this->hashPassword($this->password);\n }", "static public function tryToSetNewPassword() {\r\n\t\tif (!isset($_POST['chpw_hash']) || !isset($_POST['new_pw']) || !isset($_POST['new_pw_again']) || !isset($_POST['chpw_username']))\r\n\t\t\treturn;\r\n\r\n\t\tif ($_POST['chpw_username'] == self::getUsernameForChangePasswordHash()) {\r\n\t\t\tif ($_POST['new_pw'] != $_POST['new_pw_again'])\r\n\t\t\t\treturn array( __('The passwords have to be the same.') );\r\n\t\t\telseif (strlen($_POST['new_pw']) < self::$PASS_MIN_LENGTH)\r\n\t\t\t\treturn array( sprintf( __('The password has to contain at least %s signs.'), self::$PASS_MIN_LENGTH) );\r\n\t\t\telse {\r\n\t\t\t\tself::updateAccount($_POST['chpw_username'],\r\n\t\t\t\t\tarray('password', 'changepw_hash', 'changepw_timelimit'),\r\n\t\t\t\t\tarray(self::passwordToHash($_POST['new_pw']), '', 0));\r\n\t\t\t\theader('Location: login.php');\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\treturn array( __('Something went wrong.') );\r\n\t}", "public function change_password()\n {\n $this->form_validation->set_rules('password2', 'Password', 'required|trim|min_length[3]|matches[password3]', ['min_length' => MY_USERPASSWORDTOOSHORT, 'matches' => MY_USERPASSNOTMATCHED]);\n $this->form_validation->set_rules('password3', 'Password', 'required|trim|matches[password2]');\n\n if ($this->form_validation->run() == true) {\n $password = $this->input->post('password');\n $user = $this->user_model->get_profile($_SESSION['uid']);\n if (password_verify($password, $user['password'])) {\n $data = [];\n $data['uid'] = $_SESSION['uid'];\n $data['password'] = $this->input->post('password2');\n $this->user_model->user_change_password($data);\n $this->session->set_flashdata('message', genAlert(MY_USERPASSWORDCHANGED));\n } else {\n $this->session->set_flashdata('message', genAlert(MY_USERPASSNOTMATCHED, 'danger'));\n }\n }\n $breadcrumb_items = [\n 'Dashboard' => 'dashboard',\n 'Profile' => 'profile'\n ];\n $this->breadcrumb->add_item($breadcrumb_items);\n $data['breadcrumb'] = $this->breadcrumb->generate();\n $data['namaview'] = 'profile/change_password';\n $data['pagetitle'] = 'Ganti Password';\n\n $this->load->view('templates/dashboard.php', $data);\n }", "private function valid_password() {\n return (strlen($this->password) == 6);\n }", "public function password_validation()\n {\n $this->form_validation->set_rules('curtpassword', 'Current Password', 'callback_passwordcheck');\n $this->form_validation->set_rules('newpassword', 'New Password', 'required');\n $this->form_validation->set_rules('cpassword', 'Confirm Password', 'required|matches[newpassword]');\n if ($this->form_validation->run() == false) {\n $error = validation_errors();\n $this->session->set_flashdata('formerror', $error);\n redirect('vendor/change-password');\n } else {\n\t\t\t$password = $this->input->post('newpassword');\n\t\t\t$hash = $this->bcrypt->hash_password($password);\n\t\t\t\n if ($this->m_vendorDetail->changepass($this->id, $hash)) {\n $this->session->set_flashdata('success', 'Password updated Successfully');\n redirect('vendor/change-password');\n } else {\n $this->session->set_flashdata('error', 'unable to update your password, New password is matching with the current password!');\n redirect('vendor/change-password');\n }\n }\n\t}", "function resetUserPassword($argArrPOST) {\n //print_r($argArrPOST);\n $objValid = new Validate_fields;\n $objCore = new Core();\n $objValid->check_4html = true;\n\n $objValid->add_text_field('Current Password', $argArrPOST['frmUserOldPassword'], 'text', 'y', 20);\n $objValid->add_text_field('New Password', strip_tags($argArrPOST['frmUserNewPassword']), 'text', 'y', 20);\n $objValid->add_text_field('Confirm New password', strip_tags($argArrPOST['frmUserConfirmPassword']), 'text', 'y', 20);\n\n if ($objValid->validation()) {\n $varErrorMsgFirst = 'Please enter required fields!';\n } else {\n $varErrorMsg = $objValid->create_msg();\n }\n\n if ($varErrorMsg) {\n $objCore->setErrorMsg($varErrorMsg);\n return false;\n }\n\n $arrUserFlds = array('UserPassword');\n $varUserWhere = ' 1 AND pkUserID = \\'' . $argArrPOST['frmHiddenUserID'] . '\\'';\n $arrUserList = $this->select(TABLE_USERS, $arrUserFlds, $varUserWhere);\n\n if ($arrUserList[0]['UserPassword'] == md5(trim($argArrPOST['frmUserOldPassword']))) {\n $varUsersWhere = ' pkUserID =' . $argArrPOST['frmHiddenUserID'];\n $arrColumnAdd = array(\n 'UserPassword' => md5(trim($argArrPOST['frmUserNewPassword'])),\n 'UserDateUpdated' => 'now()'\n );\n\n $varUserID = $this->update(TABLE_USERS, $arrColumnAdd, $varUsersWhere);\n\n $objCore->setSuccessMsg(FRONT_END_PASSWORD_SUCC_CHANGE);\n return true;\n } else {\n $objCore->setErrorMsg(FRONT_END_INVALID_CURENT_PASSWORD);\n return false;\n }\n }", "public function can_change_password() {\n return false;\n }", "public function changePass($data = NULL){\r\n $username = Zend_Auth::getInstance()->getIdentity()->username;\r\n\t\t\r\n\t\tif($this->checkPassold($username, trim($data['passold']))){\r\n\t\t\t//Update password\r\n\t \t$bind = array('password' => md5(trim($data['passnew'])));\r\n\t \t$this->update($bind, \"username='\".$username.\"'\");\r\n \t\r\n\t\t\treturn TRUE;\r\n\t\t}else{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t}", "private function __changePassword() {\n\t\t$data = $this->request->data['User'];\n\t\t$this->User->id = $this->Auth->user('id');\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$this->Session->setFlash(__('Your password changed successfully.'), 'success');\n\t\t\t$this->redirect($this->referer());\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change your password due to a server problem, try again later.'), 'error');\n\t\t}\n\t}", "function ll_psw_error_hook( $errors, $update, $user ) { \n\t\tglobal $ll_psw_check_failed;\n\n\t\tif ( '' != $ll_psw_check_failed ) { \n\t\t $errors->add( 'pass', __( '<strong>ERROR:</strong> ' . $ll_psw_check_failed ) );\n\t\t}\n\n\t\tif ( count( $errors->errors ) <= 0 && !empty( $user->ID ) ) { \n\t\t $this->save_psw_hash( $user );\n\t\t delete_user_meta( $user->ID, 'll_force_password_change_now');\n\t\t}\n\n\t}", "function validatePassword($cur, $new1, $new2)\n {\n\t\t//Get user's current hashed password and compare to their entered one here\n\t\tif (getUserElement('password') != md5($cur)) return \"Your current password was incorrect.\\\\n\";\n\t\t//Check if the two new passwords match each other\n\t\tif ($new1 != $new2) return \"Your new password and the confirmation do not match.\\\\n\";\n\t\treturn \"\";\n }", "public function testUpdatePasswordsDontMatch(): void { }", "private function user_reset_password(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\n\t\t\tif(!isset($_POST['password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['confirm_password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter confirm_password are require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\n\t\t\t$user_id = $this->_request['table_doctor_id'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$cpassword = $this->_request['confirm_password'];\n\n\t\t\tif(!empty($password) && !empty($cpassword) ) {\n\n\t\t\t\tif($password!=$cpassword) {\n\t\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Password and Confirm password is not matched\");\n\t\t\t\t\t$this->response($this->json($error), 200);\n\n\t\t\t\t} else{\n\t\t\t\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t$sql = \"UPDATE table_user SET user_password='\".$hashed_password.\"' WHERE user_id='\".$user_id.\"' \";\n\t\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t\t$update = $stmt->execute();\n\t\t\t\t\t\t$fetchData = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\t\t\t\tif(count($update)==1){\n\t\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Profile Updated\");\n\t\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function Change_user_password() {\n\t\t$this->load->helper('pass');\n\t\t$user = $this->administration->getMyUser($this->user_id);\n\t\t//password\n\t\t$old_pass = $this->input->post('oldPassword');\n\t\t$newPass = $this->input->post('newPassword');\n\t\t$confirmNewPass = $this->input->post('confirmNewPassword');\n\t\tif($newPass == $confirmNewPass) {\n\t\t\t//check if old password is corrent\n\t\t\t$verify = $this->members->validateUser($user->Username,$old_pass);\n\t\t\tif($verify) {\n\t\t\t\t//validate if the password is in the correct format\n\t\t\t\t$valid_new_pass = checkPasswordCharacters($newPass);\n\t\t\t\tif($valid_new_pass) {\n\t\t\t\t\t$change_pass = $this->members->simple_pass_change($user->ID,$newPass);\n\t\t\t\t\tif($change_pass) {\n\t\t\t\t\t\techo '1';\n\t\t\t\t\t}else {\n\t\t\t\t\t\techo '6';\t\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\techo '7';\t\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\techo '8';\t\n\t\t\t}\n\t\t}else {\n\t\t\techo '9';\t\n\t\t}\n\t}", "function can_change_password() {\n return false;\n }", "public function validatePassword($attribute, $params)\r\n { \r\n \r\n if (!$this->hasErrors()) {\r\n $user = $this->getUser(); \r\n if (!$user || !$user->validatePassword($this->pwd)) {\r\n $this->addError($attribute, '旧密码不正确.');\r\n }\r\n }\r\n }", "function allowPasswordChange() {\r\n\t\treturn true;\r\n\t}", "function can_change_password() {\n\t\treturn false;\n\t}", "public function updatePwd(){\n if(\n !empty($_POST['pwd1']) &&\n !empty($_POST['pwd2']) &&\n $_POST['pwd1'] == $_POST['pwd2']){\n $pwd = $_POST['pwd1'];\n $id = $_SESSION['userID'];\n $user = new User();\n $user->updatePwd($pwd, $id);\n }\n else {\n echo \"false\";\n }\n }", "function validPassword($password){\t\r\n \tglobal $API;\r\n return $API->userValidatePassword($this->username,$password); \r\n }", "function ciniki_users_changePassword($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'oldpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Old Password'), \n 'newpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'New Password'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n if( strlen($args['newpassword']) < 8 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.20', 'msg'=>'New password must be longer than 8 characters.'));\n }\n\n //\n // Check access \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'checkAccess');\n $rc = ciniki_users_checkAccess($ciniki, 0, 'ciniki.users.changePassword', 0);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check old password\n //\n $strsql = \"SELECT id, email FROM ciniki_users \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.users', 'user');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Perform an extra check to make sure only 1 row was found, other return error\n //\n if( $rc['num_rows'] != 1 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.21', 'msg'=>'Invalid old password'));\n }\n\n //\n // Turn off autocommit\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the password, but only if the old one matches\n //\n $strsql = \"UPDATE ciniki_users SET password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['newpassword']) . \"'), \"\n . \"last_updated = UTC_TIMESTAMP(), \"\n . \"last_pwd_change = UTC_TIMESTAMP() \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.22', 'msg'=>'Unable to update password.'));\n }\n\n if( $rc['num_affected_rows'] < 1 ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.23', 'msg'=>'Unable to change password.'));\n }\n\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.24', 'msg'=>'Unable to update password.'));\n }\n\n return array('stat'=>'ok');\n}", "function password_check($old_password)\n\t\t{\n\t\t\tif ($this->ion_auth->hash_password_db($this->data['user']->id, $old_password))\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('password_check', 'Sorry, the password did not match');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}", "function wp_validate_application_password($input_user)\n {\n }", "public function comparePassword() {\r\n if ($this->data[$this->name]['Password'] !== $this->data[$this->name]['RetypePass']) {\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "function c4d_migrate_admin_overview_form_validate($form, &$form_state) {\n if (empty($form_state['values'][C4D_MIGRATE_DB_PASS])\n && $form_state['values'][C4D_MIGRATE_DB_PASS] !== variable_get(C4D_MIGRATE_DB_PASS, NULL)\n && !$form_state['values']['c4d_migrate_pw_reset']\n ) {\n $form_state['values'][C4D_MIGRATE_DB_PASS] = variable_get(C4D_MIGRATE_DB_PASS, NULL);\n }\n}", "function allowPasswordChange()\n\t{\n\t\tglobal $ilUser, $ilSetting;\n\t\t\n\t\t\n\t\treturn ilAuthUtils::isPasswordModificationEnabled($ilUser->getAuthMode(true));\n\t\t\n\t\t// Moved to ilAuthUtils\n\t\t\n\t\t// do nothing if auth mode is not local database\n\t\tif ($ilUser->getAuthMode(true) != AUTH_LOCAL &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_CAS || !$ilSetting->get(\"cas_allow_local\")) &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || !$ilSetting->get(\"shib_auth_allow_local\")) &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_SOAP || !$ilSetting->get(\"soap_auth_allow_local\")) &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_OPENID)\n\t\t\t)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (!$this->userSettingVisible('password') ||\n\t\t\t$this->ilias->getSetting('usr_settings_disable_password'))\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\n\t\treturn true;\n\t}", "public function invalidPassword() {\n\t\t$this->messages[] = \"Lösenorden har för få tecken. Minst 6 tecken.\";\n\t}", "protected function _updatePassword() {\n\t\tif(!check($this->_userid)) return;\n\t\tif(!check($this->_username)) return;\n\t\tif(!check($this->_newPassword)) return;\n\t\tif($this->_md5Enabled) {\n\t\t\t$data = array(\n\t\t\t\t'userid' => $this->_userid,\n\t\t\t\t'username' => $this->_username,\n\t\t\t\t'newpassword' => $this->_newPassword\n\t\t\t);\n\t\t\t$query = \"UPDATE \"._TBL_MI_.\" SET \"._CLMN_PASSWD_.\" = [dbo].[fn_md5](:newpassword, :username) WHERE \"._CLMN_MEMBID_.\" = :userid\";\n\t\t} else {\n\t\t\t$data = array(\n\t\t\t\t'userid' => $this->_userid,\n\t\t\t\t'newpassword' => $this->_newPassword\n\t\t\t);\n\t\t\t$query = \"UPDATE \"._TBL_MI_.\" SET \"._CLMN_PASSWD_.\" = :newpassword WHERE \"._CLMN_MEMBID_.\" = :userid\";\n\t\t}\n\t\t\n\t\t$result = $this->db->query($query, $data);\n\t\tif(!$result) return;\n\t\t\n\t\treturn true;\n\t}", "function comprobar_password()\n\t{\n\t$correcto = true; //variable booleana que comprueba si el atributo cuumple o no lo especificado\n\n\t//si los atributos estan vacios\n\tif (strlen($this->password) > 3)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"password\", \"codigoincidencia\" => \"00001\" ,\"mensajeerror\" => \"password pequeño, minimo 3 caracteres\"]);\n\n\t\t$correcto = false;\t\n\t}\n\n\tif (strlen($this->password) < 3)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"login\", \"codigoincidencia\" => \"00003\" ,\"mensajeerror\" => \"Valor de atributo no numérico demasiado corto\"]);\n\n\t\t$correcto = false;\n\t}\n\n\t//si los atributos estan vacios\n\tif (strlen($this->password) > 15)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"password\", \"codigoincidencia\" => \"00002\" ,\"mensajeerror\" => \"Password demasiado larga (no puede tener más de 15 caracteres)\"]);\n\n\t\t$correcto = false;\t\n\t}\n\n\treturn $correcto;\n}", "protected function passwordValidator(array $data)\n {\n return Validator::make($data, [\n // here we check if the user email is previously pesent and verified\n // so that we can give them to re register in case if the user \n // does not verifies and delete the email or exits from the website \n // during password entry\n 'password' => 'required|min:6|confirmed',\n ]);\n }", "public function changePW()\n {\n $id = $_GET['id'];\n $passwordInDB = $this->model->getPasswordInDB($id);\n // $passwordInDB = $_SESSION['user']['password'];\n $password = $_POST['password'];\n $password_confirm = $_POST['password_confirm'];\n $verifOldPW = password_verify($_POST['old-password'], $passwordInDB['password']);\n $regexCharacterChoice = '/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*\\W)/';\n $errors = [];\n \n if ($verifOldPW === false) {\n $errors['password'] = 'Votre ancien mot de passe est incorrect';\n $this->model->setFlash('danger', 'Votre ancien mot de passe est incorrect');\n header('location:index.php?controller=adherent&action=connexionForm&id='.$id.'');\n }\n if (empty($password) || strlen($password) < 8 || !preg_match($regexCharacterChoice, $password)) {\n $errors['password'] = 'Vous devez rentrer un mot de passe valide';\n $this->model->setFlash('danger', 'Vous devez rentrer un mot de passe valide');\n header('location:index.php?controller=adherent&action=connexionForm&id='.$id.'');\n }\n if ($password != $password_confirm) {\n $errors['password'] = 'Les mots de passe ne correspondent pas';\n $this->model->setFlash('danger', 'Les mots de passe ne correspondent pas');\n header('location:index.php?controller=adherent&action=connexionForm&id='.$id.'');\n }\n if (empty($errors)) {\n $this->model->changePW();\n $this->model->setFlash('success', 'Votre mot de passe a bien été modifié');\n header('location:index.php?controller=adherent&action=connexionForm&id='.$id.'');\n }\n }", "public function testPasswordIsValid($data)\n {\n $pattern = \"/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/\";\n\n $this->assertMatchesRegularExpression($pattern,$data);\n\n }", "public function validatePassword($attribute, $params)\n\t{\n\t\tif ($this->password !== $this->repeatePassword) {\n\t\t\t$this->addError($attribute, 'Пароль не совпадает.');\n\t\t}\n\t}", "public function postChangePassword()\n\t{\n\t\tif( Request::ajax() ) {\n\t\t\t$user = User::find(Auth::user()->get()->id);\n\n\t\t\tValidator::extend('strong_password', function($attribute, $value, $parameters) {\n\t\t\t\t$r1 = '/[A-Z]/';\n\t\t\t\t$r2 = '/[a-z]/';\n\t\t\t\t$r3 = '/[!@#$%^&*()\\-_=+{};:,<.>]/';\n\t\t\t\t$r4 = '/[0-9]/';\n\n\t\t\t\tif(preg_match_all($r1,$value, $o)<1) return false;\n\n\t\t\t\tif(preg_match_all($r2,$value, $o)<1) return false;\n\n\t\t\t\tif(preg_match_all($r3,$value, $o)<1) return false;\n\n\t\t\t\tif(preg_match_all($r4,$value, $o)<1) return false;\n\n\t\t\t\tif(strlen($value)<8) return false;\n\n\t\t\t\treturn true;\n\t\t\t});\n\n\t\t\tValidator::extend('check_password', function($attribute, $value, $parameters) \n\t\t\t{\n\t\t\t\t$user = User::find(Auth::user()->get()->id);\n\t\t\t\t$old_password = Hash::check($value, $user->password);\n\t\t\t\t\n\t\t\t\tif($old_password == true) return true;\n\n\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\t$rules = array(\n\t\t\t\t'old_password' \t\t\t=> 'required|check_password',\n\t\t\t\t'password' \t\t\t\t=> 'required|strong_password|different:old_password',\n\t\t\t\t'password_confirmation' => 'required|same:password',\n\t\t\t);\n\n\t\t\t$messages = array(\n\t\t\t\t'old_password.check_password' => 'Please enter correct password',\n\t\t\t\t'password.strong_password' => 'Passwords must be at least 8 characters long and contain at least one uppercase letter, one lowercase letter, one digit and one special character.',\n\t\t\t\t'password.different'\t\t => 'new password must be different',\n\t\t\t);\n\n\t\t\t$validator = Validator::make(Input::all(), $rules, $messages);\n\n\t\t\tif($validator->passes())\n\t\t\t{\n\t\t\t\t$user->password = Hash::make(Input::get('password'));\n\t\t\t\t$user->save();\n\n\t\t\t\treturn Response::json(array('success' => true));\n\t\t\t} \n\n\t\t\t$errors = $validator->errors()->toArray();\n\t\t\treturn Response::json(array('success' => false, 'errors' => $errors));\n\t\t}\n\t}", "function testPassword()\n {\n $this->f->_isSubmitted = true;\n $this->assertEquals(\"\", $this->f->password());\n $this->assertEquals(\"V\", $this->f->password(\"L\", \"H\", \"V\"));\n $val = &$this->f->password(\"L\", \"H\", \"V\");\n $this->f->error();\n $this->assertTrue($this->f->_hasErrors);\n $this->assertEquals(\"\", $val);\n }", "public function changePasswordAction()\n {\n if ($this->request->isPost()) {\n // Request data\n $data = $this->request->getPost();\n\n $formValidator = $this->createValidator([\n 'input' => [\n 'source' => $data,\n 'definition' => [\n 'password' => new Pattern\\Password,\n 'confirmation' => new Pattern\\PasswordConfirmation($data['password'])\n ]\n ]\n ]);\n\n if ($formValidator->isValid()) {\n // Update current password\n $userService = $this->getModuleService('userService');\n $userService->updatePasswordById($this->getUserId(), $data['password']);\n\n $this->flashBag->set('success', 'Your password has been updated successfully');\n return 1;\n\n } else {\n return $formValidator->getErrors();\n }\n \n } else {\n // Just render empty form\n return $this->view->render('settings/change-password');\n }\n }", "function User_Changepass(){\r\n\t\tif( ($token = Str_filter($_POST['token'])) && ($old_password = Str_filter($_POST['old_password'])) && ($new_password = Str_filter($_POST['new_password'])) ){\r\n\t\t\tif($username = AccessToken_Getter($token)){\r\n\t\t\t\tif($user = Mongodb_Reader(\"todo_users\",array(\"username\" => $username),1)){\t\t\t\t\r\n\t\t\t\t\tif(md5($old_password) == $user['password']){\r\n\t\t\t\t\t\tMongodb_Updater(\"todo_users\",array(\"username\" => $username),array(\"password\" => md5($new_password)));\r\n\t\t\t\t\t\t$res = Return_Error(false,0,\"修改成功\",array(\"username\" => $username));\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$res = Return_Error(true,6,\"密码不正确\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$res = Return_Error(true,5,\"该用户不存在\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$res = Return_Error(true,7,\"token无效或登录超时\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$res = Return_Error(true,4,\"提交的数据为空\");\r\n\t\t}\r\n\t\techo $res;\r\n\t}", "public function testUserPassword() {\n\t\t// make new User and save it to the database\n\t\t$newPassword = Generate::hash();\n\n\t\t// change the User password\n\t\t$this->visit('/home')\n\t\t\t->click('#user-update-button')\n\t\t\t->seePageIs('/user/update')\n\t\t\t->click('Change Password')\n\t\t\t->seePageIs('/user/password')\n\t\t\t->type($this->password, 'old_password')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->type($newPassword, 'password_confirmation')\n\t\t\t->press('Change Password')\n\t\t\t->seePageIs('/home')\n\t\t\t->see('Your password was changed successfully!')\n\t\t\t->click('Logout')\n\t\t\t->seePageIs('/');\n\n\t\t// test a regular User's login with the new password\n\t\t// TODO: check the database instead of testing the login process\n\t\t$this->visit('/')\n\t\t\t->click('#login-button')\n\t\t\t->seePageIs('/login')\n\t\t\t->type($this->User->email, 'email')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->press('Login')\n\t\t\t->seePageIs('/home')\n\t\t\t->within('#nav', function() {\n\t\t\t\t$this->see('Logout')\n\t\t\t\t\t->dontSee('Login')\n\t\t\t\t\t->dontSee('Admin');\n\t\t\t});\n\t}", "protected function afterValidate()\n {\n parent::afterValidate();\n if (!$this->hasErrors()) {\n $this->password = $this->hashPassword($this->password);\n }\n }", "protected function afterValidate()\n {\n parent::afterValidate();\n if (!$this->hasErrors()) {\n $this->password = $this->hashPassword($this->password);\n }\n }", "function oldPassword() {\n\t\t$fields = $this->_settings['fields'];\n\t\tif (\n\t\t\tSecurity::hash($this->model->data[$this->model->name][$fields['old_password']], null, true) \n\t\t\t== $this->model->field($fields['password'])\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function resetPassword($data){\n try{\n if(!empty($data)){\n $sql = \"UPDATE users SET password = ? WHERE id = ?\";\n if($query = $this->db->query($sql,$data)){\n return true;\n }\n }\n }catch(Exception $e){\n echo \"Cause error \".$e->getMessege().\"<br>\";\n }\n return false;\n }", "public function changePasswordAction(){\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['password']) && isset($data['repeat_password'])){\n if($data['password'] === $data['repeat_password']){\n $user->setPassword($data['password']);\n } else {\n $this->setErrorResponse('password and repeat_password should match!');\n }\n } else {\n $this->setErrorResponse('password and repeat_password is mandatory fields!');\n }\n $this->_helper->json(array('updated' => true));\n }", "public function postChgPw(){\n\n\t\t//set the message for each Validator\n\t\t$message=array('old_password.required'=>'The old password field cannot be empty', \n\t\t\t\t\t\t'new_password.required'=>'The new password field cannot be empty',\n\t\t\t\t\t\t'new_password.between'=>'The password length is between 6-20 characters',\n\t\t\t\t\t\t'new_password.alpha_num'=>'The password can only use number(0-9) and characters(A-Z, a-z)',\n\t\t\t\t\t\t'new_password_2.same'=>'The new password field not same'\n\t\t\t\t\t\t);\n\n\t\t//set validator, password 2 must same with password 1\n\t\t$validator = Validator::make(Input::all(),\n\t\t\tarray(\n\t\t\t\t'old_password' =>'required',\n\t\t\t\t'new_password' =>'required|between:6,20|alpha_num',\n\t\t\t\t'new_password_2' =>'same:new_password'\n\t\t\t),$message\n\t\t);\n\n\t\t//if violate validator\n\t\tif ($validator->fails()){\n\n\t\t\t//return to chg pw view with old input and error\n\t\t\treturn Redirect::route('account-chg-pw')\n\t\t\t\t\t->withErrors($validator)\n\t\t\t\t\t->withInput();\n\t\t}else{\n\n\t\t\t//get the user data where id is current user id\n\t\t\t$user = User::find(Auth::user()->id);\n\n\t\t\t//get values from input\n\t\t\t$old_password = Input::get('old_password');\n\t\t\t$new_password = Input::get('new_password');\n\n\t\t\t//if old password and the password in db is match\n\t\t\tif(Hash::check($old_password, $user->getAuthPassword())){\n\n\t\t\t\t//if password provided matched\n\t\t\t\t$user->password=Hash::make($new_password);\n\n\t\t\t\tif ($user->save()){\n\n\t\t\t\t\t//return with success msg after saved to db\n\t\t\t\t\treturn Redirect::route('account-chg-pw')\n\t\t\t\t\t\t\t->with('global','<div class=\"alert alert-info\" role=\"alert\">\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"glyphicon glyphicon-info-sign\" aria-hidden=\"true\"></span> \n\t\t\t\t\t\t\t\t\t\t\t\tYour password has been changed\t\n\t\t\t\t\t\t\t\t\t\t\t</div>');\n\t\t\t\t}\n\n\t\t\t}else{\n\n\t\t\t\t//return error msg wrong old password\n\t\t\t\t\treturn Redirect::route('account-chg-pw')\n\t\t\t\t\t\t\t->with('global','<div class=\"alert alert-danger\" role=\"alert\">\n\t\t\t\t\t\t\t\t\t\t\t \t<span class=\"glyphicon glyphicon-exclamation-sign\" aria-hidden=\"true\"></span>\n\t\t\t\t\t\t\t\t\t\t\t \t<span class=\"sr-only\">Error:</span>\n\t\t\t\t\t\t\t\t\t\t\t \tYour old password is wrong. Try again\n\t\t\t\t\t\t\t\t\t\t\t</div>');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t//fallback for change password\n\t\treturn Redirect::route('account-chg-pw')->with('global','<div class=\"alert alert-danger\" role=\"alert\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t<span class=\"glyphicon glyphicon-exclamation-sign\" aria-hidden=\"true\"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t<span class=\"sr-only\">Error:</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \tWe could not change your password. Try again\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>');\n\n\t}", "function _chk_old_pass($str) {\n $id = $this->session->userdata('id');\n $get_user_where = array('id' => $id);\n $get_user_select = array('password'); //,'password_history'\n $get_user = $this->Common_model->getsingle('ai_users', $get_user_where, $get_user_select);\n\n if ($get_user != 'no record found') {\n $old_pass_db = $get_user->password;\n\t\t\t$npass = $str;\n $old_pass_us = $npass;\n\n if ($old_pass_db != $old_pass_us) {\n $this->form_validation->set_message('_chk_old_pass', 'The %s is incorrect.');\n return FALSE;\n } else {\n return TRUE;\n }\n } else {\n $this->form_validation->set_message('_chk_old_pass', 'The %s is incorrect.');\n return FALSE;\n }\n }", "public function should_return_ok_after_user_changed_password()\n {\n factory(User::class)->create();\n $this->expectsEvents(PasswordChanged::class);\n\n $this->put('/v1/users/1/password', [\n 'old_password' => 'secrete123',\n 'new_password' => 'new123password',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::OK);\n $this->seeJsonContains(['message' => 'The password has been changed successfully.']);\n\n // Just verifying if old password has been invalidated\n $user = User::find(1);\n $this->assertFalse(Hash::check('secrete123', $user->password));\n $this->assertTrue(Hash::check('new123password', $user->password));\n }", "private function changePassword()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($request['old_pass']) || $request['old_pass']==\"\")\n throw_error_msg(\"provide old_pass\");\n\n //new_pass\n if(!isset($request['new_pass']) || $request['new_pass']==\"\")\n throw_error_msg(\"provide new_pass\");\n\n //c_new_pass\n if(!isset($request['c_new_pass']) || $request['c_new_pass']==\"\")\n throw_error_msg(\"provide c_new_pass\");\n\n if($request['c_new_pass']!=$request['c_new_pass'])\n throw_error_msg(\"new password and confirm password do not match\");\n\n $request['userid'] = userid();\n $userquery->change_password($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"password has been changed successfully\");\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }" ]
[ "0.79701155", "0.7893836", "0.7666112", "0.7464604", "0.7430108", "0.7419654", "0.7407639", "0.7383865", "0.7373173", "0.7305673", "0.72753847", "0.72653216", "0.7249119", "0.7187271", "0.7182397", "0.7122389", "0.7111739", "0.7105607", "0.70855606", "0.706462", "0.7026199", "0.702345", "0.6998861", "0.6990774", "0.6989048", "0.69873947", "0.698455", "0.6968166", "0.69591874", "0.69539595", "0.694916", "0.69478226", "0.68992794", "0.68969774", "0.6895573", "0.6867212", "0.68581855", "0.68479484", "0.684755", "0.67963266", "0.67960495", "0.6787201", "0.67802787", "0.6779513", "0.67712456", "0.6766601", "0.67530763", "0.67460537", "0.67252636", "0.672253", "0.671395", "0.67124087", "0.6696496", "0.66953087", "0.6679284", "0.6676105", "0.6661683", "0.66349304", "0.6628431", "0.66282815", "0.6622103", "0.66183496", "0.6599461", "0.6593924", "0.6585545", "0.6582872", "0.6578203", "0.65682626", "0.65624976", "0.6558892", "0.65587497", "0.6556031", "0.655437", "0.65509206", "0.6543798", "0.65383655", "0.653815", "0.65357447", "0.6531842", "0.65213084", "0.6520166", "0.65200645", "0.65097684", "0.6508712", "0.65080076", "0.65060055", "0.6496676", "0.6488646", "0.64885056", "0.6484585", "0.64806557", "0.64763576", "0.64763576", "0.6472498", "0.646756", "0.64640605", "0.6460226", "0.6460097", "0.6458717", "0.64576083" ]
0.6715559
50
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function create() {}", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315901", "0.6248427", "0.6241929", "0.6194334", "0.6081284", "0.6075819", "0.6069913", "0.60685146", "0.6055616", "0.6027874", "0.60132784", "0.60118896", "0.6011778", "0.5969603", "0.59618074", "0.5954538", "0.59404427", "0.59388787", "0.5929363", "0.5910562", "0.590651", "0.589658", "0.589658", "0.589658", "0.58692765", "0.58665586", "0.5866528", "0.58663124", "0.5852474", "0.5852405", "0.58442044", "0.58391577", "0.58154446", "0.58055794", "0.5795853", "0.5780188", "0.57653266", "0.57640004", "0.57584697", "0.575748", "0.5742612", "0.5739361", "0.5732979", "0.572247", "0.5701043", "0.5686879", "0.5685233", "0.56819254", "0.5675983", "0.56670785", "0.56606543", "0.5659307", "0.56567776", "0.56534046", "0.56343585", "0.56290466", "0.5626615", "0.56255764", "0.5608852", "0.5608026", "0.56063116", "0.56026554", "0.5599553", "0.5599351", "0.55640906", "0.55640906", "0.5561977", "0.5559745", "0.5555084", "0.5551485", "0.5544597", "0.55397296", "0.5529626", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908" ]
0.0
-1
Execute the console command.
public function handle() { CronHelper::before_cronrun($this->name, $this ); $arguments = $this->argument(); $CompanyID = $arguments["CompanyID"]; $CronJobID = $arguments["CronJobID"]; $getmypid = getmypid(); // get proccess id $CronJob = CronJob::find($CronJobID); $cronsetting = json_decode($CronJob->Settings,true); $dataactive['Active'] = 1; $dataactive['PID'] = $getmypid; $dataactive['LastRunTime'] = date('Y-m-d H:i:00'); $CronJob->update($dataactive); try { /*$joblogdata = $errors = array(); $joblogdata['CronJobID'] = $CronJobID; $joblogdata['created_at'] = date('Y-m-d H:i:s'); $joblogdata['created_by'] = 'RMScheduler'; CronJob::createLog($CronJobID); Log::useFiles(storage_path() . '/logs/createdailysummary-' . $CompanyID . '-' . date('Y-m-d') . '.log'); //Update tblUsageHeader DB::connection('sqlsrv2')->statement('CALL prc_setAccountID(' . $CompanyID . ")"); //Update tblVendorCDRHeader Log::error('Start CALL prc_setVendorAccountID(' . $CompanyID.")"); DB::connection('sqlsrv2')->statement('CALL prc_setVendorAccountID(' . $CompanyID.")"); Log::error('End CALL prc_setVendorAccountID(' . $CompanyID.")"); $CustomerDate = CompanySetting::getKeyVal($CompanyID,'LastCustomerSummaryDate'); if($CustomerDate == date("Y-m-d")) { $Live = 1; if(getenv('APP_OS') == 'Linux') { pclose(popen(env('PHPExePath') . " " . env('RMArtisanFileLocation') . " createsummary " . $CompanyID . " ".$CronJobID." ".$Live." &", "r")); }else { pclose(popen("start /B " . env('PHPExePath') . " " . env('RMArtisanFileLocation') . " createsummary " . $CompanyID . " $CronJobID $Live", "r")); } }else if(date("H") >= 2 ){ $Live = 0; if(getenv('APP_OS') == 'Linux') { pclose(popen(env('PHPExePath') . " " . env('RMArtisanFileLocation') . " createsummary " . $CompanyID . " ".$CronJobID." ".$Live." &", "r")); }else { pclose(popen("start /B " . env('PHPExePath') . " " . env('RMArtisanFileLocation') . " createsummary " . $CompanyID . " $CronJobID $Live", "r")); } } $VendorDate = CompanySetting::getKeyVal($CompanyID,'LastVendorSummaryDate'); if($VendorDate == date("Y-m-d")) { $Live = 1; if(getenv('APP_OS') == 'Linux') { pclose(popen(env('PHPExePath') . " " . env('RMArtisanFileLocation') . " createvendorsummary " . $CompanyID . " $CronJobID $Live &", "r")); }else { pclose(popen("start /B " . env('PHPExePath') . " " . env('RMArtisanFileLocation') . " createvendorsummary " . $CompanyID . " $CronJobID $Live", "r")); } }else if(date("H") >= 2 ){ $Live = 0; if(getenv('APP_OS') == 'Linux') { pclose(popen(env('PHPExePath') . " " . env('RMArtisanFileLocation') . " createvendorsummary " . $CompanyID . " $CronJobID $Live &", "r")); }else { pclose(popen("start /B " . env('PHPExePath') . " " . env('RMArtisanFileLocation') . " createvendorsummary " . $CompanyID . " $CronJobID $Live", "r")); } } $UsageHeaders = TempUsageDownloadLog::where(array('DailySummaryStatus'=>0,'CompanyID'=>$CompanyID))->select(["TempUsageDownloadLogID","CompanyID","CompanyGatewayID","ProcessID"])->take(5)->get(); //$UsageHeaders = UsageHeader::where(array('DailySummaryStatus'=>1,'CompanyID'=>$CompanyID))->select(["CompanyID","CompanyGatewayID","UsageHeaderID"])->get(); foreach ($UsageHeaders as $UsageHeader) { try { Log::info('========Transaction start========.ProcessID =='.$UsageHeader->ProcessID); DB::connection('sqlsrv2')->beginTransaction(); $CompanyGatewayID = $UsageHeader->CompanyGatewayID; $TimeZone = CompanyGateway::getGatewayTimeZone($CompanyGatewayID); if (empty($TimeZone)) { $TimeZone = 'GMT'; } TempUsageDetail::GenerateDailySummary($CompanyID,$UsageHeader->ProcessID,$TimeZone ); TempUsageDownloadLog::where(array('TempUsageDownloadLogID'=>$UsageHeader->TempUsageDownloadLogID))->update(array('DailySummaryStatus'=>'1')); DB::connection('sqlsrv2')->commit(); Log::info('========Transaction end========.'); }catch (\Exception $e){ try { DB::rollback(); DB::connection('sqlsrv2')->rollback(); DB::connection('sqlsrvcdr')->rollback(); } catch (\Exception $err) { Log::error($err); } $errors[] = 'error with transaction '.$UsageHeader->ProcessID; Log::error($e); } }*/ if(!empty($errors)){ $joblogdata['Message'] = implode(',\n\r',$errors); $joblogdata['CronJobStatus'] = CronJob::CRON_FAIL; }else{ $joblogdata['Message'] = 'Success'; $joblogdata['CronJobStatus'] = CronJob::CRON_SUCCESS; } CronJobLog::insert($joblogdata); } catch (\Exception $e) { try { DB::rollback(); DB::connection('sqlsrv2')->rollback(); DB::connection('sqlsrvcdr')->rollback(); } catch (\Exception $err) { Log::error($err); } Log::error($e); $this->info('Failed:' . $e->getMessage()); $joblogdata['Message'] ='Error:'.$e->getMessage(); $joblogdata['CronJobStatus'] = CronJob::CRON_FAIL; CronJobLog::insert($joblogdata); if(!empty($cronsetting['ErrorEmail'])) { $result = CronJob::CronJobErrorEmailSend($CronJobID,$e); Log::error("**Email Sent Status " . $result['status']); Log::error("**Email Sent message " . $result['message']); } } $dataactive['PID'] = ''; $dataactive['Active'] = 0; $CronJob->update($dataactive); Log::error(" CronJobId end" . $CronJobID); if(!empty($cronsetting['SuccessEmail'])) { $result = CronJob::CronJobSuccessEmailSend($CronJobID); Log::error("**Email Sent Status ".$result['status']); Log::error("**Email Sent message ".$result['message']); } CronHelper::after_cronrun($this->name, $this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.61484164", "0.6146793", "0.6139144", "0.61347336", "0.6131662", "0.61164206", "0.61144686", "0.61109483", "0.61082935", "0.6105106", "0.6103338", "0.6102162", "0.61020017", "0.60962653", "0.6095482", "0.6091584", "0.60885274", "0.6083864", "0.6082142", "0.6077832", "0.60766655", "0.607472", "0.60739267", "0.607275", "0.60699606", "0.6069931", "0.6068753", "0.6067665", "0.6061175", "0.60599935", "0.6059836", "0.605693", "0.60499364", "0.60418284", "0.6039709", "0.6031963", "0.6031549", "0.6027515", "0.60255647", "0.60208166", "0.6018581", "0.60179937", "0.6014668", "0.60145515", "0.60141796", "0.6011772", "0.6008498", "0.6007883", "0.60072047", "0.6006732", "0.60039204", "0.6001778", "0.6000803", "0.59996396", "0.5999325", "0.5992452", "0.5987503", "0.5987503", "0.5987477", "0.5986996", "0.59853584", "0.5983282", "0.59804505", "0.5976757", "0.5976542", "0.5973796", "0.5969228", "0.5968169", "0.59655035", "0.59642595", "0.59635514", "0.59619296", "0.5960217", "0.5955025", "0.5954439", "0.59528315", "0.59513766", "0.5947869", "0.59456027", "0.5945575", "0.5945031" ]
0.0
-1
Test output to check if property slug exists and the property type value.
public function test_output() { papi_render_property( $this->property ); $this->expectOutputRegex( '/name=\"' . papi_get_property_type_key( $this->property->slug ) . '\"' ); $this->expectOutputRegex( '/value=\"string\"/' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _passed_config_test() {\n\t\tif ( ! is_subclass_of( $this, 'SN_Type_Base' ) )\n\t\t\treturn false;\n\n\t\t$errors = array();\n\t\t$required_properties = array(\n\t\t\t'post_type' => $this->post_type,\n\t\t\t'post_type_title' => $this->post_type_title,\n\t\t\t'post_type_single' => $this->post_type_single,\n\t\t);\n\n\t\tforeach ( $required_properties as $property_name => $property ) {\n\t\t\tif ( is_null( $property ) )\n\t\t\t\t$errors[] = \"Property {$property_name} has not been set in your sub-class.\\n\";\n\t\t} // foreach()\n\n\t\tif ( empty( $errors ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tforeach ( $errors as $error )\n\t\t\t\techo esc_html( $error );\n\t\t} // if/each()\n\n\t\treturn false;\n\t}", "public function test_papi_get_property_type_custom() {\n\t\tadd_action('papi_include_properties', function() {\n\t\t\trequire_once(dirname(__FILE__) . '/../data/properties/class-papi-property-kvack.php');\n\t\t});\n\n\t\tdo_action('papi_include_properties');\n\n\t\t$this->assertTrue( _papi_get_property_type( 'kvack' ) instanceof Papi_Property_Kvack );\n\t}", "public function test_save_property_value() {\n\t\t$handler = new Papi_Admin_Meta_Boxes();\n\n\t\t// Create post data.\n\t\t$_POST = papi_test_create_property_post_data( array(\n\t\t\t'slug' => $this->property->slug,\n\t\t\t'type' => $this->property->type,\n\t\t\t'value' => 'fredrik'\n\t\t), $_POST );\n\n\t\t// Save the property using the handler.\n\t\t$handler->save_property( $this->post_id );\n\n\t\t// Test get the value with papi_field function.\n\t\t$expected = 'fredrik';\n\t\t$actual = papi_field( $this->post_id, $this->property->slug );\n\n\t\t$this->assertEquals( $expected, $actual );\n\t}", "private static function _isPropertyType($type, $value){\n $nativeType = self::_getNativeType($type);\n if ($nativeType != null){\n switch($nativeType){\n case 'boolean':\n if (is_bool($value)){\n return true;\n } else if (is_numeric($value) && ($value == 0 || $value == 1)){\n return true;\n } else if (is_string($value)){\n if ($value == 'true' || $value == 'false'){\n return true;\n } else if ($value == '1' || $value == '0'){\n return true;\n }\n }\n break;\n case 'integer':\n if (is_int($value)){\n return true;\n } else if (preg_match('/^[0-9]+$/', $value)){\n return true;\n }\n break;\n case 'double':\n if (is_float($value) || is_numeric($value)){\n return true;\n }\n break;\n case 'datetime':\n if (is_int($value) || strtotime($value)){\n return true;\n }\n break;\n case 'binary':\n if (is_binary($value)){\n return true;\n }\n break;\n case 'ascii':\n if (is_string($value)){\n return true;\n }\n break;\n case 'instance':\n $uuid = null;\n if (is_object($value) && isset($value->uuid) && is_mysql_uuid($value->uuid)){\n $uuid = $value->uuid;\n } else if (is_mysql_uuid($value)){\n $uuid = $value;\n }\n if ($uuid != null){\n $id = Mysql::query(\"SELECT MAX(id) FROM t_instance where uuid = '{$uuid}'\");\n if ($id && is_int($id)){\n return true;\n }\n }\n break;\n }\n }\n\n // all else failed\n return false;\n }", "abstract public function get_property( $slug, $child_slug = '' );", "protected function convert( $slug, $value ) {\n\t\t$property = $this->get_property( $slug );\n\n\t\t// If no property type is found, just return null.\n\t\tif ( ! papi_is_property( $property ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Prepare convert value, when you have `overwrite => true`\n\t\t// this value will not exist in the database and that's\n\t\t// why we need to prepare (change) the value.\n\t\t$value = $this->prepare_convert_value( $property, $value );\n\n\t\tif ( papi_is_empty( $value ) ) {\n\t\t\tif ( ! papi_is_empty( $property->get_option( 'value' ) ) ) {\n\t\t\t\treturn $property->get_option( 'value' );\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// A property need to know about the store.\n\t\t$property->set_store( $this );\n\n\t\t// Run load value method right after the value has been loaded from the database.\n\t\t$value = $property->load_value( $value, $slug, $this->id );\n\t\t$value = papi_filter_load_value(\n\t\t\t$property->type,\n\t\t\t$value,\n\t\t\t$slug,\n\t\t\t$this->id,\n\t\t\tpapi_get_meta_type()\n\t\t);\n\n\t\t// Format the value from the property class.\n\t\t$value = $property->format_value( $value, $slug, $this->id );\n\n\t\t// Only fired when not in admin.\n\t\tif ( ! is_admin() ) {\n\t\t\t$value = papi_filter_format_value(\n\t\t\t\t$property->type,\n\t\t\t\t$value,\n\t\t\t\t$slug,\n\t\t\t\t$this->id,\n\t\t\t\tpapi_get_meta_type()\n\t\t\t);\n\t\t}\n\n\t\tif ( is_array( $value ) ) {\n\t\t\t$value = array_filter( $value );\n\t\t}\n\n\t\treturn $value;\n\t}", "abstract protected function propertyExists($name);", "public function testUnfilteredProperties()\n {\n $this->visit('/properties')\n ->see('Victorian townhouse')\n ->see('Five bedroom mill conversion')\n ->see('Shack in the desert');\n }", "function testGetProperty2 ()\n\t{\n\t\t\t$input = null;\n\t\t\t$property = \"name\";\n\t\t\t$this->assertNull (\n\t\t\t\t\t$this->stringUtils->getProperty ($input, $property)\n\t\t\t);\n\t}", "public static function canDisplayPropertyTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PROPERTY_TYPE);\n\t}", "public function hasValue()\n {\n return $this->property_value->isNotEmpty();\n }", "public function testPropertyGetTest()\n {\n $response = $this->get('/api/v1/properties/filter');\n\n $response->assertStatus(200);\n }", "public function testPropertyMeta($value)\n {\n $object = new ArticleResponse();\n $object->setMeta($value);\n\n $this->assertEquals($value, $object->getMeta());\n }", "private function IsProperty($code) {\n\t\t$parent = '/^' . $this->bxPrefix . '[A-z\\d\\[\\]]+$/';\n\n\t\treturn preg_match($parent, $code);\n\t}", "function myprefix_setting_one_slug_validate($input) {\n\treturn $input;\n}", "public function hasSlug($slug);", "protected function getPropertyValue() {}", "function is($prop){\n \treturn $this->get_property($prop)==1?true:false;\n }", "function is_property_reference($entity_type, $name) {\n}", "public function property_type_of_practice() {\n\n\t\t\tif ( $this->add_package !== 3 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t $out = '<h3>Property Details:</h3>';\n\n\t\t\t$out = '<h4>Type of Practice</h4>';\n\t\t\t$out .= '<ul>';\n\n\t\t\t$practice_type = get_field( 'practice_type' );\n\t\t\t$practice_type_label = ( $practice_type != 'other' )\n\t\t\t\t? $practice_type\n\t\t\t\t: get_field( 'other_type' );\n\n\t\t\t$out .= '<li><em>Practice Type:</em> ' . $practice_type_label . '</li>';\n\n\t\t\t$small_animal_treated = get_field( 'small_animal_treated' );\n\t\t\t$equine_treated = get_field( 'equine_treated' );\n\t\t\t$bovine_treated = get_field( 'bovine_treated' );\n\t\t\t$other_treated = get_field( 'other_treated' );\n\t\t\t$other_animals_treated_cont = get_field( 'other_animals_treated_cont' );\n\n\n\t\t\tif ( $small_animal_treated ) {\n\t\t\t\t$treated_small = get_field( 'small_animal_choices' );\n\t\t\t\t$small_choices = rtrim( implode( ', ', $treated_small ), ',' );\n\t\t\t\t$out .= '<li><em>' . $small_animal_treated . '&#37; - Small</em> &#40; ' . $small_choices . ' &#41;</li>';\n\t\t\t}\n\n\t\t\tif ( $equine_treated ) {\n\t\t\t\t$treated_equine = get_field( 'equine_choices' );\n\t\t\t\t$equine_choices = rtrim( implode( ', ', $treated_equine ), ',' );\n\t\t\t\t$out .= '<li><em>' . $equine_treated . '&#37; - Equine</em> &#40; ' . $equine_choices . ' &#41;</li>';\n\t\t\t}\n\n\t\t\tif ( $bovine_treated ) {\n\t\t\t\t$treated_bovine = get_field( 'bovine_choices' );\n\t\t\t\t$bovine_choices = rtrim( implode( ', ', $treated_bovine ), ',' );\n\t\t\t\t$out .= '<li><em>' . $bovine_treated . '&#37; - Bovine</em> &#40; ' . $bovine_choices . ' &#41;</li>';\n\t\t\t}\n\n\t\t\tif ( $other_treated ) {\n\t\t\t\t$out .= '<li><em>' . $other_treated . '&#37; - Other</em> &#40; ' . $other_animals_treated_cont . '&#41;</li>';\n\t\t\t}\n\n\t\t\t$out .= '</ul>';\n\n\t\t\treturn $out;\n\t\t}", "public function checkHasProperty($value, $property)\n {\n if (!is_string($property)) {\n throw new InvalidArgumentException('$property must be a string and an identifier');\n }\n\n $success = (is_string($value) || is_object($value)) && property_exists($value, $property);\n\n return new Result($success, '{name} must have a property called {0}', [$property]);\n }", "public function validateSlugAction(): void\n {\n if (isset($_GET['url_slug']) && !empty($_GET['url_slug'])) {\n $slug_valid = !Post::slugExist($_GET['url_slug'], $_GET['ignore_id'] ?? null);\n header('Content-Type: application/json');\n echo json_encode($slug_valid);\n }\n }", "protected function _is($property): bool {\n $property[0] = strtolower($property[0]);\n if (property_exists($this, $property) && $this->$property === true) {\n return true;\n } elseif (array_key_exists($property, $this->_properties) && $this->_properties[$property] === true) {\n return true;\n } else {\n return false;\n }\n }", "function testGetProperty1 ()\n\t{\n\t\t\t$input = \"name=value\";\n\t\t\t$property = \"name\";\n\t\t\t$expectedOutput = \"value\";\n\t\t\t$this->assertEqual (\n\t\t\t\t\t$this->stringUtils->getProperty ($input, $property),\n\t\t\t\t\t$expectedOutput\n\t\t\t);\n\t}", "function testGetProperty3 ()\n\t{\n\t\t\t$input = \"Barry\";\n\t\t\t$property = null;\n\t\t\t$this->assertNull (\n\t\t\t\t\t$this->stringUtils->getProperty ($input, $property)\n\t\t\t);\n\t}", "private function isEmpty(Property $property)\n {\n return !isset($property->type)\n && !isset($property->description)\n && $property->default == \\SWAGGER\\UNDEFINED;\n }", "function testPostTypeExistsCheckPostTypeExpectsPostTypeNameReturned() {\n\t\t// Arrange\n\t\t\\WP_Mock::wpFunction('sanitize_key', array(\n\t\t\t'times' => 1,\n\t\t\t'return' => 'post'\n\t\t\t)\n\t\t);\n\t\t\\WP_Mock::wpFunction('post_type_exists', array(\n\t\t\t'times' => 1,\n\t\t\t'arg' => array( \\WP_Mock\\Functions::type('string') ),\n\t\t\t'return' => true\n\t\t\t)\n\t\t);\n\t\t$form = new TestValidBox();\n\t\t$expected = 'post';\n\t\t// act\n\t\t$actual = $form->check_post_type($form->post_type);\n\t\t// Assert\n\t\t$this->assertEquals($expected, $actual, 'Post type did not verify correctly');\n\t}", "public function hasStringValue(){\n return $this->_has(1);\n }", "function testPrimitiveProperty(){\n\n\t\t//see http://services.odata.org/v3/OData/OData.svc/Suppliers(0)/Address/City?$format=application/json;odata=fullmetadata\n\t\t$property = new ODataProperty();\n\t\t$property->name = \"Count\";\n\t\t$property->typeName = 'Edm.Int16';\n\t\t$property->value = 56;\n\n\t\t$content = new ODataPropertyContent();\n\t\t$content->properties = array($property);\n\n\t\t$writer = new JsonLightODataWriter(JsonLightMetadataLevel::FULL, $this->serviceBase);\n\t\t$result = $writer->write($content);\n\t\t$this->assertSame($writer, $result);\n\n\n\t\t//decoding the json string to test\n\t\t$actual = json_decode($writer->getOutput());\n\n\t\t$expected = '{\n\t\t\t\t\t\t\"odata.metadata\":\"http://services.odata.org/OData/OData.svc/$metadata#Edm.Int16\",\n\t\t\t\t\t\t\"value\" : 56\n\t\t\t\t\t }';\n\t\t$expected = json_decode($expected);\n\n\t\t$this->assertEquals(array($expected), array($actual), \"raw JSON is: \" . $writer->getOutput());\n\t}", "function is_property_multi_value($entity_type, $name) {\n $controller = entity_toolbox_controller($entity_type);\n $helper = $controller->getPropsHelper();\n\n return $helper->propIsMulti($name);\n}", "public function testSlugKeyNameProperty()\n {\n\n $post = PostWithMultipleSlugsAndPrimaryProperty::create([\n 'title' => 'A Post Title',\n 'subtitle' => 'A Post Subtitle'\n ]);\n\n $this->assertEquals('dummy', $post->getSlugKeyName());\n $this->assertEquals('a.post.subtitle', $post->dummy);\n $this->assertEquals('a.post.subtitle', $post->getSlugKey());\n\n }", "function registered_meta_key_exists($object_type, $meta_key, $object_subtype = '')\n {\n }", "public function get_slug() {\n\t\tif ( ! empty( $this->data->slug ) )\n\t\t\treturn $this->data->slug;\n\t\telse\n\t\t\treturn false;\n\t}", "public function testResultIsEmpty(): void\n {\n $this->get_accessible_reflection_property('result');\n $this->assertTrue($this->get_reflection_property_value('result'));\n }", "function hyphenNeeded($propertyName) {\n if (!array_key_exists($propertyName, $this->propertyTable))\n throw new Exception(\"Invalid property \\\"$propertyName\\\"!\");\n\n if (method_exists($this, 'isString' . $propertyName)) {\n return call_user_func(array($this, 'get' . $propertyName));\n } else {\n switch ($this->propertyTable[$propertyName]->convert) {\n case 'int':\n $Hyphen = false;\n break;\n case 'double':\n $Hyphen = false;\n break;\n case 'bool':\n $Hyphen = false;\n break;\n case 'time':\n $Hyphen = true;\n break;\n default:\n $Hyphen = true;\n }\n return $Hyphen;\n }\n }", "private function slug_exists($slug)\n\t\t{\n\t\t\t$where = '@slug=\"'.utf8_encode($slug).'\"';\n\t\t\t$node = $this->xml->xpath('/post/friendly/url['.$where.']');\n\n\t\t\tif($node==array())\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}", "function property($property_name, $default = NULL, $formatted = false)\n {\n $property_value = $this->get_property($property_name, $default);\n if ($property_value != NULL)\n {\n if ($formatted)\n {\n if (preg_match(\"/^(body|meta).(.*)$/\", $property_name, $match))\n {\n $property_prefix = $match[1];\n $property_name_cut = $match[2];\n }\n else\n {\n die(\"Invalid property name: $property_name.\\n\");\n }\n\n if ($property_prefix == \"meta\")\n {\n $meta_type = $this->_meta_property_types[$property_name];\n $before = \"<meta $meta_type=\\\"$property_name_cut\\\" content=\\\"\";\n $after = \"\\\" />\";\n }\n else if ($property_prefix == \"body\")\n {\n $before = \" $property_name_cut=\\\"\";\n $after = \"\\\"\";\n }\n else\n {\n die(\"Impossible branch: $property_name => $property_prefix $property_name_cut\");\n }\n }\n else\n {\n $before = \"\";\n $after = \"\";\n }\n\n print \"$before$property_value$after\";\n }\n }", "public function valid_location_property( $property ) {\n\t\t\tif ( property_exists( $this, $property ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( array_key_exists( $property, $this->exdata ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( isset( $this->slplus->database->extension ) ) {\n\t\t\t\t$this->slplus->database->extension->set_cols();\n\t\t\t\tif ( array_key_exists( $property, $this->slplus->database->extension->metatable['records'] ) ) {\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}", "function inspiry_is_edit_property() {\n\t\tif ( isset( $_GET['edit_property'] ) && ! empty( $_GET['edit_property'] ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function be_metabox_show_on_slug( $display, $meta_box ) {\n if ( ! isset( $meta_box['show_on']['key'], $meta_box['show_on']['value'] ) ) {\n return $display;\n }\n\n if ( 'slug' !== $meta_box['show_on']['key'] ) {\n return $display;\n }\n\n $post_id = 0;\n\n // If we're showing it based on ID, get the current ID\n if ( isset( $_GET['post'] ) ) {\n $post_id = $_GET['post'];\n } elseif ( isset( $_POST['post_ID'] ) ) {\n $post_id = $_POST['post_ID'];\n }\n\n if ( ! $post_id ) {\n return $display;\n }\n\n $slug = get_post( $post_id )->post_name;\n\n // See if there's a match\n return in_array( $slug, (array) $meta_box['show_on']['value']);\n}", "public function hasStringValue(){\n return $this->_has(3);\n }", "public function isValidProperty(string $property) : bool;", "abstract function appliedOnProperty(mixed $value = null): null|string|bool;", "function testPostTypeNotExistsCheckPostTypeExpectsPostTypeNameReturned() {\n\t\t// Arrange\n\t\t\\WP_Mock::wpFunction('sanitize_key', array(\n\t\t\t'times' => 0,\n\t\t\t)\n\t\t);\n\t\t\\WP_Mock::wpFunction('post_type_exists', array(\n\t\t\t'times' => 1,\n\t\t\t'return' => false\n\t\t\t)\n\t\t);\n\t\t$form = new TestValidBox();\n\t\t$expected = false;\n\t\t// act\n\t\t$actual = $form->check_post_type($form->post_type);\n\t\t// Assert\n\t\t$this->assertEquals($expected, $actual, 'Post type did not verify correctly');\n\t}", "public function testSetGetSlug()\n {\n $slug = 'Slug';\n $event = (new Event())->setSlug($slug);\n $this->assertNotEquals($slug, $event->getSlug());\n }", "protected function is_embedded_html( $property ) {\n\t\treturn is_array( $property ) && ! wp_is_numeric_array( $property ) && isset( $property['value'] ) && isset( $property['html'] );\n\t}", "protected function typeFail(string $property): string\n {\n return \"'$property' type not expected.\";\n }", "function ppom_has_field_by_type( $product_id, $field_type ) {\n\t\n\t$ppom\t\t= new PPOM_Meta( $product_id );\n\tif( ! $ppom->fields ) return '';\n\t\n\t$fields_found = array();\n\tforeach($ppom->fields as $field) {\n\t\t\n\t\tif( !empty($field['type']) && $field['type'] == $field_type ) {\n\t\t\t$fields_found[] = $field;\n\t\t}\n\t}\n\t\n\treturn $fields_found;\n}", "public function sanitize_post_type_rest_slug( $value ) {\n\t\tif ( array_key_exists( $value, $this->get_post_type_rest_slugs() ) ) {\n\t\t\treturn $value;\n\t\t}\n\t\treturn null;\n\t}", "function property_type($field)\n{\n$cms=mysql_fetch_array(mysql_query(\"select type_name from manage_property_type where ptype='\".$field.\"'\"));\nreturn $cms['type_name'];\n}", "public static function slugProperty() : ? string {\n return null;\n }", "public function hasProductsUsingPropValues(Property $property) {\r\n /* @var $propertyValue \\US\\CatalogBundle\\Entity\\PropertyValue */\r\n foreach ($property->getPropertyValues() as $propertyValue) {\r\n if ($propertyValue->getProducts()->count()) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "public function shouldSkipUnknownProperties() {}", "protected function _has($property): bool {\n $property[0] = strtolower($property[0]);\n return (property_exists($this, $property) || array_key_exists($property, $this->_properties));\n }", "function shouldSkipUnknownProperties() ;", "public function __isset($property){\n echo isset($this->$property);\n }", "public function __isset($property) {\n switch ($property) {\n case 'message':\n case 'code':\n case 'full_message':\n case 'is_info':\n case 'is_success':\n case 'is_redirect':\n case 'is_error':\n case 'is_client_error':\n case 'is_server_error':\n case 'response':\n return true;\n default:\n return false;\n }\n }", "private function validateEntityTypePropertyAndPropValue() {\n $validateServ = new validate();\n\n #Because of how extension properties appear in the schema (as a seperate entity), we need to change the entity name\n if ($this->entityProperty == 'extensionproperties') {\n $objectType = $this->entityType . 'property';\n } else {\n $objectType = $this->entityType;\n }\n\n #Now we itterate through all the possible cases.\n #The first is that a entity key has been provided, currently only extension properties support this\n #The second is that there is no key, and a single value has been provided\n #The third is that a series of key/value pairs have been provided\n #The fourth is a delete where no array or value has been specified, this is only currently supported for extension properties\n #The final statement deals with the case where a key has been specified as well as multiple values or where both a single value and an array are set. Neither should happen.\n if (!is_null($this->entityPropertyKey) && !is_null($this->entityPropertyValue) && is_null($this->entityPropertyKVArray)) {\n #only currently supported for extension properties\n if ($this->entityProperty == 'extensionproperties') {\n $this->validateWithService($objectType,'name',$this->entityPropertyKey,$validateServ);\n $this->validateWithService($objectType,'value',$this->entityPropertyValue,$validateServ);\n } else {\n $this->exceptionWithResponseCode(400,\n \"The API currently only supports specifying a key in the url for extension properties. For help see: $this->docsURL\"\n );\n }\n } elseif (is_null($this->entityPropertyKey) && !is_null($this->entityPropertyValue) && is_null($this->entityPropertyKVArray)) {\n $this->validateWithService($objectType,$this->entityProperty,$this->entityPropertyValue,$validateServ);\n } elseif (is_null($this->entityPropertyKey) && is_null($this->entityPropertyValue) && !is_null($this->entityPropertyKVArray)) {\n #only currently supported for extension properties\n if ($this->entityProperty == 'extensionproperties') {\n foreach ($this->entityPropertyKVArray as $key => $value) {\n $this->validateWithService($objectType,'name',$key,$validateServ);\n #Values can be null in the case of DELETEs\n if (!(empty($value) && $this->requestMethod == 'DELETE')) {\n $this->validateWithService($objectType,'value',$value,$validateServ);\n }\n }\n unset($value);\n } else {\n $this->exceptionWithResponseCode(400,\n \"The API currently only supports specifying an array of values for extension properties. For help see: $this->docsURL\"\n );\n }\n } elseif (is_null($this->entityPropertyValue) && is_null($this->entityPropertyKVArray)) {\n #Only delete methods support not providing values of any kind\n if ($this->requestMethod == 'DELETE') {\n #only currently supported for extension properties\n if ($this->entityProperty != 'extensionproperties') {\n $this->exceptionWithResponseCode(400,\n \"The API currently only supports deleting without specifying values for extension properties. For help see: $this->docsURL\"\n );\n }\n } else {\n $this->exceptionWithResponseCode(400,\n \"For methods other than 'DELETE' a value or set of values must be provided. For help see: $this->docsURL\"\n );\n }\n\n } else {\n $this->exceptionWithResponseCode(500,\n \"The validation process has failed due to an error in the internal logic. Please contact the administrator.\"\n );\n }\n }", "public function testGetPeopertyValueMethod()\n {\n $firstname = 'Chris';\n $subject = new TestPropertySubject();\n $en = new Enforcer();\n\n $result = $en->getPropertyValue('firstname', $subject);\n $this->assertEquals($firstname, $result);\n }", "public function test_adding_a_title_generates_a_slug()\n {\n //cuando cree un post y le asigne un titulo\n $post=new Post([\n 'title'=>'Como instalar laravel',\n\n ]);\n //en este punto el post deberia tener una propiedad llamada slug que contenga como-instalar-lravel\n $this->assertSame('como-instalar-laravel',$post->slug);\n\n\n\n }", "function testGetProperty4 ()\n\t{\n\t\t\t$input = \"Barry=a programmer and=good\";\n\t\t\t$property = \"Barry\";\n\t\t\t$expectedOutput = \"a programmer and=good\";\n\t\t\t$this->assertEqual (\n\t\t\t\t\t$this->stringUtils->getProperty ($input, $property),\n\t\t\t\t\t$expectedOutput\n\t\t\t);\n\t}", "function acf_get_field_type_prop($name = '', $prop = '')\n{\n}", "public function getMetabox( $slug )\n\t{\n\t\treturn isset( $this->_metaboxes[( string ) $slug] ) ? $this->_metaboxes[( string ) $slug] : false;\n\t}", "function getConfigPropertyValue($config, $pagename, $property){\n\t\treturn $config['query']['results'][$pagename]['printouts'][$property][0];\n\t}", "function testTermExistsExpectsStringUsed() {\n\t\t// Arrange\n\t\tglobal $post;\n\t\t$form = new TestNumberField();\n\t\t$form->fields['field_one']['type'] = 'taxonomyselect';\n\t\t$form->fields['field_one']['taxonomy'] = 'category';\n\t\t$form->fields['field_one']['multiple'] = false;\n\t\t$_POST = array( 'field_one' => 'term' );\n\t\t$existing = new \\StdClass;\n\t\t$existing->name = 'Sluggo';\n\t\t\\WP_Mock::wpFunction('sanitize_text_field', array('times' => 1));\n\t\t\\WP_Mock::wpFunction(\n\t\t\t'get_term_by', \n\t\t\tarray('times' => 1, 'return' => $existing));\n\t\t\\WP_Mock::wpFunction('wp_set_object_terms', array( 'times' => 1 ) );\n\n\t\t// act\n\t\t$form->validate_taxonomyselect(1, $form->fields['field_one'], 'field_one');\n\n\t\t// Assert: test will fail if wp_set_object_terms, get_term_by or\n\t\t// sanitize_text_field do not fire or fire more than once\n\t}", "function acf_field_type_exists($type = '')\n{\n}", "public function isValid() {\n\t\t// check if page type is valid\n\t\ttry {\n\t\t\t$this->getAttribute('uid'); // getAttribute forces the object to be read from database\n\t\t\treturn true;\n\t\t} catch (tx_newspaper_EmptyResultException $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public function testPageValue() : void {\n\t\t$this->assertEquals('page', PostType::Page->value);\n\t}", "public function testGetPropertyGetPropertyMethod()\n {\n $lastname = 'Cornutt';\n $subject = new TestPropertySubject();\n $en = new Enforcer();\n\n $result = $en->getPropertyValue('lastname', $subject);\n $this->assertEquals($lastname, $result);\n }", "function __isset($property){\n return isset($this->sections[$property]);\n }", "public function testProperties(): void\n {\n $this->assertSame('FOOX', $this->validator->getAssertCode('X'));\n $this->assertSame(['a:foo', 'a:bar'], $this->validator->getPath());\n }", "function testShowProperty()\r\n {\r\n global $webUrl;\r\n global $lang, $SERVER, $DATABASE;\r\n \r\n // Turn to \"Operators\" page.\r\n\t\t$this->assertTrue($this->get(\"$webUrl/operators.php\", array(\r\n\t\t 'server' => $SERVER,\r\n\t\t\t\t\t 'database' => $DATABASE,\r\n\t\t\t\t\t 'schema' => 'public',\r\n\t\t\t\t\t 'subject' => 'schema'))\r\n\t\t\t\t );\r\n // Show the properties of the operator \"===\".\r\n $this->assertTrue($this->clickLink('==='));\r\n // Check the properties.\r\n $this->assertTrue($this->assertWantedText('areasel')); \r\n \r\n return TRUE;\r\n }", "public function existsShopifyProperty($propertyName)\n {\n return property_exists($this->shopifyData, $propertyName);\n }", "function get($property) {\n if (!empty($this->{$property})) {\n return $this->{$property};\n }\n else {\n return false;\n }\n }", "function _mongo_node_type_exists($entity_type) {\n $set = mongo_node_settings();\n if (isset($set[$entity_type])) {\n return TRUE;\n }\n\n return FALSE;\n}", "public function getTypeAttribute()\n {\n return $this->metaField->slug ?? null;\n }", "public function getProperty(): string;", "function getMetaTypeSingle($type) {\r\n foreach( $this->data['VenueMeta'] as $i => $row ) {\r\n if ( $row['meta_key'] == $type) {\r\n return $row['meta_value'];\r\n }\r\n }\r\n \r\n return false;\t\t\r\n\t}", "function wp_get_duotone_filter_property($preset)\n {\n }", "public function has_prop($key)\n {\n }", "private function isHasEntity($property){\n\t\tif(isset($this->columns[$property]) && \n\t\t(is_object($this->columns[$property]) OR is_array($this->columns[$property])) ){\n\t\t\treturn true;\t\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "abstract public function getPropertyShort();", "public function hasProperty($propertyName): bool;", "function testInvalidPropertyGet() {\n\t\t$o = new \\Scrivo\\UserRole(self::$context);\n\t\t$data = $o->sabicasElRey;\n\t}", "public function slug_hook($slug) {\n\t\t// return array('valid-slug'=>'[post->ID]');\n\t\treturn false;\n\t}", "public function test_canonical_meta()\n {\n\n $metaKey = action_plugin_webcomponent_metacanonical::CANONICAL_PROPERTY;\n $pageId = 'description:test';\n $canonicalValue = \"javascript:variable\";\n $text = DOKU_LF . '---json' . DOKU_LF\n . '{' . DOKU_LF\n . ' \"' . $metaKey . '\":\"' . $canonicalValue . '\"' . DOKU_LF\n . '}' . DOKU_LF\n . '---' . DOKU_LF\n . 'Content';\n saveWikiText($pageId, $text, 'Created');\n\n $canonicalMeta = p_get_metadata($pageId, $metaKey, METADATA_RENDER_UNLIMITED);\n /** @noinspection PhpUndefinedMethodInspection */\n $this->assertEquals($canonicalValue, $canonicalMeta);\n\n // It should never occur but yeah\n $canonicalValue = \"js:variable\";\n $text = DOKU_LF . '---json' . DOKU_LF\n . '{' . DOKU_LF\n . ' \"' . $metaKey . '\":\"' . $canonicalValue . '\"' . DOKU_LF\n . '}' . DOKU_LF\n . '---' . DOKU_LF\n . 'Content';\n saveWikiText($pageId, $text, 'Updated meta');\n $canonicalMeta = p_get_metadata($pageId, $metaKey, METADATA_RENDER_UNLIMITED);\n /** @noinspection PhpUndefinedMethodInspection */\n $this->assertEquals($canonicalValue, $canonicalMeta);\n\n // Do we have the description in the meta\n $request = new TestRequest(); // initialize the request\n $response = $request->get(array('id' => $pageId), '/doku.php');\n\n\n // Query\n $canonicalHrefLink = $response->queryHTML('link[rel=\"' . $metaKey . '\"]')->attr('href');\n $canonicalId = UrlCanonical::toDokuWikiId($canonicalHrefLink);\n /** @noinspection PhpUndefinedMethodInspection */\n $this->assertEquals($canonicalValue, $canonicalId, \"The link canonical meta should be good\");\n // Facebook: https://developers.facebook.com/docs/sharing/webmasters/getting-started/versioned-link/\n $canonicalHrefMetaOg = $response->queryHTML('meta[property=\"og:url\"]')->attr('content');\n /** @noinspection PhpUndefinedMethodInspection */\n $this->assertEquals($canonicalHrefLink, $canonicalHrefMetaOg, \"The meta canonical property should be good\");\n\n\n }", "public function get_value( $slug ) {\n\t\t$slug = unpapify( $slug );\n\t\t$value = papi_get_property_meta_value( $this->id, $slug, $this->get_type() );\n\n\t\treturn $this->convert( $slug, $value );\n\t}", "public function translate_property_types_attributes( $data ) {\n\n if( !empty( $data['wpp_settings'][ 'property_types' ] ) ) {\n\n $type_package = array(\n 'kind' => 'Property Types',\n 'name' => 'custom-types',\n 'title' => 'Property Types',\n );\n\n $types = $data['wpp_settings'][ 'property_types' ];\n\n $this->delete_strings_translation( $type_package, $types );\n\n foreach($types as $key => $type){\n do_action('wpml_register_string', $type , $key , $type_package , $type , 'LINE');\n }\n\n }\n\n if( !empty( $data['wpp_settings']['property_stats'] ) ) {\n\n $attributes_package = array(\n 'kind' => 'Property Attributes',\n 'name' => 'custom-attributes',\n 'title' => 'Property Attributes',\n );\n $attributes = $data['wpp_settings']['property_stats'];\n\n $this->delete_strings_translation( $attributes_package, $attributes );\n\n foreach($attributes as $key => $attibute){\n do_action('wpml_register_string', $attibute , $key , $attributes_package , $attibute , 'LINE');\n }\n\n }\n\n \n if( !empty( $data['wpp_settings']['property_meta'] ) ) {\n\n $meta_package = array(\n 'kind' => 'Property Meta',\n 'name' => 'custom-meta',\n 'title' => 'Property Meta',\n );\n $metas = $data['wpp_settings']['property_meta'];\n\n $this->delete_strings_translation( $meta_package, $metas );\n\n foreach($metas as $key => $meta){\n do_action('wpml_register_string', $meta , $key , $meta_package , $meta , 'LINE');\n }\n\n }\n\n // @todo: move it to 'WP-Property: Terms' plugin ( add-on ). peshkov@UD\n if( !empty( $data[ 'wpp_terms' ] ) ) {\n\n $terms_package = array(\n 'kind' => 'Property Term',\n 'name' => 'custom-term',\n 'title' => 'Property Term',\n );\n\n $wpp_terms = $data['wpp_terms']['taxonomies'];\n\n $this->delete_strings_translation( $terms_package, $wpp_terms );\n\n foreach($wpp_terms as $key => $term){\n do_action('wpml_register_string', $term['label'] , $key , $terms_package , $term['label'] , 'LINE');\n }\n\n }\n\n if( !empty( $data['wpp_settings']['property_groups'] ) ) {\n\n $groups_package = array(\n 'kind' => 'Property Groups',\n 'name' => 'custom-groups',\n 'title' => 'Property Groups',\n );\n $property_groups = $data['wpp_settings']['property_groups'];\n\n $this->delete_strings_translation( $groups_package, $property_groups );\n\n foreach($property_groups as $key => $group){\n do_action('wpml_register_string', $group['name'] , $key , $groups_package , $group['name'] , 'LINE');\n }\n\n }\n\n if( !empty( $data['wpp_settings']['predefined_values'] ) ) {\n\n $attributes_values_package = array(\n 'kind' => 'Property Attributes Values',\n 'name' => 'custom-attributes-value',\n 'title' => 'Property Attributes Values',\n );\n $attributes_values = $data['wpp_settings']['predefined_values'];\n\n $this->delete_strings_translation( $attributes_values_package, $attributes );\n\n foreach($attributes_values as $key => $value){\n if( $value ){\n do_action('wpml_register_string', $value , $key , $attributes_values_package , $value , 'LINE');\n }\n }\n\n }\n\n }", "public function isEmpty(string $property): bool {\n if (property_exists($this, $property)) {\n return !is_numeric($this->$property) && empty($this->$property);\n } else {\n return !array_key_exists($property, $this->_properties)\n || !is_numeric($this->_properties[$property]) && empty($this->_properties[$property]);\n }\n }", "public function hasType(){\n return !empty($this->type);\n }", "private function propertyExists($object, $propertyName){\r\n if($this->customPropertyExists($object, $this->propertyFormat($propertyName)) &&\r\n $this->existsGetterAndSetter($object, $this->propertyFormat($propertyName))){\r\n return true;\r\n }\r\n new CradleCoreException( $this->propertyFormat($propertyName) . ' is not a valid property name or does not has getter/setter functions');\r\n Logger::debug(' .... [ERROR] ' . $this->propertyFormat($propertyName) . ' is not a valid property name or does not has getter/setter functions');\r\n return false;\r\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if (!is_null($this->container['postProcessState']) && !preg_match(\"/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/\", $this->container['postProcessState'])) {\n $invalidProperties[] = \"invalid value for 'postProcessState', must be conform to the pattern /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.\";\n }\n\n if (!is_null($this->container['state']) && !preg_match(\"/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/\", $this->container['state'])) {\n $invalidProperties[] = \"invalid value for 'state', must be conform to the pattern /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.\";\n }\n\n if (!is_null($this->container['substate']) && !preg_match(\"/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/\", $this->container['substate'])) {\n $invalidProperties[] = \"invalid value for 'substate', must be conform to the pattern /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.\";\n }\n\n if (!is_null($this->container['type']) && !preg_match(\"/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/\", $this->container['type'])) {\n $invalidProperties[] = \"invalid value for 'type', must be conform to the pattern /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.\";\n }\n\n return $invalidProperties;\n }", "protected function getEntityByTypeAndProperty($entity_type, $bundle, $property, $value) {\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', $entity_type);\n $query->propertyCondition('type', $bundle);\n $query->propertyCondition($property, $value);\n $entities = $query->execute();\n Assertions::assertTrue(isset($entities['node']), 'node not found');\n Assertions::assertCount(1, $entities['node'], 'more than one node found');\n\n return node_load(key($entities['node']));\n }", "function is_exists_s_atribute_type_lookup($s_attribute_type, $value) {\n\t$query = \"SELECT 'x' FROM s_attribute_type_lookup WHERE s_attribute_type = '\" . $s_attribute_type . \"' AND value = '$value'\";\n\n\t$result = db_query($query);\n\tif ($result && db_num_rows($result) > 0) {\n\t\tdb_free_result($result);\n\t\treturn TRUE;\n\t}\n\n\t//else\n\treturn FALSE;\n}", "public function testSuccessIsTrue(): void\n {\n $this->assertTrue($this->get_reflection_property_value('success'));\n }", "public function exists(string $slug);", "public function hasStringField()\n {\n return $this->get(self::STRING_FIELD) !== null;\n }", "protected function getterFail(string $property): string\n {\n return \"'$property' property is not working properly.\";\n }", "public function getProperty(): ?string;", "protected function validate_property($value, $config)\n\t{\n\t\tif (is_string($value))\n\t\t{\n\t\t\t$value = $this->validate_string($value, $config);\n\t\t}\n\n\t\treturn $value;\n\t}" ]
[ "0.60809165", "0.60207325", "0.57763827", "0.56831014", "0.5593171", "0.5470052", "0.54696757", "0.5352478", "0.53359056", "0.5319894", "0.52798367", "0.527311", "0.5270982", "0.521053", "0.5179019", "0.5175034", "0.51738364", "0.5166209", "0.51640695", "0.5158692", "0.51580036", "0.5136821", "0.5135605", "0.5134968", "0.5120257", "0.51166046", "0.51035744", "0.50891185", "0.50779974", "0.50764835", "0.5075066", "0.5064349", "0.5051833", "0.5038098", "0.50297326", "0.5029114", "0.50229895", "0.50195175", "0.5008945", "0.5001619", "0.50008255", "0.49669665", "0.49633497", "0.49610093", "0.49398518", "0.49349946", "0.49241462", "0.49204844", "0.49174076", "0.49118504", "0.49114078", "0.49110377", "0.4908795", "0.4904607", "0.49017504", "0.49003312", "0.48956487", "0.4894228", "0.4875561", "0.4866052", "0.48652232", "0.4859935", "0.4858422", "0.48430812", "0.48428816", "0.48417008", "0.48385674", "0.48315102", "0.48283085", "0.48267084", "0.48187992", "0.48133168", "0.479964", "0.4798843", "0.4795069", "0.47872496", "0.47849363", "0.47762552", "0.47750637", "0.4766066", "0.4763148", "0.4756837", "0.47562462", "0.47560894", "0.47532645", "0.47530377", "0.47462586", "0.47462204", "0.47434762", "0.47357225", "0.4734802", "0.47346514", "0.47336987", "0.47319588", "0.4728322", "0.4726108", "0.47239318", "0.472008", "0.47192216", "0.47165433" ]
0.7268869
0
Test save property value.
public function test_save_property_value() { $handler = new Papi_Admin_Meta_Boxes(); // Create post data. $_POST = papi_test_create_property_post_data( array( 'slug' => $this->property->slug, 'type' => $this->property->type, 'value' => 'fredrik' ), $_POST ); // Save the property using the handler. $handler->save_property( $this->post_id ); // Test get the value with papi_field function. $expected = 'fredrik'; $actual = papi_field( $this->post_id, $this->property->slug ); $this->assertEquals( $expected, $actual ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSaveSuccess()\n {\n $this->assertTrue($this->location->save());\n }", "public function test_save()\n {\n // check no data\n $this->assertEquals(model_thehub_npos::get_table_stats()->count_all, 0);\n\n // load data\n $npo=helper_models::valid_npo();\n\n // assert\n $this->assertTrue($npo->is_new());\n\n $npo->save();\n $this->assertFalse($npo->is_new());\n $this->assertFalse($npo->is_active());\n\n $this->assertEquals(model_thehub_npos::get_table_stats()->count_all, 1);\n\n // toggle active stats\n $this->assertEquals(model_thehub_npos::get_table_stats()->count_deactive, 1);\n $this->assertEquals(model_thehub_npos::get_table_stats()->count_active, 0);\n\n $npo->set_active();\n $this->assertTrue($npo->is_active());\n $this->assertEquals(model_thehub_npos::get_table_stats()->count_deactive, 0);\n $this->assertEquals(model_thehub_npos::get_table_stats()->count_active, 1);\n\n $npo->set_active(False);\n $this->assertFalse($npo->is_active());\n\n // test updates\n $npo->save();\n $this->assertEquals(model_thehub_npos::get_table_stats()->count_all, 1);\n\n $npo->save();\n $this->assertEquals(model_thehub_npos::get_table_stats()->count_all, 1);\n }", "public function testSaveValue()\n {\n $faker = Factory::create();\n $data = [\n $faker->unixTime => $faker->sentence,\n ];\n $response = $this->json('POST', '/api/values', $data);\n $response\n ->assertStatus(201)\n ->assertJson($data);\n }", "public function testSave()\n {\n $change = Change::fetch('default');\n $change->setDescription('Test submit')\n ->save();\n }", "public function save($value) {\n return $this->setProperty('save', $value);\n }", "public function testItCanSaveANewProperty(): void\n {\n $this->browse(function (Browser $browser){\n $browser->pause(100);\n\n $property_type = factory(TipoPropiedad::class)->create(['estatus' => 1]);\n $lessor = factory(Lessor::class)->create(['estatus' => true]);\n $browser->loginAs(factory(User::class)->create())\n ->visit(route('finca.create'))\n ->on(new CreatePropertyPage())\n ->assertSee('Nuevo Inmueble');\n\n $browser->pause(50);\n\n $browser->type('name', $this->faker->name);\n $browser->type('geolocation', $this->faker->name);\n $browser->pause(50);\n $browser->selectLessor($lessor->id);\n $browser->pause(100);\n $browser->radio('recibo', Property::RECIBO_STRING_NO_FISCAL_VALUE);\n\n $browser->select('property_type_id', (string) $property_type->id_tipo_propiedad);\n\n// $browser->click('#search_lessor');\n// $browser->pause(400);\n// $browser->waitFor('#modal-arrendador', 10);\n// $browser->click('.item');\n// $browser->waitFor('input[name=address]', 10);\n// $browser->pause(5500);\n\n $browser->type('address', $this->faker->streetName);\n $browser->typeSlowly('maintenance', $this->faker->numerify('####'));\n $browser->typeSlowly('water_fee', $this->faker->numerify('####'));\n $browser->typeSlowly('energy_fee', $this->faker->numerify('####'));\n $browser->typeSlowly('water_account_number', $this->faker->numerify('####'));\n $browser->typeSlowly('predial', $this->faker->numerify('##################'));\n\n $browser->scrollTo('button[type=submit]');\n $browser->click('button[type=submit]');\n\n $browser->assertUrlIs(route('finca.index'));\n });\n }", "public function testExample()\n {\n\n $finduser = Profile::find(3);\n $finduser->fname ='Silmon';\n $finduser->save();\n $this->assertEquals('Silmon', $finduser->fname);\n }", "public function save()\n {\n // Given\n $entity = Test::createEntity();\n\n $sampleReturn = new \\StdClass;\n $sampleReturn->n = 1;\n $mock = \\Mockery::mock('Freddymu\\Phpnotif\\Models\\PhpNotifModel');\n $mock\n ->shouldReceive('save')\n ->andReturn([\n $sampleReturn\n ]);\n\n // When\n $result = $mock->save($entity->toArray());\n\n // Then\n self::assertEquals(1, $result[0]->n);\n }", "public function testTemperatureSaves()\n {\n $mockModel = Mockery::mock(new Temperature());\n $mockModel->shouldReceive('save')->andReturn(true);\n\n $temperatureRepository = new TemperatureRepository();\n $saved = $temperatureRepository->save($mockModel);\n\n $this->assertTrue($saved);\n }", "public function test_save() {\n global $DB;\n\n $this->resetAfterTest();\n\n // Create data object for default assignment settings.\n $data = new stdClass();\n $data->turnitinenabled = 1;\n $data->reportgenoptions['reportgeneration'] = TURNITINSIM_REPORT_GEN_DUEDATE;\n $data->queuedrafts = 1;\n $data->indexoptions['addtoindex'] = 0;\n $data->excludeoptions['excludequotes'] = 0;\n $data->excludeoptions['excludebiblio'] = 1;\n $data->accessoptions['accessstudents'] = 1;\n\n // Save Module Settings.\n $form = new plagiarism_turnitinsim_defaults_form();\n $form->save($data);\n\n // Check settings have been saved.\n $settings = $DB->get_record('plagiarism_turnitinsim_mod', array('cm' => 0));\n\n $this->assertEquals(1, $settings->turnitinenabled);\n $this->assertEquals(TURNITINSIM_REPORT_GEN_DUEDATE, $settings->reportgeneration);\n $this->assertEquals(1, $settings->queuedrafts);\n $this->assertEquals(0, $settings->addtoindex);\n $this->assertEquals(0, $settings->excludequotes);\n $this->assertEquals(1, $settings->excludebiblio);\n $this->assertEquals(1, $settings->accessstudents);\n }", "public function onSave()\n\t{\n\t\t$value = $this->getValue();\n\t\tif(!empty( $value ))\n\t\t{\n\t\t\treturn $this->getLookupTable()->set(\n\t\t\t\t $this->getValue(),\n\t\t\t\t $this->getValueObject()->getKey()\n\t\t\t ) > 0;\n\t\t}\n\t\treturn false;\n\t}", "public function save()\n {\n $temp = [];\n foreach ($this as $prop => $value) {\n $temp[$prop] = $value;\n }\n\n self::update($temp);\n if (isset($temp[(new static)->key])) {\n self::where((new static)->key, '=', $temp[(new static)->key]);\n }\n if (self::execute()->errno == 0) {\n return true;\n }\n return false;\n }", "public function testSave() {\n\t\t$operacionBuscar = new Operacion;\n\t\t$operacionBuscar->nombre = 'Actualizado';\n\t\t$this->assertEquals( count( $operacionBuscar->search()->getData() ), 0 );\n\t\n\t\t// guarda el operacion\n\t\t$operacion = new Operacion;\n\t\t$operacion->nombre = 'Actualizado';\n\t\t$operacion->save();\n\t\n\t\t$this->assertEquals( count( $operacionBuscar->search()->getData() ), 1 );\n\t}", "public function save(): bool;", "public function save(): bool;", "public function testSave()\n {\n $user = factory(\\App\\User::class)->make();\n\n $this->assertTrue($user->save());\n }", "public function testSave()\n {\n $class = $this->getModelClass();\n\n $model = $this->createModel();\n\n $model->save();\n\n $id = $model->getKey();\n\n // if the save was successful, you should be able to find new record in DB\n $model = $this->getModelInstance($id);\n\n $this->assertInstanceOf($class, $model);\n\n $this->modelAttributesTest($model);\n\n unset($model);\n }", "public function testQuestionSaving()\n {\n $question = new Question();\n \n $question->subject_id = 123;\n $question->question = \"Test 1\";\n //testing for question\n //testing for subject id \n $question->save();\n\n $this->assertEquals($question->question,\"Test 1\");\n //see in database\n $this->assertDatabaseHas('questions',['question'=>\"Test 1\"]);\n }", "public function test_save() {\n global $DB;\n self::setAdminUser();\n $this->resetAfterTest(true);\n\n // Save new outage.\n $now = time();\n $outage = new outage([\n 'autostart' => false,\n 'warntime' => $now - 60,\n 'starttime' => 60,\n 'stoptime' => 120,\n 'title' => 'Title',\n 'description' => 'Description',\n ]);\n $outage->id = outagedb::save($outage);\n self::$outage = $outage;\n\n // Check existance.\n self::$event = $DB->get_record_select(\n 'event',\n \"(eventtype = 'auth_outage' AND instance = :idoutage)\",\n ['idoutage' => self::$outage->id],\n 'id',\n IGNORE_MISSING\n );\n self::assertTrue(is_object(self::$event));\n }", "public function testSave()\n {\n // save to cache\n $saveSearchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setFieldList(['id', 'name'])\n ->setIdName('id')\n ->build();\n\n $data = [['id' => 50, 'name' => 'Sergii']];\n\n $actualSave = $this->cacheManager->save($saveSearchCriteria, $data);\n $this->assertTrue($actualSave);\n }", "public function testSetValue()\n {\n $this->todo('stub');\n }", "public function testSetGetValue()\n {\n $value = new UploadValueStructure();\n $same = $this->uut->setValue($value);\n $this->assertSame($this->uut, $same);\n $this->assertSame($value, $this->uut->getValue());\n }", "function test_save()\n {\n\n //Arrange\n $id = null;\n $description = \"Wash the dog\";\n $test_task = new Task($description, $id);\n\n //Act\n $test_task->save();\n\n //Assert\n $result = Task::getAll();\n $this->assertEquals($test_task, $result[0]);\n\n }", "public function testSave() {\n\t\t$temaBuscar = new Tema;\n\t\t$temaBuscar->nombre = 'Prueba';\n\t\t$this->assertEquals( count( $temaBuscar->search()->getData() ), 0 );\n\t\n\t\t// guarda el tema\n\t\t$tema = new Tema;\n\t\t$tema->nombre = 'Prueba';\n\t\t$tema->responsable = 1;\n\t\t$tema->save();\n\t\n\t\t$this->assertEquals( count( $temaBuscar->search()->getData() ), 1 );\n\t}", "public function save()\n {\n return FALSE;\n }", "public function testValueValidationForUpdate()\n {\n $eavValue = $this->getEavValueRepo()->findOneBy(['value' => 'customer_invoice']);\n\n $this->assertNotNull($eavValue);\n\n $eavValue->setValue('not_existing_type');\n\n $this->em->persist($eavValue);\n\n try {\n $this->em->flush();\n } catch (\\Exception $e) {\n $this->assertInstanceOf(EavDocumentValidationException::class, $e);\n }\n\n $violations = $eavValue->getDocument()->getLastViolations();\n\n $this->assertCount(1, $violations);\n }", "public function testMetaPersist()\n\t{\n\t\t$bean = R::dispense( 'bean' );\n\t\t$bean->property = 'test';\n\t\t$bean->setMeta( 'meta', 'hello' );\n\t\tR::store( $bean );\n\t\tasrt( $bean->getMeta( 'meta' ), 'hello' );\n\t\t$bean = $bean->fresh();\n\t\tasrt( $bean->getMeta( 'meta' ), NULL );\n\t}", "public function testIsValidSuccessWithInvokedSetter()\n {\n $this->_object->expects($this->once())->method('hasDataChanges')->will($this->returnValue(true));\n $this->_object->expects($this->once())->method('getData')->with('attr1')->will($this->returnValue(1));\n $this->_object->expects($this->once())->method('getOrigData')->with('attr1')->will($this->returnValue(1));\n\n $validator = new \\Magento\\Framework\\Validator\\Entity\\Properties();\n $validator->setReadOnlyProperties(['attr1']);\n $this->assertTrue($validator->isValid($this->_object));\n }", "public function save($model, $value)\n\t{\n\t\treturn ($value) ? $this->true : $this->false;\n\t}", "final public function newlySetValueIsReturnedWithGetValue(): void\n {\n $dataType = new DataTypeMock();\n $this->assertTrue($dataType->isEqual(null));\n\n $someObject = new stdClass();\n $dataType->setValue($someObject);\n $this->assertTrue($dataType->isEqual($someObject));\n }", "public function testGetValue() : void\n {\n $instance = $this->createEmptyInstance();\n\n $value = new \\stdClass();\n\n $this->setValue($instance, 'value', $value);\n\n $this->getTestCase()->assertSame($value, $instance->getValue());\n }", "public function testSaveShouldWorkAndBumpTimestampAndTheDirtyFlagShouldWork()\n\t{\n\t\t$result = cms_orm('test_orm_table')->find();\n\t\t$old_timestamp = $result->modified_date->timestamp();\n\t\t$result->save();\n\t\t$result = cms_orm('test_orm_table')->find();\n\t\t$this->assertEqual($old_timestamp, $result->modified_date->timestamp());\n\t\t\n\t\t#Once with\n\t\t$old_timestamp = $result->modified_date->timestamp();\n\t\t$result->test_field = 'test10';\n\t\t$result->save();\n\t\t$result = cms_orm('test_orm_table')->find();\n\t\t$this->assertNotEqual($old_timestamp, $result->modified_date->timestamp());\n\t\t$this->assertEqual('test10', $result->test_field);\n\t}", "public function testSaveNullValues() {\r\n // Create record\r\n $po = new test_persistence_AbstractPersistenceAdapterTestPersistentObject();\r\n $po->booleanValue = null;\r\n $po->intValue = null;\r\n $po->stringValue = null;\r\n // Store new record\r\n $this->getPersistenceAdapter()->save($po);\r\n // Get record back from database\r\n $result = $this->executeQuery('select * from POTEST where UUID=\\''.$po->uuid.'\\'');\r\n // Records must be unique\r\n $this->assertEquals($po->booleanValue, (bool)$result[0]['BOOLEAN_VALUE'], 'Boolean value from database differs from the boolean value of the persistent object.');\r\n $this->assertEquals($po->intValue, intval($result[0]['INT_VALUE']), 'Integer value from database differs from the int value of the persistent object.');\r\n $this->assertEquals($po->stringValue, $result[0]['STRING_VALUE'], 'String value from database differs from the string value of the persistent object.');\r\n }", "function testVerifyAndSaveExpectsSuccess() {\n\t\t// arrange\n\t\t$factory = $this->getMockBuilder('TestNumberField')\n\t\t\t\t\t\t->setMethods( array( 'validate', 'delete_old_data' ) )\n\t\t\t\t\t\t->getMock();\n\t\t$factory->fields['field_one']['old_key'] = $factory->fields['field_one']['key'];\n\t\t$factory->expects($this->once())\n\t\t\t\t->method('validate')\n\t\t\t\t->will($this->returnValue(null));\n\t\t// act\n\t\t$factory->validate_and_save( 1 );\n\t}", "public function testIsModelSavingDataToDatabase()\n {\n $modelId = $this->saveTestData();\n $newModel = $this->model->load($modelId);\n $testData = $this->getTestData();\n $newModelData = [];\n foreach (array_keys($testData) as $key) {\n $newModelData[$key] = $newModel->getData($key);\n }\n $this->assertEquals($testData, $newModelData);\n }", "public function testSave() {\n\n try\n {\n $object3 = new EdaCulturas();\n\n $object3->setNombre('en_US');\n $object3->setDescripcion('USA');\n\n\n $this->assertEquals(1, $object3->save());\n\n $this->assertNull($object3->delete());\n\n }catch (Exception $e)\n {\n throw $e;\n }\n\n }", "public function testSaveUpdate()\n {\n $city = $this->existing_city;\n\n // set string properties to \"updated <property_name>\"\n // set numeric properties to strlen(<property_name>)\n foreach (get_object_vars($city) as $key => $value) {\n if ($key !== 'id' && $key != 'created') {\n if (is_string($value)) {\n $city->$key = \"updated \".$key;\n } elseif (is_numeric($value)) {\n $city->$key = strlen($key);\n }\n }\n }\n\n // update the city\n $city->save();\n\n // go get the updated record\n $updated_city = new City($city->id);\n // check the properties of the updatedCity\n foreach (get_object_vars($updated_city) as $key => $value) {\n if ($key !== 'id' && $key != 'created') {\n if (is_string($city->$key)) {\n $this->assertEquals(\"updated \".$key, $value);\n } elseif (is_numeric($city->$key)) {\n $this->assertEquals(strlen($key), $value);\n }\n }\n }\n }", "public function sanitizeValueOnSave(): bool\n {\n return true;\n }", "public function testSetGetValue()\n {\n $value = new ScalarValue('foo');\n $same = $this->uut->setValue($value);\n $this->assertSame($this->uut, $same);\n $this->assertEquals($value, $this->uut->getValue());\n }", "public function testInsertValidProperty() : void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"property\");\n\n\t\t//make a valid property uuid\n\t\t$propertyId = generateUuidV4();\n\n\t\t//make a new property with valid entries\n\t\t$property = new Property($propertyId, $this->VALID_PROPERTYCITY, $this->VALID_PROPERTYCLASS, $this->VALID_PROPERTYLATITUDE, $this->VALID_PROPERTYLONGITUDE, $this->VALID_PROPERTYSTREETADDRESS, $this->VALID_PROPERTYVALUE);\n\n\t\t//insert property\n\t\t$property->insert($this->getPDO());\n\n\t\t//grab dah data from mySQL and check that the fields match our expectations\n\t\t$pdoProperty = Property::getPropertyByPropertyId($this->getPDO(), $property->getPropertyId());\n\t\t$this->assertEquals($numRows +1, $this->getConnection()->getRowCount(\"property\"));\n\t\t$this->assertEquals($pdoProperty->getPropertyId()->toString(), $propertyId->toString());\n\t\t$this->assertEquals($pdoProperty->getPropertyCity(), $this->VALID_PROPERTYCITY);\n\t\t$this->assertEquals($pdoProperty->getPropertyClass(), $this->VALID_PROPERTYCLASS);\n\t\t$this->assertEquals($pdoProperty->getPropertyLatitude(), $this->VALID_PROPERTYLATITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyLongitude(), $this->VALID_PROPERTYLONGITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyStreetAddress(), $this->VALID_PROPERTYSTREETADDRESS);\n\t\t$this->assertEquals($pdoProperty->getPropertyValue(), $this->VALID_PROPERTYVALUE);\n\t}", "public function testPropertyValue($value)\n {\n $object = new Warning();\n $object->setValue($value);\n\n $this->assertEquals($value, $object->getValue());\n }", "function testSave()\n {\n //Arrange\n $business_name=\"Apple\";\n $business_phone= \"5033133131\";\n $business_contact = \"john\";\n $business_website = \"walkins.com\";\n $business_address =\"123 fake st\";\n $business_contact_email = \"me@fakeemail.com\";\n $id= 1;\n $test_business = new Business ($business_name, $business_phone, $business_contact, $business_website, $business_address, $business_contact_email, $id = null);\n\n //Act\n $test_business->save();\n // var_dump($test_business);\n\n //Assert\n $result = Business::getAll();\n // var_dump($result);\n $this->assertEquals($test_business, $result[0]);\n }", "public function saveField($value) {\n return $this->setProperty('saveField', $value);\n }", "public function saveField($value) {\n return $this->setProperty('saveField', $value);\n }", "public function testSuccessIsTrue(): void\n {\n $this->assertTrue($this->get_reflection_property_value('success'));\n }", "public function testSetValideMob() {\n\n $obj = new PointBonTrav();\n\n $obj->setValideMob(true);\n $this->assertEquals(true, $obj->getValideMob());\n }", "public function testShouldValidateSaveMessage ()\n {\n $this->entity->setDsSubject('assunto teste');\n\n $this->_setUser();\n\n $this->business->_validateSave($this->entity);\n }", "public function testSave ()\n {\n $user = new \\Core\\UserBundle\\Business\\UserBusiness($this->_container);\n\n $this->entity->setDsMessage('Message');\n $this->entity->setDsSubject('Subject');\n $this->entity->setUser($user->findOne());\n $this->business->save($this->entity);\n\n $this->assertInstanceOf(get_class($this->entity), $this->entity);\n }", "public\tfunction\tsave()\n\t\t{\n\t\t}", "public function testProjectAssignmentsSave()\n {\n }", "public function save(SettingModel $settingModel): bool;", "public function assertSaveDefaults() {\n\t\t\t$this->set('emailSectionID', NULL, false);\n\t\t\t$this->set('dateAdded', 'NOW()', false);\n\t\t\t$this->enclose('dateAdded', false);\n\t\t\t$this->set('lastModified', 'NOW()', false);\n\t\t\t$this->enclose('lastModified', false);\n\t\t}", "public function testGetAndSetSetting()\n {\n $this->assertEquals(0, $this->fixture->getSetting('foo'));\n\n $this->fixture->setSetting('foo', 'bar');\n\n $this->assertEquals('bar', $this->fixture->getSetting('foo'));\n }", "function test_save()\n {\n //Arrange\n $brand_name = \"Nike\";\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n\n $brand_name2 = \"Adidas\";\n $test_brand2 = new Brand($brand_name2);\n $test_brand2->save();\n\n //Act\n $result = Brand::getAll();\n\n //Assert\n $this->assertEquals($test_brand, $result[0]);\n }", "public function testIsValidSuccessWithoutInvokedSetter()\n {\n $validator = new \\Magento\\Framework\\Validator\\Entity\\Properties();\n $this->assertTrue($validator->isValid($this->_object));\n }", "public function testSetValueProperty() {\n // Test Date::setValue() with a date+time field.\n // Test a date+time field.\n $this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATETIME);\n $this->fieldStorage->save();\n $entity = EntityTest::create();\n $value = '2014-01-01T20:00:00';\n\n $entity->set('field_datetime', $value);\n $this->entityValidateAndSave($entity);\n // Load the entity and ensure the field was saved correctly.\n $id = $entity->id();\n $entity = EntityTest::load($id);\n $this->assertEquals($value, $entity->field_datetime[0]->value, '\"Value\" property can be set directly.');\n $this->assertEquals(DateTimeItemInterface::STORAGE_TIMEZONE, $entity->field_datetime->date->getTimeZone()->getName());\n\n // Test Date::setValue() with a date-only field.\n // Test a date+time field.\n $this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATE);\n $this->fieldStorage->save();\n $entity = EntityTest::create();\n $value = '2014-01-01';\n\n $entity->set('field_datetime', $value);\n $this->entityValidateAndSave($entity);\n // Load the entity and ensure the field was saved correctly.\n $id = $entity->id();\n $entity = EntityTest::load($id);\n $this->assertEquals($value, $entity->field_datetime[0]->value, '\"Value\" property can be set directly.');\n $this->assertEquals(DateTimeItemInterface::STORAGE_TIMEZONE, $entity->field_datetime->date->getTimeZone()->getName());\n }", "public function testSetSexe() {\n\n $obj = new Employes();\n\n $obj->setSexe(\"sexe\");\n $this->assertEquals(\"sexe\", $obj->getSexe());\n }", "function testSaveConfigFile(){\n\t\t\techo \"testing magratheaConfig saving a config file... <br/>\";\n\t\t\t$confs = array(\"config_test\" => \"ok\", \n\t\t\t\t\"config_test2\" => \"another_ok\" );\n\t\t\t$this->magConfig->setConfig($confs);\n\t\t\t$this->magConfig->Save(false);\n\t\t\t$this->assertTrue(file_exists($this->configPath.\"test_conf.conf\"));\n\t\t}", "public function testGetPeopertyValueMethod()\n {\n $firstname = 'Chris';\n $subject = new TestPropertySubject();\n $en = new Enforcer();\n\n $result = $en->getPropertyValue('firstname', $subject);\n $this->assertEquals($firstname, $result);\n }", "function TestSave_send_getState2(){\n \t$newAnswer = new Answer();\n \t$answerArray = array(array(\"elementId\" => 1, \"value\" => \"15\"), array(\"elementId\" => 2, \"value\" => \"0\"), array(\"elementId\" => 2, \"value\" => \"56\"), array(\"elementId\" => 2, \"value\" => \"29\"));\n \t$newAnswer->setAnswers($answerArray);\n \t$newAnswer->setRecipient(new User(1));\n \t$newAnswer->setFormId(4);\n \t$newAnswer->save();\n \t$newFormId = $newAnswer->getId();\n \t$newAnswer = new Answer($newFormId);\n \t$newAnswer->send();\n \t$this->assertEqual($newAnswer->getState(), TRUE);\n }", "public function testSet()\n {\n $object = new \\Webaholicson\\Minimvc\\Core\\Object(['test' => true]);\n $this->assertTrue($object->get('test'));\n $this->assertSame($object, $object->set('test', false));\n $this->assertFalse($object->get('test'));\n $object->set(['node' => ['test' => false]]);\n $this->assertContains(false , $object->get('node'));\n }", "public function testFilterSave()\n {\n $searchName = 'search' . uniqid();\n\n $this->visit('/')\n ->click('Login')\n ->seePageIs('/login')\n ->type('test+normal@example.ex', '#email')\n ->type('password123', '#password')\n ->click('#login-button');\n $this->visit('/properties')\n ->type('the', '#keywords')\n ->press('Update results')\n ->see('Shack in the desert')\n ->see('Victorian townhouse');\n $this->type($searchName, '#searchName')\n ->press('Save search');\n $this->visit('/properties/searches')\n ->see($searchName)\n ->press('#search-' . md5($searchName));\n $this->see('Shack in the desert')\n ->see('Victorian townhouse');\n $this->notSee('Five bedroom mill conversion');\n }", "public final function save()\n {\n }", "protected function save($property) {\n\t\t/** @var \\Interfaces\\Shared\\Database $database */\n\t\t$database = $this->dependence_objects['database'];\n\t\tif ($property) {\n\t\t\t$connection = $database->getConnection();\n\t\t\t$connection->exec('UPDATE config SET '.$property.' = \\''.$connection->escapeString($this->$property).'\\'');\n\t\t\t$this->initialize();\n\t\t}\n\t}", "public function testUpdateValidProperty() : void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"property\");\n\n\t\t//make a valid property uuid\n\t\t$propertyId = generateUuidV4();\n\n\t\t//make a new property with valid entries\n\t\t$property = new Property($propertyId, $this->VALID_PROPERTYCITY, $this->VALID_PROPERTYCLASS, $this->VALID_PROPERTYLATITUDE, $this->VALID_PROPERTYLONGITUDE, $this->VALID_PROPERTYSTREETADDRESS, $this->VALID_PROPERTYVALUE);\n\n\t\t//insert property\n\t\t$property->insert($this->getPDO());\n\n\t\t//edit the property and update it in MySQL\n\t\t$property->setPropertyValue($this->VALID_PROPERTYVALUE2);\n\t\t$property->update($this->getPDO());\n\n\t\t//grab dah data from mySQL and check that the fields match our expectations\n\t\t$pdoProperty = Property::getPropertyByPropertyId($this->getPDO(), $property->getPropertyId());\n\t\t$this->assertEquals($numRows +1, $this->getConnection()->getRowCount(\"property\"));\n\t\t$this->assertEquals($pdoProperty->getPropertyId()->toString(), $propertyId->toString());\n\t\t$this->assertEquals($pdoProperty->getPropertyCity(), $this->VALID_PROPERTYCITY);\n\t\t$this->assertEquals($pdoProperty->getPropertyClass(), $this->VALID_PROPERTYCLASS);\n\t\t$this->assertEquals($pdoProperty->getPropertyLatitude(), $this->VALID_PROPERTYLATITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyLongitude(), $this->VALID_PROPERTYLONGITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyStreetAddress(), $this->VALID_PROPERTYSTREETADDRESS);\n\t\t$this->assertEquals($pdoProperty->getPropertyValue(), $this->VALID_PROPERTYVALUE2);\n\t}", "public function test_field_has_correct_value_attribute_when_changed()\n {\n $this->Field->attributes->value = $this->test_value;\n $dom = HtmlDomParser::str_get_html($this->Field->makeView()->render());\n $input = current($dom->find('input'));\n\n // A password field should never have a value even if one is set.\n $this->assertSame(true, $input->value);\n }", "public function save()\n {\n Logger::getInstance()->po_log(\"PO:save \" . get_class($this));\n\n if (!$this->validate(true)) return false;\n \n //Logger::getInstance()->po_log(\"PO:save post validate\");\n\n $this->executeBeforeSave();\n\n //Logger::getInstance()->on();\n try\n {\n //Logger::getInstance()->po_log(\"PO:save BEGIN\");\n $pm = PersistentManager::getInstance();\n $pm->withTransaction();\n $pm->save($this);\n $pm->commitTransaction();\n //Logger::getInstance()->po_log(\"PO:save COMMIT\");\n }\n catch(Exception $e)\n {\n // TODO: log de $e\n Logger::getInstance()->po_log(\"PO:save ROLLBACK \". $e->getMessage() .\" <pre>\". $e->getTraceAsString() .\"</pre>\");\n \n $pm->rollbackTransaction();\n return false;\n }\n //Logger::getInstance()->off();\n\n $this->executeAfterSave();\n \n // Validacion\n return true;\n }", "public final function save() {\n }", "function testValueForTrue(){\n $this->assertTrue(true);\n }", "function testSaveConfigFile(){\n\t\tTestsHelper::Print(\"testing magratheaConfig saving a config file...\");\n\t\t$confs = array(\"config_test\" => \"ok\", \n\t\t\t\"config_test2\" => \"another_ok\" );\n\t\t$this->magConfig->setConfig($confs);\n\t\t$this->magConfig->Save(false);\n\t\t$this->assertTrue(file_exists($this->configPath.\"/\".$this->fileName));\n\t}", "public function testDocumentIntegrityAfterValueInsertion()\n {\n $eavAttribute = $this->getEavAttrRepo()->findOneBy(['name' => 'supplierId']);\n\n $this->assertNotNull($eavAttribute);\n\n $eavDocument = $this->getEavDocumentRepo()->findOneBy(['path' => 'some/path/to/bucket/document1.pdf']);\n\n $this->assertNotNull($eavDocument);\n\n $eavValue = new EavValue();\n $eavValue->setAttribute($eavAttribute);\n $eavValue->setDocument($eavDocument);\n $eavValue->setValue(1234);\n $this->em->persist($eavValue);\n\n try {\n $this->em->flush();\n } catch (\\Exception $e) {\n $this->assertInstanceOf(EavDocumentValidationException::class, $e);\n }\n\n $violations = $eavValue->getDocument()->getLastViolations();\n\n $this->assertCount(1, $violations);\n $this->assertContains('supplierId', (string) $violations);\n }", "public function save()\n\t{\n\t\treturn false;\n\t}", "public function save()\n\t{\n\n\t}", "public function save()\n {\n try {\n $testRunCache = new CTM_Test_Run_Cache();\n $testRun = $testRunCache->getById($this->testRunId);\n\n if ( $testRun->testRunStateId == $this->testRunStateId ) {\n // if the state is already set save the trouble of the save()\n } else if ( $testRun->testRunStateId == 5 ) {\n // If the test run has failed we cannot undo a failure.\n } else {\n $testRun->testRunStateId = $this->testRunStateId;\n $testRun->save();\n }\n\n } catch ( Exception $e ) {\n }\n\n // do the default save method.\n return parent::save();\n }", "public function testGettersAndSetters()\n {\n $this->phone->setType('phone');\n $this->assertEquals('phone', $this->phone->getType());\n\n $this->phone->setValue('059 70 22 85');\n $this->assertEquals('059 70 22 85', $this->phone->getValue());\n }", "public function saveTestMode($test_mode = true) {\n $this->test_mode = $test_mode;\n\n return $this->save();\n }", "public function Save()\r\n {\r\n return false;\r\n }", "public function testModelProperty($tester)\n {\n expect($tester->id_tarea_programada)->equals('Ingresar valor de pruebas para el campo id_tarea_programada de tipo int4');\n expect($tester->nom_tarea_programada)->equals('Ingresar valor de pruebas para el campo nom_tarea_programada de tipo varchar');\n expect($tester->fecha_inicio)->equals('Ingresar valor de pruebas para el campo fecha_inicio de tipo date');\n expect($tester->fecha_termina)->equals('Ingresar valor de pruebas para el campo fecha_termina de tipo date');\n expect($tester->fecha_proxima_eje)->equals('Ingresar valor de pruebas para el campo fecha_proxima_eje de tipo date');\n expect($tester->intervalo_ejecucion)->equals('Ingresar valor de pruebas para el campo intervalo_ejecucion de tipo int4');\n expect($tester->numero_ejecucion)->equals('Ingresar valor de pruebas para el campo numero_ejecucion de tipo int4');\n }", "public function testModelProperty($tester)\n {\n expect($tester->id_proceso)->equals('Ingresar valor de pruebas para el campo id_proceso de tipo int4');\n expect($tester->nom_proceso)->equals('Ingresar valor de pruebas para el campo nom_proceso de tipo varchar');\n expect($tester->id_tproceso)->equals('Ingresar valor de pruebas para el campo id_tproceso de tipo int4');\n expect($tester->id_modulo)->equals('Ingresar valor de pruebas para el campo id_modulo de tipo int4');\n expect($tester->url_datos_basicos)->equals('Ingresar valor de pruebas para el campo url_datos_basicos de tipo varchar');\n }", "public function testSuccessIsTrue(): void\n {\n $this->get_accessible_reflection_property('success');\n $this->assertTrue($this->get_reflection_property_value('success'));\n }", "public function save($name,$value) { \r\n \r\n $this->finalizeSaving($name, $value);\r\n }", "public function save()\n {\n $success = $this->obj->save();\n\n if (! $success)\n {\n if ($this->obj->valid)\n {\n $this->_set_error('Failed to save data!');\n }\n else\n {\n //Validation error\n $this->_set_error();\n }\n }\n\n return $success;\n }", "public function save()\n {\n // For V2.0\n }", "public function save($model, $value, $loaded);", "public function save()\r\n {\r\n \r\n }", "public function testModify()\n {\n $user = User::factory()->create();\n $old_name = $user->name;\n $old_email = $user->email;\n\n $user->name = 'David';\n $user->email = 'david@gmail.com';\n $update = $user->save();\n\n $this->assertTrue($update);\n $this->assertNotEquals($old_name, $user->name);\n $this->assertNotEquals($old_email, $user->email);\n }", "public function save()\n {\n $this->checkModel();\n if (!is_null($this->profile)) $this->saved = $this->profile->save();\n }", "function beforesave(){\n\t\t// if it returns true, the item will be saved; if it returns false, it won't\n\t\treturn true;\n\t}", "public function save()\n {\n return false;\n }", "public function save() {\n\t\t\t\n\t\t}", "public function testPersistence()\n\t{\n\t\t// $factory->depot_id = $this->depot->depot_id;\n\t\t// $factory->factory_type_id = $this->factoryType->factory_type_id;\n\t\t// $factory->save();\n\n\t\t// $this->assertTrue(Factory::findOne($factory->depot_id) !== null);\n\n\t\t// $factory->remarks = \"Remarks\";\n\t\t// $factory->save();\n\n\t\t// $this->assertTrue(Factory::findOne($factory->depot_id)->remarks == 'Remarks');\n\n\t\t// $factoryId = $factory->depot_id;\n\t\t// $factory->delete();\n\n\t\t// $this->assertTrue(Factory::findOne($factoryId) === null);\n\t}", "public function save()\n {\n $this->setData(array(\n 'modified' => time(),\n 'modifiedReadable' => Zend_Date::now()->get(Zend_Date::ISO_8601)\n ));\n \n $unmappedData = $this->getBean()->asDeepArray(true);\n if(key_exists('_id', $unmappedData)) {\n unset($unmappedData['_id']);\n }\n\n if (!($id = $this->_save($unmappedData, $this->getId()))) {\n return false;\n }\n\n $this->_setId($id);\n \n return true;\n }", "public function isPersisted() {}", "public function save() {}", "public function save() {}", "public function save() {}", "public function getChangeValueTest(): bool\n {\n return $this->changeTest;\n }", "public function testPreSave()\n {\n $this->todo('stub');\n }", "public function save();", "public function save();" ]
[ "0.6770797", "0.6706521", "0.6567234", "0.64472395", "0.64209807", "0.6383227", "0.6312883", "0.62892836", "0.62815577", "0.62499183", "0.6211984", "0.6169203", "0.6169164", "0.61611307", "0.61611307", "0.60972935", "0.6089489", "0.60835403", "0.60511506", "0.6028013", "0.60259134", "0.60059875", "0.59615105", "0.5960776", "0.5931549", "0.59298027", "0.59218115", "0.5913105", "0.5905748", "0.59041303", "0.590062", "0.5895425", "0.5871259", "0.5869195", "0.58642554", "0.5860458", "0.5847386", "0.5845669", "0.58152384", "0.58132416", "0.580767", "0.58070606", "0.580125", "0.580125", "0.5799005", "0.57923555", "0.5776379", "0.5770217", "0.576314", "0.5759282", "0.57552874", "0.5747687", "0.5742917", "0.5741518", "0.5737975", "0.5732882", "0.57253027", "0.5725178", "0.57173705", "0.5716879", "0.57136273", "0.57055134", "0.5703527", "0.5699986", "0.569262", "0.568427", "0.56820494", "0.568096", "0.56797427", "0.5675734", "0.56746113", "0.56711763", "0.56603056", "0.5654172", "0.5652502", "0.56495", "0.5641188", "0.56401134", "0.5637916", "0.5632801", "0.5621124", "0.56162834", "0.56128305", "0.5608478", "0.55996037", "0.5597467", "0.559484", "0.5585777", "0.5582707", "0.55819225", "0.55817837", "0.5578799", "0.5576734", "0.55767155", "0.55767155", "0.55755615", "0.55707407", "0.5560612", "0.55570614", "0.55570614" ]
0.76822907
0
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446737", "0.73625076", "0.7300871", "0.72476006", "0.7163127", "0.7149414", "0.7131995", "0.7105663", "0.7102927", "0.7101388", "0.704981", "0.69946545", "0.69897777", "0.6935023", "0.690029", "0.68989694", "0.68925905", "0.68878543", "0.6866467", "0.6849924", "0.6829784", "0.68033314", "0.67971504", "0.6796001", "0.6786942", "0.6760321", "0.6743112", "0.6730776", "0.67266184", "0.67259544", "0.67259544", "0.67259544", "0.671818", "0.670783", "0.670644", "0.6704464", "0.6665842", "0.6663898", "0.6660563", "0.6660198", "0.6657512", "0.6654405", "0.6648237", "0.6620824", "0.6619237", "0.6618058", "0.66072917", "0.660077", "0.6600677", "0.6594786", "0.6587929", "0.65850085", "0.65824693", "0.6581521", "0.6577045", "0.6574634", "0.65729445", "0.65715027", "0.6570646", "0.6565125", "0.6563328", "0.6553843", "0.6553201", "0.6545921", "0.6537198", "0.6534121", "0.6533748", "0.65272135", "0.6526431", "0.6525868", "0.6519198", "0.65185314", "0.6517867", "0.65170157", "0.651509", "0.65070677", "0.6505637", "0.65033627", "0.6494597", "0.6492147", "0.64880013", "0.64871716", "0.6485315", "0.6485215", "0.64790684", "0.64767736", "0.64725083", "0.64709103", "0.64702755", "0.6466392", "0.64618254", "0.646148", "0.64601135", "0.6458744", "0.64543813", "0.64537513", "0.64530194", "0.6450726", "0.64492655", "0.6449169", "0.64466155" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $request->validate([ 'msg' => 'required|string', 'chat' => 'required|numeric' ]); Mensaje::create([ 'usuario_id' => \Auth::user()->id, 'chat_id' => $request->chat, 'mensaje' => $request->msg, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { $chat = Chat::where('empresa_id', \Auth::user()->id) ->orWhere('persona_id', \Auth::user()->id) ->findOrFail($id); return $chat->mensaje->where('id', '>', request()->last)->each(function ($m) { $m->date = [ $m->created_at->format('Y'), $m->created_at->format('m') - 1, $m->created_at->format('d'), $m->created_at->format('H'), $m->created_at->format('i'), $m->created_at->format('s'), ]; $usuario = $m->usuario->fullName(); $m->logo = $m->usuario->getLogoPath(); unset($m->usuario, $m->chat_id); $m->usuario = $usuario; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Store comment to database.
public static function postStore() { if ( checkSpammer() ) { $error = ['spam' => true, 'message' => 'Sorry spammer! You are not allowed to leave coments.']; echo json_encode($error); exit; } $message = ''; $messageType = 'danger'; /** * Try to create new customer with POST input data. */ try { $postId = $_POST['post_id']; $commentData = [ 'post_id' => $postId, 'name' => $_POST['name'], 'email' => $_POST['email'], 'message' => $_POST['message'], ]; $newComment = new Comment(); $newComment->create($commentData); } catch (Exception $e) { throw new InvalidArgumentException($e->getMessage()); } /** * If during customer create has been as error, such as validation, assign them to $message. */ if ($newComment->hasError()) { foreach ($newComment->getErrors() as $error) { $message .= " - " . $error . "<br>"; } } else { $_SESSION['messageType'] = 'error'; $_SESSION['message'] = $message; } if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { echo json_encode($newComment); } else { $_SESSION['messageType'] = 'success'; $_SESSION['message'] = 'Comment was successfully created.'; header('Location: /show?id='. $postId); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function commentStore() {\n\t\t$post_id = $_POST['post_id'];\n\t\t$text = $_POST['text'];\n\t\t$comment = new Comment([$post_id, $text]);\n\t\t$comment->save();\n\t}", "public function storeCommentInDB(Comment $comment){\n $query = $this->connect->prepare(\"INSERT INTO `\".self::TABLE_NAME.\"` VALUES('', ?, ?, ?, ?)\");\n $query->bind_param(\"ssss\",\n $this->escape_string($comment->getUserID()),\n $this->escape_string($comment->getDate()),\n $this->escape_string($comment->getCommentMsg()),\n $this->escape_string($comment->getPageID()));\n $query->execute();\n }", "public function store()\n {\n $this->validate([\n 'body' => 'required|min:5'\n ]);\n /* Almacenamos los campos en la DB */\n Comment::create([\n 'body' => $this->body,\n 'user_id' => Auth::user()->id,\n ]);\n $this->default();\n }", "public function save(Comment $comment)\n {\n $this->add($comment);\n }", "public function save(Comment $comment)\n {\n $commentdata = array(\n 'art_id' => $comment->getArticle()->getId(),\n 'com_author' => $comment->getAuthor(),\n 'com_content' => $comment->getContent(),\n 'com_mail' => $comment->getMail(),\n 'parent_id' => $comment->getParent(),\n 't_date' => $comment->getDate(),\n 't_state'=> $comment->getState()\n ); \n \n if($comment->getId())\n {\n var_dump($commentdata);\n $this->getDb()->update('t_comment',$commentdata,array('com_id' => $comment->getId()));\n }\n else\n {\n $this->getDb()->insert('t_comment', $commentdata);\n $id = $this->getDb()->lastinsertID();\n $comment->setId($id);\n }\n }", "public function save(Comment $comment)\n {\n $commentData = array(\n 'episode_id' => $comment->getEpisode()->getId(),\n 'user_id' => $comment->getAuthor()->getId(),\n 'content' => $comment->getContent(),\n );\n\n if ($comment->getId())\n {\n // The comment has already been saved : update it\n $this->getDb()->update('comments', $commentData, ['id' => $comment->getId()]);\n } else\n {\n // The comment has never been saved : insert it\n $this->getDb()->insert('comments', $commentData);\n $id = $this->getDb()->lastInsertId();\n $comment->setId($id);\n }\n }", "public function store(Comment $comment)\n {\n // validate incoming data with validation rules\n $this->validate(request(), [\n 'new_reply' => 'required|min:1|max:255'\n ]);\n\n /**\n store the new reply through relationship,\n through this way you don't have to\n provide `comment_id` field inside create() method\n */\n $comment->replies()->create([\n 'user_id' => auth()->id(),\n 'body' => request()->new_reply\n ]);\n\n // redirect to the previous URL\n return redirect()->back();\n }", "public function save(Comment $comment) {\n $commentData = array(\n 'billet_id' => $comment->getBillet()->getBilletId(),\n 'com_content' => $comment->getContent(),\n 'usr_id' => $comment->getAuthor()->getId(),\n 'parent_id' => 0,\n 'com_depth' => 0,\n );\n\n if ($comment->getCommentId()) {\n // The comment has already been saved : update it\n $this->getDb()->update('t_comment', $commentData, array('com_id' => $comment->getCommentId()));\n } else {\n // The comment has never been saved : insert it\n $this->getDb()->insert('t_comment', $commentData);\n // Get the id of the newly created comment and set it on the entity.\n $commentId = $this->getDb()->lastInsertId();\n $comment->setCommentId($commentId);\n }\n }", "function save_comment($comment_id)\n {\n }", "function save(iEntityComment $entity);", "public function store()\n {\n if (Validate::commentForm()) {\n $comment = $this->Model->store();\n\n if ($comment) {\n Session::set('comment_added', true);\n }else Session::set('db_error_comment', true);\n }else Session::set('validate_error', true);\n\n Session::set('posted_data', Input::getAll());\n Session::setMany(Validate::getErrors());\n Redirect::to('post/show/' . Input::get('post_id'));\n }", "public function Save() {\n $msg = null;\n if($this['id']) {\n $this->db->ExecuteQuery(self::SQL('update comment'), array($this['data'], $this['filter'], $this['id']));\n $msg = 'update';\n } else {\n $this->db->ExecuteQuery(self::SQL('insert comment'), array($this['data'], $this['filter'], $this->user['id'], $this['idContent']));\n $this['id'] = $this->db->LastInsertId();\n $msg = 'created';\n }\n $rowcount = $this->db->RowCount();\n if($rowcount) {\n $this->AddMessage('success', \"Successfully {$msg} comment\");\n } else {\n $this->AddMessage('error', \"Failed to {$msg} comment \");\n }\n return $rowcount === 1;\n }", "public function record_comment(){\n\t\t\t\n\t\t}", "public function commentUpdate() {\n\t\t$id = $_POST['id'];\n\t\t$text = $_POST['text'];\n\t\t$c = Comment::find($id);\n\t\t$c->text = $text;\n\t\t$c->save();\n\t}", "public function saveAnswer(Comment $comment) {\n $commentData = array(\n 'billet_id' => $comment->getBillet()->getBilletId(),\n 'parent_id' => $comment->getCommentId(),\n 'usr_id' => $comment->getAuthor()->getId(),\n 'com_content' => $comment->getContent(),\n 'com_depth' => $comment->getDepth()+1,\n );\n\n if ($comment->getCommentId()) {\n // The answer has never been saved : insert it\n $this->getDb()->insert('t_comment', $commentData);\n // Get the id of the newly created answer and set it on the entity.\n\n $commentId = $this->getDb()->lastInsertId();\n $comment->setCommentId($commentId);\n }\n }", "public function store(StoreComment $request)\n {\n Comment::create([\n 'users_id' \t\t => Auth::id(),\n 'body' \t\t => $request['body'],\n 'commentable_id' \t\t=> $request['content_id'],\n 'commentable_type' \t\t=> 'App\\Content',\n ]);\n\n return Redirect::to(URL::previous() . \"#comments\");\n }", "public function save(Comment $comment)\n {\n if ($comment->isValid()) {\n $comment->isNew() ? $this->add($comment) : $this->update($comment);\n }\n }", "protected function SaveActionIdToComment()\n {\n $sActionId = TTools::GetUUID();\n $this->sqlData['action_id'] = $sActionId;\n $this->AllowEditByAll(true);\n $this->Save();\n $this->AllowEditByAll(false);\n }", "public function store()\n {\n $attrs = $this->validateComment();\n\n Comment::create($attrs);\n\n return redirect('/posts');\n }", "public function saveComment(comment $comment){\n\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP'];} \n\n\t\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; }\n\n\t\telse { $ip = $_SERVER['REMOTE_ADDR'];}\n\n $data = array(\n\n 'comment_system_type_id' => $comment->comment_system_type_id,\n\n 'comment_by_user_id' => $comment->comment_by_user_id,\n\n\t\t\t'comment_content' => $comment->comment_content,\n\n\t\t\t'comment_status' => $comment->comment_status,\t\t\t \n\n\t\t\t'comment_added_ip_address' => $ip,\n\n\t\t\t'comment_refer_id' => $comment->comment_refer_id,\n\n\t\t\t'comment_added_timestamp' =>date(\"Y-m-d H:i:s\"),\n\n );\n\n $comment_id = (int)$comment->comment_id;\n\n if ($comment_id == 0) {\n\n $this->insert($data);\n\n\t\t\treturn $this->adapter->getDriver()->getConnection()->getLastGeneratedValue();\n\n } else {\n\n if ($this->getComment($comment_id)) {\n\n $this->update($data, array('comment_id' => $comment_id));\n\n } else {\n\n throw new \\Exception('Comment id does not exist');\n\n }\n\n }\n\n }", "public function storeAction()\n {\n $comment = new Comment();\n\n $comment->create($_POST);\n\n return redirect('');\n }", "public function save()\n\t{\n\t\t// Check for request forgeries.\n\t\tFoundry::checkToken();\n\n\t\t// Only registered users are allowed here.\n\t\tFoundry::requireLogin();\n\n\t\t// Get the view\n\t\t$view \t= $this->getCurrentView();\n\n\t\t// Check for permission first\n\t\t$access = Foundry::access();\n\n\t\tif( !$access->allowed( 'comments.add' ) )\n\t\t{\n\t\t\t$view->setMessage( 'ACL: Not allowed to add comments', SOCIAL_MSG_ERROR );\n\t\t\treturn $view->call( __FUNCTION__ );\n\t\t}\n\n\t\t$element\t= JRequest::getString( 'element', '' );\n\t\t$group\t\t= JRequest::getString( 'group', SOCIAL_APPS_GROUP_USER );\n\t\t$uid\t\t= JRequest::getInt( 'uid', 0 );\n\t\t$input\t\t= JRequest::getVar( 'input', '' , 'post' , 'none' , JREQUEST_ALLOWRAW );\n\t\t$data\t\t= JRequest::getVar( 'data', array() );\n\t\t$streamid\t= JRequest::getVar( 'streamid', '' );\n\t\t$parent\t\t= JRequest::getInt( 'parent', 0 );\n\n\t\t$compositeElement = $element . '.' . $group;\n\n\t\t$table\t\t= Foundry::table( 'comments' );\n\n\t\t$table->element = $compositeElement;\n\t\t$table->uid = $uid;\n\t\t$table->comment = $input;\n\t\t$table->created_by = Foundry::user()->id;\n\t\t$table->created = Foundry::date()->toSQL();\n\t\t$table->parent = $parent;\n\t\t$table->params = $data;\n\n\t\t$state\t\t= $table->store();\n\n\t\tif( !$state )\n\t\t{\n\t\t\t$view->setMessage( $table->getError(), SOCIAL_MSG_ERROR );\n\t\t}\n\n\t\tif( $streamid )\n\t\t{\n\t\t\t$stream = Foundry::stream();\n\t\t\t$stream->updateModified( $streamid );\n\t\t}\n\n\t\t// Process mentions for this comment\n\t\tif( isset( $data['mentions']) && !empty( $data[ 'mentions' ] ) )\n\t\t{\n\t\t\tforeach( $data[ 'mentions' ] as $row )\n\t\t\t{\n\t\t\t\t$mention \t\t= (object) $row;\n\n\t\t\t\t$tag \t\t\t= Foundry::table( 'Tag' );\n\t\t\t\t$tag->offset\t= $mention->start;\n\t\t\t\t$tag->length\t= $mention->length;\n\t\t\t\t$tag->type \t\t= $mention->type;\n\n\t\t\t\tif( $tag->type == 'hashtag' )\n\t\t\t\t{\n\t\t\t\t\t$tag->title = $mention->value;\n\t\t\t\t}\n\n\t\t\t\tif( $tag->type == 'entity' )\n\t\t\t\t{\n\t\t\t\t\t$value \t\t\t\t= (object) $mention->value;\n\t\t\t\t\t$tag->item_id \t\t= $value->id;\n\t\t\t\t\t$tag->item_type \t= SOCIAL_TYPE_USER;\n\t\t\t\t}\n\n\t\t\t\t$tag->creator_id \t= Foundry::user()->id;\n\t\t\t\t$tag->creator_type \t= SOCIAL_TYPE_USER;\n\n\t\t\t\t$tag->target_id \t= $table->id;\n\t\t\t\t$tag->target_type \t= 'comments';\n\n\t\t\t\t$tag->store();\n\t\t\t}\n\t\t}\n\n\t\t$dispatcher = Foundry::dispatcher();\n\n\t\t$comments \t= array( &$table );\n\t\t$args \t\t= array( &$comments );\n\n\t\t// @trigger: onPrepareComments\n\t\t$dispatcher->trigger( $group , 'onPrepareComments' , $args );\n\n\t\treturn $view->call( __FUNCTION__, $table );\n\t}", "public function store(Request $request){\n\n //check if comment has been written\n $this->validate($request, [\n 'user_comment'=>'required'\n ]);\n\n //store the comment\n $comment = new Comment;\n $comment->comment = $request->input('user_comment');\n $comment->user_id = auth()->user()->id;\n $comment->post_id = $request->input('post_id');\n $comment->save();\n return redirect()->back()->with('success', 'Comment added to the post');\n }", "public function comedit()\n {\n $commentId = Input::get('pk');\n //get the new marks\n $comment = Input::get('value');\n //get the Student Data Row to be updated with new marks\n $commentData = Comments::whereId($commentId)->first();\n $commentData->content = $comment;\n\n $commentData->save();\n\n\n\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$this->commentary->commentary = $input['commentary'];\n\t\t$this->commentary->mid = $input['mid'];\n\t\t$this->commentary->time = $input['time'];\n\t\tif($this->commentary->save()){\n\t\t\t\\Session::flash('notice','Successfully added');\n\t\t\treturn redirect()->back();\n\t\t}\n\t}", "public function saveData(Comment $comment)\n {\n if ($comment->validateObject() === false) {\n return false;\n }\n $sqlQuery = \"INSERT INTO comments (IPAddress, commentText) VALUES (:IpAddress, :commentText);\";\n $statement = $this->connection->prepare($sqlQuery);\n $ipAddress = $comment->getIpAddress();\n $message = $comment->getMessage();\n $statement->bindParam(':IpAddress', $ipAddress, \\PDO::PARAM_STR);\n $statement->bindParam(':commentText', $message, \\PDO::PARAM_STR);\n $success = $statement->execute();\n return $success;\n }", "public function setComment($comment);", "public function setComment($comment);", "public function store(CommentRequest $request)\n {\n Comment::create([\n 'user_id' => auth()->id(),\n 'post_id' => $request->post_id,\n 'content' => $request['content'],\n ]);\n\n return redirect()->route('posts.index');\n }", "public function setComment(Comment $comment): void;", "public function saveCustomerComment()\n {\n\t$comment = Mage::app()->getRequest()->getParam('comment', null);\n\tif($comment && strlen(trim($comment))) {\n\t $this->_checkoutSession->setData('customer_comment', $comment);\n\t} else {\n\t $this->_checkoutSession->unsetData('customer_comment');\n\t}\n }", "public function addComment(): void\n {\n $this->articleId = $_GET['articleId'];\n $this->content = $_POST['comment'];\n $this->author = $_POST['nickname'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n\n $this->commentModel->addComment($this->content, $this->date, $this->author, $this->articleId);\n\n // Redirect to the article page\n Router::redirectTo('articleDetails&id=' . $this->articleId);\n exit();\n }", "public function store()\n {\n $comment=new commentes;\n $comment->body=request('body');\n $comment->post_id=request('post_id');\n$comment->user_id=request('user_id');\n $comment->save();\n return back();\n }", "public function storeComment($data)\n {\n $student_id = $data['student_id'];\n $commentor_id = auth::user()->id;\n $comment = $data['comment'];\n $newData = [\n 'student_id'=> $student_id, \n 'commentor_id' => $commentor_id, \n 'comment' => $comment\n ];\n\n return $this->create($newData);\n }", "function saveComment(){\n\t\t$this->layout = 'ajax';\n\t\t$user_id = $_POST['user_id'];\n\t\t$feeds_id = $_POST['business_feeds_id'];\n\t\t$comment = $_POST['comment'];\n\t\t$membership_id = $_POST['membershipPlan'];\n\n\t\t$saveData['user_id'] = $user_id;\n\t\t$saveData['feed_id'] = $feeds_id;\n\t\t$saveData['comment'] = $comment;\n\t\tif($membership_id != 1){\n\t\t\t$saveData['status'] = 1;\n\t\t} else {\n\t\t\t$saveData['status'] = 2;\n\t\t}\n\n\t\t$this->Comment->save($saveData);\n\n\t\t$this->set('comment', $comment);\n\n\t\t$last_id = $this->Comment->id;\n\t\t$commentArr = $this->Comment->find('first', array('conditions'=>array('Comment.id'=>$last_id, 'Comment.status'=>'1')));\n\t\t$this->set('commentArr', $commentArr);\n\t\tif(!empty($commentArr)){\n\t\t$userr_id = $commentArr['Comment']['user_id'];\n\t\t$this->set('userr_id', $userr_id);\n\t\t}\t\n\t\t$this->set('last_id', $last_id);\n\t}", "public function setComment(?string $value): void {\n $this->getBackingStore()->set('comment', $value);\n }", "public function store(Request $request)\n {\n $comment = new Comment();\n $userId = Auth::id();\n $user = User::findOrFail($userId);\n $comment->login = $user->name;\n $comment->commented_section = $request->categoryID;\n $comment->comment = $request->commentText;\n $comment->save();\n }", "function insertComment() {\n if ($this->getRequestMethod() != \"POST\") {\n $this->response('', 406);\n }\n $comment = json_decode(file_get_contents(\"php://input\"),true);\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($comment['user_id'], $auth)) {\n $this->response('', 406);\n }\n \n $columns = 'user_id, video_id, text';\n $values = $comment['user_id'] . ',' . $comment['video_id'] . ',\\'' . $comment['text'] . \"'\";\n \n $query = \"insert into comments(\". $columns . \") VALUES(\". $values . \");\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => \"Success\", \"msg\" => \"Comment Posted.\", \"data\" => $comment);\n $this->response(json_encode($success),200);\n }", "public function store(StoreComment $request)\n {\n // The incoming request is valid...\n // Retrieve the validated input data...\n $validated = $request->validated();\n\n $this->repository->fillAndSave($validated);\n \n Toastr::success('Comment Successfully Saved :)', 'Success');\n \n return redirect()->back();\n }", "public function store(CommentRequest $request) {\n // dd(request()->all());\n // dd(Auth::user()->name);\n\n\n Comment::create([\n \"tweet_id\" => $request->tweetId,\n \"user_id\" => Auth::user()->id,\n \"comment\" => $request->comment\n ]);\n \n\n $data = [\n \"user_id\" => Auth::user()->id,\n \"user_name\" => Auth::user()->name,\n \"comment\" => $request->comment,\n \"tweet_id\" => $request->tweetId,\n ];\n event(new NewNotification($data));\n\n // $comment->create([\n // 'tweet_id' =>$request->tweetId,\n // 'user_id' => Auth::user()->id,\n // 'comment' =>$request->comment\n // ]);\n return back()->with(['success' => 'comment added']);\n }", "private function saveData($data)\n {\n $newDate = date('Y-m-d H:i:s');\n $data['commentDate'] = $newDate;\n // --- saving part ---\n $comments = new commentModel();\n $commentID = $comments->insert($data);\n // --- routing after storage ---\n $url = '/comments/show/id/' . $data['topicID'];\n $this->_redirect($url);\n }", "public function store(Request $request) {\n // 投稿内容の受け取って変数に入れる\n $comment = $request->comment;\n $post_id = $request->post_id;\n\n\n Comment::create([\n 'user_id' => Auth::id(),\n 'post_id' => $post_id,\n 'content' => $comment\n ]);\n return redirect(\"/post/detail/$post_id\");\n\n }", "public function store(CommentRequest $request)\n {\n //\n $request['user_id']= auth()->user()->id;\n $inputs = $request->all();\n $ticket = Ticket::find($request->input('ticket_id'));\n Comment::create($this->file($request));\n Notification::send(User::role('Admin')->get(), new NewComment($ticket));\n if ($user = $ticket->user) {\n $user->notify(new NewComment($ticket));\n }\n return redirect()->back()->with(['messageok' => 'Registro exitoso del comentario']);\n }", "function create_comment($album_id, $comment){\n $album_id = (int)$album_id;\n $comment = mysql_real_escape_string($comment);\n\n mysql_query(\"INSERT INTO comments (album_id, user_id, comment, timestamp) VALUES ($album_id, \". $_SESSION['user_id'] .\", '$comment', UNIX_TIMESTAMP()) \");\n \n }", "public function create()\n {\n $this->validation[\"body\"][\"format\"][] = $this->body;\n if (!$this->validate()) {\n throw new ValidationException(\"invalid comment\");\n }\n $db = DB::conn();\n $set_params = array(\n \"thread_id\" => $this->thread_id, \n \"username\" => $this->username, \n \"body\" => $this->body\n );\n $db->insert(self::COMMENT_TABLE, $set_params);\n }", "public function create($comment)\n {\n\n }", "public function store(Post $post)\n {\n // validate incoming request data\n $this->validate(request(), [\n 'new_comment' => 'required|min:1|max:255'\n ]);\n\n // store comment\n $post->comments()->create([\n 'user_id' => auth()->id(),\n 'body' => request()->new_comment\n ]);\n\n // redirect to the previous URL\n return redirect()->back();\n }", "public function store(CommentRequest $request)\n {\n $comment = new Comment();\n $comment->post_id = $request->input('post_id');\n $comment->owner_id = $request->input('owner_id');\n $comment->content = $request->input('content');\n $comment->save();\n $post = Post::find($request->input('post_id')); \n return redirect(route('post.show',$post))->with('_success', 'Comentario añadido exitosamente!');\n\n }", "public function storeComment(Request $request)\n {\n if(Auth::check())\n {\n if($request->comment != '')\n {\n $input['video_id'] = $request->video_id;\n $input['user_id'] = Auth::id();\n $input['user_name'] = Auth::user()->name;\n $input['comment'] = $request->comment;\n\n Comment::create($input);\n\n return back()->with('success', 'Comment successfully published.');\n }\n return back()->with('warning', \"You can't publish an empty comment.\");\n }\n\n return back()->with('warning', 'You must be connected.');\n }", "function set_comment() {\n $this->sale_lib->set_comment($this->input->post('comment'));\n }", "public function store()\n {\n if( $this->isPersistent() )\n {\n $this->update();\n }\n else\n {\n $this->insert();\n }\n }", "function addComment(){\n\t\t$this->Article->Comment->create();\n\t\tif ($this->Article->Comment->save($this->data)) {\n\t\t\techo __('Your comment has been added successfully, and will be viewed soon after approving.', true);\n\t\t} else {\n\t\t\techo __('Your comment could not be added.', true);\n\t\t\techo '<br />';\n\t\t\tforeach($this->Article->Comment->validationErrors as $key=>$val){\n\t\t\t\techo $val.',<br />';\n\t\t\t}\n\t\t\techo 'and try again.';\n\t\t}\n\t\t$this->autoRender = false;\n\t}", "public function comment($comment)\n {\n $this->comments[] = $comment;\n }", "public function setComment(?WorkbookComment $value): void {\n $this->getBackingStore()->set('comment', $value);\n }", "public function store(CommentFormRequest $request){\n $input = $request->all();\n $this->comment->store($input, Auth::user());\n return redirect('home');\n }", "public function add(Comment $comment)\n {\n $sql = \"INSERT INTO comments(idArticle, author, content, publishDate)\n VALUES(:idArticle, :author, :content, NOW())\";\n $query = $this->db->prepare($sql);\n $query->execute([\n 'idArticle' => $comment->idArticle(),\n 'author' => $comment->author(),\n 'content' => $comment->content()\n ]);\n }", "public function createComment($comment, $author, $email, $chapter_id) {\n \n global $db; // defined in models/connect.php\n $sql = $db->prepare('\n INSERT INTO comment (comment, author, email, comment_date,chapter_id) \n VALUES(?, ?, ?, NOW(), ?)\n ');\n $affectedLines = $sql->execute(array($comment, $author, $email, $chapter_id));\n //result is commented out\n }", "public function store(Request $request)\n {\n //also update the comment count in the questions table\n //get question data via the question id\n $question = Question::find($request->question_id);\n //get the commentCount from the question db\n $commentCount = $question->comment_count;\n\n //update comment_count column in question\n //and increment comment_count\n// $question1 = Question::find($request->question_id);\n// $question1->comment_count = $commentCount++;//incremnt comment_count in question db\n// $question->save();\n DB::table('questions')\n ->where('id', $request->question_id)\n ->update(['comment_count' => $commentCount++]);\n\n //save comment into comment db\n $comment = new Comment;\n $comment->user_id = $request->user_id;\n $comment->question_id = $request->question_id;\n $comment->body = $request->body;\n $comment->save();\n\n\n\n return redirect()->route('individual.index')->with('success', \"A new comment has been posted!\");\n\n }", "function savecomments(){\n\n//database connection begins\nrequire('database/connx.php');\n\n// Connect to MySQL\n$db = & new MySQL($host,$dbUser,$dbPass,$dbName);\n\n//storing values in DB for search functionality\n\n//instantiating variables begin\n$this->comment_author = safeAddSlashes($_POST['comment_author']);\n$this->pubDate = date(\"M j, Y, g:i a\");\n$this->comment = safeAddSlashes($_POST['comment']);\n$this->lead_comment_author = safeAddSlashes($_POST['lead_comment_author']);\n$this->msg_type = $_POST['msg_type'];\nif(isset($_POST['vid'])){$this->presentation_url = safeAddSlashes($_POST['vid']);}else{$this->presentation_url = safeAddSlashes($_GET['vid']);}\n$sql=\"INSERT comments SET\nstr_presentation_url='$this->presentation_url',\nstr_name='$this->comment_author',\nstr_lead_name='$this->lead_comment_author',\ntime_pubDate='$this->pubDate',\nstr_comment='$this->comment',\nstr_msg_type='$this->msg_type'\";\n//echo \"<p>\" . $sql . \"</p>\";\n$result=$db->query($sql);\n\n }", "public function insertComment($name,$comment,$idOfRecord,$typeOfRecord = \"photo\")\r\n {\r\n \r\n //If passed , insert the comment.\r\n }", "public function insertComment() {\n\n if(isset($_POST['btnInsertComment'])){\n $comment = $_POST['comment'];\n $idUser = $_SESSION['user']->id_user;\n $idNews = $_POST['idNews'];\n $created_at = date(\"Y-m-d H-i-s\", time());\n\n\n $regComment = \"/[0-9A-Za-z.,\\n \\r?!]*/\";\n\n $errors = [];\n if($comment == \"\") {\n $errors[] = \"Cant be empty comment\";\n exit;\n }\n else if(!preg_match($regComment, $comment)) {\n $errors[] = \"Wrong format comment\";\n exit;\n }\n try {\n $modelComment = new Comments(Database::instance());\n $modelComment->insertComment($comment, $created_at, $idUser, $idNews);\n\n $this->commentLog($comment, \"INSERT\", 201);\n\n } catch (\\PDOException $ex){\n $this->errorLog(\"insertComment()\", $ex->getMessage());\n\n }\n\n\n } else {\n $this->json(null, 403);\n }\n }", "public function store(CommentRequest $request)\n {\n $authorId = Auth::id(); \n $comments = Comment::create([\n 'content' => $request->content,\n 'article_id' => $request->article_id,\n 'parent_id' => $request->parent_id,\n 'user_id' => $authorId,\n ]);\n return redirect(route('post.show',$request->article_id));\n }", "public function store(StoreComment $request)\n {\n $validated = $request->validated();\n $comment = new Comment;\n\n $comment->fill($validated);\n $comment->user_id = Auth::id();\n $comment->vulnerability_id = $request->vulnerability_id;\n $comment->save();\n\n return back();\n }", "public function storeComment($data)\n {\n $senderId = $data['user_id'];\n\n $post = Post::findOrFail($data['post_id']);\n\n $receiverId = $post->user->id;\n\n $activityData = [\n 'user_id' => $senderId,\n 'post_id' => $data['post_id'],\n ];\n\n $activityData['type'] = config('activity.type.comment');\n\n $notificationData = [\n 'sender_id' => $senderId,\n 'receiver_id' => $receiverId,\n 'post_id' => $data['post_id'],\n ];\n\n DB::beginTransaction();\n\n try {\n $comment = Comment::create($data);\n\n if (is_null($comment['parent_id'])) {\n $notificationData['type'] = config('notification.type.comment');\n } else {\n $parentComment = Comment::findOrFail($comment['parent_id']);\n\n if (is_null($parentComment->parent_id)) {\n $notificationData['type'] = config('notification.type.reply');\n } else {\n $notificationData['type'] = config('notification.type.replies_of_reply');\n }\n\n $notificationData['receiver_id'] = $parentComment->user_id;\n }\n\n if ($senderId != $receiverId) {\n $this->notificationService->storeNotification($notificationData);\n $this->activityService->storeActivity($activityData);\n }\n\n DB::commit();\n } catch (\\Throwable $th) {\n Log::error($th);\n\n DB::rollBack();\n\n return false;\n }\n\n return $comment;\n }", "public function store(Request $request)\n\t{\n $data = new fc_comment;\n\t\t$data->id = $request->input(\"id\");\n\t\t$data->blog_id = $request->input(\"blog_id\");\n\t\t$data->user_id = $request->input(\"user_id\");\n $data->comments = $request->input(\"comments\");\n $data->save();\n\t\treturn redirect(\"admin/comments\");\t\n }", "public function store(Request $request)\n {\n //save a new comment\n $this->validate($request, array(\n\n 'body' => 'required',\n \n ));\n\n $comment = new Comment;\n\n $comment->user_id = Auth::user()->id;\n $comment->body = $request->body;\n $comment->post_id = $request->post_id;\n\n $comment->save();\n\n Session::flash('success', 'Comment added!');\n\n return redirect()->back();\n }", "public function WriteToPCommentsTable() //stores comments to db\r\n {\r\n\r\n $servername = \"localhost\";\r\n $username = \"root\";\r\n $password = \"\";\r\n $db = \"frameusers\";\r\n $table = \"pcomments\";\r\n\r\n $commentTxt = $_POST['Pcmt'];\r\n $user = $_SESSION['username'];\r\n $datetime = new DateTime();\r\n\r\n $date = $datetime->format('d-m-Y H:i');\r\n\r\n // Create connection\r\n $conn = new mysqli($servername, $username, $password, $db);\r\n\r\n\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n }\r\n\r\n else if (!(isset($_SESSION['username'])))\r\n {\r\n echo \"Please login first\";\r\n }\r\n else if ($commentTxt != null)\r\n {\r\n $sql = \"INSERT INTO $table (comment_body, comment_author, username, timin )VALUES ('$commentTxt', '$user','$user', '$date')\";\r\n\r\n if ($conn->query($sql) === TRUE) {\r\n echo \"<p style='color: orange; position: absolute; left: 45%; top: 90% '>Comment Posted Successfully</p>\";\r\n echo \"<meta http-equiv=\\\"refresh\\\" content=\\\"1;url=http://localhost/secure/scenes/personal_scene.php\\\" />\";\r\n } else {\r\n //echo \"Error: \" . $sql . \"<br>\" . $conn->error;\r\n echo \"<p style='color: orangered; position: absolute; left: 34%; top: 90% '>Comment was not posted successfully, if the problem persists please contact us</p>\";\r\n }\r\n\r\n $conn->close();\r\n //echo \"Connected successfully\";\r\n }\r\n else\r\n {\r\n echo \"<p style='color: orangered; position: absolute; left: 40%; top: 90% '>Please enter a comment first before posting</p>\";\r\n }\r\n }", "public function addComment()\r\n {\r\n $pdoStatment = $this->pdo->prepare(\r\n 'INSERT INTO `comment`(`content`, `id_User`, `id_Article`) \r\n VALUES(:content, :id_User, :id_Article)'\r\n );\r\n $pdoStatment->bindValue(':content', $this->content, PDO::PARAM_STR);\r\n $pdoStatment->bindValue(':id_User', $this->id_User, PDO::PARAM_INT);\r\n $pdoStatment->bindValue(':id_Article', $this->id_Article, PDO::PARAM_INT);\r\n $pdoStatment->execute();\r\n return $this->pdo->lastInsertId();\r\n }", "public function store()\n\t{\n\t\ttry {\n\t\t\t$input = Input::all();\n\n\t\t\t$inputs_array = $input['data'];\n\n\t\t\t$comment = Comment::Create([\n\t\t\t\t'comment' => $inputs_array['comment'],\n\t\t\t]);\n\n\t\t\t$postComment = PostComment::Create([\n\t\t\t\t'owner_id' => $inputs_array['owner_id'],\n\t\t\t\t'post_id' => $inputs_array['post_id'],\n\t\t\t\t'comment_id' => $comment->id,\n\t\t\t]);\n\n\t\t\tif (!$postComment) {\n\t\t\t\t$errorMessage = [\n\t\t\t\t\t'status' => false,\n\t\t\t\t\t'message' => \"Something went wrong. Please try again later!\"\n\t\t\t\t];\n\n\t\t\t\treturn $this->setStatusCode(500)->respondWithError($errorMessage);\n\t\t\t}\n\n\t\t\t$successResponse = [\n\t\t\t\t'status' => true,\n 'message' => 'Comment posted successfully!'\n ];\n\n\t\t\treturn $this->setStatusCode(200)->respond($successResponse);\n\t\t} catch (Exception $e) {\n\t\t\t$errorMessage = [\n\t\t\t\t'status' => false,\n\t\t\t\t'message' => \"Something went wrong. Please try again later!\"\n\t\t\t];\n\n\t\t\treturn $this->setStatusCode(500)->respondWithError($errorMessage);\n\t\t}\n\t}", "public function store(PostCommentRequest $request)\n {\n Comment::create($request->all());\n return back()->with('success', 'Comment was added successfully');\n }", "public function commentAction() {\n $ses = new Application_Model_Session();\n $ses->startSession();\n {\n $request = $this->getRequest();\n $ExpId = $this->_getParam('expid');\n $form = new Campuswisdom_Form_Comment();\n $this->view->form = $form;\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($request->getPost())) {\n $mapper = new Campuswisdom_Model_ExpMapper();\n $Comment = $form->getValue(\"comment\");\n $mapper->setDbTable('campuswisdom_Model_DbTable_Comments');\n $smthn = $mapper->save($ExpId, $Comment);\n if ($smthn == null) {\n //an error occurred so nothing was saved\n } else {\n $ses->setSessionParameter('comnt', 1);\n }\n $this->_helper->redirector('viewcomments', 'exps', 'default', array('expid' => $ExpId));\n }\n }\n }\n }", "public function save($id, $comment)\n {\n $comments = $this->session->get('comments', []);\n $comments[$id] = $comment;\n $this->session->set('comments', $comments);\n\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'text' => 'required'\n ]);\n\n $comment = new InstagramAutoComments();\n $comment->comment = $request->get('text');\n $comment->source = $request->get('comment');\n $comment->country = $request->get('country');\n $comment->gender = $request->get('gender');\n $comment->options = $request->get('options') ?? [];\n $comment->save();\n\n return redirect()->back()->with('message', 'Comment added successfully!');\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $comment = Comments::findFirstByid($id);\n if (!$comment) {\n $this->flash->error(\"comment does not exist \" . $id);\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n }\n\n $comment->model = $this->request->getPost(\"model\");\n $comment->model_id = $this->request->getPost(\"model_id\");\n $comment->body = $this->request->getPost(\"body\");\n \n\n if (!$comment->save()) {\n\n foreach ($comment->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"edit\",\n \"params\" => array($comment->id)\n ));\n }\n\n $this->flash->success(\"comment was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n\n }", "private function insert_post_comment(Socket $sckt,$comment_data)\n {\n $comment = new post_comment_mdl();\n $comment->user_prof = $sckt->user->profile;\n $comment->created_at = $comment_data[\"created_at\"];\n $comment->text = $comment_data[\"text\"];\n $comment->magic_id = $comment_data[\"magic_id\"];\n $comment->post_magic_id = $comment_data[\"post_magic_id\"];\n\n $comment->set_post_comment();\n }", "public function store(CommentRequest $request)\n {\n Comment::create($request->all());\n\n return back()->with('message', MyAlert::message('commentaire envoyé avec succès! Il sera publié après vérification de l\\'équipe','success'));\n }", "public function WriteToCommentsTable() //Inserts comments to Comments Table\r\n {\r\n\r\n $servername = \"localhost\";\r\n $username = \"root\";\r\n $password = \"\";\r\n $db = \"frameusers\";\r\n $table = \"comments\";\r\n\r\n $commentTxt = $_POST['cmt'];\r\n $user = $_SESSION['username'];\r\n $datetime = new DateTime();\r\n\r\n $date = $datetime->format('d-m-Y H:i');\r\n\r\n // Create connection\r\n $conn = new mysqli($servername, $username, $password, $db);\r\n\r\n\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n }\r\n\r\n else if (!(isset($_SESSION['username'])))\r\n {\r\n echo \"Please login first\";\r\n }\r\n else if ($commentTxt != null)\r\n {\r\n $sql = \"INSERT INTO $table (comment, username, timing )VALUES ('$commentTxt','$user', '$date')\";\r\n\r\n if ($conn->query($sql) === TRUE) {\r\n echo \"<p style='color: orange; position: absolute; left: 45%; top: 90% '>Comment Posted Successfully</p>\";\r\n echo \"<meta http-equiv=\\\"refresh\\\" content=\\\"1;url=http://localhost/secure/\\\" />\";\r\n } else {\r\n //echo \"Error: \" . $sql . \"<br>\" . $conn->error;\r\n echo \"<p style='color: orangered; position: absolute; left: 34%; top: 90% '>Comment was not posted successfully, if the problem persists please contact us</p>\";\r\n }\r\n\r\n $conn->close();\r\n //echo \"Connected successfully\";\r\n }\r\n else\r\n {\r\n echo \"<p style='color: orangered; position: absolute; left: 40%; top: 90% '>Please enter a comment first before posting</p>\";\r\n }\r\n }", "public function store(CreateCommentRequest $request) {\n \n $comment = new comment;\n $comment->body = $request->body;\n $comment->post_id = $request->post_id;\n\n $request->user()->comments()->save($comment);\n\n session()->flash('flash_message', 'Comment Posted Successfully!');\n\n return redirect()->route('posts.show', Post::find($request->post_id));\n }", "public function newComment() {\n $datas['chapter_id'] = abs((int) $_GET['id']);\n $datas['author'] = trim(htmlspecialchars((string) $_POST['newCommentAuthor']));\n $datas['content'] = trim(htmlspecialchars((string) $_POST['newCommentContent']));\n\n if (!empty($datas['content']) && !empty($datas['author'])) {\n $commentMngr = new CommentManager();\n $commentMngr->add($datas);\n \n $_SESSION['commentsPseudo'] = $datas['author'];\n } else {\n $GLOBALS['error']['newComment'] = \"Un commentaire ne peut pas être vide et doit impérativement être associé à un pseudo.\";\n }\n }", "function saveComment($name, $text) {\n $list = readJson(COMMENTS_FILE_NAME, []);\n $list[] = [\n 'name' => $name,\n 'text' => $text,\n 'date' => date(\"Y-m-d H:i:s\", time())\n ];\n return writeJson(COMMENTS_FILE_NAME, $list);\n}", "public function store(Requests\\StoreCommentFormRequest $request) {\n Comment::create($request->all());\n\n return back()->with('message', 'Commentaire en attente de validation');\n }", "public function addComment() {\n $body = $this->getData();\n\n $comentario = $body->comentario;\n $usuario = $body->usuario;\n $fecha = $body->fecha;\n $puntaje = $body->puntaje;\n $id_jugador = $body->id_jugador;\n $id_comentario = $this->model->insert($comentario, $usuario, $fecha, $puntaje, $id_jugador);\n\n if($id_comentario) {\n $this->view->response(\"Se agrego el comentario nùmero: {$id_comentario}\", 200);\n } else {\n $this->view->response(\"El comentario no se pudo agregar \", 500);\n }\n\n }", "public function store($locale, Comment $comment)\n {\n $attributes = request()->validate([\n 'body' => 'required|min:5|max:100'\n ]);\n \n $attributes['author_id'] = auth()->id();\n \n $comment->testimonial()->create($attributes);\n \n return response('با موفقیت به صفحه اصلی اضافه شد.', 200);\n }", "protected function comment_save($edit) {\n global $user;\n if (!form_get_errors()) {\n $edit += array(\n 'mail' => '',\n 'homepage' => '',\n 'name' => '',\n 'status' => user_access('post comments without approval') ? COMMENT_PUBLISHED : COMMENT_NOT_PUBLISHED,\n );\n if ($edit['cid']) {\n // Update the comment in the database.\n db_query(\"UPDATE {comments} SET status = %d, timestamp = %d, subject = '%s', comment = '%s', format = %d, uid = %d, name = '%s', mail = '%s', homepage = '%s' WHERE cid = %d\", $edit['status'], $edit['timestamp'], $edit['subject'], $edit['comment'], $edit['format'], $edit['uid'], $edit['name'], $edit['mail'], $edit['homepage'], $edit['cid']);\n\n // Allow modules to respond to the updating of a comment.\n comment_invoke_comment($edit, 'update');\n\n // Add an entry to the watchdog log.\n watchdog('content', 'Comment: updated %subject.', array('%subject' => $edit['subject']), WATCHDOG_NOTICE, l(t('view'), 'node/'. $edit['nid'], array('fragment' => 'comment-'. $edit['cid'])));\n }\n else {\n // Add the comment to database.\n // Here we are building the thread field. See the documentation for\n // comment_render().\n if ($edit['pid'] == 0) {\n // This is a comment with no parent comment (depth 0): we start\n // by retrieving the maximum thread level.\n $max = db_result(db_query('SELECT MAX(thread) FROM {comments} WHERE nid = %d', $edit['nid']));\n\n // Strip the \"/\" from the end of the thread.\n $max = rtrim($max, '/');\n\n // Finally, build the thread field for this new comment.\n $thread = int2vancode(vancode2int($max) + 1) .'/';\n }\n else {\n // This is comment with a parent comment: we increase\n // the part of the thread value at the proper depth.\n\n // Get the parent comment:\n $parent = _comment_load($edit['pid']);\n\n // Strip the \"/\" from the end of the parent thread.\n $parent->thread = (string) rtrim((string) $parent->thread, '/');\n\n // Get the max value in _this_ thread.\n $max = db_result(db_query(\"SELECT MAX(thread) FROM {comments} WHERE thread LIKE '%s.%%' AND nid = %d\", $parent->thread, $edit['nid']));\n\n if ($max == '') {\n // First child of this parent.\n $thread = $parent->thread .'.'. int2vancode(0) .'/';\n }\n else {\n // Strip the \"/\" at the end of the thread.\n $max = rtrim($max, '/');\n\n // We need to get the value at the correct depth.\n $parts = explode('.', $max);\n $parent_depth = count(explode('.', $parent->thread));\n $last = $parts[$parent_depth];\n\n // Finally, build the thread field for this new comment.\n $thread = $parent->thread .'.'. int2vancode(vancode2int($last) + 1) .'/';\n }\n }\n\n if (empty($edit['timestamp'])) {\n $edit['timestamp'] = time();\n }\n\n if ($edit['uid'] === $user->uid && isset($user->name)) { // '===' Need to modify anonymous users as well.\n $edit['name'] = $user->name;\n }\n\n db_query(\"INSERT INTO {comments} (nid, pid, uid, subject, comment, format, hostname, timestamp, status, thread, name, mail, homepage) VALUES (%d, %d, %d, '%s', '%s', %d, '%s', %d, %d, '%s', '%s', '%s', '%s')\", $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], $edit['comment'], $edit['format'], ip_address(), $edit['timestamp'], $edit['status'], $thread, $edit['name'], $edit['mail'], $edit['homepage']);\n $edit['cid'] = db_last_insert_id('comments', 'cid');\n\n // Tell the other modules a new comment has been submitted.\n comment_invoke_comment($edit, 'insert');\n\n // Add an entry to the watchdog log.\n watchdog('content', 'Comment: added %subject.', array('%subject' => $edit['subject']), WATCHDOG_NOTICE, l(t('view'), 'node/'. $edit['nid'], array('fragment' => 'comment-'. $edit['cid'])));\n }\n _comment_update_node_statistics($edit['nid']);\n\n // Clear the cache so an anonymous user can see his comment being added.\n cache_clear_all();\n\n // Explain the approval queue if necessary, and then\n // redirect the user to the node he's commenting on.\n if ($edit['status'] == COMMENT_NOT_PUBLISHED) {\n drupal_set_message(t('Your comment has been queued for moderation by site administrators and will be published after approval.'));\n }\n else {\n comment_invoke_comment($edit, 'publish');\n }\n return $edit['cid'];\n }\n else {\n return FALSE;\n }\n }", "public function insertComment()\n\t{\n\t\t$reviewid = $this->session->userdata('reviewid');\n\n\t\t$commentData = $this->input->post();\n\n\t\t$comment = $commentData['comment'];\n\t\t// var_dump($comment);\n\t\t$this->Review_Model->insertComment($reviewid, $comment);\n\n\t\tredirect(base_url() . 'index.php/reviewPage/' . $reviewid);\n\t}", "public function store(Request $request)\n {\n \n $comment = new Comment;\n $comment->comment = $request->comment_content;\n $comment->user()->associate($request->user());\n $commentPic = DB::table('comments')\n ->join('users','comments.user_id','=','users.id')\n ->join('profiles','users.id','=','profiles.user_id')\n ->select('comments.*','profiles.profilepic_path as pic')\n ->get();\n // dd($request);\n $forum = Forum::find($request->forum_id);\n $forum->comments()->save($comment);\n\n /* hualilidefengexian : Testing out the activity log*/\n \n $user = Auth::user()->id;\n\n activity()\n ->performedOn($comment)\n ->causedBy($user)\n ->withProperties(['commented' => $request->comment_content, 'forum_id'=>$forum ->id])\n ->log('Commented on forums');\n\n /* end of testing */\n\n return back();\n\n \n\n //dd(Forum::find($request->forum_id));\n // $comment = new Comment;\n\n // $comment->comment = $request->comment;\n\n // $comment->user()->associate($request->user());\n\n // $forum_post = Forum::find($request->forum_id);\n\n // $forum_post->comments()->save($comment);\n\n // return back();\n }", "public function store(Request $request)\n {\n\n $comment = Comment::create([\n 'user_id' => auth()->user()->id,\n 'body' => $request->body,\n 'post_id' => $request->post_id\n ]);\n\n\n flash()->overlay('Comment created successfully.');\n\n return redirect('/admin/comments');\n }", "public function store(Request $request)\n {\n $request->validate([\n 'user'=>'required|integer',\n 'id'=>'required|integer',\n 'comment'=>'required|string',\n 'published'=>'required|integer'\n ]);\n\n $comment = Comment::create([\n 'author_id'=>$request->user,\n 'post_id'=>$request->post,\n 'comment'=>$request->comment,\n 'published'=>$request->published\n ]);\n\n if($comment){\n Session::flash('success','Comment created');\n return redirect('/admin/comments');\n }\n }", "public function comment($comment) {\n $comment['InsertUserID'] = Gdn::session()->UserID;\n $comment['DateInserted'] = Gdn_Format::toDateTime();\n $comment['InsertIPAddress'] = ipEncode(Gdn::request()->ipAddress());\n\n $this->Validation->applyRule('ActivityID', 'Required');\n $this->Validation->applyRule('Body', 'Required');\n $this->Validation->applyRule('DateInserted', 'Required');\n $this->Validation->applyRule('InsertUserID', 'Required');\n\n $this->EventArguments['Comment'] = &$comment;\n $this->fireEvent('BeforeSaveComment');\n\n if ($this->validate($comment)) {\n $activity = $this->getID($comment['ActivityID'], DATASET_TYPE_ARRAY);\n\n $_ActivityID = $comment['ActivityID'];\n // Check to see if this is a shared activity/notification.\n if ($commentActivityID = val('CommentActivityID', $activity['Data'])) {\n Gdn::controller()->json('CommentActivityID', $commentActivityID);\n $comment['ActivityID'] = $commentActivityID;\n }\n\n $storageObject = FloodControlHelper::configure($this, 'Vanilla', 'ActivityComment');\n if ($this->checkUserSpamming(Gdn::session()->User->UserID, $storageObject)) {\n return false;\n }\n\n // Check for spam.\n $spam = SpamModel::isSpam('ActivityComment', $comment);\n if ($spam) {\n return SPAM;\n }\n\n // Check for approval\n $approvalRequired = checkRestriction('Vanilla.Approval.Require');\n if ($approvalRequired && !val('Verified', Gdn::session()->User)) {\n LogModel::insert('Pending', 'ActivityComment', $comment);\n return UNAPPROVED;\n }\n\n $iD = $this->SQL->insert('ActivityComment', $comment);\n\n if ($iD) {\n // Check to see if this comment bumps the activity.\n if ($activity && val('Bump', $activity['Data'])) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $activity['ActivityID']]);\n if ($_ActivityID != $comment['ActivityID']) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $_ActivityID]);\n }\n }\n\n // Send a notification to the original person.\n if (val('ActivityType', $activity) === 'WallPost') {\n $this->notifyWallComment($comment, $activity);\n }\n }\n\n return $iD;\n }\n return false;\n }", "public function save(Playlist $playlist) {\n $playlistData = array(\n 'user_id' => $playlist->getAuthor()->getId(),\n 'media_name' => $playlist->getName(),\n 'deezer_id' => $playlist->getDeezer(),\n 'mini_image_url' => $playlist->getImage()\n );\n\n if ($playlist->getId()) {\n // The comment has already been saved : update it\n $this->getDb()->update('t_playlist', $playlistData, array('media_id' => $playlist->getId()));\n } else {\n // The comment has never been saved : insert it\n $this->getDb()->insert('t_playlist', $playlistData);\n // Get the id of the newly created comment and set it on the entity.\n $id = $this->getDb()->lastInsertId();\n $playlist->setId($id);\n }\n }", "public function store(Request $request)\n {\n $request->validate([\n 'comment'=>'required',\n 'discussion_id'=>'required',\n 'user_id'=>'required'\n ]);\n $comment = $request->get('comment');\n $comment = new Comment([\n 'discussion_id' => $request->get('discussion_id'),\n 'comment' => $comment,\n 'user_id' => $request->get('user_id'),\n 'isFile' =>str_starts_with($comment, 'https://firebasestorage.googleapis.com/'),\n 'file_comment'=> $request->get('file_comment'),\n ]);\n $comment->save();\n\n return ['success'=>'Comment saved'];\n }", "public function update()\n {\n $this->validation[\"body\"][\"format\"][] = $this->body;\n if (!$this->validate()) {\n throw new ValidationException(\"invalid comment\");\n }\n $db = DB::conn();\n $set_params = array(\n \"body\" => $this->body\n );\n $where_params = array(\"id\" => $this->id);\n $db->update(self::COMMENT_TABLE, $set_params, $where_params);\n }", "function warquest_home_comment_save_do() {\r\n\r\n\t/* input */\r\n\tglobal $player;\r\n\tglobal $uid;\r\n\tglobal $other;\r\n\tglobal $comment;\r\n\r\n\t/* output */\r\n\tglobal $output;\r\n\r\n\tif (strlen($comment)>0) {\r\n\t\r\n\t\tif ($uid==0) {\r\n\t\t\twarquest_db_comment_insert(0, 0, $player->pid, $other->pid, $comment);\r\n\t\t} else {\t\t\r\n\t\t\twarquest_db_comment_update($uid, $comment);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($other->pid)) {\r\n\t\t\r\n\t\t\t$other->comment_notification++;\r\n\t\t\twarquest_comment_mail($other->pid, $comment, $player->name);\r\n\t\t\t$message = t('ALLIANCE_COMMENT_PLAYER', player_format($other->pid, $other->name, $other->country));\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\r\n\t\t\t$message = t('ALLIANCE_COMMENT_ALL');\r\n\t\t\twarquest_info(\"Post message: \".$comment);\t\t\r\n\t\t}\t\t\r\n\r\n\t\t/* Clear input parameters */\r\n\t\t$uid = 0;\r\n\t\t\r\n\t\t$output->popup .= warquest_box_icon(\"info\", $message);\r\n\t}\r\n}", "public function store(StoreCommentRequest $request)\n {\n return auth()->user()->comments()->create($request->validated());\n }", "public function store() {\r\n //\r\n if (!Sentry::check()) {\r\n $input = Input::except('slug', 'parent_id');\r\n $validation = Validator::make($input, Comment::$rules);\r\n if ($validation->fails()) {\r\n return Redirect::to('artikel/' . Input::get('slug'))->withInput($input)->withErrors($validation);\r\n }\r\n $telo = new Comment();\r\n $telo->fill($input);\r\n $post = Artikel::find(Input::get('post_id'));\r\n $telo->artikel()->associate($post);\r\n if ($telo->save()) {\r\n $root = Comment::find(Input::get('parent_id'));\r\n $telo->makeChildOf($root);\r\n return Redirect::to('artikel/' . Input::get('slug'));\r\n }\r\n } else {\r\n $user = Sentry::getUser();\r\n $input = array(\r\n 'nama' => ucfirst($user->first_name) . ' ' . ucfirst($user->last_name),\r\n 'url' => 'arnosa.net',\r\n 'email' => $user->email,\r\n 'komentar' => strip_tags(Input::get('komentar')),\r\n );\r\n }\r\n $com = new Comment();\r\n $com->fill($input);\r\n $post = Artikel::find(Input::get('post_id'));\r\n $com->artikel()->associate($post);\r\n if ($com->save()) {\r\n if (Input::get('parent_id')) {\r\n $root = Comment::find(Input::get('parent_id'));\r\n $com->makeChildOf($root);\r\n }\r\n return Redirect::route('admin.comments.index');\r\n }\r\n }", "function setComment($comment)\n {\n $this->comment = $comment;\n }", "function setComment($comment)\n {\n $this->comment = $comment;\n }", "public function store($id)\n\t{\n\n\t\t$rules = [\n\t\t\t\t'comment' => 'required'\n\t\t\t];\n\n\t\t$validator = Validator::make(Input::all(),$rules);\n\n\t\tif($validator->fails())\t{\n\t\t\treturn Redirect::back()->withErrors($validator);\n\t\t} else {\n\t\t\t//get id of user;\n\t\t\t$user_id = Auth::id();\n\t\t\t$comment = new Comment();\n\t\t\t$comment->post_id = $id;\n\t\t\t$comment->user_id = $user_id;\n\t\t\t$comment->comment = Input::get('comment');\n\t\t\t$comment->save();\n\n\t\t\tSession::flash('message','Comment Added');\n\t\t\treturn Redirect::back();\n\t\t}\n\t}", "public function store()\n\t{\n\t\t$data = Input::all();\n\t\t$data['user_id'] = \\Auth::user()->id;\n\t\t$comment_data = $this->commentService->createComment($data);\n\n\t\treturn Response::json($comment_data, 201);\n\t}", "abstract protected function add(Comment $comment);", "public function comment(Request $request)\n {\n $this->validate($request, [\n 'comment' => 'bail|required|max:200',\n 'postId' => 'required|numeric',\n ]);\n\n // creating a new comment\n $comment = new Post_comment();\n $comment->post_id = $request->postId;\n $comment->comment = $request->comment;\n $comment->artist_id = Auth::user()->id;\n \n $comment->save(); \n }" ]
[ "0.83012444", "0.7649011", "0.73279566", "0.71398056", "0.70038223", "0.69852006", "0.69712514", "0.684422", "0.6769625", "0.6694173", "0.6649", "0.6585793", "0.6585218", "0.65420955", "0.65291476", "0.652476", "0.652032", "0.64805317", "0.64727837", "0.6462652", "0.6455871", "0.6410975", "0.63992625", "0.6390014", "0.6344638", "0.6330117", "0.6296147", "0.6296147", "0.62941235", "0.6293742", "0.62669957", "0.6263577", "0.6256888", "0.62522227", "0.62478924", "0.62374", "0.62358093", "0.6223906", "0.61851364", "0.61754656", "0.6174308", "0.6171719", "0.61645865", "0.61565816", "0.6136771", "0.6135541", "0.61289304", "0.6126007", "0.6111616", "0.6106253", "0.6099109", "0.609754", "0.60845876", "0.6079938", "0.6071948", "0.6068418", "0.60559607", "0.6053687", "0.60513556", "0.60427904", "0.60406053", "0.6028951", "0.60275024", "0.6026758", "0.60249084", "0.6020897", "0.60190433", "0.6015067", "0.6013647", "0.6010082", "0.59914374", "0.5988393", "0.597794", "0.5977466", "0.59619415", "0.59581316", "0.5954833", "0.5949373", "0.5949165", "0.5940393", "0.59371895", "0.59330106", "0.59240997", "0.59027773", "0.59008884", "0.5892094", "0.58877665", "0.58785903", "0.5877657", "0.58762634", "0.58715504", "0.58713514", "0.5858598", "0.58483446", "0.5844083", "0.5841735", "0.5841735", "0.58346856", "0.583391", "0.5832741", "0.58239746" ]
0.0
-1
Returns the static model of the specified AR class.
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model() {\n return parent::model(get_called_class());\n }", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }" ]
[ "0.74836576", "0.7380479", "0.7153653", "0.7139917", "0.7061897", "0.7031516", "0.6927712", "0.6927712", "0.6924855", "0.6902187", "0.6894202", "0.6894202", "0.6889197", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869", "0.6869" ]
0.0
-1
Run the database seeds.
public function run() { //No iniciado EstadoPedido::create([ 'id_estado_pedido' => 1, 'estado_pedido' => 'Iniciado' ]); //Iniciado EstadoPedido::create([ 'id_estado_pedido' => 2, 'estado_pedido' => 'No Iniciado' ]); //Finalizado EstadoPedido::create([ 'id_estado_pedido' => 3, 'estado_pedido' => 'Finalizado' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
ApplyParameters will update current set of Parameters to the set of specified nodes of the Memcached Instance. (instances.applyParameters)
public function applyParameters($name, Google_Service_CloudMemorystoreforMemcached_ApplyParametersRequest $postBody, $optParams = array()) { $params = array('name' => $name, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('applyParameters', array($params), "Google_Service_CloudMemorystoreforMemcached_Operation"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateParameters($name, Google_Service_CloudMemorystoreforMemcached_UpdateParametersRequest $postBody, $optParams = array())\n {\n $params = array('name' => $name, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('updateParameters', array($params), \"Google_Service_CloudMemorystoreforMemcached_Operation\");\n }", "function setParameters($parameters);", "public function postFlush()\n {\n foreach ($this->parametersMap as $map) {\n $map['entity']->setParameters($map['parameters']);\n }\n\n // reset parameters map\n $this->parametersMap = [];\n }", "public function setParameters($parameters){\n\t\tself::$_parameters[get_class($this)] = $parameters;\n\t}", "function setParameters(array $parameters) {\n foreach ($parameters as $key => $value) {\n $this->setParameter($key, $value);\n }\n }", "public function modifyActionParameters(array $parameters);", "public function set($parameters)\n {}", "public function setParametersByRef (&$parameters)\n {\n\n foreach ($parameters as $key => &$value)\n {\n\n $this->parameters[$key] =& $value;\n\n }\n\n }", "public function setParameters($parameters) {\n $this->params = $parameters;\n }", "public function setSiteParameters($params);", "public function setParameters($parameters)\n {\n $this->parameters = $parameters;\n return $this;\n }", "public function setParameters($parameters) {\n $this->parameters = $parameters;\n }", "public function setParameters ($parameters)\n {\n\n $this->parameters = array_merge($this->parameters, $parameters);\n\n }", "public function setParameters( $parameters ) {\n $this->parameters = $parameters;\n\n return $this;\n }", "private function setParams($statemant, $parameters = array()){\n\t\tforeach ($parameters as $key => $value) {\n\t\t\t//Parametros da query.\n\t\t\t$this->setParam($statemant, $key, $value);\n\t\t}\n\t}", "public function setParameters(array $parameters): void;", "public static function applyParameters(\n object $config,\n object $twig,\n array $parameters\n ): void {\n if (empty($parameters)) {\n return;\n }\n foreach ($parameters as $parameter => $value) {\n if (Utils::startsWith('twig.', $parameter, false)) {\n $twig->twig_vars[end(explode('.', $parameter))] = $value;\n } else {\n $config->set($parameter, $value);\n }\n }\n }", "public function finish_setting_parameters()\n {\n $this->set_variable( 'parameters', $this->parameters );\n }", "public function setParams($params);", "public function setParams($params);", "public function SetParameters($parameters)\n {\n $this->parameters = $parameters;\n }", "public function setParameters(array $parameters)\n {\n $this->clearCachedValueIf($this->params != $parameters);\n $this->params = $parameters;\n }", "abstract public function processParameters ($params);", "protected function assignParameters($parameters) {\n\t\t$plugin = IoC::getPluginInstance();\n\t\t$domain = $plugin->plugin_slug;\n\n\t\t// create default parameters\n\t\t$formulaParameters = $this->formulaParser::extractParameters($this->formula);\n\t\tforeach ($formulaParameters as $formulaParameter){\n\t\t\t$this->parameters->{$formulaParameter} = self::createParameter($formulaParameter);\n\t\t}\n\n\t\t$processedSubmit = false;\n\t\tforeach ($parameters as $key => $param) {\n\t\t\tif (empty($param->attributes)) { $param->attributes = new \\stdClass(); }\n\t\t\tif (empty($param->attributes->id)) { $param->attributes->id = 'shortcalc_'.rand(0,1000000);}\n\t\t\tif (empty($param->attributes->name) && !empty($param->name)) {\n\t\t\t\t$param->attributes->name = $param->name;\n\t\t\t}\n\t\t\tif (empty($param->attributes->name)) { $param->attributes->name = $key;}\n\t\t\tif (empty($param->attributes->value)) { $param->attributes->value = '';}\n\t\t\tif (empty($param->element)) { $param->element = 'input';}\n\t\t\tif (empty($param->label)) { $param->label = '';}\n\t\t\tif (empty($param->prefix)) { $param->prefix = '';}\n\t\t\tif (empty($param->postfix)) { $param->postfix = '';}\n\n\t\t\tif ($param->element == 'input' && empty($param->attributes->type)) {\n\t\t\t\t$param->attributes->type = 'text';\n\t\t\t}\n\n\t\t\tif (empty($param->label) && $param->attributes->type !== 'submit'\n\t\t\t\t&& $param->element !== 'button') {\n\t\t\t\t$param->label = $key;\n\t\t\t}\n\n\t\t\t$this->parameters->{$param->attributes->name} = $param;\n\n\t\t\tif ($param->attributes->type == 'submit') {\n\t\t\t\t$processedSubmit = true;\n\t\t\t}\n\t\t}\n\n\t\t// add submit button if there is not any\n\t\tif (!$processedSubmit) {\n\t\t\t$this->parameters->submit = self::createParameter('submit', 'input', 'submit', __('Calculate', $domain));\n\t\t}\n\t}", "public function setParameters(array $parameters): self\n {\n $this->parameters = $parameters;\n return $this;\n }", "protected function processApply(array $apply, string $name, DataSet $dataSet, $value): void {\n\n foreach ($apply as $applyIndex => $applyDefinition) {\n\n $maxIndexes = [\n 'g' => 0,\n ];\n\n // Set this to false to start the process\n $isDoneProcessing = false;\n\n // End the process if everything has been processed\n while (!$isDoneProcessing) {\n\n // Set this to true - If a collection is being processed it'll update the status\n $isDoneProcessing = true;\n\n // Get the params\n $params = $applyDefinition->getArgs();\n\n // Process each params (retrieve reference if available)\n foreach ($params as $paramIndex => &$param) {\n\n // Generate the reference locator key\n $referenceLocatorName = md5($name . $applyIndex . $paramIndex . (string)$param);\n\n // Retrieve the current reference locator if it is registered\n $referenceLocator = $this->services->getReferenceLocatorCollection()->getReferenceLocator($referenceLocatorName);\n\n // Init and register the reference locator if empty\n if (!isset($referenceLocator)) {\n\n $referenceLocator = new ReferenceLocator($param);\n $this->services->getReferenceLocatorCollection()->registerReferenceLocator($referenceLocatorName, $referenceLocator);\n\n }\n\n // Update the param value if it was a reference\n if ($referenceLocator->isReference()) {\n\n // Get the next reference available in the reference locator\n $reference = $referenceLocator->getNextReference($this->services->getDataSetCollection());\n\n // Update the reference string in the param with the reference value\n $param = $reference->getValue();\n\n if (!$referenceLocator->isDone()) {\n\n // Prevent the process to break out of the loop if we have other references to process\n $isDoneProcessing = false;\n\n }\n\n // Save the highest index set (default) to be able to generate the final field key later\n $referenceIndexes = $reference->getIndexes();\n if (isset($referenceIndexes['g']) && $referenceIndexes['g'] >= $maxIndexes['g']) {\n\n $maxIndexes = $referenceIndexes;\n\n }\n\n }\n\n }\n\n if ($applyDefinition->getType() === ContractApplyDefinition::TYPE_PROCESSOR) {\n\n // Get the processor by name\n $processor = $this->services->getDataProcessorCollection()->getDataProcessor($applyDefinition->getName());\n\n // If value = null try to get key first (this should only work in the case of a source since the\n // destination is supposed to be empty for now)\n if (!isset($value)) {\n\n $value = $dataSet->get($name);\n\n }\n\n // Apply the processor\n $value = $processor->process($value, $params);\n\n // Generate the final key\n $fieldKey = $name;\n foreach ($maxIndexes as $level => $index) {\n\n $fieldKey = str_replace('[$' . $level . ']', $index, $fieldKey);\n\n }\n\n // Set the final value\n $dataSet->set($fieldKey, $value);\n\n } elseif ($applyDefinition->getType() === ContractApplyDefinition::TYPE_VALIDATOR) {\n\n // Get the validator by name\n $validator = $this->services->getDataValidatorCollection()->getDataValidator($applyDefinition->getName());\n\n // If value = null try to get key directly (this should only work in the case of a source since the\n // destination is supposed to be empty for now)\n if (!isset($value)) {\n\n $value = $dataSet->get($name);\n\n }\n\n // Apply the validator\n $isValid = $validator->validate($value, $params);\n\n if (!$isValid) {\n throw new MetamorphoseValidateException('Invalid value for the target field or attribute ' . $name);\n }\n\n } else {\n\n throw new MetamorphoseException('Invalid apply type for ' . $name);\n\n }\n\n }\n\n }\n\n }", "public function parameters( Array $parameters=array() ) {\n foreach ($parameters as $name=>$value) {\n $this->params[$name]= $value;\n }\n }", "public function setParameters(array $parameters)\n\t{\n\t\t$this->parameters = $parameters;\n\t\t\n\t\treturn $this;\n\t}", "public function setParameters()\n {\n $params = array();\n $associations = array();\n foreach ($this->datatablesModel->getColumns() as $key => $data) {\n // if a function or a number is used in the data property\n // it should not be considered\n if( !preg_match('/^(([\\d]+)|(function)|(\\s*)|(^$))$/', $data['data']) ) {\n $fields = explode('.', $data['data']);\n $params[$key] = $data['data'];\n $associations[$key] = array('containsCollections' => false);\n\n if (count($fields) > 1) {\n $this->setRelatedEntityColumnInfo($associations[$key], $fields);\n } else {\n $this->setSingleFieldColumnInfo($associations[$key], $fields[0]);\n }\n }\n }\n\n $this->parameters = $params;\n // do not reindex new array, just add them\n $this->associations = $associations + $this->associations;\n }", "public function setWordpressParameters($parameters)\n {\n $this->wordpress_parameters = $parameters;\n }", "public function setParameters(array $parameters) : self\n {\n $this->parameters = $parameters;\n\n return $this;\n }", "public function setParameters(array $parameters)\n {\n $this->parameters = $parameters;\n return $this;\n }", "function set($params, $context) {\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, [\n\t\t\t\"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t]);\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, \"rpc.powermgmt.set\");\n\t\t// Get the existing configuration object.\n\t\t$db = \\OMV\\Config\\Database::getInstance();\n\t\t$object = $db->get(\"conf.system.powermngmnt\");\n\t\t$object->setAssoc($params);\n\t\t// Set the configuration object.\n\t\t$db->set($object);\n\t\t// Return the configuration object.\n\t\treturn $object->getAssoc();\n\t}", "public function setParameters(mixed ...$parameters) : void\n {\n $this->parameters = $parameters;\n }", "public function setMinkParameters(array $parameters)\n {\n $this->minkParameters = $parameters;\n }", "public function setMinkParameters(array $parameters)\n {\n $this->minkParameters = $parameters;\n }", "public function setParameters($params)\n {\n $this->postFields = $params;\n }", "public function setSettings($params, $context)\n\t{\n\t\tglobal $xmlConfig;\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, array(\n\t\t\t \"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t ));\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, '{\n\t\t\t \"type\":\"object\",\n\t\t\t \"properties\":{\n\t\t\t\t \"enable\":{\"type\":\"boolean\"},\n\t\t\t\t \"basedn\":{\"type\":\"string\"},\n \"rootbindcn\":{\"type\":\"string\"},\n \"rootbindpw\":{\"type\":\"string\"},\n \"usersuffix\":{\"type\":\"string\"},\n \"groupsuffix\":{\"type\":\"string\"}\n\t\t\t }\n\t\t }');\n\t\t// Prepare the configuration object.\n\t\t$object = array(\n\t\t\t\"enable\" => array_boolval($params, 'enable'),\n\t\t\t\"basedn\" => trim($params['basedn']),\n \"rootbindcn\" => trim($params['rootbindcn']),\n \"rootbindpw\" => trim($params['rootbindpw']),\n \"usersuffix\" => trim($params['usersuffix']),\n \"groupsuffix\" => $params['groupsuffix'],\n\t\t);\n \n //We need to set the ldap client to use the new ldap server information\n //if the ldap server is enabled\n if($object['enable']){ \n $xpath = \"//services/ldap\";\n $ldapclientObject = $xmlConfig->get($xpath);\n $ldapclientObject['enable'] = 1; //if server is enabled, client should connect to it\n $ldapclientObject['host'] = \"localhost\";\n $ldapclientObject['base'] = $object['basedn'];\n $ldapclientObject['rootbinddn'] = $object['rootbindcn'].\",\".$object['basedn'];\n $ldapclientObject['rootbindpw'] = $object['rootbindpw'];\n $ldapclientObject['usersuffix'] = $object['usersuffix'];\n $ldapclientObject['groupsuffix'] = $object['groupsuffix'];\n if (FALSE === $xmlConfig->replace($xpath, $ldapclientObject)) {\n throw new OMVException(OMVErrorMsg::E_CONFIG_SET_OBJECT_FAILED);\n }\n }\n \n // Update the configuration file. If it fails it throws an exception.\n $xpath = \"//services/ldapserver\";\n if (FALSE === $xmlConfig->replace($xpath, $object)) {\n throw new OMVException(OMVErrorMsg::E_CONFIG_SET_OBJECT_FAILED);\n }\n \n\t\t// Notify configuration changes.\n\t\t//\n\t\t// This will notify event listeners such as the service module\n\t\t// to perform certain tasks. The most common one is to mark the\n\t\t// service as dirty.\n $dispatcher = &OMVNotifyDispatcher::getInstance();\n $dispatcher->notify(OMV_NOTIFY_MODIFY,\n \"org.openmediavault.services.ldapserver\", $object);\n\n\t\treturn $object;\n\t}", "public function set($params) {}", "function set_params($params)\r\n\t{\r\n\t\t$this->parameters = $params;\r\n\t}", "public function __construct($parameters = [])\n {\n parent::__construct($parameters);\n array_walk($parameters, [$this, 'updateQuery']);\n }", "public function setParameters(/*Vector<IParameterData>*/ $value) /*: this*/ {\n $this->parameters = $value;\n return $this;\n }", "protected function inject_custom_parameters()\n\t{\n\t\tforeach ($this->custom_parameters as $key => $value)\n\t\t{\n\t\t\t$this->container->setParameter($key, $value);\n\t\t}\n\t}", "public function parameters($parameters)\n {\n $this->options['parameters'] = $parameters;\n\n return $this;\n }", "final protected function _setParameters(array $params)\n\t{\n\t\tforeach ($params as $key => $value) {\n\t\t\t$this->setParameter($key, $value);\n\t\t}\n\t}", "public function applyParameters(&$parameterArray)\n {\n $this->addSearchParameters($parameterArray);\n }", "public function applyParameters(&$parameterArray)\n {\n $this->addSearchParameters($parameterArray);\n }", "private function _set_parameters() {\n\t\t$transient_expiry = ( isset( $this->transient_expiry ) ) ? $this->transient_expiry : ( 3 * HOUR_IN_SECONDS );\n\t\t$posts = ( isset( $this->posts ) ) ? $this->posts : $this->get_posts();\n\t\t$post_type_args = ( isset( $this->_post_type_args ) ) ? $this->_post_type_args : array();\n\t\t$this->taxonomy_name = ( isset( $this->taxonomy_name ) ) ? $this->taxonomy_name : \"{$this->post_type}-categories\";\n\t\t$taxonomy_labels = ( isset( $this->custom_taxonomy_labels ) ) ? $this->custom_taxonomy_labels : array();\n\t\t$taxonomy_args = ( isset( $this->_taxonomy_args ) ) ? $this->_taxonomy_args: array();\n\t\t$custom_post_type_args = ( isset( $this->custom_post_type_args ) ) ? $this->custom_post_type_args : array();\n\t\t$custom_post_type_labels = ( isset( $this->custom_post_type_labels ) ) ? $this->custom_post_type_labels : array();\n\t\t$custom_taxonomy_args = ( isset( $this->custom_taxonomy_args ) ) ? $this->custom_taxonomy_args : array();\n\t\t$custom_post_type_supports = ( isset( $this->custom_post_type_supports ) ) ? $this->custom_post_type_supports : array();\n\t\t$disable_image_column = ( isset( $this->disable_image_column ) ) ? $this->disable_image_column : false;\n\t\t$disable_post_type_categories = ( isset( $this->disable_post_type_categories ) ) ? $this->disable_post_type_categories : false;\n\n\t\t// Set class properties\n\t\t$this->transient_expiry = $transient_expiry;\n\t\t$this->posts = $posts;\n\t\t$this->_post_type_args = $post_type_args;\n\t\t$this->custom_taxonomy_labels = $taxonomy_labels;\n\t\t$this->_taxonomy_args = $taxonomy_args;\n\t\t$this->custom_post_type_args = $custom_post_type_args;\n\t\t$this->custom_post_type_labels = $custom_post_type_labels;\n\t\t$this->disable_post_type_categories = $disable_post_type_categories;\n\t\t$this->custom_taxonomy_args = $custom_taxonomy_args;\n\t\t$this->custom_post_type_supports = $custom_post_type_supports;\n\t\t$this->disable_image_column = $disable_image_column;\n\t\t$this->set_post_type_supports( $this->custom_post_type_supports );\n\t\t$this->set_post_type_args( $this->custom_post_type_args );\n\t\t$this->set_taxonomy_args( $this->custom_taxonomy_args );\n\t}", "public function setSettings($params, $context)\n {\n $this->validateMethodContext($context, ['role' => OMV_ROLE_ADMINISTRATOR]);\n // Validate the parameters of the RPC service method.\n $this->validateMethodParams($params, 'rpc.tgt.setsettings');\n // Get the existing configuration object.\n $db = \\OMV\\Config\\Database::getInstance();\n $object = $db->get('conf.service.tgt');\n $object->setAssoc($params);\n // Set the configuration object.\n $db->set($object);\n // Remove useless properties from the object.\n $object->remove('targets');\n // Return the configuration object.\n return $object->getAssoc();\n }", "function setSettings($params, $context) {\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, [\n\t\t\t\"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t]);\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, \"rpc.ldap.setsettings\");\n\t\t// Prepare the configuration object.\n\t\t$object = new \\OMV\\Config\\ConfigObject(\"conf.service.ldap\");\n\t\t$object->setAssoc($params);\n\t\t// Set the configuration object.\n\t\t$db = \\OMV\\Config\\Database::getInstance();\n\t\t$db->set($object);\n\t\t// Return the configuration object.\n\t\treturn $object->getAssoc();\n\t}", "public function params(array $parameters): self\n {\n foreach ($parameters as $name => $value) {\n $this->param($name, $value);\n }\n\n return $this;\n }", "abstract public function process($parameters);", "public function execute(array $parameters = []);", "protected function setDataParameters()\n {\n if (isset($this->controller['query_results']->parameters)) {\n $this->controller['parameters'] = $this->controller['query_results']->parameters;\n unset($this->controller['query_results']->parameters);\n $this->controller['query_results'] = $this->controller['query_results']->data;\n\n } else {\n $this->controller['parameters'] = $this->plugin_data->render->extension->parameters;\n }\n\n return $this;\n }", "public function setParameters($params) {\n\t\t$defaultParams = $this->params;\n\t\t$allParams = array_merge($defaultParams, $params);\n\n\t\t$this->validateParameters($allParams);\n\n\t\t// Save parameters as they were\n\t\t$this->params = $allParams;\n\n\t\t// Update request URLs from the new parameters\n\t\t$this->urlRaw = $this->build();\n\t\t$this->url = $this->build(true);\n\t}", "public function applyChanges($params, $context) {\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, [\n\t\t\t\"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t]);\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, \"rpc.config.applychanges\");\n\t\t$moduleMngr = \\OMV\\Engine\\Module\\Manager::getInstance();\n\t\t$notifyDispatcher = \\OMV\\Engine\\Notify\\Dispatcher::getInstance();\n\t\t// Open the dirty modules file. Lock it to force all writers\n\t\t// to wait until this RPC has been finished.\n\t\t$jsonFile = new \\OMV\\Json\\File(\\OMV\\Environment::get(\n\t\t \"OMV_ENGINED_DIRTY_MODULES_FILE\"));\n\t\t$jsonFile->open(\"c+\");\n\t\t// Make sure we have a valid JSON file. Keep in mind that the file\n\t\t// is empty if it was created by the \\OMV\\Json\\File::open method.\n\t\tif ($jsonFile->isEmpty())\n\t\t\t$jsonFile->write([]);\n\t\t// Read the file content.\n\t\t$dirtyModules = $jsonFile->read();\n\t\t// Remove non-existing modules from list. It may happen that the\n\t\t// list contains entries from already deinstalled plugins.\n\t\t$removeDirtyModules = [];\n\t\t$modules = array_keys($moduleMngr->getModules());\n\t\tforeach ($dirtyModules as $dirtyModulek => $dirtyModulev) {\n\t\t\tif (!in_array($dirtyModulev, $modules))\n\t\t\t\t$removeDirtyModules[] = $dirtyModulev;\n\t\t}\n\t\tif (!empty($removeDirtyModules)) {\n\t\t\t// Remove module name from list of dirty modules. Note, the\n\t\t\t// array must be re-indexed.\n\t\t\t$dirtyModules = array_values(array_diff($dirtyModules,\n\t\t\t\t$removeDirtyModules));\n\t\t}\n\t\t// Get list of modules to be processed. If the parameter 'modules'\n\t\t// is empty, then process all registered modules.\n\t\t$modules = $params['modules'];\n\t\tif (empty($params['modules']))\n\t\t\t$modules = array_keys($moduleMngr->getModules());\n\t\t$processModules = [];\n\t\tforeach ($modules as $modulek => $modulev) {\n\t\t\t// Skip module if 'force' is disabled and module is not marked\n\t\t\t// as dirty.\n\t\t\tif (!in_array($modulev, $dirtyModules) &&\n\t\t\t\t(FALSE === $params['force'])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t// Get the module object and apply the configuration.\n\t\t\tif (is_null($inst = $moduleMngr->getModule($modulev))) {\n\t\t\t\tthrow new \\OMV\\Exception(\"Module '%s' not found.\",\n\t\t\t\t\t$modulev);\n\t\t\t}\n\t\t\t// Append module to list of modules that have to be processed.\n\t\t\t$processModules[$modulev] = $inst;\n\t\t\t// Remove module name from list of dirty modules. Note, the\n\t\t\t// array must be re-indexed.\n\t\t\t$dirtyModules = array_values(array_diff($dirtyModules,\n\t\t\t\t[$modulev]));\n\t\t}\n\t\t// Build the dependency list and deploy the configuration for the\n\t\t// specified modules.\n\t\t$tsort = new \\OMV\\Util\\TopologicalSort();\n\t\t$tsort->clean();\n\t\tforeach ($processModules as $name => $inst) {\n\t\t\t// Add the modules that need to be executed before the\n\t\t\t// given module.\n\t\t\t$afterNames = $inst->deployAfter();\n\t\t\tif (FALSE === $tsort->add($name, $afterNames)) {\n\t\t\t\tthrow new \\OMV\\Exception(\n\t\t\t\t\t\"Failed to add node (name=%s, dependencies=[%s]).\",\n\t\t\t\t\t$name, implode(\",\", $afterNames));\n\t\t\t}\n\t\t\t// Add the modules that need to be executed after the\n\t\t\t// given module.\n\t\t\t$beforeNames = $inst->deployBefore();\n\t\t\tforeach ($beforeNames as $beforeNamek => $beforeNamev) {\n\t\t\t\tif (FALSE === $tsort->add($beforeNamev, [$name])) {\n\t\t\t\t\tthrow new \\OMV\\Exception(\n\t\t\t\t\t\t\"Failed to add node (name=%s, dependencies=[%s]).\",\n\t\t\t\t\t\t$beforeNamev, $name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach ($tsort->sort() as $name) {\n\t\t\t$this->debug(\"Deploying configuration for module '%s'\", $name);\n\t\t\t$name = strtolower($name);\n\t\t\t$uri = \"org.openmediavault.module.service.%s.%s\";\n\t\t\t$processModules[$name]->preDeploy();\n\t\t\t$notifyDispatcher->notify(OMV_NOTIFY_EVENT,\n\t\t\t\tsprintf($uri, $name, \"predeploy\"));\n\t\t\t$processModules[$name]->deploy();\n\t\t\t$notifyDispatcher->notify(OMV_NOTIFY_EVENT,\n\t\t\t\tsprintf($uri, $name, \"deploy\"));\n\t\t\t$processModules[$name]->postDeploy();\n\t\t\t$notifyDispatcher->notify(OMV_NOTIFY_EVENT,\n\t\t\t\tsprintf($uri, $name, \"postdeploy\"));\n\t\t}\n\t\t// Reset list of dirty modules.\n\t\t$jsonFile->write($dirtyModules);\n\t\t$jsonFile->close();\n\t\t// Unlink all configuration revision files.\n\t\t$db = \\OMV\\Config\\Database::getInstance();\n\t\t$db->unlinkRevisions();\n\t}", "function apply($node)\r\n\t\t{\r\n\t\t\t$this->address = $node->address;\r\n\t\t\t$this->elements = $node->elements;\r\n\t\t\t$this->size = $node->size;\r\n\t\t\t$this->parent = $node->parent;\r\n\t\t\t$this->less = $node->less;\r\n\t\t\t$this->previous = $node->previous;\r\n\t\t\t$this->next = $node->next;\r\n\t\t}", "public function setAllParameters($allParameters){\n\t\tself::$_allParameters[get_class($this)] = $allParameters;\n\t}", "public function setParameters($parameters) {\r\n\t\tif ($parameters === null || is_string ( $parameters )) {\r\n\t\t\t$this->parameters = $parameters;\r\n\t\t\treturn $this;\r\n\t\t}\r\n\t\t\r\n\t\tif (! is_array ( $parameters ) && ! $parameters instanceof Traversable) {\r\n\t\t\tthrow new Exception\\InvalidArgumentException ( sprintf ( '%s expects a string, array, or Traversable object of parameters; received \"%s\"', __METHOD__, (is_object ( $parameters ) ? get_class ( $parameters ) : gettype ( $parameters )) ) );\r\n\t\t}\r\n\t\t\r\n\t\t$string = '';\r\n\t\tforeach ( $parameters as $param ) {\r\n\t\t\t$string .= ' ' . $param;\r\n\t\t}\r\n\t\ttrim ( $string );\r\n\t\t\r\n\t\t$this->parameters = $string;\r\n\t\treturn $this;\r\n\t}", "public function setParameters(array $parameters)\n {\n $this->parameters = $parameters;\n }", "public function applyToNode(Node $node);", "public function execute(array $parameters = array());", "public function initialize(array $parameters = [])\n {\n $this->parameters = new class\n {\n /**\n * Parameter storage.\n */\n protected $parameters;\n\n public function __construct(array $parameters = [])\n {\n $this->parameters = $parameters;\n }\n\n\n public function all(/*string $key = null*/)\n {\n $key = \\func_num_args() > 0 ? func_get_arg(0) : null;\n\n if (null === $key) {\n return $this->parameters;\n }\n\n if (!\\is_array($value = $this->parameters[$key] ?? [])) {\n throw new BadRequestException(sprintf('Unexpected value for parameter \"%s\": expecting \"array\", got \"%s\".', $key, get_debug_type($value)));\n }\n\n return $value;\n }\n\n\n public function add(array $parameters = [])\n {\n $this->parameters = array_replace($this->parameters, $parameters);\n }\n\n\n public function get(string $key, $default = null)\n {\n return \\array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default;\n }\n\n\n public function set(string $key, $value)\n {\n $this->parameters[$key] = $value;\n }\n\n\n public function remove(string $key)\n {\n unset($this->parameters[$key]);\n }\n };\n\n if ($parameters) {\n foreach ($parameters as $key => $value) {\n $method = 'set' . ucfirst(Helper::camelCase($key));\n if (method_exists($this, $method)) {\n $this->$method($value);\n }\n }\n }\n return $this;\n }", "public function setParams ($params) {\n\t\t$this->params = $params;\n\t\treturn $this;\t\n\t}", "function apply_ops_to_replicas(array $replicas, array $ops) {\n foreach($replicas as $r) {\n $r->apply_ops($ops);\n }\n}", "public function applyFilters() {\n\t\tforeach ($this->filters as $filter) {\n\t\t\t$filter->apply($this);\n\t\t}\n\t\t$this->removeFilters();\n\t}", "public function SetMatchedParams ($matchedParams = []);", "public function setParameters(array $params)\n {\n $this->_parameters = $params;\n return $this;\n }", "private function tree_apply_changes($changes) {\n global $db;\n\n foreach ($changes as $id => $change) {\n $change[\"ID_KAT\"] = $id;\n if ($updateid = $db->update($this->table, $change))\n unset($this->cache_nodes[$updateid]);\n }\n\n return $this->tree_create_nestedset();\n }", "private function _setParams ()\n {\n $endpoint = $this->_endpoint->getData();\n if (count($endpoint) > 0) {\n \n $method = $this->_endpoint->getUrl();\n $methodname = 'setParameter' . ucfirst($method['method']);\n \n $this->_httpclient->{$methodname}('access_token', \n $this->_accesstoken);\n $this->_httpclient->{$methodname}('api_secret', $this->_apisecret);\n \n foreach ($endpoint as $param => $value) {\n $this->_httpclient->{$methodname}($param, $value);\n }\n }\n }", "public function setRouteParameters(array $routeParams);", "public function testOverrideParameters(): void\n {\n $process = $this->phpbench(\n 'run --dump --progress=none --parameters=\\'{\"length\": 333}\\' benchmarks/set1/BenchmarkBench.php'\n );\n $this->assertExitCode(0, $process);\n $output = $process->getOutput();\n $this->assertXPathCount(3, $output, '//parameter[@value=333]');\n }", "public function replace(array $parameters = [])\n {\n $this->parameters = $parameters;\n\n return $this;\n }", "private function setParams($statement, $parameters = array()){\n\t\tforeach ($parameters as $key => $value) { ///percorrer as linhas rows\n\t\t\t$this->setParam($key,$value);///percorer as colunas ID\n\t\t}\n\t}", "protected function specifyParameters()\n {\n // We will loop through all of the arguments and options for the command and\n // set them all on the base command instance. This specifies what can get\n // passed into these commands as \"parameters\" to control the execution.\n foreach ($this->getArguments() as $arguments) {\n call_user_func_array([$this, 'addArgument'], $arguments);\n }\n foreach ($this->getOptions() as $options) {\n call_user_func_array([$this, 'addOption'], $options);\n }\n }", "public function addParams($parameters){\n\t\t\tif(is_array($parameters)){\n\t\t\t\tforeach ($parameters as $key=>$value) {\n\t\t\t\t\t$this->addParam($key, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public function setParameters(array $params) {\n foreach ($params as $pName => $pValue) {\n $this->setParameter($pName, $pValue);\n }\n }", "public function setQueryParameters(array $parameters): self\n\t{\n\t\tforeach ($parameters as $key => $value)\n\t\t{\n\t\t\tself::validateQueryParameter($key, $value);\n\t\t}\n\t\t\n\t\t$this->parameters = new Parameters($parameters);\n\t\t\n\t\treturn $this;\n\t}", "function setValues($list) {\n global $params;\n if ( count($list )) {\n foreach ($list as $k => $v ) {\n $params[$k] = $v;\n }\n }\n}", "public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n //Creating array containing variable IDs in List\n $variableIDs = [];\n $variableList = json_decode($this->ReadPropertyString('VariableList'), true);\n foreach ($variableList as $line) {\n $variableIDs[] = $line['VariableID'];\n }\n\n //Creating links for all variable IDs in VariableList\n foreach ($variableList as $line) {\n $variableID = $line['VariableID'];\n $this->RegisterMessage($variableID, VM_UPDATE);\n $this->RegisterReference($variableID);\n if (!@$this->GetIDForIdent('Link' . $variableID)) {\n\n //Create links for variables\n $linkID = IPS_CreateLink();\n IPS_SetParent($linkID, $this->InstanceID);\n IPS_SetLinkTargetID($linkID, $variableID);\n IPS_SetIdent($linkID, 'Link' . $variableID);\n\n //Setting initial visibility\n IPS_SetHidden($linkID, (GetValue($variableID) == $this->GetSwitchValue($variableID)));\n }\n }\n\n //Deleting unlisted links\n foreach (IPS_GetChildrenIDs($this->InstanceID) as $linkID) {\n if (IPS_LinkExists($linkID)) {\n if (!in_array(IPS_GetLink($linkID)['TargetID'], $variableIDs)) {\n $this->UnregisterMessage(IPS_GetLink($linkID)['TargetID'], VM_UPDATE);\n $this->UnregisterReference(IPS_GetLink($linkID)['TargetID']);\n $this->UnregisterReference($linkID);\n IPS_DeleteLink($linkID);\n }\n }\n }\n }", "public function replaceParamsObject()\n {\n // Additional code that will run immediately after the service is created\n $this->container->extend('params', function (FrameworkParams $frameworkParamsObject, $container) {\n\n // Extract the framework Params class instance's registry object\n $reflectionClass = new \\ReflectionClass($frameworkParamsObject);\n\n /** @var \\ReflectionProperty $params */\n $paramsReflector = $reflectionClass->getProperty('params');\n\n // 'params' property of framework Params class has private visibility\n $paramsReflector->setAccessible(true);\n $frameworkRegistry = $paramsReflector->getValue($frameworkParamsObject);\n\n $jobBoardRegistry = new Registry($container);\n $jobBoardRegistry->merge($frameworkRegistry);\n\n $jobBoardParams = new JobBoardParams($container);\n $jobBoardParams->setParamsObject($jobBoardRegistry);\n\n return $jobBoardParams;\n });\n }", "public function withParameters($parameters = [])\n {\n $this->parameters = $parameters;\n\n return $this;\n }", "public function purgeUnreferencedParametersValue()\n {\n require_once('class/Class.WIFF.php');\n\n $wiff = WIFF::getInstance();\n\n $xml = $wiff->loadContextsDOMDocument();\n if ($xml === false) {\n $this->errorMessage = sprintf(\"Error lopading 'contexts.xml': %s\", $wiff->errorMessage);\n return false;\n }\n\n $xpath = new DOMXPath($xml);\n\n $parametersValueNodeList = $xpath->query(sprintf(\"/contexts/context[@name='%s']/parameters-value/param\", $this->name));\n if ($parametersValueNodeList->length <= 0) {\n return true;\n }\n\n $purgeNodeList = array();\n for ($i = 0; $i < $parametersValueNodeList->length; $i++) {\n /**\n * @var DOMElement $pv\n */\n $pv = $parametersValueNodeList->item($i);\n if ($pv->getAttribute('volatile') == 'yes' || $pv->getAttribute('volatile') == 'Y') {\n /* Purge volatile parameters */\n array_push($purgeNodeList, $pv);\n } else {\n $moduleName = $pv->getAttribute('modulename');\n $module = $this->getModule($moduleName);\n if ($module === false) {\n /* If the parameter's module does not exists, then try to find an\n * installed module which replaces this missing parameter's module.\n */\n $newModule = $this->getModuleReplaced($moduleName);\n if ($newModule === false) {\n /* Purge the parameter as it belongs to nobody */\n array_push($purgeNodeList, $pv);\n } else {\n /* Re-affect the parameter to this new module */\n $pv->setAttribute('modulename', $newModule->name);\n }\n }\n }\n }\n\n foreach ($purgeNodeList as $node) {\n /**\n * @var DOMElement $node\n */\n $node->parentNode->removeChild($node);\n }\n\n $ret = $wiff->commitDOMDocument($xml);\n if ($ret === false) {\n $this->errorMessage = sprintf(\"Error saving contexts.xml '%s': %s\", $wiff->contexts_filepath, $wiff->errorMessage);\n return false;\n }\n\n return true;\n }", "public function setParams(array $params);", "public function setParams(array $params);", "public function setParams(array $params);", "public function setParams($params) {\n\t\t$this->params = array();\n\t\t$this->addParams($params);\n\t}", "private function specifyParameters(): void\n {\n // We will loop through all of the arguments and options for the command and\n // set them all on the base command instance. This specifies what can get\n // passed into these commands as \"parameters\" to control the execution.\n foreach ($this->getArguments() as $arguments) {\n $this->addArgument(...$arguments);\n }\n\n foreach ($this->getOptions() as $options) {\n $this->addOption(...$options);\n }\n }", "public function addParameters(\\Vitess\\Proto\\Automation\\EnqueueClusterOperationRequest\\ParametersEntry $value){\n return $this->_add(2, $value);\n }", "public function setParams($params)\n {\n $this->_params = $params;\n }", "public function setParams($params)\n {\n $this->_params = $params;\n }", "private function parseParams($params)\n {\n if (is_array($params)) {\n foreach ($params as $key => $param) {\n if (array_key_exists($key, $this->map)) {\n $setter = 'set'.ucfirst(($this->map[$key]));\n $this->$setter($param);\n }\n }\n }\n return $this;\n }", "public function setParameterValues(array $parameters): void\n {\n $this->parameterValues = $parameters;\n }", "public function setParams($params) {\n $this->params = $params;\n }", "public function setParams($params)\n {\n $this->params = $params;\n return $this;\n }", "public function parameters(array $params)\n\t{\n\t\t$this->parameters = $params + $this->parameters;\n\n\t\treturn $this;\n\t}", "public function setParams($params){\r\n $this->params=$params;\r\n }", "public static function updateSettings($data) {\n \n $db = Database::instance();\n $db->beginTransaction();\n \n try {\n \n foreach($data as $paramName => $paramValue) {\n $db->query('UPDATE settings SET param_value = ? WHERE param_name = ?', array($paramValue, $paramName));\n }\n \n $db->commit();\n \n self::clearAllSettingsCache();\n \n } catch (Exception $ex) {\n $db->rollback();\n }\n }", "function storeParameters()\n {\n }", "function mongo_node_mass_update($entity_type, $entities, $args) {\n foreach ($entities as $entity_id) {\n $entity = entity_get_controller($entity_type)->load(array($entity_id));\n $entity = reset($entity);\n // Skip if not updates.\n if (!isset($args['updates'])) {\n continue;\n }\n foreach ($args['updates'] as $p_name => $p_val) {\n $entity->$p_name = $p_val;\n }\n entity_save($entity_type, $entity);\n }\n}" ]
[ "0.6154143", "0.54503316", "0.5191981", "0.5166786", "0.51637626", "0.513689", "0.50782436", "0.5043711", "0.5033503", "0.50106966", "0.50103676", "0.50025725", "0.4985237", "0.49577144", "0.49391407", "0.4929261", "0.49193248", "0.4877203", "0.48508462", "0.48508462", "0.48359138", "0.47689894", "0.47327328", "0.47264963", "0.46952114", "0.46442792", "0.46306837", "0.46185997", "0.45813537", "0.45692053", "0.45549557", "0.4551911", "0.45314014", "0.45282337", "0.45254388", "0.45254388", "0.45204395", "0.45189613", "0.4516766", "0.45100582", "0.4500621", "0.4499876", "0.44977412", "0.44915202", "0.4487294", "0.44812974", "0.44812974", "0.4469994", "0.4463082", "0.44340843", "0.44237357", "0.44086698", "0.4408295", "0.4403447", "0.43862253", "0.43801937", "0.43776864", "0.43558052", "0.43470666", "0.43462798", "0.43384793", "0.43323794", "0.43223166", "0.43100417", "0.42940274", "0.42909884", "0.42860305", "0.4280982", "0.42647156", "0.42555878", "0.42544487", "0.42528984", "0.42363423", "0.4232008", "0.4224373", "0.42189354", "0.4218493", "0.42151487", "0.42140192", "0.42134842", "0.42132488", "0.41992489", "0.4198513", "0.41940197", "0.41940197", "0.41940197", "0.41890916", "0.4183055", "0.4181504", "0.41702732", "0.41702732", "0.4169608", "0.41583586", "0.4154041", "0.41491023", "0.41468978", "0.4144842", "0.41363755", "0.41352656", "0.41255465" ]
0.67549556
0
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. (instances.getIamPolicy)
public function getIamPolicy($resource, $optParams = array()) { $params = array('resource' => $resource); $params = array_merge($params, $optParams); return $this->call('getIamPolicy', array($params), "Google_Service_CloudMemorystoreforMemcached_Policy"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIamPolicy($resource, $optParams = [])\n {\n $params = ['resource' => $resource];\n $params = array_merge($params, $optParams);\n return $this->call('getIamPolicy', [$params], Policy::class);\n }", "public function getIamPolicy($resource, $optParams = [])\n {\n $params = ['resource' => $resource];\n $params = array_merge($params, $optParams);\n return $this->call('getIamPolicy', [$params], Policy::class);\n }", "public function getIamPolicy($resource, $optParams = [])\n {\n $params = ['resource' => $resource];\n $params = array_merge($params, $optParams);\n return $this->call('getIamPolicy', [$params], GoogleIamV1Policy::class);\n }", "public function getIamPolicy($resource, $optParams = [])\n {\n $params = ['resource' => $resource];\n $params = array_merge($params, $optParams);\n return $this->call('getIamPolicy', [$params], GoogleIamV1Policy::class);\n }", "public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])\n {\n $params = ['resource' => $resource, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('getIamPolicy', [$params], Policy::class);\n }", "public function getIamPolicy()\n {\n return isset($this->iam_policy) ? $this->iam_policy : null;\n }", "public function getPolicy(mixed $resource): mixed;", "public function getAuthorizationPolicy()\n {\n return $this->authorization_policy;\n }", "public function getPolicy($capability) {\n // them the same as the project's policies.\n switch ($capability) {\n case PhabricatorPolicyCapability::CAN_VIEW:\n return PhabricatorPolicies::getMostOpenPolicy();\n case PhabricatorPolicyCapability::CAN_EDIT:\n return PhabricatorPolicies::POLICY_USER;\n }\n }", "protected function policy()\n {\n return $this->gate()->getPolicyFor($this);\n }", "public function getPolicy()\n {\n return Controllers\\PolicyController::getInstance();\n }", "public function getPolicy($capability) {\n return PhabricatorPolicies::POLICY_USER;\n }", "public function getAuthorizationPolicyId()\n {\n return $this->authorization_policy_id;\n }", "public function GetIamPolicy(\\Google\\Cloud\\Iam\\V1\\GetIamPolicyRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.securitycenter.v1.SecurityCenter/GetIamPolicy',\n $argument,\n ['\\Google\\Cloud\\Iam\\V1\\Policy', 'decode'],\n $metadata, $options);\n }", "public function getAclResource()\n {\n if (!array_key_exists(EntityDefinitionConfig::ACL_RESOURCE, $this->items)) {\n return null;\n }\n\n return $this->items[EntityDefinitionConfig::ACL_RESOURCE];\n }", "public function getPolicyID()\n {\n return $this->policyID;\n }", "public function getInstanceSchedulePolicy()\n {\n return $this->instance_schedule_policy;\n }", "public function getChildPolicy()\n {\n return $this->child_policy;\n }", "public function getPolicies()\n {\n return $this->policies;\n }", "public function getAcl()\n {\n if (!$this->_acl instanceof P4Cms_Acl) {\n throw new P4Cms_Acl_Exception(\n \"Cannot get acl. No acl has been set.\"\n );\n }\n\n return $this->_acl;\n }", "public function toPolicy()\n {\n return new Policy($this->calls);\n }", "static public function GetPolicyKey() {\n if (isset(self::$policykey))\n return self::$policykey;\n else\n return false;\n }", "public function policy($force_new = false)\n\t{\n\t\tif ((! $force_new) && (! is_null($this->policy))) {\n\t\t\treturn $this->policy;\n\t\t}\n\n\t\treturn $this->policy = policy($this->policy_class);\n\t}", "public function Policies()\n\t{\n\t\treturn $this->hasMany('\\App\\ThunderID\\OrganisationManagementV1\\Models\\Policy');\n\t}", "public function policy(Policy $policy = null)\n {\n if(null === $policy)\n {\n return $this->child('policy');\n }\n return $this->child('policy', $policy);\n }", "public function getAcl()\n {\n return $this->_acl;\n }", "public function getAcl()\n {\n return $this->acl;\n }", "public function getAcl()\n {\n return $this->acl;\n }", "public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])\n {\n $params = ['resource' => $resource, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('setIamPolicy', [$params], Policy::class);\n }", "public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])\n {\n $params = ['resource' => $resource, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('setIamPolicy', [$params], Policy::class);\n }", "public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])\n {\n $params = ['resource' => $resource, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('setIamPolicy', [$params], Policy::class);\n }", "public function getAppManagementPolicies()\n {\n if (array_key_exists(\"appManagementPolicies\", $this->_propDict)) {\n return $this->_propDict[\"appManagementPolicies\"];\n } else {\n return null;\n }\n }", "public function setIamPolicy($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\DataFusion\\V1beta1\\IAMPolicy::class);\n $this->iam_policy = $var;\n\n return $this;\n }", "public function get($name, $optParams = [])\n {\n $params = ['name' => $name];\n $params = array_merge($params, $optParams);\n return $this->call('get', [$params], GoogleChromePolicyVersionsV1PolicySchema::class);\n }", "public function getAcl()\n {\n if (!isset($this->persistent->acl)) {\n\n $acl = new AclList();\n\n $acl->setDefaultAction(Acl::DENY);\n\n $config = $this->getDi()->getConfig();\n\n $roles = $config->acl->roles;\n foreach ($roles as $name => $description) {\n $acl->addRole(new Role($name, $description));\n }\n \n //Private area resources\n $privateResources = $config->acl->resources->private->toArray();\n foreach ($privateResources as $resource => $actions) {\n $acl->addResource(new Resource($resource), $actions);\n }\n\n //Public area resources\n $publicResources = $config->acl->resources->public->toArray();\n foreach ($publicResources as $resource => $actions) {\n $acl->addResource(new Resource($resource), $actions);\n }\n\n //Grant access to public areas to all roles\n foreach ($roles as $name => $description) {\n foreach ($publicResources as $resource => $actions) {\n foreach ($actions as $action) {\n $acl->allow($name, $resource, $action);\n }\n }\n }\n\n //Grant access to private area to role admin\n foreach ($privateResources as $resource => $actions) {\n foreach ($actions as $action) {\n $acl->allow('admin', $resource, $action);\n }\n }\n\n //The acl is stored in session, APC would be useful here too\n $this->persistent->acl = $acl;\n }\n\n return $this->persistent->acl;\n }", "public function getVoicemailPolicy()\n {\n list($response) = $this->getVoicemailPolicyWithHttpInfo();\n return $response;\n }", "public function getVpcAccess()\n {\n return $this->vpc_access;\n }", "public function getPolicyById(int $identifier) : ? PolicyEntity\n {\n $data = $this->getQueryAdapter()->fetchData(\n 'getPolicyById',\n [\n ':idPolicy' => $identifier\n ]\n );\n\n /** @var null|PolicyEntity $entity */\n $entity = $this->getEntity(PolicyEntity::class, $data[0] ?? []);\n\n return $entity;\n }", "public function getPolicyByName(string $name) : ? PolicyEntity\n {\n $data = $this->getQueryAdapter()->fetchData(\n 'getPolicyByName',\n [\n ':name' => $name\n ]\n );\n\n /** @var null|PolicyEntity $entity */\n $entity = $this->getEntity(PolicyEntity::class, $data[0] ?? []);\n\n return $entity;\n }", "public function policies()\n {\n return $this->hasMany(Policy::class);\n }", "public static function getAccessControlPolicy($bucket, $uri = '')\n\t{\n\t\t// TODO: Implement getAccessControlPolicy() method.\n\t}", "public function getUserSecurityPolicies(){\r\n return $this->userSecurityPolicies;\r\n }", "public function getRetentionPolicy()\n {\n return isset($this->retention_policy) ? $this->retention_policy : null;\n }", "public function getNegativeCachingPolicy()\n {\n return $this->negative_caching_policy;\n }", "public function getAcl()\n {\n if ($this->_acl instanceof \\Magento\\Framework\\Acl) {\n return $this->_acl;\n }\n\n try {\n $this->_acl = $this->_aclFactory->create();\n foreach ($this->_loaderPool as $loader) {\n $loader->populateAcl($this->_acl);\n }\n } catch (\\Exception $e) {\n throw new \\LogicException('Could not create an acl object: ' . $e->getMessage());\n }\n\n return $this->_acl;\n }", "public function getRetentionPolicy()\n {\n return $this->retention_policy;\n }", "public function getResource($resourceId)\n {\n /** @var AclResource $resource */\n $resourceData = $this->cache->get($resourceId);\n $resource = null;\n\n if ($resourceData !== null) {\n $resource = $this->aclResourceBuilder->build($resourceData);\n\n return $resource;\n }\n\n /** @var ResourceProviderInterface $resourceProvider */\n foreach ($this->resourceProviders as $resourceProvider) {\n $hasResource = $resourceProvider->hasResource($resourceId);\n if ($hasResource) {\n $resourceData = $resourceProvider->getResource($resourceId);\n /** @var AclResource $resource */\n $resource = $this->aclResourceBuilder->build($resourceData);\n // @todo Not required\n $resource->setProviderId($resourceProvider->getProviderId());\n $this->cache->set($resource);\n\n return $resource;\n }\n }\n\n return null;\n }", "public function getVoicemailPolicyAsync()\n {\n return $this->getVoicemailPolicyAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function getCacheKeyPolicy()\n {\n return $this->cache_key_policy;\n }", "public function getPolicyClass()\n\t{\n\t\treturn $this->policy_class;\n\t}", "public function listPolicy(User $user)\n {\n return $user->may(static::PERMISSION_LIST);\n }", "public function listPolicy(User $user)\n {\n return $user->may(static::PERMISSION_LIST);\n }", "protected function getResourceIfAllowed($resourceId, $grant = 'view')\n {\n $resource = $this->repository->find($resourceId, false);\n if (!$this->context->isGranted($grant, $resource)) {\n throw new AccessDeniedException();\n }\n\n return $resource;\n }", "public static function getActionsPolicy($id = null) {\n $user = JFactory::getUser();\n $result = new JObject;\n\n if (empty($id)) {\n $assetName = 'com_easysdi_service';\n } else {\n $assetName = 'com_easysdi_service.policy.' . (int) $id;\n }\n\n $actions = array(\n 'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.own', 'core.edit.state', 'core.delete'\n );\n\n foreach ($actions as $action) {\n $result->set($action, $user->authorise($action, $assetName));\n }\n\n return $result;\n }", "public function getPermissions(Roleable $resource = null);", "public function getAcl()\n {\n require_once \"AmfAcl.php\";\n return AmfAcl::staticInstance();\n }", "public function getPolicyValue()\n {\n return $this->policy_value;\n }", "public function getPermission()\n {\n return $this->permission ?: null;\n }", "public function getPrivacy() {\n\t\treturn $this->_getResponse(self::URL_PRIVACY);\n\t}", "public function getPolicyVersion()\n {\n return $this->policy_version;\n }", "function get_acl()\n{\n try {\n return Zend_Registry::get('bootstrap')->getResource('Acl');\n } catch (Zend_Exception $e) {\n return null;\n }\n}", "private function getPermissions()\n\t{\n\t\tif (!isset($this->permissions)) {\n\t\t\t$this->permissions = $this->permissions()->get();\n\t\t}\n\t\treturn $this->permissions;\n\t}", "public function getPermission()\n {\n return $this->permission;\n }", "function data_privacy_policy() {\n return $this->db->get('t_page_privacy_policy');\n }", "public function policy()\n {\n $return = array();\n\n // Itterate over policy rules\n foreach( $this->rules as $k => $v )\n {\n // If rule is enabled, add string to array\n $string = $this->get_rule_error($k);\n if( $string ) $return[$k] = $string;\n }\n\n return $return;\n }", "public function getPrivacy()\n {\n return $this->getResponse(self::URL_PRIVACY);\n }", "public function getACL(){\n\t\tif(!isset($this->subsite_acl_cache)){\n\t\t\t$this->subsite_acl_cache = false;\n\n\t\t\t$query = \"SELECT value\";\n\t\t\t$query .= \" FROM \" . get_config(\"dbprefix\") . \"private_settings\";\n\t\t\t$query .= \" WHERE name = 'subsite_acl'\";\n\t\t\t$query .= \" AND entity_guid = \" . $this->getGUID();\n\n\t\t\tif($setting = get_data_row($query)){\n\t\t\t\t$this->subsite_acl_cache = $setting->value;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->subsite_acl_cache;\n\t}", "public function setAuthorizationPolicyId($var)\n {\n GPBUtil::checkString($var, True);\n $this->authorization_policy_id = $var;\n\n return $this;\n }", "public function getPermissionsListAttribute()\n {\n return Permission::orderBy('resource')->get();\n }", "public function getRestartPolicy()\n {\n return $this->_restartPolicy;\n }", "public function getNetworkSwitchAccessPolicy($network_id, $access_policy_number)\n {\n list($response) = $this->getNetworkSwitchAccessPolicyWithHttpInfo($network_id, $access_policy_number);\n return $response;\n }", "public function getPolicyListByResource(\n int $resourceId,\n int $limit = QueryInterface::MAX_ROW_LIMIT,\n int $offset = 0\n ) : EntitySet {\n $this->normalizeLimitAndOffset($limit, $offset);\n\n $data = $this->getQueryAdapter()->fetchData(\n 'getPolicyListByResource',\n [\n ':idResource' => $resourceId,\n ':limit' => $limit,\n ':offset' => $offset\n ]\n );\n\n return $this->getEntitySet(PolicyEntity::class, $data);\n }", "public function getPermissions()\n {\n return $this->get(self::PERMISSIONS);\n }", "public function get($name, $optParams = [])\n {\n $params = ['name' => $name];\n $params = array_merge($params, $optParams);\n return $this->call('get', [$params], PolicyBasedRoute::class);\n }", "public function getPolicyByHostname($name)\n {\n if (! $this->inventory->hasHost($name)) {\n return array();\n }\n\n $policy = array();\n $host = $this->inventory->getHost($name);\n\n foreach ($this->inventory->getHostGroupsByHost($host) as $group) {\n $policy = array_replace_recursive($policy, $group->getFirewallPolicy());\n }\n\n return array_replace_recursive($policy, $host->getFirewallPolicy());\n }", "public function getNetworkGroupPolicy($network_id, $group_policy_id)\n {\n list($response) = $this->getNetworkGroupPolicyWithHttpInfo($network_id, $group_policy_id);\n return $response;\n }", "public function authorize(IPrincipal $user, AuthorizationPolicy|string $policy, object $resource = null): AuthorizationResult;", "public function getBucketPolicy($bucket)\n\t{\n\t\t$url = 'https://' . $bucket . '.' . $this->options->get('api.url') . '/?policy';\n\n\t\t// Send the request and process the response\n\t\treturn $this->commonGetOperations($url);\n\t}", "public function getUnloadingPolicy()\n {\n return $this->unloading_policy;\n }", "public function get() {\n $context = new RenderContext();\n \n $permissions = $this->renderer->executeInRenderContext($context, function () {\n $permissions = $this->permissionHandler->getPermissions();\n foreach ($permissions as $id => $permission) {\n $permissions[$id]['id'] = $id;\n $permissions[$id]['provider_label'] = $this->moduleExtensionList->getName($permissions[$id]['provider']);\n // @todo Make a helper method to automatically render elements.\n if (is_array($permissions[$id]['description'])) {\n $permissions[$id]['description'] = $this->renderer->render($permissions[$id]['description']);\n }\n };\n return array_values($permissions);\n });\n\n $response = new ResourceResponse($permissions);\n $response->addCacheableDependency($context);\n return $response;\n }", "public function getPermissions() {\r\n $template = $this->getOne('Template');\r\n if (empty($template)) return array();\r\n\r\n /* get permissions for policy */\r\n $c = $this->xpdo->newQuery('modAccessPermission');\r\n $c->sortby('name','ASC');\r\n $permissions = $template->getMany('Permissions',$c);\r\n\r\n $data = $this->get('data');\r\n $lexicon = $template->get('lexicon');\r\n $list = array();\r\n /** @var modAccessPermission $permission */\r\n foreach ($permissions as $permission) {\r\n $desc = $permission->get('description');\r\n if (!empty($lexicon) && $this->xpdo->lexicon) {\r\n if (strpos($lexicon,':') !== false) {\r\n $this->xpdo->lexicon->load($lexicon);\r\n } else {\r\n $this->xpdo->lexicon->load('core:'.$lexicon);\r\n }\r\n $desc = $this->xpdo->lexicon($desc);\r\n }\r\n $active = array_key_exists($permission->get('name'),$data) && $data[$permission->get('name')] ? 1 : 0;\r\n $list[] = array(\r\n $permission->get('name'),\r\n $permission->get('description'),\r\n $desc,\r\n $permission->get('value'),\r\n $active,\r\n );\r\n }\r\n return $list;\r\n }", "protected function policyCode(){\n return $this->policyCode;\n }", "static function getPermission($name) {\n return static::getPermissions()->get($name);\n }", "public function getAccess()\n {\n if (array_key_exists(\"access\", $this->_propDict)) {\n if (is_a($this->_propDict[\"access\"], \"\\Beta\\Microsoft\\Graph\\Model\\AccessAction\") || is_null($this->_propDict[\"access\"])) {\n return $this->_propDict[\"access\"];\n } else {\n $this->_propDict[\"access\"] = new AccessAction($this->_propDict[\"access\"]);\n return $this->_propDict[\"access\"];\n }\n }\n return null;\n }", "public function setAuthorizationPolicy($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\NetworkSecurity\\V1\\AuthorizationPolicy::class);\n $this->authorization_policy = $var;\n\n return $this;\n }", "public function getPrivacyPolicy() {\n return view('customer.privacy-policy')->with('api',true);\n }", "public static function getCurrentAclResources()\n {\n return self::$currentAclResources;\n }", "public function permissions()\n\t{\n\t\treturn $this->get('permissions');\n\t}", "private static function getSystemSecurityPolicyCached()\n {\n get_instance()->load->library('Cachedobjectmanager');\n\n $policy_name = '_system_security_policy';\n return get_instance()->cachedobjectmanager->get($policy_name, self::$cached_objects_collection_name, 3600 * 24,\n function () {\n get_instance()->load->library('SecurityPolicy');\n return get_instance()->securitypolicy->getSystemSecurityPolicy();\n }\n );\n }", "public function getPolicyNumber()\n {\n return $this->policyNumber;\n }", "public function permissions() {\n\t$this->loadPermissions();\n\treturn $this->permissions;\n}", "public function getFallbackPolicy()\n {\n return $this->fallback_policy;\n }", "public function getAutoscaling()\n {\n return $this->autoscaling;\n }", "public static function getAcl()\n {\n return self::getActions();\n }", "function ACL() {\n\t\t\treturn new S3ACL($this->__bucket, FALSE, $this->GetAWSKeyId(), $this->GetSecretKey());\n\t\t}", "public function getRequiredPermissions()\n {\n return $this->requiredPermissions;\n }", "public function get_permissions()\n\t{\n\t\treturn $this->area->get_permissions($this->path);\n\t}", "public function getGrantControls()\n {\n if (array_key_exists(\"grantControls\", $this->_propDict)) {\n if (is_a($this->_propDict[\"grantControls\"], \"\\Microsoft\\Graph\\Model\\ConditionalAccessGrantControls\") || is_null($this->_propDict[\"grantControls\"])) {\n return $this->_propDict[\"grantControls\"];\n } else {\n $this->_propDict[\"grantControls\"] = new ConditionalAccessGrantControls($this->_propDict[\"grantControls\"]);\n return $this->_propDict[\"grantControls\"];\n }\n }\n return null;\n }", "public function getResource() {\n $resource = false;\n if (isset($this->_resource)) {\n $resource = $this->_resource;\n }\n\n return $resource;\n }", "public function getResource()\n\t{\n\t\tif($this->resource === null) {\n\t\t\t$this->connect();\n\t\t}\n\n\t\treturn $this->resource;\n\t}" ]
[ "0.7502546", "0.7502546", "0.7328576", "0.7328576", "0.7262742", "0.6871538", "0.6391005", "0.6086077", "0.6045683", "0.5912826", "0.5787457", "0.52523154", "0.52466166", "0.52409846", "0.5178083", "0.50797904", "0.5046584", "0.4993362", "0.49406746", "0.4888249", "0.48804507", "0.4867342", "0.48114014", "0.47504523", "0.4742271", "0.47220817", "0.47193873", "0.47193873", "0.47188833", "0.47188833", "0.47188833", "0.47017795", "0.46915108", "0.46733", "0.46352094", "0.4620474", "0.45715633", "0.4547795", "0.45246208", "0.45119947", "0.44836423", "0.44636694", "0.44607216", "0.4459482", "0.4447249", "0.44429532", "0.44320896", "0.44008148", "0.4384048", "0.43781748", "0.43756336", "0.43756336", "0.43612418", "0.43344265", "0.43268892", "0.43070054", "0.42792267", "0.42783445", "0.4277532", "0.42755875", "0.42745164", "0.42664266", "0.42636132", "0.42241663", "0.42191878", "0.42140806", "0.42008838", "0.4196688", "0.41962662", "0.41949472", "0.41866022", "0.4185905", "0.41854703", "0.41831264", "0.41819486", "0.41810492", "0.4167996", "0.4167638", "0.41638368", "0.4162589", "0.41625142", "0.41323215", "0.41200078", "0.41150573", "0.4104833", "0.4101189", "0.40979013", "0.40976867", "0.4092555", "0.40915996", "0.40910476", "0.4088275", "0.40849003", "0.40845346", "0.40800586", "0.4053869", "0.40477517", "0.4039385", "0.40304092", "0.40173176" ]
0.6221031
7
Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permissionaware UIs and commandline tools, not for authorization checking. This operation may "fail open" without warning. (instances.testIamPermissions)
public function testIamPermissions($resource, Google_Service_CloudMemorystoreforMemcached_TestIamPermissionsRequest $postBody, $optParams = array()) { $params = array('resource' => $resource, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('testIamPermissions', array($params), "Google_Service_CloudMemorystoreforMemcached_TestIamPermissionsResponse"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testIamPermissions($resource, $optParams = [])\n {\n $params = ['resource' => $resource];\n $params = array_merge($params, $optParams);\n return $this->call('testIamPermissions', [$params], GoogleIamV1TestIamPermissionsResponse::class);\n }", "public function getPermissions(Roleable $resource = null);", "public function getPossiblePermissions();", "public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])\n {\n $params = ['resource' => $resource, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);\n }", "public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])\n {\n $params = ['resource' => $resource, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);\n }", "public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])\n {\n $params = ['resource' => $resource, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);\n }", "public function getPermissions();", "public function getPermissions() {}", "public function getPermissions() {}", "abstract public function getPermissions();", "public function testIamPermissions($resource, GoogleIamV1TestIamPermissionsRequest $postBody, $optParams = [])\n {\n $params = ['resource' => $resource, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('testIamPermissions', [$params], GoogleIamV1TestIamPermissionsResponse::class);\n }", "public function & GetPermissions ();", "public function testPermissionsAreReturned()\n {\n /** @var \\Pterodactyl\\Models\\User $user */\n $user = factory(User::class)->create();\n\n $this->actingAs($user)\n ->getJson('/api/client/permissions')\n ->assertOk()\n ->assertJson([\n 'object' => 'system_permissions',\n 'attributes' => [\n 'permissions' => Permission::permissions()->toArray(),\n ],\n ]);\n }", "public function getEvaluatePermissions() {}", "public function getAllPermissions();", "public function getAllPermissions();", "public function get_permissions()\n\t{\n\t\treturn $this->area->get_permissions($this->path);\n\t}", "public function allowedPermissions()\n {\n return $this->permissions()->wherePivot('has_access', true)->orderBy('name');\n }", "public function getPermissionsListAttribute()\n {\n return Permission::orderBy('resource')->get();\n }", "public function permissions() {\n\t$this->loadPermissions();\n\treturn $this->permissions;\n}", "public function getPermissions()\n {\n return $this->get(self::PERMISSIONS);\n }", "public function get_available_permissions()\n {\n try {\n $url = $this->get_url(\"graph\", \"me\", array(\"metadata\" => \"1\"));\n $data = $this->api_call($url);\n //echo $url;\n } catch (Exception $ex) {\n print_r($ex->getMessage());\n exit;\n }\n\n return $this->convert_array_to_object($data->metadata);\n }", "public function getPermissions()\n\t{\n\t\tif(isset($this->permissions))\n\t\t{\n\t\t\treturn $this->permissions;\n\t\t}\n\n\t\t$request = new ColoCrossing_Http_Request('/', 'GET');\n\t\t$executor = $this->getHttpExecutor();\n\t\t$response = $executor->executeRequest($request);\n\t\t$content = $response->getContent();\n\n\t\treturn $this->permissions = isset($content) && isset($content['permissions']) ? $content['permissions'] : array();\n\t}", "public function getPermissions()\n {\n return $this->permissions;\n }", "public function getPermissions()\n {\n return $this->permissions;\n }", "public function getPermissions()\n {\n return $this->permissions;\n }", "protected function getPermissions()\n {\n return Permission::with('roles')->get();\n }", "public function permissions()\n\t{\n\t\treturn $this->get('permissions');\n\t}", "function getPermissions(&$record){\n $auth =& Dataface_AuthenticationTool::getInstance();\n $user =& $auth->getLoggedInUser();\n if ( !isset($user) ) return Dataface_PermissionsTool::READ_ONLY();\n // if the user is null then nobody is logged in... read only\n $role = $user->val('Role');\n return Dataface_PermissionsTool::getRolePermissions($role);\n // Returns all of the permissions for the user's current role.\n }", "private function getPermissions()\n\t{\n\t\tif (!isset($this->permissions)) {\n\t\t\t$this->permissions = $this->permissions()->get();\n\t\t}\n\t\treturn $this->permissions;\n\t}", "function getPermissions() {\n // For eficientcy, we will just store the names, not the objects\n if ( is_null($this->allPermissions) ) {\n $tmpRole = FactoryObject::newObject(\"_Permission\");\n $this->allPermissions = $tmpRole ->getAllPermissionByIdRole($this->getId());\n } \n\n return $this->allPermissions;\n }", "public function permissions()\n {\n return $this->permissions;\n }", "protected function getPermissions()\n {\n if (!$this->tablePermissionsExists()) {\n return [];\n }\n return Permission::with('roles')->get();\n }", "public function permissions() : ?array\n {\n if ($apiRoot = $this->request('GET', $this->identity->getUrl('/')))\n {\n $payload = $apiRoot->getPayload();\n\n if (isset($payload['permissions']) && is_array($payload['permissions']))\n {\n return $payload['permissions'];\n }\n }\n\n return null;\n }", "public function getFilePermissionsReturnsCorrectPermissionsForFilesNotOwnedByCurrentUser_dataProvider() {}", "public function getAllPermissions(): array;", "function getPermissions(&$record){\n $auth =& Dataface_AuthenticationTool::getInstance();\n $user =& $auth->getLoggedInUser();\n if ( $user ) return Dataface_PermissionsTool::ALL();\n return Dataface_PermissionsTool::NO_ACCESS();\n }", "public function checkPermissions();", "public function getPermissionByResourceAndAction($resources){\n\t\t// its ok since this going to end up as or\n\t\tforeach($resources as $resource=>$actions){\n\t\t\tforeach($actions as $action){\t\t\t\t\n\t\t\t\t$permissions = Permission::Where(function($query) use ($resource, $action){\n\t\t\t\t\t$query->where('resource', $resource)->where('action', $action);\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\t\t\n\n\t\t// continue chaining\n\t\tforeach($resources as $resource=>$actions){\n\t\t\tforeach($actions as $action){\t\t\t\t\n\t\t\t\t$permissions->orWhere(function($query) use ($resource, $action){\n\t\t\t\t\t$query->where('resource', $resource)->where('action', $action);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn $permissions->get();\n\t}", "public function getUserPermissions()\n {\n $headers = ['Ability', 'Role'];\n\n $user = $this->user->find($this->argument('needle'));\n if ($user) {\n $permissions = $user->abilities;\n\n if (!is_array($permissions)) {\n $permissions = [];\n }\n\n foreach ($permissions as $module=>$permission) {\n $this->warn(\"\\n\" . strtoupper($module));\n $data = [];\n foreach ($permission as $ability=>$perm) {\n $vals = [$ability];\n if (is_bool($perm)) {\n if ($perm) {\n $vals[] = 'true';\n } else {\n $vals[] = 'false';\n }\n }\n if (is_string($perm)) {\n $vals[] = $perm;\n }\n $data[] = $vals;\n }\n $this->table($headers, $data);\n }\n\n } else {\n $this->error(\"No user found!\");\n }\n }", "public function getAllPermissions()\n {\n return $this->repository->getAllPermissions();\n }", "public function getAllPermissionsForUser($user): array;", "public static function getAllPermissions()\n\t{\n\t\treturn Permission::all();\n\t}", "public function can($permissions);", "public function listPermissions($user) {\n return $user->permissions;\n }", "public function getPermissions(): array {\n\t\treturn [];\n\t}", "function getPermissions(&$record){\n\t\t$auth =& Dataface_AuthenticationTool::getInstance();\n\t\t$user =& $auth->getLoggedInUser();\n\t\t//\n\t\t// This returns permissions of ALL for admin, no access when there is no user, and by role if there is a user logged in. 2014-06-08. David Gleba.\n\t\t//\n\t\tif ( !isset($user) ){\n\t\t\treturn Dataface_PermissionsTool::NO_ACCESS(); \t\t\t\t// if the user is null then nobody is logged in... no access. This will force a login prompt. \n\t\t} else if ($user and $user->val('Role') == 'ADMIN'){\n\t\t\treturn Dataface_PermissionsTool::ALL();\t\t\t\t\t\t//returns all permissions if user is ADMIN\n\t\t} else {\n\t\t\t$role = $user->val('Role');\n\t\t\treturn Dataface_PermissionsTool::getRolePermissions($role); // Returns the permissions based on the user's current role.\n\t\t}\n\t}", "public function getPermissions()\r\n {\r\n return $this->getGuardUser()->getPermissions();\r\n }", "public function getRolePermissions()\n {\n $headers = ['Ability', 'Role'];\n\n $role_name = $this->argument('needle');\n\n $role = $this->permission->findBy('role_name', $role_name);\n if ($role) {\n $permissions = json_to_array($role->permission);\n\n if (!is_array($permissions)) {\n $permissions = [];\n }\n\n foreach ($permissions as $module=>$permission) {\n $this->warn(\"\\n\" . strtoupper($module));\n $data = [];\n\n foreach ($permission as $ability=>$perm) {\n $vals = [$module, $ability];\n if (is_bool($perm)) {\n if ($perm) {\n $vals[] = 'true';\n } else {\n $vals[] = 'false';\n }\n }\n if (is_string($perm)) {\n $vals[] = $perm;\n }\n $data[] = $vals;\n }\n $this->table($headers, $data);\n }\n\n } else {\n $this->error(\"No role found!\");\n }\n }", "public function getRequiredPermissions()\n {\n return $this->requiredPermissions;\n }", "public function getCustomerResultPermissions(): array;", "public function permissionsAvailable($filter = null)\n {\n $permissions = Permission::whereNotIn('permissions.id', function($query) {\n $query->select('permission_role.permission_id');\n $query->from('permission_role');\n $query->whereRaw(\"permission_role.role_id={$this->id}\");\n })\n ->where(function ($queryFilter) use ($filter) {\n if ($filter)\n $queryFilter->where('permissions.name', 'LIKE', \"%{$filter}%\");\n })\n ->paginate();\n\n return $permissions;\n }", "public function getPermissions(): array {\n\t\tif ($this->permissions === null) {\n\t\t\t$this->permissions = UserQueries::getUserPermissions($this->id);\n\t\t}\n\n\t\treturn $this->permissions;\n\t}", "public function permissions()\n {\n return $this->permissionModel->findAll();\n }", "public function getCurrentUserPermissions()\n {\n return $this->permissions()\n ->whereNull('expires_at')\n ->orWhere('expires_at', '>', now())\n ->get();\n }", "public function getObjectPermissions(): array;", "public function getPermissions() {\n\t\treturn $this->addressBookInfo['permissions'];\n\t}", "public function getPermissions() {\n return $this->getGuardUser()->getPermissions();\n }", "public function permissions()\n {\n if (is_array($this->permissions)) {\n return $this->permissions;\n }\n\n if ($this->permissions) {\n return [ $this->permissions ];\n }\n\n return [];\n }", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function TestIamPermissions(\\Google\\Cloud\\Iam\\V1\\TestIamPermissionsRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.securitycenter.v1.SecurityCenter/TestIamPermissions',\n $argument,\n ['\\Google\\Cloud\\Iam\\V1\\TestIamPermissionsResponse', 'decode'],\n $metadata, $options);\n }", "public function getAllAvailable()\n {\n return $this->allPermissions;\n }", "public function canAll($permissions, &$failed = null);", "public function Permissions($removeOverlap = false)\n\t{\n\t\t$permissions = array();\n\n\t\t// Get permissions based on member ID...\n\t\t// Be careful changing this because we append later!\n\t\t$q = \"SELECT ID FROM Permissions WHERE (ObjectID='$this->ID' AND ObjectType='Member') OR (\";\n\n\t\t// Now permissions based on callings for this member\n\t\t$callings = $this->Callings();\n\t\tforeach ($callings as $calling)\n\t\t\t$q .= \"ObjectID=\".$calling->ID().\" OR \";\n\n\t\t// Trim the trailing OR bit...\n\t\tif (strrpos('(', $q) == strlen($q) - 1)\n\t\t\t$q = substr($q, 0, strlen($q) - 5);\n\t\telse\n\t\t\t$q = substr($q, 0, strlen($q) - 4);\n\n\t\tif (count($callings) > 0)\n\t\t\t$q .= \" AND ObjectType='Calling')\"; // don't forget this\n\n\t\t$r = DB::Run($q);\n\n\t\twhile ($row = mysql_fetch_array($r))\n\t\t{\n\t\t\t$per = Permission::Load($row['ID']);\n\n\t\t\t// Prevent duplicates questions/overlap of permissions?\n\t\t\tif ($removeOverlap)\n\t\t\t{\n\t\t\t\t$found = false;\n\t\t\t\tforeach ($permissions as $p)\n\t\t\t\t{\n\t\t\t\t\tif ($p->QuestionID() == $per->QuestionID())\n\t\t\t\t\t{\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($found) continue;\n\t\t\t}\n\n\t\t\t$permissions[] = $per;\n\t\t}\n\n\t\treturn $permissions;\n\t}", "public function getPermissionsViaRole()\n {\n return $this->roles->map(function (Role $role) {\n return $role->getAllPermissions();\n })->flatten();\n }", "public static function getPermissions(): array\n {\n return [];\n }", "public function permissions()\n {\n\n return Permission::all();\n }", "public function getRequiredPermissions()\r\n\t{\r\n\t\treturn array();\r\n\t}", "public static function uses_permissions(): bool;", "public static function getUsersPermissions($resourceId)\n {\n return self::getRolePrivilegeRetriever()->retrieveByResourceIds([$resourceId]);\n }", "public function getRequiredPermissions()\n\t{\n\t\treturn array();\n\t}", "public static function getAllPermissions()\n {\n return Cache::rememberForever('permissions.all', function() {\n return self::all();\n });\n }", "public function getAllPermissions()\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->getAllPermissions() : array();\r\n }", "public function getPermissions()\n\t{\n\t\tif(!$this->id)\n\t\t\treturn array();\n $role= UserRole::model()->getUserRole($this);\n if(!$role->role_id){\n return array();\n }\n\t\t$permissions = array();\n\t\t$sql = \"SELECT pa.ACTION_ID AS id, pa.key from \". PermissionMap::model()->tableName().\" pm left join \". PermissionAction::model()->tableName().\" pa on pa.ACTION_ID = pm.permission_id where pm.type = '\".PermissionMap::TYPE_ROLE.\"' and pm.principal_id = {$role->role_id}\";\n\t\t\tforeach (Yii::app()->db->cache(500)->createCommand($sql)->query()->readAll() as $permission)\n\t\t\t\t$permissions[$permission['id']] = $permission['key'];\n\t\t\n\n\n\t\t// Direct user permission assignments\n\t\t$sql = \"select pa.ACTION_ID as id, pa.key from \". PermissionMap::model()->tableName().\" pm left join \". PermissionAction::model()->tableName().\" pa on pa.ACTION_ID = pm.permission_id where pm.type = '\".PermissionMap::TYPE_USER.\"' and pm.principal_id = {$this->id}\";\n\t\tforeach (Yii::app()->db->cache(500)->createCommand($sql)->query()->readAll() as $permission)\n\t\t\t$permissions[$permission['id']] = $permission['key'];\n\n\n\t\treturn $permissions;\n\t}", "public function getAllPermissions() {\n return $this->getGuardUser() ? $this->getGuardUser()->getAllPermissions() : array();\n }", "public function testThatGetPermissionsRequestIsFormattedProperly()\n {\n $api = new MockManagementApi( [ new Response( 200, self::$headers ) ] );\n\n $api->call()->users()->getPermissions(\n '__test_user_id__',\n [ 'per_page' => 3, 'page' => 2, 'include_totals' => 0 ]\n );\n\n $this->assertEquals( 'GET', $api->getHistoryMethod() );\n $this->assertStringStartsWith(\n 'https://api.test.local/api/v2/users/__test_user_id__/permissions?',\n $api->getHistoryUrl()\n );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'per_page=3', $query );\n $this->assertContains( 'page=2', $query );\n $this->assertContains( 'include_totals=false', $query );\n\n $headers = $api->getHistoryHeaders();\n $this->assertEquals( 'Bearer __api_token__', $headers['Authorization'][0] );\n $this->assertEquals( self::$expectedTelemetry, $headers['Auth0-Client'][0] );\n }", "static function getPermissions() {\n if(self::$permissions === false) {\n self::$permissions = new NamedList(array(\n\n ));\n\n EventsManager::trigger('on_system_permissions', array(&self::$permissions));\n } // if\n\n return self::$permissions;\n }", "public function getPermissions(): int\n {\n return $this->permissions;\n }", "public function permissionsAvailable($filter = null)\n {\n $permissions = Permission::whereNotIN('permissions.id', function($query){\n $query\n ->select('permission_role.permission_id')\n ->from('permission_role')\n ->whereRaw(\"permission_role.role_id={$this->id}\");\n })\n ->where(function($queryFilter) use($filter){\n if ($filter)$queryFilter->where('permissions.name', 'LIKE', \"%$filter%\");\n })\n ->paginate($this->num_pagination);\n //->toSql();\n //dd($permissions);\n\n return $permissions;\n }", "public function getAllPermission()\n {\n $query = $this->createQuery('permission');\n $query->innerJoin('permission.UserGroup');\n $query->innerJoin('permission.Resource');\n $query->orderBy('granted Desc');\n\n return $query;\n }", "public function getPermissions()\r\n\t{\r\n\t\tif($this->accessToken === null) {\r\n\t\t\tthrow new SkydriveException_InvalidToken();\r\n\t\t}\r\n\t\t$url = self::baseUrl . \"permissions?access_token=\" . $this->accessToken;\r\n\t\t$result = $this->fetch($url);\r\n\t\treturn $result;\r\n\t}", "static public function getRequiredPermissions(): array\n {\n return static::$required_permissions;\n }", "public function can($permission, $requireAll = false);", "public function permissions()\n\t{\n\t\treturn $this->manyShiftsToMany('Permission');\n\t}", "public function getPossiblePermissions()\n {\n return array_keys($this->map);\n }", "public function permissions($idr) {\n\n $stmt = $this->connection->prepare(\"SELECT id, permission_id FROM role_permissions WHERE role_id = ?\");\n $stmt->bind_param(\"s\", $idr);\n $stmt->execute();\n $result = $stmt->get_result();\n return $result->fetch_array();\n }", "public function getPermissions() :array\n {\n return $this->permissions;\n }", "private function getUserRolePermissions()\n {\n return [];\n }", "public function getDirectPermissions(): Collection\n {\n return $this->permissions;\n }", "public function testGetAssignedPermissions() {\n $identity = JwtIdentity::findIdentityByAccessToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJlbHktc2NvcGVzIjoicGVybTEscGVybTIscGVybTMiLCJpYXQiOjE1NjQ2MTA1NDIsImV4cCI6MTU2NDYxNDE0Miwic3ViIjoiZWx5fDEifQ.MO6T92EOFcZSPIdK8VBUG0qyV-pdayzOPQmpWLPwpl1933E9ann9GdV49piX1IfLHeCHVGThm5_v7AJgyZ5Oaw');\n $this->assertSame(['perm1', 'perm2', 'perm3'], $identity->getAssignedPermissions());\n\n // Token without sub claim\n $identity = JwtIdentity::findIdentityByAccessToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJpYXQiOjE1NjQ2MTA1NDIsImV4cCI6MTU2NDYxNDE0Miwic3ViIjoiZWx5fDEifQ.jsjv2dDetSxu4xivlHoTeDUhqsl-cxSI6SktufJhwR9wqDgQCVIONiqQCUzTzyTwyAz4Ztvel4lKjMCstdJOEw');\n $this->assertSame([], $identity->getAssignedPermissions());\n }", "protected static function getPermissions(): Collection\n {\n return app(PermissionRegistrar::class)->getPermissions();\n }", "protected static function getPermissions(): Collection\n {\n return app(PermissionRegistrar::class)->getPermissions();\n }", "public function getPermissions() {\r\n $template = $this->getOne('Template');\r\n if (empty($template)) return array();\r\n\r\n /* get permissions for policy */\r\n $c = $this->xpdo->newQuery('modAccessPermission');\r\n $c->sortby('name','ASC');\r\n $permissions = $template->getMany('Permissions',$c);\r\n\r\n $data = $this->get('data');\r\n $lexicon = $template->get('lexicon');\r\n $list = array();\r\n /** @var modAccessPermission $permission */\r\n foreach ($permissions as $permission) {\r\n $desc = $permission->get('description');\r\n if (!empty($lexicon) && $this->xpdo->lexicon) {\r\n if (strpos($lexicon,':') !== false) {\r\n $this->xpdo->lexicon->load($lexicon);\r\n } else {\r\n $this->xpdo->lexicon->load('core:'.$lexicon);\r\n }\r\n $desc = $this->xpdo->lexicon($desc);\r\n }\r\n $active = array_key_exists($permission->get('name'),$data) && $data[$permission->get('name')] ? 1 : 0;\r\n $list[] = array(\r\n $permission->get('name'),\r\n $permission->get('description'),\r\n $desc,\r\n $permission->get('value'),\r\n $active,\r\n );\r\n }\r\n return $list;\r\n }", "function isAllowedPermission()\n {\n $retObj = array();\n try {\n\n if (isset($_REQUEST['user_id']) && isset($_REQUEST['is_backend']) && isset($_REQUEST['method']))\n {\n $retObj['allowed'] = false;\n\n $params = array(\n 'user_id' => $_REQUEST['user_id'],\n 'is_backend' => $_REQUEST['is_backend'],\n 'method' => $_REQUEST['method']\n );\n\n $aclObj = new AclManager();\n $permissions = $aclObj->getUserPermissions($params);\n\n //c. check if method valid\n foreach($permissions as $permission)\n {\n if($permission['title'] == $params['method']) {\n $retObj['allowed'] = true;\n }\n }\n\n } else {\n\n throw new \\Exception('Unsupported Request: missing critical parameter(s).');\n\n }\n\n } catch (\\Exception $e) {\n\n Api::invalidResponse(\n $e->getMessage(),\n 400,\n Constants::STATUS_INVALID,\n $e,\n true,\n true\n );\n\n }\n\n return Api::apiResponse($retObj, Constants::STATUS_SUCCESSFUL);\n }", "public static function permissions(): array\n {\n return [];\n }", "protected function _initPermissions () {\r\n\r\n\t\t$bFreshData = false;\r\n\r\n\t\tif (self::$_bUseCache) {\r\n\t\t\t$oCacheManager = Kwgl_Cache::getManager();\r\n\t\t\t$oAclCache = $oCacheManager->getCache('acl');\r\n\r\n\t\t\tif (($aPermissionListing = $oAclCache->load(self::CACHE_IDENTIFIER_PERMISSIONS)) === false) {\r\n\t\t\t\t// Not Cached or Expired\r\n\r\n\t\t\t\t$bFreshData = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$bFreshData = true;\r\n\t\t}\r\n\r\n\t\tif ($bFreshData) {\r\n\t\t\t// Get Privileges from the Database\r\n\t\t\t$oDaoRoleResourcePrivilege = Kwgl_Db_Table::factory('System_Role_Resource_Privilege');\r\n\t\t\t//$aPermissionListing = $oDaoRoleResource->fetchAll();\r\n\t\t\t$aPermissionListing = $oDaoRoleResourcePrivilege->getPermissions();\r\n\r\n\t\t\tif (self::$_bUseCache) {\r\n\t\t\t\t$oAclCache->save($aPermissionListing, self::CACHE_IDENTIFIER_PERMISSIONS);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tforeach ($aPermissionListing as $aPermissionDetail) {\r\n\t\t\t$sRoleName = $aPermissionDetail['role_name'];\r\n\t\t\t$sResourceName = $aPermissionDetail['resource_name'];\r\n\t\t\t$sPrivilegeName = null;\r\n\t\t\tif (!is_null($aPermissionDetail['privilege_name'])) {\r\n\t\t\t\t$sPrivilegeName = $aPermissionDetail['privilege_name'];\r\n\t\t\t}\r\n\t\t\t$sPermissionType = $aPermissionDetail['permission'];\r\n\r\n\t\t\t// Check the Permission to see if you should allow or deny the Resource/Privilege to the Role\r\n\t\t\tswitch ($sPermissionType) {\r\n\t\t\t\tcase self::PERMISSION_TYPE_ALLOW:\r\n\t\t\t\t\t$this->allow($sRoleName, $sResourceName, $sPrivilegeName);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase self::PERMISSION_TYPE_DENY:\r\n\t\t\t\t\t$this->deny($sRoleName, $sResourceName, $sPrivilegeName);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}" ]
[ "0.7326895", "0.7189527", "0.6833086", "0.667732", "0.667732", "0.667732", "0.6569084", "0.65045834", "0.65045834", "0.64443904", "0.63613695", "0.63609505", "0.6343199", "0.63105816", "0.62023324", "0.62023324", "0.6190868", "0.61633635", "0.61273396", "0.6101975", "0.60849637", "0.6084613", "0.6068304", "0.6066938", "0.6066938", "0.6066938", "0.6065376", "0.60618895", "0.6036209", "0.60109586", "0.60082024", "0.60053897", "0.5983902", "0.5973767", "0.5972971", "0.594352", "0.59310997", "0.59107953", "0.5852722", "0.5813676", "0.58047307", "0.5801319", "0.5800161", "0.57897204", "0.5785415", "0.57848716", "0.5777791", "0.57690406", "0.5748142", "0.5743054", "0.5739641", "0.573723", "0.57327545", "0.5731538", "0.57289803", "0.5724296", "0.5707794", "0.5704229", "0.5700733", "0.56977177", "0.56977177", "0.56977177", "0.56977177", "0.56977177", "0.569015", "0.5682526", "0.5677961", "0.56697696", "0.5660728", "0.56602097", "0.56564176", "0.5647423", "0.563709", "0.5636835", "0.5630622", "0.5623179", "0.56167537", "0.5612883", "0.5608409", "0.55972236", "0.5590239", "0.5586847", "0.5586109", "0.55763406", "0.5573706", "0.5545141", "0.55424404", "0.5534512", "0.5532473", "0.5528574", "0.55120814", "0.5510757", "0.55083716", "0.5499395", "0.5495495", "0.5495495", "0.54877496", "0.5487451", "0.547384", "0.5418408" ]
0.65533733
7
Updates the defined Memcached Parameters for an existing Instance. This method only stages the parameters, it must be followed by ApplyParameters to apply the parameters to nodes of the Memcached Instance. (instances.updateParameters)
public function updateParameters($name, Google_Service_CloudMemorystoreforMemcached_UpdateParametersRequest $postBody, $optParams = array()) { $params = array('name' => $name, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('updateParameters', array($params), "Google_Service_CloudMemorystoreforMemcached_Operation"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function applyParameters($name, Google_Service_CloudMemorystoreforMemcached_ApplyParametersRequest $postBody, $optParams = array())\n {\n $params = array('name' => $name, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('applyParameters', array($params), \"Google_Service_CloudMemorystoreforMemcached_Operation\");\n }", "public function postFlush()\n {\n foreach ($this->parametersMap as $map) {\n $map['entity']->setParameters($map['parameters']);\n }\n\n // reset parameters map\n $this->parametersMap = [];\n }", "public function finish_setting_parameters()\n {\n $this->set_variable( 'parameters', $this->parameters );\n }", "public function setInstanceId(string $instanceId): ParamsInterface;", "public function setParameters($parameters){\n\t\tself::$_parameters[get_class($this)] = $parameters;\n\t}", "function setParameters($parameters);", "public function setSiteParameters($params);", "public function modifyActionParameters(array $parameters);", "public function set($parameters)\n {}", "public function setParameters($parameters)\n {\n $this->parameters = $parameters;\n return $this;\n }", "public function setParameters($parameters) {\n $this->params = $parameters;\n }", "protected function setDataParameters()\n {\n if (isset($this->controller['query_results']->parameters)) {\n $this->controller['parameters'] = $this->controller['query_results']->parameters;\n unset($this->controller['query_results']->parameters);\n $this->controller['query_results'] = $this->controller['query_results']->data;\n\n } else {\n $this->controller['parameters'] = $this->plugin_data->render->extension->parameters;\n }\n\n return $this;\n }", "public function setParameters($parameters) {\n $this->parameters = $parameters;\n }", "public function setParameters( $parameters ) {\n $this->parameters = $parameters;\n\n return $this;\n }", "public function setParameters ($parameters)\n {\n\n $this->parameters = array_merge($this->parameters, $parameters);\n\n }", "function set($params, $context) {\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, [\n\t\t\t\"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t]);\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, \"rpc.powermgmt.set\");\n\t\t// Get the existing configuration object.\n\t\t$db = \\OMV\\Config\\Database::getInstance();\n\t\t$object = $db->get(\"conf.system.powermngmnt\");\n\t\t$object->setAssoc($params);\n\t\t// Set the configuration object.\n\t\t$db->set($object);\n\t\t// Return the configuration object.\n\t\treturn $object->getAssoc();\n\t}", "public function setParams($params);", "public function setParams($params);", "function setParameters(array $parameters) {\n foreach ($parameters as $key => $value) {\n $this->setParameter($key, $value);\n }\n }", "public function SetParameters($parameters)\n {\n $this->parameters = $parameters;\n }", "public static function updateSettings($data) {\n \n $db = Database::instance();\n $db->beginTransaction();\n \n try {\n \n foreach($data as $paramName => $paramValue) {\n $db->query('UPDATE settings SET param_value = ? WHERE param_name = ?', array($paramValue, $paramName));\n }\n \n $db->commit();\n \n self::clearAllSettingsCache();\n \n } catch (Exception $ex) {\n $db->rollback();\n }\n }", "private function setParams($statemant, $parameters = array()){\n\t\tforeach ($parameters as $key => $value) {\n\t\t\t//Parametros da query.\n\t\t\t$this->setParam($statemant, $key, $value);\n\t\t}\n\t}", "public function replaceParamsObject()\n {\n // Additional code that will run immediately after the service is created\n $this->container->extend('params', function (FrameworkParams $frameworkParamsObject, $container) {\n\n // Extract the framework Params class instance's registry object\n $reflectionClass = new \\ReflectionClass($frameworkParamsObject);\n\n /** @var \\ReflectionProperty $params */\n $paramsReflector = $reflectionClass->getProperty('params');\n\n // 'params' property of framework Params class has private visibility\n $paramsReflector->setAccessible(true);\n $frameworkRegistry = $paramsReflector->getValue($frameworkParamsObject);\n\n $jobBoardRegistry = new Registry($container);\n $jobBoardRegistry->merge($frameworkRegistry);\n\n $jobBoardParams = new JobBoardParams($container);\n $jobBoardParams->setParamsObject($jobBoardRegistry);\n\n return $jobBoardParams;\n });\n }", "public function setParameters($params)\n {\n $this->postFields = $params;\n }", "protected function assignParameters($parameters) {\n\t\t$plugin = IoC::getPluginInstance();\n\t\t$domain = $plugin->plugin_slug;\n\n\t\t// create default parameters\n\t\t$formulaParameters = $this->formulaParser::extractParameters($this->formula);\n\t\tforeach ($formulaParameters as $formulaParameter){\n\t\t\t$this->parameters->{$formulaParameter} = self::createParameter($formulaParameter);\n\t\t}\n\n\t\t$processedSubmit = false;\n\t\tforeach ($parameters as $key => $param) {\n\t\t\tif (empty($param->attributes)) { $param->attributes = new \\stdClass(); }\n\t\t\tif (empty($param->attributes->id)) { $param->attributes->id = 'shortcalc_'.rand(0,1000000);}\n\t\t\tif (empty($param->attributes->name) && !empty($param->name)) {\n\t\t\t\t$param->attributes->name = $param->name;\n\t\t\t}\n\t\t\tif (empty($param->attributes->name)) { $param->attributes->name = $key;}\n\t\t\tif (empty($param->attributes->value)) { $param->attributes->value = '';}\n\t\t\tif (empty($param->element)) { $param->element = 'input';}\n\t\t\tif (empty($param->label)) { $param->label = '';}\n\t\t\tif (empty($param->prefix)) { $param->prefix = '';}\n\t\t\tif (empty($param->postfix)) { $param->postfix = '';}\n\n\t\t\tif ($param->element == 'input' && empty($param->attributes->type)) {\n\t\t\t\t$param->attributes->type = 'text';\n\t\t\t}\n\n\t\t\tif (empty($param->label) && $param->attributes->type !== 'submit'\n\t\t\t\t&& $param->element !== 'button') {\n\t\t\t\t$param->label = $key;\n\t\t\t}\n\n\t\t\t$this->parameters->{$param->attributes->name} = $param;\n\n\t\t\tif ($param->attributes->type == 'submit') {\n\t\t\t\t$processedSubmit = true;\n\t\t\t}\n\t\t}\n\n\t\t// add submit button if there is not any\n\t\tif (!$processedSubmit) {\n\t\t\t$this->parameters->submit = self::createParameter('submit', 'input', 'submit', __('Calculate', $domain));\n\t\t}\n\t}", "public function setParameters(/*Vector<IParameterData>*/ $value) /*: this*/ {\n $this->parameters = $value;\n return $this;\n }", "public function setParameters(array $parameters): void;", "public function update() {\n\t\tif (isset($this->params['updated'])) {\n\t\t\t$this->params['updated'] = null;\n\t\t} // 'updated' is an auto timestamp\n\n\t\t$columns = array();\n\t\tforeach (array_keys($this->params) as $key) {\n\t\t\tarray_push($columns, $key . ' = ?');\n\t\t}\n\t\t$bindings = implode(', ', $columns);\n\t\t$sql = 'UPDATE ' . static::$table . ' SET ' . $bindings . ' WHERE id = ' . $this->get('id') . ' ;';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute(array_values($this->params));\n\t}", "public function execute()\n {\n $this->cleanHistory();\n $this->log();\n $this->instanceManager->update($this->instance);\n }", "public function setMinkParameters(array $parameters)\n {\n $this->minkParameters = $parameters;\n }", "public function setMinkParameters(array $parameters)\n {\n $this->minkParameters = $parameters;\n }", "public function parameters($parameters)\n {\n $this->options['parameters'] = $parameters;\n\n return $this;\n }", "public function __construct($parameters = [])\n {\n parent::__construct($parameters);\n array_walk($parameters, [$this, 'updateQuery']);\n }", "public function set($params) {}", "public function setParametersByRef (&$parameters)\n {\n\n foreach ($parameters as $key => &$value)\n {\n\n $this->parameters[$key] =& $value;\n\n }\n\n }", "protected function execute(InputInterface $input, OutputInterface $output)\n {\n $this->style->title('Setting the instance API settings');\n\n // Prepare the apiSettings array the input is in the format key:value key:value.\n $settings = $input->getArgument('settings');\n $apiSettings = [];\n foreach ($settings as $setting) {\n list($key, $value) = explode(':', $setting);\n $apiSettings[$key] = $value;\n }\n\n $response = $this->sendAPIRequest(\n 'post',\n '/instance/'.$input->getOption('project').'/'.$input->getOption('instanceid').'/apiSettings',\n ['apiSettings' => json_encode($apiSettings),]\n );\n\n if ($response['curlInfo']['http_code'] === 201) {\n $this->style->success(sprintf('Updated API settings on instance %s', $input->getOption('instanceid')));\n } else {\n $this->style->error($response['result']);\n }\n\n }", "public function update($params)\n {\n $params = (array)$params;\n foreach ($params as $variable => $value) {\n if (array_key_exists($variable, static::getSchema())) {\n $this->$variable = $value;\n }\n }\n }", "public function setParameters(array $parameters): self\n {\n $this->parameters = $parameters;\n return $this;\n }", "public function setParameters(array $parameters)\n {\n $this->clearCachedValueIf($this->params != $parameters);\n $this->params = $parameters;\n }", "public function update( array $params );", "function set_params($params)\r\n\t{\r\n\t\t$this->parameters = $params;\r\n\t}", "public function setParameters()\n {\n $params = array();\n $associations = array();\n foreach ($this->datatablesModel->getColumns() as $key => $data) {\n // if a function or a number is used in the data property\n // it should not be considered\n if( !preg_match('/^(([\\d]+)|(function)|(\\s*)|(^$))$/', $data['data']) ) {\n $fields = explode('.', $data['data']);\n $params[$key] = $data['data'];\n $associations[$key] = array('containsCollections' => false);\n\n if (count($fields) > 1) {\n $this->setRelatedEntityColumnInfo($associations[$key], $fields);\n } else {\n $this->setSingleFieldColumnInfo($associations[$key], $fields[0]);\n }\n }\n }\n\n $this->parameters = $params;\n // do not reindex new array, just add them\n $this->associations = $associations + $this->associations;\n }", "protected function setInstances(Instances $instances)\n {\n $this->instances = $instances;\n return $this;\n }", "protected function loadParameters()\n {\n $params = Yaml::parse(file_get_contents($this->getBaseDir('Resources/data/parameters.yml')));\n if (is_array($params)) {\n foreach ($params as $paramName => $paramValue) {\n if (!$this->app->offsetExists($paramName)) {\n $this->app[$paramName] = $paramValue;\n }\n }\n }\n return $this;\n }", "public function update($parameters = array())\n {\n return $this->callUpdateItemEndpoint(__METHOD__, array('record' => $parameters));\n }", "public function parameters( Array $parameters=array() ) {\n foreach ($parameters as $name=>$value) {\n $this->params[$name]= $value;\n }\n }", "function update($params) {\r\n try {\r\n $newsletterscheduleObj = NewsletterSchedulePeer::retrieveByPK($params[\"id\"]); \r\n if (empty($newsletterscheduleObj))\r\n throw new Exception();\r\n foreach ($params as $key => $value) {\r\n $setMethod = \"set\".$key;\r\n if ( method_exists($newsletterscheduleObj,$setMethod) ) { \r\n if (!empty($value))\r\n $newsletterscheduleObj->$setMethod($value);\r\n else\r\n $newsletterscheduleObj->$setMethod(null);\r\n }\r\n }\r\n $newsletterscheduleObj->save();\r\n return true;\r\n } catch (Exception $exp) {\r\n return false;\r\n } \r\n }", "public function setSettings($params, $context)\n\t{\n\t\tglobal $xmlConfig;\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, array(\n\t\t\t \"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t ));\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, '{\n\t\t\t \"type\":\"object\",\n\t\t\t \"properties\":{\n\t\t\t\t \"enable\":{\"type\":\"boolean\"},\n\t\t\t\t \"basedn\":{\"type\":\"string\"},\n \"rootbindcn\":{\"type\":\"string\"},\n \"rootbindpw\":{\"type\":\"string\"},\n \"usersuffix\":{\"type\":\"string\"},\n \"groupsuffix\":{\"type\":\"string\"}\n\t\t\t }\n\t\t }');\n\t\t// Prepare the configuration object.\n\t\t$object = array(\n\t\t\t\"enable\" => array_boolval($params, 'enable'),\n\t\t\t\"basedn\" => trim($params['basedn']),\n \"rootbindcn\" => trim($params['rootbindcn']),\n \"rootbindpw\" => trim($params['rootbindpw']),\n \"usersuffix\" => trim($params['usersuffix']),\n \"groupsuffix\" => $params['groupsuffix'],\n\t\t);\n \n //We need to set the ldap client to use the new ldap server information\n //if the ldap server is enabled\n if($object['enable']){ \n $xpath = \"//services/ldap\";\n $ldapclientObject = $xmlConfig->get($xpath);\n $ldapclientObject['enable'] = 1; //if server is enabled, client should connect to it\n $ldapclientObject['host'] = \"localhost\";\n $ldapclientObject['base'] = $object['basedn'];\n $ldapclientObject['rootbinddn'] = $object['rootbindcn'].\",\".$object['basedn'];\n $ldapclientObject['rootbindpw'] = $object['rootbindpw'];\n $ldapclientObject['usersuffix'] = $object['usersuffix'];\n $ldapclientObject['groupsuffix'] = $object['groupsuffix'];\n if (FALSE === $xmlConfig->replace($xpath, $ldapclientObject)) {\n throw new OMVException(OMVErrorMsg::E_CONFIG_SET_OBJECT_FAILED);\n }\n }\n \n // Update the configuration file. If it fails it throws an exception.\n $xpath = \"//services/ldapserver\";\n if (FALSE === $xmlConfig->replace($xpath, $object)) {\n throw new OMVException(OMVErrorMsg::E_CONFIG_SET_OBJECT_FAILED);\n }\n \n\t\t// Notify configuration changes.\n\t\t//\n\t\t// This will notify event listeners such as the service module\n\t\t// to perform certain tasks. The most common one is to mark the\n\t\t// service as dirty.\n $dispatcher = &OMVNotifyDispatcher::getInstance();\n $dispatcher->notify(OMV_NOTIFY_MODIFY,\n \"org.openmediavault.services.ldapserver\", $object);\n\n\t\treturn $object;\n\t}", "public function modifyInstancePassword($instanceId, $adminPass, $options = array())\n {\n list($config) = $this->parseOptions($options, 'config');\n if (empty($instanceId)) {\n throw new \\InvalidArgumentException(\n 'request $instanceId should not be empty.'\n );\n }\n if (empty($adminPass)) {\n throw new \\InvalidArgumentException(\n 'request $adminPass should not be empty.'\n );\n }\n $body = array();\n $credentials = $this->config[BceClientConfigOptions::CREDENTIALS];\n $secretAccessKey = null;\n if(isset($credentials['sk'])){\n $secretAccessKey = $credentials['sk'];\n }\n if(isset($credentials['secretAccessKey'])){\n $secretAccessKey = $credentials['secretAccessKey'];\n }\n $cipherAdminPass = $this->aes128WithFirst16Char($adminPass, $secretAccessKey);\n $body['adminPass'] = $cipherAdminPass;\n $params = array();\n $params['changePass'] = null;\n return $this->sendRequest(\n HttpMethod::PUT,\n array(\n 'config' => $config,\n 'params' => $params,\n 'body' => json_encode($body),\n ),\n '/instance/' . $instanceId\n );\n }", "public function setParameters($params) {\n\t\t$defaultParams = $this->params;\n\t\t$allParams = array_merge($defaultParams, $params);\n\n\t\t$this->validateParameters($allParams);\n\n\t\t// Save parameters as they were\n\t\t$this->params = $allParams;\n\n\t\t// Update request URLs from the new parameters\n\t\t$this->urlRaw = $this->build();\n\t\t$this->url = $this->build(true);\n\t}", "public function setParameters(array $parameters) : self\n {\n $this->parameters = $parameters;\n\n return $this;\n }", "public function addParameters(\\Vitess\\Proto\\Automation\\EnqueueClusterOperationRequest\\ParametersEntry $value){\n return $this->_add(2, $value);\n }", "public function initialize(array $parameters = [])\n {\n $this->parameters = new class\n {\n /**\n * Parameter storage.\n */\n protected $parameters;\n\n public function __construct(array $parameters = [])\n {\n $this->parameters = $parameters;\n }\n\n\n public function all(/*string $key = null*/)\n {\n $key = \\func_num_args() > 0 ? func_get_arg(0) : null;\n\n if (null === $key) {\n return $this->parameters;\n }\n\n if (!\\is_array($value = $this->parameters[$key] ?? [])) {\n throw new BadRequestException(sprintf('Unexpected value for parameter \"%s\": expecting \"array\", got \"%s\".', $key, get_debug_type($value)));\n }\n\n return $value;\n }\n\n\n public function add(array $parameters = [])\n {\n $this->parameters = array_replace($this->parameters, $parameters);\n }\n\n\n public function get(string $key, $default = null)\n {\n return \\array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default;\n }\n\n\n public function set(string $key, $value)\n {\n $this->parameters[$key] = $value;\n }\n\n\n public function remove(string $key)\n {\n unset($this->parameters[$key]);\n }\n };\n\n if ($parameters) {\n foreach ($parameters as $key => $value) {\n $method = 'set' . ucfirst(Helper::camelCase($key));\n if (method_exists($this, $method)) {\n $this->$method($value);\n }\n }\n }\n return $this;\n }", "public function modifyInstanceAttributes($instanceId, $name, $options = array())\n {\n list($config) = $this->parseOptions($options, 'config');\n if (empty($instanceId)) {\n throw new \\InvalidArgumentException(\n 'request $instanceId should not be empty.'\n );\n }\n if (empty($name)) {\n throw new \\InvalidArgumentException(\n 'request $name should not be empty.'\n );\n }\n $body = array();\n $body['name'] = $name;\n $params = array();\n $params['modifyAttribute'] = null;\n\n return $this->sendRequest(\n HttpMethod::PUT,\n array(\n 'config' => $config,\n 'params' => $params,\n 'body' => json_encode($body),\n ),\n '/instance/' . $instanceId\n );\n }", "public function setSettings($params, $context)\n {\n $this->validateMethodContext($context, ['role' => OMV_ROLE_ADMINISTRATOR]);\n // Validate the parameters of the RPC service method.\n $this->validateMethodParams($params, 'rpc.tgt.setsettings');\n // Get the existing configuration object.\n $db = \\OMV\\Config\\Database::getInstance();\n $object = $db->get('conf.service.tgt');\n $object->setAssoc($params);\n // Set the configuration object.\n $db->set($object);\n // Remove useless properties from the object.\n $object->remove('targets');\n // Return the configuration object.\n return $object->getAssoc();\n }", "public function setParameters(array $parameters)\n {\n $this->parameters = $parameters;\n return $this;\n }", "public function update( $new_instance, $old_instance ) {\t}", "public function update($instance, $validatedData)\n {\n }", "public function setParameters(array $parameters)\n\t{\n\t\t$this->parameters = $parameters;\n\t\t\n\t\treturn $this;\n\t}", "function storeParameters()\n {\n }", "public function setWordpressParameters($parameters)\n {\n $this->wordpress_parameters = $parameters;\n }", "protected function setParametersFromToken()\n {\n if (count($this->token->attributes) > 0) {\n foreach ($this->token->attributes as $key => $value) {\n $this->controller['parameters']->$key = $value;\n }\n }\n\n $this->controller['parameters']->token = $this->token;\n\n return $this;\n }", "public function update(array $parameters = [])\n {\n json_decode(self::put(\"/photos/{$this->id}\", ['query' => $parameters])->getBody(), true);\n parent::update($parameters);\n }", "function setSettings($params, $context) {\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, [\n\t\t\t\"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t]);\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, \"rpc.ldap.setsettings\");\n\t\t// Prepare the configuration object.\n\t\t$object = new \\OMV\\Config\\ConfigObject(\"conf.service.ldap\");\n\t\t$object->setAssoc($params);\n\t\t// Set the configuration object.\n\t\t$db = \\OMV\\Config\\Database::getInstance();\n\t\t$db->set($object);\n\t\t// Return the configuration object.\n\t\treturn $object->getAssoc();\n\t}", "public static function grade_item_update_parameters() {\n return new external_function_parameters(\n array(\n 'zoomid' => new external_value(PARAM_INT, 'zoom course module id')\n )\n );\n }", "function update( $new_instance, $old_instance )\n {\n }", "public function rebuildInstance($instanceId, $imageId, $adminPass, $options = array())\n {\n list($config) = $this->parseOptions($options, 'config');\n if (empty($instanceId)) {\n throw new \\InvalidArgumentException(\n 'request $instanceId should not be empty.'\n );\n }\n if (empty($imageId)) {\n throw new \\InvalidArgumentException(\n 'request $imageId should not be empty.'\n );\n }\n if (empty($adminPass)) {\n throw new \\InvalidArgumentException(\n 'request $adminPass should not be empty.'\n );\n }\n $body = array();\n $credentials = $this->config[BceClientConfigOptions::CREDENTIALS];\n $secretAccessKey = null;\n if(isset($credentials['sk'])){\n $secretAccessKey = $credentials['sk'];\n }\n if(isset($credentials['secretAccessKey'])){\n $secretAccessKey = $credentials['secretAccessKey'];\n }\n $cipherAdminPass = $this->aes128WithFirst16Char($adminPass, $secretAccessKey);\n $body['imageId'] = $imageId;\n $body['adminPass'] = $cipherAdminPass;\n\n $params = array();\n $params['rebuild'] = null;\n\n return $this->sendRequest(\n HttpMethod::PUT,\n array(\n 'config' => $config,\n 'params' => $params,\n 'body' => json_encode($body),\n ),\n '/instance/' . $instanceId\n );\n }", "public function setAllParameters($allParameters){\n\t\tself::$_allParameters[get_class($this)] = $allParameters;\n\t}", "public function setParams($params)\n {\n $this->params = $params;\n return $this;\n }", "private function _set_parameters() {\n\t\t$transient_expiry = ( isset( $this->transient_expiry ) ) ? $this->transient_expiry : ( 3 * HOUR_IN_SECONDS );\n\t\t$posts = ( isset( $this->posts ) ) ? $this->posts : $this->get_posts();\n\t\t$post_type_args = ( isset( $this->_post_type_args ) ) ? $this->_post_type_args : array();\n\t\t$this->taxonomy_name = ( isset( $this->taxonomy_name ) ) ? $this->taxonomy_name : \"{$this->post_type}-categories\";\n\t\t$taxonomy_labels = ( isset( $this->custom_taxonomy_labels ) ) ? $this->custom_taxonomy_labels : array();\n\t\t$taxonomy_args = ( isset( $this->_taxonomy_args ) ) ? $this->_taxonomy_args: array();\n\t\t$custom_post_type_args = ( isset( $this->custom_post_type_args ) ) ? $this->custom_post_type_args : array();\n\t\t$custom_post_type_labels = ( isset( $this->custom_post_type_labels ) ) ? $this->custom_post_type_labels : array();\n\t\t$custom_taxonomy_args = ( isset( $this->custom_taxonomy_args ) ) ? $this->custom_taxonomy_args : array();\n\t\t$custom_post_type_supports = ( isset( $this->custom_post_type_supports ) ) ? $this->custom_post_type_supports : array();\n\t\t$disable_image_column = ( isset( $this->disable_image_column ) ) ? $this->disable_image_column : false;\n\t\t$disable_post_type_categories = ( isset( $this->disable_post_type_categories ) ) ? $this->disable_post_type_categories : false;\n\n\t\t// Set class properties\n\t\t$this->transient_expiry = $transient_expiry;\n\t\t$this->posts = $posts;\n\t\t$this->_post_type_args = $post_type_args;\n\t\t$this->custom_taxonomy_labels = $taxonomy_labels;\n\t\t$this->_taxonomy_args = $taxonomy_args;\n\t\t$this->custom_post_type_args = $custom_post_type_args;\n\t\t$this->custom_post_type_labels = $custom_post_type_labels;\n\t\t$this->disable_post_type_categories = $disable_post_type_categories;\n\t\t$this->custom_taxonomy_args = $custom_taxonomy_args;\n\t\t$this->custom_post_type_supports = $custom_post_type_supports;\n\t\t$this->disable_image_column = $disable_image_column;\n\t\t$this->set_post_type_supports( $this->custom_post_type_supports );\n\t\t$this->set_post_type_args( $this->custom_post_type_args );\n\t\t$this->set_taxonomy_args( $this->custom_taxonomy_args );\n\t}", "public function updated_params()\n {\n return $this->request('updated/query/params');\n }", "public function setParams ($params) {\n\t\t$this->params = $params;\n\t\treturn $this;\t\n\t}", "public function withParameters($parameters = [])\n {\n $this->parameters = $parameters;\n\n return $this;\n }", "public function saveParams()\r\n\t{\r\n\t\tforeach ($this->param_names as $param_name)\r\n\t\t{\r\n\t\t\t$funcname = 'get'.$param_name;\r\n\t\t\tif (_PS_VERSION_ < '1.5')\r\n\t\t\t\tConfiguration::updateValue('CERTISSIM_'.Tools::strtoupper($param_name), $this->$funcname());\r\n\t\t\telse\r\n\t\t\t\tConfiguration::updateValue('CERTISSIM_'.Tools::strtoupper($param_name), $this->$funcname(), false, null, $this->getIdshop());\r\n\t\t}\r\n\t}", "abstract protected function _updateConfiguration();", "protected function inject_custom_parameters()\n\t{\n\t\tforeach ($this->custom_parameters as $key => $value)\n\t\t{\n\t\t\t$this->container->setParameter($key, $value);\n\t\t}\n\t}", "public function setParameters($var)\n {\n $arr = GPBUtil::checkMapField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\AIPlatform\\V1beta1\\Value::class);\n $this->parameters = $arr;\n\n return $this;\n }", "public function testOverrideParameters(): void\n {\n $process = $this->phpbench(\n 'run --dump --progress=none --parameters=\\'{\"length\": 333}\\' benchmarks/set1/BenchmarkBench.php'\n );\n $this->assertExitCode(0, $process);\n $output = $process->getOutput();\n $this->assertXPathCount(3, $output, '//parameter[@value=333]');\n }", "public function setParameters(mixed ...$parameters) : void\n {\n $this->parameters = $parameters;\n }", "public function setParams($params) {\n $this->params = $params;\n }", "public function setParams($params)\n {\n $this->params = $params;\n\n return $this;\n }", "public function set_parameters($value)\n\t{\n\t\t$this->parameters = array_merge($this->parameters, $value);\n\t}", "public function updateSettings($new_instance, $old_instance) \n\t{\n\t\t$instance = $old_instance;\n\t\t$instance['date_format'] = $new_instance['date_format'];\n\t\t$instance['input_date_ymd'] = $new_instance['input_date_ymd'];\n\t\t$instance['classname'] = $new_instance['classname'];\n\t\t$instance['name'] = $new_instance['name'];\n\t\t$instance['id'] = $new_instance['id'];\n\t\treturn $instance;\n\t}", "public function setParams($params){\r\n $this->params=$params;\r\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"InstanceId\",$param) and $param[\"InstanceId\"] !== null) {\n $this->InstanceId = $param[\"InstanceId\"];\n }\n\n if (array_key_exists(\"InstanceName\",$param) and $param[\"InstanceName\"] !== null) {\n $this->InstanceName = $param[\"InstanceName\"];\n }\n\n if (array_key_exists(\"InstanceVersion\",$param) and $param[\"InstanceVersion\"] !== null) {\n $this->InstanceVersion = $param[\"InstanceVersion\"];\n }\n\n if (array_key_exists(\"Status\",$param) and $param[\"Status\"] !== null) {\n $this->Status = $param[\"Status\"];\n }\n\n if (array_key_exists(\"NodeCount\",$param) and $param[\"NodeCount\"] !== null) {\n $this->NodeCount = $param[\"NodeCount\"];\n }\n\n if (array_key_exists(\"ConfigDisplay\",$param) and $param[\"ConfigDisplay\"] !== null) {\n $this->ConfigDisplay = $param[\"ConfigDisplay\"];\n }\n\n if (array_key_exists(\"MaxTps\",$param) and $param[\"MaxTps\"] !== null) {\n $this->MaxTps = $param[\"MaxTps\"];\n }\n\n if (array_key_exists(\"MaxBandWidth\",$param) and $param[\"MaxBandWidth\"] !== null) {\n $this->MaxBandWidth = $param[\"MaxBandWidth\"];\n }\n\n if (array_key_exists(\"MaxStorage\",$param) and $param[\"MaxStorage\"] !== null) {\n $this->MaxStorage = $param[\"MaxStorage\"];\n }\n\n if (array_key_exists(\"ExpireTime\",$param) and $param[\"ExpireTime\"] !== null) {\n $this->ExpireTime = $param[\"ExpireTime\"];\n }\n\n if (array_key_exists(\"AutoRenewFlag\",$param) and $param[\"AutoRenewFlag\"] !== null) {\n $this->AutoRenewFlag = $param[\"AutoRenewFlag\"];\n }\n\n if (array_key_exists(\"PayMode\",$param) and $param[\"PayMode\"] !== null) {\n $this->PayMode = $param[\"PayMode\"];\n }\n\n if (array_key_exists(\"Remark\",$param) and $param[\"Remark\"] !== null) {\n $this->Remark = $param[\"Remark\"];\n }\n\n if (array_key_exists(\"SpecName\",$param) and $param[\"SpecName\"] !== null) {\n $this->SpecName = $param[\"SpecName\"];\n }\n\n if (array_key_exists(\"ExceptionInformation\",$param) and $param[\"ExceptionInformation\"] !== null) {\n $this->ExceptionInformation = $param[\"ExceptionInformation\"];\n }\n\n if (array_key_exists(\"ClusterStatus\",$param) and $param[\"ClusterStatus\"] !== null) {\n $this->ClusterStatus = $param[\"ClusterStatus\"];\n }\n }", "public function params(array $parameters): self\n {\n foreach ($parameters as $name => $value) {\n $this->param($name, $value);\n }\n\n return $this;\n }", "public function execute(array $parameters = array())\n\t{\n\t\t$filter = \\JFilterInput::getInstance();\n\n\t\t// Get the passed configuration values\n\t\t$defConfig = array(\n\t\t\t'profile' => 1,\n\t\t\t'description' => '',\n\t\t\t'comment' => '',\n\t\t\t'backupid' => null,\n\t\t\t'overrides' => array(),\n\t\t);\n\n\t\t$defConfig = array_merge($defConfig, $parameters);\n\n\t\t$profile = (int) $defConfig['profile'];\n\t\t$profile = max(1, $profile); // Make sure $profile is a positive integer >= 1\n\t\t$description = $filter->clean($defConfig['description'], 'string');\n\t\t$comment = $filter->clean($defConfig['comment'], 'string');\n\t\t$backupid = $filter->clean($defConfig['backupid'], 'cmd');\n\t\t$backupid = empty($backupid) ? null : $backupid; // Otherwise the Engine doesn't set a backup ID\n\t\t$overrides = $filter->clean($defConfig['overrides'], 'array');\n\n\t\t$this->container->platform->setSessionVar('profile', $profile);\n\t\tdefine('AKEEBA_PROFILE', $profile);\n\n\t\t/**\n\t\t * DO NOT REMOVE!\n\t\t *\n\t\t * The Model will only try to load the configuration after nuking the factory. This causes Profile 1 to be\n\t\t * loaded first. Then it figures out it needs to load a different profile and it does – but the protected keys\n\t\t * are NOT replaced, meaning that certain configuration parameters are not replaced. Most notably, the chain.\n\t\t * This causes backups to behave weirdly. So, DON'T REMOVE THIS UNLESS WE REFACTOR THE MODEL.\n\t\t */\n\t\tPlatform::getInstance()->load_configuration($profile);\n\n\t\t/** @var \\Akeeba\\Backup\\Site\\Model\\Backup $model */\n\t\t$model = $this->container->factory->model('Backup')->tmpInstance();\n\t\t$model->setState('tag', AKEEBA_BACKUP_ORIGIN);\n\t\t$model->setState('backupid', $backupid);\n\t\t$model->setState('description', $description);\n\t\t$model->setState('comment', $comment);\n\n\t\t$array = $model->startBackup($overrides);\n\n\t\tif ($array['Error'] != '')\n\t\t{\n\t\t\tthrow new \\RuntimeException('A backup error has occurred: ' . $array['Error'], 500);\n\t\t}\n\n\t\t// BackupID contains the numeric backup record ID. backupid contains the backup id (usually in the form id123)\n\t\t$statistics = Factory::getStatistics();\n\t\t$array['BackupID'] = $statistics->getId();\n\n\t\t// Remote clients expect a boolean, not an integer.\n\t\t$array['HasRun'] = ($array['HasRun'] === 0);\n\n\t\treturn $array;\n\t}", "public function updateCampaign($params)\r\n {\r\n }", "public function update( $new_instance, $old_instance ) {\n\t\t$new_instance[ 'account' ] = isset($_POST['account']) ? $_POST['account'] : '';\n\t\t$new_instance[ 'hashTag' ] = isset($_POST['hashTag']) ? $_POST['hashTag'] : '';\n\t\t$new_instance[ 'retweets' ] = $_POST['retweets'];\n\t\t$new_instance[ 'CONSUMER_KEY' ] = isset($_POST['CONSUMER_KEY']) ? $_POST['CONSUMER_KEY'] : '';\n\t\t$new_instance[ 'CONSUMER_SECRET' ] = isset($_POST['CONSUMER_SECRET']) ? $_POST['CONSUMER_SECRET'] : '';\n return $new_instance;\n\t}", "public function setPost(ParametersInterface $post)\n {\n $this->postParams = $post;\n return $this;\n }", "function update ($parameters = []): bool {\n\t\t\t$cache_key = \"session[\".$this->id.\"]\";\n\t\t\t$cache = new \\Cache\\Item($GLOBALS['_CACHE_'], $cache_key);\n\t\t\tif ($cache) $cache->delete();\n\t\t\tapp_log(\"Unset cache key $cache_key\",'debug',__FILE__,__LINE__);\n\n\t\t\t# Make Sure User Has Privileges to view other sessions\n\t\t\tif ($GLOBALS['_SESSION_']->id != $this->id && ! $GLOBALS['_SESSION_']->customer->can('manage sessions')) {\n\t\t\t\t$this->error(\"No privileges to change session\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$ok_params = array(\n\t\t\t\t\"user_id\"\t=> \"user_id\",\n\t\t\t\t\"timezone\"\t=> \"timezone\",\n\t\t\t\t\"super_elevation_expires\" => \"super_elevation_expires\",\n\t\t\t\t\"oauth2_state\"\t=> \"oauth2_state\"\n\t\t\t);\n\n\t\t\t$update_session_query = \"\n\t\t\t\tUPDATE\tsession_sessions\n\t\t\t\tSET\t\tid = id\";\n\n\t\t\t$bind_params = array();\n\t\t\tforeach ($parameters as $parameter => $value) {\n\t\t\t\tif ($ok_params[$parameter]) {\n\t\t\t\t\t$update_session_query .= \",\n\t\t\t\t\t\t`$parameter` = ?\";\n\t\t\t\t\tarray_push($bind_params,$value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$update_session_query .= \"\n\t\t\t\tWHERE\tid = ?\n\t\t\t\";\n\t\t\tarray_push($bind_params,$this->id);\n\n\t\t\tquery_log($update_session_query,$bind_params,true);\n\n\t\t\t$rs = $GLOBALS['_database']->Execute($update_session_query,$bind_params);\n\t\t\tif (! $rs) {\n\t\t\t\t$this->SQLError($GLOBALS['_database']->ErrorMsg());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn $this->details();\n\t\t}", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"Instances\",$param) and $param[\"Instances\"] !== null) {\n $this->Instances = [];\n foreach ($param[\"Instances\"] as $key => $value){\n $obj = new InstanceOpsDto();\n $obj->deserialize($value);\n array_push($this->Instances, $obj);\n }\n }\n\n if (array_key_exists(\"CheckFather\",$param) and $param[\"CheckFather\"] !== null) {\n $this->CheckFather = $param[\"CheckFather\"];\n }\n\n if (array_key_exists(\"RerunType\",$param) and $param[\"RerunType\"] !== null) {\n $this->RerunType = $param[\"RerunType\"];\n }\n\n if (array_key_exists(\"DependentWay\",$param) and $param[\"DependentWay\"] !== null) {\n $this->DependentWay = $param[\"DependentWay\"];\n }\n\n if (array_key_exists(\"SkipEventListening\",$param) and $param[\"SkipEventListening\"] !== null) {\n $this->SkipEventListening = $param[\"SkipEventListening\"];\n }\n\n if (array_key_exists(\"SonInstanceType\",$param) and $param[\"SonInstanceType\"] !== null) {\n $this->SonInstanceType = $param[\"SonInstanceType\"];\n }\n\n if (array_key_exists(\"SearchCondition\",$param) and $param[\"SearchCondition\"] !== null) {\n $this->SearchCondition = new InstanceApiOpsRequest();\n $this->SearchCondition->deserialize($param[\"SearchCondition\"]);\n }\n\n if (array_key_exists(\"OptType\",$param) and $param[\"OptType\"] !== null) {\n $this->OptType = $param[\"OptType\"];\n }\n\n if (array_key_exists(\"OperatorName\",$param) and $param[\"OperatorName\"] !== null) {\n $this->OperatorName = $param[\"OperatorName\"];\n }\n\n if (array_key_exists(\"OperatorId\",$param) and $param[\"OperatorId\"] !== null) {\n $this->OperatorId = $param[\"OperatorId\"];\n }\n\n if (array_key_exists(\"ProjectId\",$param) and $param[\"ProjectId\"] !== null) {\n $this->ProjectId = $param[\"ProjectId\"];\n }\n\n if (array_key_exists(\"ProjectIdent\",$param) and $param[\"ProjectIdent\"] !== null) {\n $this->ProjectIdent = $param[\"ProjectIdent\"];\n }\n\n if (array_key_exists(\"ProjectName\",$param) and $param[\"ProjectName\"] !== null) {\n $this->ProjectName = $param[\"ProjectName\"];\n }\n\n if (array_key_exists(\"PageIndex\",$param) and $param[\"PageIndex\"] !== null) {\n $this->PageIndex = $param[\"PageIndex\"];\n }\n\n if (array_key_exists(\"PageSize\",$param) and $param[\"PageSize\"] !== null) {\n $this->PageSize = $param[\"PageSize\"];\n }\n\n if (array_key_exists(\"Count\",$param) and $param[\"Count\"] !== null) {\n $this->Count = $param[\"Count\"];\n }\n\n if (array_key_exists(\"RequestBaseInfo\",$param) and $param[\"RequestBaseInfo\"] !== null) {\n $this->RequestBaseInfo = new ProjectBaseInfoOpsRequest();\n $this->RequestBaseInfo->deserialize($param[\"RequestBaseInfo\"]);\n }\n\n if (array_key_exists(\"IsCount\",$param) and $param[\"IsCount\"] !== null) {\n $this->IsCount = $param[\"IsCount\"];\n }\n }", "function setParams($params) {\n $this->params = $params;\n }", "public static function media_update_parameters() {\n return new \\external_function_parameters(array(\n 'code' => new \\external_value(PARAM_ALPHANUM, 'Stream code', VALUE_REQUIRED, 0, NULL_NOT_ALLOWED),\n 'draftid' => new \\external_value(PARAM_INT, 'Draft files ID', VALUE_REQUIRED, 0, NULL_NOT_ALLOWED),\n ));\n }", "public function setParams($params)\n {\n $this->params = $params;\n }", "public function update( $new_instance, $old_instance ) {\n\t}", "public function update( $new_instance, $old_instance ) {\n\t}", "public function setParameters(array $params)\n {\n $this->_parameters = $params;\n return $this;\n }", "public function setParams( $params )\r\n\t{\r\n\t\t$this->params = $params;\r\n\t}", "private function setPostParameters() {\n\t\tforeach (array_keys($_POST) as $currentKey) {\n\t\t\t$this->postArray[$currentKey] = $_POST[$currentKey];\n\t\t}\n\t}" ]
[ "0.5736186", "0.5272202", "0.5187677", "0.51296955", "0.5078651", "0.50673974", "0.49798724", "0.49290124", "0.49184364", "0.48360404", "0.48177403", "0.47957313", "0.4783466", "0.4761485", "0.471853", "0.47072637", "0.46982905", "0.46982905", "0.46965885", "0.46873063", "0.46432412", "0.4640186", "0.4638336", "0.46377295", "0.46177265", "0.46075252", "0.45942357", "0.45816457", "0.4533538", "0.45133322", "0.45133322", "0.4487711", "0.44784138", "0.44770765", "0.4464181", "0.44599524", "0.445703", "0.44471774", "0.44466865", "0.44110128", "0.44022274", "0.43836537", "0.43817818", "0.43814045", "0.43764755", "0.43737608", "0.43718532", "0.43717062", "0.43670678", "0.43667942", "0.43545341", "0.435013", "0.43491402", "0.4331489", "0.4329052", "0.4311155", "0.43000287", "0.42956936", "0.42922643", "0.4291632", "0.4282482", "0.427937", "0.42752647", "0.42752624", "0.42686594", "0.42670357", "0.42413932", "0.42413375", "0.42376572", "0.4235157", "0.42277208", "0.42255834", "0.42202273", "0.42098716", "0.4208855", "0.42077368", "0.41952652", "0.4192389", "0.41923785", "0.41814446", "0.4177087", "0.41748968", "0.41649705", "0.41649532", "0.41571048", "0.4154834", "0.41511223", "0.4142648", "0.4139652", "0.41347677", "0.41333237", "0.41285035", "0.4125966", "0.41226768", "0.41111758", "0.41033328", "0.41033328", "0.40951222", "0.40941918", "0.40917328" ]
0.6724812
0
Handle an incoming request.
public function handle($request, Closure $next) { // Verifica se existe um usuário autenticado if(auth()->check() == true) { // Cria uma instância do Controller de Usuario $usuarioController = new UsuarioController(); // Chama a function para pegar os dados do usuário $user = $usuarioController->getUserData(auth()->user()->USUARIO_COD); // Verifica se foram obtidas informações do usuário if($user == false) { // Se a variavel $user estiver vazia é executado o logout e exibido uma mensagem de erro $usuarioController->logout() ->with('mensagem_erro', 'Houve um erro, tente novamente'); } else { // Se existerem dados na variavel $user é feito o compartilhamento dele com todas as views View::share([ // 'isLogged' com a informação se existe usuário logado 'isLogged' => true, // 'usuario' com os dados do usuário 'usuario' => $user, ]); } } else { // Compartilha duas informações para todas as views View::share([ // 'isLogged' informando que não está logado 'isLogged' => false ]); } return $next($request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $request);", "public function handle($request);", "public function handleRequest() {}", "function handleRequest() ;", "public function handle(Request $request);", "protected function handle(Request $request) {}", "public function handle(array $request);", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "abstract protected function process(Request $request);", "public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }", "abstract function handle(Request $request, $parameters);", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function handle(ServerRequestInterface $request);", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }", "function handle(Request $request = null, Response $response = null);", "public function processRequest();", "public abstract function processRequest();", "public function handleRequest(Request $request, Response $response);", "abstract public function processRequest();", "public function handle(array $request = []);", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }", "public function process(Request $request, Response $response, RequestHandlerInterface $handler);", "public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function handle(Request $request): Response;", "public static function process_http_request()\n {\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "abstract public function handle(ServerRequestInterface $request): ResponseInterface;", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}", "public function handle($request, $next);", "public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }", "public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }", "public function process($path, Request $request);", "public function handle(string $query, ServerRequestInterface $request);", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "public function handle($request)\n {\n $this->setRouter($this->app->compose('Cygnite\\Base\\Router\\Router', $request), $request);\n\n try {\n $response = $this->sendRequestThroughRouter($request);\n /*\n * Check whether return value is a instance of Response,\n * otherwise we will try to fetch the response form container,\n * create a response and return to the browser.\n *\n */\n if (!$response instanceof ResponseInterface && !is_array($response)) {\n $r = $this->app->has('response') ? $this->app->get('response') : '';\n $response = Response::make($r);\n }\n } catch (\\Exception $e) {\n $this->handleException($e);\n } catch (Throwable $e) {\n $this->handleException($e);\n }\n\n return $response;\n }", "public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }", "public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }", "final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }", "public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function handle(RequestInterface $request): ResponseInterface;", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function process(\n ServerRequestInterface $request,\n RequestHandlerInterface $handler\n );", "protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}", "public function handleHttpRequest($requestParams)\n\t{\n\t\t$action = strtolower(@$requestParams[self::REQ_PARAM_ACTION]);\t\t\n\t\t$methodName = $this->actionToMethod($action);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$this->$methodName($requestParams);\n\t\t} catch(Exception $e)\n\t\t{\n\t\t\techo \"Error: \".$e->getMessage();\n\t\t}\n\t}", "public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }", "public function handle(ClientInterface $client, RequestInterface $request, HttpRequest $httpRequest);", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public function serve_request()\n {\n }", "public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}", "function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }", "public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}", "public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }", "public function RouteRequest ();", "public function handle(ServerRequestInterface $request, $handler, array $vars): ?ResponseInterface;", "public function DispatchRequest ();", "protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "abstract public function request();", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function processAction(Request $request)\n {\n // Get the request Vars\n $this->requestQuery = $request->query;\n\n // init the hybridAuth instance\n $provider = trim(strip_tags($this->requestQuery->get('hauth_start')));\n $cookieName = $this->get('azine_hybrid_auth_service')->getCookieName($provider);\n $this->hybridAuth = $this->get('azine_hybrid_auth_service')->getInstance($request->cookies->get($cookieName), $provider);\n\n // If openid_policy requested, we return our policy document\n if ($this->requestQuery->has('get') && 'openid_policy' == $this->requestQuery->get('get')) {\n return $this->processOpenidPolicy();\n }\n\n // If openid_xrds requested, we return our XRDS document\n if ($this->requestQuery->has('get') && 'openid_xrds' == $this->requestQuery->get('get')) {\n return $this->processOpenidXRDS();\n }\n\n // If we get a hauth.start\n if ($this->requestQuery->has('hauth_start') && $this->requestQuery->get('hauth_start')) {\n return $this->processAuthStart();\n }\n // Else if hauth.done\n elseif ($this->requestQuery->has('hauth_done') && $this->requestQuery->get('hauth_done')) {\n return $this->processAuthDone($request);\n }\n // Else we advertise our XRDS document, something supposed to be done from the Realm URL page\n\n return $this->processOpenidRealm();\n }", "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "public function handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);", "public function handle(Request $request, Closure $next);", "public function handleGetRequest($id);", "abstract function doExecute($request);", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "abstract public function mapRequest($request);", "public function handle(ServerRequestInterface $request)\n {\n $router = $this->app->get(RouterInterface::class);\n $response = $router->route($request);\n\n if (! headers_sent()) {\n\n // Status\n header(sprintf(\n 'HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase()\n ));\n\n // Headers\n foreach ($response->getHeaders() as $name => $values) {\n foreach ($values as $value) {\n header(sprintf('%s: %s', $name, $value), false);\n }\n }\n }\n\n echo $response->getBody()->getContents();\n }", "abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);", "private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }", "public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}", "protected function handle(Request $request)\n {\n return 1;\n }", "public function __invoke(Request $request, RequestHandler $handler) {\n R::setup('mysql:host=127.0.0.1;dbname=cellar','root','');\n \n $response = $handler->handle($request);\n R::close();\n return $response;\n }", "public function handle($req)\n {\n $params = $req->post ?: [];\n\n $files = $this->transformFiles($req->files);\n\n $cookies = $req->cookie ?: [];\n\n $server = $this->transformHeadersToServerVars(array_merge($req->header, [\n 'PATH_INFO' => array_get($req->server, 'path_info'),\n ]));\n $server['X_REQUEST_ID'] = Str::uuid()->toString();\n\n $requestUri = $req->server['request_uri'];\n if (isset($req->server['query_string']) && $req->server['query_string']) {\n $requestUri .= \"?\" . $req->server['query_string'];\n }\n\n $resp = $this->call(\n strtolower($req->server['request_method']),\n $requestUri, $params, $cookies, $files,\n $server, $req->rawContent()\n );\n\n return [\n 'status' => $resp->getStatusCode(),\n 'headers' => $resp->headers,\n 'body' => $resp->getContent(),\n ];\n }", "public function handle(Request $request)\n {\n $route_params = $this->_router->match($request->getUri());\n $route = $route_params['route'];\n $params = $route_params['params'];\n\n $func = reset($route) . self::CONTROLLER_METHOD_SUFIX;\n $class_name = key($route);\n $controller = new $class_name($request);\n\n $response = call_user_func_array(\n [\n $controller,\n $func,\n ],\n [$params]\n );\n\n if ($response instanceof Response) {\n return $response;\n } else {\n throw new InvalidHttpResponseException();\n }\n }" ]
[ "0.8299201", "0.8147294", "0.8147294", "0.8147294", "0.8127764", "0.7993589", "0.7927201", "0.7912899", "0.7899075", "0.76317674", "0.75089735", "0.7485808", "0.74074036", "0.7377414", "0.736802", "0.7294553", "0.72389543", "0.7230166", "0.72108", "0.71808434", "0.7170364", "0.71463037", "0.7126907", "0.7122795", "0.71225274", "0.7116879", "0.70607233", "0.6981947", "0.6966695", "0.69393975", "0.6912079", "0.68985975", "0.6887614", "0.68774897", "0.6806274", "0.67969805", "0.67778915", "0.6762979", "0.67565143", "0.67533374", "0.67192745", "0.6683243", "0.66487724", "0.66395754", "0.6634629", "0.66283566", "0.6617558", "0.6610097", "0.6610011", "0.6544976", "0.653806", "0.6512757", "0.64682734", "0.64381886", "0.6416964", "0.63373476", "0.63359964", "0.6334543", "0.63308066", "0.6321675", "0.63176167", "0.631661", "0.6310991", "0.63108873", "0.6295945", "0.6279438", "0.62778515", "0.62508965", "0.62422955", "0.62321424", "0.62237644", "0.6203428", "0.61954546", "0.6191255", "0.61774665", "0.61682004", "0.6151806", "0.61271876", "0.61257905", "0.6116093", "0.61126447", "0.6112368", "0.6101652", "0.60893977", "0.60871464", "0.60862815", "0.60734737", "0.60535145", "0.6028341", "0.60250086", "0.60224646", "0.6011745", "0.6011483", "0.60106593", "0.5998867", "0.5997086", "0.5991233", "0.59844923", "0.59668386", "0.5961315", "0.5954762" ]
0.0
-1
Add the page title and toolbar.
protected function addToolbar() { $canDo = JHotelReservationHelper::getActions(); JRequest::setVar('hidemainmenu', true); $user = JFactory::getUser(); $isNew = ($this->item->room_id == 0); JToolBarHelper::title(JText::_('LNG_ROOM',true)." : ".(!$isNew ? JText::_('LNG_EDIT',true): JText::_('LNG_ADD_NEW',true)), 'menu.png'); if ($canDo->get('core.create')){ JToolBarHelper::apply('room.apply'); JToolBarHelper::save('room.save'); JToolBarHelper::save2new('room.save2new'); } if(!$isNew){ JToolBarHelper::custom('room.editrateprices', 'edit', 'stats', 'JTOOLBAR_EDIT_RATE_DETAILS',false); } JToolBarHelper::cancel('room.cancel'); JToolBarHelper::divider(); JToolBarHelper::help('JHELP_ROOM_EDIT'); $doc =JFactory::getDocument(); $doc->addScript('components/'.getBookingExtName().'/assets/js/jquery.upload.js'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initPageHeaderToolbar()\n {\n if (empty($this->display)) {\n $this->page_header_toolbar_btn['new_reward'] = [\n 'href' => self::$currentIndex.'&addgamifications_reward&token='.$this->token,\n 'desc' => $this->l('Add new reward'),\n 'icon' => 'process-icon-new',\n ];\n }\n\n parent::initPageHeaderToolbar();\n }", "protected function addToolbar()\n\t{\n\t\t// Set toolbar items for the page\n\t\tif ($this->copy)\n\t\t{\n\t\t\t$toolbarTitle=JText::_('COM_JOOMLEAGUE_ADMIN_PROJECT_COPY_PROJECT');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$toolbarTitle=(!$this->edit) ? JText::_('COM_JOOMLEAGUE_ADMIN_PROJECT_ADD_NEW') : JText::_('COM_JOOMLEAGUE_ADMIN_PROJECT_EDIT');\n\t\t\tJToolBarHelper::divider();\n\t\t}\n\t\tJToolBarHelper::title($toolbarTitle,'ProjectSettings');\n\t\t\n\t\tif (!$this->copy)\n\t\t{\n\t\t\tJLToolBarHelper::apply('project.apply');\n\t\t\tJLToolBarHelper::save('project.save');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tJLToolBarHelper::save('project.copysave');\n\t\t}\n\t\tJToolBarHelper::divider();\n\t\tif ((!$this->edit) || ($this->copy))\n\t\t{\n\t\t\tJLToolBarHelper::cancel('project.cancel');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// for existing items the button is renamed `close`\n\t\t\tJLToolBarHelper::cancel('project.cancel',JText::_('COM_JOOMLEAGUE_GLOBAL_CLOSE'));\n\t\t}\n\t\tJLToolBarHelper::onlinehelp();\n\t}", "protected function addToolbar()\n\t{\n\t\t$app = Factory::getApplication();\n\t\t\n\t\t$this->option = $app->input->get('option', 'com_' . EcConst::getPrefix());\n\t\t$this->canDo = EcHelperAdmin::getActionsEc($this->option);\n\t\t\n\t\tJToolbarHelper::title(Text::_(JString::strtoupper($this->option)), 'stack article');\n\t\t\n\t\tif ($this->canDo->get('core.admin')) {\n\t\t\tJToolbarHelper::divider();\n\t\t\tJToolbarHelper::preferences($this->option);\n\t\t}\n\t}", "public function loadPageTitle()\n \t\t{\n echo \"<title>Add Item</title>\";\n }", "protected function addToolBar()\n {\n $title = JText::_('COM_HELLOWORLD_MANAGER_HELLOWORLDS');\n\n if ($this->pagination->total)\n {\n $title .= \"<span style='font-size: 0.5em; vertical-align: middle;'>(\" . $this->pagination->total . \")</span>\";\n }\n }", "public function initPageHeaderToolbar()\n {\n if (empty($this->display)){\n $this->page_header_toolbar_btn = array(\n 'new' => array(\n 'href' => self::$currentIndex.'&addwpproductcarousels&token='.$this->token,\n 'desc' => $this->l('Add New Carousel', null, null, false),\n 'icon' => 'process-icon-new'\n ),\n 'options' => array(\n 'href' => $this->context->link->getAdminLink('AdminModules') . '&configure=wpproductcarousels',\n 'desc' => $this->l('Options'),\n 'icon' => 'process-icon-cogs'\n )\n );\n }\n\n parent::initPageHeaderToolbar();\n }", "protected function addToolbar()\n\t{\n\t\t$acl = ProjectforkHelper::getActions();\n\t\t$user = JFactory::getUser();\n \n\t\tJToolBarHelper::title(JText::_('COM_CONTENT_ARTICLES_TITLE'), 'article.png');\n\n\t\tif ($acl->get('core.admin')) {\n\t\t\tJToolBarHelper::preferences('com_projectfork');\n\t\t\tJToolBarHelper::divider();\n\t\t}\n\n\t\tJToolBarHelper::help('JHELP_CONTENT_ARTICLE_MANAGER');\n\t}", "public function addToolbar()\n\t{\n\t\tJToolBarHelper::title(JText::_('JBS_EI_TITLE'), 'folder');\n\t\tJToolBarHelper::help('jbsexportimport', true);\n\t}", "protected function addToolbar()\n\t{\t\t\n\t\t// Set toolbar items for the page\n\t\t$edit=JRequest::getVar('edit',true);\n\t\t$text=!$edit ? JText::_('COM_JOOMLEAGUE_GLOBAL_NEW') : JText::_('COM_JOOMLEAGUE_GLOBAL_EDIT');\n\t\tJLToolBarHelper::save('playground.save');\n\t\tif (!$edit)\n\t\t{\n\t\t\tJToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_PLAYGROUND_ADD_NEW'),'playground');\n\t\t\tJToolBarHelper::divider();\n\t\t\tJLToolBarHelper::cancel('playground.cancel');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// for existing items the button is renamed `close` and the apply button is showed\n\t\t\tJToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_PLAYGROUND_EDIT'),'playground');\n\t\t\tJLToolBarHelper::apply('playground.apply');\n\t\t\tJToolBarHelper::divider();\n\t\t\tJLToolBarHelper::cancel('playground.cancel','COM_JOOMLEAGUE_GLOBAL_CLOSE');\n\t\t}\n\t\tJToolBarHelper::divider();\n\t\tJLToolBarHelper::onlinehelp();\t\n\t}", "protected function addToolbar()\n\t{\n\t\tJRequest::setVar('hidemainmenu', true);\n\t}", "protected function addToolbar()\n\t{\n JToolbarHelper::preferences('com_jpetition');\n JToolbarHelper::title(JText::_('COM_JPETITION'), 'checkmark');\n }", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->registerResource('css', $this->cssResource);\n $output .= $this->registerResource('js', $this->jsResource);\n $output .= $this->fixHTML5();\n $output .= '</head><body>';\n echo $output;\n }", "public function addPage()\n {\n $placements = array(\n array('id' => 'ads.leftbar.banner', 'name' => $this->translate->translate('Left Side')),\n array('id' => 'ads.rightbar.banner', 'name' => $this->translate->translate('Right Side'))\n );\n $this->putitem(\"placements\", $placements);\n\n $view_types = array(\n array('id' => 'serial', 'name' => 'Serial'),\n array('id' => 'carrousel', 'name' => 'Carroussel')\n );\n $this->putitem(\"view_types\", $view_types);\n\n parent::addPage();\n }", "public function add_page() {\n\t\tadd_theme_page(\n\t\t\t\t__('Manage Sidebars', self::TEXT_DOMAIN),\n\t\t\t\t__('Manage Sidebars', self::TEXT_DOMAIN),\n\t\t\t\t'edit_theme_options',\n\t\t\t\t'ups_sidebars',\n\t\t\t\tarray( $this, 'admin_page' )\n\t\t\t);\n\t}", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->fixHTML5();\n $output .= $this->registerCustomResources();\n $output .= '</head><body>';\n echo $output;\n }", "public function init()\n {\n\t\t$this->view->headTitle(Zend_Registry::get('Default Page Title'));\n\t\t$this->view->headTitle()->prepend('Partners');\n }", "protected function addToolBar()\r\n\t{\r\n\t\t$title = JText::_('COM_SMF_MANAGER');\r\n\t\tif ($this->pagination->total)\r\n\t\t{\r\n\t\t\t$title .= \"<span style='font-size: 0.5em; vertical-align: middle;'> (\" . $this->pagination->total . \")</span>\";\r\n\t\t}\r\n\r\n\t\tJToolBarHelper::title($title,'smf');\r\n\r\n\t\tJToolBarHelper::addNew('smf.add');\r\n\t\tJToolBarHelper::editList('smf.edit');\r\n\t\tJToolBarHelper::deleteList('', 'datalist.delete');\r\n\t}", "public function setPageTitle($title);", "function addHeader($title)\n {\n $this->page .= <<<EOD\n<html>\n<head>\n<title>$title</title>\n</head>\n<body>\n<h1 align=\"center\">$title</h1>\nEOD;\n }", "protected function addToolbar()\n\t{\n\t\t// Initialise variables.\n\t\t$state\t= $this->get('State');\n\t\t$canDo\t= HelloHelper::getActions();\n\n\t\tJToolBarHelper::title(JText::_('COM_HELLO_MESSAGES_TITLE'), 'hello');\n\n\t\tif ($canDo->get('core.create')) {\n\t\t\tJToolBarHelper::addNew('message.add', 'JTOOLBAR_NEW');\n\t\t}\n\n\t\tif ($canDo->get('core.edit')) {\n\t\t\tJToolBarHelper::editList('message.edit', 'JTOOLBAR_EDIT');\n\t\t}\n\n\t\tif ($canDo->get('core.edit.state')) {\n\t\t\tJToolBarHelper::publishList('messages.publish', 'JTOOLBAR_PUBLISH');\n\t\t\tJToolBarHelper::unpublishList('messages.unpublish', 'JTOOLBAR_UNPUBLISH');\n\t\t\tJToolBarHelper::archiveList('messages.archive','JTOOLBAR_ARCHIVE');\n\t\t}\n\n\t\tif ($state->get('filter.published') == -2 && $canDo->get('core.delete')) {\n\t\t\tJToolBarHelper::deleteList('', 'messages.delete','JTOOLBAR_EMPTY_TRASH');\n\t\t} else if ($canDo->get('core.edit.state')) {\n\t\t\tJToolBarHelper::trash('messages.trash','JTOOLBAR_TRASH');\n\t\t}\n\n\t\tif ($canDo->get('core.admin')) {\n\t\t\tJToolBarHelper::preferences('com_hello');\n\t\t}\n\t}", "public function add_page() {\n\t\t\tif ( ! defined( 'WPEX_THEME_PANEL_SLUG' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Add page\n\t\t\tadd_submenu_page(\n\t\t\t\tWPEX_THEME_PANEL_SLUG,\n\t\t\t\t__( 'Demo Importer', 'total' ),\n\t\t\t\t__( 'Demo Importer', 'total' ),\n\t\t\t\t'administrator',\n\t\t\t\tWPEX_THEME_PANEL_SLUG .'-demo-importer',\n\t\t\t\tarray( $this, 'demos_page' )\n\t\t\t);\n\n\t\t}", "protected function addToolbar()\n\t{\n\t\tJFactory::getApplication()->input->set('hidemainmenu', true);\n\n\t\t$canDo = JHelperContent::getActions('com_cooltouraman');\n\t\t$isNew = ($this->item->id == 0);\n\n\t\tJToolbarHelper::title(\n\t\t\tJText::_(\n\t\t\t\t$isNew ? 'COM_COOLTOURAMAN_VIEW_NEW_EXPERIENCE_TITLE' : 'COM_COOLTOURAMAN_VIEW_EDIT_EXPERIENCE_TITLE'\n\t\t\t),\n\t\t\t'experience_level ' . ($isNew ? 'experience_level-add' : 'experience_level-edit')\n\t\t);\n\n\t\tif ($canDo->get('core.edit') || $canDo->get('core.create'))\n\t\t{\n\t\t\tJToolbarHelper::apply('experience_level.apply');\n\t\t\tJToolbarHelper::save('experience_level.save');\n\t\t}\n\n\t\tif (empty($this->item->id))\n\t\t{\n\t\t\tJToolbarHelper::cancel('experience_level.cancel');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tJToolbarHelper::cancel('experience_level.cancel', 'JTOOLBAR_CLOSE');\n\t\t}\n\t}", "protected function addToolBar() \r\n {\r\n // Ponemos el nombre del titulo de la vista y el icono que seleccionemos.\r\n JToolBarHelper::title(JText::_('Modelos de Marcas de Vehiculo'),'bookmark banners');\r\n JToolBarHelper::deleteList('', 'nodelos.delete');\r\n JToolBarHelper::editList('nodelo.edit');\r\n JToolBarHelper::addNew('nodelo.add');\r\n }", "protected function addToolbar()\n\t{\n\t\t$bar = JToolBar::getInstance('sender');\n\t\t$bar->appendButton('Link', 'export', 'COM_NEWSLETTER_NEWSLETTER_SEND', '#');\n\n\t\t// Load the submenu.\n\t\tNewsletterHelper::addSubmenu(JRequest::getVar('view'));\n\t}", "public function initToolbar()\n {\n }", "protected function setupPage()\n {\n // Yes, hardcoded on purpose\n $this->pageRenderer->setXmlPrologAndDocType('<!DOCTYPE html>');\n $this->pageRenderer->setCharSet('utf-8');\n $this->pageRenderer->setLanguage($GLOBALS['LANG']->lang);\n $this->pageRenderer->addMetaTag('<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">');\n }", "protected function addToolbar()\n\t{\n\t\trequire_once JPATH_COMPONENT.'/helpers/wbty_payments.php';\n\n\t\t$state\t= $this->get('State');\n\t\t$canDo\t= Wbty_paymentsHelper::getActions($state->get('filter.category_id'));\n\t\t\n\t\tJToolBarHelper::title(JText::_('COM_WBTY_PAYMENTS_TITLE_CONTROLPANEL'), 'controlpanel.png');\n\n\t\tif ($canDo->get('core.admin')) {\n\t\t\tJToolBarHelper::preferences('com_wbty_payments');\n\t\t}\n\n\t}", "protected function renderToolbar() {}", "protected function addToolbar() {\n JFactory::getApplication()->input->set('hidemainmenu', true);\n\n $user = JFactory::getUser();\n $isNew = ($this->item->id == 0);\n if (isset($this->item->checked_out)) {\n $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));\n } else {\n $checkedOut = false;\n }\n\n JToolBarHelper::title(JText::_('COM_CHARTIIB_TITLE_HIERARCHY'), 'generic');\n\n JToolBarHelper::custom('hierarchy.enregistrer', 'save.png', 'save.png', 'JTOOLBAR_SAVE', false);\n \n if (empty($this->item->id)) {\n JToolBarHelper::cancel('hierarchy.cancel', 'JTOOLBAR_CANCEL');\n } else {\n JToolBarHelper::cancel('hierarchy.cancel', 'JTOOLBAR_CLOSE');\n }\n }", "public function init()\n {\n \tparent::init();\n \t$this->view->headTitle('Wedding Cakes');\n }", "protected function page_title() {\n?>\n\t\t<h2>\n\t\t\t<?php echo __( 'Marketplace Add-ons', APP_TD ); ?>\n\t\t\t<a href=\"https://marketplace.appthemes.com/\" class=\"add-new-h2\"><?php _e( 'Browse Marketplace', APP_TD ); ?></a>\n\t\t\t<a href=\"https://www.appthemes.com/themes/\" class=\"add-new-h2\"><?php _e( 'Browse Themes', APP_TD ); ?></a>\n\t\t</h2>\n<?php\n\t}", "private function addToolbar(): void\n\t{\n\t\tFactory::getApplication()->input->set('hidemainmenu', true);\n\n\t\tToolbarHelper::title(Text::_('COM_JED_EDIT_EMAIL'), 'mail');\n\n\t\tif ($this->canDo->get('core.edit') || $this->canDo->get('core.create'))\n\t\t{\n\t\t\tToolbarHelper::apply('email.apply');\n\t\t\tToolbarHelper::save('email.save');\n\t\t}\n\n\t\tif ($this->canDo->get('core.create')\n\t\t\t&& $this->canDo->get(\n\t\t\t\t'core.manage'\n\t\t\t))\n\t\t{\n\t\t\tToolbarHelper::save2new('email.save2new');\n\t\t}\n\n\t\tif (!$this->item->get('id'))\n\t\t{\n\t\t\tToolbarHelper::cancel('email.cancel');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tToolbarHelper::cancel('email.cancel', 'JTOOLBAR_CLOSE');\n\t\t}\n\t}", "protected function setupPage() {}", "function set_title() {\n \tglobal $pageTitle;\n \tif (isset($pageTitle))\n \t\techo 'Tanqeeb | ' . $pageTitle;\n \telse\n \t\techo 'Tanqeeb';\n}", "function setElementToolbar()\n\t{\n\t\t$task = JRequest::getVar('task', '', 'method', 'string');\n\t\tJToolBarHelper::title($task == 'add' ? JText::_('ELEMENT') . ': <small><small>[ '. JText::_('NEW') .' ]</small></small>' : JText::_('ELEMENT') . ': <small><small>[ '. JText::_('EDIT') .' ]</small></small>', 'fabrik-element.png');\n\t\tJToolBarHelper::save();\n\t\tJToolBarHelper::apply();\n\t\tJToolBarHelper::cancel();\n\t}", "protected function setup_menu() {\n\t\t$nag = '';\n\n\t\tif ( $this->has_notices() ) {\n\t\t\t$nag = \" <span class='wp-shp-browser-info dashicons dashicons-info' style='line-height: 0.8em'></span>\";\n\t\t}\n\n\t\t$defaults = array(\n\t\t\t'menu_title' => __( 'Showcase', 'wp-shp-browser' ),\n\t\t\t'page_title' => $this->get_page_title(),\n\t\t\t'page_slug' => $this->page_slug,\n\t\t\t'action_link' => false,\n\t\t\t'admin_action_priority' => 99,\n\t\t);\n\t\t$this->args = wp_parse_args( $this->args, $defaults );\n\n\t\t$this->args['menu_title'] .= $nag;\n\t}", "protected function setPageTitle() {\r\n\t\t$pageTitleText = (empty($this->settings['news']['semantic']['general']['pageTitle']['useAlternate'])) ? $this->newsItem->getTitle() : $this->newsItem->getAlternativeTitle();\r\n\t\t$pageTitleAction = $this->settings['news']['semantic']['general']['pageTitle']['action'];\r\n\r\n\t\tif (!empty($pageTitleAction)) {\r\n\t\t\tswitch ($pageTitleAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$pageTitleText .= ': ' . $GLOBALS['TSFE']->page['title'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$pageTitleText = $GLOBALS['TSFE']->page['title'] . ': ' . $pageTitleText;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t\t$this->pageTitle = html_entity_decode($pageTitleText, ENT_QUOTES, \"UTF-8\");\r\n\t\t\t$GLOBALS['TSFE']->page['title'] = $this->pageTitle;\r\n\t\t\t$GLOBALS['TSFE']->indexedDocTitle = $this->pageTitle;\r\n\t\t}\r\n\t}", "public function ext_makeToolBar() {}", "public function header()\n {\n echo \"<!doctype html>\\n<html lang='pt'>\\n<head>\\n\";\n echo \"\\t<meta charset='UTF-8'>\\n\";\n echo \"\\t<title>{$this->controller->getTitle()}</title>\\n\";\n $this->links();\n echo \"</head>\\n<body>\\n\";\n }", "protected function addToolbar() {\n //// Get a refrence of the page instance in joomla\n//\t\t$document\t= JFactory::getDocument();\n// // Set toolbar items for the page\n// $stylelink = '<link rel=\"stylesheet\" href=\"'.JURI::root().'administrator/components/com_sportsmanagement/assets/css/jlextusericons.css'.'\" type=\"text/css\" />' .\"\\n\";\n// $document->addCustomTag($stylelink);\n\n $app = JFactory::getApplication();\n $jinput = $app->input;\n $option = $jinput->getCmd('option');\n // store the variable that we would like to keep for next time\n // function syntax is setUserState( $key, $value );\n $app->setUserState(\"$option.rid\", $this->rid);\n $app->setUserState(\"$option.pid\", $this->project_id);\n\n $massadd = $jinput->getInt('massadd', 0);\n\n // Set toolbar items for the page\n $this->title = JText::_('COM_SPORTSMANAGEMENT_ADMIN_MATCHES_TITLE');\n\n if (!$massadd) {\n //JToolbarHelper::publishList('matches.publish');\n //JToolbarHelper::unpublishList('matches.unpublish');\n\n JToolbarHelper::publish('match.insertgooglecalendar', 'JLIB_HTML_CALENDAR', true);\n JToolbarHelper::divider();\n JToolbarHelper::publish('matches.count_result_yes', 'COM_SPORTSMANAGEMENT_ADMIN_MATCH_F_AD_INCL', true);\n JToolbarHelper::unpublish('matches.count_result_no', 'COM_SPORTSMANAGEMENT_ADMIN_MATCH_F_AD_INCL', true);\n JToolbarHelper::divider();\n JToolbarHelper::publish('matches.publish', 'JTOOLBAR_PUBLISH', true);\n JToolbarHelper::unpublish('matches.unpublish', 'JTOOLBAR_UNPUBLISH', true);\n JToolbarHelper::divider();\n\n JToolbarHelper::apply('matches.saveshort');\n JToolbarHelper::divider();\n\n JToolbarHelper::custom('match.massadd', 'new.png', 'new_f2.png', JText::_('COM_SPORTSMANAGEMENT_ADMIN_MATCHES_MASSADD_MATCHES'), false);\n JToolbarHelper::addNew('match.addmatch', JText::_('COM_SPORTSMANAGEMENT_ADMIN_MATCHES_MASSADD_ADD_MATCH'));\n//\t\t\tJToolbarHelper::deleteList(JText::_('COM_SPORTSMANAGEMENT_ADMIN_MATCHES_MASSADD_WARNING'), 'match.remove');\n JToolbarHelper::divider();\n\n JToolbarHelper::back('JPREV', 'index.php?option=com_sportsmanagement&view=rounds');\n } else {\n JToolbarHelper::custom('match.cancelmassadd', 'cancel.png', 'cancel_f2.png', JText::_('COM_SPORTSMANAGEMENT_ADMIN_MATCHES_MASSADD_CANCEL_MATCHADD'), false);\n }\n\n parent::addToolbar();\n }", "protected function addToolbar(){\n\t\tJRequest::setVar('hidemainmenu', true);\n\t\t$isNew\t\t= ($this->item->id == 0);\n\t\tJToolBarHelper::title($isNew ? JText::_('ADD_coment') : JText::_('EDIT_coment'), 'coment.png');\n\t\tJToolBarHelper::apply('coment.apply');\n\t\tJToolBarHelper::save('coment.save');\n\t\tJToolBarHelper::save2new('coment.save2new');\n\t\t// If an existing item, can save to a copy.\n\t\tif (empty($this->item->id)) {\n\t\t\tJToolBarHelper::cancel('coment.cancel');\n\t\t}\n\t\telse {\n\t\t\tJToolBarHelper::cancel('coment.cancel', 'JTOOLBAR_CLOSE');\n\t\t}\n\t}", "function admin_page_header()\n\t\t{\n\t\t\t$permissions = $this->permissions_check();\n\n\t\t\t$out = '';\n\t\t\t$out .= '<h1>WP Volunteer Manager</h1>';\n\n\t\t\t$out .= $this->render_messages();\n\t\t\t$out .= $this->admin_notices();\n\n\t\t\techo $out;\n\n\t\t\tif(!$permissions) { wp_die(); }\n\t\t}", "public function page_setup(){\n add_menu_page( PLUGIN_NAME, PLUGIN_NAME, 'manage_options', sanitize_key(PLUGIN_NAME), array($this, 'admin_page'), $this->icon, 3 );\n }", "public function setPageTitle($title)\n\t{\n\t\t$this->_themeExtras['title'] = $title;\n\t}", "public function setPageTitle($page_name);", "public function setPageTitle($page_name);", "protected function actionHeader() {\n Navigation::activateItem($this->navlink);\n $this->setTabNavigationIcon('black');\n $this->addSubNavigation(_('Lesen'), 'show');\n if (Utils\\hasPermission($this->edit_permission)) {\n $this->addSubNavigation(_('Bearbeiten'), 'edit');\n }\n }", "function customPageHeader() {\n echo osc_apply_filter('custom_plugin_title', __('Plugins'));\n }", "protected function addToolbar()\n\t{\n\t\tif (!$this->edit)\n\t\t{\n\t\t\tJToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_CLUB_ADD_NEW'),'jl-clubs');\n\t\t\tJLToolBarHelper::save('club.save');\n\t\t\tJToolBarHelper::divider();\n\t\t\tJLToolBarHelper::cancel('club.cancel');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// for existing items the button is renamed `close` and the apply button is showed\n\t\t\tJToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_CLUB_EDIT'). ': ' . $this->form->getValue('name'), 'jl-clubs');\n\t\t\tJLToolBarHelper::apply('club.apply');\n\t\t\tJLToolBarHelper::save('club.save');\n\t\t\tJToolBarHelper::divider();\n\t\t\tJLToolBarHelper::cancel('club.cancel','COM_JOOMLEAGUE_GLOBAL_CLOSE');\n\t\t}\n\t\t\n\t\tJToolBarHelper::help('screen.joomleague',true);\n\t}", "public function initializePage()\n\t{\n\t\tadd_menu_page('Thema opties', 'Thema opties', 'manage_options', 'theme-options');\n\t}", "public function initPageHeaders()\n\t{\n\t\tinclude_once('view/main_page_header.php');\n\t}", "function mkPage($subtitle = '', $menu = 0, $level = 0)\n{\n global $app, $globalSettings;\n\n if ($subtitle == '') {\n $title = $globalSettings[DISPLAY_APP_NAME];\n } else {\n $title = $globalSettings[DISPLAY_APP_NAME] . $globalSettings['sep'] . $subtitle;\n }\n $rot = mkRootUrl();\n $auth = is_authenticated();\n if ($globalSettings[LOGIN_REQUIRED]) {\n $adm = is_admin();\n } else {\n $adm = true;\n } # the admin button should be always visible if no login is required\n $page = ['title' => $title,\n 'rot' => $rot,\n 'h1' => $subtitle,\n 'version' => $globalSettings['version'],\n 'glob' => $globalSettings,\n 'menu' => $menu,\n 'level' => $level,\n 'auth' => $auth,\n 'admin' => $adm];\n return $page;\n}", "function beginPage($pageTitle = 'Paalgeld Europa', $inContainer = true, $subTitle = ''){\n global $_inContainer, $_pageName, $_loadChosen, $_loadGoogleCharts, $_loadGoogleMaps;\n $_inContainer = $inContainer;\n require('inc/pagebegin.php');\n}", "public function addHeader(){\n$this->page.= <<<EOD\n<html>\n<head>\n</head>\n<title>\n$this->title\n</title>\n<body>\n<h1 align=\"center\">\n$this->title\n</h1>\nEOD;\n}", "public function admin_dashboard() {\n $this->set('title_for_layout', __('Panel'));\n }", "public function run()\n {\n $title = 'Any successful career starts with a good Education';\n\n FrontPageHeader::create([\n 'title' => strtolower($title),\n ]);\n }", "protected function output_page_title( $page_title = '' ) {\n?>\n\t\t<h2>\n\t\t\t<?php echo $this->browser_args['page_title']; ?>\n\n\t\t\t<?php if ( ! empty( $this->browser_args['header_buttons'] ) && is_array( $this->browser_args['header_buttons'] ) ) foreach( $this->browser_args['header_buttons'] as $tab ): ?>\n\t\t\t\t<a href=\"<?php echo esc_url( $tab['url'] ); ?>\" class=\"add-new-h2\" target=\"_blank\" rel=\"nofollow\"><?php echo $tab['title']; ?></a>\n\t\t\t<?php endforeach; ?>\n\t\t</h2>\n<?php\n\t}", "public function add_theme_title_tag() {\n\t\t\tif (!is_admin()) {\n\t\t\t\t// auto gen <title>\n\t\t\t\tif (!current_theme_supports('title-tag')) {\n\t\t\t\t\tadd_theme_support( 'title-tag' );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function iron_admin_bar ( $wp_toolbar )\n{\n\tglobal $redux_args;\n\n\t$wp_toolbar->add_node( array(\n\t\t 'parent' => 'appearance'\n\t\t, 'id' => 'iron-options'\n\t\t, 'title' => $redux_args['menu_title']\n\t\t, 'href' => admin_url('/admin.php?page=' . $redux_args['page_slug'])\n\t) );\n}", "public function welcome_register_menu() {\n\t\t\t\t$action_count = get_option('swing_plugin_installed_notif');\n\t\t\t\t$title = $action_count > 0 ? esc_html($this->strings['welcome_menu_text']) . '<span class=\"badge pending-tasks\">' . esc_html( $action_count ) . '</span>' : esc_html($this->strings['welcome_menu_text']);\n\t\t\t\tadd_theme_page( esc_html($this->strings['welcome_menu_text']), $title , 'edit_theme_options', 'vmagazine-lite-welcome', array( $this, 'welcome_screen' ));\n\t\t\t}", "protected function addToolBar()\n {\n JToolbarHelper::title(JText::_('COM_AGENDA_ADMIN_MANAGE_AGENDA_ITEMS'));\n JToolbarHelper::addNew('agendaitem.add');\n JToolbarHelper::editList('agendaitem.edit');\n JToolbarHelper::divider();\n JToolbarHelper::publish('agendaitems.publish', 'JTOOLBAR_PUBLISH', true);\n JToolbarHelper::custom('agendaitems.overwrittenUnpublish', 'unpublish', 'unpublish', 'JTOOLBAR_UNPUBLISH');\n JToolbarHelper::divider();\n JToolbarHelper::deleteList(JText::_('COM_AGENDA_AGENDA_ITEMS_DELETE_CONFIRM'), 'agendaitems.delete');\n }", "protected function addToolbar()\n\t{\n\t\t$user\t= JFactory::getUser();\n\t\t$result\t= new JObject;\n\n\t\t$actions = array(\n\t\t\t'core.admin', 'core.manage'\n\t\t);\n\n\t\tforeach ($actions as $action) {\n\t\t\t$result->set($action, $user->authorise($action, 'com_toes'));\n\t\t}\n\t\t\n\t\t$canDo\t= $result;\n\t\t\n\t\tJToolBarHelper::title(JText::_('COM_TOES'), 'blue-transparant');\n\t\n\t\tif ($canDo->get('core.admin')) {\n\t\t\tJToolBarHelper::preferences('com_toes');\n\t\t\tJToolBarHelper::divider();\n\t\t}\n\t}", "protected function renderPageTitle() {}", "function add_utility_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $icon_url = '')\n {\n }", "public static function add_page() {\n\t\tadd_submenu_page(\n\t\t\tWPEX_THEME_PANEL_SLUG,\n\t\t\tesc_html__( 'Under Construction', 'total' ),\n\t\t\tesc_html__( 'Under Construction', 'total' ),\n\t\t\t'administrator',\n\t\t\tWPEX_THEME_PANEL_SLUG . '-under-construction',\n\t\t\tarray( 'WPEX_Under_Construction', 'create_admin_page' )\n\t\t);\n\t}", "protected function regeneratePageTitle() {}", "function topbar_plugin_page() {\r\n $page_title = 'Top Bar Options';\r\n $menu_title = 'Top Bar' ;\r\n $capabiliy = 'manage_options';\r\n $slug = 'topbar-plugin';\r\n $callback = 'topbar_page_html';\r\n $icon = 'dashicons-schedule';\r\n $position = 60;\r\n\r\n add_menu_page($page_title, $menu_title, $capabiliy, $slug, $callback, $icon, $position);\r\n}", "public function setPages() {\n $this->pages = array(\n array(\n 'page_title' => 'Open Badge',\n 'menu_title' => 'Open Badge',\n 'capability' => 'manage_options',\n 'menu_slug' => self::SLUG_PLUGIN,\n 'callback' => array(DashboardTemp::class, 'main'),\n 'icon_url' => 'dashicons-awards',\n 'position' => '110'\n )\n );\n }", "function scoreSystemManager_add_pages() {\r\n // Add a new top-level menu (ill-advised):\r\n add_menu_page('Score System', 'Score System', 'edit_pages', 'scoreSystemManager-dashboard', 'scoreSystemManager_dashboard');\r\n}", "private function configureToolbar(): void\n {\n /** @var Toolbar $toolbarLayout */\n $toolbar = $this->getToolbarBlock();\n $toolbar->removeOrderFromAvailableOrders('position');\n $toolbar->addOrderToAvailableOrders('created_at', __('New'));\n $toolbar->setDefaultOrder('created_at');\n }", "public static function pageTop($title)\r\n {\r\n $appcss = WS_CSS . 'app.css';\r\n echo <<<pagetop\r\n <!doctype html>\r\n <html>\r\n <div class=\"page\">\r\n \r\n <head>\r\n <meta charset=\"utf-8\">\r\n <title>$title</title>\r\n <!-- Bootstrap Core CSS -->\r\n <link href=\"styles.css\" rel=\"stylesheet\">\r\n \r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\r\n <meta name=\"author\" content=\"Caleb Armentrout\">\r\n <meta name=\"description\" content=\"Everything you wanted to know about web programming\">\r\n <meta name=\"keywords\" content=\"xampp, php, mysql, html, web programming\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n <!--[if lte IE 9]>\r\n <script src=\"http://html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\r\n <![endif]-->\r\n \r\n <!-- Embed fonts for the page -->\r\n <link href='https://fonts.googleapis.com/css?family=Miriam+Libre:400,700|Source+Sans+Pro:200,400,700,600,400italic,700italic' rel='stylesheet' type='text/css'>\r\n \r\n <!-- Latest compiled and minified CSS - get from getbootstrap.com-->\r\n <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\" integrity=\"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\" crossorigin=\"anonymous\">\r\n \r\n <!-- Optional theme -->\r\n <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css\" integrity=\"sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp\" crossorigin=\"anonymous\">\r\n \r\n <!-- Latest compiled and minified JavaScript -->\r\n <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\" integrity=\"sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa\" crossorigin=\"anonymous\"></script>\r\n \r\n <link rel=\"stylesheet\" href=\"$appcss\">\r\n \r\n <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->\r\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\r\n <!--[if lt IE 9]>\r\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\r\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\r\n <![endif]-->\r\n \r\n </head>\r\n <body class=\"home language-php\">\r\n \r\n <header class=\"navbar navbar-default navbar-fixed-top topnav\" role=\"banner\">\r\n <div class=\"container topnav\">\r\n <nav role=\"navigation\">\r\n <div class=\"container-fluid\">\r\n <!-- Brand and toggle get grouped for better mobile display -->\r\n <div class=\"navbar-header\">\r\n <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar-collapse-1\">\r\n <span class=\"sr-only\">Toggle navigation</span>\r\n <span class=\"icon-bar\"></span>\r\n <span class=\"icon-bar\"></span>\r\n <span class=\"icon-bar\"></span>\r\n </button>\r\n <a class=\"navbar-brand topnav\" href=\"/\">Home</a>\r\n </div>\r\n \r\n <!-- Collect the nav links, forms, and other content for toggling -->\r\n <div class=\"collapse navbar-collapse\" id=\"navbar-collapse-1\">\t\t\t\t\t\t \r\n <ul class=\"nav navbar-nav navbar-right\">\r\n \r\n <li><a href=\"/createPost.php\">Create Post</a></li> \r\n <li><a href=\"/getPost.php\">Editing posts</a></li>\r\n <li><a href=\"/createLogin.php\">Create Login</a></li>\r\n <li><a href=\"/fileupload.php\">Upload Image</a></li>\r\n <li><a href=\"/login.php\"><i class=\"fa fa-sign-in fa-fw\"></i> Login</a></li>\t \r\n </ul>\t\t\t\t\t\t\r\n </div><!-- /.navbar-collapse -->\r\n </div><!-- /.container-fluid -->\r\n </nav>\r\n </div>\t\t\r\n </header>\r\n <div class=\"intro-header\">\r\n\t \t<h2>Web Development</h2>\r\n\t</div>\r\npagetop;\r\n }", "public function prePageHeader();", "public function parallax_one_welcome_register_menu() {\n\t\tadd_theme_page( 'About Parallax One', 'About Parallax One', 'activate_plugins', 'parallax-one-welcome', array( $this, 'parallax_one_welcome_screen' ) );\n\t}", "public function add_page() {\n\t\t\tadd_submenu_page(\n\t\t\t\tWPEX_THEME_PANEL_SLUG,\n\t\t\t\t__( 'Theme Skins', 'wpex' ),\n\t\t\t\t__( 'Theme Skins', 'wpex' ),\n\t\t\t\t'administrator',\n\t\t\t\tWPEX_THEME_PANEL_SLUG .'-skins',\n\t\t\t\tarray( $this, 'create_admin_page' )\n\t\t\t);\n\t\t}", "public function indexAction() {\r\n $this->view->title = 'Hello World !';\r\n $this->view->headTitle('Hello World !');\r\n }", "function add_theme_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }", "public function init(){\n parent::init();\n $this->registerAssets();\n \n echo CHtml::openTag($this->tag, $this->getTitleOptions());\n echo $this->getTitleText();\n }", "public function __construct() {\n parent::__construct('div', new TitleBarContentArea('left'), new TitleBarContentArea('right'));\n $this->cssClasses()->lock('title-bar');\n }", "private function configureTemplate(){\n\t\t$template = $this->getTemplate();\n\t\t$template->setPageSubtitle($this->getModule()->getDisplayedName());\n\t}", "function setElementsToolbar()\n\t{\n\t\tJToolBarHelper::title(JText::_('ELEMENTS'), 'fabrik-element.png');\n\t\tJToolBarHelper::customX('addToTableView', 'publish.png', 'publish_f2.png', JText::_('ADD TO TABLE VIEW'));\n\t\tJToolBarHelper::customX('removeFromTableView', 'unpublish.png', 'unpublish_f2.png', JText::_('REMOVE FROM TABLE VIEW'));\n\t\tJToolBarHelper::publishList();\n\t\tJToolBarHelper::unpublishList();\n\t\tJToolBarHelper::customX('copySelectGroup', 'copy.png', 'copy_f2.png', 'Copy');\n\t\tJToolBarHelper::deleteList('', 'checkRemove');\n\t\tJToolBarHelper::editListX();\n\t\tJToolBarHelper::addNewX();\n\t}", "protected function setDefaultHeader()\n {\n if (!empty($this->toolbar)) {\n return;\n }\n\n $heading = function ($n) {\n return [\n 'label' => Yii::t('kvmarkdown', 'Heading {n}', ['n' => $n]),\n 'options' => [\n 'class' => 'kv-heading-' . $n,\n 'title' => Yii::t('kvmarkdown', 'Heading {n} Style', ['n' => $n]),\n ],\n ];\n };\n $isBs4 = $this->isBs4();\n\n $this->toolbar = [\n [\n 'buttons' => [\n self::BTN_BOLD => ['icon' => 'bold', 'title' => Yii::t('kvmarkdown', 'Bold')],\n self::BTN_ITALIC => ['icon' => 'italic', 'title' => Yii::t('kvmarkdown', 'Italic')],\n self::BTN_PARAGRAPH => ['icon' => 'font', 'title' => Yii::t('kvmarkdown', 'Paragraph')],\n self::BTN_NEW_LINE => [\n 'icon' => 'text-height',\n 'title' => Yii::t('kvmarkdown', 'Append Line Break'),\n ],\n self::BTN_HEADING => [\n 'icon' => $isBs4 ? 'heading' : 'header',\n 'title' => Yii::t('kvmarkdown', 'Heading'),\n 'items' => [\n self::BTN_H1 => $heading(1),\n self::BTN_H2 => $heading(2),\n self::BTN_H3 => $heading(3),\n self::BTN_H4 => $heading(4),\n self::BTN_H5 => $heading(5),\n self::BTN_H6 => $heading(6),\n ],\n ],\n ],\n ],\n [\n 'buttons' => [\n self::BTN_LINK => ['icon' => 'link', 'title' => Yii::t('kvmarkdown', 'URL/Link')],\n self::BTN_IMAGE => ['icon' => $isBs4 ? 'image' : 'picture', 'title' => Yii::t('kvmarkdown', 'Image')],\n ],\n ],\n [\n 'buttons' => [\n self::BTN_INDENT_L => ['icon' => $isBs4 ? 'outdent' : 'indent-left', 'title' => Yii::t('kvmarkdown', 'Indent Text')],\n self::BTN_INDENT_R => ['icon' => $isBs4 ? 'indent' : 'indent-right', 'title' => Yii::t('kvmarkdown', 'Unindent Text')],\n ],\n ],\n [\n 'buttons' => [\n self::BTN_UL => ['icon' => 'list', 'title' => Yii::t('kvmarkdown', 'Bulleted List')],\n self::BTN_OL => ['icon' => 'list-alt', 'title' => Yii::t('kvmarkdown', 'Numbered List')],\n self::BTN_DL => ['icon' => 'th-list', 'title' => Yii::t('kvmarkdown', 'Definition List')],\n ],\n ],\n [\n 'buttons' => [\n self::BTN_FOOTNOTE => ['icon' => 'edit', 'title' => Yii::t('kvmarkdown', 'Footnote')],\n self::BTN_QUOTE => ['icon' => 'comment', 'title' => Yii::t('kvmarkdown', 'Block Quote')],\n ],\n ],\n [\n 'buttons' => [\n self::BTN_CODE => [\n 'label' => $isBs4 ? null : self::ICON_CODE,\n 'icon' => $isBs4 ? 'code' : null,\n 'title' => Yii::t('kvmarkdown', 'Inline Code'),\n 'encodeLabel' => false,\n ],\n self::BTN_CODE_BLOCK => ['icon' => $isBs4 ? 'laptop-code' : 'sound-stereo', 'title' => Yii::t('kvmarkdown', 'Code Block')],\n ],\n ],\n [\n 'buttons' => [\n self::BTN_HR => [\n 'icon' => 'minus',\n 'title' => Yii::t('kvmarkdown', 'Horizontal Line'),\n 'encodeLabel' => false,\n ],\n ],\n ],\n [\n 'buttons' => [\n self::BTN_MAXIMIZE => [\n 'icon' => $isBs4 ? 'expand-arrows-alt' : 'fullscreen',\n 'title' => Yii::t('kvmarkdown', 'Toggle full screen'),\n 'data-enabled' => true,\n ],\n ],\n 'options' => ['class' => 'pull-right float-right'],\n ],\n ];\n }", "protected function addToolbar()\r\n {\r\n $canDo = JVoterHelper::getActions();\r\n $user = JFactory::getUser();\r\n \r\n // Get the toolbar object instance\r\n $bar = JToolbar::getInstance('toolbar');\r\n \r\n JToolbarHelper::title(JText::_('COM_JVOTER_TITLE_FEATURES'), 'puzzle-piece feature');\r\n \r\n if ($canDo->get('core.create'))\r\n {\r\n JToolbarHelper::addNew('feature.add');\r\n }\r\n \r\n if ($canDo->get('core.edit') || $canDo->get('core.edit.own'))\r\n {\r\n JToolbarHelper::editList('features.edit');\r\n }\r\n \r\n if ($canDo->get('core.edit.state'))\r\n {\r\n JToolbarHelper::publish('features.publish', 'JTOOLBAR_PUBLISH', true);\r\n JToolbarHelper::unpublish('features.unpublish', 'JTOOLBAR_UNPUBLISH', true);\r\n JToolbarHelper::archiveList('features.archive');\r\n }\r\n \r\n if ($user->authorise('core.admin'))\r\n {\r\n JToolbarHelper::checkin('features.checkin');\r\n } \r\n \r\n if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete'))\r\n {\r\n JToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'features.delete', 'JTOOLBAR_EMPTY_TRASH');\r\n }\r\n elseif ($canDo->get('core.edit.state'))\r\n {\r\n JToolbarHelper::trash('features.trash');\r\n }\r\n \r\n if ($user->authorise('core.admin', 'com_jvoter') || $user->authorise('core.options', 'com_jvoter'))\r\n {\r\n JToolbarHelper::preferences('com_jvoter');\r\n }\r\n }", "public function __construct($title)\n {\n $this->_title = $title;\n $this->createMenuBar();\n }", "public function display_page_header() {\n\t\tglobal $title;\n\n\t\tprintf( '<h1>%s</h1>', esc_html( $title ) );\n\n\t\tsettings_errors( self::POST_ACTION_ID );\n\n\t\tprintf(\n\t\t\t'<p>%s</p>',\n\t\t\tesc_html(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1 is the name of the DB table, 2 is a version number, 3 is an option name. */\n\t\t\t\t\t__( 'Your custom table \"%1$s\" is ready and its current version is %2$d. This version number is stored in the (network?) option \"%3$s\".', 'autowpdb-example-plugin' ),\n\t\t\t\t\t$this->table->get_table_definition()->get_table_name(),\n\t\t\t\t\t$this->upgrader->get_db_version(),\n\t\t\t\t\t$this->upgrader->get_db_version_option_name()\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "public function indexAction() {\n $this->view->title = 'Hello World !';\n $this->view->headTitle('Hello World !');\n }", "public function init() {\n \tif (array_key_exists('applicationName', $this->_strings)) {\n \t\t$this->view->headTitle($this->_strings['applicationName']);\n \t\t$this->view->headerTitle = $this->_strings['applicationName'];\n \t}\n }", "public function initializePage()\n {\n // Set the font.\n $this->AddFont('MTCORSVA', '', 'MTCORSVA.php');\n $this->SetFont('MTCORSVA', '', 18);\n\n // Line break.\n $this->Ln(9);\n\n $this->Cell(259, 30, 'This certificate is presented to', 0, 0, 'C');\n\n // Set the font.\n $this->AddFont('BebasNeue-Regular', '', 'BebasNeue-Regular.php');\n $this->SetFont('BebasNeue-Regular', '', 30);\n\n // Line break.\n $this->Ln(10);\n\n // Set page header title.\n $this->Cell(259, 35, $this->aScheduleDetails['studentName'], 0, 0, 'C');\n\n // Line break.\n $this->Ln(1);\n\n $this->Cell(259, 35, '____________________________________', 0, 0, 'C');\n }", "public function index()\n {\n $this->layout->title = \"Home page\";\n }", "public function add_pages() {\n\t\t$admin_page = add_theme_page( __('Theme Options'), __('Theme Options'), 'manage_options', 'eaboot_options', array(&$this, 'display_page'));\n\n\t\tadd_action('admin_print_scripts-' . $admin_page, array(&$this, 'scripts'));\n\t\tadd_action('admin_print_styles-' . $admin_page, array(&$this, 'styles'));\n\t}", "protected function initTitles() {\n\t\t$title \t = \"\";\n\t\t\n\t\tif(isset($this->config['titles']['title']))\n\t\t \t$title = $this->config['titles']['title'];\n\n\t\tif(isset($this->config['titles'][$this->request->getControllerName()]['title']))\n\t\t \t$title .= $this->config['titles']['seperator'] . $this->config['titles'][$this->request->getControllerName()]['title'];\n\t\t \t\n\t\tif(isset($this->config['titles'][$this->request->getControllerName()]['action'][$this->request->getActionName()]))\n\t\t \t$title .= $this->config['titles']['seperator'] . $this->config['titles'][$this->request->getControllerName()]['action'][$this->request->getActionName()];\n\t\t \t\n\t\t$this->layout->setTitle($title);\n\t}", "public function index()\n {\n \t$this->setTitle($this->app['config']['title']);\n\n $this->useComponent('Header');\n $this->useComponent('Top');\n $this->useComponent('Sidebar');\n $this->useComponent('Footer');\n\n }", "public function addFooter(){\n\n$this->page .= <<<EOD\n<pre>\n$this->title\n</pre>\n</body>\n</html>\nEOD;\n}", "function __construct($ptitle)\r\n {\r\n $this->_htmlpage = new HTMLPage($ptitle);\r\n $this->setPageDefaults();\r\n $this->setDynamicDefaults();\r\n }", "protected function init()\n {\n $this->setTitle('core_layout.edit_layout');\n }", "public function before()\n\t{\n\n\t\tparent::before();\n\t\tif ($this->auto_render) { \n\t\t\t$this->template->title = 'Hector - ';\n\t\t\t$this->template->page_description = '';\n\t\t\t$this->template->navbar = '';\n\t\t\t$this->template->content = '';\n\t\t\t$this->template->styles = array();\n\t\t\t$this->template->scripts = array();\n\t\t\t$this->template->set_focus = '';\n\t\t}\n\t\t\n\t}", "function setTitle() {\n global $pageTitle;\n\n $pageTitle = isset($pageTitle) ? $pageTitle : 'Default' ;\n echo $pageTitle;\n }", "public function hb_custom_menu_page(){\n esc_html_e( 'Handlebars Test Page', 'hbs' );\n }", "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 init()\n {\n $this->_helper->layout()->getView()->headTitle('@PHPoton');\n\n // Set navigation\n $container = Zend_Registry::get('navigation');\n $this->view->navigation(new Zend_Navigation($container));\n }", "function setup_title() {\n\t\tglobal $bp;\n\n\t\tif ( bp_is_messages_component() ) {\n\t\t\tif ( bp_is_my_profile() ) {\n\t\t\t\t$bp->bp_options_title = __( 'My Messages', 'buddypress' );\n\t\t\t} else {\n\t\t\t\t$bp->bp_options_avatar = bp_core_fetch_avatar( array(\n\t\t\t\t\t'item_id' => bp_displayed_user_id(),\n\t\t\t\t\t'type' => 'thumb',\n\t\t\t\t\t'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )\n\t\t\t\t) );\n\t\t\t\t$bp->bp_options_title = bp_get_displayed_user_fullname();\n\t\t\t}\n\t\t}\n\n\t\tparent::setup_title();\n\t}", "function setToolBar()\r\n\t{\r\n\t\tJToolBarHelper::title( JText::_('CC VIDEO CATEGORIES'), 'videoscategories');\r\n\t\t\r\n\t\t// Add the necessary buttons\r\n\t\tJToolBarHelper::back('Home' , 'index.php?option=com_community');\r\n\t\tJToolBarHelper::divider();\r\n\t\tJToolBarHelper::publishList( 'publish' , JText::_('CC PUBLISH') );\r\n\t\tJToolBarHelper::unpublishList( 'unpublish' , JText::_('CC UNPUBLISH') );\r\n\t\tJToolBarHelper::divider();\r\n\t\tJToolBarHelper::trash( 'removecategory', JText::_('CC DELETE'));\r\n\t\tJToolBarHelper::addNew( 'newcategory' , JText::_('CC NEW') );\r\n\t}" ]
[ "0.70321816", "0.6914718", "0.69110465", "0.68955934", "0.6886404", "0.6848027", "0.6789726", "0.67716205", "0.6708893", "0.6635611", "0.659488", "0.6590661", "0.6535471", "0.64418656", "0.64236104", "0.63893145", "0.63043237", "0.6254176", "0.62397873", "0.6207881", "0.61812145", "0.6167674", "0.6152089", "0.6147539", "0.61029744", "0.6089703", "0.60783446", "0.6071012", "0.60308856", "0.6005357", "0.5998511", "0.5984899", "0.596946", "0.59512746", "0.59157944", "0.59069955", "0.5898562", "0.5891459", "0.58797073", "0.5863006", "0.585977", "0.58538747", "0.58529735", "0.5848634", "0.5843876", "0.5843876", "0.5829798", "0.58262616", "0.5826001", "0.5819702", "0.5809448", "0.58093256", "0.58021533", "0.5793401", "0.5776164", "0.5767844", "0.57571274", "0.5747103", "0.574098", "0.5730187", "0.572535", "0.5715437", "0.57127434", "0.5711367", "0.5695023", "0.56938547", "0.56897354", "0.5685917", "0.5677437", "0.5676247", "0.5675613", "0.5664654", "0.56611615", "0.56531876", "0.5648527", "0.56454796", "0.56430596", "0.56427675", "0.5642283", "0.56397146", "0.56350046", "0.56301916", "0.5628957", "0.5628128", "0.5626947", "0.5623501", "0.5621214", "0.5620866", "0.560856", "0.56084317", "0.56021434", "0.5601234", "0.5600047", "0.55882627", "0.55789477", "0.55738455", "0.5572703", "0.5571328", "0.5559302", "0.55518323", "0.5551231" ]
0.0
-1
function for deliver reponse on request===================
function deliverResponse($status,$status_msg,$data){ $response['status'] = $status; $response['status_msg'] = $status_msg; $response['data'] = $data; $json_response = json_encode($response); echo $json_response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _response() {}", "function deliver_response(){\n\n // --- Step 1: Initialize variables and functions\n //\n // Deliver HTTP Response\n // The desired HTTP response content type: [json, html, xml]\n // The desired HTTP response data\n\n\n header('HTTP/1.1 '.$this->response['status'] . // Set HTTP Response\n ' '.$this->http_response_code[$this->response['status'] ]);\n header('Content-Type: application/json; charset=utf-8'); // Set HTTP Response Content Type\n $json_response = json_encode($this->response['data']); // Format data into a JSON response\n echo $json_response; // Deliver formatted data\n }", "protected function sendResponse() {}", "abstract public function response();", "public function sendResponse();", "public function & GetResponse ();", "public function response();", "public function response ();", "public function prepareResponse();", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "function process() {\n\t\t\t$response = $this->response();\n\t\t\t$this->setSuccess($response);\n\t\t\treturn $this->responseVar;\n\t\t}", "abstract protected function getReponseData() ;", "public function send_response() {\n\t\n\t\t$return = $this->get_response();\n\t\t\n\t\t/* send it and terminate this instance */\n\t\tif($this->get_errors()) {\n\t\t\twp_send_json_error($return);\t\t\t\t\t\t\n\t\t} else {\n \t\tif( null === $this->wp_query ) {\n \t\t\twp_send_json_success($return); \t\t \t\t\n \t\t} else {\n \t\t\n \t\t\t$data = array(\n \t\t\t'success' => true,\n \t\t\t'data' => $return,\n \t\t\t'query' => $this->parse_wp_query_object_2_js( $this->wp_query )\n \t\t\t);\n \t\t\twp_send_json($data); // build a custom wp_send_json_success with an extra property \n \t\t}\t\t\t\n\t\t}\n\t}", "public function response()\n {\n }", "function _handler_response(&$app, &$c) {\n\t\t$c->param('app.view_http.response.status', $this->_http->getResponseCode());\n\t\t$c->param('app.view_http.response.body', $this->_http->getResponseBody());\n\t\t$c->param('app.view_http.response.headers', $this->_http->getResponseHeader());\n\t}", "public function serveRequest()\n {\n $msg = $this->connection->read();\n if (!$msg) return;\n $this->connection->acknowledge($msg);\n \n $replyMsg = $this->act($msg);\n\n // write correlation id\n $replyMsg->setHeader(\"correlation-id\", $msg->getId());\n\n $this->connection->send($msg->getReplyTo(), $replyMsg);\t\t\n }", "function deliverResponse($status,$status_msg,$data)\n{\n $response['status'] = $status;\n $response['status_msg'] = $status_msg;\n $response['data'] = $data;\n $json_response = json_encode($response);\n echo $json_response;\n}", "function deliverResponse($status,$status_msg,$data)\n{\n $response['status'] = $status;\n $response['status_msg'] = $status_msg;\n $response['data'] = $data;\n $json_response = json_encode($response);\n echo $json_response;\n}", "function deliverResponse($status,$status_msg,$data)\n{\n $response['status'] = $status;\n $response['status_msg'] = $status_msg;\n $response['data'] = $data;\n $json_response = json_encode($response);\n echo $json_response;\n}", "function deliverResponse($status,$status_msg,$data)\n{\n $response['status'] = $status;\n $response['status_msg'] = $status_msg;\n $response['data'] = $data;\n $json_response = json_encode($response);\n echo $json_response;\n}", "public function Response($response) {\n\t\t\n\t}", "protected function found()\n {\n $this->response = $this->response->withStatus(200);\n $this->jsonBody($this->payload->getOutput());\n }", "private function __send_response(){\n http_response_code($this->response_code);\n if($this->_redirect) header(\"Location: \".Config::WEB_DIRECTORY.\"{$this->_redirect_location}\");\n elseif($this->_JSON){\n header('Content-Type: application/json; charset=UTF-8');\n print json_encode($this->_JSON_contents, JSON_PRETTY_PRINT);\n }elseif($this->_HTML){\n if($this->_HTML_load_view) $this->_template->render();\n } /** @noinspection PhpStatementHasEmptyBodyInspection */ else{\n // Do nothing\n }\n }", "abstract public function responseProvider();", "protected function success()\n {\n $this->response = $this->response->withStatus(200);\n $this->jsonBody($this->payload->getOutput());\n }", "public function getHttpResponse();", "private function getResponse() {\n $this->response['status_code'] = $this->status->getStatusCode();\n $this->response['reason_phrase'] = $this->status->getReasonPhrase();\n \n $this->readHeaders();\n }", "public function serve_request()\n {\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "public function getResponse() {}", "public function getResponse() {}", "function response($code, $dataAry)\n{\n if($code != 200)\n {\n $dataAry['status'] = 'error'; \n }\n else\n {\n $dataAry['status'] = 'success'; \n }\n $response = $GLOBALS['app']->response();\n $response['Content-Type'] = 'application/json';\n $response->status($code);\n $response->body(json_encode($dataAry));\n}", "public function getResponse() {\n\t}", "public static function client_responce()\n {\n // Find out Request Type\n $req_type = self::client_request_type();\n\n // Fire Responce\n self::{$req_type}();\n\n // End..\n die();\n }", "protected function _request() {}", "public function Response($response);", "public function getResponse($response) {\r\n\r\n\r\n }", "public function getResponse()\n {\n }", "private function requestProcessor() {\n try {\n\n if (empty($this->uri))\n throw new \\Exception(\"Undefined url\");\n\n $ReqHandle = curl_init($this->uri);\n\n $body = json_encode([]);\n if( sizeof($this->data) > 0 )\n $body = json_encode($this->data);\n\n $returnTransfer = 0;\n if( $this->hasResponseToReturn )\n $returnTransfer = 1;\n\n $isPost = 0;\n if( $this->method != 'GET')\n $isPost = 1;\n\n\n if($isPost == 1){\n curl_setopt($ReqHandle,CURLOPT_POST, $isPost);\n curl_setopt($ReqHandle, CURLOPT_POSTFIELDS, $body);\n }\n \n curl_setopt_array($ReqHandle, [\n CURLOPT_RETURNTRANSFER => $returnTransfer,\n CURLOPT_HTTPHEADER => $this->headersToBeUsed\n ]);\n\n\n $result = curl_exec($ReqHandle);\n\n if(curl_errno($ReqHandle)){\n\n return curl_error($ReqHandle);\n }\n\n if($returnTransfer == 1)\n return json_decode($result);\n\n\n\n } catch (\\Throwable $t) {\n new ErrorTracer($t);\n }\n }", "protected function _handleResponse(){\n $this->_results[] = array(\n 'http_code' => $this->getInfoHTTPCode(),\n 'response' => $this->getResponse(),\n 'server' => $this->getUrl()\n );\n }", "protected function process_response() {\n\t\t\t$this->response['response']['Message'] = isset($this->response['response']['Message']) ? $this->response['response']['Message'] : '';\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'invalid') !== false) ? true : $this->response['response']['error'];\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'the item code was specified more than once') !== false) ? true : $this->response['response']['error'];\n\t\t\t$this->response['response']['Level1Code'] = $this->request['Level1Code'];\n\t\t\t\n\t\t\tif (!$this->response['response']['error']) { // IF Error is False\n\t\t\t\tif (in_array($this->response['server']['http_code'], array('200', '201', '202', '204'))) {\n\t\t\t\t\t$this->log_sendlogitem($this->request['Level1Code']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->log_error($this->response['response']['Message']);\n\t\t\t}\n\t\t}", "protected function processing()\n {\n $this->response = $this->response->withStatus(203);\n $this->jsonBody($this->payload->getOutput());\n }", "public function respond() {\n\t\thttp_response_code($this->code);\n\n\t\t// Additional headers\n\t\tforeach ($this->head as $header) {\n\t\t\theader($header);\n\t\t}\n\n\t\t// Write the body\n\t\tforeach ($this->body as $toStringable) {\n\t\t\techo $toStringable;\n\t\t}\n\t}", "public function getResponse() {\n }", "private function responseHandle() {\n // call hook function\n is_callable(config('hooks.onResponse')) && call_user_func(config('hooks.onResponse'), $this);\n // response data\n $this->responder->output();\n }", "function respond() {\n\n $request = & $this->request;\n $response = false;\n\n // first check for page refresh or first load\n if ($this->request->source == REQ_INDEX) {\n $state = $request->to_state(true);\n $response = $this->_do_index($state);\n\n } else {\n\n // next try for action event\n if ( ! $response) {\n $response = $this->_do_action($request);\n }\n\n // then fall back to state event\n if ( ! $response) {\n $state = $request->to_state();\n $response = $this->_do_state($state);\n }\n }\n\n // send response content to browser\n if ($response !== false) {\n if ($request->source == REQ_AJAX) {\n header('Content-type: application/json', true, 200);\n // no caching for ajax responses\n header(\"Cache-Control: no-cache, must-revalidate\");\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n $response = json_encode($response);\n } else {\n header('Content-type: text/html; charset=utf-8');\n }\n echo $response;\n return true;\n } else {\n return false;\n }\n }", "public function requests()\n\t{\n\t\t$this->checkRequest();\n\t\t$this->getResponse();\n\t}", "public function respond()\n\t{\n\t\t$this->setTemplate();\n\t\t$this->template->setGuid( $this->request['guid'] );\n\t\t$this->template->setContent( $this->view->getContent() );\n\t\n\t\techo $this->template->request();\t\n\t}", "function myServiceMethod ($request, $response)\n\t\t{\n $response->data['message'] = 'I received from you: ' . $request->data['message'];\n $response->data['success'] = 'true';\n\t\t}", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "function getResponse();", "function getResponse();", "private function resetReponse()\n {\n $this->app->singleton(\"response\", function () {\n return new Response();\n });\n }", "function deliver_response($api_response){\r\n \r\n // Set HTTP Response\r\n header('HTTP/1.1 200 OK');\r\n\r\n // Set HTTP Response Content Type\r\n header('Content-Type: application/json; charset=utf-8');\r\n \r\n // Format data into a JSON response\r\n $json_response = json_encode($api_response);\r\n\r\n // Deliver formatted data\r\n echo $json_response;\r\n \r\n // End script process\r\n exit;\r\n \r\n}", "public function success(BaseResponse $response);", "public function response(){\r\n\t\t// register event on_shutdown\r\n\t\tregister_shutdown_function(function(){\r\n\t\t\t// on_shutdown\r\n\t\t\t\\M::get('event')->trigger('system.on_shutdown');\r\n\r\n\t\t\t// debug\r\n\t\t\t\\M::get('debug')->exception_fatal();\r\n\t\t});\r\n\r\n\t\tob_start();\r\n\t\t\t// load default config & controller core\r\n\t\t\trequire_once APP_PATH . 'config.php';\r\n\t\t\trequire_once SYSTEM_PATH . 'controller.php';\r\n\r\n\t\t\t// on load\r\n\t\t\t\\M::get('event')->trigger('system.on_load', DOMAIN);\r\n\r\n\t\t\t// parser url\r\n\t\t\t$this->parser_url();\r\n\t\t\t// load module\r\n\t\t\t$this->load_module(input('module', 'str', 'get'));\r\n\t\t\t// load extend module\r\n\t\t\t$this->load_extend(input('extend_module', 'str', 'get'));\r\n\t\t\t// load group controller & controller\r\n\t\t\tlist($lib, $instance) = $this->load_controller(input('group_controller', 'str', 'get'), input('controller', 'str', 'get'));\r\n\t\t\t// load action\r\n\t\t\t$this->load_action($lib, $instance);\r\n\t\t$html = ob_get_clean();\r\n\r\n\t\t// on response\r\n\t\tob_start();\r\n\t\t\\M::get('event')->change('system.on_response', $html);\r\n\r\n\t\t// display html & end all script\r\n\t\tdie($html);\r\n\t}", "public function process()\n {\n \t$client = $this->client->getClient();\n\n \ttry {\n $response = $client->get($this->buildUrl());\n return new ResponseJson((string)$response->getBody(), true);\n } catch (RequestException $e) {\n return new ResponseJson((string)$e->getResponse()->getBody(), false);\n }\n }", "public function post()\n\t{\n\t\t\n\t\t$this->plugin->setResponse( $result );\n\t}", "function response($status,$status_message,$data){\n header(\"HTTP/1.1 \".$status);\n $response['status']=$status;\n $response['status_message']=$status_message;\n $response['data']=$data;\n $json_response = json_encode($response);\n echo $json_response;\n}", "function get_response() {\n return $this->response;\n }", "function response($code){\n $this->response_code = $code;\n }", "public function respond();", "public function respond();", "public function sendResponse()\n {\n $this->_response = Mage::app()->getResponse();\n\n //check redirect\n if ($this->_response->isRedirect()) {\n $headers = $this->_response->getHeaders();\n $redirect = '';\n foreach ($headers as $header) {\n if (\"Location\" == $header[\"name\"]) {\n $redirect = $header[\"value\"];\n break;\n }\n }\n if ($redirect) {\n $this->setRedirect($redirect);\n }\n }\n\n $this->_response->clearHeaders();\n $this->_response->setHeader('Content-Type', 'application/json');\n $this->_response->clearBody();\n $this->_response->setBody($this->toJson());\n $this->_response->sendResponse();\n exit;\n }", "protected function afterResponse()\n {\n }", "public function processRequest();", "public function onResponse($rep) \n {\n if($rep->get('correlation_id') == $this->correlation_id) {\n $this->response = $rep->body;\n }\n }", "abstract public function handle_request();", "public function execute()\n {\n $this->log->info(\"Received server to server notification.\");\n\n $oResponse = $this->resultFactory->create(\\Magento\\Framework\\Controller\\ResultFactory::TYPE_RAW);\n $response = $this->getRequest()->getParams();\n\n $result = null;\n if (array_key_exists('opensslResult', $response)) {\n try {\n $result = $this->helper->decryptResponse($response['opensslResult']);\n\n if ($result != null) {\n $result = json_decode($result);\n\n $this->log->debug(var_export($result, true));\n } else {\n $this->log->error(\"Decoded response is NULL\");\n }\n } catch (\\Exception $ex) {\n $this->log->error($ex->getMessage(), $ex);\n }\n }\n\n if ($result && isset($result->status) &&\n ($result->status == 'complete-ok' || $result->status == 'in-progress')) {\n try {\n $this->helper->processGatewayResponse($result);\n $oResponse->setContents('OK');\n } catch (PaymentException $e) {\n $this->log->error($e->getMessage(), $e);\n $oResponse->setContents('ERROR');\n }\n } else {\n $oResponse->setContents('ERROR');\n }\n\n return $oResponse;\n }", "public function respond()\n {\n }", "function send_response( $response, $ttl ) {\n\theader( 'Expires: ' . gmdate( 'r', time() + $ttl ) );\n\theader( 'Access-Control-Allow-Origin: *' );\n\theader( 'Content-Type: application/json; charset=UTF-8' );\n\n\techo wp_json_encode( $response );\n}", "public function dispatch()\n {\n $this->response = $this->frontController->execute();\n }", "public function run()\n\t{\n\t\t// Proxy requests, write headers, and then render response\n\t\treturn $this\n\t\t\t->request()\n\t\t\t->response()\n\t\t;\n\t}", "function rest_do_request($request)\n {\n }", "public function get_response()\n {\n return $this->response; \n }", "public function send()\n {\n http_response_code( $this->getResultCode() );\n echo $this->getBody();\n }", "public function doRequests();", "public function setResponse() {\n }", "function Reponse($ReturnValue){\n\t\t\t\theader('Content-Type: application/json;charset=UTF-8');\n\t\t\t\theader(\"Content-length: \" . strlen($ReturnValue));\n\t\t\t\t// Return the output\n\t\t\t\techo json_encode($ReturnValue);\n\t\t\t\t\n\t\t\t\t}", "public function execute()\n\t{\n\t\ttry\n\t\t{\n\t\t\t// Try and return the normal request\n\t\t\treturn parent::execute();\n\t\t}\n\t\tcatch(Vertebro_Exception $e)\n\t\t{\n\t\t\t// Assign the error code\n\t\t\t$this->response->status($e->code());\n\n\t\t\t// Assign the body\n\t\t\t$this->body = array('error' => $e->errors());\n\t\t}\n\t\tcatch(Kohana_Exception $e) {\n\n\t\t\tif (Kohana::$environment != Kohana::DEVELOPMENT)\n\t\t\t{\n\t\t\t\t$this->response->status(400);\n\n\t\t\t\t// Set a default error\n\t\t\t\t$this->body = array('error' => 'Something went wrong');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->body = array('error' => $e->getMessage());\n\t\t\t}\n\t\t}\n\n\t\t// Run the after\n\t\t$this->after();\n\n\t\t// Return the response we have now\n\t\treturn $this->response;\n\t}", "abstract public function request();", "private function respond()\n {\n $this->response->header('Content-Type', 'application/json');\n return $this->response;\n }", "public function afterAction()\r\n\t\t{\r\n\t\t\t//\r\n\t\t\tif (empty( $this->response )) {\r\n\t\t\t\t//\r\n\t\t\t\t$isNeedRender = !empty( $this->view ) && !$this->view->isRendered();\r\n\t\t\t\t//\r\n\t\t\t\t$this->response = new HttpResponse();\r\n\t\t\t\t//\r\n\t\t\t\tif ( $isNeedRender ) {\r\n\t\t\t\t\t//\r\n\t\t\t\t\t$this->response->setData( $this->view->render() );\r\n\t\t\t\t} else {\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//\r\n\t\t\tif (!$this->response->isSent()) {\r\n\t\t\t\t//\r\n\t\t\t\t$this->response->send();\r\n\t\t\t}\r\n\t\t}", "function send($response)\n {\n }", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "public function send()\n {\n // This function is large and handles validation, preparing headers, formatting headers,\n // sending headers, and sending content. It could be separated into smaller private functions\n // however doing so increases the amount of memory and decreases performance (this was tested\n // during development). The increase in memory is relatively small at 2% or less however\n // FastSitePHP is designed for performance (while being a scripting language) so large functions\n // are acceptable (plus every single line of code in this function is unit tested so\n // even though it is large it functions as expected).\n\n // Basic validation of the Response that either [content()] or [file()]\n // was called for most response types but that not both are called.\n if ($this->response_content !== null && $this->response_file !== null) {\n throw new \\Exception(sprintf('The [%s] Object for the current Route had content set through both [content()] and [file()] functions. When returning the response object from a route or when sending the response only one of these functions can be called.', __CLASS__));\n } else {\n if ($this->status_code !== 304\n && $this->status_code !== 204\n && $this->status_code !== 205\n && $this->response_content === null\n && $this->response_file === null\n ) {\n throw new \\Exception(sprintf('The [%s] Object for the current Route had no content set from either [content()], [file()], or [redirect()] functions. Before returning the response object from a route or before sending the response content must be set unless the status code is [204 - No Content], [205 - Reset Content], or [304 - Not Modified].', __CLASS__));\n }\n }\n\n // Check if JSON or JSONP Response and if so then update the Response Content\n if ($this->response_file === null && gettype($this->response_content) !== 'string') {\n // Get the Response Content-Type\n $content_type = $this->header('Content-Type');\n\n // If the response type is specified as JSON then convert\n // the response content to a JSON string.\n if ($content_type === 'application/json') {\n $this->response_content = json_encode($this->response_content, $this->json_options);\n // If JSONP (JSON with Padding) then export as a JavaScript\n // function with a JSON Object or Array as the parameter.\n } elseif ($this->jsonp_query_string !== null && strpos($content_type, 'application/javascript') === 0) {\n // [jsonp_query_string] can be either a string or array\n // so if string then cast it as an array\n $qs_params = (array)$this->jsonp_query_string;\n $qs_param = null;\n $js_function = null;\n\n // Find the JavaScript Function Name from the Query String\n foreach ($qs_params as $item) {\n if (isset($_GET[$item])) {\n $js_function = $_GET[$item];\n $qs_param = $item;\n break;\n }\n }\n\n // Validate that a valid JavaScript function was specified. This does not validate\n // against any allowed JavaScript function name but rather is checking for a function\n // name that contains only letters, numbers, or an underscore; and that it is at least\n // two characters in length and does not start with a number.\n if ($js_function === null) {\n throw new \\Exception('[jsonp] was specified as the content-type however a JavaScript function was not found in one of the query string parameters: ' . implode(', ', $qs_params));\n } elseif ($js_function === '') {\n throw new \\Exception(sprintf('The [jsonp] callback query string parameter [%s] was defined however it did not contain a function name and was instead an empty string.', $qs_param));\n } elseif (preg_match('/^[A-Za-z_][A-Za-z0-9_]+$/', $js_function) !== 1) {\n throw new \\Exception(sprintf('The [jsonp] callback function was not using a format supported. The function name must contain only letters, numbers, or the underscore character; it must be at least two characters in length and cannot start with a number. Query String Parameter [%s] and Value [%s]', $qs_param, $js_function));\n }\n\n // There are two Unicode Control Characters supported in JSON Strings but not in JavaScript:\n // LINE SEPARATOR (U+2028)\n // PARAGRAPH SEPARATOR (U+2029)\n // In some Frameworks and Languages these have to be manually handled (for example\n // in Ruby on Rails and Express with Node.js), however in PHP the function json_encode()\n // escapes all Unicode Characters by default so the two characters do not have to be\n // handled here. A Unit Test [test-web-response.php/jsonp-escape-characters] was created\n // to confirm this.\n\n // Create the JavaScript/JSONP Response, the resulting text from the\n // string concatenation would be in the following format: '/**/callback({\"prop\":\"value\"});'.\n // The '/**/' prefix is to prevent an attack type named the \"Rosetta Flash\".\n // For a details on how the attack works refer to the blog post:\n // https://miki.it/blog/2014/7/8/abusing-jsonp-with-rosetta-flash/\n $this->response_content = '/**/' . $js_function . '(' . json_encode($this->response_content) . ');';\n } else {\n // Unknown result, raise an exception\n throw new \\Exception(sprintf('Unexpected Response Content Variable Type set when [%s->content()] was called. If contentType() is [json] or [jsonp] then content() can be set with a string or any type that can be encoded to a JSON string such as an object or an array, however for all other response types that do not use a file response the content() must be a [string] type. At the time of the response the contentType() was set to [%s] and the type of content set was a [%s] type.', __CLASS__, $content_type, gettype($this->response_content)));\n }\n }\n\n // Get the Request method, example 'GET' or 'POST'\n $method = (isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : '');\n\n // Send Response Headers unless they have already been sent. For most PHP installations\n // they would only be sent if a route had manually called header() and has output buffering\n // turned on or manually called ob_flush(). This condition is unlikely to be meet by\n // most websites however it's possible and several unit tests show how it can happen.\n if (!headers_sent()) {\n // First check if the page is allowing the browser or client to cache the response.\n // In HTTP 1.1 Specs the Response Header Fields 'ETag' and 'Last-Modified' allow for the\n // browser or client to save cached copies of a resource or webpage and send request headers\n // 'If-None-Match' and 'If-Modified-Since' to determine if the content needs to be resent.\n if (count($this->header_fields) > 0) {\n // Get the values that will be used for the response header fields\n $etag = $this->header('ETag');\n $last_modified = $this->header('Last-Modified');\n $cache_control = $this->header('Cache-Control');\n $expires = $this->header('Expires');\n $can_send_304 = false;\n\n // If either value is set then check if a 304 status code is allowed for the response\n if ($etag !== null || $last_modified !== null) {\n // Is the request method either 'GET' or 'HEAD'\n $method_matches = ($method === 'GET' || $method === 'HEAD');\n // Make sure the status code to be returned is 200 or more but less than 300\n $status_code_is_200_range = ($this->status_code === null || ($this->status_code >= 200 && $this->status_code < 300));\n // Check Response headers indicating if the user is not allowed to cache the response.\n // If any of these headers are set then do not send a 304. See noCache() for setting these.\n // Each of the lines below have been unit tested individually by first setting\n // [$user_can_cache] to true. This specific logic is not required by HTTP 1.1 Specs\n // but rather based on logic that if the server is instructing the client to not\n // store cached copied then it will never send a 304 response.\n $user_can_cache = ($cache_control === null || strpos($cache_control, 'no-store') === false);\n $user_can_cache = ($user_can_cache && ($expires === null || (string)$expires !== '0'));\n $user_can_cache = ($user_can_cache && ((($pragma = $this->header('Pragma')) === null || $pragma !== 'no-cache')));\n // A 304 response can only be sent if all of the above statements return true\n $can_send_304 = ($method_matches && $status_code_is_200_range && $user_can_cache);\n }\n\n // If defined handle the 'ETag' Response Header and 'If-None-Match' Request Header\n // http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26\n if ($etag !== null) {\n // If the ETag is defined as a closure function then call the function\n // with the response content as a parameter to generate the etag.\n if ($etag instanceof \\Closure) {\n // Make sure this is not a file response\n if ($this->response_file !== null) {\n throw new \\Exception('Etag must not be defined as a closure function for file responses when calling the function file(). To specify an etag for file responses use the $cache_type parameter of the file() function.');\n }\n\n // Validate that the closure function returns a string\n $etag_value = call_user_func($etag, $this->response_content);\n if (!is_string($etag_value)) {\n throw new \\Exception(sprintf('The ETag function defined by the app should return a string but instead returned a [%s]', gettype($etag_value)));\n }\n\n // Reset the ETag value using the etag() function\n // so that it will correctly format the value.\n $this->etag($etag_value, $this->etag_type);\n $etag = $this->etag();\n }\n\n // Get the request header value from the $_SERVER superglobal\n $if_none_match = (isset($_SERVER['HTTP_IF_NONE_MATCH']) ? $_SERVER['HTTP_IF_NONE_MATCH'] : null);\n\n // Compare request header value with the response value, if they match\n // then set the status code to 304 'Not Modified'\n if ($if_none_match !== null && $can_send_304) {\n // ETag specs allow for a request to send up one or more\n // ETags using the format '\"etag\"' or '\"etag1\", \"etag2\"' so\n // split the request value to an array and check each item.\n // In reality all web browsers cache only one copy and send\n // one ETag so this might only happen if using a special cache\n // server or software to cache multiple copies of a page.\n //\n // A special 'If-None-Match' value of '*' exists to match any\n // resource however based on HTTP Protocol it is intended\n // only on being used for PUT requests. Many popular frameworks\n // incorrectly send a 304 for '*' GET Requests however to\n // correctly handle it the site would need to have custom logic\n // in place check if the resource exists or not and then return\n // either a 304 Response or 412 'Precondition Failed' Response.\n //\n // Convert the string to an array and trim whitespace from each\n // item then compare the item to the request header.\n $items = array_map('trim', explode(',', $if_none_match));\n foreach ($items as $item) {\n if ($item === $etag) {\n $this->status_code = 304;\n break;\n }\n }\n }\n }\n\n // If defined handle the 'Last-Modified' Response Header and 'If-Modified-Since' Request Header\n // http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.29\n // http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.25\n if ($last_modified !== null) {\n // Last-Modified will be sent as a 'HTTP-date' format which looks like:\n // [Last-Modified: Tue, 25 Aug 2015 00:10:58 GMT]. When the value is set\n // from the function lastModified() it ends up a Unix Timestamp (int)\n // which is then converted into the proper format, however ff the value is\n // a string then it was set from the header() function of this class.\n if (!is_int($last_modified)) {\n // Parse the string date value into a Unix Timestamp\n $last_modified_value = strtotime($last_modified);\n\n // If the value returned is false then it was not a valid date string.\n // Throw an exception with a helpful message for the developer.\n if ($last_modified_value === false) {\n throw new \\Exception(sprintf('Invalid value for the header [Last-Modified] which was likely set by calling the header() function. If using a string value then the parameter must be a valid value for the php function strtotime(), the value specified was: [%s]', $last_modified));\n }\n\n // Set the time value to the Unix Timestamp value, note the value\n // is not set above so that the original value can be used in an\n // error message if needed.\n $last_modified = $last_modified_value;\n }\n\n // If status code of 304 was not set from the etag then check the date last modified\n // in comparison to the request header 'If-Modified-Since'. This only gets checked if\n // and etag was not defined.\n if ($this->status_code !== 304 && $etag === null && $can_send_304) {\n // Get the request header value from the $_SERVER superglobal\n $if_modified_since = (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] : null);\n\n // Compare request header time value with the response value, if they match\n // set the status code to 304 'Not Modified'. If an invalid request header\n // is sent then this will not cause an exception but rather evaluate to\n // false. This is confirmed with a unit test.\n if ($if_modified_since !== null && $last_modified === strtotime($if_modified_since)) {\n $this->status_code = 304;\n }\n }\n\n // Update the 'Last-Modified' header so the date format will look like 'Wed, 10 Jun 2015 23:48:48 GMT'\n $this->header('Last-Modified', gmdate('D, d M Y H:i:s T', $last_modified));\n }\n\n // Handle the 'Expires' Header so that if specified as a time value it gets\n // converted to the correct date/time format.\n if ($expires !== null && is_int($expires)) {\n $this->header('Expires', gmdate('D, d M Y H:i:s T', $expires));\n }\n }\n\n // First send the response status code if one is set, by default the web\n // server will return 200 so in most cases this doesn't need to be set.\n // The functions statusCode() and exceptionHandler() set the value for this.\n if ($this->status_code !== null) {\n // The function http_response_code() is available in PHP 5.4 and later.\n // A polyfill is provided for PHP 5.3.\n if (function_exists('http_response_code')) {\n http_response_code($this->status_code);\n } else {\n // If your site requires PHP 5.3 and uses additional status codes\n // then you can get them from the PHP Source Code:\n // https://github.com/php/php-src/blob/master/main/http_status_codes.h\n $status_code_text = array(\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 307 => 'Temporary Redirect',\n 308 => 'Permanent Redirect',\n 404 => 'Not Found',\n 429 => 'Too Many Requests',\n 500 => 'Internal Server Error',\n );\n\n // Add status to the header response, for example 'HTTP/1.1 200 OK'\n if (isset($status_code_text[$this->status_code])) {\n // Even though this framework specifies HTTP/1.1 headers it's possible\n // that the server version could be HTTP/1.0 or HTTP/2.0 so the SERVER_PROTOCOL\n // is used to get the supported version from the actual web server. At\n // the time of development (late 2015) it not common for servers to support\n // only HTTP/1.0, however if they do specifying another version can cause\n // problems. For examples of this refer to PHP documentation at:\n // http://php.net/manual/en/function.header.php\n header(sprintf('%s %d %s', $_SERVER['SERVER_PROTOCOL'], $this->status_code, $status_code_text[$this->status_code]));\n }\n }\n }\n\n // Send additional headers after the status code\n foreach ($this->header_fields as $name => $value) {\n header(\"$name: $value\");\n }\n\n // Cookies are sent along with the response headers and like other response\n // headers can only be sent if content is not already sent to the client.\n foreach ($this->response_cookies as $cookie) {\n // setcookie() will return false when php error handling is turned off,\n // otherwise invalid calls to setcookie() will trigger E_WARNING errors.\n if (is_array($cookie['expire'])) {\n if (PHP_VERSION_ID >= 70300) {\n // PHP 7.3 +\n $success = setcookie($cookie['name'], $cookie['value'], $cookie['expire']);\n } else {\n // Compatability with new PHP 7.3 API - 'expire/expires' is not an error\n $options = $cookie['expire'];\n $success = setcookie($cookie['name'], $cookie['value'], $options['expires'], $options['path'], $options['domain'], $options['secure'], $options['httponly']);\n }\n } else {\n $success = setcookie($cookie['name'], $cookie['value'], $cookie['expire'], $cookie['path'], $cookie['domain'], $cookie['secure'], $cookie['httponly']);\n }\n if (!$success) {\n throw new \\Exception(sprintf('Error: setcookie() returned false for cookie named [%s]', (is_string($cookie['name']) ? $cookie['name'] : 'Name was not a string, gettype=' . gettype($cookie['name']))));\n }\n }\n }\n\n // After headers are sent output the response unless the\n // request method was HEAD or one of the the following Status Codes:\n // [204 'No Content'], [205 'Reset Content'], or [304 'Not Modified'].\n // HTTP Specs for a HEAD Request:\n // http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.4\n // The HEAD method is identical to GET except that the server MUST NOT\n // return a message-body in the response. The meta information contained\n // in the HTTP headers in response to a HEAD request SHOULD be identical\n // to the information sent in response to a GET request.\n // Based on the specs the response headers should be the same however in reality\n // they usually are not because the actual web servers (e.g.: Apache or IIS)\n // will add additional headers based on the content. Specifically FastSitePHP\n // does not modify or include the 'Content-Length' header for most responses\n // because it is handled by the web server. It is easy to calculate what the\n // uncompressed content length would be however HTML content is often gzipped\n // by the web server so the actual content length of the response is not known\n // with PHP Code if compression is handled by the server. However FastSitePHP\n // does send the 'Content-Length' for file responses, see more below.\n //\n // Additionally if this check is not in place and content is sent to output\n // then tested versions of both IIS and Apache prevent the content from being\n // submitted for both HEAD requests and 304 Responses. Status Codes between\n // 100 and 199 indicate informational messages also do not included content but\n // they are not checked here because FastSitePHP doesn't handle them. They are\n // handled at a lower-level by the web server software. The unit test\n // [test-web-request.php/post-data-12] with a Windows C# Program or\n // Mac/Linux Shell Script can be used to confirm that the Web Server being\n // tested properly handles status code 100. See comments on that unit test\n // for more info related to status code 100.\n if ($method !== 'HEAD'\n && ($this->status_code === null\n || ($this->status_code !== 304 && $this->status_code !== 204 && $this->status_code !== 205))\n ) {\n if ($this->response_file === null) {\n echo $this->response_content;\n } else {\n // Send [Content-Length] Response Header based on the file size.\n // If the file type ends up with a content type such as 'text/html'\n // then the web server will likely buffer all output and overwrite this,\n // however if the file type is a file download, video streaming, etc\n // then the header value will come from here and the web server will\n // stream the file.\n header('Content-Length: ' . filesize($this->response_file));\n\n // Make sure any previous output has been cleared. Without calling\n // [ob_end_clean()] at least once [readfile()] would attempt to load\n // the entire file in memory rather than streaming it.\n while (ob_get_level()) {\n ob_end_clean();\n }\n\n // This streams with a buffer size of 8192 based on PHP-SRC\n readfile($this->response_file);\n }\n }\n }" ]
[ "0.749841", "0.733907", "0.7126193", "0.7105176", "0.7000018", "0.69180834", "0.6904549", "0.6856594", "0.68184316", "0.6714908", "0.6714908", "0.6714908", "0.6714908", "0.6714908", "0.6668592", "0.6616681", "0.6593002", "0.65478325", "0.65169346", "0.650107", "0.6476509", "0.6476509", "0.6476509", "0.6476509", "0.6447124", "0.6408778", "0.6400359", "0.63938016", "0.6380698", "0.6376156", "0.63741213", "0.63567024", "0.6340762", "0.6332209", "0.6332209", "0.63112235", "0.63041806", "0.62894785", "0.6276663", "0.6258651", "0.62551296", "0.6238586", "0.6232259", "0.6216249", "0.6211504", "0.6207534", "0.61939585", "0.6181496", "0.6181035", "0.61688066", "0.61585355", "0.6155014", "0.61233276", "0.6120577", "0.6120577", "0.6120577", "0.6120577", "0.6120577", "0.6120577", "0.6120577", "0.6120577", "0.6120577", "0.6120577", "0.6120577", "0.6109831", "0.6109831", "0.6109056", "0.60992694", "0.6097873", "0.6086155", "0.6069854", "0.60677797", "0.6057656", "0.60438526", "0.6028839", "0.6009992", "0.6009992", "0.6003116", "0.5986896", "0.5978683", "0.5977415", "0.5971448", "0.5969452", "0.5965639", "0.59626615", "0.59486604", "0.59481144", "0.59459585", "0.5929534", "0.59255105", "0.5916471", "0.59156924", "0.5901772", "0.5891518", "0.58876204", "0.58839774", "0.58809197", "0.58798516", "0.58792853", "0.5878369" ]
0.6365243
31
Return new Permission instance
public function __construct($role, callable $callback = null);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function permissionInstance()\n\t{\n\t\treturn new PermissionMaker();\n\t}", "public function create()\n {\n return $this->permissionService->create();\n }", "public function createPermission(array $data = []): Permission\n {\n return new Permission($data);\n }", "public static function getDefault(){\n $permission = new Permission();\n $permission->enableRead = true; // default\n $permission->enableEdit = true; // default\n $permission->enableDelete = true; // default\n return $permission;\n }", "public function create(array $data): Permission\n {\n return Permission::create($data);\n }", "public function create()\n\t{\n\t\t//Permissions are created via code\n\t}", "public static function createPermission($permission) {\n $params = self::getPermissionParts($permission);\n return static::updateOrCreate($params);\n }", "function model()\n {\n return Permission::class;\n }", "protected function _getPermissionModel()\n\t{\n\t\treturn $this->getModelFromCache('XenForo_Model_Permission');\n\t}", "public function addPermission() {\n try {\n if (!($this->permission instanceof Base_Model_ObtorLib_App_Core_Doc_Entity_Permission)) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception(\" Permission Entity not intialized\");\n } else {\n $objPermission = new Base_Model_ObtorLib_App_Core_Doc_Dao_Permission();\n $objPermission->permission = $this->permission;\n return $objPermission->addPermission();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception($ex);\n }\n }", "function permissionFactory()\n {\n return [\n 'factory'=>(new JbPermission)\n ];\n }", "function permission_first_or_create($permission)\n {\n try {\n return Permission::create(['name' => $permission]);\n } catch (PermissionAlreadyExists $e) {\n return Permission::findByName($permission);\n }\n }", "public function permission()\n {\n return $this->hasOne('App\\Models\\Permission', 'id', 'permission_fk');\n }", "public function form()\n {\n return Factory::create('permission');\n }", "public static function awooThePerms(): Permission\n {\n $acl = new Permission;\n\n $acl->addRole(\"guest\");\n $acl->addRole(\"member\", \"guest\");\n $acl->addRole(\"council\", \"member\");\n\n $acl->addResource(\"news\");\n $acl->addResource(\"comments\");\n $acl->addResource(\"admin\");\n\n $acl->allow(\"guest\", ['news', 'comments'], \"view\");\n $acl->allow(\"member\", ['comments'], [\"create\", \"deleteSelf\"]);\n $acl->allow(\"council\", Permission::ALL, ['create', 'view', 'edit', 'delete', 'deleteSelf']);\n\n return $acl;\n }", "public function create()\n {\n $transaction = \\Yii::$app->db->beginTransaction();\n $this->role = \\Yii::$app->authManager->createRole($this->roleName);\n $this->role->description = $this->description;\n \\Yii::$app->authManager->add($this->role);\n\n foreach ($this->permissions as $permission) {\n \\Yii::$app->authManager->addChild($this->role, $permission);\n\n }\n\n $transaction->commit();\n\n return $this;\n }", "public function create()\n {\n return view(\"role_permission.permission\");\n }", "public static function with_permission($permission) {\n return self::where([\"can_$permission\" => '1']);\n }", "public function model()\n {\n return Permission::class;\n }", "public function model()\n {\n return Permission::class;\n }", "public function model()\n {\n return Permission::class;\n }", "public function model()\n {\n return Permission::class;\n }", "public function permission($permission);", "public function create()\n {\n if (Auth::user()->ability('superadministrator', 'create-permissions')){\n return view('permission.create',[\n 'pageheader'=>'权限',\n 'pagedescription'=>'添加',\n ]);\n }\n return abort(403,config('yyxt.permission_deny'));\n }", "public function create()\n {\n return view('permissions.create_permission');\n }", "public function actionCreate()\n {\n $model = new Permission();\n\n if ($model->load(Yii::$app->request->post())) {\n $this->_saveRecord($model, 'permission_id');\n }\n\n return $this->render(ACTION_CREATE, [MODEL => $model, 'titleView' => 'Create']);\n }", "public function create(PermissionRequest $request, Permission $permission)\n {\n $permission = $permission->presenter();\n $permission['code'] = 2002;\n return response()->json($permission)\n ->setStatusCode(200, 'CREATE_SUCCESS');\n\n }", "public function store(Request $request)\n {\n\n $data = $request->all();\n return Permission::create($data);\n }", "public function create()\n {\n $this->authorize('create', Permission::class);\n\n return view('laralum_permissions::create');\n }", "function acl_permission()\n {\n return app(PermissionRepositoryContract::class);\n }", "public function create() {\r\n $this->db->insert(\"assets_permissions\", array());\r\n\r\n $this->model->setId($this->db->lastInsertId());\r\n\r\n return $this->save();\r\n }", "public function run()\n {\n Permission::factory(SC::PERMISSIONS_COUNT)->create();\n }", "public static function getPermissionModel()\n {\n return static::getModel('Permissions');\n }", "public function create()\n {\n try {\n $permissions = Permission::latest()->get();\n for ($i=0; $i < count($permissions); $i++) { \n $permissions[$i]->access = false;\n }\n } catch (JWTException $e) {\n throw new HttpException(500);\n }\n return response()->json([\n 'permissions' =>$permissions\n ]);\n }", "public function create(array $input)\n {\n Validator::make($input, [\n 'name' => ['required', 'string', 'max:64'],\n 'group' => ['nullable', 'string', 'max:64'],\n 'slug' => ['required', 'unique:permissions', 'string', 'max:64'],\n ])->validateWithBag('createPermission');\n\n return Permission::create([\n 'name' => $input['name'],\n 'group' => $input['group'],\n 'slug' => Str::snake($input['slug']),\n ]);\n }", "public function create($permissionName, $readableName = null);", "public function firstOrCreate(array $data): Permission\n {\n return $this->firstOrCreate($data);\n }", "public function permission()\n {\n return $this->belongsTo('\\\\Neoflow\\\\CMS\\\\Model\\\\PermissionModel', 'permission_id');\n }", "public function updatePermission() {\n try {\n if (!($this->permission instanceof Base_Model_ObtorLib_App_Core_Doc_Entity_Permission)) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception(\" Permission Entity not intialized\");\n } else {\n $objPermission = new Base_Model_ObtorLib_App_Core_Doc_Dao_Permission();\n $objPermission->permission = $this->permission;\n return $objPermission->updatePermission();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception($ex);\n }\n }", "public function create()\n {\n abort_if(Gate::denies('permission_create'), Response::HTTP_FORBIDDEN, 'Forbidden');\n\n return view('admin.permissions.create');\n }", "public function __construct(Permission $permission)\n {\n $this->model = $permission;\n }", "public function created(Permission $permission)\n {\n //\n }", "public function getPermission($permission) {}", "public function getPermission($permission) {}", "public function build(): GrantPermissionsRequest\n\t{\n\t\t$instance = new GrantPermissionsRequest();\n\t\tif ($this->permissions === null) {\n\t\t\tthrow new BuilderException('Property [permissions] is required.');\n\t\t}\n\t\t$instance->permissions = $this->permissions;\n\t\t$instance->origin = $this->origin;\n\t\t$instance->browserContextId = $this->browserContextId;\n\t\treturn $instance;\n\t}", "public function create()\n {\n /* Permission CREATE form */\n if (Auth::user()->hasRole('superadmin')) {\n return view('superadmin.permission.create');\n }\n abort(403);\n \n }", "public function getPermission($permission);", "public function store(PermissionRequest $request)\n {\n return $this->permissionService->store($request);\n }", "public function create()\n {\n return view('back_end.createPermission');\n }", "public function find(int $id): Permission\n {\n return Permission::find($id);\n }", "public function givePermission($permission);", "public function givePermission($permission);", "public function create()\n {\n $menu_control = view()->shared('menu_control');\n $menu_control['page'] = 'all_permissions';\n $menu_control['category'] = 'users';\n\n $permission = '';\n\n return view('users::permissions.create', compact('menu_control', 'permission'));\n }", "protected function getCurrentPermission() {}", "public function create()\n {\n $title = 'Add Permission';\n return view('admin.permission.create', compact('title') );\n }", "public function setPermission($permission)\n {\n $this->permission = $permission;\n\n return $this;\n }", "public function store(Request $request)\n {\n $reqExecTimeId = 49;\n if ($this->privileges[\"role\"] != 3 && $this->privileges[\"role\"] != 2) {\n return response()->json([\n 'message' => 'Forbidden'\n ], 403);\n }\n $new_data = json_decode($request->getContent(), true);\n if ($new_data == null) {\n $new_data = $request->all();\n }\n $data = json_decode($new_data['data'],true);\n $Permission = new Permission;\n $Permission->setSelf($new_data);\n if ($Permission->isValide()) {\n $Permission->save();\n $res = new PermissionTemplate($Permission);\n } else {\n $res = response()->json([\n 'error' => \"Invalid_or_missing_fields\"\n ], 500);\n }\n $this->workEnd($reqExecTimeId);\n return $res;\n }", "public function create()\n {\n return view('backend.permission.create');\n }", "public function create()\n {\n return view('backend.permission.create');\n }", "public function create() {\n// $role = Sentinel::findRoleById(1);\n// $roles = Rol::get();\n// foreach($roles as $role){\n// $role->removePermission(0);\n// $role->removePermission(1);\n// $role->save();\n// }\n// dd(Sentinel::getUser()->hasAccess('sds'));\n// dd(\\Modules\\Permissions\\Entities\\ModulePermission::where('module_id', 10)->where('permission', 'like', '%.view')->orderBy('menu_id')->lists('permission')->toArray());\n }", "function permission_build($module) {\n $instanceArgs = array(\n 'module' => $module,\n );\n $factoryArgs = array(\n 'module' => $module,\n 'instance_args' => $instanceArgs\n );\n $builder = hook_get_builder('permission', $factoryArgs);\n\n return $builder->build();\n}", "public function permission()\n {\n try {\n $data = [\n 'action' => route('store.permission'),\n 'page_title' => 'Permission',\n 'title' => 'Add permission',\n 'permission_id' => 0,\n 'name' => (old('name')) ? old('name') : '',\n 'description' => (old('description')) ? old('description') : '',\n 'modules' => Module::get(),\n ];\n return $data;\n } catch(\\Exception $err){\n Log::error('message error in permission on RoleRepository :'. $err->getMessage());\n return back()->with('error', $err->getMessage());\n }\n }", "function rolePermissionFactory()\n {\n return [\n 'factory'=>(new JbRolePermission)\n ];\n }", "public function create(): View\n {\n return view('permissions.create');\n }", "public function create()\n {\n return view('admin.permissions.create');\n }", "public function create()\n {\n return view('admin.permissions.create');\n }", "public function create()\n {\n return view('permission.create');\n }", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function createPermission(array $attributes, $reload = true);", "public function create()\n {\n return view('permissions.create');\n }", "public function create()\n {\n abort_unless(Gate::allows('permission-create'), 403);\n\n return view('admin.permission.create');\n }", "public function create()\n {\n abort_unless(Gate::allows('permission-create'), 403);\n\n return view('admin.permission.create');\n }", "public function actionCreate()\n {\n $model = new PermissionForm();\n $post = Yii::$app->request->post();\n unset($this -> menuList[0]);\n if ($model->load($post) && $model->save()) {\n $model->menu_id = $post['PermissionForm']['menu_id'];\n $model->save();\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'menuList' => $this -> menuList,\n ]);\n }\n }", "public function create()\n {\n // if (! Gate::allows('users_manage')) {\n // return abort(401);\n // }\n return view('admin.permissions.create');\n }", "public function create()\n {\n \n \n return view('permissions.create');\n }", "public function access(): mixed\n {\n return new Access('access');\n }", "public function create()\n {\n $this->authorize('create', Role::class);\n $permissions = Permission::whereIsNotAdminOnly()->get();\n\n return response()->json(compact('permissions'));\n }", "public function __construct()\n\t{\n\t\tparent::__construct('fuel_permissions');\n\t}", "public function setPermission($permission)\n {\n if (is_array($permission)) {\n $this->permission = $permission;\n } else if ($permission) {\n $this->permission = [$permission];\n }\n\n return $this;\n }", "public function setPermission(Permission $permission = null)\n {\n $this->permission = $permission;\n\n return $this;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Koryukan_Db_Permission');\n }", "public static function findByName($name) {\n $permission = static::where('name', $name)->first();\n\n if (!$permission) {\n throw new PermissionDoesNotExist();\n }\n\n return $permission;\n }", "public function create() {\n\t\tif(!(Entrust::hasRole(['support', 'admin']) || Entrust::can('permission.create'))) return redirect()->route('home');\n Log::debug('create');\n\n\t\treturn view('pages.permission.create');\n\t}", "public function create()\n {\n return view('admin.pages.spatie.permission.create')\n ->with(['menu'=>'user_permission']);\n }", "public function create()\n {\n // \n return view('admin.permission.createP');\n }", "public function store(Request $request)\n { \n $this->cpAuthorize();\n\n if (Gate::denies('cp')) {\n return response()->json(['msg'=>'Access denied'],403);\n }\n\n if(!$request->data_id){\n //we don't know who to assign the permission to\n return response()->json(['id'=>-1]);\n }\n \n\n $perm=new Permission();\n if($request->isgroup){\n //check permission \n $permExists=Permission::where('source_type',$request->source_type)\n ->where('source_id',$request->source_id)\n ->where('user_group_id',$request->data_id)->first();\n if($permExists){\n return response()->json(['id'=>-1]);\n }\n $perm->user_group_id=$request->data_id;\n }\n else{\n //check permission \n $permExists=Permission::where('source_type',$request->source_type)\n ->where('source_id',$request->source_id)\n ->where('user_id',$request->data_id)->first();\n if($permExists){\n return response()->json(['id'=>-1]);\n }\n $perm->user_id=$request->data_id;\n }\n $perm->source_type=$request->source_type;\n $perm->source_id=$request->source_id;\n $perm->create=0;\n $perm->read=0;\n $perm->update=0;\n $perm->delete=0;\n\n $perm->save();\n\n return response()->json( ['id'=>$perm->id]);\n\n }", "public function create()\n {\n if (! Gate::allows('users_manage')) {\n return abort(401);\n }\n return view('admin.permissions.create');\n }", "public function setPermissionType($val)\n {\n $this->_propDict[\"permissionType\"] = $val;\n return $this;\n }", "public function __construct()\n {\n parent::__construct('BaseMtc_permissions');\n }", "function createPermission($permission) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"INSERT INTO \" . $db_table_prefix . \"permissions (\n\t\tname\n\t\t)\n\t\tVALUES (\n\t\t?\n\t\t)\");\n $stmt->bind_param(\"s\", $permission);\n $result = $stmt->execute();\n $stmt->close();\n return $result;\n}", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required|string|max:255',\n ]);\n\n //$permission->assignRole($role);\n\n $permission = Permission::create(['name' => $request->name]);\n \n foreach($request->role as $role){\n $permission->assignRole($role);\n }\n return $permission;\n }", "public function create()\n {\n return view('UserCenter.Permissions.create');\n }", "public function newAction(Request $request)\n {\n $this->get('Services')->setMenuItem('Permission');\n\n $permission = new Permission();\n $form = $this->createForm('Wbc\\AdministratorBundle\\Form\\PermissionType', $permission);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($permission);\n $em->flush();\n\n $this->get('Services')->addFlash('success', $this->get('translator')->trans('Permission created!'));\n\n return $this->redirectToRoute('permission_index');\n }\n\n return $this->render('permission/new.html.twig', array(\n 'permission' => $permission,\n 'form' => $form->createView(),\n ));\n }", "public static function makeNonPublic()\n {\n // Default ACL is private.\n return new ACL();\n }", "public function & GetPermissions ();", "public function model()\n {\n return 'Litepie\\\\User\\\\Models\\\\Permission';\n }", "public function create(){\r\n\treturn new $this->class();\r\n }" ]
[ "0.8236426", "0.7761542", "0.741348", "0.7021073", "0.70154107", "0.6718478", "0.670793", "0.6583185", "0.6543856", "0.6513792", "0.6508203", "0.65011555", "0.6486979", "0.64859325", "0.6351172", "0.6318352", "0.629535", "0.6292314", "0.61926836", "0.61926836", "0.61926836", "0.61926836", "0.6188555", "0.61788374", "0.6151318", "0.6136286", "0.61288583", "0.61250496", "0.61230123", "0.61129487", "0.61109865", "0.6093369", "0.60841763", "0.6080763", "0.60728675", "0.60516936", "0.6044288", "0.603824", "0.60201204", "0.60116386", "0.60047626", "0.5993424", "0.59477305", "0.59477305", "0.5945996", "0.59438246", "0.5934135", "0.5927168", "0.5919349", "0.59018433", "0.5896114", "0.5896114", "0.5895754", "0.58687186", "0.5864133", "0.58364445", "0.5833442", "0.5823844", "0.5823844", "0.582384", "0.5817206", "0.5808644", "0.5796599", "0.5794663", "0.57931876", "0.57931876", "0.5782819", "0.57649785", "0.57649785", "0.57649785", "0.57649785", "0.57649785", "0.5753622", "0.5747636", "0.574266", "0.574266", "0.57166034", "0.5709482", "0.5703011", "0.57028955", "0.5700262", "0.568394", "0.56832725", "0.5678931", "0.56739634", "0.5661109", "0.56467503", "0.56382763", "0.56279004", "0.56252015", "0.56220806", "0.56086123", "0.56076634", "0.5597184", "0.5588779", "0.558779", "0.55735284", "0.5572779", "0.55723745", "0.55704826", "0.5568986" ]
0.0
-1
Determine if user is allowed to perform an action
public function allowed(User $user, $entity = null);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function isAllowed() {\n $allowed = array(\n \"rss\" => array(\"feed\"),\n \"torrent\" => array(\"download\"),\n \"user\" => array(\"login\", \"register\", \"confirm\", \"recover\", \"invite\")\n );\n if (!isset($allowed[$this->data['url']['application']]))\n return false;\n if (in_array($this->data['url']['action'], $allowed[$this->data['url']['application']]))\n return true;\n else\n return false;\n }", "protected function isAllowed() {\n\t\treturn $this->allowedActions == array('*') ||\n\t\t\t\tin_array($this->_request->params['action'], array_map('strtolower', $this->allowedActions));\n\t}", "public function hasPermission($action = \"\");", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }", "public function authorize()\n {\n return $this->user()->can('anyAction', ChessRule::class);\n }", "public function canExecute($action, $user){\n return $user != null && (Security::is_dairy($user) || $user->is_veterinary());\n }", "public function authorize(): bool\n {\n return $this->user()->can('anyAction', ChessRule::class);\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}", "public function authorize()\n {\n return Gate::allows('add_to_dos') ? true : false;\n }", "public function isPermitted($action)\r\n {\r\n // users Roles\r\n $Roles = $this->User->RoleCollection->getPropertyList('name');\r\n $Roles[] = 'everyone';\r\n\r\n // if user is owner\r\n if ($this->isOwner()) {\r\n $Roles[] = 'owner';\r\n }\r\n\r\n // superadmin can do anything\r\n if (in_array('superadmin', $Roles)) {\r\n return true;\r\n }\r\n\r\n // only roles user is in can perform an action with those roles set\r\n $AllowedGroups = $this->Permissions->getPermitted($action);\r\n if ($permitted = (bool) count(array_intersect($Roles, $AllowedGroups))) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserSaveVersion();\n break;\n case 'delete':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion();\n break;\n case 'massDeleteRevisions':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteRevision();\n break;\n default:\n return Mage::getSingleton('admin/session')->isAllowed('cms/page');\n break;\n }\n }", "function isAllowedAction($action) {\n\t\t\treturn true;\n\t\t}", "public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\treturn $this->user()->can('create', WorkFunction::class) && $this->user()->can('update', $this->workplace);\n\t}", "public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}", "public function isAlwaysGranted(): bool;", "public function authorize()\n {\n if (Auth::user()->can('update-assignment')) return true;\n if (Auth::user()->hasRole('student'))\n if ($this->owns('assignment')) return true;\n return false;\n }", "protected function _isAllowed()\n {\n \treturn true;\n }", "public function authorize()\n {\n //Get the 'mark' id\n switch ((int) request()->segment(6)) {\n case 0:\n return access()->allow('deactivate-users');\n break;\n\n case 1:\n return access()->allow('reactivate-users');\n break;\n }\n\n return false;\n }", "protected function _isAllowed()\n {\n return $this->_getAclHelper()->isActionAllowed($this->_aclSection);\n }", "public function performPermission()\n {\n // User Role flags\n // Admin = 20\n // Editor = 40\n // Author = 60 (deprecated)\n // Webuser = 100 (deprecated)\n //\n // Webuser dont have access to edit node data\n //\n if($this->controllerVar['loggedUserRole'] > 40)\n {\n return false;\n }\n\n return true;\n }", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }", "public function check_access() {\n\n\t\tif (isset($this->current_entity_allowed)) {\n\t\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t\t}\n\n\t\t$this->current_entity_allowed = MKB_Options::option('restrict_on') ?\n\t\t\t(bool) $this->check_entity_access($this->get_current_entity()) :\n\t\t\ttrue; // always allowed if restriction is off\n\n\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t}", "public function authorize()\n {\n if(!isset($this->action)){\n return false;\n }\n\n if($this->action === \"add\"){\n return Auth::guard('api')->check();\n }else if($this->action === \"update\" || $this->action === \"delete\"){\n if(empty($this->income) || Helper::getStringType($this->income) !== \"integer\"){\n return false;\n }\n\n // not existing or deleted\n if(empty((new Income)->income($this->income))){\n return false;\n }\n\n return Income::canModify(Auth::guard('api')->id(), $this->income) && Auth::guard('api')->check();\n }\n\n return false;\n }", "public function canUserDoThisActionDirectly($action_name)\n {\n if (!auth()->check()) {return abort(401, 'You are not authenticated');}\n\t\tif(isset($this->actions[$action_name])){\t\n\t\t\treturn auth()->user()->can($this->actions[$action_name]);\n\t\t}\n\t\treturn false;\n }", "public function isAllowed(): bool\n {\n foreach ($this->rights as $rights) {\n [$module, $action] = explode('/', $rights);\n\n // check action rights\n if ($module !== '' && $action !== '' && !BackendAuthentication::isAllowedAction($action, $module)) {\n return false;\n }\n }\n\n return true;\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize()\n\t{\n\t\treturn current_user()->hasValidCoffeeShop();\n\t}", "public function authorize()\n {\n $user = Auth::user();\n $lecture = Lecture::findOrFail($this->route('lecture'));\n return $user->can('lecture-update') || $user->id == $lecture->user_id;\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function current_role_can(string $action): bool;", "public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }", "public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isActionAllowed($action)\n\t{\n\t\treturn Mage::getSingleton('admin/session')->isAllowed('rees46/manage/' . $action);\n\t}", "public function isActionAllowed($action){\r\n if(in_array($action,$this->_allowedActions)){\r\n return true;\r\n }\r\n return false;\r\n }", "public function authorize()\n {\n abort_if(Gate::denies('permission_edit'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n\n return true;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "protected function isAllowedAction($action)\n {\n return true;\n }", "public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n // all who has permission\n return true;\n }", "public function authorize()\n {\n\n if (Gate::allows('change-order-status', $this->route('order'))) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $user = Auth::user();\n\n $foodAddition = new FoodAddition();\n\n if((!$user->can('create', $foodAddition)) || (!$user->can('create-food-addition'))) {\n return false;\n }\n\n return true;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }", "public function authorize()\n {\n return $this->user()->can('create mindoro transaction');\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "public static function isAllowed() {\r\n\t\treturn TodoyuAuth::isAdmin();\r\n\t}", "public function authorize()\n\t{\n\t\t$expenses = $this->input('expense_ids');\n\t\tif($expenses != null && count($expenses) > 0) {\n\t\t\t$reportId = Expense::find($expenses[0])->report_id;\n\t\t\t$report = ExpenseReport::find($reportId);\n\t\t\tif($report->status) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function authorize()\n {\n return auth()->user()->can('update online assessment');\n }", "public function authorize()\n {\n $user = $this->user();\n return $user->can('add-user');\n }", "public function authorize()\n {\n if (Gate::allows('isVendor') or Gate::allows('isAdmin')){\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "protected function _isAllowed()\n {\n \n $actionName = $this->getRequest()->getActionName();\n switch ($actionName) {\n case 'index':\n case 'edit':\n case 'delete':\n // intentionally no break\n default:\n $adminSession = Mage::getSingleton('admin/session');\n $isAllowed = $adminSession\n ->isAllowed('testimonials_clients/client');\n break;\n }\n \n return $isAllowed;\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }", "public function authorize() {\n\t\tif (Auth::user()->user_type == \"S\" || Auth::user()->user_type == \"O\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tabort(404);\n\t\t}\n\t}", "public function authorize()\n {\n return $this->user()->can('manage-drafts');\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function user_is_allowed()\n {\n //check if the record exist\n if (! $this->record) {\n $this->build_error('These record does not exist or it may not belong to you',404);\n }\n\n //check if the user is the owner of the entry\n if(!isOwner($this->record)) {\n $this->build_error('you are not the owner of this task');\n }\n\n //check if the incomming entries type is Array\n if (!is_array($this->request->entries)) {\n $this->build_error('Please the entries must be an Array');\n }\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(static::ADMIN_RESOURCE);\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(static::ADMIN_RESOURCE);\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(static::ADMIN_RESOURCE);\n }", "function can($action, $params=array()){\n $logger = Logger::getInstance();\n\n $user = false;\n if(isset($_SESSION['JR'])){\n //who is logged in.\n $user = $_SESSION['JR']->getUser();\n }\n\n //If someone is logged in\n if($user !== false){\n switch($action){\n case 'find':\n //IF searching for own address, return true;\n $ret = true;\n foreach($params[0] as $p){\n if($p[0] == \"person_id\"){\n if(count($p) == 2 && $p[1] == $user['person_id']) $ret = true && $ret;\n else if(count($p) == 3 && $p[2] == $user['person_id']) $ret = true && $ret;\n else $ret = false;\n }\n }\n if($ret) return true;\n //Otherwise let anyone but reviewers search addresses\n return $user['role_id'] != ROLE::REVIEWER;\n\n case 'read':\n //Let anyone but reviewers read addresses, except their own\n return $this->vals['person_id'] == $user['person_id'] || $user['role_id'] != ROLE::REVIEWER;\n break;\n case 'update':\n //A user can update their own address\n if($user['person_id'] == $this->person_id) return true;\n \n //Administrators and Editors can edit addresses\n return $user['role_id'] == ROLE::ADMINISTRATOR || $user['role_id'] == ROLE::EDITOR;\n break;\n case 'create':\n if($user['person_id'] == $params['person_id']) return true;\n case 'delete':\n //Administrators, Editors can create and delete\n return $user['role_id'] == ROLE::ADMINISTRATOR || $user['role_id'] == ROLE::EDITOR;\n break;\n }\n }\n\n $logger->log(\"Permission Denied!\",Logger::DEBUG,true);\n return false;\n\n\n }", "public function authorize()\n {\n $user = Auth::user();\n\n if(!$user->can('update-role')) {\n return false;\n }\n\n return true;\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $member = auth()->user()->member;\n return auth()->user()->can('pdg', $member) || auth()->user()->can('manager', $member);\n }", "public function authorize()\n // can access chef member who is 'logined' and 'chefprofile null === false'\n {\n $loginedUser = Auth::user();\n\n return $loginedUser->user_type === 'chef' && (\n\n is_null($loginedUser->chef) === false\n );\n }", "public function authorize()\n {\n $user = \\Auth::user();\n \n if($user->can('update', \\App\\Product::class)){\n return true;\n }\n \n return false;\n }", "public function authorize()\n {\n return (\\Auth::user()->hasRole('admin')) || (\\Auth::user()->hasRole('editor')) || \\Auth::user()->canDo('UPDATE_POLLS');\n }", "protected function _isAllowed($action)\n {\n return Mage::getSingleton('admin/session')->isAllowed($action);\n }", "protected function user_authorized()\n\t{\n\t\t// If the user has the super role, then allow access\n\t\t$super_role = Kohana::config('acl.super_role');\n\t\tif ($super_role AND in_array($super_role, $this->user->roles_list()))\n\t\t\treturn TRUE;\n\t\t// If the user is in the user list, then allow access\n\t\tif (in_array($this->user->id, $this->rule['users']))\n\t\t\treturn TRUE;\n\t\t\t\n\t\t// If the user has all (AND) the capabilities, then allow access\n\t\t$difference = array_diff($this->rule['capabilities'], $this->user->capabilities_list());\n\t\tif ( ! empty($this->rule['capabilities']) AND empty($difference))\n\t\t\treturn TRUE;\n\n\t\t// If there were no capabilities allowed, check the roles\n\t\tif (empty($this->rule['capabilities']))\n\t\t{\n\t\t\t// If the user has one (OR) the roles, then allow access\n\t\t\t$intersection = array_intersect($this->rule['roles'], $this->user->roles_list());\n\t\t\tif ( ! empty($intersection))\n\t\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Rapidmage_Firewall::manage_rules');\n }", "public function isAuthorized($user)\n{\n if (in_array($this->request->action,['postjob','apply','posted','applied','getjob'])) {\n return true;\n }\n // The owner of an job can edit and delete it\n if (in_array($this->request->action, ['edit', 'delete'])) {\n $jobId = (int)$this->request->params['pass'][0];\n if ($this->Jobs->isOwnedBy($jobId, $user['id'])) {\n return true;\n }\n }\n\n return parent::isAuthorized($user);\n}", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n return $this->user()->can('update_users');\n }", "public function authorize()\n {\n $id = $this->route('id');\n if ($id) {\n $giftList = GiftList::find($id);\n if (!$giftList || $giftList->user->id != Auth::user()->id) {\n return false;\n }\n }\n return true;\n }", "public function authorize()\n {\n// $comment = Comment::find($this->route('comment')); // Get 'comment' route's params.\n// return $comment && $this->user()->can('update', $comment);\n\n return false;\n }", "function isAuthorized($aro, $controller, $action = null)\n\t{\n\t\t//if the user is an admin -> allow\n\t\tif( !empty($this->admins) &&\n\t\t\t ((in_array($aro[$this->userModel][$this->role], $this->admins)\n\t\t\t \t|| in_array($aro[$this->userModel][$this->username], $this->admins)\n\t\t\t\t|| in_array($aro[$this->userModel]['id'], $this->admins))))\n\t\t{\n\t\t\t$this->admin = true;\n\t\t\treturn true;\n\t\t}\n\n\t\t// if the key doesnt exist - allow access\n\t\tif (is_array($this->access) && array_key_exists($action, $this->access))\n\t\t{\n\t\t\tif(!empty($aro[$this->userModel][$this->role]))\n\t\t\t{\n\t\t\t\tif (in_array($aro[$this->userModel][$this->role], $this->access[$action]))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//be sure to check if the user doesnt have the same username as the admin group\n\t\t\telseif($aro[$this->userModel][$this->username])\n\t\t\t{\n\t\t\t\tif (in_array($aro[$this->userModel][$this->username], $this->access[$action]))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($aro[$this->userModel]['id'])\n\t\t\t{\n\t\t\t\tif (in_array($aro[$this->userModel]['id'], $this->access[$action]))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// if the action is an admin action and the user isnt an admin and the permissions for the action werent\n\t\t// defined\n\t\tif(strpos($action, Configure::read('Routing.admin')) === 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn\ttrue;\n\t}", "public function isAllowedForUser(){\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'DELETE':\n {\n return true;\n }\n case 'POST':\n {\n return true;\n }\n case 'PUT':\n {\n if (Auth::user()->hasPermissionTo('post_update', 'blog')) {\n return true;\n } else {\n return true;\n }\n }\n default:\n break;\n }\n return true;\n }", "public function beforeAction($action)\r\n {\r\n $user = $this->user;\r\n $request = Yii::$app->getRequest();\r\n $this->rule->permission = $this->getActionId($action);\r\n if(!$this->rule->allows($action, $user, $request)){\r\n $this->denyAccess($user);\r\n return false;\r\n }\r\n return true;\r\n }" ]
[ "0.76931316", "0.76195174", "0.755741", "0.75334775", "0.7484701", "0.7479297", "0.7476902", "0.7463149", "0.744782", "0.742073", "0.7412508", "0.7390839", "0.7382271", "0.7378166", "0.7378166", "0.7375086", "0.73647827", "0.7359324", "0.73535997", "0.73226476", "0.7310793", "0.7290242", "0.72857606", "0.727979", "0.7275394", "0.72650474", "0.72531384", "0.7252537", "0.72250783", "0.72094804", "0.720349", "0.72015613", "0.7199279", "0.7194934", "0.71791214", "0.71779794", "0.71745056", "0.71740854", "0.7157146", "0.71555454", "0.71466964", "0.71368587", "0.71259874", "0.7120956", "0.7117484", "0.71082735", "0.7100388", "0.70976335", "0.70968777", "0.7094505", "0.7078984", "0.7075857", "0.7075471", "0.70711535", "0.70639986", "0.7056167", "0.7053993", "0.70526516", "0.70526516", "0.7047377", "0.70467836", "0.70424944", "0.70417964", "0.7025029", "0.70213103", "0.7014324", "0.7012543", "0.70121205", "0.70121205", "0.70090264", "0.70057493", "0.7005607", "0.7002453", "0.7001704", "0.7001393", "0.700122", "0.700122", "0.700122", "0.700045", "0.69987357", "0.6997191", "0.69942003", "0.6988239", "0.6988205", "0.69868004", "0.6985908", "0.69825846", "0.69811994", "0.69782406", "0.69758457", "0.6968624", "0.69680494", "0.6960996", "0.69552094", "0.69448864", "0.6941994", "0.69394577", "0.69294626", "0.6925963", "0.6924713", "0.69239986" ]
0.0
-1
Associate this post with this user
public function p_add() { $_POST['user_id'] = $this->user->user_id; # Unix timestamp of when this post was created / modified $_POST['created'] = Time::now(); $_POST['modified'] = Time::now(); # Insert # Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us DB::instance(DB_NAME)->insert('activities', $_POST); # Send them back to home page Router::redirect('/activities/index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function creating(Post $post)\n {\n // Se ejecute si no se esta ingresando registros desde la consola\n if (! \\App::runningInConsole()) {\n $post->user_id = auth()->user()->id;\n }\n }", "public function create(User $user, Post $post);", "public function associateUser(User $user){\n $user->addPoints(PointType::Post);\n return $this->associate($user);\n }", "public function add_user($id) {\n UserToPres::create_entry($id,$this->id);\n }", "public function addUser($userId)\n {\n $this->user()->associate($userId);\n }", "public function user_post() {\n $this->loadModel('Image');\n $id = $this->Auth->user('id');\n $this->layout = 'front_end';\n $allImage = $this->Image->getAllimage($id);\n $data = $this->User->userData($id);\n $this->loadModel('Post');\n $post = $this->Post->postList();\n $this->set('image', $allImage);\n $this->set('user', $data);\n $this->set('post', $post);\n $this->render('/Users/user_post');\n }", "public function add_post()\n {\n $response = $this->UserM->add_user(\n $this->post('email'),\n $this->post('nama'),\n $this->post('nohp'),\n $this->post('pekerjaan')\n );\n $this->response($response);\n }", "protected function setAuthorOfPostNodeToCurrentUser(NodeInterface $node): void\n {\n $currentUser = $this->userService->getCurrentUser();\n $userIdentifier = $this->persistenceManager->getIdentifierByObject($currentUser);\n\n $node->setProperty('user', $userIdentifier);\n }", "public function getPostUser() {\n\n // Match and map the id of the author ($userId) to a user object\n return UserManager::getUserById($this->userId);\n }", "public function add(){\n\t\t// if we got a post information, do add else do nothing\n\t\tif($this->request->is('post')){\n\t\t\t$this->User->create();\n\t\t\tif($this->User->save($this->request->data)){\n\t\t\t\t// if the information is successfully saved\n\t\t\t\t$this->Session->setFlash(__('Congratulation, the user has been created.'));\n\t\t\t\t$this->redirect(array('controller'=>'jobs', 'action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Sorry, the user can not be created.'));\n\t\t\t}\n\t\t}\n\t}", "public function p_add() {\n $_POST['user_id'] = $this->user->user_id;\n\n # Unix timestamp of when this post was created / modified\n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n\n # Insert\n # Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us\n DB::instance(DB_NAME)->insert('posts', $_POST);\n\n \t\tRouter::redirect('/posts/myposts');\n }", "public function author(){\n return $this->belongsTo(User::class, 'user_id');//Overriding the key column name in the db that the post has \n }", "public function author()\n {\n $userId = $_post['userId'];\n $userRepository = new UserRepository();\n if (!empty($userId)) {\n $author = $userRepository->getAuthor();\n }\n }", "public function creating(Post $post)\n {\n $post->slug = Str::slug($post->title);\n $post->author_id = Auth::user()->id;\n }", "public function add(Post $post);", "public function add(Post $post);", "public function vote($submission_id, $user_id)\n {\n $this->submission->find($submission_id)->attach($user_id);\n }", "public function p_add() {\n\t\t\t#print_r($_POST);\n\t\t\t\n\t\t\t\n\t\t\t$_POST['created'] = Time::now();\n \t\t\t$_POST['modified'] = Time::now();\n\t\t\t$_POST['poster'] = $this->user->user_id;\n\t\t\t\n\t\t\t#Write Post to the Database\n\t\t $post_id= DB::instance(DB_NAME)->insert('posts', $_POST);\n\t\t\t#Call the parser to look for hashtags: \n\t\t\t$_POST['post'] = $this->parse(\"#\",$_POST['post'],$post_id);\n\t\t\t#Call the parser to look for mentions, and the 'reply_to' for the post\n\t\t\t$_POST['post'] = $this->parse(\"@\",$_POST['post'],$post_id);\n\t\t\t#Update the Post record with new post, updated in the parser:\n\t\t\tDB::instance (DB_NAME)->update('posts',$_POST,\"where post_id = '\".$post_id.\"'\");\t\n\t\t\t\n\t\t Router::redirect('/users/');\n\t\t\t\n\t\t\t\t\t\t\n\t\t}", "public function post_author( $author ) {\n\t\t$this->data['post_author'] = $author;\n\t}", "function create_new_user_posts($user_id){\n if (!$user_id>0)\n return;\n //here we know the user has been created so to create \n //3 posts we call wp_insert_post 3 times.\n // Create post object\n $user = get_user_by('id', $user_id); \n $streamer_account = array(\n 'post_title' => $user->user_nicename,\n 'post_status' => 'publish',\n 'post_author' => $user_id,\n 'post_type' => 'streamers'\n );\n\n // Insert the post into the database\n $streamer_act = wp_insert_post( $streamer_account );\n update_user_meta( $user_id, 'useracct', $streamer_act ); //this gets the id of the use, adds a meta useracct and places the added post id for the account, so that there will be only 1 streamer post per user account\n wp_update_post();\n\n}", "public function publishuser(){\n $post = User::where('id', \\request(\"id\"))->first();\n $post->approved = $post->approved==\"pending\"?\"approved\":\"pending\";\n $post->save();\n return redirect(route('voyager.users.index'));\n }", "public function create(User $user, $post)\n { \n return true;\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'body'=>'required|string',\n ]);\n\n $post=new Post;\n $post->body=$request->input('body');\n $post->user_id=auth()->user()->id; //user_id=auth()->user()->id;\n $post->save();\n return response(['message'=>'Post Created successfully']); \n\n }", "public function created(Tags $tag): void\n {\n $user = auth()->user(); \n $tag->author()->associate($user)->save();\n }", "public function update(User $user, Post $post);", "public function add_post($data,$user_id){\n $this->db->insert('blog',$data);\n// $user_id= $this->db->insert_id();\n \n }", "public function author(): User\n {\n $author = new User($this->wpPost->post_author);\n\n return $this->setAttribute(__METHOD__, $author);\n }", "public function store()\n {\n /*$this->validate([\n 'title' => 'required',\n 'body' => 'required',\n ]);*/\n agenc::updateOrCreate([\n 'name' => $this->name,\n 'code' => $this->code,\n 'phone' => $this->phone,\n 'fax' => $this->fax,\n 'email' => $this->email,\n 'address' => $this->address,\n 'country' => $this->country,\n 'status' => 1,\n ]);\n\n session()->flash('message',\n $this->agency_id ? 'Post Updated Successfully.' : 'Post Created Successfully.');\n\n $this->resetInputFields();\n\n $this->emit('userStore');\n }", "public function store($user_id, Request $request)\n {\n\n //data validation\n $validatedData = $request->validate([\n 'title' => 'required|max:512',\n 'picture' => 'required',\n ]);\n\n $last_id = Post::get()->last()->id;\n\n $post = new Post;\n $post->title = $validatedData['title'];\n $post->user_id = $user_id;\n\n $post->save();\n\n if(!is_null($request['tag_checkbox_1']))\n {\n $post->tags()->attach($request['tag_checkbox_1']);\n }\n\n if(!is_null($request['tag_checkbox_2']))\n {\n $post->tags()->attach($request['tag_checkbox_2']);\n }\n\n $post->image()->delete();\n $post->image()->create(['filename' => $validatedData['picture']]);\n\n session()->flash('message', 'Post created successfully');\n\n return $this->show_per_user($user_id);\n }", "public function p_add() {\n $_POST['user_id'] = $this->user->user_id;\n\n # Unix timestamp of when this post was created / modified\n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n\n # Insert\n # Note didn't have to sanitize $_POST data because the insert method does it for us\n DB::instance(DB_NAME)->insert('posts', $_POST); //insert('table-name', array from forms post method)\n\n\t\techo \"<br/>***<br/>\";\n\t\t# current post\n print_r($_POST);\n\t\techo \"<br/>***<br/>\";\n\n # Quick and dirty feedback\n echo \"Your post has been added. <a href='/posts/add'>Add another</a>\";\n\n }", "public function poster()\n {\n return $this->belongsTo(User::class, 'poster_id');\n }", "protected function set_post() {\n $this->post = $this->safe_find_from_id('Post');\n }", "public function authorId() { return $this->post->post_author; }", "protected function add_post_access( ?int $post_id, int $user_id ): void {\n\t\t\t_deprecated_function( __METHOD__, '4.5.0' );\n\n\t\t\t$this->update_post_access( $post_id, $user_id );\n\t\t}", "public function add() {\n\t\t$user_id = $this->UserAuth->getUserId();\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->request->data[\"Contact\"][\"user_id\"] = $user_id;\n\t\t\t$this->Contact->saveAssociated($this->request->data, array(\"deep\" => true));\n\t\t}\n\t\t\n\t\t$this->render('form');\n\t}", "public function associate(string $userId1, string $userId2, string $link)\n {\n $this->storage->storeAssociate($userId1, $userId2, $link, $this->context->get());\n }", "public function index_post()\n\t {\n\t \t\t$user= [\n\t \t\t\t'us_type'=>$this->post('post_type'),\n\t \t\t\t'id_user'=>$this->post('post_id'),\n \t'us' => $this->post('post_us'),\n\t 'email'=> $this->post('post_email'),\n\t 'born'=> $this->post('post_born'),\n\t 'status'=> $this->post('post_status'),\n\t 'pass'=> $this->post('post_pass'),\n \t];\n \t$us=$this->User_Model->add_user($user);\n \tif ($us) {\n \t\t$this->response(array(\"code\" =>200, \"response\"=>\"Se agrego el usuario\"+$user->us));\n \t} else {\n \t\t$this->response(array(\"code\" =>204, \"response\"=>\"NO se agrego el usuario\"+$user->us));\n \t}\n\t }", "function populate_object_with_post_by_id() {\n $query = \"SELECT\n *\n FROM\n \" . $this->table_name . \" \n WHERE\n id = ?\";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of user to be updated\n $stmt->bindParam(1, $this->id);\n \n // execute query\n $stmt->execute();\n\n if (!$stmt->rowCount() > 0) {\n // false means that post not exists\n return false;\n }\n \n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->id = $row['id'];\n $this->username = $row['username'];\n $this->date = $row['date'];\n $this->private = $row['private'] > 0;\n $this->content = $row['content'];\n /* $this->images = array();\n $this->likes = 0;\n $this->meLike = false;\n $this->comments = array(); */\n return true;\n }", "public function action_add()\r\n\t{\r\n\t\tif ( Request::current()->method() == Request::POST )\r\n\t\t{\r\n\t\t\treturn $this->_add();\r\n\t\t}\r\n\t\t\r\n\t\t$this->template->title = __('Add user');\r\n\t\t$this->breadcrumbs\r\n\t\t\t->add($this->template->title);\r\n\r\n\t\t// check if user have already enter something\r\n\t\t$data = Flash::get( 'post_data', array() );\r\n\r\n\t\t$user = new User( $data );\r\n\r\n\t\t$this->template->content = View::factory( 'user/edit', array(\r\n\t\t\t'action' => 'add',\r\n\t\t\t'user' => $user,\r\n\t\t\t'permissions' => Model_Permission::get_all()\r\n\t\t) );\r\n\t}", "public function addPost(int $userId, array $post) {\n $userController = new UserController();\n $userController->redirectIfNotConnected();\n\n if ( count($this->getErrors() ) == 0) {\n\n unset($_SESSION['userAddPost']);\n\n $postModel = new PostModel();\n $postModel->insertPost($userId, $post);\n $role = $_SESSION['user']['role'];\n header(\"Location: index.php?action=account&id=$userId\");\n } else {\n $userController->redirectIfNotConnected();\n $_SESSION['userAddPost']['title'] = htmlspecialchars($post['title']);\n $_SESSION['userAddPost']['post'] = htmlspecialchars($post['post']);\n\n $_SESSION['userAddPost']['errors'] = $this->getErrors();\n \n header(\"Location:index.php?id=$userId&action=addPostView\");\n }\n \n }", "public function follow($post_id_followed) {\n\t\n\t # Prepare the data array to be inserted\n\t $data = Array(\n\t \"created\" => Time::now(),\n\t \"user_id\" => $this->user->user_id,\n\t \"post_id_followed\" => $post_id_followed\n\t );\n\t\n\t # Do the insert\n\t DB::instance(DB_NAME)->insert('users_posts', $data);\n\t\n\t # Send them back\n\t Router::redirect(\"/posts/users\");\n\t\n\t}", "public function add_author( $data, $post ) {\n\t\tif ( $this->context->site_represents === false ) {\n\t\t\t$data['author'] = [ '@id' => WPSEO_Schema_Utils::get_user_schema_id( $post->post_author, $this->context ) ];\n\t\t}\n\t\treturn $data;\n\t}", "public function post(){\n // will go to post table and look for user_id automatically if want to specify different column then can specify as a second param in hasOne\n // get post by this user\n return $this->hasOne('cms\\Post');\n }", "public function creating(User $user)\n {\n\n $user->user_creator_id = \\Auth::id();\n //$user->user_updater_id = \\Auth::id();\n }", "public function Edit_My_Profile()\n\t{\n\t\t$this->_CheckLogged();\n\t\t\n\t\t$this->_processInsert($this->instructors_model->getMyPostId());\n\t}", "public function user_publishPost() {\n $this->layout = 'front_end';\n $this->loadModel('Post');\n if ($this->request->is('post')) {\n\n $data = $this->request->data;\n $users = $this->User->userList();\n $image = $_FILES['post_image']['name'];\n if (!empty($image))\n {\n $ext = substr(strtolower(strrchr($image, '.')) , 1);\n $arr_ext = array(\n 'jpg',\n 'jpeg',\n 'gif',\n 'png'\n );\n if (in_array($ext, $arr_ext))\n {\n move_uploaded_file($_FILES[\"post_image\"][\"tmp_name\"], WWW_ROOT . 'files/uploads/post/' . $image);\n $data['post_image'] = $image;\n\n }\n }\n foreach ($users as $value) {\n $userEmail= $value['User']['email'];\n $userName= $value['User']['first_name'];\n $currentUserData = $this->Session->read('Auth.User');\n $publisher_name= $currentUserData['name'];\n $url = Router::url(array(\n 'controller' => 'users',\n 'action' => 'login') , true);\n $dataArry = array('event_name'=>$this->request->data['post_title'],\n 'publisher_name'=>$publisher_name,\n 'user_name'=>$userName,\n 'url'=>$url);\n if($userName != $publisher_name){\n\n $Email = new Email();\n $send = $Email->sendEmail($userEmail, 'New Event', 'new_event_publish', $dataArry);\n\n }\n }\n\n $status = $this->Post->addPost($data);\n \n $this->redirect(array('controller' => 'Users', 'action' => 'user_dashboard'));\n \n }\n }", "public function authorLink() { return $this->post->post_author; }", "public function p_add() {\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\t\t\n\t\t# Unix timestamp of when this post was created / modified\n\t\t$_POST['created'] = Time::now();\n\t\t$_POST['modified'] = Time::now();\n\t\t$_POST['created_by'] = $this->user['email'];\n\t\t$_POST['modified_by'] = $this->user['email'];\n\t\tunset($_POST['MAX_FILE_SIZE']);\n\n\t\t# Insert\n\t\t# Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us\n\t\tDB::instance(DB_NAME)->insert('teachers', $_POST);\n\n\t\t\n\t\t# Send them to the main page\n\t\tRouter::redirect(\"/\");\n\n\n\t}", "function incrementPost()\n {\n $member_handler = &zarilia_gethandler( 'member' );\n return $member_handler->updateUserByField( $this, 'posts', $this->getVar( 'posts' ) + 1 );\n }", "public function add()\n\t{\n\t\t// TODO\n\t\t// if(user has permissions){}\n\t\t$this -> loadModel('User');\n\t\tif($this -> request -> is('post') && !$this -> User -> exists($this -> request -> data['SgaPerson']['user_id']))\n\t\t{\n\t\t\t$this -> Session -> setFlash(\"Please select a valid JacketPages user to add.\");\n\t\t\t$this -> redirect(array('action' => 'index',$id));\n\t\t}\n\t\t$this -> loadModel('User');\n\t\tif ($this -> request -> is('post'))\n\t\t{\n\t\t\t$this -> SgaPerson -> create();\n\t\t\tif ($this -> SgaPerson -> save($this -> data))\n\t\t\t{\n\t\t\t\t$user = $this -> User -> read(null, $this -> data['SgaPerson']['user_id']);\n\t\t\t\t$this -> User -> set('level', 'sga_user');\n\t\t\t\t$this -> User -> set('sga_id', $this -> SgaPerson -> getInsertID());\n\t\t\t\t$this -> User -> save();\n\t\t\t\t$this -> Session -> setFlash(__('The user has been added to SGA.', true));\n\t\t\t\t$this -> redirect(array('action' => 'index'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this -> Session -> setFlash(__('Invalid user. User may already be assigned a role in SGA. Please try again.', true));\n\t\t\t}\n\t\t}\n\t}", "public function postedBy()\n {\n return $this->belongsTo('App\\User','seller_id');\n }", "public function store()\n\t{\n $post = new Post;\n //$post->title='test title';\n //$post->body='test body';\n $data = [\n 'title'=>'title',\n 'body'=>'body',\n 'user_id'=>1\n ];;\n Posts::create($data);\n $post->save();\n\t}", "public function setAuthorAttribute(User $user)\n {\n $this->attributes['author_id'] = $user->id;\n }", "public function setUserAttribute($user)\n {\n if (is_scalar($user)) {\n $user = User::findOrFail($user);\n }\n\n $this->user()->associate($user);\n }", "protected function setupUser()\n {\n $user = \\App\\Models\\User::first();\n\n if (empty($user)) {\n $this->user = \\App\\Models\\User::factory()->create();\n } else {\n $this->user = $user;\n }\n\n $this->actingAs($this->user);\n }", "function stm_user_registration_save( $user_id ) {\r\n\t$post_title = '';\r\n if ( isset( $_POST['first_name'] ) )\r\n\t\t$post_title = $_POST['first_name'];\r\n\telse{\r\n\t\t$user_info = get_userdata($user_id);\r\n\t\t//$username = $user_info->user_login;\r\n\t\t$first_name = $user_info->first_name;\r\n\t\t$last_name = $user_info->last_name;\r\n\t\t$post_title = $first_name . ' ' . $last_name;\r\n\t}\r\n\r\n\r\n\t$defaults = array(\r\n\t\t\t\t 'post_type' => 'ocbmembers',\r\n\t\t\t\t 'post_title' => $post_title,\r\n\t\t\t\t 'post_content' => 'Replace with your content.',\r\n\t\t\t\t 'post_status' => 'publish'\r\n\t\t\t\t);\r\n\tif($post_id = wp_insert_post( $defaults )) {\r\n\t\t// add to user profile\r\n\t\tadd_post_meta($post_id, '_stm_user_id', $user_id);\r\n\r\n\t\t//add user profile to post\r\n\t\tupdate_user_meta( $user_id, '_stm_profile_post_id', $post_id );\r\n\r\n\t\tupdate_user_meta( $user_id, 'show_admin_bar_front', 'false' );\r\n\r\n\t}\r\n\r\n}", "public function update(User $user, Post $post)\n {\n //\n }", "public function insert(){\n\t\t// $post->title = 'A post from the insert method';\n\t\t// $post->body = 'Some random ghibberrish';\n\t\t// $post->save();\n\n\t\t$data = array(\n\t\t\t'title' => 'A post from the insert method, using the data array',\n\t\t\t'body' => 'Some random ghibberrish, using the data array',\n\t\t\t'user_id' => 1\n\t\t);\n\n\t\tPost::create($data);\n\n\t\tdd('post inserted');\n\t}", "public function my_post()\n {\n// $post = $this->postModel->getPostById($id);\n//\n// if($post->user_id != $_SESSION['user_id']) {\n// redirect('posts');\n// }\n\n $userPosts = $this->postModel->postByUser($_SESSION['user_id']);\n\n $data = [\n 'userPosts' => $userPosts\n ];\n\n $this->view('posts/user_posts', $data);\n }", "public function join(User $user, Post $post): bool\n {\n return true;\n }", "public function __construct($userId, Post $post)\n {\n $this->userId = $userId;\n $this->post = $post;\n }", "public function add(User $user)\n {\n return $user->role->can_add_post == 1;\n }", "public function add_post(){\n $response = $this->PersonM->add_person(\n $this->post('name'),\n $this->post('hp'),\n $this->post('email'),\n $this->post('message')\n );\n $this->response($response);\n }", "public function creating(Product $product)\n {\n $product->user_id = auth()->id();\n }", "function addPost($details) {\n $userCtrl = new UserController();\n if(isset($details['postBy'])) {\n $userCtrl->respond(true, 'Invalid usage of API');\n }\n if(!isset($details['text'])) {\n $userCtrl->respond(true, 'Please fill details of the post');\n }\n $userCtrl->addPost($details);\n}", "public function store(Post $post)\n {\n\n\n if(auth()->id()) {\n\n $this->validate(request(), [\n 'vote' => 'required|numeric|integer|between:-1,1'\n ]);\n\n $vote_val = request('vote');\n\n if ($vote_val != 0) {\n\n $vote_val = ($vote_val > 0 ? true : false);\n\n $vote = Vote::firstOrNew(array(\n 'user_id' => auth()->id(),\n 'post_id' => $post->id\n ));\n $vote->upvote = $vote_val;\n $vote->save;\n\n }\n\n return back();\n }\n\n return redirect('/login');\n\n }", "public function assignUser()\n {\n $user = User::find(request()['user_id']);\n\n $user->survey_id = request()['survey_id'];\n\n $user->save();\n\n return ['message' => 'survey assigned succefully'];\n }", "public function run()\n {\n $user = \\App\\User::first();\n\n $user->posts()->saveMany(factory(App\\Post::class, 50)->make());\n }", "public function createAnswer()\n {\n $this->is_answer = true;\n $this->topic->is_answered = true;\n $post = $this;\n\n Db::transaction(function() use ($post)\n {\n $post->topic->save();\n $post->save();\n });\n }", "public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}", "public function associateUser($deviceToken, $userId) {\n // Replace :user_id by $userId\n $endPoint = str_replace(':user_id', $userId, self::$endPoints['associateUser']);\n $response = $this->prepareRequest(\n self::METHOD_POST, \n $deviceToken,\n $endPoint\n );\n\treturn (empty($response)) ? true : false;\n }", "public function api_entry_setprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n $arg = $this->safeArray(array('fullname', 'avatar', 'church', 'city', 'province', 'bday', 'mood'), $_POST);\n\n $arg['id'] = $_POST[\"user\"];\n\n if (count($arg) == 1)\n parent::returnWithErr(\"You should pass the profile 1 entry at least to update.\");\n\n $user = $this->Mdl_Users->update($arg);\n\n if ($user == null)\n parent::returnWithErr(\"Profile has not been updated.\");\n\n parent::returnWithoutErr(\"Profile has been updated successfully.\", $user);\n }", "public function setAuthor(UserInterface $author);", "public function setAuthor(UserInterface $author);", "public static function set_user_voted( $post_id ) {\n $user_id = LaterPay_Helper_User::get_user_unique_id();\n $users_voted_data = get_post_meta( $post_id, 'laterpay_users_voted' );\n $users_voted = $users_voted_data ? $users_voted_data[0] : array();\n $users_voted[] = $user_id;\n\n update_post_meta( $post_id, 'laterpay_users_voted', $users_voted );\n }", "public function addPost($post)\n {\n $this->posts[] = $post;\n }", "public function addUser($data)\n{\n\t$this->insert($data);\n}", "public function insert($postBody)\n {\n $currentDateTime = new DateTime('now');\n $defaults = array(\n 'id' => str_replace(array(' ', '.'), '', microtime()),\n 'suspended' => false,\n 'changePasswordAtNextLogin' => false,\n 'isAdmin' => false,\n 'isDelegatedAdmin' => false,\n 'lastLoginTime' => $currentDateTime->format('c'),\n 'creationTime' => $currentDateTime->format('c'),\n 'agreedToTerms' => false,\n 'isEnforcedIn2Sv' => 'false',\n 'isEnrolledIn2Sv' => 'false',\n );\n\n // array_merge will not work, since $postBody is an object which only\n // implements ArrayAccess\n foreach ($defaults as $key => $value) {\n if (!isset($postBody[$key])) {\n $postBody[$key] = $value;\n }\n }\n\n $currentUser = $this->get($postBody->primaryEmail);\n\n if ($currentUser) {\n throw new \\Exception(\n \"Account already exists: \" . $postBody['primaryEmail'],\n 201407101120\n );\n }\n\n $newUser = new \\Google_Service_Directory_User();\n ObjectUtils::initialize($newUser, $postBody);\n $userData = json_encode($newUser);\n\n // record the user in the database\n $sqliteUtils = new SqliteUtils($this->dbFile);\n $sqliteUtils->recordData($this->dataType, $this->dataClass, $userData);\n\n // record the user's aliases in the database\n if ($postBody->aliases) {\n $usersAliases = new UsersAliasesResource($this->dbFile);\n\n foreach ($postBody->aliases as $alias) {\n $newAlias = new Alias();\n $newAlias->alias = $alias;\n $newAlias->kind = \"personal\";\n $newAlias->primaryEmail = $postBody->primaryEmail;\n\n $usersAliases->insertAssumingUserExists($newAlias);\n }\n }\n\n // Get (and return) the new user that was just created back out of the database\n return $this->get($postBody->primaryEmail);\n }", "public function setCreatedBy($userID);", "public function setCreatedBy(?SubmissionUserIdentity $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }", "public function addUser(){}", "public function addPost($post)\n {\n $this->post[] = $post;\n }", "public function create()\n {\n $user = auth()->user();\n $user_id = $user->id;\n $introductions = Introduction::all();\n $introduction = new Introduction();\n \n // ユーザーとプロフィールを結びつける?\n // ポスト一つをとる\n \n $my_introduction = $introduction->where('user_id', $user_id)->get()->first(); // プロフィールを取得\n $profile_image_path = $my_introduction->profile_image_path;\n // postのイントロダクションをとる\n return view('posts.create', [\n 'user' => $user,\n 'my_introduction' => $my_introduction,\n 'profile_image_path' => $profile_image_path\n ]);\n }", "public function setPost($post)\n\t{\n\t\t$this->posts[] = $post;\n\t}", "public function store(PostRequest $request)\n {\n $post = auth()->user()->addPostFrom($request);\n\n $post->tags()->sync($request->get('tags'));\n\n return redirect()->route('posts.index');\n }", "function press_post() \n\t{\n\t\t\n\t\t// validation rules for create\n\t\t\n\t\t$rules = array(\n\t\t\tarray(\n\t \t'field' => 'product_id',\n\t \t'rules' => 'required|callback_id_check[Product]'\n\t ),\n\t array(\n\t \t'field' => 'user_id',\n\t \t'rules' => 'required|callback_id_check[User]'\n\t )\n );\n\n\t\t// validation\n if ( !$this->is_valid( $rules )) exit;\n\n\t\t$product_id = $this->post('product_id');\n\t\t$user_id = $this->post('user_id');\n\t\t$shop_id = $this->post('shop_id');\n\n\t\t$users = global_user_check($user_id);\n\t\t\n\t\t// prep data\n $data = array( 'product_id' => $product_id, 'user_id' => $user_id, 'shop_id' => $shop_id );\n\n \t\n\t\tif ( $this->Like->exists( $data )) {\n\t\t\t\n\t\t\tif ( !$this->Like->delete_by( $data )) {\n\t\t\t\t$this->error_response( get_msg( 'err_model' ));\n\t\t\t} \n\n\t\t} else {\n\n\t\t\tif ( !$this->Like->save( $data )) {\n\t\t\t\t$this->error_response( get_msg( 'err_model' ));\n\t\t\t} \n\n\t\t}\n\n\t\t$obj = new stdClass;\n\t\t$obj->id = $product_id;\n\t\t$product = $this->Product->get_one( $obj->id );\n\t\t\n\t\t$product->login_user_id_post = $user_id;\n\t\t$this->ps_adapter->convert_product( $product );\n\t\t$this->custom_response( $product );\n\t\t\n\n\t}", "public function add_post(){\n $response = $this->BayiM->add(\n $this->post('iduser'),\n $this->post('nama'),\n $this->post('gender')\n );\n $this->response($response);\n }", "public function insert() {\n\t\t$this->insert_user();\n\t}", "public function addPost( $aData = array() ) {\n\t\tif ( empty($aData['author_id']) ){\n\t\t\treturn null;\n\t\t}\n\t\t$oAuthor = $this->dm->getRepository('Document\\User\\User')->find( $aData['author_id'] );\n\t\tif ( !$oAuthor ){\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( empty($aData['content']) ){\n\t\t\treturn null;\n\t\t}\n\n\t\t// Encode html\n\t\t// $aData['content'] = htmlentities( $aData['content'] );\n\t\t// $aData['title'] = htmlentities( $aData['title'] );\n\n\t\t$slug = (!empty($aData['title']) ? $this->url->create_slug( $aData['title'] ) . '-' : '') . new MongoId();\n\n\t\t$oPost = new Post();\n\t\t$oPost->setContent( $aData['content'] );\n\t\t$oPost->setUser( $oAuthor );\n\t\t$oPost->setStatus( true );\n\t\t$oPost->setSlug( $slug );\n\n\t\tif ( !empty($aData['title']) ){\n\t\t\t$oPost->setTitle( $aData['title'] );\n\t\t}\n\n\t\tif ( !empty($aData['stockTags']) ){\n\t\t\t$oPost->setStockTags( $aData['stockTags'] );\n\t\t}\n\n\t\t$this->dm->persist( $oPost );\n\t\t$this->dm->flush();\n\n\t\t// Add Image\n\t\tif ( !empty($aData['thumb']) ) {\n\t\t\t$oPost->setThumb( $aData['thumb'] );\n\t\t}elseif ( !empty($aData['image_link']) && !empty($aData['extension']) && is_file($aData['image_link']) ) {\n\t\t\t$sFolderLink = $this->config->get('user')['default']['image_link'];\n\t\t\t$sFolderName = $this->config->get('post')['default']['image_folder'];\n\t\t\t$sAvatarName = $this->config->get('post')['default']['avatar_name'];\n\t\t\t$path = $sFolderLink . $oAuthor->getId() . '/' . $sFolderName . '/' . $oPost->getId() . '/' . $sAvatarName . '.' . $aData['extension'];\n\t\t\t$dest = DIR_IMAGE . $path;\n\n\t\t\t$this->load->model('tool/image');\n\t\t\tif ( $this->model_tool_image->moveFile($aData['image_link'], $dest) ){\n\t\t\t\t$oPost->setThumb( $path );\n\t\t\t}\n\n\t\t\t$this->dm->flush();\n\t\t}\n\n\t\t// Cache post for what's new\n\t\t$this->load->model('cache/post');\n\t\t$aData = array(\n\t\t\t'post_id' => $oPost->getId(),\n\t\t\t'type' => $this->config->get('post')['cache']['stock'],\n\t\t\t'type_id' => new MongoId(),\n\t\t\t'view' => 0,\n\t\t\t'created' => $oPost->getCreated(),\n\t\t\t'hasTitle' => !empty($aData['title']),\n\t\t);\n\t\t$this->model_cache_post->editPost( $aData );\n\n\t\treturn $oPost;\n\t}", "public function assignUser(Request $request)\n {\n $group = Group::find($request->groupId);\n $group->users()->attach($request->userId);\n return redirect()->back();\n }", "public function store(Request $request)\n {\n $request->validate([\n 'title' => 'required|string|max:255',\n 'content' => 'required',\n 'slug' => 'string|alpha_dash|nullable|unique:posts|max:255'\n ]);\n\n $data = [\n 'user_id' => $this->id()\n ];\n\n if ($request->filled('slug')) {\n $request->slug = strtolower($request->slug);\n } else {\n $title = preg_replace(\"/[^a-zA-Z\\s]/\", \"\", $request->title);\n $slug = str_replace(' ', '-', strtolower($title));\n $data['slug'] = $slug;\n }\n\n $request->merge($data);\n\n $post = Post::create($request->all());\n $post->category()->attach($request->category);\n\n return redirect('user/post')->with('success', 'Success Create New Post');\n }", "public function setUser($aUser){\n $this->user = $aUser;\n }", "public function noteAdd(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n } \n $this->Notes->add($user);\n }", "function register_block_core_post_author()\n {\n }", "public function store(PostsCreateRequest $request)\n {\n //\n $input= $request->all();\n $user= Auth::user();\n //return $user;\n if($file= $request->file('photo_id')){\n\n $name= time() .$file->getClientOriginalName();\n $file->move('images', $name);\n $photo = Photo::create(['file' =>$name]);\n $input['photo_id'] = $photo->id;\n }\n //usefull to create post and inject it in the user post table by using the relationship\n $user->posts()->create($input);\n // Post::create($input);\n return redirect('/admin/posts');\n\n }", "public function noteAdd(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $this->Notes->add($user);\n }", "function setUp() {\n\t\tparent::setUp();\n\n\t\t$this->author = new WP_User( $this->factory->user->create( array( 'role' => 'editor' ) ) );\n\n\t\t$post = array(\n\t\t\t'post_author' => $this->author->ID,\n\t\t\t'post_status' => 'publish',\n\t\t\t'post_content' => rand_str(),\n\t\t\t'post_title' => rand_str(),\n\t\t);\n\n\t\t// insert a post\n\t\t$this->post_id = wp_insert_post($post);\n\t}", "function setUser($user) {\n $this->userObject = $user;\n }", "function addpost($url,$title,$user)\n\t{\n\t\t// time() returns the timestamp of the current time on the system\n\t\t$this->db->insert($this->posts_table,array('url' => $url,'title' => $title,'user' => $user,'timestamp' => time()));\n\t}", "public function add(): void\n {\n\n $this->checkAccess(); // redirect to login page if not connected\n\n $pageTitle = 'Ajouter un post';\n $message = '';\n $style = 'success';\n $template = 'new-post';\n $post = $this->model;\n\n $postArray = $post->collectInput('POST'); // collect global $_POST data\n \n if (!empty($postArray))\n {\n if (isset($postArray['save']))\n {\n $message = 'Le post a bien été enregistré en base';\n $post->status = self::STATUS_SUBMITTED;\n }\n if (isset($postArray['saveAsDraft']))\n {\n $message = 'Le brouillon a bien été enregistré en base';\n $post->status = self::STATUS_DRAFT;\n }\n\n $post->author = filter_var($_SESSION['user_id'], FILTER_VALIDATE_INT); // author = connected user\n $this->dataTransform($post, $postArray);\n \n $post->id = $post->insert();\n\n if($post->id == 0)\n {\n $message = 'Une erreur est survenue, le post n\\'a pas pu être inséré dans la base de données.';\n $style = 'danger';\n } \n if($post->id !== 0)\n {\n array_push($_SESSION['user_posts'], $post->id);\n $message .= ' sous l\\'identifiant #'.$post->id.'.';\n $pageTitle = 'Modifier le post #'.$post->id;\n $template = 'edit-post';\n\n if((!$this->isAdmin()) AND (NOTIFY['new_post'] == 1)) // if current user is not admin and new post notification is enabled\n {\n // Try to notify the site owner of the new post submission\n try\n {\n $serverArray = $this->collectInput('SERVER');\n $baseUrl = 'http://'.$serverArray['HTTP_HOST'].$serverArray['PHP_SELF'];\n $body = \"Un nouveau post vient d'être soumis par {$post->getAuthor()} : {$baseUrl}?controller=post&task=edit&id={$post->id}\";\n if (!$this->sendEmail(SITE_NAME,'noreply@myblog.fr','Nouveau post soumis',$body))\n {\n throw new Throwable();\n }\n }\n catch (Throwable $e)\n {\n // Uncomment in dev context:\n $error = sprintf('Erreur : %1$s<br>Fichier : %2$s<br>Ligne : %3$d', $e->getMessage(), $e->getFile(), $e->getLine());\n echo filter_var($error, FILTER_SANITIZE_STRING);\n }\n }\n }\n\n }\n \n $this->display('admin', $template, $pageTitle, compact('message','style','post'));\n\n }" ]
[ "0.6332145", "0.6213329", "0.612398", "0.6123417", "0.610395", "0.6055124", "0.5938344", "0.5918528", "0.5897", "0.5868861", "0.57789", "0.57701355", "0.57615316", "0.5713289", "0.56854177", "0.56854177", "0.5685248", "0.5645958", "0.5607845", "0.5588168", "0.5546257", "0.55429703", "0.553689", "0.553361", "0.55198795", "0.55058634", "0.54986304", "0.5487525", "0.54542", "0.5428471", "0.54100543", "0.539863", "0.5396305", "0.5376849", "0.53700554", "0.53543484", "0.5346036", "0.53420323", "0.53394425", "0.5330919", "0.53131676", "0.5312991", "0.53125983", "0.5295495", "0.52940845", "0.5289418", "0.5272352", "0.52608764", "0.52585226", "0.5247386", "0.52451074", "0.52418065", "0.52405334", "0.5239711", "0.5216177", "0.5213332", "0.5211486", "0.52105683", "0.51931787", "0.5187248", "0.5186792", "0.5184516", "0.5183609", "0.51737857", "0.51683855", "0.5164023", "0.51627177", "0.5157903", "0.5155345", "0.51529616", "0.5142414", "0.5139271", "0.51388353", "0.51388353", "0.51374775", "0.5135506", "0.5134035", "0.5131489", "0.51281047", "0.51270574", "0.51229095", "0.512229", "0.5121048", "0.5115123", "0.51065063", "0.5104698", "0.5102499", "0.5100031", "0.5098871", "0.5098004", "0.5097561", "0.50713444", "0.50680894", "0.50671", "0.50636363", "0.5063534", "0.5061746", "0.5061438", "0.5060272", "0.505992" ]
0.5627533
18
Set up the View
public function confirm_deleteactivity($activity_id) { $this->template->content = View::instance('v_activities_deleteact'); $this->template->title = "Confirm delete?"; $this->template->content->activity_id = $activity_id; # Render template echo $this->template; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initializeView() {}", "public function initializeView() {}", "protected function initializeView() {\n\t}", "protected function initializeStandaloneViewInstance() {}", "public function __construct()\n {\n $this->view = new View($this);\n }", "protected function setView()\n {\n $view = 'Src\\Modules\\\\' . $this->module_name . '\\Views\\\\' . $this->class . 'View';\n $this->view = new $view;\n \n $this->view->setData( $this->model->getData() );\n \n $this->view->run();\n }", "function __construct()\r\n {\r\n $this->view = new View();\r\n }", "public function init()\n {\n $this->getBootstrap()->bootstrap('view');\n $this->_view = $this->getBootstrap()->getResource('view');\n $this->setHeadLinks();\n }", "function __construct()\n {\n $this->view = new View();\n }", "public function setUp()\n\t{\n\t\t$this->view = new BaseView;\n\t}", "protected function _view()\r\n\t\t{\r\n\t\t\t((!is_object($this->_view)) ? $this->_view = init_class(VIEW_NAME) : '');\r\n\t\t}", "function __construct() {\n// \t\t$this -> view = new View();\n \t}", "private function setupViews()\n {\n // Sidebar\n View::composer('components.sidebar', \\App\\Http\\View\\Composers\\SidebarComposer::class);\n }", "protected function initializeView() {\n\t\t$this->view = t3lib_div::makeInstance('Tx_FormhandlerFluid_View_TemplateView');\n\t\t$this->controllerContext = Tx_FormhandlerFluid_Controller_Form::getControllerContext();\n\t\t$this->view->setControllerContext($this->controllerContext);\n\t\t\n\t\t// Set the view paths (usually done in controller but this view is not\n\t\t// always called from a controller (f.i. Tx_FormhandlerFluid_View_FluidMail)\n\t\t$this->settings = Tx_Formhandler_Globals::$settings;\n\t\tif (!empty($this->settings['templateRoot'])) {\n\t\t\t$path = Tx_Formhandler_StaticFuncs::resolvePath($this->settings['templateRoot']);\n\t\t\t$path = rtrim($path, '\\\\/').'/';\n\t\t\t$this->view->setTemplateRootPath($path.trim($this->settings['templateDir'], '\\\\/'));\n\t\t\t$this->view->setLayoutRootPath($path.trim($this->settings['layoutDir'], '\\\\/'));\n\t\t\t$this->view->setPartialRootPath($path.trim($this->settings['partialDir'], '\\\\/'));\n\t\t}\n\t\telseif ($this->settings['templateFile']) {\n\t\t\t$path = Tx_Formhandler_StaticFuncs::resolvePath($this->settings['templateFile']);\n\t\t\t$this->view->setTemplatePathAndFilename($path);\n\t\t} else {\n\t\t\tTx_Formhandler_StaticFuncs::throwException('no_template_file');\n\t\t}\n\t}", "public function __construct()\n {\n $this->view = new Views('about');\n }", "function __construct()\n {\n $this->view = new View(); \n }", "public function __construct()\n\t{\n\t\t$this->_view = new \\App\\View\\View('welcome'); \n\t}", "function __construct(){\n $this->view=new View(); \n }", "private function _initView()\n {\n App::front()->registerPlugin(new App_Controller_Plugin_View());\n }", "protected function _initView()\r\n {\r\n $view = new Zend_View();\r\n $view->doctype('XHTML1_STRICT');\r\n\r\n // Add it to the ViewRenderer\r\n $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');\r\n $viewRenderer->setView($view);\r\n\r\n $front = Zend_Controller_Front::getInstance();\r\n $router = $front->getRouter();\r\n $router->addRoute('products', new Zend_Controller_Router_Route('products/:slug', array('controller' => 'products', 'action' => 'details')));\r\n $router->addRoute('page', new Zend_Controller_Router_Route('page/:slug', array('controller' => 'page', 'action' => 'open')));\r\n\r\n return $view;\r\n }", "public function __construct(){\n //l'intensification de la classe view\n $this->view=new View();\n }", "protected function setupViewPath()\n\t{\n\t\tlist($packageName, $routeName) = [$this->packageName, \\Request::route()->getName()];\n\t\t$this->view = \"${packageName}::pages.$routeName\";\n\t}", "public function init()\n {\n Zend_Registry::set('view', new Omeka_View);\n }", "public function __construct()\r\n {\r\n $this->view = new stdClass;\r\n $this->view->placeHolder = $this->placeHolder;\r\n $this->view->settingOptionName = $this->settingOptionName;\r\n }", "protected function initView()\n {\n $view = $this->objectProviderService->get($this->resolveViewClassName());\n\n if (!$view instanceof ViewInterface) {\n throw new \\UnexpectedValueException(\n 'View \"' . get_class($view) . '\" does not implement Signature\\Mvc\\View\\ViewInterface.'\n );\n }\n\n $this->view = $view;\n\n // Assign basic view data\n $this->view->setViewData([\n 'moduleContext' => $this->getModuleContext(),\n 'config' => $this->configurationService->getConfig($this->getModuleContext()),\n 'resourceDir' => $this->getResourceDir(),\n 'templateDir' => $this->getTemplateDir(),\n ]);\n }", "public function initialize()\n {\n\t\tparent::initialize();\n\t\t$this->viewBuilder()->layout('admin');\n\t\t\n }", "public function init() {\n //En esta linea de código enviamos a las vistas la base de la URL\n //Para este Ejemplo quedaria http://localhost/ejemplo/public\n //El objeto view crea una interfaz entre el controlador y la vista.\n //La variable baseUrl es la que contendra la direccion del proyecto, esta variable \n //la creamos nosotros mismos. \n //$this->_request->getBaseUrl(); es el encargado de capturar la URL base y como vemos en la linea\n //es asignada a la variable baseUrl y esta a su vez es pasada a todas las vistas de este controlador.\n\n\n $this->view->baseUrl = $this->_request->getBaseUrl();\n }", "public function init()\n {\n $this->View()->addTemplateDir(dirname(__FILE__) . \"/Views/\");\n parent::init();\n }", "protected function _initView()\n\t{\n\t\t$view = new App_View();\n\t\t$view->doctype('XHTML1_STRICT');\n\n\t\t$view->addHelperPath(APPLICATION_PATH . '/views/helpers');\n\t\t$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');\n\t\t$viewRenderer->setView($view);\n\n\t\t\n\t\treturn $view;\n\t}", "public function createView();", "protected function setupLayout()\n\t{\n\t\tdefine(\"aol_institute\", 68);\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function loadView()\n {\n }", "protected function loadView()\n {\n }", "public function init()\n {\n \tparent::init();\n \t$this->view->headTitle('Wedding Cakes');\n }", "public function setLibraryViewConfiguration()\r\n {\r\n // Gets the library configuration manager\r\n $this->libraryConfigurationManager = $this->getController()->getLibraryConfigurationManager();\r\n\r\n // Gets the view identifier\r\n $this->viewIdentifier = $this->libraryConfigurationManager->getViewIdentifier($this->viewType);\r\n\r\n // Gets the view configuration\r\n $this->libraryViewConfiguration = $this->libraryConfigurationManager->getViewConfiguration($this->viewIdentifier);\r\n }", "protected function setupLayout()\n\t{\n\t\t$button['text'] = \"login\";\n\t\t$button['url'] = route('login');\n\n\t\tif(Auth::check())\n\t\t{\n\t\t\t$button['text'] = \"logout\";\n\t\t\t$button['url'] = route('logout');\n\t\t\t$this->logged_in_user = Auth::user();\n\t\t\t$notif = new Notification();\n\t\t\t$notifications = $notif->getNotifications($this->logged_in_user->id);\n\t\t\t$new = 0;\n\t\t\tforeach ($notifications as $not) {\n\t\t\t\tif($not->seen == 0)\n\t\t\t\t{\n\t\t\t\t\t$new++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$rating_types = RatingType::getRatingTypes($this->logged_in_user->id);\n\n\t\t\tView::share('notifications', $notifications);\n\t\t\tView::share('new', $new);\n\t\t\tView::share('rating_types', $rating_types);\n\t\t\tView::share('logged_in_user', $this->logged_in_user);\n\t\t}\n\n\t\tView::share('button', $button);\n\t\tView::share('show_feed', $this->show_feed);\n\t\t//Get image path info for all poster and backdrop images\n\t\t$t = new TheMovieDb();\n \t\t$this->image_path_config = $t->getImgPath();\n\t\tView::share('image_path_config', $this->image_path_config);\n\n\n\t\t\n\n\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "public function __construct()\r\n\t\t{\r\n\t\t\t$this->view = new \\Core\\Libraries\\Gears;\r\n\t\t}", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->view = new ViewController();\t\t\n\t}", "public function __construct()\n {\n $view = new View('header',array('warning' => 'Login', 'heading' => 'Login'));\n $view->display();\n }", "protected function set_up()\n {\n $this->_object = new Zend_View_Helper_Gravatar();\n $this->_view = new Zend_View();\n $this->_view->doctype()->setDoctype(strtoupper(\"XHTML1_STRICT\"));\n $this->_object->setView($this->_view);\n\n if (isset($_SERVER['HTTPS'])) {\n unset($_SERVER['HTTPS']);\n }\n }", "public function init()\n\t{\n\n\t\tZend_Layout::startMvc(APPLICATION_PATH . '/layouts/');\n\n\t\t$ZL = Zend_Layout::getMvcInstance();\n\n\t\t$ZL->setViewSuffix('php');\n\t\t$view = Zend_Layout::getMvcInstance()->getView();\n\t\t//for layout setting -------- end --------------\n\n\t\tZend_Loader::loadClass('Zend_View');\n\n\t\t$this->view = new Zend_View();\n\t\t$this->view->setScriptPath(APPLICATION_PATH.'/views');\n\t\t$this->_getModel();\n\t\t$this->auth = new Zend_Session_Namespace('Zend_Auth');\n\t\t$controller = Zend_Controller_Front::getInstance();\n\t\t$this->view->baseUrl=$controller->getBaseUrl();\n\t////////////////////////////Module include//////////////////////\n\t\t$this->_loadModel('Users.php');\n\t\t\n\n\t//////////////// calendar////////////\n\t}", "public function init()\n {\n \t$this->view->layout = array();\n }", "function __construct()\n {\n $this->view = TemplatesFactory::templates();\n Sesion::init();\n }", "public function init()\n {\n\t\t$this->view->titleBrowser = 'e-Transporte';\n }", "public function __construct()\n {\n $this->view = 'frontend.contents.home';\n }", "public function __construct(){\n parent::__construct();\n \n // set the default template as the name of the view class\n $template = get_class($this);\n if(strtolower(substr($template, -4)) === 'view'){\n $template = substr($template, 0, strlen($template) - 4);\n }\n $this->template($template);\n }", "protected function setUp()\n {\n $this->view = new Zend_View();\n $this->helper = new Zend_View_Helper_FormImage();\n $this->helper->setView($this->view);\n }", "function init()\n\t{\n\t\t// Ghetto fix for formText problem\n\t\t$this->view->addHelperPath(ROOT_DIR . '/library/Zarrar/View/HelperFix', 'Zarrar_View_HelperFix');\n\t\t\n\t\t// Disable header file\n\t\t$this->view->headerFile = '_empty.phtml';\n\t\t\n\t\t// Add stylesheet for table\n\t\t$this->view\n\t\t\t->headLink()\n\t\t\t->appendStylesheet(\"{$this->view->dir_styles}/oranges-in-the-sky.css\");\n\t\t\t\n\t\t// Instantiate table for later usage\n\t\t$this->_table = new Study();\n\t}", "public function init()\n {\n $this->_helper->layout()->getView()->headTitle('@PHPoton');\n\n // Set navigation\n $container = Zend_Registry::get('navigation');\n $this->view->navigation(new Zend_Navigation($container));\n }", "public function initialize()\n {\n //$this->view->setTemplateBefore('public');\n }", "function __construct() {\n // Create a new instance of the corresponding view.\n $this->view = new View();\n // $this->session = new Session(); // Sessions still not working.\n }", "protected function initView()\n {\n $this->di->set('view', function () {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n $em = $this->getShared('eventsManager');\n\n $view = new View;\n $view->registerEngines([\n // Setting up Volt Engine\n // See https://docs.phalconphp.com/en/latest/reference/volt.html#setting-up-the-volt-engine\n '.volt' => function ($view, $di) {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n $volt = new VoltEngine($view, $di);\n\n $options = [\n 'compiledPath' => function ($templatePath) {\n /** @var DiInterface $this */\n $config = $this->getShared('config')->get('volt')->toArray();\n\n $filename = str_replace(\n ['\\\\', '/'],\n $config['separator'],\n trim(substr($templatePath, strlen(BASE_DIR)), '\\\\/')\n );\n $filename = basename($filename, '.volt') . $config['compiledExt'];\n\n return rtrim($config['cacheDir'], '\\\\/') . DIRECTORY_SEPARATOR . $filename;\n },\n 'compileAlways' => boolval($config->get('volt')->forceCompile),\n ];\n\n $volt->setOptions($options);\n\n $volt->getCompiler()->addFunction('number_format', function ($resolvedArgs) {\n return 'number_format(' . $resolvedArgs . ')';\n })->addFunction('chr', function ($resolvedArgs) {\n return 'chr(' . $resolvedArgs . ')';\n });\n\n return $volt;\n },\n // Setting up Php Engine\n '.phtml' => 'Phalcon\\Mvc\\View\\Engine\\Php'\n ]);\n\n $view->setViewsDir($config->get('application')->viewsDir);\n\n $that = $this;\n $em->attach('view', function ($event, $view) use ($that, $config) {\n /**\n * @var LoggerInterface $logger\n * @var View $view\n * @var Event $event\n * @var DiInterface $that\n */\n $logger = $that->get('logger');\n $logger->debug(sprintf('Event %s. Path: %s', $event->getType(), $view->getActiveRenderPath()));\n\n if ('notFoundView' == $event->getType()) {\n $message = sprintf('View not found: %s', $view->getActiveRenderPath());\n $logger->error($message);\n throw new ViewException($message);\n }\n });\n\n $view->setEventsManager($em);\n\n return $view;\n });\n }", "public function __construct()\n {\n $this->view = GeneralUtility::makeInstance(StandaloneView::class);\n $this->view->setPartialRootPaths($this->partialRootPaths);\n $this->view->setTemplateRootPaths($this->templateRootPaths);\n $this->view->setLayoutRootPaths($this->layoutRootPaths);\n $this->view->setTemplate($this->templateFile);\n $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);\n $this->docHeaderComponent = GeneralUtility::makeInstance(DocHeaderComponent::class);\n $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);\n }", "function abstractInit()\n\t{\n\t\t/* Setting base url in view */\n\t\t$this->view->baseUrl = $this->_request->getBaseUrl();\n\t\t\n\t\t/* Setting the name of current module in view */\n\t\t$this->view->currentModule = $this->_request->getModuleName();\n\t\t\n\t\t/* Setting the name of current controller in view */\n\t\t$this->view->currentController = $this->_request->getControllerName();\n\t\t\n\t\t/* Setting the name of current action in view */\n\t\t$this->view->currentAction = $this->_request->getActionName();\n\t\t\n\t\t/* Setting the base url of assets in view */\n\t\t$this->view->assetUrl = $this->_request->getBaseUrl() . '/assets/';\n\t\t\n\t\t/* Addicting custom helper path */\n\t\t$this->view->addHelperPath(PLUGIN_DIR . 'Helpers/');\n\t}", "public function setup() { \n\t\t$this->auth_realm = CMS::$admin_realm;\n\t\treturn parent::setup()->use_views_from('../app/views'); \n\t}", "public function init()\n {\n \t$this->view->headTitle('Produktgruppen');\n\t\t$this->db = Zend_Registry::get('db');\n\t\t$this->logger = Zend_Registry::get('logger');\n }", "public function init() {\n \n // Instantiate the class\n (new MidrubBaseAdminCollectionFrontendControllers\\Init)->view();\n \n }", "public function createView(){\n\t\t$vue = new View(\"Create\");\n\t\t$vue->generer();\n\t}", "function __construct() {\r\n $this->view = new View();\r\n $this->deviceType = View::getInstance();\r\n }", "public function initialize()\n {\n // set base template\n $this->view->setTemplateBefore('default');\n }", "public function getView() {}", "public function getView() {}", "protected function makeViews()\n {\n new MakeView($this, $this->files);\n }", "public function __construct()\n {\n parent::__construct();\n $this->view->js = array('pizza/js/default.js',\n 'pizza/js/jquery.jeditable.min.js',\n '../public/js/jquery.goup.min.js');\n\n $this->view->css = array('pizza/css/default.css');\n }", "protected function setupLayout()\n {\n if ( ! is_null($this->layout))\n {\n $this->layout = view($this->layout);\n $this->layout->menus = Menu::getMenu() ;\n }\n }", "protected function setUp()\n {\n $this->view = new Zend_View();\n $this->helper = new Zend_View_Helper_HtmlFlash();\n $this->helper->setView($this->view);\n }", "public function display()\n \t{\n \t\t$this->assign(\"__view\", $this->_view);\n \t\tparent::display();\n \t}", "public function init()\n {\n parent::init();\n\n // Retrieving a field from the controller container and layout into this view.\n $this->add($this->fieldCtrl->getField('label'));\n }", "public function __construct() {\n // Pass in the base for all the views\n parent::__construct();\n\n $this->view_base = 'settings/authorized-users/';\n $this->title = _('Authorized Users') . ' | ' . _('Settings');\n }", "protected function setupLayout() {\n\t\tif (!is_null($this -> layout)) {\n\t\t\t$this -> layout = View::make($this -> layout);\n\t\t}\n\t}", "protected function setupLayout() {\n\t\tif ( ! is_null($this->layout)) {\n\n\n\t\t\t$cb_js_var = array(\n\t\t\t\t'site_url' => url('/'),\n\t\t\t\t'admin_url' => url('/admin'),\n\t\t\t\t'admin_assets_url' => asset('packages/vizioart/cookbook/'),\n\t\t\t\t'admin_api_url' => url('/admin/api')\n\t\t\t);\n\n\n\t\t\t$this->layout = View::make($this->layout, array(\n\t\t\t\t'cb_js_var' => $cb_js_var\n\t\t\t));\n\t\t}\n\t}", "public function init()\n {\n $this->sysConfig = Zend_Registry::get('sysConfig');\n\t\t$this->view->sysConfig = $this->sysConfig;\n\t\t\n\t\t$this->config = Zend_Registry::get('config');\n\t\t$this->view->config = $this->config;\n\t\t\n\t\t$this->db=Zend_Registry::get('db');\n\t\t\n\t\t//controller and action names\n\t\t$this->controllerName = $this->getRequest()->getControllerName();\n\t\t$this->view->controllerName = $this->controllerName;\n\t\t\n\t\t$this->actionName = $this->getRequest()->getActionName();\n\t\t$this->view->actionName = $this->actionName;\n\t\t\n\t\t$this->view->baseurl=$this->config->common->baseUrl.\"/\";\n\t\t$this->view->cssurl=$this->config->common->cssPath;\n\t\t$this->view->jsurl=$this->config->common->jsPath;\n\n $this->view->items = \"\";\n $this->view->dashboard = \"\";\n $this->view->cnews = \"\";\n $this->view->expenditure = \"\";\n \n \n }", "private static function view(): void\n {\n Debug::setBacklog();\n\n /**\n * Calls the methods to define and validate the template and view files.\n */\n self::viewCheckTemplateFile();\n self::viewDefineViewPath();\n self::viewCheckFileExists();\n\n /**\n * Calls the method that will import the template file to be returned to the request.\n */\n self::viewRequireTemplate(\n new ViewHelper(\n self::$routeController->getResultData(),\n self::$viewPath\n ),\n );\n }", "public function setUp()\n {\n Time::setToStringFormat('yyyy-MM-dd HH:mm:ss');\n $this->request = new Request();\n $this->response = new Response();\n $this->view = new PugView($this->request, $this->response);\n }", "protected function commonViewData() {\n //print \"Hello\";\n $this->viewModel->set(\"mainMenu\", array(\"Home\" => \"home\", \"Help\" => \"help\"));\n $this->viewModel->set(\"Basepath\", \"http://localhost/~georginfanger/georginfanger/\");\n }", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->data_view \t\t\t\t\t= parent::setupThemes();\n\t\t$this->data_view['client_index'] \t= $this->data_view['view_path'] . '.clients.index';\n\t\t$this->data_view['html_body_class'] = 'page-header-fixed page-quick-sidebar-over-content page-container-bg-solid page-sidebar-closed';\n\t\t$this->data_view['include'] \t\t= $this->data_view['view_path'] . '.sms';\n\t\t$this->noteFolder \t \t\t\t\t= public_path() . '/documents';\n\t\t//'pdf|doc|docx|gif|jpg|png'\n\t\t$this->prefixNoteFileName = \\Auth::id();\n\t}", "protected function setupLayout() {\n if (!is_null($this->layout)) $this->layout = View::make($this->layout);\n }", "public function launch()\r\n {\r\n // Extract data to be usable inside the view file\r\n extract($this->data);\r\n\r\n // Expected view file format is\r\n // viewfolder.viewfile\r\n $view_file = str_replace(\".\", \"/\", $this->view_file);\r\n\r\n // Require view\r\n require path('app').'/views/'.$view_file.'.php';\r\n }", "protected function set_up()\n {\n Zend_Registry::_unsetInstance();\n Zend_Dojo_View_Helper_Dojo::setUseDeclarative();\n\n $this->errors = [];\n $this->view = $this->getView();\n $this->decorator = new Zend_Dojo_Form_Decorator_DijitElement();\n $this->element = $this->getElement();\n $this->element->setView($this->view);\n $this->decorator->setElement($this->element);\n }", "public function init() {\n parent::init();\n $this->_breadcrumbs->append(array('Contact', array('action' => 'index', 'controller' => 'contact')));\n\n // Pass variables to view\n $baseUrl = $this->view->baseUrl();\n $this->view->headLink()->appendStylesheet(\"{$baseUrl}/stylesheets/cms_layout.css\", 'screen');\n $this->view->title = 'Contact DG Environment';\n $this->view->showLeftNavigation = true;\n }", "protected function setupLayout()\r\n\t{\r\n\t\tif ( ! is_null($this->layout))\r\n\t\t{\r\n\t\t\t$this->layout = View::make($this->layout);\r\n\t\t}\r\n\t}", "protected function setupLayout()\n\t{\n\t\tif (!is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "public function getView()\n {\n }", "public function view()\n\t{\n\t\t// TODO Implement\t\n\t}", "function index() {\n\n $this->view->render();\n\n }", "public function __construct( View $view ) {\n\t\t$this->view = $view;\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}" ]
[ "0.81184554", "0.81184554", "0.8021358", "0.7495072", "0.7486435", "0.74779695", "0.7349287", "0.7348084", "0.7343529", "0.7313897", "0.7200492", "0.71498567", "0.71445227", "0.71423405", "0.70986485", "0.70923644", "0.70853436", "0.7070219", "0.7059331", "0.70427984", "0.70369345", "0.7011118", "0.7006282", "0.70030856", "0.7000328", "0.6998977", "0.69926953", "0.6966993", "0.6949017", "0.69473815", "0.6942942", "0.69148344", "0.69148344", "0.69127125", "0.68934757", "0.6871464", "0.68650955", "0.68611664", "0.6859732", "0.68456703", "0.6839118", "0.68123233", "0.6803712", "0.6796979", "0.67949575", "0.67919916", "0.67860514", "0.6773742", "0.67640996", "0.6746652", "0.6744468", "0.6741197", "0.6737751", "0.67233527", "0.6711633", "0.6706395", "0.66777354", "0.66717863", "0.6671454", "0.6663901", "0.6652473", "0.6652473", "0.6648483", "0.6647316", "0.6645801", "0.6621078", "0.66115654", "0.6603116", "0.6595277", "0.65946144", "0.65899193", "0.656524", "0.6554518", "0.6550057", "0.65409523", "0.65405285", "0.6537589", "0.653543", "0.6534263", "0.652308", "0.6522465", "0.6521893", "0.65164053", "0.6513693", "0.6511916", "0.65113354", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888" ]
0.0
-1
Set up the View
public function index() { $this->template->content = View::instance('v_activities_index'); $this->template->title = "Activities"; # Build the query $q = "SELECT activities .* , users.first_name, users.last_name FROM activities INNER JOIN users ON activities.user_id = users.user_id"; # Run the query $activities = DB::instance(DB_NAME)->select_rows($q); # Pass data to the View $this->template->content->activities = $activities; # Render the View echo $this->template; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initializeView() {}", "public function initializeView() {}", "protected function initializeView() {\n\t}", "protected function initializeStandaloneViewInstance() {}", "public function __construct()\n {\n $this->view = new View($this);\n }", "protected function setView()\n {\n $view = 'Src\\Modules\\\\' . $this->module_name . '\\Views\\\\' . $this->class . 'View';\n $this->view = new $view;\n \n $this->view->setData( $this->model->getData() );\n \n $this->view->run();\n }", "function __construct()\r\n {\r\n $this->view = new View();\r\n }", "public function init()\n {\n $this->getBootstrap()->bootstrap('view');\n $this->_view = $this->getBootstrap()->getResource('view');\n $this->setHeadLinks();\n }", "function __construct()\n {\n $this->view = new View();\n }", "public function setUp()\n\t{\n\t\t$this->view = new BaseView;\n\t}", "protected function _view()\r\n\t\t{\r\n\t\t\t((!is_object($this->_view)) ? $this->_view = init_class(VIEW_NAME) : '');\r\n\t\t}", "function __construct() {\n// \t\t$this -> view = new View();\n \t}", "private function setupViews()\n {\n // Sidebar\n View::composer('components.sidebar', \\App\\Http\\View\\Composers\\SidebarComposer::class);\n }", "protected function initializeView() {\n\t\t$this->view = t3lib_div::makeInstance('Tx_FormhandlerFluid_View_TemplateView');\n\t\t$this->controllerContext = Tx_FormhandlerFluid_Controller_Form::getControllerContext();\n\t\t$this->view->setControllerContext($this->controllerContext);\n\t\t\n\t\t// Set the view paths (usually done in controller but this view is not\n\t\t// always called from a controller (f.i. Tx_FormhandlerFluid_View_FluidMail)\n\t\t$this->settings = Tx_Formhandler_Globals::$settings;\n\t\tif (!empty($this->settings['templateRoot'])) {\n\t\t\t$path = Tx_Formhandler_StaticFuncs::resolvePath($this->settings['templateRoot']);\n\t\t\t$path = rtrim($path, '\\\\/').'/';\n\t\t\t$this->view->setTemplateRootPath($path.trim($this->settings['templateDir'], '\\\\/'));\n\t\t\t$this->view->setLayoutRootPath($path.trim($this->settings['layoutDir'], '\\\\/'));\n\t\t\t$this->view->setPartialRootPath($path.trim($this->settings['partialDir'], '\\\\/'));\n\t\t}\n\t\telseif ($this->settings['templateFile']) {\n\t\t\t$path = Tx_Formhandler_StaticFuncs::resolvePath($this->settings['templateFile']);\n\t\t\t$this->view->setTemplatePathAndFilename($path);\n\t\t} else {\n\t\t\tTx_Formhandler_StaticFuncs::throwException('no_template_file');\n\t\t}\n\t}", "public function __construct()\n {\n $this->view = new Views('about');\n }", "function __construct()\n {\n $this->view = new View(); \n }", "public function __construct()\n\t{\n\t\t$this->_view = new \\App\\View\\View('welcome'); \n\t}", "function __construct(){\n $this->view=new View(); \n }", "private function _initView()\n {\n App::front()->registerPlugin(new App_Controller_Plugin_View());\n }", "protected function _initView()\r\n {\r\n $view = new Zend_View();\r\n $view->doctype('XHTML1_STRICT');\r\n\r\n // Add it to the ViewRenderer\r\n $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');\r\n $viewRenderer->setView($view);\r\n\r\n $front = Zend_Controller_Front::getInstance();\r\n $router = $front->getRouter();\r\n $router->addRoute('products', new Zend_Controller_Router_Route('products/:slug', array('controller' => 'products', 'action' => 'details')));\r\n $router->addRoute('page', new Zend_Controller_Router_Route('page/:slug', array('controller' => 'page', 'action' => 'open')));\r\n\r\n return $view;\r\n }", "public function __construct(){\n //l'intensification de la classe view\n $this->view=new View();\n }", "protected function setupViewPath()\n\t{\n\t\tlist($packageName, $routeName) = [$this->packageName, \\Request::route()->getName()];\n\t\t$this->view = \"${packageName}::pages.$routeName\";\n\t}", "public function init()\n {\n Zend_Registry::set('view', new Omeka_View);\n }", "public function __construct()\r\n {\r\n $this->view = new stdClass;\r\n $this->view->placeHolder = $this->placeHolder;\r\n $this->view->settingOptionName = $this->settingOptionName;\r\n }", "protected function initView()\n {\n $view = $this->objectProviderService->get($this->resolveViewClassName());\n\n if (!$view instanceof ViewInterface) {\n throw new \\UnexpectedValueException(\n 'View \"' . get_class($view) . '\" does not implement Signature\\Mvc\\View\\ViewInterface.'\n );\n }\n\n $this->view = $view;\n\n // Assign basic view data\n $this->view->setViewData([\n 'moduleContext' => $this->getModuleContext(),\n 'config' => $this->configurationService->getConfig($this->getModuleContext()),\n 'resourceDir' => $this->getResourceDir(),\n 'templateDir' => $this->getTemplateDir(),\n ]);\n }", "public function initialize()\n {\n\t\tparent::initialize();\n\t\t$this->viewBuilder()->layout('admin');\n\t\t\n }", "public function init() {\n //En esta linea de código enviamos a las vistas la base de la URL\n //Para este Ejemplo quedaria http://localhost/ejemplo/public\n //El objeto view crea una interfaz entre el controlador y la vista.\n //La variable baseUrl es la que contendra la direccion del proyecto, esta variable \n //la creamos nosotros mismos. \n //$this->_request->getBaseUrl(); es el encargado de capturar la URL base y como vemos en la linea\n //es asignada a la variable baseUrl y esta a su vez es pasada a todas las vistas de este controlador.\n\n\n $this->view->baseUrl = $this->_request->getBaseUrl();\n }", "public function init()\n {\n $this->View()->addTemplateDir(dirname(__FILE__) . \"/Views/\");\n parent::init();\n }", "protected function _initView()\n\t{\n\t\t$view = new App_View();\n\t\t$view->doctype('XHTML1_STRICT');\n\n\t\t$view->addHelperPath(APPLICATION_PATH . '/views/helpers');\n\t\t$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');\n\t\t$viewRenderer->setView($view);\n\n\t\t\n\t\treturn $view;\n\t}", "public function createView();", "protected function setupLayout()\n\t{\n\t\tdefine(\"aol_institute\", 68);\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function loadView()\n {\n }", "protected function loadView()\n {\n }", "public function init()\n {\n \tparent::init();\n \t$this->view->headTitle('Wedding Cakes');\n }", "public function setLibraryViewConfiguration()\r\n {\r\n // Gets the library configuration manager\r\n $this->libraryConfigurationManager = $this->getController()->getLibraryConfigurationManager();\r\n\r\n // Gets the view identifier\r\n $this->viewIdentifier = $this->libraryConfigurationManager->getViewIdentifier($this->viewType);\r\n\r\n // Gets the view configuration\r\n $this->libraryViewConfiguration = $this->libraryConfigurationManager->getViewConfiguration($this->viewIdentifier);\r\n }", "protected function setupLayout()\n\t{\n\t\t$button['text'] = \"login\";\n\t\t$button['url'] = route('login');\n\n\t\tif(Auth::check())\n\t\t{\n\t\t\t$button['text'] = \"logout\";\n\t\t\t$button['url'] = route('logout');\n\t\t\t$this->logged_in_user = Auth::user();\n\t\t\t$notif = new Notification();\n\t\t\t$notifications = $notif->getNotifications($this->logged_in_user->id);\n\t\t\t$new = 0;\n\t\t\tforeach ($notifications as $not) {\n\t\t\t\tif($not->seen == 0)\n\t\t\t\t{\n\t\t\t\t\t$new++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$rating_types = RatingType::getRatingTypes($this->logged_in_user->id);\n\n\t\t\tView::share('notifications', $notifications);\n\t\t\tView::share('new', $new);\n\t\t\tView::share('rating_types', $rating_types);\n\t\t\tView::share('logged_in_user', $this->logged_in_user);\n\t\t}\n\n\t\tView::share('button', $button);\n\t\tView::share('show_feed', $this->show_feed);\n\t\t//Get image path info for all poster and backdrop images\n\t\t$t = new TheMovieDb();\n \t\t$this->image_path_config = $t->getImgPath();\n\t\tView::share('image_path_config', $this->image_path_config);\n\n\n\t\t\n\n\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "public function __construct()\r\n\t\t{\r\n\t\t\t$this->view = new \\Core\\Libraries\\Gears;\r\n\t\t}", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->view = new ViewController();\t\t\n\t}", "public function __construct()\n {\n $view = new View('header',array('warning' => 'Login', 'heading' => 'Login'));\n $view->display();\n }", "protected function set_up()\n {\n $this->_object = new Zend_View_Helper_Gravatar();\n $this->_view = new Zend_View();\n $this->_view->doctype()->setDoctype(strtoupper(\"XHTML1_STRICT\"));\n $this->_object->setView($this->_view);\n\n if (isset($_SERVER['HTTPS'])) {\n unset($_SERVER['HTTPS']);\n }\n }", "public function init()\n\t{\n\n\t\tZend_Layout::startMvc(APPLICATION_PATH . '/layouts/');\n\n\t\t$ZL = Zend_Layout::getMvcInstance();\n\n\t\t$ZL->setViewSuffix('php');\n\t\t$view = Zend_Layout::getMvcInstance()->getView();\n\t\t//for layout setting -------- end --------------\n\n\t\tZend_Loader::loadClass('Zend_View');\n\n\t\t$this->view = new Zend_View();\n\t\t$this->view->setScriptPath(APPLICATION_PATH.'/views');\n\t\t$this->_getModel();\n\t\t$this->auth = new Zend_Session_Namespace('Zend_Auth');\n\t\t$controller = Zend_Controller_Front::getInstance();\n\t\t$this->view->baseUrl=$controller->getBaseUrl();\n\t////////////////////////////Module include//////////////////////\n\t\t$this->_loadModel('Users.php');\n\t\t\n\n\t//////////////// calendar////////////\n\t}", "public function init()\n {\n \t$this->view->layout = array();\n }", "function __construct()\n {\n $this->view = TemplatesFactory::templates();\n Sesion::init();\n }", "public function init()\n {\n\t\t$this->view->titleBrowser = 'e-Transporte';\n }", "public function __construct()\n {\n $this->view = 'frontend.contents.home';\n }", "public function __construct(){\n parent::__construct();\n \n // set the default template as the name of the view class\n $template = get_class($this);\n if(strtolower(substr($template, -4)) === 'view'){\n $template = substr($template, 0, strlen($template) - 4);\n }\n $this->template($template);\n }", "protected function setUp()\n {\n $this->view = new Zend_View();\n $this->helper = new Zend_View_Helper_FormImage();\n $this->helper->setView($this->view);\n }", "function init()\n\t{\n\t\t// Ghetto fix for formText problem\n\t\t$this->view->addHelperPath(ROOT_DIR . '/library/Zarrar/View/HelperFix', 'Zarrar_View_HelperFix');\n\t\t\n\t\t// Disable header file\n\t\t$this->view->headerFile = '_empty.phtml';\n\t\t\n\t\t// Add stylesheet for table\n\t\t$this->view\n\t\t\t->headLink()\n\t\t\t->appendStylesheet(\"{$this->view->dir_styles}/oranges-in-the-sky.css\");\n\t\t\t\n\t\t// Instantiate table for later usage\n\t\t$this->_table = new Study();\n\t}", "public function init()\n {\n $this->_helper->layout()->getView()->headTitle('@PHPoton');\n\n // Set navigation\n $container = Zend_Registry::get('navigation');\n $this->view->navigation(new Zend_Navigation($container));\n }", "public function initialize()\n {\n //$this->view->setTemplateBefore('public');\n }", "function __construct() {\n // Create a new instance of the corresponding view.\n $this->view = new View();\n // $this->session = new Session(); // Sessions still not working.\n }", "protected function initView()\n {\n $this->di->set('view', function () {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n $em = $this->getShared('eventsManager');\n\n $view = new View;\n $view->registerEngines([\n // Setting up Volt Engine\n // See https://docs.phalconphp.com/en/latest/reference/volt.html#setting-up-the-volt-engine\n '.volt' => function ($view, $di) {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n $volt = new VoltEngine($view, $di);\n\n $options = [\n 'compiledPath' => function ($templatePath) {\n /** @var DiInterface $this */\n $config = $this->getShared('config')->get('volt')->toArray();\n\n $filename = str_replace(\n ['\\\\', '/'],\n $config['separator'],\n trim(substr($templatePath, strlen(BASE_DIR)), '\\\\/')\n );\n $filename = basename($filename, '.volt') . $config['compiledExt'];\n\n return rtrim($config['cacheDir'], '\\\\/') . DIRECTORY_SEPARATOR . $filename;\n },\n 'compileAlways' => boolval($config->get('volt')->forceCompile),\n ];\n\n $volt->setOptions($options);\n\n $volt->getCompiler()->addFunction('number_format', function ($resolvedArgs) {\n return 'number_format(' . $resolvedArgs . ')';\n })->addFunction('chr', function ($resolvedArgs) {\n return 'chr(' . $resolvedArgs . ')';\n });\n\n return $volt;\n },\n // Setting up Php Engine\n '.phtml' => 'Phalcon\\Mvc\\View\\Engine\\Php'\n ]);\n\n $view->setViewsDir($config->get('application')->viewsDir);\n\n $that = $this;\n $em->attach('view', function ($event, $view) use ($that, $config) {\n /**\n * @var LoggerInterface $logger\n * @var View $view\n * @var Event $event\n * @var DiInterface $that\n */\n $logger = $that->get('logger');\n $logger->debug(sprintf('Event %s. Path: %s', $event->getType(), $view->getActiveRenderPath()));\n\n if ('notFoundView' == $event->getType()) {\n $message = sprintf('View not found: %s', $view->getActiveRenderPath());\n $logger->error($message);\n throw new ViewException($message);\n }\n });\n\n $view->setEventsManager($em);\n\n return $view;\n });\n }", "public function __construct()\n {\n $this->view = GeneralUtility::makeInstance(StandaloneView::class);\n $this->view->setPartialRootPaths($this->partialRootPaths);\n $this->view->setTemplateRootPaths($this->templateRootPaths);\n $this->view->setLayoutRootPaths($this->layoutRootPaths);\n $this->view->setTemplate($this->templateFile);\n $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);\n $this->docHeaderComponent = GeneralUtility::makeInstance(DocHeaderComponent::class);\n $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);\n }", "function abstractInit()\n\t{\n\t\t/* Setting base url in view */\n\t\t$this->view->baseUrl = $this->_request->getBaseUrl();\n\t\t\n\t\t/* Setting the name of current module in view */\n\t\t$this->view->currentModule = $this->_request->getModuleName();\n\t\t\n\t\t/* Setting the name of current controller in view */\n\t\t$this->view->currentController = $this->_request->getControllerName();\n\t\t\n\t\t/* Setting the name of current action in view */\n\t\t$this->view->currentAction = $this->_request->getActionName();\n\t\t\n\t\t/* Setting the base url of assets in view */\n\t\t$this->view->assetUrl = $this->_request->getBaseUrl() . '/assets/';\n\t\t\n\t\t/* Addicting custom helper path */\n\t\t$this->view->addHelperPath(PLUGIN_DIR . 'Helpers/');\n\t}", "public function setup() { \n\t\t$this->auth_realm = CMS::$admin_realm;\n\t\treturn parent::setup()->use_views_from('../app/views'); \n\t}", "public function init()\n {\n \t$this->view->headTitle('Produktgruppen');\n\t\t$this->db = Zend_Registry::get('db');\n\t\t$this->logger = Zend_Registry::get('logger');\n }", "public function init() {\n \n // Instantiate the class\n (new MidrubBaseAdminCollectionFrontendControllers\\Init)->view();\n \n }", "public function createView(){\n\t\t$vue = new View(\"Create\");\n\t\t$vue->generer();\n\t}", "function __construct() {\r\n $this->view = new View();\r\n $this->deviceType = View::getInstance();\r\n }", "public function initialize()\n {\n // set base template\n $this->view->setTemplateBefore('default');\n }", "public function getView() {}", "public function getView() {}", "protected function makeViews()\n {\n new MakeView($this, $this->files);\n }", "public function __construct()\n {\n parent::__construct();\n $this->view->js = array('pizza/js/default.js',\n 'pizza/js/jquery.jeditable.min.js',\n '../public/js/jquery.goup.min.js');\n\n $this->view->css = array('pizza/css/default.css');\n }", "protected function setupLayout()\n {\n if ( ! is_null($this->layout))\n {\n $this->layout = view($this->layout);\n $this->layout->menus = Menu::getMenu() ;\n }\n }", "protected function setUp()\n {\n $this->view = new Zend_View();\n $this->helper = new Zend_View_Helper_HtmlFlash();\n $this->helper->setView($this->view);\n }", "public function display()\n \t{\n \t\t$this->assign(\"__view\", $this->_view);\n \t\tparent::display();\n \t}", "public function init()\n {\n parent::init();\n\n // Retrieving a field from the controller container and layout into this view.\n $this->add($this->fieldCtrl->getField('label'));\n }", "public function __construct() {\n // Pass in the base for all the views\n parent::__construct();\n\n $this->view_base = 'settings/authorized-users/';\n $this->title = _('Authorized Users') . ' | ' . _('Settings');\n }", "protected function setupLayout() {\n\t\tif (!is_null($this -> layout)) {\n\t\t\t$this -> layout = View::make($this -> layout);\n\t\t}\n\t}", "protected function setupLayout() {\n\t\tif ( ! is_null($this->layout)) {\n\n\n\t\t\t$cb_js_var = array(\n\t\t\t\t'site_url' => url('/'),\n\t\t\t\t'admin_url' => url('/admin'),\n\t\t\t\t'admin_assets_url' => asset('packages/vizioart/cookbook/'),\n\t\t\t\t'admin_api_url' => url('/admin/api')\n\t\t\t);\n\n\n\t\t\t$this->layout = View::make($this->layout, array(\n\t\t\t\t'cb_js_var' => $cb_js_var\n\t\t\t));\n\t\t}\n\t}", "public function init()\n {\n $this->sysConfig = Zend_Registry::get('sysConfig');\n\t\t$this->view->sysConfig = $this->sysConfig;\n\t\t\n\t\t$this->config = Zend_Registry::get('config');\n\t\t$this->view->config = $this->config;\n\t\t\n\t\t$this->db=Zend_Registry::get('db');\n\t\t\n\t\t//controller and action names\n\t\t$this->controllerName = $this->getRequest()->getControllerName();\n\t\t$this->view->controllerName = $this->controllerName;\n\t\t\n\t\t$this->actionName = $this->getRequest()->getActionName();\n\t\t$this->view->actionName = $this->actionName;\n\t\t\n\t\t$this->view->baseurl=$this->config->common->baseUrl.\"/\";\n\t\t$this->view->cssurl=$this->config->common->cssPath;\n\t\t$this->view->jsurl=$this->config->common->jsPath;\n\n $this->view->items = \"\";\n $this->view->dashboard = \"\";\n $this->view->cnews = \"\";\n $this->view->expenditure = \"\";\n \n \n }", "private static function view(): void\n {\n Debug::setBacklog();\n\n /**\n * Calls the methods to define and validate the template and view files.\n */\n self::viewCheckTemplateFile();\n self::viewDefineViewPath();\n self::viewCheckFileExists();\n\n /**\n * Calls the method that will import the template file to be returned to the request.\n */\n self::viewRequireTemplate(\n new ViewHelper(\n self::$routeController->getResultData(),\n self::$viewPath\n ),\n );\n }", "public function setUp()\n {\n Time::setToStringFormat('yyyy-MM-dd HH:mm:ss');\n $this->request = new Request();\n $this->response = new Response();\n $this->view = new PugView($this->request, $this->response);\n }", "protected function commonViewData() {\n //print \"Hello\";\n $this->viewModel->set(\"mainMenu\", array(\"Home\" => \"home\", \"Help\" => \"help\"));\n $this->viewModel->set(\"Basepath\", \"http://localhost/~georginfanger/georginfanger/\");\n }", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->data_view \t\t\t\t\t= parent::setupThemes();\n\t\t$this->data_view['client_index'] \t= $this->data_view['view_path'] . '.clients.index';\n\t\t$this->data_view['html_body_class'] = 'page-header-fixed page-quick-sidebar-over-content page-container-bg-solid page-sidebar-closed';\n\t\t$this->data_view['include'] \t\t= $this->data_view['view_path'] . '.sms';\n\t\t$this->noteFolder \t \t\t\t\t= public_path() . '/documents';\n\t\t//'pdf|doc|docx|gif|jpg|png'\n\t\t$this->prefixNoteFileName = \\Auth::id();\n\t}", "protected function setupLayout() {\n if (!is_null($this->layout)) $this->layout = View::make($this->layout);\n }", "public function launch()\r\n {\r\n // Extract data to be usable inside the view file\r\n extract($this->data);\r\n\r\n // Expected view file format is\r\n // viewfolder.viewfile\r\n $view_file = str_replace(\".\", \"/\", $this->view_file);\r\n\r\n // Require view\r\n require path('app').'/views/'.$view_file.'.php';\r\n }", "protected function set_up()\n {\n Zend_Registry::_unsetInstance();\n Zend_Dojo_View_Helper_Dojo::setUseDeclarative();\n\n $this->errors = [];\n $this->view = $this->getView();\n $this->decorator = new Zend_Dojo_Form_Decorator_DijitElement();\n $this->element = $this->getElement();\n $this->element->setView($this->view);\n $this->decorator->setElement($this->element);\n }", "public function init() {\n parent::init();\n $this->_breadcrumbs->append(array('Contact', array('action' => 'index', 'controller' => 'contact')));\n\n // Pass variables to view\n $baseUrl = $this->view->baseUrl();\n $this->view->headLink()->appendStylesheet(\"{$baseUrl}/stylesheets/cms_layout.css\", 'screen');\n $this->view->title = 'Contact DG Environment';\n $this->view->showLeftNavigation = true;\n }", "protected function setupLayout()\r\n\t{\r\n\t\tif ( ! is_null($this->layout))\r\n\t\t{\r\n\t\t\t$this->layout = View::make($this->layout);\r\n\t\t}\r\n\t}", "protected function setupLayout()\n\t{\n\t\tif (!is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "public function getView()\n {\n }", "public function view()\n\t{\n\t\t// TODO Implement\t\n\t}", "function index() {\n\n $this->view->render();\n\n }", "public function __construct( View $view ) {\n\t\t$this->view = $view;\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}" ]
[ "0.81184554", "0.81184554", "0.8021358", "0.7495072", "0.7486435", "0.74779695", "0.7349287", "0.7348084", "0.7343529", "0.7313897", "0.7200492", "0.71498567", "0.71445227", "0.71423405", "0.70986485", "0.70923644", "0.70853436", "0.7070219", "0.7059331", "0.70427984", "0.70369345", "0.7011118", "0.7006282", "0.70030856", "0.7000328", "0.6998977", "0.69926953", "0.6966993", "0.6949017", "0.69473815", "0.6942942", "0.69148344", "0.69148344", "0.69127125", "0.68934757", "0.6871464", "0.68650955", "0.68611664", "0.6859732", "0.68456703", "0.6839118", "0.68123233", "0.6803712", "0.6796979", "0.67949575", "0.67919916", "0.67860514", "0.6773742", "0.67640996", "0.6746652", "0.6744468", "0.6741197", "0.6737751", "0.67233527", "0.6711633", "0.6706395", "0.66777354", "0.66717863", "0.6671454", "0.6663901", "0.6652473", "0.6652473", "0.6648483", "0.6647316", "0.6645801", "0.6621078", "0.66115654", "0.6603116", "0.6595277", "0.65946144", "0.65899193", "0.656524", "0.6554518", "0.6550057", "0.65409523", "0.65405285", "0.6537589", "0.653543", "0.6534263", "0.652308", "0.6522465", "0.6521893", "0.65164053", "0.6513693", "0.6511916", "0.65113354", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888" ]
0.0
-1
Set up the View
public function myactivities() { $client_files_head = Array( "http://code.highcharts.com/highcharts.js", "http://code.highcharttable.org/master/jquery.highchartTable-min.js", "/js/highchart.js","/js/jquery.dataTables.js", "/css/jquery.dataTables_themeroller.css", "/css/demo_table.css"); $this->template->client_files_head = Utils::load_client_files($client_files_head); $this->template->content = View::instance('v_activities_myactivities'); $this->template->title = "My Activities"; # Build the query $q = "SELECT activities.activitytype, activities.activitytime, activities.caloriesburned, activities.date FROM activities WHERE user_id = ".$this->user->user_id; # Run the query $activities = DB::instance(DB_NAME)->select_rows($q); # Pass data to the View $this->template->content->activities = $activities; # Render the View echo $this->template; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initializeView() {}", "public function initializeView() {}", "protected function initializeView() {\n\t}", "protected function initializeStandaloneViewInstance() {}", "public function __construct()\n {\n $this->view = new View($this);\n }", "protected function setView()\n {\n $view = 'Src\\Modules\\\\' . $this->module_name . '\\Views\\\\' . $this->class . 'View';\n $this->view = new $view;\n \n $this->view->setData( $this->model->getData() );\n \n $this->view->run();\n }", "function __construct()\r\n {\r\n $this->view = new View();\r\n }", "public function init()\n {\n $this->getBootstrap()->bootstrap('view');\n $this->_view = $this->getBootstrap()->getResource('view');\n $this->setHeadLinks();\n }", "function __construct()\n {\n $this->view = new View();\n }", "public function setUp()\n\t{\n\t\t$this->view = new BaseView;\n\t}", "protected function _view()\r\n\t\t{\r\n\t\t\t((!is_object($this->_view)) ? $this->_view = init_class(VIEW_NAME) : '');\r\n\t\t}", "function __construct() {\n// \t\t$this -> view = new View();\n \t}", "private function setupViews()\n {\n // Sidebar\n View::composer('components.sidebar', \\App\\Http\\View\\Composers\\SidebarComposer::class);\n }", "protected function initializeView() {\n\t\t$this->view = t3lib_div::makeInstance('Tx_FormhandlerFluid_View_TemplateView');\n\t\t$this->controllerContext = Tx_FormhandlerFluid_Controller_Form::getControllerContext();\n\t\t$this->view->setControllerContext($this->controllerContext);\n\t\t\n\t\t// Set the view paths (usually done in controller but this view is not\n\t\t// always called from a controller (f.i. Tx_FormhandlerFluid_View_FluidMail)\n\t\t$this->settings = Tx_Formhandler_Globals::$settings;\n\t\tif (!empty($this->settings['templateRoot'])) {\n\t\t\t$path = Tx_Formhandler_StaticFuncs::resolvePath($this->settings['templateRoot']);\n\t\t\t$path = rtrim($path, '\\\\/').'/';\n\t\t\t$this->view->setTemplateRootPath($path.trim($this->settings['templateDir'], '\\\\/'));\n\t\t\t$this->view->setLayoutRootPath($path.trim($this->settings['layoutDir'], '\\\\/'));\n\t\t\t$this->view->setPartialRootPath($path.trim($this->settings['partialDir'], '\\\\/'));\n\t\t}\n\t\telseif ($this->settings['templateFile']) {\n\t\t\t$path = Tx_Formhandler_StaticFuncs::resolvePath($this->settings['templateFile']);\n\t\t\t$this->view->setTemplatePathAndFilename($path);\n\t\t} else {\n\t\t\tTx_Formhandler_StaticFuncs::throwException('no_template_file');\n\t\t}\n\t}", "public function __construct()\n {\n $this->view = new Views('about');\n }", "function __construct()\n {\n $this->view = new View(); \n }", "public function __construct()\n\t{\n\t\t$this->_view = new \\App\\View\\View('welcome'); \n\t}", "function __construct(){\n $this->view=new View(); \n }", "private function _initView()\n {\n App::front()->registerPlugin(new App_Controller_Plugin_View());\n }", "protected function _initView()\r\n {\r\n $view = new Zend_View();\r\n $view->doctype('XHTML1_STRICT');\r\n\r\n // Add it to the ViewRenderer\r\n $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');\r\n $viewRenderer->setView($view);\r\n\r\n $front = Zend_Controller_Front::getInstance();\r\n $router = $front->getRouter();\r\n $router->addRoute('products', new Zend_Controller_Router_Route('products/:slug', array('controller' => 'products', 'action' => 'details')));\r\n $router->addRoute('page', new Zend_Controller_Router_Route('page/:slug', array('controller' => 'page', 'action' => 'open')));\r\n\r\n return $view;\r\n }", "public function __construct(){\n //l'intensification de la classe view\n $this->view=new View();\n }", "protected function setupViewPath()\n\t{\n\t\tlist($packageName, $routeName) = [$this->packageName, \\Request::route()->getName()];\n\t\t$this->view = \"${packageName}::pages.$routeName\";\n\t}", "public function init()\n {\n Zend_Registry::set('view', new Omeka_View);\n }", "public function __construct()\r\n {\r\n $this->view = new stdClass;\r\n $this->view->placeHolder = $this->placeHolder;\r\n $this->view->settingOptionName = $this->settingOptionName;\r\n }", "protected function initView()\n {\n $view = $this->objectProviderService->get($this->resolveViewClassName());\n\n if (!$view instanceof ViewInterface) {\n throw new \\UnexpectedValueException(\n 'View \"' . get_class($view) . '\" does not implement Signature\\Mvc\\View\\ViewInterface.'\n );\n }\n\n $this->view = $view;\n\n // Assign basic view data\n $this->view->setViewData([\n 'moduleContext' => $this->getModuleContext(),\n 'config' => $this->configurationService->getConfig($this->getModuleContext()),\n 'resourceDir' => $this->getResourceDir(),\n 'templateDir' => $this->getTemplateDir(),\n ]);\n }", "public function initialize()\n {\n\t\tparent::initialize();\n\t\t$this->viewBuilder()->layout('admin');\n\t\t\n }", "public function init() {\n //En esta linea de código enviamos a las vistas la base de la URL\n //Para este Ejemplo quedaria http://localhost/ejemplo/public\n //El objeto view crea una interfaz entre el controlador y la vista.\n //La variable baseUrl es la que contendra la direccion del proyecto, esta variable \n //la creamos nosotros mismos. \n //$this->_request->getBaseUrl(); es el encargado de capturar la URL base y como vemos en la linea\n //es asignada a la variable baseUrl y esta a su vez es pasada a todas las vistas de este controlador.\n\n\n $this->view->baseUrl = $this->_request->getBaseUrl();\n }", "public function init()\n {\n $this->View()->addTemplateDir(dirname(__FILE__) . \"/Views/\");\n parent::init();\n }", "protected function _initView()\n\t{\n\t\t$view = new App_View();\n\t\t$view->doctype('XHTML1_STRICT');\n\n\t\t$view->addHelperPath(APPLICATION_PATH . '/views/helpers');\n\t\t$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');\n\t\t$viewRenderer->setView($view);\n\n\t\t\n\t\treturn $view;\n\t}", "public function createView();", "protected function setupLayout()\n\t{\n\t\tdefine(\"aol_institute\", 68);\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "public function init()\n {\n \tparent::init();\n \t$this->view->headTitle('Wedding Cakes');\n }", "protected function loadView()\n {\n }", "protected function loadView()\n {\n }", "public function setLibraryViewConfiguration()\r\n {\r\n // Gets the library configuration manager\r\n $this->libraryConfigurationManager = $this->getController()->getLibraryConfigurationManager();\r\n\r\n // Gets the view identifier\r\n $this->viewIdentifier = $this->libraryConfigurationManager->getViewIdentifier($this->viewType);\r\n\r\n // Gets the view configuration\r\n $this->libraryViewConfiguration = $this->libraryConfigurationManager->getViewConfiguration($this->viewIdentifier);\r\n }", "protected function setupLayout()\n\t{\n\t\t$button['text'] = \"login\";\n\t\t$button['url'] = route('login');\n\n\t\tif(Auth::check())\n\t\t{\n\t\t\t$button['text'] = \"logout\";\n\t\t\t$button['url'] = route('logout');\n\t\t\t$this->logged_in_user = Auth::user();\n\t\t\t$notif = new Notification();\n\t\t\t$notifications = $notif->getNotifications($this->logged_in_user->id);\n\t\t\t$new = 0;\n\t\t\tforeach ($notifications as $not) {\n\t\t\t\tif($not->seen == 0)\n\t\t\t\t{\n\t\t\t\t\t$new++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$rating_types = RatingType::getRatingTypes($this->logged_in_user->id);\n\n\t\t\tView::share('notifications', $notifications);\n\t\t\tView::share('new', $new);\n\t\t\tView::share('rating_types', $rating_types);\n\t\t\tView::share('logged_in_user', $this->logged_in_user);\n\t\t}\n\n\t\tView::share('button', $button);\n\t\tView::share('show_feed', $this->show_feed);\n\t\t//Get image path info for all poster and backdrop images\n\t\t$t = new TheMovieDb();\n \t\t$this->image_path_config = $t->getImgPath();\n\t\tView::share('image_path_config', $this->image_path_config);\n\n\n\t\t\n\n\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "public function __construct()\r\n\t\t{\r\n\t\t\t$this->view = new \\Core\\Libraries\\Gears;\r\n\t\t}", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->view = new ViewController();\t\t\n\t}", "public function __construct()\n {\n $view = new View('header',array('warning' => 'Login', 'heading' => 'Login'));\n $view->display();\n }", "protected function set_up()\n {\n $this->_object = new Zend_View_Helper_Gravatar();\n $this->_view = new Zend_View();\n $this->_view->doctype()->setDoctype(strtoupper(\"XHTML1_STRICT\"));\n $this->_object->setView($this->_view);\n\n if (isset($_SERVER['HTTPS'])) {\n unset($_SERVER['HTTPS']);\n }\n }", "public function init()\n\t{\n\n\t\tZend_Layout::startMvc(APPLICATION_PATH . '/layouts/');\n\n\t\t$ZL = Zend_Layout::getMvcInstance();\n\n\t\t$ZL->setViewSuffix('php');\n\t\t$view = Zend_Layout::getMvcInstance()->getView();\n\t\t//for layout setting -------- end --------------\n\n\t\tZend_Loader::loadClass('Zend_View');\n\n\t\t$this->view = new Zend_View();\n\t\t$this->view->setScriptPath(APPLICATION_PATH.'/views');\n\t\t$this->_getModel();\n\t\t$this->auth = new Zend_Session_Namespace('Zend_Auth');\n\t\t$controller = Zend_Controller_Front::getInstance();\n\t\t$this->view->baseUrl=$controller->getBaseUrl();\n\t////////////////////////////Module include//////////////////////\n\t\t$this->_loadModel('Users.php');\n\t\t\n\n\t//////////////// calendar////////////\n\t}", "public function init()\n {\n \t$this->view->layout = array();\n }", "function __construct()\n {\n $this->view = TemplatesFactory::templates();\n Sesion::init();\n }", "public function init()\n {\n\t\t$this->view->titleBrowser = 'e-Transporte';\n }", "public function __construct()\n {\n $this->view = 'frontend.contents.home';\n }", "public function __construct(){\n parent::__construct();\n \n // set the default template as the name of the view class\n $template = get_class($this);\n if(strtolower(substr($template, -4)) === 'view'){\n $template = substr($template, 0, strlen($template) - 4);\n }\n $this->template($template);\n }", "protected function setUp()\n {\n $this->view = new Zend_View();\n $this->helper = new Zend_View_Helper_FormImage();\n $this->helper->setView($this->view);\n }", "function init()\n\t{\n\t\t// Ghetto fix for formText problem\n\t\t$this->view->addHelperPath(ROOT_DIR . '/library/Zarrar/View/HelperFix', 'Zarrar_View_HelperFix');\n\t\t\n\t\t// Disable header file\n\t\t$this->view->headerFile = '_empty.phtml';\n\t\t\n\t\t// Add stylesheet for table\n\t\t$this->view\n\t\t\t->headLink()\n\t\t\t->appendStylesheet(\"{$this->view->dir_styles}/oranges-in-the-sky.css\");\n\t\t\t\n\t\t// Instantiate table for later usage\n\t\t$this->_table = new Study();\n\t}", "public function init()\n {\n $this->_helper->layout()->getView()->headTitle('@PHPoton');\n\n // Set navigation\n $container = Zend_Registry::get('navigation');\n $this->view->navigation(new Zend_Navigation($container));\n }", "public function initialize()\n {\n //$this->view->setTemplateBefore('public');\n }", "function __construct() {\n // Create a new instance of the corresponding view.\n $this->view = new View();\n // $this->session = new Session(); // Sessions still not working.\n }", "protected function initView()\n {\n $this->di->set('view', function () {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n $em = $this->getShared('eventsManager');\n\n $view = new View;\n $view->registerEngines([\n // Setting up Volt Engine\n // See https://docs.phalconphp.com/en/latest/reference/volt.html#setting-up-the-volt-engine\n '.volt' => function ($view, $di) {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n $volt = new VoltEngine($view, $di);\n\n $options = [\n 'compiledPath' => function ($templatePath) {\n /** @var DiInterface $this */\n $config = $this->getShared('config')->get('volt')->toArray();\n\n $filename = str_replace(\n ['\\\\', '/'],\n $config['separator'],\n trim(substr($templatePath, strlen(BASE_DIR)), '\\\\/')\n );\n $filename = basename($filename, '.volt') . $config['compiledExt'];\n\n return rtrim($config['cacheDir'], '\\\\/') . DIRECTORY_SEPARATOR . $filename;\n },\n 'compileAlways' => boolval($config->get('volt')->forceCompile),\n ];\n\n $volt->setOptions($options);\n\n $volt->getCompiler()->addFunction('number_format', function ($resolvedArgs) {\n return 'number_format(' . $resolvedArgs . ')';\n })->addFunction('chr', function ($resolvedArgs) {\n return 'chr(' . $resolvedArgs . ')';\n });\n\n return $volt;\n },\n // Setting up Php Engine\n '.phtml' => 'Phalcon\\Mvc\\View\\Engine\\Php'\n ]);\n\n $view->setViewsDir($config->get('application')->viewsDir);\n\n $that = $this;\n $em->attach('view', function ($event, $view) use ($that, $config) {\n /**\n * @var LoggerInterface $logger\n * @var View $view\n * @var Event $event\n * @var DiInterface $that\n */\n $logger = $that->get('logger');\n $logger->debug(sprintf('Event %s. Path: %s', $event->getType(), $view->getActiveRenderPath()));\n\n if ('notFoundView' == $event->getType()) {\n $message = sprintf('View not found: %s', $view->getActiveRenderPath());\n $logger->error($message);\n throw new ViewException($message);\n }\n });\n\n $view->setEventsManager($em);\n\n return $view;\n });\n }", "public function __construct()\n {\n $this->view = GeneralUtility::makeInstance(StandaloneView::class);\n $this->view->setPartialRootPaths($this->partialRootPaths);\n $this->view->setTemplateRootPaths($this->templateRootPaths);\n $this->view->setLayoutRootPaths($this->layoutRootPaths);\n $this->view->setTemplate($this->templateFile);\n $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);\n $this->docHeaderComponent = GeneralUtility::makeInstance(DocHeaderComponent::class);\n $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);\n }", "function abstractInit()\n\t{\n\t\t/* Setting base url in view */\n\t\t$this->view->baseUrl = $this->_request->getBaseUrl();\n\t\t\n\t\t/* Setting the name of current module in view */\n\t\t$this->view->currentModule = $this->_request->getModuleName();\n\t\t\n\t\t/* Setting the name of current controller in view */\n\t\t$this->view->currentController = $this->_request->getControllerName();\n\t\t\n\t\t/* Setting the name of current action in view */\n\t\t$this->view->currentAction = $this->_request->getActionName();\n\t\t\n\t\t/* Setting the base url of assets in view */\n\t\t$this->view->assetUrl = $this->_request->getBaseUrl() . '/assets/';\n\t\t\n\t\t/* Addicting custom helper path */\n\t\t$this->view->addHelperPath(PLUGIN_DIR . 'Helpers/');\n\t}", "public function setup() { \n\t\t$this->auth_realm = CMS::$admin_realm;\n\t\treturn parent::setup()->use_views_from('../app/views'); \n\t}", "public function init()\n {\n \t$this->view->headTitle('Produktgruppen');\n\t\t$this->db = Zend_Registry::get('db');\n\t\t$this->logger = Zend_Registry::get('logger');\n }", "public function init() {\n \n // Instantiate the class\n (new MidrubBaseAdminCollectionFrontendControllers\\Init)->view();\n \n }", "function __construct() {\r\n $this->view = new View();\r\n $this->deviceType = View::getInstance();\r\n }", "public function createView(){\n\t\t$vue = new View(\"Create\");\n\t\t$vue->generer();\n\t}", "public function initialize()\n {\n // set base template\n $this->view->setTemplateBefore('default');\n }", "public function getView() {}", "public function getView() {}", "public function __construct()\n {\n parent::__construct();\n $this->view->js = array('pizza/js/default.js',\n 'pizza/js/jquery.jeditable.min.js',\n '../public/js/jquery.goup.min.js');\n\n $this->view->css = array('pizza/css/default.css');\n }", "protected function makeViews()\n {\n new MakeView($this, $this->files);\n }", "protected function setupLayout()\n {\n if ( ! is_null($this->layout))\n {\n $this->layout = view($this->layout);\n $this->layout->menus = Menu::getMenu() ;\n }\n }", "protected function setUp()\n {\n $this->view = new Zend_View();\n $this->helper = new Zend_View_Helper_HtmlFlash();\n $this->helper->setView($this->view);\n }", "public function display()\n \t{\n \t\t$this->assign(\"__view\", $this->_view);\n \t\tparent::display();\n \t}", "public function init()\n {\n parent::init();\n\n // Retrieving a field from the controller container and layout into this view.\n $this->add($this->fieldCtrl->getField('label'));\n }", "public function __construct() {\n // Pass in the base for all the views\n parent::__construct();\n\n $this->view_base = 'settings/authorized-users/';\n $this->title = _('Authorized Users') . ' | ' . _('Settings');\n }", "protected function setupLayout() {\n\t\tif (!is_null($this -> layout)) {\n\t\t\t$this -> layout = View::make($this -> layout);\n\t\t}\n\t}", "protected function setupLayout() {\n\t\tif ( ! is_null($this->layout)) {\n\n\n\t\t\t$cb_js_var = array(\n\t\t\t\t'site_url' => url('/'),\n\t\t\t\t'admin_url' => url('/admin'),\n\t\t\t\t'admin_assets_url' => asset('packages/vizioart/cookbook/'),\n\t\t\t\t'admin_api_url' => url('/admin/api')\n\t\t\t);\n\n\n\t\t\t$this->layout = View::make($this->layout, array(\n\t\t\t\t'cb_js_var' => $cb_js_var\n\t\t\t));\n\t\t}\n\t}", "public function init()\n {\n $this->sysConfig = Zend_Registry::get('sysConfig');\n\t\t$this->view->sysConfig = $this->sysConfig;\n\t\t\n\t\t$this->config = Zend_Registry::get('config');\n\t\t$this->view->config = $this->config;\n\t\t\n\t\t$this->db=Zend_Registry::get('db');\n\t\t\n\t\t//controller and action names\n\t\t$this->controllerName = $this->getRequest()->getControllerName();\n\t\t$this->view->controllerName = $this->controllerName;\n\t\t\n\t\t$this->actionName = $this->getRequest()->getActionName();\n\t\t$this->view->actionName = $this->actionName;\n\t\t\n\t\t$this->view->baseurl=$this->config->common->baseUrl.\"/\";\n\t\t$this->view->cssurl=$this->config->common->cssPath;\n\t\t$this->view->jsurl=$this->config->common->jsPath;\n\n $this->view->items = \"\";\n $this->view->dashboard = \"\";\n $this->view->cnews = \"\";\n $this->view->expenditure = \"\";\n \n \n }", "private static function view(): void\n {\n Debug::setBacklog();\n\n /**\n * Calls the methods to define and validate the template and view files.\n */\n self::viewCheckTemplateFile();\n self::viewDefineViewPath();\n self::viewCheckFileExists();\n\n /**\n * Calls the method that will import the template file to be returned to the request.\n */\n self::viewRequireTemplate(\n new ViewHelper(\n self::$routeController->getResultData(),\n self::$viewPath\n ),\n );\n }", "public function setUp()\n {\n Time::setToStringFormat('yyyy-MM-dd HH:mm:ss');\n $this->request = new Request();\n $this->response = new Response();\n $this->view = new PugView($this->request, $this->response);\n }", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->data_view \t\t\t\t\t= parent::setupThemes();\n\t\t$this->data_view['client_index'] \t= $this->data_view['view_path'] . '.clients.index';\n\t\t$this->data_view['html_body_class'] = 'page-header-fixed page-quick-sidebar-over-content page-container-bg-solid page-sidebar-closed';\n\t\t$this->data_view['include'] \t\t= $this->data_view['view_path'] . '.sms';\n\t\t$this->noteFolder \t \t\t\t\t= public_path() . '/documents';\n\t\t//'pdf|doc|docx|gif|jpg|png'\n\t\t$this->prefixNoteFileName = \\Auth::id();\n\t}", "protected function commonViewData() {\n //print \"Hello\";\n $this->viewModel->set(\"mainMenu\", array(\"Home\" => \"home\", \"Help\" => \"help\"));\n $this->viewModel->set(\"Basepath\", \"http://localhost/~georginfanger/georginfanger/\");\n }", "protected function set_up()\n {\n Zend_Registry::_unsetInstance();\n Zend_Dojo_View_Helper_Dojo::setUseDeclarative();\n\n $this->errors = [];\n $this->view = $this->getView();\n $this->decorator = new Zend_Dojo_Form_Decorator_DijitElement();\n $this->element = $this->getElement();\n $this->element->setView($this->view);\n $this->decorator->setElement($this->element);\n }", "protected function setupLayout() {\n if (!is_null($this->layout)) $this->layout = View::make($this->layout);\n }", "public function launch()\r\n {\r\n // Extract data to be usable inside the view file\r\n extract($this->data);\r\n\r\n // Expected view file format is\r\n // viewfolder.viewfile\r\n $view_file = str_replace(\".\", \"/\", $this->view_file);\r\n\r\n // Require view\r\n require path('app').'/views/'.$view_file.'.php';\r\n }", "public function init() {\n parent::init();\n $this->_breadcrumbs->append(array('Contact', array('action' => 'index', 'controller' => 'contact')));\n\n // Pass variables to view\n $baseUrl = $this->view->baseUrl();\n $this->view->headLink()->appendStylesheet(\"{$baseUrl}/stylesheets/cms_layout.css\", 'screen');\n $this->view->title = 'Contact DG Environment';\n $this->view->showLeftNavigation = true;\n }", "protected function setupLayout()\r\n\t{\r\n\t\tif ( ! is_null($this->layout))\r\n\t\t{\r\n\t\t\t$this->layout = View::make($this->layout);\r\n\t\t}\r\n\t}", "protected function setupLayout()\n\t{\n\t\tif (!is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "public function getView()\n {\n }", "public function __construct( View $view ) {\n\t\t$this->view = $view;\n\t}", "public function view()\n\t{\n\t\t// TODO Implement\t\n\t}", "function index() {\n\n $this->view->render();\n\n }", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}" ]
[ "0.8117829", "0.8117829", "0.8020825", "0.749491", "0.7486882", "0.74765915", "0.7350456", "0.73497725", "0.7344746", "0.73157203", "0.7198995", "0.7151095", "0.7144292", "0.7140135", "0.7099746", "0.7093709", "0.7086563", "0.70709145", "0.7058408", "0.70425236", "0.7037591", "0.70107484", "0.70079696", "0.7004486", "0.6999473", "0.6998799", "0.69932896", "0.6966883", "0.69487756", "0.694568", "0.6943914", "0.69138044", "0.6912058", "0.6912058", "0.6895329", "0.6870062", "0.68677074", "0.6862712", "0.68609184", "0.6849502", "0.68394345", "0.68121713", "0.6806073", "0.6797994", "0.6796482", "0.6792041", "0.6788121", "0.67749316", "0.6764776", "0.6747586", "0.67461604", "0.67411494", "0.6738919", "0.67231846", "0.6712698", "0.67080796", "0.667681", "0.6673211", "0.66707355", "0.66645974", "0.6649689", "0.6649689", "0.66485375", "0.6648364", "0.6645069", "0.66238755", "0.6609944", "0.6601007", "0.6596572", "0.65941817", "0.6589198", "0.6565728", "0.65542334", "0.6553442", "0.6541628", "0.65393126", "0.65373945", "0.6536701", "0.6535526", "0.6524118", "0.65217763", "0.6521266", "0.6514137", "0.6514121", "0.6512927", "0.65107995", "0.65093374", "0.65093374", "0.65093374", "0.65093374", "0.65093374", "0.65093374", "0.65093374", "0.65093374", "0.65093374", "0.65093374", "0.65093374", "0.65093374", "0.65093374", "0.65093374", "0.65093374" ]
0.0
-1
Set up the View
public function users() { $this->template->content = View::instance("v_activities_users"); $this->template->title = "Users"; # Build the query to get all the users $q = "SELECT * FROM users"; # Execute the query to get all the users. # Store the result array in the variable $users $users = DB::instance(DB_NAME)->select_rows($q); # Build the query to figure out what connections does this user already have? # I.e. who are they following $q = "SELECT * FROM users_users WHERE user_id = ".$this->user->user_id; # Execute this query with the select_array method # select_array will return our results in an array and use the "users_id_followed" field as the index. # This will come in handy when we get to the view # Store our results (an array) in the variable $connections $connections = DB::instance(DB_NAME)->select_array($q, 'user_id_followed'); # Pass data (users and connections) to the view $this->template->content->users = $users; $this->template->content->connections = $connections; # Render the view echo $this->template; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initializeView() {}", "public function initializeView() {}", "protected function initializeView() {\n\t}", "protected function initializeStandaloneViewInstance() {}", "public function __construct()\n {\n $this->view = new View($this);\n }", "protected function setView()\n {\n $view = 'Src\\Modules\\\\' . $this->module_name . '\\Views\\\\' . $this->class . 'View';\n $this->view = new $view;\n \n $this->view->setData( $this->model->getData() );\n \n $this->view->run();\n }", "function __construct()\r\n {\r\n $this->view = new View();\r\n }", "public function init()\n {\n $this->getBootstrap()->bootstrap('view');\n $this->_view = $this->getBootstrap()->getResource('view');\n $this->setHeadLinks();\n }", "function __construct()\n {\n $this->view = new View();\n }", "public function setUp()\n\t{\n\t\t$this->view = new BaseView;\n\t}", "protected function _view()\r\n\t\t{\r\n\t\t\t((!is_object($this->_view)) ? $this->_view = init_class(VIEW_NAME) : '');\r\n\t\t}", "function __construct() {\n// \t\t$this -> view = new View();\n \t}", "private function setupViews()\n {\n // Sidebar\n View::composer('components.sidebar', \\App\\Http\\View\\Composers\\SidebarComposer::class);\n }", "protected function initializeView() {\n\t\t$this->view = t3lib_div::makeInstance('Tx_FormhandlerFluid_View_TemplateView');\n\t\t$this->controllerContext = Tx_FormhandlerFluid_Controller_Form::getControllerContext();\n\t\t$this->view->setControllerContext($this->controllerContext);\n\t\t\n\t\t// Set the view paths (usually done in controller but this view is not\n\t\t// always called from a controller (f.i. Tx_FormhandlerFluid_View_FluidMail)\n\t\t$this->settings = Tx_Formhandler_Globals::$settings;\n\t\tif (!empty($this->settings['templateRoot'])) {\n\t\t\t$path = Tx_Formhandler_StaticFuncs::resolvePath($this->settings['templateRoot']);\n\t\t\t$path = rtrim($path, '\\\\/').'/';\n\t\t\t$this->view->setTemplateRootPath($path.trim($this->settings['templateDir'], '\\\\/'));\n\t\t\t$this->view->setLayoutRootPath($path.trim($this->settings['layoutDir'], '\\\\/'));\n\t\t\t$this->view->setPartialRootPath($path.trim($this->settings['partialDir'], '\\\\/'));\n\t\t}\n\t\telseif ($this->settings['templateFile']) {\n\t\t\t$path = Tx_Formhandler_StaticFuncs::resolvePath($this->settings['templateFile']);\n\t\t\t$this->view->setTemplatePathAndFilename($path);\n\t\t} else {\n\t\t\tTx_Formhandler_StaticFuncs::throwException('no_template_file');\n\t\t}\n\t}", "public function __construct()\n {\n $this->view = new Views('about');\n }", "function __construct()\n {\n $this->view = new View(); \n }", "public function __construct()\n\t{\n\t\t$this->_view = new \\App\\View\\View('welcome'); \n\t}", "function __construct(){\n $this->view=new View(); \n }", "private function _initView()\n {\n App::front()->registerPlugin(new App_Controller_Plugin_View());\n }", "protected function _initView()\r\n {\r\n $view = new Zend_View();\r\n $view->doctype('XHTML1_STRICT');\r\n\r\n // Add it to the ViewRenderer\r\n $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');\r\n $viewRenderer->setView($view);\r\n\r\n $front = Zend_Controller_Front::getInstance();\r\n $router = $front->getRouter();\r\n $router->addRoute('products', new Zend_Controller_Router_Route('products/:slug', array('controller' => 'products', 'action' => 'details')));\r\n $router->addRoute('page', new Zend_Controller_Router_Route('page/:slug', array('controller' => 'page', 'action' => 'open')));\r\n\r\n return $view;\r\n }", "public function __construct(){\n //l'intensification de la classe view\n $this->view=new View();\n }", "protected function setupViewPath()\n\t{\n\t\tlist($packageName, $routeName) = [$this->packageName, \\Request::route()->getName()];\n\t\t$this->view = \"${packageName}::pages.$routeName\";\n\t}", "public function init()\n {\n Zend_Registry::set('view', new Omeka_View);\n }", "public function __construct()\r\n {\r\n $this->view = new stdClass;\r\n $this->view->placeHolder = $this->placeHolder;\r\n $this->view->settingOptionName = $this->settingOptionName;\r\n }", "protected function initView()\n {\n $view = $this->objectProviderService->get($this->resolveViewClassName());\n\n if (!$view instanceof ViewInterface) {\n throw new \\UnexpectedValueException(\n 'View \"' . get_class($view) . '\" does not implement Signature\\Mvc\\View\\ViewInterface.'\n );\n }\n\n $this->view = $view;\n\n // Assign basic view data\n $this->view->setViewData([\n 'moduleContext' => $this->getModuleContext(),\n 'config' => $this->configurationService->getConfig($this->getModuleContext()),\n 'resourceDir' => $this->getResourceDir(),\n 'templateDir' => $this->getTemplateDir(),\n ]);\n }", "public function initialize()\n {\n\t\tparent::initialize();\n\t\t$this->viewBuilder()->layout('admin');\n\t\t\n }", "public function init() {\n //En esta linea de código enviamos a las vistas la base de la URL\n //Para este Ejemplo quedaria http://localhost/ejemplo/public\n //El objeto view crea una interfaz entre el controlador y la vista.\n //La variable baseUrl es la que contendra la direccion del proyecto, esta variable \n //la creamos nosotros mismos. \n //$this->_request->getBaseUrl(); es el encargado de capturar la URL base y como vemos en la linea\n //es asignada a la variable baseUrl y esta a su vez es pasada a todas las vistas de este controlador.\n\n\n $this->view->baseUrl = $this->_request->getBaseUrl();\n }", "public function init()\n {\n $this->View()->addTemplateDir(dirname(__FILE__) . \"/Views/\");\n parent::init();\n }", "protected function _initView()\n\t{\n\t\t$view = new App_View();\n\t\t$view->doctype('XHTML1_STRICT');\n\n\t\t$view->addHelperPath(APPLICATION_PATH . '/views/helpers');\n\t\t$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');\n\t\t$viewRenderer->setView($view);\n\n\t\t\n\t\treturn $view;\n\t}", "public function createView();", "protected function setupLayout()\n\t{\n\t\tdefine(\"aol_institute\", 68);\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function loadView()\n {\n }", "protected function loadView()\n {\n }", "public function init()\n {\n \tparent::init();\n \t$this->view->headTitle('Wedding Cakes');\n }", "public function setLibraryViewConfiguration()\r\n {\r\n // Gets the library configuration manager\r\n $this->libraryConfigurationManager = $this->getController()->getLibraryConfigurationManager();\r\n\r\n // Gets the view identifier\r\n $this->viewIdentifier = $this->libraryConfigurationManager->getViewIdentifier($this->viewType);\r\n\r\n // Gets the view configuration\r\n $this->libraryViewConfiguration = $this->libraryConfigurationManager->getViewConfiguration($this->viewIdentifier);\r\n }", "protected function setupLayout()\n\t{\n\t\t$button['text'] = \"login\";\n\t\t$button['url'] = route('login');\n\n\t\tif(Auth::check())\n\t\t{\n\t\t\t$button['text'] = \"logout\";\n\t\t\t$button['url'] = route('logout');\n\t\t\t$this->logged_in_user = Auth::user();\n\t\t\t$notif = new Notification();\n\t\t\t$notifications = $notif->getNotifications($this->logged_in_user->id);\n\t\t\t$new = 0;\n\t\t\tforeach ($notifications as $not) {\n\t\t\t\tif($not->seen == 0)\n\t\t\t\t{\n\t\t\t\t\t$new++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$rating_types = RatingType::getRatingTypes($this->logged_in_user->id);\n\n\t\t\tView::share('notifications', $notifications);\n\t\t\tView::share('new', $new);\n\t\t\tView::share('rating_types', $rating_types);\n\t\t\tView::share('logged_in_user', $this->logged_in_user);\n\t\t}\n\n\t\tView::share('button', $button);\n\t\tView::share('show_feed', $this->show_feed);\n\t\t//Get image path info for all poster and backdrop images\n\t\t$t = new TheMovieDb();\n \t\t$this->image_path_config = $t->getImgPath();\n\t\tView::share('image_path_config', $this->image_path_config);\n\n\n\t\t\n\n\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "public function __construct()\r\n\t\t{\r\n\t\t\t$this->view = new \\Core\\Libraries\\Gears;\r\n\t\t}", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->view = new ViewController();\t\t\n\t}", "public function __construct()\n {\n $view = new View('header',array('warning' => 'Login', 'heading' => 'Login'));\n $view->display();\n }", "protected function set_up()\n {\n $this->_object = new Zend_View_Helper_Gravatar();\n $this->_view = new Zend_View();\n $this->_view->doctype()->setDoctype(strtoupper(\"XHTML1_STRICT\"));\n $this->_object->setView($this->_view);\n\n if (isset($_SERVER['HTTPS'])) {\n unset($_SERVER['HTTPS']);\n }\n }", "public function init()\n\t{\n\n\t\tZend_Layout::startMvc(APPLICATION_PATH . '/layouts/');\n\n\t\t$ZL = Zend_Layout::getMvcInstance();\n\n\t\t$ZL->setViewSuffix('php');\n\t\t$view = Zend_Layout::getMvcInstance()->getView();\n\t\t//for layout setting -------- end --------------\n\n\t\tZend_Loader::loadClass('Zend_View');\n\n\t\t$this->view = new Zend_View();\n\t\t$this->view->setScriptPath(APPLICATION_PATH.'/views');\n\t\t$this->_getModel();\n\t\t$this->auth = new Zend_Session_Namespace('Zend_Auth');\n\t\t$controller = Zend_Controller_Front::getInstance();\n\t\t$this->view->baseUrl=$controller->getBaseUrl();\n\t////////////////////////////Module include//////////////////////\n\t\t$this->_loadModel('Users.php');\n\t\t\n\n\t//////////////// calendar////////////\n\t}", "public function init()\n {\n \t$this->view->layout = array();\n }", "function __construct()\n {\n $this->view = TemplatesFactory::templates();\n Sesion::init();\n }", "public function init()\n {\n\t\t$this->view->titleBrowser = 'e-Transporte';\n }", "public function __construct()\n {\n $this->view = 'frontend.contents.home';\n }", "public function __construct(){\n parent::__construct();\n \n // set the default template as the name of the view class\n $template = get_class($this);\n if(strtolower(substr($template, -4)) === 'view'){\n $template = substr($template, 0, strlen($template) - 4);\n }\n $this->template($template);\n }", "protected function setUp()\n {\n $this->view = new Zend_View();\n $this->helper = new Zend_View_Helper_FormImage();\n $this->helper->setView($this->view);\n }", "function init()\n\t{\n\t\t// Ghetto fix for formText problem\n\t\t$this->view->addHelperPath(ROOT_DIR . '/library/Zarrar/View/HelperFix', 'Zarrar_View_HelperFix');\n\t\t\n\t\t// Disable header file\n\t\t$this->view->headerFile = '_empty.phtml';\n\t\t\n\t\t// Add stylesheet for table\n\t\t$this->view\n\t\t\t->headLink()\n\t\t\t->appendStylesheet(\"{$this->view->dir_styles}/oranges-in-the-sky.css\");\n\t\t\t\n\t\t// Instantiate table for later usage\n\t\t$this->_table = new Study();\n\t}", "public function init()\n {\n $this->_helper->layout()->getView()->headTitle('@PHPoton');\n\n // Set navigation\n $container = Zend_Registry::get('navigation');\n $this->view->navigation(new Zend_Navigation($container));\n }", "public function initialize()\n {\n //$this->view->setTemplateBefore('public');\n }", "function __construct() {\n // Create a new instance of the corresponding view.\n $this->view = new View();\n // $this->session = new Session(); // Sessions still not working.\n }", "protected function initView()\n {\n $this->di->set('view', function () {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n $em = $this->getShared('eventsManager');\n\n $view = new View;\n $view->registerEngines([\n // Setting up Volt Engine\n // See https://docs.phalconphp.com/en/latest/reference/volt.html#setting-up-the-volt-engine\n '.volt' => function ($view, $di) {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n $volt = new VoltEngine($view, $di);\n\n $options = [\n 'compiledPath' => function ($templatePath) {\n /** @var DiInterface $this */\n $config = $this->getShared('config')->get('volt')->toArray();\n\n $filename = str_replace(\n ['\\\\', '/'],\n $config['separator'],\n trim(substr($templatePath, strlen(BASE_DIR)), '\\\\/')\n );\n $filename = basename($filename, '.volt') . $config['compiledExt'];\n\n return rtrim($config['cacheDir'], '\\\\/') . DIRECTORY_SEPARATOR . $filename;\n },\n 'compileAlways' => boolval($config->get('volt')->forceCompile),\n ];\n\n $volt->setOptions($options);\n\n $volt->getCompiler()->addFunction('number_format', function ($resolvedArgs) {\n return 'number_format(' . $resolvedArgs . ')';\n })->addFunction('chr', function ($resolvedArgs) {\n return 'chr(' . $resolvedArgs . ')';\n });\n\n return $volt;\n },\n // Setting up Php Engine\n '.phtml' => 'Phalcon\\Mvc\\View\\Engine\\Php'\n ]);\n\n $view->setViewsDir($config->get('application')->viewsDir);\n\n $that = $this;\n $em->attach('view', function ($event, $view) use ($that, $config) {\n /**\n * @var LoggerInterface $logger\n * @var View $view\n * @var Event $event\n * @var DiInterface $that\n */\n $logger = $that->get('logger');\n $logger->debug(sprintf('Event %s. Path: %s', $event->getType(), $view->getActiveRenderPath()));\n\n if ('notFoundView' == $event->getType()) {\n $message = sprintf('View not found: %s', $view->getActiveRenderPath());\n $logger->error($message);\n throw new ViewException($message);\n }\n });\n\n $view->setEventsManager($em);\n\n return $view;\n });\n }", "public function __construct()\n {\n $this->view = GeneralUtility::makeInstance(StandaloneView::class);\n $this->view->setPartialRootPaths($this->partialRootPaths);\n $this->view->setTemplateRootPaths($this->templateRootPaths);\n $this->view->setLayoutRootPaths($this->layoutRootPaths);\n $this->view->setTemplate($this->templateFile);\n $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);\n $this->docHeaderComponent = GeneralUtility::makeInstance(DocHeaderComponent::class);\n $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);\n }", "function abstractInit()\n\t{\n\t\t/* Setting base url in view */\n\t\t$this->view->baseUrl = $this->_request->getBaseUrl();\n\t\t\n\t\t/* Setting the name of current module in view */\n\t\t$this->view->currentModule = $this->_request->getModuleName();\n\t\t\n\t\t/* Setting the name of current controller in view */\n\t\t$this->view->currentController = $this->_request->getControllerName();\n\t\t\n\t\t/* Setting the name of current action in view */\n\t\t$this->view->currentAction = $this->_request->getActionName();\n\t\t\n\t\t/* Setting the base url of assets in view */\n\t\t$this->view->assetUrl = $this->_request->getBaseUrl() . '/assets/';\n\t\t\n\t\t/* Addicting custom helper path */\n\t\t$this->view->addHelperPath(PLUGIN_DIR . 'Helpers/');\n\t}", "public function setup() { \n\t\t$this->auth_realm = CMS::$admin_realm;\n\t\treturn parent::setup()->use_views_from('../app/views'); \n\t}", "public function init()\n {\n \t$this->view->headTitle('Produktgruppen');\n\t\t$this->db = Zend_Registry::get('db');\n\t\t$this->logger = Zend_Registry::get('logger');\n }", "public function init() {\n \n // Instantiate the class\n (new MidrubBaseAdminCollectionFrontendControllers\\Init)->view();\n \n }", "public function createView(){\n\t\t$vue = new View(\"Create\");\n\t\t$vue->generer();\n\t}", "function __construct() {\r\n $this->view = new View();\r\n $this->deviceType = View::getInstance();\r\n }", "public function initialize()\n {\n // set base template\n $this->view->setTemplateBefore('default');\n }", "public function getView() {}", "public function getView() {}", "protected function makeViews()\n {\n new MakeView($this, $this->files);\n }", "public function __construct()\n {\n parent::__construct();\n $this->view->js = array('pizza/js/default.js',\n 'pizza/js/jquery.jeditable.min.js',\n '../public/js/jquery.goup.min.js');\n\n $this->view->css = array('pizza/css/default.css');\n }", "protected function setupLayout()\n {\n if ( ! is_null($this->layout))\n {\n $this->layout = view($this->layout);\n $this->layout->menus = Menu::getMenu() ;\n }\n }", "protected function setUp()\n {\n $this->view = new Zend_View();\n $this->helper = new Zend_View_Helper_HtmlFlash();\n $this->helper->setView($this->view);\n }", "public function display()\n \t{\n \t\t$this->assign(\"__view\", $this->_view);\n \t\tparent::display();\n \t}", "public function init()\n {\n parent::init();\n\n // Retrieving a field from the controller container and layout into this view.\n $this->add($this->fieldCtrl->getField('label'));\n }", "public function __construct() {\n // Pass in the base for all the views\n parent::__construct();\n\n $this->view_base = 'settings/authorized-users/';\n $this->title = _('Authorized Users') . ' | ' . _('Settings');\n }", "protected function setupLayout() {\n\t\tif (!is_null($this -> layout)) {\n\t\t\t$this -> layout = View::make($this -> layout);\n\t\t}\n\t}", "protected function setupLayout() {\n\t\tif ( ! is_null($this->layout)) {\n\n\n\t\t\t$cb_js_var = array(\n\t\t\t\t'site_url' => url('/'),\n\t\t\t\t'admin_url' => url('/admin'),\n\t\t\t\t'admin_assets_url' => asset('packages/vizioart/cookbook/'),\n\t\t\t\t'admin_api_url' => url('/admin/api')\n\t\t\t);\n\n\n\t\t\t$this->layout = View::make($this->layout, array(\n\t\t\t\t'cb_js_var' => $cb_js_var\n\t\t\t));\n\t\t}\n\t}", "public function init()\n {\n $this->sysConfig = Zend_Registry::get('sysConfig');\n\t\t$this->view->sysConfig = $this->sysConfig;\n\t\t\n\t\t$this->config = Zend_Registry::get('config');\n\t\t$this->view->config = $this->config;\n\t\t\n\t\t$this->db=Zend_Registry::get('db');\n\t\t\n\t\t//controller and action names\n\t\t$this->controllerName = $this->getRequest()->getControllerName();\n\t\t$this->view->controllerName = $this->controllerName;\n\t\t\n\t\t$this->actionName = $this->getRequest()->getActionName();\n\t\t$this->view->actionName = $this->actionName;\n\t\t\n\t\t$this->view->baseurl=$this->config->common->baseUrl.\"/\";\n\t\t$this->view->cssurl=$this->config->common->cssPath;\n\t\t$this->view->jsurl=$this->config->common->jsPath;\n\n $this->view->items = \"\";\n $this->view->dashboard = \"\";\n $this->view->cnews = \"\";\n $this->view->expenditure = \"\";\n \n \n }", "private static function view(): void\n {\n Debug::setBacklog();\n\n /**\n * Calls the methods to define and validate the template and view files.\n */\n self::viewCheckTemplateFile();\n self::viewDefineViewPath();\n self::viewCheckFileExists();\n\n /**\n * Calls the method that will import the template file to be returned to the request.\n */\n self::viewRequireTemplate(\n new ViewHelper(\n self::$routeController->getResultData(),\n self::$viewPath\n ),\n );\n }", "public function setUp()\n {\n Time::setToStringFormat('yyyy-MM-dd HH:mm:ss');\n $this->request = new Request();\n $this->response = new Response();\n $this->view = new PugView($this->request, $this->response);\n }", "protected function commonViewData() {\n //print \"Hello\";\n $this->viewModel->set(\"mainMenu\", array(\"Home\" => \"home\", \"Help\" => \"help\"));\n $this->viewModel->set(\"Basepath\", \"http://localhost/~georginfanger/georginfanger/\");\n }", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->data_view \t\t\t\t\t= parent::setupThemes();\n\t\t$this->data_view['client_index'] \t= $this->data_view['view_path'] . '.clients.index';\n\t\t$this->data_view['html_body_class'] = 'page-header-fixed page-quick-sidebar-over-content page-container-bg-solid page-sidebar-closed';\n\t\t$this->data_view['include'] \t\t= $this->data_view['view_path'] . '.sms';\n\t\t$this->noteFolder \t \t\t\t\t= public_path() . '/documents';\n\t\t//'pdf|doc|docx|gif|jpg|png'\n\t\t$this->prefixNoteFileName = \\Auth::id();\n\t}", "protected function setupLayout() {\n if (!is_null($this->layout)) $this->layout = View::make($this->layout);\n }", "public function launch()\r\n {\r\n // Extract data to be usable inside the view file\r\n extract($this->data);\r\n\r\n // Expected view file format is\r\n // viewfolder.viewfile\r\n $view_file = str_replace(\".\", \"/\", $this->view_file);\r\n\r\n // Require view\r\n require path('app').'/views/'.$view_file.'.php';\r\n }", "protected function set_up()\n {\n Zend_Registry::_unsetInstance();\n Zend_Dojo_View_Helper_Dojo::setUseDeclarative();\n\n $this->errors = [];\n $this->view = $this->getView();\n $this->decorator = new Zend_Dojo_Form_Decorator_DijitElement();\n $this->element = $this->getElement();\n $this->element->setView($this->view);\n $this->decorator->setElement($this->element);\n }", "public function init() {\n parent::init();\n $this->_breadcrumbs->append(array('Contact', array('action' => 'index', 'controller' => 'contact')));\n\n // Pass variables to view\n $baseUrl = $this->view->baseUrl();\n $this->view->headLink()->appendStylesheet(\"{$baseUrl}/stylesheets/cms_layout.css\", 'screen');\n $this->view->title = 'Contact DG Environment';\n $this->view->showLeftNavigation = true;\n }", "protected function setupLayout()\r\n\t{\r\n\t\tif ( ! is_null($this->layout))\r\n\t\t{\r\n\t\t\t$this->layout = View::make($this->layout);\r\n\t\t}\r\n\t}", "protected function setupLayout()\n\t{\n\t\tif (!is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "public function getView()\n {\n }", "public function view()\n\t{\n\t\t// TODO Implement\t\n\t}", "function index() {\n\n $this->view->render();\n\n }", "public function __construct( View $view ) {\n\t\t$this->view = $view;\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}" ]
[ "0.81184554", "0.81184554", "0.8021358", "0.7495072", "0.7486435", "0.74779695", "0.7349287", "0.7348084", "0.7343529", "0.7313897", "0.7200492", "0.71498567", "0.71445227", "0.71423405", "0.70986485", "0.70923644", "0.70853436", "0.7070219", "0.7059331", "0.70427984", "0.70369345", "0.7011118", "0.7006282", "0.70030856", "0.7000328", "0.6998977", "0.69926953", "0.6966993", "0.6949017", "0.69473815", "0.6942942", "0.69148344", "0.69148344", "0.69127125", "0.68934757", "0.6871464", "0.68650955", "0.68611664", "0.6859732", "0.68456703", "0.6839118", "0.68123233", "0.6803712", "0.6796979", "0.67949575", "0.67919916", "0.67860514", "0.6773742", "0.67640996", "0.6746652", "0.6744468", "0.6741197", "0.6737751", "0.67233527", "0.6711633", "0.6706395", "0.66777354", "0.66717863", "0.6671454", "0.6663901", "0.6652473", "0.6652473", "0.6648483", "0.6647316", "0.6645801", "0.6621078", "0.66115654", "0.6603116", "0.6595277", "0.65946144", "0.65899193", "0.656524", "0.6554518", "0.6550057", "0.65409523", "0.65405285", "0.6537589", "0.653543", "0.6534263", "0.652308", "0.6522465", "0.6521893", "0.65164053", "0.6513693", "0.6511916", "0.65113354", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888", "0.6509888" ]
0.0
-1
Prepare the data array to be inserted
public function follow($user_id_followed) { $data = Array( "created" => Time::now(), "user_id" => $this->user->user_id, "user_id_followed" => $user_id_followed ); # Do the insert DB::instance(DB_NAME)->insert('users_users', $data); # Send them back Router::redirect("/activities/users"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function prepare_data(&$data_arr);", "abstract public function prepareData();", "private function prepare_data(){\r\n\t\t\t$this->data_table['cols'] = array();\r\n\t\t\t\r\n\t\t\tforeach($this->columns as $column_id => $column_info){\r\n\t\t\t\tswitch($column_info['type']){\r\n\t\t\t\t\tcase 'number':\r\n\t\t\t\t\tcase 'float':\r\n\t\t\t\t\tcase 'currency':\r\n\t\t\t\t\t\t$column_info['type'] = 'number';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$column_info['type'] = 'string';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->data_table['cols'][] = array_merge(array('id' => $column_id), $column_info);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$rows_count = sizeof(reset($this->data));\r\n\t\t\t\r\n\t\t\tfor($i = 0; $i < $rows_count; $i++){\r\n\t\t\t\t$c = array();\r\n\t\t\t\t\r\n\t\t\t\tforeach($this->columns as $column_id => $column_info){\r\n\t\t\t\t\t$value = $this->data[$column_id][$i];\r\n\t\t\t\t\t$c[] = array('v' => $value);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->data_table['rows'][] = array('c' => $c);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->data_table = json_encode($this->data_table);\r\n\t\t}", "public function prepare(array $data);", "abstract protected function prepareData( $data );", "protected function preprocessData() {}", "public function prepareBeforeCreate(array $data): array\n {\n return $data;\n }", "public function prepareData(): array\n {\n return [];\n }", "function prepareData()\r\n\t{\r\n\t\treturn true;\r\n\t}", "function prepareData(){\n $this->ref = array();\n foreach($this->getIterator() as $junk=>$item){\n // current values\n $id = $item[$this->id_field];\n \n // save item\n $this->items[$id] = $item;\n \n // save relation\n if(isset($item[$this->parent_id_field])) {\n $this->ref[$item[$this->parent_id_field]][] = $id;\n } else {\n $this->ref[undefined][] = $id;\n }\n }\n }", "protected function prepareData()\n {\n parent::prepareData();\n $this->prepareConfigurableProductOptions();\n $this->prepareAttributeSet();\n }", "function insertArray($data) {\n\t\t$ar = array();\n\t\t$str = '';\n\t\t$str1 = '';\n\t\tforeach($data as $key=>$value)\n\t\t{\n\t\t\tif(empty($str))\n\t\t\t{\n\t\t\t\t$str1 = $key;\n\t\t\t\t$str = '\"'.strip_tags(trim($value)).'\"';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$str1 = ','.$key;\n\t\t\t\t$str .=' ,\"'.strip_tags(trim($value)).'\"';\n\t\t\t}\n\t\t}\n\t\t$ar['fields'] = $str1;\n\t\t$ar['values'] = $str;\n\t\treturn $ar;\n\t}", "public function addToInsertSQLArray();", "abstract protected function prepareVars(array $data);", "private function _fill_insert_data() {\n $data = array();\n $data['numero_ticket'] = $this->_generate_numero_ticket();\n $data['descripcion'] = $this->post('descripcion');\n $data['soporte_categoria_id'] = $this->post('soporte_categoria_id');\n $data['persona_id'] = get_persona_id();\n $data['created_at'] = date('Y-m-d H:i:s');\n $data['status'] = 1;\n return $data;\n }", "public function populateFromArray($dataToInsert)\n\t{\n\t\tglobal $atlas;\n\t\t//insert to temporary table\n\t\t$query = \"INSERT INTO $this->tableName (\" . implode(',', array_keys($this->columns)) . \") VALUES \";\n\t\n\t\tforeach ($dataToInsert as $row)\n\t\t{\n\t\t\t$toAdd = \"\";\n\t\t\tforeach ($this->columns AS $col => $type)\n\t\t\t{\n\t\t\t\tif( is_array($row[$col]) ) // Handle array for multivalueds fields - gsalameh\n\t\t\t\t{\n\t\t\t\t\t$toAdd .= ',' . $this->quoteSmart( implode(',', $row[$col]) );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$toAdd .= ',' . $this->quoteSmart($row[$col]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$query .= '(' . substr($toAdd, 1) . '),';\n\t\t}\n\t\n\t\t//remnove last Comma\n\t\t$query = substr($query, 0, -1);\n\t\n\t\t\\DB::statement($query);\n\t\n\t\treturn true;\n\t}", "function prepare_insert($data = []){\n // if there is no data to set, then return an empty string\n if($data == []){\n return '';\n }\n $set_sql = $this->create_set($data);\n // check again to make sure there were proper columns listed in the SET\n if(strlen($set_sql) == 0){\n return '';\n }\n $return_string = \"INSERT INTO {$this->table_name} $set_sql;\";\n return $return_string;\n }", "protected function prepareData(array $data)\n {\n $data['original_text'] = $data['text'];\n $data['text'] = $this->stringProcessor ? $this->stringProcessor->prepare($data['text']) : $data['text'];\n return $data;\n }", "protected function prepare() \n {\n $this->array = new ArrayNode;\n }", "public function exchanegArray($_data)\n {\n $this->branch_no = (int) gv('branch_no', $_data);\n $this->branch_name = (string) gv('branch_name', $_data);\n $this->abbr_name = (string) gv('abbr_name', $_data);\n $this->timezone = (string) gv('timezone', $_data);\n $this->phone = (string) gv('phone', $_data);\n $this->address = (string) gv('address', $_data);\n $this->update_time = (string) gv('update_time', $_data);\n }", "private function _prepareInsertString($data) {\n /**\n * @ Incoming $data looks like:\n * $data = array('field' => 'value', 'field2'=> 'value2');\n */\n return array(\n 'names' => implode(\", \", array_keys($data)),\n 'values' => ':' . implode(', :', array_keys($data))\n );\n }", "public function insert(array $data);", "public function insert(array $data);", "public function prepareData($data)\n\t{\t\n\t\t/**\n\t\t * Fill the data (specially for the 'active', 'inactive', 'supporter' and 'newsletter':\n\t\t * they could not exist in the array when the box is not checked and in this case, the default value would be\n\t\t * used instead of the '0' one\n\t\t */\n\t\tarray_key_exists('active', $data) ? $data['active'] = '1' : $data['active'] = '0';\n\t\tarray_key_exists('inactive', $data) ? $data['inactive'] = '1' : $data['inactive'] = '0';\n\t\tarray_key_exists('supporter', $data) ? $data['supporter'] = '1' : $data['supporter'] = '0';\n\t\tarray_key_exists('newsletter', $data) ? $data['newsletter'] = '1' : $data['newsletter'] = '0';\n\n\t\treturn $data;\n\t}", "public function prep_values($data, $type='insert') {\n $fields = '';\n $placeholders = '';\n $values = [];\n\n foreach ($data as $field => $value) {\n $fields .= \"{$field},\";\n $values[] = $value;\n\n if ($type == 'update') {\n $placeholders .= $field . '=?,';\n } else {\n $placeholders .= '?,';\n }\n }\n\n $fields = substr($fields, 0, -1);\n $placeholders = substr($placeholders, 0, -1);\n\n // $values = $this->htmlchars($values);\n\n return array($fields, $placeholders, $values);\n }", "private function _prepareRow($array){\n return array_merge($this->_blankRow, $array);\n }", "function prepData($data)\r\n {\r\n \t$data['data']['Question']['master'] = $data['form']['master'];\r\n\t$data['data']['Question']['type'] = $data['form']['type'];\r\n\t$data['data']['Question']['count'] = $data['form']['data']['Question']['count'];\r\n\r\n\treturn $data;\r\n }", "public function prepare( $data );", "protected function prepareAssignCatActionData()\n {\n foreach ($this->_data as $key => $value) {\n switch ($key) {\n case 'urlPath':\n $this->_urlPath = $value;\n break;\n case 'paramName':\n $this->_paramName = $value;\n break;\n default:\n $this->_additionalData[$key] = $value;\n break;\n }\n }\n }", "private function createArrayable()\n {\n $this->data = $this->data->toArray();\n\n $this->createArray();\n }", "protected function prepareMyData(){\n\t\tglobal $C;\n if( $this->id > 0 ){\n $this->get( \"`id`={$this->id}\" );\n $this->unstoreSfield();\n }\n\t\t$C->setID( $this->data['parent'] );\n\t\t$C->get( \"`id`={$this->data['parent']}\" );\n\t\t$C->unstoreSfield();\n $p = $C->getData();\n if( is_array( $p ) ){\n\t\t\tT::assign( \"parent\", $p[\"name\"] );\n\t\t\t$fieldlist=array();\n if( is_array( $p[\"fields\"] ) )\n foreach( $p[\"fields\"] as $key => $item ){\n $fieldlist[] = array( \"cnt\" => $key, \"name\" => $item, \"value\"=> $this->data[$this->sfield][$key] );\n }\n\t\t\tT::assign( \"fieldlist\", $fieldlist );\n }\n\t\tT::assign( \"f\", $this->sfield );\n\t\tT::assign( \"item\",$this->data );\t\t\n\t}", "private function prepareData(){\n\t\t\t$this->text = trim($this->text);\n\t\t\t$this->user_id = intval($this->user_id);\n\t\t\t$this->parent_id = intval($this->parent_id);\n\t\t}", "function buildTempTableFromData($uniqueId){\n\t\t//require_once($_SERVER['DOCUMENT_ROOT'] .\"/inc/php/classes/sql_safe.php\" );\n\t\t//Grab first row\n\t\t if(!isset($this->data[0])){\n\t\t \tthrow new Exception(\"Bad Data Format. Foxpro report needs an array of arrays\");\n\t\t }\n\t\t$firstRow = $this->data[0];\n\t\t$columns = array_keys($firstRow);\n\n\t\t//See the excel sheet in project files for an explanation of this logic.\n\t\t$paramLimit = 1500; //sqlsrv max escaped params is 2100. driver will throw an error if you exceed 2100.\n\t\t$rowCount = count($this->data);\n\t\t$columnCount = count($this->data[0]);\n\t\tif($columnCount > $paramLimit){\n\t\t\tthrow new Exception(\"Cannot insert more columns than the parameter limit! Column Count = {$columnCount}. Parameter Limit = {$paramLimit}.\");\n\t\t}\n\t\t$paramTotal = $columnCount*$rowCount;\n\t\t$groupsNeeded = ceil($paramTotal/$paramLimit);\n\t\t$chunkSize = floor($rowCount/$groupsNeeded);\n\t\t$chunks = array_chunk($this->data,$chunkSize);\n\n\t\t$tableName = \"tmp_foxpro_autogen_\".$uniqueId;\n\n\t\t$columnSqlArray = array();\n\t\tforeach ($columns as $column) {\n\t\t\t$columnSqlArray[] = \"[{$column}] [varchar](MAX) NULL\";\n\t\t}\n\t\t$tableNameQuery = \"FWE_DEV..[{$tableName}]\";\n\t\t$createQuery = \"CREATE TABLE {$tableNameQuery} (\" . implode(\",\", $columnSqlArray) . \")\";\n\t\t$this->mssqlHelperInstance->query($createQuery);\n\n\t\t$dbClass = get_class($this->mssqlHelperInstance);\n\t\tif ($dbClass == 'mssql_helper') {\n\t\t\trequire_once($_SERVER['DOCUMENT_ROOT'] . '/inc/php/classes/sqlsrv_helper.php');\n\t\t\t$insertInstance = new sqlsrv_helper('m2m');\n\t\t} else {\n\t\t\t$insertInstance = $this->mssqlHelperInstance;\n\t\t}\n\n\t\tforeach($chunks as $chunk) {\n\n\t\t\t$insertSqlArray = array();\n\t\t\t$queryValues = array();\n\t\t\tforeach ($chunk as $row) {\n\t\t\t\t$values = array_values($row);\n\t\t\t\t$rowArray = array();\n\t\t\t\tforeach ($values as $value) {\n\t\t\t\t\t$rowArray[] = \"?\";\n\t\t\t\t\t$queryValues[] = (string)$value;\n\t\t\t\t}\n\t\t\t\t$insertSqlArray[] = \"(\" . implode(\",\", $rowArray) . \")\";\n\t\t\t}\n\t\t\t$insertQuery = \"INSERT INTO {$tableNameQuery} (\" . implode(\",\", $columns) . \") VALUES \" . implode(\",\", $insertSqlArray) . \"\";\n\n\t\t\t$insertInstance->query($insertQuery, $queryValues);\n\t\t}\n\t\t$this->tableName = $tableNameQuery;\n\t}", "abstract protected function prepareData(array $rawData, array $options, tx_mksearch_interface_IndexerDocument $indexDoc);", "public function prepare($data) {\n\n $data = $this->convertPhpArrayToJson($data);\n\n return parent::prepare($data);\n\n }", "protected static function _create(array $data) {\n global $db;\n //$arr_k = implode(\",\", array_keys($data));\n //$arr_v = implode(\"','\", $data);\n $arr_k = ''; $arr_v = '';\n foreach ($data as $k => $d) {\n $arr_k = mysql_prep_string($k).\",\";\n $arr_v = mysql_prep_string($d).\",\";\n }\n $arr_k = rtrim($arr_k, ','); $arr_v = rtrim($arr_v, ',');\n $q = \"INSERT INTO \".TABLE.\" ($arr_k) VALUES ('$arr_v')\";\n $res = $db->query($q);\n return $res;\n }", "public function exchangeArray($data)\n {\n $this->id = (!empty($data['id'])) ? $data['id']:null; // int\n $this->migration = (!empty($data['migration'])) ? $data['migration']:null; // varchar\n $this->batch = (!empty($data['batch'])) ? $data['batch']:null; // int\n }", "public function prepareBeforeUpdate(array $data): array\n {\n return $data;\n }", "public function prepare(){\n\t\treturn array(\n\t\t\t'creationData' => $this->creationData->prepare(),\n\t\t\t'modificationHistory' => $this->modificationHistory->prepare() );\t\t\n\t}", "public function exchanegArray($_data)\n {\n $this->page_no = (int) gv('page_no', $_data);\n $this->category_no = (int) gv('category_no', $_data);\n $this->controller_no = (int) gv('controller_no', $_data);\n $this->page_title = (string) gv('page_title', $_data);\n $this->page_uri = (string) gv('page_uri', $_data);\n $this->page_description = (string) gv('page_description', $_data);\n $this->icon = (string) gv('icon', $_data);\n $this->order_no = (int) gv('order_no', $_data);\n $this->use_mobile = (int) gv('use_mobile', $_data);\n $this->update_time = (string) gv('update_time', $_data);\n }", "private function prepareData($fields) {\n \n $insertData = array();\n \n foreach ($fields as $field) {\n if ($this->notManyToManyRelation($field)) {\n \n if($field->multiLanguage) {\n $name = getLocalizedFieldName($field->name);\n } else {\n $name = $field->name;\n }\n $insertData[$name] = $field->value;\n }\n if ($field instanceof PasswordField) {\n $insertData[$field->name] = md5($field->value);\n }\n }\n // auto generated unique id\n unset($insertData[\"id\"]);\n return $insertData;\n }", "public function importArray($data);", "private function setData() {\n $this->Data = array_map('strip_tags', $this->Data);\n $this->Data = array_map('trim', $this->Data);\n }", "public function insertArrayDataProvider()\n {\n return [\n 'one column' => [\n ['column1'],\n [[1], [2]],\n [['column1' => 1, 'column2' => null], ['column1' => 2, 'column2' => null]],\n ],\n 'one column simple' => [\n ['column1'],\n [1, 2],\n [['column1' => 1, 'column2' => null], ['column1' => 2, 'column2' => null]],\n ],\n 'two columns' => [\n ['column1', 'column2'],\n [[1, 2], [3, 4]],\n [['column1' => 1, 'column2' => 2], ['column1' => 3, 'column2' => 4]],\n ],\n 'several columns with identity' => [ // test possibility to insert data with filled identity field\n ['id', 'column1', 'column2'],\n [[1, 0, 0], [2, 1, 1], [3, 2, 2]],\n [\n ['id' => 1, 'column1' => 0, 'column2' => 0],\n ['id' => 2, 'column1' => 1, 'column2' => 1],\n ['id' => 3, 'column1' => 2, 'column2' => 2]\n ],\n ]\n ];\n }", "protected function prepareCreateData(array &$aData): Base\n {\n return $this;\n }", "public function normalizeData() : array;", "public function readyToInsert($data)\n {\n\n $returnArray = array();\n\n $datetime = date_create()->format('Y-m-d H:i:s');\n\n foreach ($data as $modelName => $insetDatas) {\n\n foreach ($insetDatas as $specialKey => $insertData) {\n\n $hash = arrayMd5Hash($insertData);\n\n $insertData[singular($modelName) . \"_created_date\"] = $datetime;\n $insertData[singular($modelName) . \"_update_date\"] = $datetime;\n $insertData[singular($modelName) . \"_hash\"] = $hash;\n\n $returnArray[$modelName][] = $insertData;\n\n }\n\n }\n return $returnArray;\n }", "public function prepareData()\r\n {\r\n $users_model = new UsersModel();\r\n $users_all = $users_model->getAll(true, false, 'C_FULLNAME');\r\n $users = Groups::getUsers($this->group_id, 'C_FULLNAME');\r\n $users_include = array();\r\n \tforeach ($users as $user_info) {\r\n \t\t$users_include[$user_info['U_ID']] = array(\r\n \t\t\t$user_info['U_ID'],\r\n \t\t\t$user_info['C_FULLNAME']\r\n \t\t);\r\n \t} \r\n \t$users_exclude = array();\r\n \tforeach ($users_all as $user_info) {\r\n \t\tif (!isset($users_include[$user_info['U_ID']])) {\r\n\t \t\t$users_exclude[] = array(\r\n\t \t\t\t$user_info['U_ID'],\r\n\t \t\t\t$user_info['C_FULLNAME']\r\n\t \t\t);\r\n \t\t}\r\n \t}\r\n \t$this->smarty->assign('group_id', $this->group_id);\r\n \t$this->smarty->assign('users_in', json_encode(array_values($users_include)));\r\n \t$this->smarty->assign('users_out', json_encode($users_exclude)); \r\n }", "protected function prepForSave()\n\t{\n\t\t$array = array();\n\t\tforeach( static::$schema AS $field => $type )\n\t\t{\n\t\t\tif ( is_array( $type ) )\n\t\t\t{\n\t\t\t\t$type = $type[ 'type' ];\n\t\t\t}\n\t\t\t\n\t\t\t$array[ $field ] = $this->sanitize( $type, $this->data[ $field ], true );\n\t\t}\n\n\t\tif ( isset( $this->data[ 'updated_at' ] ) )\n\t\t{\n\t\t\t$array[ 'updated_at' ] = date( 'Y-m-d H:i:s' );\n\t\t}\n\t\tif ( ! $this->loaded && isset( $this->data[ 'created_at' ] ) )\n\t\t{\n\t\t\t$array[ 'created_at' ] = date( 'Y-m-d H:i:s' );\n\t\t}\n\t\t\n\t\treturn $array;\n\t}", "private function prepare($data)\n {\n foreach ($data as $code => &$item) {\n $item = $this->prepareItem($code, $item);\n }\n return $data;\n }", "public function insertData($table, $data){// method inserData body start\n\t\t$fields \t\t\t= array_keys( $data );\n\t\t//$values \t\t\t= array_map( \"mysql_real_escape_string\", array_values( $data ) );\n\t\t$values \t\t\t= array_values( $data );\n\t\t$query \t\t\t\t= \"INSERT INTO $table(\".implode(\",\",$fields).\") VALUES ('\".implode(\"','\", $values ).\"');\";\n\t\t$execute \t\t\t= $this->query($query);\n\t\t\n\t}", "protected function _prepareUpdateData($data) {\n $dataPrepared = array(\n 'name' => $data->getName(),\n 'module_id' => $data->getModule_id(),\n 'system' => $data->getSystem(),\n 'person_id' => $data->getPerson_id(),\n 'color' => $data->getColor(),\n );\n\n return $dataPrepared;\n }", "function prepareFields() {\r\n\t\t$data = array_keys($this->modx->getFieldMeta('msProductData'));\r\n\t\tforeach ($this->resourceArray as $k => $v) {\r\n\t\t\tif (is_array($v) && in_array($k, $data)) {\r\n\t\t\t\t$tmp = $this->resourceArray[$k];\r\n\t\t\t\t$this->resourceArray[$k] = array();\r\n\t\t\t\tforeach ($tmp as $v2) {\r\n\t\t\t\t\tif (!empty($v2)) {\r\n\t\t\t\t\t\t$this->resourceArray[$k][] = array('value' => $v2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (empty($this->resourceArray['vendor'])) {\r\n\t\t\t$this->resourceArray['vendor'] = '';\r\n\t\t}\r\n\t}", "public function prepareForValidation(): void\n {\n $products = [];\n foreach ($this->products as $key => $product) {\n $products['products'][$key] = [\n 'id' => $product['id'],\n 'qty' => $product['qty'],\n 'product' => Product::find($product['id']),\n ];\n }\n\n $this->merge($products);\n }", "protected function initData()\n {\n foreach (['data', 'uploads'] as $option) {\n $value = $this->option($option);\n if ($value) {\n $this->info[$option] = explode(',', $value);\n }\n }\n }", "private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\n }", "function prepare_array() {\n\n\t\t$obj['name'] = $this->name->value;\n\t\t$obj['url'] = $this->url->value;\n\t\t$obj['image'] = $this->image->value;\n\t\t$obj['description'] = $this->description->value;\n\t\t/*\n\t\tforeach($this as $key => $value) {\n\n\t\t\t$obj[$key] = $value;\n\n\t\t}\n\t*/\n\t\treturn $obj;\n\t}", "private function prepareForTransaction($table, $data){\n $queries = [];\n foreach($data as $data_item){\n $queries[]= 'INSERT INTO `'.$table.'` (`addresses_id`, `addresses_address`, `addresses_street`, \n `addresses_street_name`, `addresses_street_type`, `addresses_adm`, `addresses_adm1`, `addresses_adm2`, `addresses_cord_x`, `addresses_cord_y`, `coords`) VALUES\n (\n '.$data_item->addresses_id.',\n \"'.$data_item->addresses_address.'\",\n \"'.$data_item->addresses_street.'\",\n \"'.$data_item->addresses_street_name.'\",\n \"'.$data_item->addresses_street_type.'\",\n \"'.$data_item->addresses_adm.'\",\n \"'.$data_item->addresses_adm1.'\",\n \"'.$data_item->addresses_adm2.'\",\n \"'.$data_item->addresses_cord_x.'\",\n \"'.$data_item->addresses_cord_y.'\",\n GeomFromText(\"POINT('.$data_item->addresses_cord_x.' '.$data_item->addresses_cord_y.')\")\n )';\n }\n return $queries;\n }", "function prepareParams($data){\r\n\t$param_info = $this->getParamInfo();\r\n\t$param_ids = array();\r\n\t$param_types = array();\r\n\r\n\tforeach($param_info as $p_i){\r\n\t\t$param_ids[$p_i['param']] = $p_i['id'];\r\n\t\t$param_types[$p_i['param']] = $p_i['param_type'];\r\n\t}\r\n\t$new_params = array();\r\n\tforeach($data as $k=>$v){\r\n\t\tif(isset($param_ids[$k]) && $param_types[$k] == 'text'){\r\n\t\t\t$new_params[$param_ids[$k]][0] = $v;\r\n\t\t}\r\n\t\telseif(isset($param_ids[$k])){\r\n\t\t\tif(is_array($v)){\r\n\t\t\t\t$v = implode(',',$v);\r\n\t\t\t}\r\n\t\t\t$new_params[$param_ids[$k]][1] = $v;\r\n\t\t\t$new_params[$param_ids[$k]][0] = $data[$k.'_text_value'];\r\n\t\t}\r\n\t}\r\n\treturn $new_params;\r\n}", "public function setData(Array $data);", "public function insertData (array $params);", "public function prepare_items()\n {\n $columns = $this->get_columns();\n $hidden = $this->get_hidden_columns();\n $sortable = $this->get_sortable_columns();\n $data = $this->table_data();\n usort( $data, array( &$this, 'sort_data' ) );\n $perPage = 10;\n $currentPage = $this->get_pagenum();\n $totalItems = count($data);\n $this->set_pagination_args( array(\n 'total_items' => $totalItems,\n 'per_page' => $perPage\n ) );\n $data = array_slice($data,(($currentPage-1)*$perPage),$perPage);\n $this->_column_headers = array($columns, $hidden, $sortable);\n $this->process_bulk_action();\n $this->items = $data;\n }", "public function creataTypeArray()\n\t{\n\t\t$this->db->creataTypeArray();\n\t}", "protected function _prep_args() {\n\t\t// this is the data prepared for binding.\n\t\t// these fields are ordered as they are in the table\n\t\t$args = array(\n\t\t\t'the_id' => $this->id,\n\t\t\t'date_created' => $this->date_created,\n\t\t\t'completed' => $this->completed,\n\t\t\t'template_id' => $this->template_id,\n\t\t);\n\n\t\treturn $args;\n\t}", "private function convertData() {\n\t\tforeach ($this->Data as $i => $Data) {\n\t\t\t$Points = array();\n\t\t\tforeach ($Data['data'] as $x => $y) {\n\t\t\t\t$Points[] = array($x, $y);\n\t\t\t}\n\t\t\t$this->Data[$i]['data'] = $Points;\n\t\t}\n\n\t\tif (Configuration::ActivityView()->smoothCurves() && !isset($this->Options['series']['curvedLines']['apply']))\n\t\t\t$this->Options['series']['curvedLines']['apply'] = true;\n\n\t\tif (empty($this->Data) && strlen($this->ErrorString) == 0)\n\t\t\t$this->raiseError('Es sind keine Daten vorhanden.');\n\t}", "public function prepareDataField($inputData) {\n\t\t\t$data = array();\n\n\t\t\tif($this->actionType == \"create\") {\n\t\t\t\t$field = array();\n\t\t\t\t$field['attribute:visible'] = 'visible';\n\t\t\t\t$data['field'] = $field;\n\t\t\t} else {\n\t\t\t\t$data['full:field'] = $inputData;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}", "public function doInsert( $data ) {\t\t\r\n\r\n\t\t\r\n\t\t\t\t$newRow = $this->createRow();\r\n\t\t\t\r\n\t\t\t\tforeach ( $newRow->toArray() as $key => $v ) {\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t$newRow[ $key ] = Class_array::getValue( $data, $key );\r\n\t\t\t\t\r\n }\r\n\t\t\t\t$newRow->save();\t\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\treturn $newRow;\r\n\t\t\t\r\n\t\t//}\r\n\t}", "protected function prepareForValidation()\n {\n $this->merge([\n self::ATTRIBUTE_REFERER => $this->prepareArray($this->input(self::ATTRIBUTE_REFERER)),\n self::ATTRIBUTE_IP => $this->prepareArray($this->input(self::ATTRIBUTE_IP)),\n ]);\n }", "protected function _beforePrepareDocumentData()\n {\n $this->_documentData = array();\n $this->_documentTextSearch = array();\n $this->_documentCategoryNames = array();\n $this->_documentAutocompleteSearch = array();\n }", "protected function _prepareSaveData($data = array())\n {\n $data = parent::_prepareSaveData($data);\n\n if (!array_key_exists('user_id', $data) && $this->_userId !== null) {\n $data['user_id'] = $this->_userId;\n }\n\n if (!array_key_exists('refund_flag', $data) && $this->_refundFlag !== null) {\n $data['refund_flag'] = $this->_refundFlag;\n }\n\n if (!array_key_exists('listing_id', $data) && $this->_listingId !== null) {\n $data['listing_id'] = $this->_listingId;\n }\n\n if (!array_key_exists('sale_id', $data) && $this->_saleId !== null) {\n $data['sale_id'] = $this->_saleId;\n }\n\n if (!array_key_exists('gateway_id', $data) && $this->_gatewayId !== null) {\n $data['gateway_id'] = $this->_gatewayId;\n }\n\n return $data;\n }", "protected function prepareForValidation()\n {\n $merge = [];\n\n if ($this->valtotal) {\n $merge['valtotal'] = Format::strToFloat($this->valtotal);\n }\n\n $this->merge($merge);\n }", "protected function _prepareSaveData($data = array())\n {\n if (isset($data['id']) && empty($data['id'])) {\n unset($data['id']);\n }\n\n if (isset($data['addl_category_id']) && empty($data['addl_category_id'])) {\n unset($data['addl_category_id']);\n }\n\n if (!empty($data['buyout_price']) && $data['listing_type'] == 'product') {\n $data['start_price'] = $data['buyout_price'];\n }\n\n $keysToUnset = array('rollback_data', 'active', 'approved', 'closed', 'deleted', 'nb_clicks');\n foreach ($keysToUnset as $keyToUnset) {\n if (array_key_exists($keyToUnset, $data)) {\n unset($data[$keyToUnset]);\n }\n }\n\n $startTime = time();\n if (isset($data['start_time_type'])) {\n switch ($data['start_time_type']) {\n case 1: // custom\n $startTime = strtotime($data['start_time']);\n $data['start_time'] = date('Y-m-d H:i:s', $startTime);\n $data['closed'] = 1;\n break;\n default: // now\n $data['start_time'] = new Expr('now()');\n break;\n }\n }\n else if (isset($data['start_time'])) {\n $startTime = strtotime($data['start_time']);\n }\n\n $endTime = null;\n\n $endTimeType = isset($data['end_time_type']) ? $data['end_time_type'] : 0;\n switch ($endTimeType) {\n case 1: // custom\n $endTime = strtotime($data['end_time']);\n $data['duration'] = new Expr('null');\n break;\n default: // duration\n if (!empty($data['duration'])) {\n if ($data['duration'] > 0) {\n $endTime = $startTime + $data['duration'] * 86400;\n }\n }\n break;\n }\n\n if ($endTime) {\n $data['end_time'] = date('Y-m-d H:i:s', $endTime);\n }\n else {\n $data['end_time'] = new Expr('null');\n }\n\n if (!empty($data['stock_levels'])) {\n foreach ($data['stock_levels'] as $key => $value) {\n if (!empty($value[StockLevels::FIELD_OPTIONS])) {\n $data['stock_levels'][$key][StockLevels::FIELD_OPTIONS] = \\Ppb\\Utility::unserialize($value[StockLevels::FIELD_OPTIONS]);\n }\n\n if (!empty($value[StockLevels::FIELD_QUANTITY])) {\n $data['stock_levels'][$key][StockLevels::FIELD_QUANTITY] = abs(intval($value[StockLevels::FIELD_QUANTITY]));\n }\n }\n }\n\n return parent::_prepareSaveData($data);\n }", "public function exchangeArray($data) {\n\t\t$this->id = (isset ( $data ['id'] )) ? $data ['id'] : null;\n\t\t$this->descriptionkey = (isset ( $data ['descriptionkey'] )) ? $data ['descriptionkey'] : null;\n\t\t$this->title = (isset ( $data ['title'] )) ? $data ['title'] : null;\n\t\t//$this->imgkey = (isset ( $data ['imgkey']['name'] )) ? $data ['imgkey']['name'] : null;\n\t\t$this->imgkey = (isset ( $data ['imgkey'] )) ? $data ['imgkey'] : null;\n\t\t$this->patient_id = (isset ( $data ['patient_id'])) ? $data ['patient_id'] : null;\n\t}", "private function prepareData($data)\n {\n $data = (is_array($data)) ? $data : json_decode($data, true);\n $prepareData = array();\n foreach ($data as $key => $value) {\n switch ($key) {\n case 'Nome':\n case 'Sobrenome':\n case 'Email':\n case 'Telefone':\n $prepareData[$key] = $value;\n break;\n }\n }\n return $prepareData;\n }", "protected function _prepareRowsAction() {\n \n }", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['id'])) $tmp['id'] = $data['id'];\n\t\tif(isset($data['title'])) $tmp['title'] = $data['title'];\n\t\tif(isset($data['guide'])) $tmp['guide'] = $data['guide'];\n\t\tif(isset($data['gtype'])) $tmp['gtype'] = $data['gtype'];\n\t\tif(isset($data['ntype'])) $tmp['ntype'] = $data['ntype'];\n\t\tif(isset($data['btype'])) $tmp['btype'] = $data['btype'];\n\t\tif(isset($data['img'])) $tmp['img'] = $data['img'];\n\t\tif(isset($data['status'])) $tmp['status'] = intval($data['status']);\n\t\tif(isset($data['start_time'])) $tmp['start_time'] = $data['start_time'];\n\t\tif(isset($data['update_time'])) $tmp['update_time'] = intval($data['update_time']);\n\t\tif(isset($data['end_time'])) $tmp['end_time'] = intval($data['end_time']);\n\t\treturn $tmp;\n\t}", "protected function insert(array $data): void\n {\n if (isset($this->table->disableForeignkeyCheck) && $this->table->disableForeignkeyCheck) {\n DB::connection('c2')->statement('SET FOREIGN_KEY_CHECKS=0;');\n }\n\n if (isset($this->table->shouldTruncateFirst) && $this->table->shouldTruncateFirst) {\n DB::connection('c2')->table($this->table->to)->truncate();\n }\n\n if (isset($this->table->generateUuid) && $this->table->generateUuid) {\n $data = $this->generateUuid($data);\n }\n\n foreach (array_chunk($data, 1000) as $chunk) {\n DB::connection('c2')->table($this->table->to)->insert($chunk);\n }\n }", "private function prepareQueryArray($input){\n global $Core;\n if(empty($input) || !is_array($input)){\n throw new Exception ($Core->language->error_input_must_be_a_non_empty_array);\n }\n $allowedFields = $this->getTableFields();\n $temp = array();\n\n $parentFunction = debug_backtrace()[1]['function'];\n if((stristr($parentFunction,'add') || $parentFunction == 'insert')){\n $requiredBuffer = $this->requiredFields;\n }\n else{\n $requiredBuffer = array();\n if(stristr($parentFunction,'translate')){\n $allowedFields = $this->translationFields;\n }\n }\n\n foreach ($input as $k => $v){\n if($k === 'added' && !$this->allowFieldAdded){\n throw new Exception ($Core->language->field_added_is_not_allowed);\n }\n if($k === 'id'){\n throw new Exception ($Core->language->field_id_is_not_allowed);\n }\n\n if(!isset($allowedFields[$k]) && !in_array($k,$allowedFields)){\n throw new Exception (get_class($this).\": The field $k does not exist in table {$this->tableName}!\");\n }\n\n if(!is_array($v)){\n $v = trim($v);\n }\n\n if(!empty($v) || ((is_numeric($v) && intval($v) === 0))){\n if(!empty($requiredBuffer) && ($key = array_search($k, $requiredBuffer)) !== false) {\n unset($requiredBuffer[$key]);\n }\n $fieldType = $this->tableFields[$k]['type'];\n if(stristr($fieldType,'int') || stristr($fieldType,'double')){\n if(!is_numeric($v)){\n $k = str_ireplace('_id','',$k);\n throw new Exception ($Core->language->error_field.' \\\"'.$Core->language->$k.'\\\" '.$Core->language->error_must_be_a_numeric_value);\n }\n $temp[$k] = $v;\n }\n else if($fieldType == 'date'){\n $t = explode('-',$v);\n if(count($t) < 3 || !checkdate($t[1],$t[2],$t[0])){\n $k = str_ireplace('_id','',$k);\n throw new Exception ($Core->language->error_field.' \\\"'.$Core->language->$k.'\\\" '.$Core->language->error_must_be_a_date_with_format);\n }\n $temp[$k] = $v;\n unset($t);\n }\n else{\n if(in_array($k,$this->explodeFields)){\n if(is_object($v)){\n $v = (array)$v;\n }\n else if(!is_array($v)){\n $v = array($v);\n }\n\n if($k == 'languages'){\n $tt = array();\n foreach($v as $lang){\n if(empty($lang)){\n throw new Exception ($Core->language->error_language_cannot_be_empty);\n }\n $langMap = $Core->language->getLanguageMap(false);\n\n if(!isset($langMap[$lang])){\n throw new Exception ($Core->language->error_undefined_or_inactive_language);\n }\n if(!is_numeric($lang)){\n $lang = $langMap[$lang]['id'];\n }\n $tt[] = $lang;\n }\n $v = '|'.implode('|',$tt).'|';\n }\n else{\n $tt = '';\n foreach($v as $t){\n if(!empty($t)){\n $tt .= str_replace($this->explodeDelimiter,'_',$t).$this->explodeDelimiter;\n }\n }\n $v = substr($tt,0,-1);\n unset($tt,$t);\n }\n }\n else if(is_array($v)){\n $k = str_ireplace('_id','',$k);\n throw new Exception($Core->language->error_field.' \\\"'.$Core->language->$k.'\\\" '.$Core->language->error_must_be_alphanumeric_string);\n }\n\n $temp[$k] = $Core->db->real_escape_string($v);\n }\n }\n else{\n if(stristr($parentFunction,'update') && isset($this->requiredFields[$k])){\n $k = str_ireplace('_id','',$k);\n throw new Exception($Core->language->error_field.' \\\"'.$Core->language->$k.'\\\" '.$Core->language->error_must_not_be_empty);\n }\n else $temp[$k] = '';\n }\n }\n\n if(!empty($requiredBuffer)){\n $temp = array();\n foreach($requiredBuffer as $r){\n $r = str_ireplace('_id','',$r);\n $temp[] = $Core->language->$r;\n }\n\n throw new Exception($Core->language->error_required_fields_missing.\": \".implode(', ',$temp));\n }\n\n return $temp;\n }", "private function insertValues($finaldataset, $dataset, $array) {\n for ($i = 0; $i < count($finaldataset); $i++) {\n if (is_array($dataset[$i][2])) {\n if (isset($dataset[$i][2]['selectname'])) { // exception for select composing\n $finaldataset[$i]['input_value'] = $array[$dataset[$i][2]['selectname']];\n }\n }\n /**\n * Since we use same function both for add and edit pages, some of the values in fields might be void.\n * $array is array from $_SESSION if user is on add page and have already tried to save data\n * or array with db data if user is on add edit page.\n */\n elseif (isset($array[$dataset[$i][2]])) $finaldataset[$i]['input_value'] = $array[$dataset[$i][2]];\n else $finaldataset[$i]['input_value'] = '';\n }\n return $finaldataset;\n }", "protected function _prepareInsertData($data) {\n $dataPrepared = $this->_prepareUpdateData($data);\n\n return $dataPrepared;\n }", "private function prep_query($data, $type='insert') {\n\t\t$fields = '';\n\t\t$placeholders = '';\n\t\t$values = array();\n\t\t\n\t\t// Loop through $data and build $fields, $placeholders, and $values\t\t\t\n\t\tforeach ( $data as $field => $value ) {\n\t\t\t$fields .= \"{$field},\";\n\t\t\t$values[] = $value;\n\t\t\t\n\t\t\tif ( $type == 'update') {\n\t\t\t\t$placeholders .= $field . '=?,';\n\t\t\t} else {\n\t\t\t\t$placeholders .= '?,';\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// Normalize $fields and $placeholders for inserting\n\t\t$fields = substr($fields, 0, -1);\n\t\t$placeholders = substr($placeholders, 0, -1);\n\n\t\t//print_r($fields);\n\t\t//print_r($placeholders);\n\t\t//print_r($values);\n\n\t\techo '<pre>', print_r($fields), '</pre>';\n\t\techo '<pre>', print_r($placeholders), '</pre>';\n\t\techo '<pre>', print_r($values), '</pre>';\n\t\t\n\t\treturn array( $fields, $placeholders, $values );\n\n\n\t}", "public function prepare_items()\r\n {\r\n $columns = $this->get_columns();\r\n $hidden = $this->get_hidden_columns();\r\n $sortable = $this->get_sortable_columns();\r\n\r\n /** Process bulk action */\r\n $this->process_bulk_action();\r\n\r\n $data = $this->table_data();\r\n usort($data, array(&$this, 'sort_data'));\r\n $perPage = 30;\r\n $currentPage = $this->get_pagenum();\r\n $totalItems = count($data);\r\n $this->set_pagination_args(array(\r\n 'total_items' => $totalItems,\r\n 'per_page' => $perPage\r\n ));\r\n $data = array_slice($data, (($currentPage - 1) * $perPage), $perPage);\r\n // var_dump($data);\r\n // die();\r\n $this->_column_headers = array($columns, $hidden, $sortable);\r\n $this->items = $data;\r\n }", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n // All keys are srings in array, merge it with defaults to override\r\r\n $this->e_data = array_merge($this->default_options, $this->e_data);\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "function fillQuestion($data)\r\n {\r\n\tfor( $i=0; $i<$data['count']; $i++ ){\r\n\t\t$data[$i]['Question'] = $this->findAll($conditions='id='.$data[$i]['SurveyQuestion']['question_id'], $fields=\"prompt, type\");\r\n\t\t$data[$i]['Question'] = $data[$i]['Question'][0]['Question'];\r\n\t\t$data[$i]['Question']['number'] = $data[$i]['SurveyQuestion']['number'];\r\n\t\t$data[$i]['Question']['id'] = $data[$i]['SurveyQuestion']['question_id'];\r\n\t\t$data[$i]['Question']['sq_id'] = $data[$i]['SurveyQuestion']['id'];\r\n\t\tunset($data[$i]['SurveyQuestion']);\r\n\t}\r\n\r\n\treturn $data;\r\n }", "public function setUp()\n {\n foreach ($this->data as $row) {\n $this->table->insert($row);\n }\n\n parent::setUp();\n\n }", "abstract protected function prepareEntity(/*array*/ $entity_data);", "function processData($data) {\n\t$database = new PDO(\"sqlite:usgs.db\") or die(\"Unable to access database\");\n\t$prep = $database->prepare(\"REPLACE INTO datum (source, eqid, timestamp, latitude, longitude, magnitude, depth, region) VALUES(:source,:eqid,:timestamp,:latitude,:longitude,:magnitude,:depth,:region)\");\n\t\n\t/* First row is always headers */\n\tarray_pop($data);\n\n\tforeach ($data as $row) {\n\t\t$p = str_getcsv($row);\n\t\t$prep->bindParam(\":source\", $p[10]);\n\t\t$prep->bindParam(\":eqid\", $p[11]);\n\t\t$prep->bindParam(\":timestamp\", strtotime($p[0]));\n\t\t$prep->bindParam(\":latitude\", $p[1]);\n\t\t$prep->bindParam(\":longitude\", $p[2]);\n\t\t$prep->bindParam(\":magnitude\", $p[4]);\n\t\t$prep->bindParam(\":depth\", $p[3]);\n\t\t$prep->bindParam(\":region\", $p[9]);\n\t\t$prep->execute();\n\t}\n\n\tunset($prep);\n\tunset($database);\n}", "public function fromArray($data)\n {\n $this->data = $data;\n\n\n }", "protected static function prepareData(array $data)\n\t{\n\t\t$newData = array();\n\n\t\tforeach ($data as $code => $val)\n\t\t{\n\t\t\tif (mb_strpos($code, '_') !== false)\n\t\t\t{\n\t\t\t\t$codeHook = mb_substr($code, 0, mb_strpos($code, '_'));\n\t\t\t\t$codeVal = mb_substr($code, mb_strpos($code, '_') + 1);\n\t\t\t\tif (!isset($newData[$codeHook]))\n\t\t\t\t{\n\t\t\t\t\t$newData[$codeHook] = array();\n\t\t\t\t}\n\t\t\t\t$newData[$codeHook][$codeVal] = $val;\n\t\t\t}\n\t\t}\n\n\t\treturn $newData;\n\t}", "private function setData() { \n $Avatar = $this->Data['avatar'];\n $Depoimento = $this->Data['depoimento'];\n unset($this->Data['avatar'], $this->Data['depoimento']);\n \n $this->Data = array_map('strip_tags', $this->Data);\n $this->Data = array_map('trim', $this->Data);\n \n $this->Data['data'] = Check::Data($this->Data['data']); \n $this->Data['avatar'] = $Avatar;\n $this->Data['depoimento'] = $Depoimento;\n }", "private function prepareData(){\n $this->params['crud_url'] = '/'.trim($this->params['crud_url'],'/');\n }", "private function addData ()\n {\n foreach ($this->data as $key=>$value)\n {\n $keys[] = $key;\n $values[] = $value;\n \n }\n $cols = implode($keys, \",\");\n $dataValues = \"'\".implode($values, \"','\").\"'\";\n $query = \"INSERT INTO `$this->tablename`($cols)VALUES($dataValues);\";\n \n $conn = $this->DB->conn;\n \n $sql = $conn->query($query);\n \n if($sql == TRUE) return TRUE;\n else \n {\n \n throw new Exception(\"Error : Data Not inserted to database :( \".$conn->error);\n \n }\n \n }", "private function getPrepared()\n {\n $array = $this->ToArray();\n unset($array['currentPage']);\n unset($array['pageCount']);\n unset($array['errors']);\n unset($array['insert']);\n unset($array['table']);\n unset($array['Adapter']);\n unset($array['pdoFetch']);\n unset($array['cmsFetchMode']);\n unset($array[$this->primaryName]);\n unset($array['primaryName']);\n $prepared['update'] = '';\n foreach($array as $k=>$v)\n {\n $prepared['values'][':'.$k] = $v;\n $prepared['update'] .= '`'.$k.'`'.\"=\".':'.$k.',';\n }\n if ($prepared['update']{strlen($prepared['update'])-1} == ',')\n {\n $prepared['update'] = substr($prepared['update'],0,-1);\n }\n $prepared['set'] = implode(', ', array_keys($array));\n return $prepared;\n }", "private function prepareAttachmentData() {\n $this->attachmentMediaFiles = [];\n\n // Prepare the gallery images. This should be called before prepareImageData. Otherwise, if there are duplicate\n // image URLs and prepareImageData finds them first, gallery images won't be saved. In other words, the images\n // that are marked as \"gallery_image\" will be skipped since their URLs were already saved. So, gallery image\n // data preparation is first.\n $this->prepareGalleryFileData();\n\n // Prepare the images\n $this->prepareFileData();\n\n // Set the attachment media files\n $this->postData->setAttachmentData($this->attachmentMediaFiles);\n }", "protected function processData($data)\n {\n $this->data = array_replace_recursive($this->data, $data);\n }", "public function creating(array $data);", "public function exchangeArray($data){\n\t\t$this->id \t = (!empty($data['id'])) ? $data['id'] : null;\n\t\t$this->description = (!empty($data['description'])) ? $data['description'] : null;\n\t\t$this->date \t = (!empty($data['date'])) ? $data['date'] : null;\n\t\t$this->type = (!empty($data['type'])) ? $data['type'] : null;\n\t\t$this->user_id = (!empty($data['user_id'])) ? $data['user_id'] : null;\n\t}", "public function addAndProcess(array $data){\n \n if(is_array($data)){\n foreach($data as $k => $v) {\n if ( $v == \"\") {\n $data[$k] = NULL;\n }\n }\n\n if(!is_null($data['gridref'])) {\n $data = $this->_processFindspot($data);\n }\n\n $findid = new Pas_Generator_FindID();\n $data['old_findspotid'] = $findid->generate();\n $secuid = new Pas_Generator_SecuID();\n $data['secuid'] = $secuid->secuid();\n //Get the label for the parish\n if(array_key_exists('parishID', $data) &&!is_null($data['parishID'])){\n $parishes = new OsParishes();\n $data['parish'] = $parishes->fetchRow(\n $parishes->select()->where('osID = ?', $data['parishID'])\n )->label;\n }\n //Get the label for the county\n if(array_key_exists('countyID', $data) && !is_null($data['countyID'])){\n $counties = new OsCounties();\n $data['county'] = $counties->fetchRow(\n $counties->select()->where('osID = ?', $data['countyID'])\n )->label;\n }\n //Get the label for the district\n if(array_key_exists('districtID', $data) && !is_null($data['districtID'])){\n $district = new OsDistricts();\n $data['district'] = $district->fetchRow(\n $district->select()->where('osID = ?', $data['districtID'])\n )->label;\n }\n if(array_key_exists('landownername', $data)){\n unset($data['landownername']);\n }\n\n if(array_key_exists('csrf', $data)){\n unset($data['csrf']);\n }\n\n if(empty($data['created'])){\n $data['created'] = $this->timeCreation();\n }\n\n if(empty($data['createdBy'])){\n $data['createdBy'] = $this->getUserNumber();\n }\n\n return parent::insert($data);\n } else {\n throw new Exception('The data submitted is not an array',500);\n }\n }", "function prepare_for_save ($data) {\r\n\t\t// Normalize marker contents\r\n\t\tif (is_array($data['markers'])) foreach ($data['markers'] as $k=>$v) {\r\n\t\t\t$data['markers'][$k]['icon'] = basename($v['icon']);\r\n\t\t\tif (!current_user_can('unfiltered_html')) {\r\n\t\t\t\t$data['markers'][$k]['body'] = wp_filter_post_kses($v['body']);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$post_ids = is_array(@$data['post_ids']) ? array_unique($data['post_ids']) : array();\r\n\t\t// Pack options\r\n\t\t$map_options = array (\r\n\t\t\t\"height\" => $data['height'],\r\n\t\t\t\"width\" => $data['width'],\r\n\t\t\t\"zoom\" => $data['zoom'],\r\n\t\t\t\"map_type\" => strtoupper($data['map_type']),\r\n\t\t\t\"map_alignment\" => strtolower($data['map_alignment']),\r\n\t\t\t\"show_map\" => (int)$data['show_map'],\r\n\t\t\t\"show_posts\" => (int)$data['show_posts'],\r\n\t\t\t\"show_markers\" => (int)$data['show_markers'],\r\n\t\t\t\"show_images\" => (int)$data['show_images'],\r\n\t\t\t\"image_size\" => $data['image_size'],\r\n\t\t\t\"image_limit\" => (int)$data['image_limit'],\r\n\t\t\t\"show_panoramio_overlay\" => (int)$data['show_panoramio_overlay'],\r\n\t\t\t\"panoramio_overlay_tag\" => $data['panoramio_overlay_tag'],\r\n\t\t\t\"street_view\" => $data['street_view'],\r\n\t\t\t\"street_view_pos\" => $data['street_view_pos'],\r\n\t\t\t\"street_view_pov\" => $data['street_view_pov'],\r\n\t\t);\r\n\t\t// Return prepped data array\r\n\t\treturn array (\r\n\t\t\t\"title\" => $data['title'],\r\n\t\t\t\"markers\" => serialize($data['markers']),\r\n\t\t\t\"post_ids\" => serialize($post_ids),\r\n\t\t\t\"options\" => serialize($map_options),\r\n\t\t);\r\n\t}", "public function exchangeArray($data)\n {\n $this->id = (isset($data['id'])) ? $data['id'] : null;\n $this->idmz = (isset($data['idmz'])) ? $data['idmz'] : null;\n\t\t$this->img = (isset($data['img'])) ? $data['img'] : null;\n\t\t$this->description = (isset($data['description'])) ? $data['description'] : null;\n $this->title = (isset($data['title'])) ? $data['title'] : null;\n $this->page = (isset($data['page'])) ? $data['page'] : null;\n \n }", "private function createDataRowForColumns(){\n\t\t$DataRows = [];\n\t\tforeach (\\DB::select('show columns from ' . $this->model->getTable() ) as $column)\n\t\t\t$DataRows[] = (new DataRowColumn)->setModel($this->model)->setField($column->Field)->fillModel();\n\n\t\t$this->DataType->dataRows()->saveMany($DataRows);\n\t}" ]
[ "0.79630697", "0.72921276", "0.7230927", "0.70332", "0.6768586", "0.65584826", "0.6534422", "0.6488492", "0.64735675", "0.6460831", "0.6450331", "0.6446165", "0.64317036", "0.6422355", "0.6414935", "0.64036655", "0.6349072", "0.6337286", "0.6333663", "0.6284629", "0.62730545", "0.6271085", "0.6271085", "0.6241184", "0.6216569", "0.6194178", "0.6192947", "0.6191696", "0.6183599", "0.61736727", "0.61696744", "0.6162867", "0.6161349", "0.612849", "0.609494", "0.6068968", "0.60411584", "0.60342926", "0.6030999", "0.6010253", "0.5983828", "0.59798115", "0.59702045", "0.59559584", "0.5952286", "0.5941235", "0.59337866", "0.59327334", "0.5920883", "0.5916609", "0.5912151", "0.5908881", "0.59082556", "0.5900767", "0.5895774", "0.58913785", "0.58875674", "0.5872707", "0.58620316", "0.58502567", "0.5844111", "0.5843538", "0.5838726", "0.5835967", "0.5829642", "0.58135027", "0.58030075", "0.5802919", "0.5797413", "0.578902", "0.5780781", "0.5775862", "0.57738847", "0.5769238", "0.5767858", "0.5761148", "0.5754967", "0.57519585", "0.5740818", "0.57332134", "0.57308", "0.5730377", "0.572832", "0.5724861", "0.57230175", "0.57193595", "0.5718623", "0.5713835", "0.57003564", "0.569448", "0.5692738", "0.56880194", "0.567935", "0.5674623", "0.5670663", "0.56673145", "0.56624395", "0.56591594", "0.5654989", "0.56524783", "0.56467897" ]
0.0
-1
Create a new cursor for the given connection and query
public function __construct(Connection $db, Select $select) { $this->db = $db; $this->select = $select; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cursor($query, $bindings = [], $useReadPdo = true)\n {\n\n }", "public static function cursor();", "public function getNewCursor()\n {\n return oci_new_cursor($this->_dbh);\n }", "public static function cursor($query, $bindings = [], $useReadPdo = true)\n {\n }", "public function createStatementForScrollableCursor($query) {\n $statement = $this->db->prepare($query, [\n PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL\n ]);\n $statement->execute();\n\n return $statement;\n }", "public function getNewCursor(): mixed\n {\n return oci_new_cursor($this->dbh);\n }", "static public function get_cursor(\n object $pp1, string $dmlrr, string $qrywhere=\"'1'='1'\", array $binds=[]\n , array $other=[]): object\n {\n self::$pp1 = $pp1 ;\n if (isset($pp1->shared_dbadapter_obj)) self::$utldb = $pp1->shared_dbadapter_obj ;\n\n $cursor = self::$utldb::get_cursor( //$pp1\n \"SELECT $dmlrr FROM \". self::$tbl .\" WHERE $qrywhere\"\n , $binds\n , $other=['caller' => __FILE__ .' '.', ln '. __LINE__ ] ) ;\n return $cursor ;\n }", "abstract public function newQuery();", "public function query($query)\n {\n $stmt = new Doctrine_Adapter_Statement_Oracle($this, $query, $this->executeMode);\n $stmt->execute();\n\n return $stmt;\n }", "function createQuery() ;", "public function customQueryAllWithParams($query) {\n $query[\"_flat\"] = true;\n $statement = Connect::ArangoBindStatementHandler(\n $this->_arangoConnect, $query\n );\n \n // execute the statement\n $cursor = $statement->execute();\n $cursor = $cursor->getAll();\n return $cursor;\n }", "public function prepare($query)\n {\n $stmt = new Doctrine_Adapter_Statement_Oracle($this, $query, $this->executeMode);\n\n return $stmt;\n }", "public function cursor(CursorInfo $cursor = null)\n {\n if(null === $cursor)\n {\n return $this->child('cursor');\n }\n return $this->child('cursor', $cursor);\n }", "public function load()\n {\n // Execute the query, add query to any thrown exceptions\n try\n {\n $this->_cursor = $this->collection()->find($this->_query, $this->_fields);\n }\n catch(MongoCursorException $e) {\n throw new MongoCursorException(\"{$e->getMessage()}: {$this->inspect()}\", $e->getCode());\n }\n catch(MongoException $e) {\n throw new MongoException(\"{$e->getMessage()}: {$this->inspect()}\", $e->getCode());\n }\n\n // Add cursor options\n foreach($this->_options as $key => $value)\n {\n if($value === NULL) $this->_cursor->$key();\n else $this->_cursor->$key($value);\n }\n\n return $this;\n }", "function Query($query)\n{\n global $Cn;\n try{\n $result =$Cn->query($query);\n $resultado = $result->fetchAll(PDO::FETCH_ASSOC);\n $result->closeCursor();\n return $resultado;\n }catch(Exception $e){\n die(\"Error en la LIN: \" . $e->getLine() . \", MSG: \" . $e->GetMessage());\n }\n}", "public function paginate(array $query = [])\n {\n $resource = Inflector::pluralize($this->getResourceName());\n\n return new CursorBasedPagination($this->client, $this, $resource, $query);\n }", "public function newQuery();", "private function getCommand($query): MongoCommand\n {\n try {\n $command = new MongoCommand($query);\n } catch (InvalidArgumentException $e) {\n new Exception('WriteConcern could not to be initiated');\n }\n return $command;\n }", "public static function query($query){\n if(!self::$connection){\n self::initDb();\n }\n\n return self::$connection->query($query);\n }", "abstract protected function initQuery(): void;", "protected function newInstance($query)\n {\n if ($this->common) {\n $class = \"Aura\\SqlQuery\\Common\";\n } else {\n $class = \"Aura\\SqlQuery\\\\{$this->db}\";\n }\n\n $class .= \"\\\\{$query}\";\n\n return new $class(\n $this->getQuoter(),\n $this->newSeqBindPrefix()\n );\n }", "public static function NewQuery()\r\n\t{\r\n\t\treturn new QSqlQuery();\r\n\t}", "public function execute($query=null)\n {\n return static::query($query);\n }", "public function query($query){\n return $this->connection->query($query);\n }", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function query($query){\n\t\t$this->lastQuery = $query;\n\t\treturn $this->connection->query($query);\n\t}", "public function connection($query,$justask='unset') \n {\n\t\t \n\t\ttry {\n\t\t\t/**\n\t\t\t * The PDO String connection is for mysql\n\t\t\t * Check the documentation for your database\n\t\t\t // */\n\t\t\t$options = array(\n\t\t\tPDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',\n\t\t\tPDO::MYSQL_ATTR_USE_BUFFERED_QUERY => FALSE,\n\t\t\t);\n\t\t\t$connection = new PDO(\n\t\t\t\"$this->site_db_type:host=$this->site_db_host;dbname=$this->site_db_name\", \n\t\t\t$this->site_db_user, \n\t\t\t$this->site_db_password,$options\n\t\t\t); \n\t\t\t\n\t\t\t$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t$connection->setAttribute(PDO::ATTR_AUTOCOMMIT, TRUE);\n\t\t\t$connection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n\t\t\t\n\t\t\t\n\t\t\t} catch ( PDOException $e ) {\n\t\t\t\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"<br/>\";\n\t\t\tdie();\n\t\t\t\n\t\t}\n $this->_connection = $connection;\n $this->setConnection($connection);\n $this->getPager();\n\t\t\n\t\tif (!empty($query) && $justask == 'unset')\n\t\t{ \n\t\t$sth = $connection->query($query);\n\t\t$sth->execute();\n\t\t$row = $sth->fetchAll(PDO::FETCH_ASSOC);\n\t\treturn $row;}\t\t\t\t\n\t\t\n\t\telse if ($justask != 'unset'){ return $connection;}\n }", "public function createQuery(): QueryInterface;", "public function __construct($query_string, $odbc_connection_id) {\n $this->query_string = $query_string;\n $this->connection_id = $odbc_connection_id;\n #$this->query_bound_variables = $query_bound_variables; #This should also be here if we iterate through the variables\n }", "public function query($query) {\n $this->result = $this->dbHandler->prepare($query);\n }", "public function newQuery()\n {\n return new self($this->connection, $this->processor);\n }", "protected function fetchObject($cursor = null, $class = 'stdClass')\n {\n if (!empty($cursor) && $cursor instanceof Statement) {\n $object = $cursor->fetch(\\PDO::FETCH_OBJ);\n } else {\n if ($this->prepared instanceof Statement) {\n $object = $this->prepared->fetch(\\PDO::FETCH_OBJ);\n }\n }\n\n if (!isset($object)) {\n return false;\n }\n\n $newObject = $object;\n if ($class !== 'stdClass') {\n $newObject = new $class;\n foreach (get_object_vars($object) as $key => $value) {\n $newObject->{$key} = $value;\n }\n }\n\n return $newObject;\n }", "private function _newConnection($host, $dbname, $username, $passwd, $options = NULL) \n\t{\n\t\t// setting default options if not provided\n\t\t$options || $options = array (\n\t\t\t\\PDO::MYSQL_ATTR_FOUND_ROWS => TRUE\n\t\t);\n\t\n\t\ttry {\n\t\t\t// connect to the database\n\t\t\t$this->_connection = new \\PDO ( 'mysql:host=' . $host . ';dbname=' . $dbname, $username, $passwd, $options );\n\t\t\t\t\n\t\t\t// set the error codes\n\t\t\t$this->_connection->setAttribute ( \\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION );\n\t\t} catch ( PDOException $e ) {\n\t\t\ttrigger_error ( 'Error connecting to host: ' . $e->getMessage (), E_USER_ERROR );\n\t\t}\n\t}", "function customQuery($query) \t{\n $res = $this->execute($query);\n\t\t return $res;\n\t}", "public static function InstantiateCursor(QDatabaseResultBase $objDbResult) {\n\t\t\t// If blank resultset, then return empty result\n\t\t\tif (!$objDbResult) return null;\n\n\t\t\t// If empty resultset, then return empty result\n\t\t\t$objDbRow = $objDbResult->GetNextRow();\n\t\t\tif (!$objDbRow) return null;\n\n\t\t\t// We need the Column Aliases\n\t\t\t$strColumnAliasArray = $objDbResult->QueryBuilder->ColumnAliasArray;\n\t\t\tif (!$strColumnAliasArray) $strColumnAliasArray = array();\n\n\t\t\t// Pull Expansions (if applicable)\n\t\t\t$strExpandAsArrayNodes = $objDbResult->QueryBuilder->ExpandAsArrayNodes;\n\n\t\t\t// Load up the return result with a row and return it\n\t\t\treturn CommunicationList::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t}", "public function getStatement($query){\n return $this->pdo->query($query);\n }", "public static function InstantiateCursor(QDatabaseResultBase $objDbResult) {\n\t\t\t// If blank resultset, then return empty result\n\t\t\tif (!$objDbResult) return null;\n\n\t\t\t// If empty resultset, then return empty result\n\t\t\t$objDbRow = $objDbResult->GetNextRow();\n\t\t\tif (!$objDbRow) return null;\n\n\t\t\t// We need the Column Aliases\n\t\t\t$strColumnAliasArray = $objDbResult->QueryBuilder->ColumnAliasArray;\n\t\t\tif (!$strColumnAliasArray) $strColumnAliasArray = array();\n\n\t\t\t// Pull Expansions (if applicable)\n\t\t\t$strExpandAsArrayNodes = $objDbResult->QueryBuilder->ExpandAsArrayNodes;\n\n\t\t\t// Load up the return result with a row and return it\n\t\t\treturn ComandoRisco::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t}", "function createQueryObject($ifc, $con){\r\n\t\tdie('Not implemented');\r\n\t}", "public function query($query)\n\t{\n\t\t// connect to the database\n\t\tself::_connect();\n\n\t\t// execute the query\n\t\t$res = self::_execute($query);\n\n\t\t// if $res isn't false, set the resource in our object\n\t\tif ($res)\n\t\t{\n\t\t\tself::$resource = $res;\n\t\t}\n\t\t// unset any existing resource on a failed query\n\t\telse if (isset(self::$resource))\n\t\t{\n\t\t\tunset(self::$resource);\n\t\t}\n\n\t\t// close the connection\n\t\tself::_disconnect();\n\t}", "public function cursor($query, $bindings = [], $useReadPdo = true)\n {\n $recordset = $this->run($query, $bindings, function ($query, $bindings) {\n if ($this->pretending()) {\n return [];\n }\n\n return $this->db->get_recordset_sql($query, $bindings);\n });\n\n foreach ($recordset as $record) {\n yield $record;\n }\n\n $recordset->close();\n }", "public function find($query = null)\n {\n return new ResultSet($this, $query);\n }", "function _connectAndExec( $sql ) {\r\n\t\t\t$this->_logSql( $sql );\r\n\t\t\t$this->connect();\r\n\t\t\t$stmt = OCIParse( $this->_conn, $sql );\r\n\t\t\tif ( ! $stmt ) {\r\n\t\t\t\t$error = ocierror( $stmt );\r\n\t\t\t\ttrigger_error( $error['message'], YD_ERROR );\r\n\t\t\t}\r\n\t\t\t$result = @OCIExecute( $stmt );\r\n\t\t\tif ( ! $result ) {\r\n\t\t\t\t$error = ocierror( $stmt );\r\n\t\t\t\tif ( ! empty( $error['sqltext'] ) ) { $error['message'] .= ' (SQL: ' . $error['sqltext'] . ')'; }\r\n\t\t\t\ttrigger_error( $error['message'], YD_ERROR );\r\n\t\t\t}\r\n\t\t\treturn $stmt;\r\n\t\t}", "public function cursor(string $cursor) : OffersRequestBuilder {\n return parent::cursor($cursor);\n }", "private function _init( $query )\n {\n # Connect to database\n $params = $this->parameters;\n\n if(!$this->getConnectionStatus()) { $this->connectToDb(); }\n try {\n # Prepare query\n $this->doQuery = $this->pdo->prepare( $query );\n\n # Bind parameters\n $this->bindParams( $params );\n # Execute SQL\n $this->doQuery->execute();\n }\n catch(\\PDOException $e)\n {\n # Exception\n }\n # Reset the parameters array\n $this->parameters = array();\n }", "public function newConn(){\n $tmp = clone $this;\n $tmp->tbl = \"\";\n $tmp->query = null;\n $tmp->conn = $this->conn;\n \n return $tmp;\n }", "public function cursor()\n {\n $this->_cursor OR $this->load();\n return $this->_cursor;\n }", "public function query($query){\n $this->result = oci_parse($this->con, $query);\n try{\n oci_execute($this->result);\n }catch(Exception $e){\n throw new Exception(\"Error en el query: \" . $e->getMessage());\n }\n }", "public function createQuery()\n {\n $query = &atknew(\"atk.db.atk{$this->m_current_clusternode->m_type}query\");\n $query->m_db = $this;\n return $query;\n }", "function query() {}", "static public function rr_all(\n string $dmlrr, string $qrywhere=\"'1'='1'\", array $binds=[]\n , array $other=[]): object //returns $cursor\n {\n //////// open cursor (execute-query loop is in view script)\n if ($category_from_url) \n {\n //3. SQL Query if FILTER BY C ATEGORY_ FROM_ U R L is active\n // *******************************************************************\n $cursor = $dm->rr(\"SELECT * FROM \".self::$tbl.\" WHERE category = :category_from_url ORDER BY datetime desc\"\n ,[ ['placeh'=>':category_from_url', 'valph'=>$category_from_url, 'tip'=>'str'] ]\n , __FILE__ .'() '.', ln '. __LINE__ );\n }\n // default SQL query\n else{\n $cursor = $dm->rr(\"SELECT * FROM \".self::$tbl.\" ORDER BY datetime desc\", [], __FILE__ .' '.', ln '. __LINE__) ;\n }\n\n //$dm::disconnect(); //problem ON LINUX\n return $cursor ;\n }", "public static function query( $query ) {\n global $edb;\n $conn = $edb->connect();\n try {\n $query = $conn->query($query);\n do {\n if ($query->columnCount() > 0) {\n $results = $query->fetchAll(PDO::FETCH_OBJ);\n }\n }\n while ($query->nextRowset());\n\n $conn = null;\n\n return $results;\n }\n catch (PDOException $e) {\n $conn = null;\n die ('Query failed: ' . $e->getMessage());\n }\n }", "public function __construct($query)\n\t{\n $this->query = $query;\n }", "function query($query) {\n\t\treturn $this->dbcr_query( $query, true );\n\t}", "public function getXqlCursor () {\n $this->xmldb->getXqlCursor();\n }", "public function prepare(): Query\n {\n if (null === $this->dbc) {\n throw new RuntimeException('No database connection set for query.');\n }\n $this->statement = $this->dbc->getStatement($this->generateQuery());\n return $this;\n }", "public function query($query){ \n\t\tif($r = $this->mysqli->query($query)){\n\t\t\t$rows = array();\n\t\t\twhile(is_object($r) && $row = $r->fetch_assoc()){\n\t\t\t\t$rows[]= $row;\n\t\t\t}\n\t\t\t$result = new DB_result($rows, $query);\n\t\t\treturn $result;\n\t\t}\n\t\techo $this->mysqli->error . \"<br><br>\";\n\t\tdie(\"{$query}\");\n\n\t}", "public function query($query){\n return pg_query($this -> connect(), $query);\n }", "public function getXqueryCursor () {\n $this->xmldb->getCursor();\n }", "abstract protected function initQuery(Query $query): Query;", "public function execute($query);", "public function query($query)\n {\n $result = $this->db->query($query);\n $result->execute();\n return $result;\n }", "public function executeQuery($query) {\r\n\t\t\r\n\t\t$this->mdb2->connect();\r\n\t\t\t\t\r\n\t\t$ResultSet = $this->mdb2->query($query);\r\n\t\t\r\n\t\t$this->mdb2->disconnect();\r\n\t\t\r\n\t\tif (PEAR::isError($ResultSet)) {\r\n\t\t\tdie($ResultSet->getMessage() . \": \" . $query);\r\n\t\t}\r\n\t\t\r\n\t\treturn $ResultSet;\r\n\t\t\r\n\t}", "public function __construct() { \n\t\t$this->Connection = new RDataConnection();\t// connection object\n\t\t$this->buildQuery = array(\n\t\t\t'query' \t=> array(),\n\t\t\t'select' \t=> array(),\n\t\t\t'where' \t=> array(),\n\t\t\t'insert' \t=> array(),\n\t\t\t'update' \t=> array(),\n\t\t\t'join' \t=> array(),\n\t\t\t'orderBy' \t=> array(),\n\t\t\t'limit'\t\t=> array(),\n\t\t\t'groupBy' \t=> array(),\n\t\t\t'having' \t=> array(),\n\t\t\t'from' \t=> array(),\n\t\t\t'delete' \t=> array()\n\t );\t\t\t\t\t\t\t \n\t\t$this->params = array();\t\n\t\t$this->types = array();\t\t\n\t\t$this->customQuery = array();\t\n\t\t$this->customParams = array();\t\n\t\t$this->customTypes = array();\t\n\t\t$this->addFoundRows = false;\t\n\t\t$this->queryType = self::SELECT;\n\t\tself::$inputIdx = 0;\n\t\t//$this->debug = (defined('DEV_MODE') && constant('DEV_MODE') === true); \n\t\t$this->debug = isDevMode(); \n\t\t\t\n\t\t// init connection\n\t\t//$this->Connection->Connect(CONNECTION_TYPE,DATABASE_USERNAME,DATABASE_PASSWORD,DATABASE_NAME,DATABASE_HOST,DATABASE_PORT);\n\t\t$this->Connection->Connect('mysql',DATABASE_USERNAME,DATABASE_PASSWORD,DATABASE_NAME,DATABASE_HOST,DATABASE_PORT);\n\t}", "public function find($collection_name, $query = array(), $options = array()) {\r\n\t\t$collection = $this->database->selectCollection($collection_name);\r\n\t\t$fields = isset($options['fields']) ? $options['fields'] : [];\r\n\t\t$cursor = $collection->find($query, $fields);\r\n\t\tif (isset($options['sort']) && $options['sort'] !== null) {\r\n\t\t\t$cursor->sort($options['sort']);\r\n\t\t}\r\n\t\tif (isset($options['limit']) && $options['limit'] !== null) {\r\n\t\t\t$cursor->limit($options['limit']);\r\n\t\t}\r\n\t\tif (isset($options['skip']) && $options['skip'] !== null) {\r\n\t\t\t$cursor->skip($options['skip']);\r\n\t\t}\r\n\t\treturn $cursor;\r\n\t}", "function query($query) \n \t{\n \t\tif ( is_object($query) )\n \t\t\t$queryString = $query->getSQL();\n \t\telse\n \t\t\t$queryString = $query;\n \t\t\t\n \t\tif ($this->queryId) \n \t\t{\n \t\t\t@mysql_free_result($this->queryId);\n \t\t\t$this->queryId = 0;\n \t\t}\n\n \t\t$this->queryId = @mysql_query($queryString, $this->linkId);\n\t \tif (!$this->queryId)\n\t \t{\n\t \t\techo $query . \"<br>\";\n\t \t\tnew CException(mysql_error(), __FILE__, __LINE__);\n\t \t}\n\n \t\t$this->row = 0;\n \t\t\n \t\treturn $this->queryId;\n \t}", "public function newQuery($action,$name=null){\n $name = isset($name) ? $name : count($this->querys);\n $this->querys[$name] = new ECP_DatabaseQuery($action,$this->_conf);\n return $this->querys[$name];\n }", "public static function selectFromCursor($cn, $stmt)\n {\n $pstmt = $cn->prepare($stmt, array(\\PDO::CURSOR_FWDONLY, \\PDO::ATTR_CURSOR));\n $pstmt->execute();\n return $pstmt->fetchAll();\n }", "function Query($par_Query)\n\t{\n\t\t//PSK_Log::getInstance()->WriteLog($par_Query, PSK_ET_APPWARNING); \n\n\t\tif ($this->__connected /*&& (is_a($this->__connection, 'PDO'))*/) {\n\t\t\t$query = new PSK_DBQuery_PDOMySQL($this);\n\t\t\t$result = $this->__connection->query($par_Query);\n\t\t\t$query->setResultSet($result);\n\t\t\treturn $query;\n\t\t} else {\n\t\t\tthrow new Exception(PSK_STR_DB_NOOPENCONNECTION);\n\t\t}\n\t}", "function resourceForQuery($query) {\n $result = mysql_query(replaceConstantForQuery($query)) or trigger_error(mysql_error() . \" @ \" . $query);\n \n return $result;\n }", "private function _prepareQuery() \n\t{\n\t\t\t// Establish connection to the database if not already connected\n\t\tif (! $this->_connection || empty($this->_connection)) {\n\t\t\t\n\t\t\t // retrieve the database configuration from the registry\n\t\t\t$config = Registry::getSetting('dbConfig');\n\t\t\t\n\t\t\t$this->_newConnection(\n\t\t\t\t\t$config['host'], \n\t\t\t\t\t$config['database'], \n\t\t\t\t\t$config['user'], \n\t\t\t\t\t$config['password']);\n\t\t}\n\t\t\n\t\tif (! $stmt = $this->_connection->prepare ( $this->_query )) {\n\t\t\ttrigger_error ( 'Problem preparing query', E_USER_ERROR );\n\t\t}\n\t\t$this->_stmt = $stmt;\n\t}", "function __construct() { //se sobreescribe ...funciona ok\n //$c= new ConexionOracle();\n $this->coneccion=new ConexionOracle();\n //echo 'se ejecuto el constructor de la clase sQueryOracle';\n }", "public function fetch(string $query, $values = [], $binds = '', bool $openConnection = true) : ?MysqlResultCollection;", "protected function query() {\n\t\treturn new Query($this);\n\t}", "function executeqry($query){\n \n$conn= self::connect();\n \n $stid = oci_parse($conn, $query);\n oci_execute($stid);\n \n oci_close($conn);\n \n return $stid; \n }", "public function query($query)\n {\n $this->dbStmt = $this->dbHandler->prepare($query);\n }", "public function fetch_object($query);", "abstract function executeQuery($cons);", "public static function InstantiateCursor(QDatabaseResultBase $objDbResult) {\n\t\t\t// If blank resultset, then return empty result\n\t\t\tif (!$objDbResult) return null;\n\n\t\t\t// If empty resultset, then return empty result\n\t\t\t$objDbRow = $objDbResult->GetNextRow();\n\t\t\tif (!$objDbRow) return null;\n\n\t\t\t// We need the Column Aliases\n\t\t\t$strColumnAliasArray = $objDbResult->QueryBuilder->ColumnAliasArray;\n\t\t\tif (!$strColumnAliasArray) $strColumnAliasArray = array();\n\n\t\t\t// Pull Expansions (if applicable)\n\t\t\t$strExpandAsArrayNodes = $objDbResult->QueryBuilder->ExpandAsArrayNodes;\n\n\t\t\t// Load up the return result with a row and return it\n\t\t\treturn StewardshipPledge::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t}", "public function selectOne(string $query, array $bindings = []): PDOConnection{\n\t\t$stmt = $this->conn->prepare($query);\n\t\t$stmt = $this->bindValues($stmt, $bindings);\n\t\t$stmt->execute();\n\t\t$this->stmt = $stmt;\n\t\treturn $this->stmt->fetchObject(__CLASS__);\n\t}", "protected function cursorPaginator($items, $perPage, $cursor, $options)\n {\n return Container::getInstance()->makeWith(CursorPaginator::class, compact(\n 'items', 'perPage', 'cursor', 'options'\n ));\n }", "public function newQuery()\n {\n return new self($this->connection, $this->grammar, $this->getProcessor());\n }", "abstract public function execute($query);", "public function query($query,\n $fetchType = null,\n $typeArg = null,\n array $ctorArgs = array())\n {\n $stmt = $this->prepare($query);\n $stmt->execute();\n\n return $stmt;\n }", "function getOne($query, array $binds = [], $conn)\n{\n $statement = $conn->prepare($query);\n foreach($binds as $key => $value) {\n $statement->bindValue($key, $value);\n }\n $statement->execute();\n $result = $statement->fetch();\n $statement->closeCursor();\n return $result;\n}", "public function closeCursor();", "protected function execute_single_query(){\n\t\t$this -> open_connection();\n\t\t$this -> conn -> query($this -> query);\n\t\t$this -> close_connection();\n\t}", "public function __construct($connection, $query, $bindings, $fetchMethod, $fetchMode)\n\t{\n\t\t$this->connection = $connection;\n\n\t\t$this->query = $this->connection->prepare($query);\n\n\t\t// If there are any bindings for the prepared statement we store them\n\t\tif ($bindings) {\n\t\t\t$this->params = $this->params + $bindings;\n\t\t}\n\n\t\t$this->fetchMethod = $fetchMethod;\n\n\t\t// If a fetch more was specified we store it\n\t\tif ($fetchMode) {\n\t\t\t$this->fetchMode = $fetchMode;\n\t\t}\n\n\t\t$this->execute();\n\t}", "public function ejecutar_una_consulta($query){\n $response=self::ConnectDB()->prepare($query);\n $response->execute();\n return $response;\n }", "function createConnection($host,$userName,$userPass){\n //Try to go and create a new PDO based connection...\n $conn = oci_connect($userName,$userPass,$host);\n\n //Set the variable to the conn.\n $this->setCONN($conn);\n\n //if there is any errors\n if(!$conn){\n //Set error\n #error variable is $error\n $error = oci_error();\n\n //Display an error on connection errors.\n trigger_error(htmlentities($error['message'],ENT_QUOTES),E_USER_ERROR);\n }\n\n\n\n }", "public static function InstantiateCursor(QDatabaseResultBase $objDbResult) {\n\t\t\t// If blank resultset, then return empty result\n\t\t\tif (!$objDbResult) return null;\n\n\t\t\t// If empty resultset, then return empty result\n\t\t\t$objDbRow = $objDbResult->GetNextRow();\n\t\t\tif (!$objDbRow) return null;\n\n\t\t\t// We need the Column Aliases\n\t\t\t$strColumnAliasArray = $objDbResult->QueryBuilder->ColumnAliasArray;\n\t\t\tif (!$strColumnAliasArray) $strColumnAliasArray = array();\n\n\t\t\t// Pull Expansions\n\t\t\t$objExpandAsArrayNode = $objDbResult->QueryBuilder->ExpandAsArrayNode;\n\t\t\tif (!empty ($objExpandAsArrayNode)) {\n\t\t\t\tthrow new QCallerException (\"Cannot use InstantiateCursor with ExpandAsArray\");\n\t\t\t}\n\n\t\t\t// Load up the return result with a row and return it\n\t\t\treturn PersonWithLock::InstantiateDbRow($objDbRow, null, null, null, $strColumnAliasArray);\n\t\t}", "public function query($query) {\r\n return $this->PDOInstance->query($query);\r\n }", "public function setCursor($var)\n {\n GPBUtil::checkString($var, True);\n $this->cursor = $var;\n }", "function db_query ($query, array $parameters = array()) {\n $statement = db_connect()->prepare($query);\n $statement->execute($parameters);\n \n return $statement;\n}", "protected function query($query)\n {\n if (! $this->isConnected) {\n $this->connectDB();\n }\n return $this->link->query($query);\n }", "public function query($query);", "public function query($query);", "public function query($query);", "function instance($conn, $sql, $params){\n $data = q($conn, $sql, $params);\n\n if (count($data) > 0)\n return $data[0];\n else\n return null;\n}" ]
[ "0.646304", "0.62126166", "0.61816925", "0.61503655", "0.6074052", "0.5918917", "0.58335066", "0.57481873", "0.56561756", "0.56295484", "0.5409702", "0.5391621", "0.5381549", "0.53810734", "0.532112", "0.52801424", "0.5257124", "0.525689", "0.5254592", "0.5247009", "0.5231564", "0.522925", "0.5193723", "0.5185515", "0.5165096", "0.51639825", "0.51639825", "0.51639825", "0.51406", "0.5125445", "0.51117927", "0.5108811", "0.5098806", "0.50828266", "0.5075809", "0.5056362", "0.5047524", "0.50344247", "0.5008517", "0.5005884", "0.5005479", "0.4993421", "0.49861515", "0.49861035", "0.49820426", "0.49749053", "0.4970622", "0.49697953", "0.4965143", "0.4957628", "0.4947849", "0.4947189", "0.49408728", "0.49354014", "0.49218196", "0.491922", "0.49175274", "0.4915556", "0.49097997", "0.49023542", "0.4900043", "0.48963565", "0.48879868", "0.4871034", "0.4870677", "0.48687488", "0.4859424", "0.4830454", "0.48301798", "0.4824625", "0.48186776", "0.481867", "0.4815445", "0.48048133", "0.479366", "0.47913948", "0.4787787", "0.47869816", "0.47764406", "0.47738642", "0.4766308", "0.47641343", "0.47547153", "0.4754247", "0.47497156", "0.47443482", "0.4744008", "0.47425732", "0.47420517", "0.47419322", "0.47401088", "0.47359404", "0.4735265", "0.47336012", "0.473332", "0.4731255", "0.47294033", "0.47275236", "0.47275236", "0.47275236", "0.47264257" ]
0.0
-1
Get the fetch mode
public function getFetchMode() { return $this->fetchModeAndArgs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFetchMode()\n {\n return $this->fetchMode;\n }", "public function getFetchMode()\n\t{\n\t\treturn $this->fetchMode;\n\t}", "public function getSingleFetchMode()\n {\n return $this->singleFetchMode;\n }", "public function fetchMode($arg);", "private function _get_fetch_mode_complete() {\n $current_fetch = $this->fetch_mode;\n $current_cl = $this->fetch_receptacle;\n $current_ctor = $this->ctor_args;\n return [\n $current_fetch,\n $current_cl,\n $current_ctor,\n ];\n }", "public function setFetchMode($mode) {\n\t\t$this->_defaultFetchMode = $mode;\n\t}", "private static function setFetchType( $mode )\n {\n switch ( $mode ):\n case 'assoc':\n return self::$stmt->setFetchMode( \\PDO::FETCH_ASSOC );\n case 'bound':\n return self::$stmt->setFetchMode( \\PDO::FETCH_BOUND );\n case 'both':\n return self::$stmt->setFetchMode( \\PDO::FETCH_BOTH );\n case 'class':\n return self::$stmt->setFetchMode( \\PDO::FETCH_CLASS, self::$FETCH_CLASS );\n case 'class_prop':\n return self::$stmt->setFetchMode( \\PDO::FETCH_CLASS | \\PDO::FETCH_PROPS_LATE, self::$FETCH_CLASS, self::$_FETCH_CLASS_PARAMS );\n case 'class_type':\n return self::$stmt->setFetchMode( \\PDO::FETCH_CLASS | \\PDO::FETCH_CLASSTYPE );\n case 'column':\n return self::$stmt->setFetchMode( \\PDO::FETCH_COLUMN, self::$FETCH_OFFSET );\n case 'column_group':\n return self::$stmt->setFetchMode( \\PDO::FETCH_GROUP, self::$FETCH_OFFSET );\n case 'column_unique':\n return self::$stmt->setFetchMode( \\PDO::FETCH_UNIQUE, self::$FETCH_OFFSET );\n case 'func':\n return self::$stmt->setFetchMode( \\PDO::FETCH_FUNC, self::$FETCH_FUNC );\n case 'into':\n return self::$stmt->setFetchMode( \\PDO::FETCH_INTO, self::$FETCH_CLASS );\n case 'key_pair':\n return self::$stmt->setFetchMode( \\PDO::FETCH_KEY_PAIR );\n case 'lazy':\n return self::$stmt->setFetchMode( \\PDO::FETCH_LAZY );\n case 'named':\n return self::$stmt->setFetchMode( \\PDO::FETCH_NAMED );\n case 'num':\n return self::$stmt->setFetchMode( \\PDO::FETCH_NUM );\n case 'obj':\n return self::$stmt->setFetchMode( \\PDO::FETCH_OBJ );\n case 'serialize':\n return self::$stmt->setFetchMode( \\PDO::FETCH_SERIALIZE );\n default:\n return self::$stmt->setFetchMode( \\PDO::FETCH_ASSOC );\n endswitch;\n }", "public function getMode()\n {\n if (isset($this->data[\"mode\"])) {\n return $this->data[\"mode\"];\n }\n if (isset($this->data['external'])) {\n return \"prefer_local\";\n }\n return \"only_local\";\n }", "public function setFetchMode($fetchMode);", "public function set_fetchMode($type)\r\n {\r\n }", "function getMode() {\n\t\treturn $this->get('mode');\n\t}", "public function CMSFetchMode($mode)\n {\n $this->cmsFetchMode = $mode;\n }", "public function fetch($fetchMode = \\PDO::FETCH_BOTH);", "protected function getMode() {\n\t\treturn $this->mode;\n\t}", "public function setFetchMode($fetch_mode) {\n\t\t$this->fetchMode = $fetch_mode;\n\t}", "public function getCacheMode()\n {\n return isset($this->cache_mode) ? $this->cache_mode : '';\n }", "function getMode() {\n\t\treturn $this->mode;\n\t}", "private function correctFetchMode($PearDBFetchMode=DB_FETCHMODE_DEFAULT) {\n\t\tswitch($PearDBFetchMode) {\n\t\t\tcase DB_FETCHMODE_OBJECT:\n\t\t\t\t$fetch = PDO::FETCH_OBJ;\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_ASSOC:\n\t\t\t\t$fetch = PDO::FETCH_ASSOC;\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_ORDERED:\n\t\t\tcase DB_FETCHMODE_DEFAULT:\n\t\t\t\t$fetch = PDO::FETCH_NUM;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception(sprintf(_(\"Unknown SQL fetchmode of %s\"),$fetch));\n\t\t\tbreak;\n\t\t}\n\t\treturn $fetch;\n\t}", "public function getMode() {\n return $this->mode;\n }", "public function getMode() {\n return $this->mode;\n }", "public function getMode() {\n return $this->mode;\n }", "public function setFetchMode ($mode)\n {\n // check for PDO extension\n //if (! extension_loaded('pdo')) {\n /**\n *\n * @see EhrlichAndreas_Db_Exception\n */\n // throw new EhrlichAndreas_Db_Exception('The PDO extension is required for this adapter but the extension is not loaded');\n //}\n switch ($mode)\n {\n case EhrlichAndreas_Db_Abstract::FETCH_LAZY:\n \n case EhrlichAndreas_Db_Abstract::FETCH_ASSOC:\n \n case EhrlichAndreas_Db_Abstract::FETCH_NUM:\n \n case EhrlichAndreas_Db_Abstract::FETCH_BOTH:\n \n case EhrlichAndreas_Db_Abstract::FETCH_NAMED:\n \n case EhrlichAndreas_Db_Abstract::FETCH_OBJ:\n \n $this->_fetchMode = $mode;\n\n break;\n\n default:\n /**\n *\n * @see EhrlichAndreas_Db_Exception\n */\n throw new EhrlichAndreas_Db_Exception(\"Invalid fetch mode '$mode' specified\");\n\n break;\n }\n }", "public function getMode()\n {\n return $this->mode;\n }", "public function getMode()\n {\n return $this->mode;\n }", "public function getMode()\n {\n return $this->mode;\n }", "public function getMode()\n {\n return $this->mode;\n }", "public function getMode()\n {\n return $this->mode;\n }", "public function getMode()\n {\n return $this->mode;\n }", "public function getMode()\n {\n return $this->mode;\n }", "function getMode() {\n\t\treturn $this->_mode;\n\t}", "function getMode() {\n\t\treturn $this->_mode;\n\t}", "public function getMode();", "public function getMode();", "public function getMode();", "public function getMode();", "function getMode()\n {\n return $this->mode;\n }", "public function getMode()\n {\n return $this->_mode;\n }", "public function getMode()\n\t{\n\t\treturn $this->mode;\n\t}", "public function getMode()\n\t{\n\t\treturn $this->mode;\n\t}", "public static function getMode()\n {\n return self::$_mode;\n }", "function getMode()\n {\n return $this->mode;\n }", "public static function getMode();", "final public function getMode(): int {}", "public function GetMode()\n\t{\n\t\treturn $this->mode;\n\t}", "private function correctFetchMode($PearDBFetchMode=DB_FETCHMODE_DEFAULT) {\n\t\tswitch($PearDBFetchMode) {\n\t\t\tcase DB_FETCHMODE_OBJECT:\n\t\t\t\t$fetch = PDO::FETCH_OBJ;\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_ASSOC:\n\t\t\t\t$fetch = PDO::FETCH_ASSOC;\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_DEFAULT:\n\t\t\t\t$fetch = $this->correctFetchMode($this->defaultFetch);\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_ORDERED:\n\t\t\t\t$fetch = PDO::FETCH_NUM;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception(sprintf(_(\"Unknown SQL fetchmode of %s\"),$fetchmode));\n\t\t\tbreak;\n\t\t}\n\t\treturn $fetch;\n\t}", "public function mode()\n\t{\n\t\treturn $this->mode;\n\t}", "public function getMode()\n {\n return;\n }", "public function getMode(): string\n {\n return $this->mode;\n }", "public function setFetchMode($fetchMode) {\n $this->_fetchMode = $fetchMode;\n }", "public function getMode()\n {\n $env = $this->reader->load(ConfigFilePool::APP_ENV);\n return isset($env[State::PARAM_MODE]) ? $env[State::PARAM_MODE] : null;\n }", "public function mode()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" mode ?\");\n\t}", "public function SetPdoFetchMode($mode = PDO::FETCH_ASSOC)\n {\n $this->pdoFetch = $mode;\n }", "public function getMode(): string;", "public function getMode()\n {\n $value = $this->_config->get('dataprocessing/general/mode');\n\n if ($value === null) {\n $value = 'products';\n }\n\n return $value;\n }", "public function getMode() {\n return (isset($this->mode)) ? $this->mode : 'public';\n }", "public function setFetchMode($fetchMode)\n {\n $this->fetchMode = $fetchMode;\n }", "function getMode() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_TRANSFER_MODE, FTP_ASCII);\r\n\t}", "public function getCurrentMode()\n {\n $params = request()->input();\n\n if (isset($params['mode']))\n return $params['mode'];\n\n return 'grid';\n }", "function setFetchMode($mode, $params=null) \n {\n $ret = call_user_func_array(array('parent', 'setFetchMode'), func_get_args());\n return $ret ? $this : $ret;\n }", "private function getSelectQueryFetchType()\n {\n switch ($this->returnType) {\n case ExtendedPDO::RETURN_TYPE_OBJECT:\n return \\PDO::FETCH_OBJ;\n case ExtendedPDO::RETURN_TYPE_ASSOC:\n return \\PDO::FETCH_ASSOC;\n }\n return $this->returnType;\n }", "final public function mode():string\n {\n return $this->mode;\n }", "public function setFetchMode(int $mode, mixed ...$args);", "public function getCurrentMode()\n\t{\n\t\tif ($this->getHidepriceModel()->getId()) {\n\t\t\treturn $this->getHidepriceModel()->getMode();\n\t\t}\n\n\t\treturn 0;\n\t}", "public function setFetchMode($mode, $fetch_arga = NULL, $fetch_argb = NULL)\r\n\t{\r\n\t\tswitch($mode)\r\n\t\t{\r\n\t\t\tcase LikePDO::FETCH_ASSOC :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_ASSOC;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_BOTH :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_BOTH;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_BOUND :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_BOUND;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_CLASS :\r\n\t\t\t\tif(!class_exists($fetch_arga))\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new LikePDOException(\"No fetch class specified\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif($fetch_argb)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!is_array($fetch_argb))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthrow new LikePDOException(\"Warning: LikePDOStatement::setFetchMode() expects parameter 3 to be array on parameter 1 is FETCH_CLASS, \".gettype($fetch_argb).\" given\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->fetchModeArguments = $fetch_argb;\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$this->fetchModeArguments = array();\r\n\t\t\t\t}\t\r\n\t\t\t\t\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_CLASS;\r\n\t\t\t\t$this->fetchModeDefinition = $fetch_arga;\r\n\t\t\tbreak;\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_INTO :\r\n\t\t\t\tif(!is_object($fetch_arga))\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new LikePDOException(\"No fetch class specified\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_INTO;\r\n\t\t\t\t$this->fetchModeDefinition = $fetch_arga;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_LAZY :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_LAZY;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_NAMED :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_NAMED;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_NUM :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_NUM;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_OBJ :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_OBJ;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tdefault :\r\n\t\t\t\tthrow new LikePDOException(\"Invalid fetch mode\");\r\n\t\t\t\treturn false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function fetch(int $mode = \\PDO::ATTR_DEFAULT_FETCH_MODE, int $cursorOrientation = PDO::FETCH_ORI_NEXT, int $cursorOffset = 0);", "public function mode(...$mode)\n\t{\n\t\tif (!$this->setFetchMode(...$mode))\n\t\t{\n\t\t\tthrow new UnableToSetFetchMode($mode);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getBootloaderMode()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_BOOTLOADER_MODE, $payload);\n\n $payload = unpack('C1mode', $data);\n\n return $payload['mode'];\n }", "public function SetFetchMode($value)\n {\n $this->init();\n try {\n return $this->db->SetFetchMode($value);\n } catch (Exception $e) {\n trigger_error('ERROR SQL STATS: Error Caught: ' . print_r($e, 1));\n return false;\n }\n }", "public function setFetchmode(Fetchmode $fetchmode) {\n $this->fetchmode[$fetchmode->getPath()]= $fetchmode->getMode();\n return $this;\n }", "private function getMode()\n {\n $mode = $this->mode;\n $conf_view = $this->conf_view;\n\n\n $sumOfModes = count( $conf_view );\n\n // RETURN false : there isn't any single view\n if ( $sumOfModes < 1 )\n {\n // RETURN : no DRS prompt needed\n if ( !$this->pObj->b_drs_error )\n {\n return false;\n }\n\n // RETURN : DRS prompt\n $this->getModeDRSnoView();\n return false;\n }\n\n // mode isn't proper. Move it to 1.\n if ( $mode > $sumOfModes )\n {\n $mode = 1;\n }\n\n return $mode;\n }", "public function get_mode() {\n global $SESSION;\n if (isset($SESSION->homeworkblockmode)) {\n return $SESSION->homeworkblockmode;\n }\n\n $possiblemodes = $this->get_possible_modes();\n $SESSION->homeworkblockmode = $possiblemodes[0];\n return $possiblemodes[0];\n }", "public function setFetchMode(string $fetchMode): DatabaseProviderInterface\n {\n $this->container['config']['database.fetch'] = $fetchMode;\n\n return $this;\n }", "public function setFetchMode(int $mode, mixed ...$args)\n {\n switch ($mode) {\n case PDO::FETCH_ASSOC:\n case PDO::FETCH_BOTH:\n case PDO::FETCH_OBJ:\n $this->fetchMode = $mode;\n\n break;\n default:\n throw new CacheException('Requested fetch mode is not yet supported.');\n }\n\n return true;\n }", "public function getIterationMode();", "public function getMode(): ?int\n {\n return $this->mode;\n }", "public function getFetch()\n {\n return $this->get(self::_FETCH);\n }", "function Get_Mode($url)\n\t{\n\t\t\n\t\tif (preg_match('/\\.ds(\\d+)\\.tss/', $url))\n\t\t{\n\t\t\t$mode = MODE_LOCAL;\n\t\t}\n\t\telseif (preg_match('/^rc\\./', $url))\n\t\t{\n\t\t\t$mode = MODE_RC;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$mode = MODE_LIVE;\n\t\t}\n\t\t\n\t\treturn($mode);\n\t\t\n\t}", "public function getMode() : string\n {\n return $this->getRequest()->getParam($this->getBlockViewModeParameter(), \"grid\");\n }", "public function GetAutoCommitMode()\r\n {\r\n $this->checkDatabaseManager();\r\n $query = \"SELECT @@autocommit\";\r\n $this->_TotalQueries++;\r\n $this->_LastQuery = $query;\r\n $startTime = microtime(true);\r\n $res = $this->_DatabaseHandler->query($query)->fetch_row()[0];\r\n $this->_LastQueryElapsedTime = microtime(true) - $startTime;\r\n $this->_TotalExecutionTime += $this->_LastQueryElapsedTime;\r\n return $res;\r\n }", "function getApiMode()\n {\n return $this->_props['ApiMode'];\n }", "public function delegateFetch(DbalStatement $dbal_statement, $mode, $fetch_class);", "public function getListMode(): string;", "abstract public function fetch($fetchType = \\PDO::FETCH_ASSOC);", "public function getPageMode() {}", "private function getMode($code){\n\t\t\treturn $this->query_modes[$code];\n\t\t}", "private function getMode($code){\n\t\t\treturn $this->query_modes[$code];\n\t\t}", "public function get_status() {\n\t\tif ( array_key_exists( self::STATUS, $this->ryte_option ) ) {\n\t\t\treturn $this->ryte_option[ self::STATUS ];\n\t\t}\n\n\t\treturn self::CANNOT_FETCH;\n\t}", "public function getOutputMode()\n {\n return $this->output_mode;\n }", "public function getAuthMode() {}", "function get_db_stat($mode)\n{\n\tglobal $db;\n\n\tswitch( $mode )\n\t{\n\t\tcase 'usercount':\n\t\t\t$sql = \"SELECT COUNT(user_id) AS total\n\t\t\t\tFROM \" . USERS_TABLE . \"\n\t\t\t\tWHERE user_id <> \" . ANONYMOUS;\n\t\t\tbreak;\n\n\t\tcase 'newestuser':\n\t\t\t$sql = \"SELECT user_id, username\n\t\t\t\tFROM \" . USERS_TABLE . \"\n\t\t\t\tWHERE user_id <> \" . ANONYMOUS . \"\n\t\t\t\tORDER BY user_id DESC\n\t\t\t\tLIMIT 1\";\n\t\t\tbreak;\n\n\t\tcase 'postcount':\n\t\tcase 'topiccount':\n\t\t\t$sql = \"SELECT SUM(forum_topics) AS topic_total, SUM(forum_posts) AS post_total\n\t\t\t\tFROM \" . FORUMS_TABLE;\n\t\t\tbreak;\n\t}\n\n\tif ( !($result = $db->sql_query($sql)) )\n\t{\n\t\treturn false;\n\t}\n\n\t$row = $db->sql_fetchrow($result);\n\n\tswitch ( $mode )\n\t{\n\t\tcase 'usercount':\n\t\t\treturn $row['total'];\n\t\t\tbreak;\n\t\tcase 'newestuser':\n\t\t\treturn $row;\n\t\t\tbreak;\n\t\tcase 'postcount':\n\t\t\treturn $row['post_total'];\n\t\t\tbreak;\n\t\tcase 'topiccount':\n\t\t\treturn $row['topic_total'];\n\t\t\tbreak;\n\t}\n\n\treturn false;\n}", "private function _getMode()\n {\n if ($this->_mcryptMode == '') {\n $this->_mcryptMode = MCRYPT_MODE_CBC;\n }\n return $this->_mcryptMode;\n }", "public function getDisplayMode()\n\t\t{\n\t\t\treturn isset($this->state['mode'])\n\t\t\t\t\t? $this->state['mode']\n\t\t\t\t\t: self::DEFAULT_DISPLAY_MODE;\n\t\t}", "public function getTMode()\n {\n return $this->transport_fk;\n }", "private function getTransactionMode()\n {\n $gatewayUrl = $this->requestParser->getGatewayUrl(['apiOperation' => 'PAYMENT_OPTIONS_INQUIRY']);\n $jsonResponse = $this->transactionHandler->getTransactionResponse($gatewayUrl);\n $responseArray = json_decode($jsonResponse, true);\n $transactionMode = $responseArray['transactionMode'];\n if ($transactionMode === 'PURCHASE')\n return 'PAY';\n else\n return 'AUTHORIZE';\n\n }", "public function getAuthMode();", "public function getUserMode()\n {\n return($this->options['userMode']);\n }", "public function getMode()\n {\n return $this->base.($this->plus ? '+' : '').$this->flag;\n }", "public function getLookupMode() {}", "public static function defaultReturnType()\n {\n return Configuration::get('database.fetchType', self::FETCH_ASSOC);\n }", "public function getSortMode()\n {\n return $this->sortMode;\n }" ]
[ "0.88492507", "0.88359755", "0.7688645", "0.73517036", "0.71193796", "0.7099569", "0.697338", "0.69626397", "0.69553506", "0.69322205", "0.68911964", "0.6881433", "0.68512225", "0.6844698", "0.6824973", "0.67894274", "0.67286074", "0.6707479", "0.6687623", "0.6687623", "0.6682578", "0.668032", "0.6680151", "0.6680151", "0.6680151", "0.6680151", "0.6680151", "0.6680151", "0.6680151", "0.66584164", "0.66584164", "0.6636335", "0.6636335", "0.6636335", "0.6636335", "0.6633683", "0.6619969", "0.6611661", "0.6611661", "0.66050047", "0.6584607", "0.65835387", "0.65801305", "0.65581393", "0.6550101", "0.6528177", "0.65281546", "0.6517607", "0.63886863", "0.6309964", "0.63001657", "0.6289314", "0.62807393", "0.6274788", "0.62683463", "0.6265774", "0.6250468", "0.62019455", "0.6201378", "0.61755437", "0.6158894", "0.61551476", "0.61483085", "0.6096653", "0.6084358", "0.6067616", "0.6033888", "0.60033166", "0.5994448", "0.5950319", "0.5938592", "0.5935553", "0.5925236", "0.5919942", "0.59147155", "0.58931684", "0.58928794", "0.58718616", "0.586105", "0.5840547", "0.5837256", "0.58104765", "0.58037215", "0.57958174", "0.577392", "0.577392", "0.5767445", "0.576712", "0.5730413", "0.5729559", "0.5716644", "0.57078713", "0.5697498", "0.56966853", "0.5689025", "0.56812596", "0.5660504", "0.56567097", "0.5651763", "0.5648859" ]
0.86798507
2
Store a new order
public function save(ServerRequestInterface $request, ResponseInterface $response) { $data = $request->getParsedBody(); return $response->withJson($this->service->createNewOrder((float)$data['value'])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function saveOrder() {\n $currentDate = new Zend_Date();\n $customer = Customer::findByEmail($this->getRequest()->getParam('email'));\n $customer->name = $this->getRequest()->getParam('name');\n $customer->phone = $this->getRequest()->getParam('phone');\n\n $ord = new Order();\n $ord->Customer = $customer;\n $ord->date = $currentDate->get();\n //TODO Take product id from param and check if it is available (not in future, still on sales, etc)\n $product = Product::getCurrentProduct();\n $ord->Product = $product;\n $customer->save();\n $ord->save();\n $product->takeFromStock();\n $customer->sendOrderNotification($ord);\n }", "public function storeOrder($request);", "function persistOrder(User $user, Order $order, array $orderItems);", "public function saved(Order $Order)\n {\n //code...\n }", "public function addOrder(Order $order);", "public function store($order)\n\t{\n $part = Request::json('part');\n \n if(!isset($part)){\n return Error::show(1);\n }\n \n $insert = $this->standingOrders->insertItem($part, $order);\n if(isset($insert)){\n return Response::json(array(\n 'message' => $insert\n ));\n }\n else{\n return Error::show(1);\n }\n\t}", "public function ___orderSaved(PadOrder $order) {\n }", "public static function createOrder ()\n\t{\n $user=Auth::user();// here to get the user info and store it in the $user variable\n $order=$user->orders()->create([\n 'total'=>Cart::total(),\n 'delivered' =>0\n\n ]);\n // the delivered column will get by default the value zero which means that this order\n // is not delivered yet \n\n $cartItems=cart::content();\n //seek for intels about attach function \n\n foreach($cartItems as $cartItem)\n $order->orderItems()->attach($cartItem->id,[\n 'qty'=>$cartItem->qty ,\n 'total' => $cartItem->qty*$cartItem->price \n ]);\n\n\t}", "static public function SaveOrder() {\n $order = new self();\n $order->uid = Session::get('user_id');\n $order->total = 0;\n foreach (Cart::getContent()->toArray() as $item) {\n $order->total += $item['price'] * $item['quantity'];\n }\n $order->order_data = serialize(Cart::getContent()->toArray());\n $order->status = \"New\";\n $order->save();\n $order_id = DB::table('orders')->latest()->first()->id;\n /* saving order_id in session, used to redirect the user to order details page on user page after submitting checkout */\n Session::put('last_order', $order_id);\n /* clear cart, ready for a new order */\n Cart::clear();\n return true;\n }", "public function saving(Order $Order)\n {\n //code...\n }", "public function addOrder($order){\n $this->collection[] = $order;\n }", "public function afterPlaceOrder($order)\n {\n $this->aliExpressOrderRepository->create(['order' => $order]);\n }", "public function saveTemporaryOrder()\r\n {\r\n $order = Shopware()->Modules()->Order();\r\n\r\n $order->sUserData = $this->View()->sUserData;\r\n $order->sComment = isset($this->session['sComment']) ? $this->session['sComment'] : '';\r\n $order->sBasketData = $this->View()->sBasket;\r\n $order->sAmount = $this->View()->sBasket['sAmount'];\r\n $order->sAmountWithTax = !empty($this->View()->sBasket['AmountWithTaxNumeric']) ? $this->View()->sBasket['AmountWithTaxNumeric'] : $this->View()->sBasket['AmountNumeric'];\r\n $order->sAmountNet = $this->View()->sBasket['AmountNetNumeric'];\r\n $order->sShippingcosts = $this->View()->sBasket['sShippingcosts'];\r\n $order->sShippingcostsNumeric = $this->View()->sBasket['sShippingcostsWithTax'];\r\n $order->sShippingcostsNumericNet = $this->View()->sBasket['sShippingcostsNet'];\r\n $order->bookingId = Shopware()->System()->_POST['sBooking'];\r\n $order->dispatchId = $this->session['sDispatch'];\r\n $order->sNet = $this->View()->sUserData['additional']['show_net'];\r\n\r\n $order->sDeleteTemporaryOrder();\t// Delete previous temporary orders\r\n $order->sCreateTemporaryOrder();\t// Create new temporary order\r\n }", "function addOrder () {\n\t//\terror_log ( 'addOrder\\n', 3, '/var/tmp/php.log' );\n\t$request = Slim::getInstance ()->request ();\n\t$order = json_decode ( $request->getBody () );\n\t//\t$sql = \"INSERT INTO wine (name, grapes, country, region, year, description) VALUES (:name, :grapes, :country, :region, :year, :description)\";\n\ttry {\n\t\t$db = new DbOperation();\n\t\t$orderId = $db->addOrder ( $order );\n\t\t//\t\t$stmt = $db->prepare ( $sql );\n\t\t//\t\t$stmt->bindParam ( \"name\", $order->name );\n\t\t//\t\t$stmt->bindParam ( \"grapes\", $order->grapes );\n\t\t//\t\t$stmt->bindParam ( \"country\", $order->country );\n\t\t//\t\t$stmt->bindParam ( \"region\", $order->region );\n\t\t//\t\t$stmt->bindParam ( \"year\", $order->year );\n\t\t//\t\t$stmt->bindParam ( \"description\", $order->description );\n\t\t//\t\t$stmt->execute ();\n\t\t//\t\t$order->id = $db->lastInsertId ();\n\t\t//\t\t$db = null;\n\t\t// print_f($order);\n\t\t// $order.push(\"orderId\", $orderId);\n\t\t// print_f($order);\n\t\t$order->orderId = $orderId;\n\t\techo '{\"addedOrder\":' . json_encode ( $order ) . '}';\n\t\t// echo $orderId;\n\t} catch ( Exception $e ) {\n\t\t//\t\terror_log ( $e->getMessage (), 3, '/var/tmp/php.log' );\n\t\t//\t\techo '{\"error\":{\"text\":' . $e->getMessage () . $e.'}}';\n\t\techo '{\"errorText\":\"Add order fail with text as\", \"text\":}' . $e->getMessage () . $e . '}';\n\t}\n}", "public function store(OrderRequest $request)\n\t{\n $order = new Order($request->all());\n $order->tracking_id = mt_rand(100, 999999);\n $order->save();\n\n $this->attachProducts($order, $request);\n\n return redirect()->route('orders.index');\n\t}", "private function saveOrder()\n {\n $this->paymentInterface->setMethod(self::PAYMENT_METHOD);\n $this->magentoOrderId = $this->quoteManagement->placeOrder($this->quoteId, $this->paymentInterface);\n /** @var \\Magento\\Sales\\Api\\Data\\OrderInterface magentoOrder */\n $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId);\n\n if ($this->magentoOrderId == '') {\n throw new \\Exception(self::PMO_ERR_MSG);\n }\n }", "public function store(Request $request)\n {\n $lorealOrders = $this->getLorealOrderQuery();\n $firstOrder = $lorealOrders->first();\n $newOrder = new Order;\n $newOrder->supplier = $firstOrder->supplier;\n $newOrder->order_date = Carbon::now();\n $newOrder->status = 'Draft';\n $newOrder->item_count = $lorealOrders->count();\n $newOrder->save();\n\n foreach ($lorealOrders as $lorealOrder) {\n try {\n $product = Product::where('id', $lorealOrder->id)->firstOrFail();\n\n $orderItem = new OrderItem;\n $orderItem->order()->associate($newOrder);\n $orderItem->product()->associate($product);\n $orderItem->supplier = $product->supplier;\n $orderItem->display_name = $product->display_name;\n $orderItem->supplier_product_name = $product->order_name;\n $orderItem->supplier_sequence = $product->supplier_sequence;\n $orderItem->max_stock = $product->current_max_stock;\n $orderItem->available_stock = $product->current_stock_available;\n $orderItem->order_amount = $lorealOrder->ORDER_AMOUNT;\n $orderItem->cost_price = $product->current_cost_price;\n $orderItem->total_price = ($product->current_cost_price * $lorealOrder->ORDER_AMOUNT);\n $orderItem->save();\n } catch (Exception $e) {\n echo 'Message : ' . $e->getMessage() . PHP_EOL;\n }\n }\n\n $orders = Order::all();\n return view('order.index', compact('orders'));\n }", "function saveorder()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$cid \t= JRequest::getVar( 'cid', array(), 'post', 'array' );\n\t\t$order \t= JRequest::getVar( 'order', array(), 'post', 'array' );\n\t\tJArrayHelper::toInteger($cid);\n\t\tJArrayHelper::toInteger($order);\n\n\t\t$model = $this->getModel('weblink');\n\t\t$model->saveorder($cid, $order);\n\n\t\t$msg = JText::_( 'New ordering saved' );\n\t\t$this->setRedirect( 'index.php?option=com_weblinks', $msg );\n\t}", "public function create(Order $order)\n {\n //\n }", "public function store(OrderCreateRequest $request)\n {\n return $this->repository->storeOrder($request);\n }", "public function saveOrder()\n {\n $this->validate();\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n /**\n * @var TM_FireCheckout_Model_Service_Quote\n */\n $service = Mage::getModel('firecheckout/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent('checkout_type_onepage_save_order_after',\n array('order'=>$order, 'quote'=>$this->getQuote()));\n\n /**\n * a flag to set that there will be redirect to third party after confirmation\n * eg: paypal standard ipn\n */\n $redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();\n /**\n * we only want to send to customer about new order when there is no redirect to third party\n */\n $canSendNewEmailFlag = true;\n if (version_compare(Mage::helper('firecheckout')->getMagentoVersion(), '1.5.0.0', '>=')) {\n $canSendNewEmailFlag = $order->getCanSendNewEmailFlag();\n }\n if (!$redirectUrl && $canSendNewEmailFlag) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession->setLastOrderId($order->getId())\n ->setRedirectUrl($redirectUrl)\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n // add recurring profiles information to the session\n $profiles = $service->getRecurringPaymentProfiles();\n if ($profiles) {\n $ids = array();\n foreach ($profiles as $profile) {\n $ids[] = $profile->getId();\n }\n $this->_checkoutSession->setLastRecurringProfileIds($ids);\n // TODO: send recurring profile emails\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => $profiles)\n );\n\n return $this;\n }", "public function store(Request $request, Order $order)\n {\n $request->validate([\n 'recepie_menu_id' => 'required',\n 'qty' => 'required', \n 'status_id' => 'required',\n 'amount' => 'required' \n ]); \n\n $ticket = new Ticket($request->all());\n $ticket->store($order);\n $ticket = $order->tickets()->find($ticket->id);\n\n return response()->json([\n 'data' => $ticket\n ], 201);\n }", "public function store()\n\t{ \n $nextId = OrdenEsM::nextId();\n $input = Input::all();\n $ordenD = new OrdenEsD();\n $ordenD->upc = $input['upc'];\n $ordenD->epc = $input['epc'];\n $ordenD->quantity = $input['quantity'];\n $ordenD->created_at = $input['created_at'];\n $ordenD->updated_at = $input['updated_at'];\n $ordenD->orden_es_m_id = $nextId;\n $ordenD->save();\n\t}", "public function store(Request $request)\n {\n $order = Auth::user()->orders()->create($request->except('catalogue') + [\n 'ordNo' => uniqid('ord-'),\n 'status' => 'pending'\n ]);\n\n $order->catalogue()->attach(array_reduce(\n explode(',', $request->catalogue), function ($carry, $next) {\n list($id, $quantity) = explode(':', $next);\n return $carry + [intval($id) => ['quantity' => $quantity]];\n },\n []\n ));\n\n Mail::to(config('mail.admin.address'))->send(new NewOrderMail($order));\n\n return redirect()->route('customer.order.show', $order);\n }", "public function store(Request $request)\n {\n \n $data_array = json_decode($request->data_string);\n $total = 0;\n\n foreach ($data_array as $data) {\n $total += $data->price * $data->qty;\n }\n\n $order = new Order;\n $order->voucherno = uniqid();\n $order->orderdate = date('Y-m-d');\n $order->note = $request->note;\n $order->total = $total;\n $order->phone = $request->phone;\n $order->address = $request->address;\n $order->user_id = Auth::id();\n $order->save();\n\n foreach ($data_array as $data) {\n $order->items()->attach($data->id,['qty' => $data->qty]);\n }\n\n return 'Order Successfully!';\n }", "public function store(OrderRequest $request)\n {\n DB::transaction(function () use ($request) {\n $result = $this->orderService->create($request->input());\n $this->orderService->addItem($result->id);\n $this->cartService->deleteCart();\n return $result;\n });\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Order::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tOrder::create($data);\n\n\t\treturn Redirect::route('admin.orders.index');\n\t}", "function add_sales_order(&$order)\n{\n\tglobal $loc_notification, $path_to_root, $Refs;\n\n\tbegin_transaction();\n\thook_db_prewrite($order, $order->trans_type);\n\t$order_no = get_next_trans_no($order->trans_type);\n\t$del_date = date2sql($order->due_date);\n\t$order_type = 0; // this is default on new order\n\t$total = $order->get_trans_total();\n\t$sql = \"INSERT INTO \".TB_PREF.\"sales_orders (order_no, type, debtor_no, trans_type, branch_code, customer_ref, reference, comments, ord_date,\n\t\torder_type, ship_via, deliver_to, delivery_address, contact_phone,\n\t\tfreight_cost, from_stk_loc, delivery_date, payment_terms, total)\n\t\tVALUES (\" .db_escape($order_no) . \",\" .db_escape($order_type) . \",\" . db_escape($order->customer_id) .\n\t\t \", \" .db_escape($order->trans_type) . \",\" .db_escape($order->Branch) . \", \".\n\t\t\tdb_escape($order->cust_ref) .\",\". \n\t\t\tdb_escape($order->reference) .\",\". \n\t\t\tdb_escape($order->Comments) .\",'\" . \n\t\t\tdate2sql($order->document_date) . \"', \" .\n\t\t\tdb_escape($order->sales_type) . \", \" .\n\t\t\tdb_escape($order->ship_via).\",\" . \n\t\t\tdb_escape($order->deliver_to) . \",\" .\n\t\t\tdb_escape($order->delivery_address) . \", \" .\n\t\t\tdb_escape($order->phone) . \", \" . \n\t\t\tdb_escape($order->freight_cost) .\", \" . \n\t\t\tdb_escape($order->Location) .\", \" .\n\t\t\tdb_escape($del_date) . \",\" .\n\t\t\tdb_escape($order->payment) . \",\" .\n\t\t\tdb_escape($total). \")\";\n\n\tdb_query($sql, \"order Cannot be Added\");\n\n\t$order->trans_no = array($order_no=>0);\n\n\tif ($loc_notification == 1)\n\t{\n\t\tinclude_once($path_to_root . \"/inventory/includes/inventory_db.inc\");\n\t\t$st_ids = array();\n\t\t$st_names = array();\n\t\t$st_num = array();\n\t\t$st_reorder = array();\n\t}\n\tforeach ($order->line_items as $line)\n\t{\n\t\tif ($loc_notification == 1 && is_inventory_item($line->stock_id))\n\t\t\t$loc = calculate_reorder_level($order->Location, $line, $st_ids, $st_names, $st_num, $st_reorder); \n\n\t\t$sql = \"INSERT INTO \".TB_PREF.\"sales_order_details (order_no, trans_type, stk_code, description, unit_price, quantity, discount_percent) VALUES (\";\n\t\t$sql .= $order_no . \",\".$order->trans_type .\n\t\t\t\t\",\".db_escape($line->stock_id).\", \"\n\t\t\t\t.db_escape($line->item_description).\", $line->price,\n\t\t\t\t$line->quantity,\n\t\t\t\t$line->discount_percent)\";\n\t\tdb_query($sql, \"order Details Cannot be Added\");\n\n\t// Now mark quotation line as processed\n\t\tif ($order->trans_type == ST_SALESORDER && $line->src_id)\n\t\t\tupdate_parent_line(ST_SALESORDER, $line->src_id, $line->qty_dispatched); // clear all the quote despite all or the part was ordered\n\t} /* inserted line items into sales order details */\n\tadd_audit_trail($order->trans_type, $order_no, $order->document_date);\n\t$Refs->save($order->trans_type, $order_no, $order->reference);\n\n\thook_db_postwrite($order, $order->trans_type);\n\tcommit_transaction();\n\n\tif ($loc_notification == 1 && count($st_ids) > 0)\n\t\tsend_reorder_email($loc, $st_ids, $st_names, $st_num, $st_reorder);\n\treturn $order_no;\n}", "public function setOrder($order);", "public function store()\n\t{\n\t\t$id = Request::input('cart');\n\t\t$cart = Cart::where('id', $id)->first();\n\n\t\t$cart_products = $cart->products;\n\n\t\t$order = new Order;\n\t\t\\Auth::user()->orders()->save($order);\n\n\t\tif (!$cart_products->isEmpty()) {\n\n\t\t\tforeach ($cart_products as $product){\n\t\t\t\tif($product->stock < $product->pivot->quantity ) {\n\t\t\t\t\t$order->delete();\n\t\t\t\t\tflash()->error('Cannot fulfill order as insufficient ' . $product->title. ' stock');\n\t\t\t\t\treturn redirect('orders/create');\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($cart_products as $product) {\n\t\t\t\t$order->products()->attach([$product->id], [ 'quantity' => $product->pivot->quantity ]);\n\t\t\t}\n\t\t}\n\n\t\tflash()->success('Order successfully created');\n\t\treturn redirect('orders');\n\t\t\n\t}", "private function storePurchaseOrder() {\n return $this->json('POST', 'api/pch_purchase_order', $this->tempJson);\n }", "function setOrder( $order )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n if ( get_class( $order ) == \"ezorder\" )\n {\n $this->OrderID = $order->id();\n } \n }", "public function store(StoreOrderRequest $request)\n {\n //Input received from the request\n $input = $request->except(['_token']);\n //Create the model using repository create method\n $this->repository->create($input);\n //return with successfull message\n return redirect()->route('admin.orders.index')->withFlashSuccess(trans('alerts.backend.orders.created'));\n }", "function store()\n {\n $this->dbInit();\n \n if ( !isset( $this->ID ) )\n {\n $this->Database->query( \"INSERT INTO eZTrade_OrderItem SET\n\t\t OrderID='$this->OrderID',\n\t\t Count='$this->Count',\n\t\t Price='$this->Price',\n\t\t ProductID='$this->ProductID'\n \" );\n\n $this->ID = mysql_insert_id();\n\n $this->State_ = \"Coherent\";\n }\n else\n {\n $this->Database->query( \"UPDATE eZTrade_OrderItem SET\n\t\t OrderID='$this->OrderID',\n\t\t Count='$this->Count',\n\t\t Price='$this->Price',\n\t\t ProductID='$this->ProductID'\n WHERE ID='$this->ID'\n \" );\n\n $this->State_ = \"Coherent\";\n }\n \n return true;\n }", "abstract public function setOrder(OrderModel $order);", "public function createOrder($order)\n {\n $this->notificationRepository->create(['type' => 'order', 'order_id' => $order->id]);\n \n event(new CreateOrderNotification);\n }", "private function SetOrderData()\n\t\t{\n\t\t\t// doesn't factor in cookies stored by Interspire Shopping Cart, so we have to pass back the\n\t\t\t// order token manually from those payment providers. We do this by taking the\n\t\t\t// cart ID passed back from the provider which stores the order's unique token.\n\t\t\tif(isset($_COOKIE['SHOP_ORDER_TOKEN'])) {\n\t\t\t\t$this->orderToken = $_COOKIE['SHOP_ORDER_TOKEN'];\n\t\t\t}\n\t\t\telse if(isset($_REQUEST['provider'])) {\n\t\t\t\tGetModuleById('checkout', $this->paymentProvider, $_REQUEST['provider']);\n\n\t\t\t\tif(in_array(\"GetOrderToken\", get_class_methods($this->paymentProvider))) {\n\t\t\t\t\t$this->orderToken = $this->paymentProvider->GetOrderToken();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tob_end_clean();\n\t\t\t\t\theader(sprintf(\"Location:%s\", $GLOBALS['ShopPath']));\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Load the pending orders from the database\n\t\t\t$this->pendingData = LoadPendingOrdersByToken($this->orderToken, true);\n\t\t\tif(!$this->orderToken || $this->pendingData === false) {\n\t\t\t\t$this->BadOrder();\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tif($this->paymentProvider === null) {\n\t\t\t\tGetModuleById('checkout', $this->paymentProvider, $this->pendingData['paymentmodule']);\n\t\t\t}\n\n\t\t\tif($this->paymentProvider) {\n\t\t\t\t$this->paymentProvider->SetOrderData($this->pendingData);\n\t\t\t}\n\t\t}", "public function store(Request $request) {\n $data = new ItemOrder();\n $data->table_number = $request->table_number;\n $data->user_name = $request->user_name;\n $data->staff_id = auth()->user()->id;\n $data->order_number = generate_order_number();\n \n $data->save();\n $orderId = $data->id;\n\n foreach($request->order_details as $val) {\n $detailObj = new ItemOrderDetail();\n $detailObj->order_id = $orderId;\n $detailObj->item_id = $val['item_id'];\n $detailObj->quantity = $val['quantity'];\n $detailObj->price = $val['price'];\n $detailObj->final_price = $val['price'] * $val['quantity'];\n\n $detailObj->save();\n }\n\n $data->save();\n\n return redirect()->route('orders')->with('success', 'Order added successfully.');\n }", "public function store()\n {\n $products = Cart::getProducts();\n\n // Create Order\n $order = new Order;\n $order->products_data = serialize($products);\n $order->user_id = auth()->user()->id;\n $order->save();\n\n return redirect('/orders')->with('success', 'Order Created');\n }", "public function canStoreOrder();", "function setOrder($order);", "public function addOrderedItemsToStock($order)\r\n {\r\n \t$nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\r\n \t$isCustomStockManagementEnabled = Mage::getModel('paymentsensegateway/direct')->getConfigData('customstockmanagementenabled');\r\n\t\t\r\n \tif($nVersion >= 1410 &&\r\n \t\t$isCustomStockManagementEnabled)\r\n \t{\r\n\t \t$items = $order->getAllItems();\r\n\t\t\tforeach ($items as $itemId => $item)\r\n\t\t\t{\r\n\t\t\t\t// ordered quantity of the item from stock\r\n\t\t\t\t$quantity = $item->getQtyOrdered();\r\n\t\t\t\t$productId = $item->getProductId();\r\n\t\t\t\t\r\n\t\t\t\t$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);\r\n\t\t\t\t$stockManagement = $stock->getManageStock();\r\n\t\t\t\t\r\n\t\t\t\tif($stockManagement)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stock->setQty($stock->getQty() + $quantity);\r\n\t\t\t\t\t$stock->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t}\r\n }", "public function store(OrderStoreRequest $request)\n {\n $order = new Order();\n $order->fill($request->all());\n $order->products_json = $order->convertProductsJsonToOrder($request->products_json);\n $order->status = 'not paid';\n\n $intent = $order->stripePay();\n $order->payment = $intent->id;\n $order->amount = $request->amount;\n\n $order->save();\n\n return response()->json(['client_key' => $intent->client_secret]);\n }", "private function create_order_record($id_order) {\n $aux['details'] = $this->m_orders_overview->get_details($id_order);\n\n $record['id_order'] = null; // auto-increment\n $record['id_menu_order'] = $id_order;\n $record['id_table'] = $aux['details'][0]->id_table;\n $record['id_count_ks'] = $aux['details'][0]->id_count_ks;\n $record['date_pay'] = date(\"Y-m-d\");\n\n $record['id_employee'] = $aux['details'][0]->id_employee;\n $record['pay_method'] = 'hotovost';\n $record['sum_price'] = $aux['details'][0]->price;\n $record['is_closed'] = 0;\n\n $this->m_orders_overview->insert_new_order_record($record);\n }", "public function additionOrder()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `ordero`(`castumerid`, `areaid`, `phoneo`, `areatransid`, `deviceid`, `orderdate`, `timeo`, `timing`, `mdn`, `sn`, `note`, `process`, `idservo`, `idservows`, `idmark`, `poseplt`, `dftime`, `odatews`, `odatefs`, `odatedp`, `timodp`, `timingdp`, `resono`, `deleto`, `employeeid`, `employeeidws`, `employeeiddp`)\n VALUES ('$this->castumerid', '$this->areaid', '$this->phone', '$this->areatransid', '$this->deviceid', '$this->orderdate', '$this->timeo', '$this->timing', '$this->mdn', '$this->sn', '$this->note', '$this->process', '$this->idservo', '$this->idservows', '$this->idmark', '$this->poseplt', '$this->dftime', '$this->odatews', '$this->timodp', '$this->odatedp', '$this->odatedp', '$this->timingdp', '$this->resono', '$this->deleto', '$this->employeeid', '$this->employeeidws', '$this->employeeiddp')\");\n $result = $sql->execute();\n $ido = $dbh->lastInsertId();\n return array ($result,$ido);\n }", "public function store(StoreOrder $request)\n {\n $params = $request->all();\n $order = $this->orderService->create($params);\n\n return json_encode($order);\n }", "public function store(OrderRequest $request)\n {\n $order = new Order;\n $order->cid = $request->cid;\n $order->charges = $request->charges;\n $order->subtotal = $request->subtotal;\n $order->total = $request->total;\n $order->name = $request->customer['name'];\n $order->email = $request->customer['email'];\n $order->contact = $request->customer['contact'];\n $order->device_token = $request->device_token;\n $order->created = $request->created;\n $order->save();\n\n $order_id= $order->id;\n foreach ($request->orders as $key => $value) {\n $orderDetail = new OrderDetail;\n $orderDetail->order_id = $order_id;\n $orderDetail->orderNumber = $value['orderNumber'];\n $orderDetail->truckName = $value['truckName'];\n $orderDetail->created = $value['created'];\n $orderDetail->save();\n\n $order_detail_id= $orderDetail->id;\n foreach ($value['items'] as $key => $value) {\n $item = new Item;\n $item->order_detail_id = $order_detail_id;\n $item->description = $value['description'];\n $item->display_name = $value['display_name'];\n $item->f_id = $value['f_id'];\n $item->p_id = $value['p_id'];\n $item->price = $value['price'];\n $item->quantity = $value['quantity'];\n $item->total = $value['total'];\n $item->save();\n }\n }\n return response([\n 'status'=>1,\n 'message'=>'Order Added Successfully!'\n ],Response::HTTP_CREATED);\n }", "public function store()\n\t{\n\t\t$order = new Order();\n\n\t\t$items = json_decode(Input::get('items', []), true);\n\n\t\tforeach($items as &$item) {\n\t\t\t$id = $item['reference']['id'];\n\t\t\t$model = Product::find($id);\n\t\t\t$item['name'] = $model->name;\n\t\t\t$item['unit_price'] = $model->price;\n\t\t\t$item['total_price_including_tax'] = ceil($model->price * $model->vatgroup->amount * $item['quantity']);\n\t\t\t$item['total_price_excluding_tax'] = ceil($model->price * $item['quantity']);\n\t\t\t$item['type'] = 'physical';\n\t\t\t$item['discount_rate'] = 0;\n\t\t\t$item['tax_rate'] = (int) abs((1 - $model->vatgroup->amount) * 100);\n\t\t}\n\n\t\t$order->items = $items;\n\n\t\t# determine shipping type\n\t\t$total = $order->getTotal();\n\t\t$weight = $order->getWeight();\n\t\tif ($weight <= 1000) {\n\t\t\t$shippingType = 'mail';\n\t\t\t$shippingCost = 39;\n\t\t}else {\n\t\t\t$shippingType = 'service-pack';\n\t\t\t$shippingCost = 99;\n\t\t}\n\n\t\t# free shipping?\n\t\tif ($total >= 800) {\n\t\t\t$shippingCost = 0;\n\t\t}\n\n\t\t# add shipping\n\t\t$items = $order->items;\n\t\t$items[] = [\n\t\t\t'discount_rate' => 0,\n\t\t\t'name' => $shippingType,\n\t\t\t'quantity' => 1,\n\t\t\t'reference' => null,\n\t\t\t'tax_rate' => 0,\n\t\t\t'total_price_excluding_tax' => $shippingCost,\n\t\t\t'total_price_including_tax' => $shippingCost,\n\t\t\t'total_tax_amount' => 0,\n\t\t\t'type' => 'shipping_fee',\n\t\t\t'unit_price' => $shippingCost,\n\t\t];\n\t\t$order->items = $items;\n\n\t\t# set user\n\t\t$order->user_id = Input::get('user_id');\n\n\t\t# set shipping & billing addresses\n\t\t$order->billing_address = [\n\t\t\t'given_name' => $order->user->firstname,\n\t\t\t'family_name' => $order->user->lastname,\n\t\t\t'street_address' => null,\n\t\t\t'postal_code' => null,\n\t\t\t'city' => null,\n\t\t\t'country' => null,\n\t\t\t'email' => $order->user->email,\n\t\t\t'phone' => null,\n\t\t];\n\t\t$order->shipping_address = $order->billing_address;\n\n\t\t# set locale etc\n\t\t$order->locale = 'nb-no';\n\t\t$order->purchase_country = 'no';\n\t\t$order->purchase_currency = 'nok';\n\n\t\t# set total\n\t\t$order->total_price_including_tax = $order->getTotal();\n\n\t\t$total = 0;\n\t\tforeach($order->items as $item) {\n\t\t\t$total += $item['total_price_excluding_tax'];\n\t\t}\n\t\t$order->total_price_excluding_tax = $total;\n\n\t\t# total tax amount\n\t\t$tax = 0;\n\t\tforeach($order->items as $item) {\n\t\t\t$tax += $item['total_price_including_tax'] - $item['total_price_excluding_tax'];\n\t\t}\n\t\t$order->total_tax_amount = $tax;\n\n\t\t$order->status = 'unprocessed';\n\n\t\t# save\n\t\t$order->save();\n\n\t\t# redirect to edit that order now\n\t\treturn Redirect::to(route('admin.orders.edit', $order->id));\n\t}", "function save_order(){\n\tif( ! current_user_can( 'order_posts' ) ){\n\t\twp_send_json_error( 'Oooops, you haven\\'t got the permission to do that' );\n\n\t\treturn;\n\t}\n\t$ordered_ids = $_POST[ 'id_array' ];\n\t$position = 1;\n\tforeach( $ordered_ids as $id ){\n\t\tupdate_post_meta( (int) $id, 'post_order', $position );\n\t\t$position ++;\n\t}\n}", "public function creating(Order $Order)\n {\n //code...\n }", "public function addOrder(IncidentOrder $order)\n {\n $this->orders[] = $order;\n }", "protected function createOrder(){\n $order = Auth::user()->orders()->create(['status' => 'aguardando']);\n\n return $order;\n }", "public function setOrder(\\Magento\\Sales\\Model\\Order $order);", "public function add($order)\n {\n $order['time'] = time();\n $order['created_time'] = time();\n return $this->db->insert('orders', $order) == TRUE;\n }", "public function create() : Orders;", "public function store_order_complete_end($order)\n\t{\n\t\t// load the sync db\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\n\t\t// load the order_map config file\n\t\tinclude_once dirname(dirname(__FILE__)).'/bmi_custom/config/order_map.php';\n\n\t\t$order_array = $order->toTagArray();\n\t\t//file_put_contents('./' . time() . '-order.json', json_encode($order_array));\n\n\t\t$order_record = array();\n\n\t\t// loop through all the static fields from the order map\n\t\tforeach($order_fields as $field=>$key)\n\t\t{\n\t\t\t$order_record[$field] = $order_array[$key];\n\t\t}\n\n\t\t// now we do some replacements for shipping, tax and payment based on the mappings\n\t\tif(!empty($shipping_methods[$order_record['shipping_carrier']]))\n\t\t{\n\t\t\t$order_record['shipping_carrier'] = $shipping_methods[$order_record['shipping_carrier']];\n\t\t}\t\n\n\t\tif(!empty($payment_methods[$order_record['order_payment_method']]))\n\t\t{\n\t\t\t$order_record['order_payment_method'] = $payment_methods[$order_record['order_payment_method']];\n\t\t}\t\n\n\t\tif(empty($order_record['order_tax_rate_name']))\n\t\t{\n\n\t\t\tif($order_record['shipping_state'] == 'MA')\n\t\t\t{\n\t\t\t\t$order_record['order_tax_rate_name'] = 'Non Taxable';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$order_record['order_tax_rate_name'] = 'Out of State';\n\t\t\t}\t\n\n\t\t}\n\n\n\t\tee()->sync_db->insert('orders', $order_record);\n\n\t\t// loop through the items in the order\n\t\tforeach($order_array['items'] as $item)\n\t\t{\n\t\t\t$item_record = array();\n\n\t\t\t// loop through the static fields from the item_map\n\t\t\tforeach($item_fields as $field=>$key)\n\t\t\t{\n\t\t\t\t$item_record[$field] = $item[$key];\n\t\t\t}\n\n\t\t\tee()->sync_db->insert('order_items', $item_record);\t\n\t\t}\t\t\t \n\t}", "public function store(Request $request)\n\n {\n $validatedData = $request->validate([\n 'address' => 'required | max:100 | min:10',\n 'name' => 'required | max:50 ',\n 'surname' => 'required | max:50',\n 'phone_number' => 'required | string | numeric',\n 'total_price' => 'required | numeric',\n 'user_id' => 'required | numeric',\n ]);\n $dishes[] = $request['dishes'];\n $quantity = $request['quantity'];\n \n $order = Order::create($validatedData);\n\n foreach ($dishes as $key => $dish) {\n foreach ($dish as $k => $item){\n $order->dishes()->attach([$item], ['quantity' => $quantity[$k]]); //li attacco nella tabella pivot\n }\n }\n return redirect()->route('checkout', compact('order'));\n }", "public function neworder() {\n\t\tparent::__construct();\n\t\tsession_start();\n\t\tif(isset($_SESSION['uid'])){\n\t\t\t$this->write('orders', array(NULL, $_SESSION['uid'], 1, \"PAID\"));\n\t\t} else {\n\t\t\t$this->write('orders', array(NULL, NULL, 1, \"PAID\"));\n\t\t}\n\t\t$this->orderid = $this->id;\n\t\t\n\t\t//Create new order table and insert cart data\n\t\t$create = $this->conn->prepare(\n\t\t\t'DROP TABLE IF EXISTS order'.$this->orderid.'; '\n\t\t\t.'CREATE TABLE order'.$this->orderid\n\t\t\t.'(itemid INT(7) ZEROFILL NOT NULL, itemname VARCHAR(256) NOT NULL, qnt INT(3) NOT NULL, itemprice DECIMAL(6,2) NOT NULL); '\n\t\t);\n\t\t$create->execute();\n\n\t\t$count = 0;\n\t\tforeach($_SESSION['cart'] as $item){\n\t\t\t//This is redundant but otherwise db insert skips first row - PDO or db class issue?\n\t\t\tif($count == 0){$this->write('order'.$this->orderid, array($item[\"item\"],$item[\"name\"],$item[\"qnt\"],$item[\"price\"]));};\n\t\t\t$count++;\n\t\t\t$this->write('order'.$this->orderid, array($item[\"item\"],$item[\"name\"],$item[\"qnt\"],$item[\"price\"]));\n\t\t}\n\t}", "public function store(OrderRequest $request)\n {\n // dikhawatirkan bentrok dengan nomor\n $sarana = Sarana::find($request->sarana_id);\n\n // if sarana not registered create new one\n if (!$sarana) {\n $sarana = Sarana::firstOrCreate(['nomor' => $request->sarana_id], [\n 'nomor' => $request->sarana_id,\n 'nomor_lama' => $request->nomor_lama,\n 'dipo_id' => $request->dipo_id,\n 'jenis_sarana_id' => $request->jenis_sarana_id\n ]);\n }\n\n $order = Order::create(array_merge($request->all(), [\n 'user_id' => auth()->user()->id,\n 'sarana_id' => $sarana->id,\n ]));\n\n return [\n 'message' => 'Data telah disimpan',\n 'data' => $order\n ];\n }", "public function store(Request $request)\n {\n $request->validate([\n 'total' => 'required|min:0',\n 'id_discount' => 'numeric'\n ]);\n $id_order = 'Orders-00001';\n $cek_order = Order::find($id_order);\n if($cek_order){\n $cek_order = Order::select('id')->orderBy('created_at','desc')->first();\n $id_order = $cek_order->id;\n $id_order++;\n }\n\n $order = new Order([\n 'id' => $id_order,\n 'total' => $request->get('total'),\n 'id_discount' => $request->get('id_discount'),\n ]);\n $order->save();\n return new OrderInsertResource($order);\n\n\n }", "public function insertItem($part, $order){\r\n \r\n //remove standing order from cache\r\n /*\r\n if(Cache::has($cache_id)){\r\n Cache::forget($cache_id);\r\n }\r\n */\r\n $so = $this->soap->insertItemInToStandingOrder($this->licence, $part, $order);\r\n return $so;\r\n }", "public function setOrder(?string $order): void\n {\n $this->order = $order;\n }", "public function setOrder(?string $order): void\n {\n $this->order = $order;\n }", "public function addOrder(Order $order) {\n $this->orders->add($order);\n }", "public function store(StoreOrderRequest $request)\n {\n //Unique code for orders\n\n $code= $this->generateCode();\n\n while($this->codeExists($code)){\n\n $code= $this->generateCode();\n }\n\n $order = new Order();\n $order->order_review_code =$code;\n $order->first_name = $request->fname;\n $order->last_name = $request->lname;\n $order->phone_number = $request->phone;\n $order->email = $request->email;\n $order->company_name = $request->bussines;\n $order->service = $request->product;\n $order->additional_info = $request->additional_info;\n $order->created_by = Auth::id();\n $order->save();\n\n route('search', ['post' => 1]);\n\n $url = URL::to('/search?search='.$order->order_review_code);\n Mail::to($order->email)->send(new OrderRegistered($url));\n\n return redirect()->route('orders.index') ->with('success', 'Užsakymas sukurtas sėkmingai');\n\n }", "public function store(OrderRequest $request)\n {\n $request_data = $request->all();\n $order_details = Order::createCustomerOrder($request_data);\n if ($request_data['order_submit_btn'] == 'close') {\n return Redirect::route($this->route)->with($this->success, __($this->createmsg));\n } else {\n return Redirect::route('main.order.edit', $order_details['id'])->with($this->success, __($this->createmsg));\n }\n }", "public function store(StoreOrderRequest $request)\n {\n return (new StoreOrderService())->save($request);\n }", "private function storeOrders(User $user, $chargeid) {\n //1. add to order and orderdetail \n $user_id = $user->id;\n $sellers = ShoppingCart::where('user_id', $user_id)->groupBy('seller_id')->select('seller_id')->get();\n\n foreach ($sellers as $seller) {\n $shoppingCartExtra = ShoppingCartExtra::where('user_id', $user_id)\n ->where('seller_id', $seller->seller_id)\n ->first();\n\n $order = Order::create([\n \"user_id\" => $user_id,\n \"seller_id\" => $seller->seller_id,\n \"type\" => \"REGULAR\",\n \"total\" => $shoppingCartExtra->total,\n \"transfer_amount\" => $shoppingCartExtra->transfer_amount,\n \"app_fee\" => $shoppingCartExtra->app_fee,\n \"deliver_fee\" => $shoppingCartExtra->deliver_fee,\n \"pickup_time\" => DateTime::createFromFormat('m/d/Y H:i', $shoppingCartExtra->pickup_time)->format('Y-m-d H:i:s'),\n \"pickup_type\" => $shoppingCartExtra->pickup_type,\n \"pickup_location_desc\" => $shoppingCartExtra->pickup_location_desc,\n \"address\" => $shoppingCartExtra->address,\n \"google_place_id\" => $shoppingCartExtra->google_place_id,\n \"tax\" => $shoppingCartExtra->tax,\n \"description\" => $shoppingCartExtra->description,\n \"total_price\" => $shoppingCartExtra->total_price,\n \"charge_id\" => $chargeid\n ]);\n \n // store order location\n LocationService::CreateLocationByGP_id($shoppingCartExtra->google_place_id, 'orders', $order->id);\n \n $shoppingCarts = ShoppingCart::where('user_id', $user_id)\n ->where('seller_id', $seller->seller_id)\n ->get();\n foreach ($shoppingCarts as $shoppingCart) {\n OrderDetail::create([\n \"order_id\" => $order->id,\n \"dish_id\" => $shoppingCart->dish_id,\n \"dish_name\" => $shoppingCart->dish_name,\n \"quantity\" => $shoppingCart->quantity,\n \"unit_price\" => $shoppingCart->unit_price,\n \"total_price\" => $shoppingCart->total_price,\n ]);\n }\n }\n //2. delete the staff in the shopping cart and shopping extra\n ShoppingCart::where(\"user_id\", $user_id)->delete();\n ShoppingCartExtra::where(\"user_id\", $user_id)->delete();\n \n }", "public function store(OrderRequest $request){\n $validated = $request->validated();\n $params = $request->except(['_token','_method']);\n\n $cart = CartController::findCart();\n if(blank($cart)){\n return back()->with('fail',__('lang.cart-empty'));\n }\n $params['status_id'] = OrderStatusEnum::processing;\n $order = Order::create($params);\n if(blank($order)){\n return back()->with('error',__('lang.order-fail'));\n }\n $cart = $this->covertCartToDetailOrder($cart);\n\n $result=$order->detailOrders()->saveMany($cart);\n \n if(!$result){\n $order->delete();\n return back()->with('error',__('lang.order-fail'));\n }\n $sendMail = SendMail::dispatch($params)->delay(now()->addMinute(1));\n $request->session()->put('cart_'.$request->user_id,['total'=>0]);\n \n return back()->with('success',__('lang.order-success'));\n }", "private function saveRecord(): void\r\n {\r\n $this->order->add_meta_data('_moloni_sent', $this->document_id);\r\n $this->order->save();\r\n }", "public function store(OrderRequest $request)\n {\n try {\n $order = $this->orderService->create($request->all());\n } catch (\\Exception $e) {\n return api_error($e->getCode(), 'bad request' ,$e->getMessage());\n }\n\n return api_response(\n 201,\n 'order created successfully',\n new OrderResource($order->with('foods')->first())\n );\n }", "static function createOrder(Order $newOrder) : int {\r\n $sqlInsert = \"INSERT INTO Orders (CustomerID, Amt, Dates) \r\n VALUES (:CustomerID, :Amount, :Date) \";\r\n\r\n self::$db->query($sqlInsert);\r\n\r\n self::$db->bind(':CustomerID', $newOrder->getCustomerID());\r\n self::$db->bind(':Amount', $newOrder->getAmount());\r\n self::$db->bind(':Date', $newOrder->getDate());\r\n \r\n\r\n self::$db->execute();\r\n\r\n return self::$db->lastInsertId();\r\n\r\n }", "private function _createOrder($_cart, $_usr)\n {\n //\t\tTODO We need tablefields for the new values:\n //\t\tShipment:\n //\t\t$_prices['shipmentValue']\t\tw/out tax\n //\t\t$_prices['shipmentTax']\t\t\tTax\n //\t\t$_prices['salesPriceShipment']\tTotal\n //\n //\t\tPayment:\n //\t\t$_prices['paymentValue']\t\tw/out tax\n //\t\t$_prices['paymentTax']\t\t\tTax\n //\t\t$_prices['paymentDiscount']\t\tDiscount\n //\t\t$_prices['salesPricePayment']\tTotal\n\n $_orderData = new stdClass();\n\n $_orderData->virtuemart_order_id = null;\n $oldOrderNumber = '';\n\n $this->deleteOldPendingOrder($_cart);\n\n\n $_orderData->virtuemart_user_id = $_usr->get('id');\n $_orderData->virtuemart_vendor_id = $_cart->vendorId;\n $_orderData->customer_number = $_cart->customer_number;\n $_prices = $_cart->cartPrices;\n //Note as long we do not have an extra table only storing addresses, the virtuemart_userinfo_id is not needed.\n //The virtuemart_userinfo_id is just the id of a stored address and is only necessary in the user maintance view or for choosing addresses.\n //the saved order should be an snapshot with plain data written in it.\n //\t\t$_orderData->virtuemart_userinfo_id = 'TODO'; // $_cart['BT']['virtuemart_userinfo_id']; // TODO; Add it in the cart... but where is this used? Obsolete?\n $_orderData->order_total = $_prices['billTotal'];\n $_orderData->order_salesPrice = $_prices['salesPrice'];\n $_orderData->order_billTaxAmount = $_prices['billTaxAmount'];\n $_orderData->order_billDiscountAmount = $_prices['billDiscountAmount'];\n $_orderData->order_discountAmount = $_prices['discountAmount'];\n $_orderData->order_subtotal = $_prices['priceWithoutTax'];\n $_orderData->order_tax = $_prices['taxAmount'];\n $_orderData->order_shipment = $_prices['shipmentValue'];\n $_orderData->order_shipment_tax = $_prices['shipmentTax'];\n $_orderData->order_payment = $_prices['paymentValue'];\n $_orderData->order_payment_tax = $_prices['paymentTax'];\n\n if (!empty($_cart->cartData['VatTax'])) {\n $taxes = array();\n foreach ($_cart->cartData['VatTax'] as $k => $VatTax) {\n $taxes[$k]['virtuemart_calc_id'] = $k;\n $taxes[$k]['calc_name'] = $VatTax['calc_name'];\n $taxes[$k]['calc_value'] = $VatTax['calc_value'];\n $taxes[$k]['result'] = $VatTax['result'];\n }\n $_orderData->order_billTax = vmJsApi::safe_json_encode($taxes);\n }\n\n if (!empty($_cart->couponCode)) {\n $_orderData->coupon_code = $_cart->couponCode;\n $_orderData->coupon_discount = $_prices['salesPriceCoupon'];\n }\n $_orderData->order_discount = $_prices['discountAmount']; // discount order_items\n\n\n $_orderData->order_status = 'P';\n $_orderData->order_currency = $this->getVendorCurrencyId($_orderData->virtuemart_vendor_id);\n\n if (isset($_cart->pricesCurrency)) {\n $_orderData->user_currency_id = $_cart->pricesCurrency;\n $currency = CurrencyDisplay::getInstance($_orderData->user_currency_id);\n if ($_orderData->user_currency_id != $_orderData->order_currency) {\n $_orderData->user_currency_rate = $currency->convertCurrencyTo($_orderData->user_currency_id, 1.0, false);\n } else {\n $_orderData->user_currency_rate = 1.0;\n }\n }\n\n $shoppergroups = $_cart->user->get('shopper_groups');\n if (!empty($shoppergroups)) {\n $_orderData->user_shoppergroups = implode(',', $shoppergroups);\n }\n\n if (isset($_cart->paymentCurrency)) {\n $_orderData->payment_currency_id = $_cart->paymentCurrency; //$this->getCurrencyIsoCode($_cart->pricesCurrency);\n $currency = CurrencyDisplay::getInstance($_orderData->payment_currency_id);\n if ($_orderData->payment_currency_id != $_orderData->order_currency) {\n $_orderData->payment_currency_rate = $currency->convertCurrencyTo($_orderData->payment_currency_id, 1.0, false);\n } else {\n $_orderData->payment_currency_rate = 1.0;\n }\n }\n\n $_orderData->virtuemart_paymentmethod_id = $_cart->virtuemart_paymentmethod_id;\n $_orderData->virtuemart_shipmentmethod_id = $_cart->virtuemart_shipmentmethod_id;\n\n //Some payment plugins need a new order_number for any try\n $_orderData->order_number = '';\n $_orderData->order_pass = '';\n\n $_orderData->order_language = $_cart->order_language;\n $_orderData->ip_address = ShopFunctions::getClientIP();;\n\n $maskIP = VmConfig::get('maskIP', 'last');\n if ($maskIP == 'last') {\n $rpos = strrpos($_orderData->ip_address, '.');\n $_orderData->ip_address = substr($_orderData->ip_address, 0, ($rpos + 1)) . 'xx';\n }\n\n //lets merge here the userdata from the cart to the order so that it can be used\n if (!empty($_cart->BT)) {\n $continue = array('created_on' => 1, 'created_by' => 1, 'modified_on' => 1, 'modified_by' => 1, 'locked_on' => 1, 'locked_by' => 1);\n foreach ($_cart->BT as $k => $v) {\n if (isset($continue[$k])) continue;\n $_orderData->{$k} = $v;\n }\n }\n $_orderData->STsameAsBT = $_cart->STsameAsBT;\n unset($_orderData->created_on);\n\n JPluginHelper::importPlugin('vmshopper');\n $dispatcher = JDispatcher::getInstance();\n $plg_datas = $dispatcher->trigger('plgVmOnUserOrder', array(&$_orderData));\n\n\n $i = 0;\n while ($oldOrderNumber == $_orderData->order_number) {\n if ($i > 5) {\n $msg = 'Could not generate new unique ordernumber';\n vmError($msg . ', an ordernumber should contain at least one random char', $msg);\n break;\n }\n $_orderData->order_number = $this->genStdOrderNumber($_orderData->virtuemart_vendor_id);\n if (!empty($oldOrderNumber)) vmdebug('Generated new ordernumber ', $oldOrderNumber, $_orderData->order_number);\n $i++;\n }\n if (empty($_orderData->order_pass)) {\n $_orderData->order_pass = $this->genStdOrderPass();\n }\n if (empty($_orderData->order_create_invoice_pass)) {\n $_orderData->order_create_invoice_pass = $this->genStdCreateInvoicePass();\n }\n\n $orderTable = $this->getTable('orders');\n $orderTable->bindChecknStore($_orderData);\n\n if (!empty($_cart->couponCode)) {\n //set the virtuemart_order_id in the Request for 3rd party coupon components (by Seyi and Max)\n vRequest::setVar('virtuemart_order_id', $orderTable->virtuemart_order_id);\n // If a gift coupon was used, remove it now\n CouponHelper::setInUseCoupon($_cart->couponCode, true);\n }\n // the order number is saved into the session to make sure that the correct cart is emptied with the payment notification\n $_cart->order_number = $orderTable->order_number;\n $_cart->order_pass = $_orderData->order_pass;\n $_cart->virtuemart_order_id = $orderTable->virtuemart_order_id;\n $_cart->setCartIntoSession();\n\n return $orderTable->virtuemart_order_id;\n }", "public function saveOrder()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$modelUserCart = $this->getModel('usercart');\n\n\t\t$modelUserCart->storeUserOrder();\n\t\t$modelUserCart->sendOrderMail();\n\t\t$modelUserCart->emptyCart();\n\t\t$params = $app->getParams('com_simpleshop');\n\t\t$return_url = $params->get('return_url');\n\n\n\t\t$app->redirect($return_url);\n\n\t}", "public function store(Request $request)\n {\n \n $order = new Order;\n $order->id_Uzsakymas = $request->input('id_Uzsakymas');\n $order->uzsakytos_prekes_pavadinimas = $request->input('uzsakytos_prekes_pavadinimas');\n $order->uzsakymo_kiekis = $request->input('uzsakymo_kiekis');\n $order->uzsakymo_kaina = $request->input('uzsakymo_kaina');\n $order->uzsakymo_suma = $request->input('uzsakymo_suma');\n $order->pristatymo_data = $request->input('pristatymo_data');\n $order->fk_Pirkejasid_Pirkejas = $request->input('fk_Pirkejasid_Pirkejas');\n $order->fk_Sutartisid_Sutartis = $request->input('fk_Sutartisid_Sutartis');\n $order->save();\n\n return redirect('/orders');\n\n }", "function setOrder($order){\n\t\t$this->order=$order;\n\t}", "public function store(CreateOrderRequest $request)\n {\n $input = $request->all();\n $order = $this->orderRepository->create($input);\n\n Flash::success(__('messages.saved', ['model' => __('models/orders.singular')]));\n\n return redirect(route('orders.index'));\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'service' => 'required',\n 'issue' => 'required'\n\n ]);\n\n //create Post\n $orders = new Order;\n $orders->user_id = auth()->user()->id;\n $account = Account::find($request->id);\n $orders->account()->associate($account);\n $orders->issue = $request->input('issue');\n $orders->save();\n\n return redirect ('/orders')->with('success', 'Order Created');\n\n\n }", "public function order() {\n if(\\Auth::user() == null){\n\n \\Session::flash('warning', 'Je moet eerst inloggen!');\n return Redirect('/inloggen');\n\n }\n\n // Create order\n $order = new Order();\n $order->user_id = \\Auth::user()->id;\n\n // Save order\n $order->save();\n\n // Store ordered products\n foreach($this->getCart() as $item => $amount){\n $order_product = new OrderProduct();\n $order_product->order_id = $order->id;\n $order_product->product_id = $item;\n $order_product->amount = $amount;\n $order_product->save();\n }\n\n // Remove shopping cart session\n session()->forget('cart');\n\n // Send user to his order page\n return Redirect('/orders/'.$order->id);\n\n }", "public function store(Request $request)\n {\n return Order::create([\"client_id\" => $request->client_id]);\n }", "public function store(Request $request)\n {\n $newOrder = new Orders;\n $newOrder->customer_id = $request->order[\"customer_id\"];\n $newOrder->shipping_id= $request->order[\"shipping_id\"];\n $newOrder->product_id= $request->order[\"product_id\"];\n $newOrder->save();\n\n return $newOrder;\n }", "public function testUpdateOrder()\n {\n }", "public function store(Request $request)\n {\n $this->validateData($request);\n\n $user = Auth::user();\n $input = $request->all();\n\n $address = $input['district'] .', '. $input['division'] . ', ' . $input['zip_code'];\n\n unset($input['district']);\n unset($input['division']);\n unset($input['zip_code']);\n\n $input['user_id'] = $user['id'];\n $input['books'] = Cart::count();\n $input['bill'] = Cart::total();\n\n $input['address'] = $input['address'] . ', ' . $address;\n\n $order = Order::create($input);\n\n foreach(Cart::content() as $book){\n\n Book::where('id', $book->id)->increment('sales', $book->qty);\n\n OrderItem::create(['order_id' => $order->id, 'book_id' => $book->id, 'quantity' => $book->qty, 'subtotal' => ($book->qty * $book->price)]);\n }\n\n Cart::destroy();\n\n Session::flash('success_order', 'Order Successfull');\n\n return redirect()->route('order-details', [$order->slug])->with(compact('order'));\n }", "public function addOrder(Request $request,Order $order)\n {\n if (empty(Session::get('cart')->items)) {\n return redirect()->back();\n }\n $user = auth()->user();\n $order = new Order([\n 'order_number' => rand(1, 15000),\n 'user_id'=> $user->id,\n 'order'=> json_encode(Session::get('cart'))\n ]);\n $order->save();\n session()->put('cart', null);\n return redirect()->route('orders');\n }", "public function store(Request $request)\n {\n $data = $request->json()->all();\n // dd($request->user());\n\n $user = $request->user();\n\n // Enregistrement commande\n $order = $user->orders()->create([\n 'payment_intent_id' => $data['paymentIntent']['id'],\n 'amount' => $data['paymentIntent']['amount'],\n 'payment_created' => (new DateTime())->setTimesTamp($data['paymentIntent']['created'])->format('y-m-d H:i:s'),\n // 'user_id' => $request->payment,\n \n ]);\n // $order = new Order();\n\n\n foreach(Cart::content() as $product)\n {\n $order->products()->create([\n 'title' => $product->name,\n 'quantite' => $product->qty,\n 'price' => $product->price\n ]);\n // $order->payment_intent_id = $data['paymentIntent']['id'];\n }\n if($data['paymentIntent']['status'] == 'succeeded')\n {\n Cart::destroy();\n Session::flash('success','Votre commande à été traitée avec succes');\n return response()->json(['success' => 'Le paiement à réussi']);\n //return back()->with('success', 'Le paiement à réussi.');\n }\n else\n {\n return response()->json(['error' => 'Le paiement à échoué']);\n }\n}", "private function updateOrderData()\n {\n $sign = $this->connector->signRequestKid(\n null,\n $this->connector->accountURL,\n $this->orderURL\n );\n\n $post = $this->connector->post($this->orderURL, $sign);\n if (strpos($post['header'], \"200 OK\") !== false) {\n $this->status = $post['body']['status'];\n $this->expires = $post['body']['expires'];\n $this->identifiers = $post['body']['identifiers'];\n $this->authorizationURLs = $post['body']['authorizations'];\n $this->finalizeURL = $post['body']['finalize'];\n if (array_key_exists('certificate', $post['body'])) {\n $this->certificateURL = $post['body']['certificate'];\n }\n $this->updateAuthorizations();\n } else {\n //@codeCoverageIgnoreStart\n $this->log->error(\"Failed to fetch order for {$this->basename}\");\n //@codeCoverageIgnoreEnd\n }\n }", "function saveOrder()\n\t\t{\n\t\t\tglobal $current_user, $wpdb, $pmpro_checkout_id;\n\n\t\t\t//get a random code to use for the public ID\n\t\t\tif(empty($this->code))\n\t\t\t\t$this->code = $this->getRandomCode();\n\n\t\t\t//figure out how much we charged\n\t\t\tif(!empty($this->InitialPayment))\n\t\t\t\t$amount = $this->InitialPayment;\n\t\t\telseif(!empty($this->subtotal))\n\t\t\t\t$amount = $this->subtotal;\n\t\t\telse\n\t\t\t\t$amount = 0;\n\n\t\t\t//Todo: Tax?!, Coupons, Certificates, affiliates\n\t\t\tif(empty($this->subtotal))\n\t\t\t\t$this->subtotal = $amount;\n\t\t\tif(isset($this->tax))\n\t\t\t\t$tax = $this->tax;\n\t\t\telse\n\t\t\t\t$tax = $this->getTax(true);\n\t\t\t$this->certificate_id = \"\";\n\t\t\t$this->certificateamount = \"\";\n\n\t\t\t//calculate total\n\t\t\tif(!empty($this->total))\n\t\t\t\t$total = $this->total;\n\t\t\telse {\n\t\t\t\t$total = (float)$amount + (float)$tax;\n\t\t\t\t$this->total = $total;\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t//these fix some warnings/notices\n\t\t\tif(empty($this->billing))\n\t\t\t{\n\t\t\t\t$this->billing = new stdClass();\n\t\t\t\t$this->billing->name = $this->billing->street = $this->billing->city = $this->billing->state = $this->billing->zip = $this->billing->country = $this->billing->phone = \"\";\n\t\t\t}\n\t\t\tif(empty($this->user_id))\n\t\t\t\t$this->user_id = 0;\n\t\t\tif(empty($this->paypal_token))\n\t\t\t\t$this->paypal_token = \"\";\n\t\t\tif(empty($this->couponamount))\n\t\t\t\t$this->couponamount = \"\";\n\t\t\tif(empty($this->payment_type))\n\t\t\t\t$this->payment_type = \"\";\n\t\t\tif(empty($this->payment_transaction_id))\n\t\t\t\t$this->payment_transaction_id = \"\";\n\t\t\tif(empty($this->subscription_transaction_id))\n\t\t\t\t$this->subscription_transaction_id = \"\";\n\t\t\tif(empty($this->affiliate_id))\n\t\t\t\t$this->affiliate_id = \"\";\n\t\t\tif(empty($this->affiliate_subid))\n\t\t\t\t$this->affiliate_subid = \"\";\n\t\t\tif(empty($this->session_id))\n\t\t\t\t$this->session_id = \"\";\n\t\t\tif(empty($this->accountnumber))\n\t\t\t\t$this->accountnumber = \"\";\n\t\t\tif(empty($this->cardtype))\n\t\t\t\t$this->cardtype = \"\";\n\t\t\tif(empty($this->expirationmonth))\n\t\t\t\t$this->expirationmonth = \"\";\n\t\t\tif(empty($this->expirationyear))\n\t\t\t\t$this->expirationyear = \"\";\n\t\t\tif(empty($this->ExpirationDate))\n\t\t\t\t$this->ExpirationDate = \"\";\n\t\t\tif (empty($this->status))\n\t\t\t\t$this->status = \"\";\n\n\t\t\tif(empty($this->gateway))\n\t\t\t\t$this->gateway = pmpro_getOption(\"gateway\");\n\t\t\tif(empty($this->gateway_environment))\n\t\t\t\t$this->gateway_environment = pmpro_getOption(\"gateway_environment\");\n\n\t\t\tif(empty($this->datetime) && empty($this->timestamp))\n\t\t\t\t$this->datetime = date(\"Y-m-d H:i:s\", time());\n\t\t\telseif(empty($this->datetime) && !empty($this->timestamp) && is_numeric($this->timestamp))\n\t\t\t\t$this->datetime = date(\"Y-m-d H:i:s\", $this->timestamp);\t//get datetime from timestamp\n\t\t\telseif(empty($this->datetime) && !empty($this->timestamp))\n\t\t\t\t$this->datetime = $this->timestamp;\t\t//must have a datetime in it\n\n\t\t\tif(empty($this->notes))\n\t\t\t\t$this->notes = \"\";\n\n\t\t\tif(empty($this->checkout_id) || intval($this->checkout_id)<1) {\n\t\t\t\t$highestval = $wpdb->get_var(\"SELECT MAX(checkout_id) FROM $wpdb->pmpro_membership_orders\");\n\t\t\t\t$this->checkout_id = intval($highestval)+1;\n\t\t\t\t$pmpro_checkout_id = $this->checkout_id;\n\t\t\t}\n\n\t\t\t//build query\n\t\t\tif(!empty($this->id))\n\t\t\t{\n\t\t\t\t//set up actions\n\t\t\t\t$before_action = \"pmpro_update_order\";\n\t\t\t\t$after_action = \"pmpro_updated_order\";\n\t\t\t\t//update\n\t\t\t\t$this->sqlQuery = \"UPDATE $wpdb->pmpro_membership_orders\n\t\t\t\t\t\t\t\t\tSET `code` = '\" . $this->code . \"',\n\t\t\t\t\t\t\t\t\t`session_id` = '\" . $this->session_id . \"',\n\t\t\t\t\t\t\t\t\t`user_id` = \" . intval($this->user_id) . \",\n\t\t\t\t\t\t\t\t\t`membership_id` = \" . intval($this->membership_id) . \",\n\t\t\t\t\t\t\t\t\t`paypal_token` = '\" . $this->paypal_token . \"',\n\t\t\t\t\t\t\t\t\t`billing_name` = '\" . esc_sql($this->billing->name) . \"',\n\t\t\t\t\t\t\t\t\t`billing_street` = '\" . esc_sql($this->billing->street) . \"',\n\t\t\t\t\t\t\t\t\t`billing_city` = '\" . esc_sql($this->billing->city) . \"',\n\t\t\t\t\t\t\t\t\t`billing_state` = '\" . esc_sql($this->billing->state) . \"',\n\t\t\t\t\t\t\t\t\t`billing_zip` = '\" . esc_sql($this->billing->zip) . \"',\n\t\t\t\t\t\t\t\t\t`billing_country` = '\" . esc_sql($this->billing->country) . \"',\n\t\t\t\t\t\t\t\t\t`billing_phone` = '\" . esc_sql($this->billing->phone) . \"',\n\t\t\t\t\t\t\t\t\t`subtotal` = '\" . $this->subtotal . \"',\n\t\t\t\t\t\t\t\t\t`tax` = '\" . $this->tax . \"',\n\t\t\t\t\t\t\t\t\t`couponamount` = '\" . $this->couponamount . \"',\n\t\t\t\t\t\t\t\t\t`certificate_id` = \" . intval($this->certificate_id) . \",\n\t\t\t\t\t\t\t\t\t`certificateamount` = '\" . $this->certificateamount . \"',\n\t\t\t\t\t\t\t\t\t`total` = '\" . $this->total . \"',\n\t\t\t\t\t\t\t\t\t`payment_type` = '\" . $this->payment_type . \"',\n\t\t\t\t\t\t\t\t\t`cardtype` = '\" . $this->cardtype . \"',\n\t\t\t\t\t\t\t\t\t`accountnumber` = '\" . $this->accountnumber . \"',\n\t\t\t\t\t\t\t\t\t`expirationmonth` = '\" . $this->expirationmonth . \"',\n\t\t\t\t\t\t\t\t\t`expirationyear` = '\" . $this->expirationyear . \"',\n\t\t\t\t\t\t\t\t\t`status` = '\" . esc_sql($this->status) . \"',\n\t\t\t\t\t\t\t\t\t`gateway` = '\" . $this->gateway . \"',\n\t\t\t\t\t\t\t\t\t`gateway_environment` = '\" . $this->gateway_environment . \"',\n\t\t\t\t\t\t\t\t\t`payment_transaction_id` = '\" . esc_sql($this->payment_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t`subscription_transaction_id` = '\" . esc_sql($this->subscription_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t`timestamp` = '\" . esc_sql($this->datetime) . \"',\n\t\t\t\t\t\t\t\t\t`affiliate_id` = '\" . esc_sql($this->affiliate_id) . \"',\n\t\t\t\t\t\t\t\t\t`affiliate_subid` = '\" . esc_sql($this->affiliate_subid) . \"',\n\t\t\t\t\t\t\t\t\t`notes` = '\" . esc_sql($this->notes) . \"',\n\t\t\t\t\t\t\t\t\t`checkout_id` = \" . intval($this->checkout_id) . \"\n\t\t\t\t\t\t\t\t\tWHERE id = '\" . $this->id . \"'\n\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set up actions\n\t\t\t\t$before_action = \"pmpro_add_order\";\n\t\t\t\t$after_action = \"pmpro_added_order\";\n\t\t\t\t\n\t\t\t\t//only on inserts, we might want to set the expirationmonth and expirationyear from ExpirationDate\n\t\t\t\tif( (empty($this->expirationmonth) || empty($this->expirationyear)) && !empty($this->ExpirationDate)) {\n\t\t\t\t\t$this->expirationmonth = substr($this->ExpirationDate, 0, 2);\n\t\t\t\t\t$this->expirationyear = substr($this->ExpirationDate, 2, 4);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//insert\n\t\t\t\t$this->sqlQuery = \"INSERT INTO $wpdb->pmpro_membership_orders\n\t\t\t\t\t\t\t\t(`code`, `session_id`, `user_id`, `membership_id`, `paypal_token`, `billing_name`, `billing_street`, `billing_city`, `billing_state`, `billing_zip`, `billing_country`, `billing_phone`, `subtotal`, `tax`, `couponamount`, `certificate_id`, `certificateamount`, `total`, `payment_type`, `cardtype`, `accountnumber`, `expirationmonth`, `expirationyear`, `status`, `gateway`, `gateway_environment`, `payment_transaction_id`, `subscription_transaction_id`, `timestamp`, `affiliate_id`, `affiliate_subid`, `notes`, `checkout_id`)\n\t\t\t\t\t\t\t\tVALUES('\" . $this->code . \"',\n\t\t\t\t\t\t\t\t\t '\" . session_id() . \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->user_id) . \",\n\t\t\t\t\t\t\t\t\t \" . intval($this->membership_id) . \",\n\t\t\t\t\t\t\t\t\t '\" . $this->paypal_token . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql(trim($this->billing->name)) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql(trim($this->billing->street)) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->city) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->state) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->zip) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->country) . \"',\n\t\t\t\t\t\t\t\t\t '\" . cleanPhone($this->billing->phone) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->subtotal . \"',\n\t\t\t\t\t\t\t\t\t '\" . $tax . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->couponamount. \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->certificate_id) . \",\n\t\t\t\t\t\t\t\t\t '\" . $this->certificateamount . \"',\n\t\t\t\t\t\t\t\t\t '\" . $total . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->payment_type . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->cardtype . \"',\n\t\t\t\t\t\t\t\t\t '\" . hideCardNumber($this->accountnumber, false) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->expirationmonth . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->expirationyear . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->status) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->gateway . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->gateway_environment . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->payment_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->subscription_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->datetime) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->affiliate_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->affiliate_subid) . \"',\n\t\t\t\t\t\t\t\t\t\t'\" . esc_sql($this->notes) . \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->checkout_id) . \"\n\t\t\t\t\t\t\t\t\t )\";\n\t\t\t}\n\n\t\t\tdo_action($before_action, $this);\n\t\t\tif($wpdb->query($this->sqlQuery) !== false)\n\t\t\t{\n\t\t\t\tif(empty($this->id))\n\t\t\t\t\t$this->id = $wpdb->insert_id;\n\t\t\t\tdo_action($after_action, $this);\n\t\t\t\treturn $this->getMemberOrderByID($this->id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function setOrder(OrderInterface $order);", "public function creating(Order $order): void\n\t{\n\t\tif (auth()->check()) {\n\t\t\t$order->client_id = auth()->id();\n\t\t}\n\t\t// If a booster has been selected for the order, set its status to progress, otherwise pending\n\t\t(bool) $order->booster_id ? $order->status = 'progress' : 'pending';\n\t}", "public function store(OrderRequest $request)\n {\n $request->validated();\n // dd($request->post());\n $file = \"\";\n if($request->hasFile('transaction_file')){\n $file = $request->file('transaction_file')->store(env(\"TRANSACTION_DIR\").date(\"Y/m/d\"));\n }\n\n //insert to tabel order\n DB::transaction(function() use ($request, $file)\n {\n $detailUnit = DB::table('unit')\n ->where('unit.id', $request->unit_id)->first();\n\n $findOrder = DB::table('orders')->where('unit_id', '=', $request->unit_id)->first();\n if($findOrder == null){\n $data = [\n 'order_number' => \"ORDER_\".rand(1, 1000),\n 'client_id' => $request->client,\n 'user_id' => auth()->user()->id,\n 'unit_id' => $request->unit_id,\n ];\n \n // jika order reserved\n if($request->payment_status == PaymentStatus::RESERVED_ID){\n $data = array_merge($data, ['reserved_date' => date(\"Y-m-d H:i:s\")]);\n }\n \n // jika order booking\n if($request->payment_status == PaymentStatus::BOOKING_ID){\n $hitungdpdancicilan = $this->hitungTotalDPdanCicilan($detailUnit->price,$request->nominal,$request->order_dp_persen,$request->order_lama_cicilan);\n $dpdanCicilan = [\n 'persen_dp' => $request->order_persen_dp,\n 'nominal_dp' => $hitungdpdancicilan[0],\n 'lama_cicilan' => $request->order_lama_cicilan,\n 'cicilan' => $hitungdpdancicilan[1],\n 'booking_date' => date(\"Y-m-d H:i:s\")\n ];\n $data = array_merge($data, $dpdanCicilan);\n }\n $orderID = DB::table('orders')->insertGetId($data);\n }else{\n $orderID = $findOrder->id;\n\n $findBookingPrice = DB::table('payment_histories')\n ->where('order_id', '=', $findOrder->id)\n ->where('payment_status_id', \"=\",PaymentStatus::BOOKING_ID)\n ->first();\n $data = [];\n if($request->order_persen_dp != null && $request->order_lama_cicilan != null){\n if($findBookingPrice == null){\n $bookingfee = str_replace(\",\",\"\",$request->nominal);\n }else{\n $bookingfee = $findBookingPrice->nominal;\n }\n $hitungdpdancicilan = $this->hitungTotalDPdanCicilan($detailUnit->price,$bookingfee,$request->order_persen_dp,$request->order_lama_cicilan);\n \n $data = [\n 'persen_dp' => $request->order_persen_dp,\n 'nominal_dp' => $hitungdpdancicilan[0],\n 'lama_cicilan' => $request->order_lama_cicilan,\n 'cicilan' => $hitungdpdancicilan[1],\n ];\n }\n\n if($request->payment_status == PaymentStatus::BOOKING_ID){\n $data = array_merge($data, ['booking_date' => date(\"Y-m-d H:i:s\")]);\n }elseif($request->payment_status == PaymentStatus::DP_ID){\n $data = array_merge($data, ['dp_date' => date(\"Y-m-d H:i:s\")]);\n }\n \n if(!empty($data)){\n DB::table('orders')->where('id', '=', $orderID)->update($data);\n }\n }\n \n $paymentHistories = [\n 'order_id' => $orderID,\n 'user_id' => auth()->user()->id,\n 'payment_status_id' => $request->payment_status,\n 'payment_number' => 'PN_'.$request->order_id.\"_\".auth()->user()->id.\"_\".rand(0, 9999).\"_\".strtotime(date('YmdHis')),\n 'nominal' => str_replace(\",\",\"\", $request->nominal),\n 'payment_method' => $request->payment_method,\n 'payment_date' => date('Y-m-d H:i:s'),\n 'status' => ($request->payment_status_id == 2 ? 1 : 0),\n 'transaction_file' => $file,\n 'notes' => $request->payment_history_note\n ];\n if(auth()->user()->hasRole('kasir')){\n $paymentHistories = array_merge($paymentHistories, ['valid_transaction'=>$request->valid_transaction]);\n }\n $pr = DB::table(\"payment_histories\")->insert($paymentHistories);\n });\n return redirect(route('units.index'));\n //\n }", "function save($order_id = 0) {\n\tif ($order_id) {\n\t $this->order_id = $order_id;\n\t}\n\n\t$this->update_records(\"order_id\");\n\tparent::save();\n }", "public function storeDataInSession() {\n\t\t$_SESSION['Order__id'] = $this->insertedOrderId;\n\t\t$_SESSION['transactionAmount'] = $this->totalPrice;\n\t}", "function createOrder($order,$requester,$numberId){\n $sql='';\n //status==0 mean have to cook and else will finish now status will be send\n $finish_time=$order->status==0 ? '\\'0000-00-00 00:00:00\\'' :'now()';\n $sql = 'INSERT INTO `order` (waiter_id,chef_id, number_id, table_id, product_id,bill_detail_id, count, comments, order_time, finish_time, status, price) VALUES ';\n $sql.= '(\\''.$requester.'\\',\\'\\','.$numberId.', '.$order->table_id.', '.$order->product_id.',-1,'.$order->count.',\\''.$order->comments.'\\', now(), '.$finish_time.', \\''.$order->status.'\\', '.$order->price.');';\n //echo $sql;\n if(isset($this->connection)){\n return $this->queryNotAutoClose($sql);\n }else{\n return $this->query($sql);\n }\n }", "public function store(Request $request)\n {\n $orders = $request->order;\n if(!$orders){ \n return response()->json(['status' => 'NOK', 'msg' => 'The order is empty please add items to the order!']); \n }\n $orderId = $request->orderId;\n try{\n DB::beginTransaction();\n foreach($orders as $order){\n $array = explode('_', $order['id']);\n $item = new OrderItem;\n $item->order_id = $orderId;\n $item->item_type = $array[0];\n if($item->item_type == 'drink'){\n $item->drink_id = $array[1];\n }else{\n $item->meal_id = $array[1];\n }\n $item->amount = $order['amount'];\n $item->price = $order['price'];\n $item->save();\n }\n DB::commit();\n return response()->json(['status' => 'OK']);\n }catch(Exception $e){\n DB::rollback();\n return response()->json(['status' => 'NOK', 'msg' => 'Something went wrong on server please try again']);\n }\n }", "public function store(Request $request)\n {\n \n /* Note: please try improving the code below if possible for production */\n //------------------------------------------------------------------------//\n\n\n //Finding the requested item for the order \n $item = Item::findOrFail( request('item_id') );\n \n //Getting the Quanitiy & customer's name\n $qty = request('qty');\n $customer_name = request('customer_name');\n $total = $item->price * $qty; //Calculating the total\n \n // Checks if the order is already paid for or not\n if(request('paid') == null) $paid=0;\n else $paid = 1;\n\n //getting the first Order line object (if any)\n $first = Order_line::orderBy('id', 'desc')->first();\n \n //Checking whether our table is empty or has record \n if($first == null) $order_line = 1;\n else $order_line = $first->id + 1 ; \n\n //Inserting the new order to the database\n Order::create([\n \"customer_name\" => $customer_name,\n \"price\" => $item->price,\n \"order_lines_id\" => $order_line,\n \"paid\" => $paid\n ]);\n\n //Retrevieng the last order for the order ID\n $order_id = Order::orderBy('id', 'desc')->first()->id;\n\n //Inserting the orderLine\n Order_line::create([\n 'id' => $order_line,\n 'order_id' => $order_id,\n 'item_id' => $item->id,\n 'price' => $total,\n 'qty' => $qty\n ]);\n\n // Returning back to the index page\n return redirect('orders');\n }", "public function store(Request $request)\n {\n $id = $request[\"id\"];\n $order = Order::find($id);\n $order->status = \"cooked\";\n $order->save();\n }", "public function order_save(Request $request)\n {\n if (!(\\Session::has('total') && (\\Session::get('total') > 0)))\n {\n alert()->error(__('Error'), __('No item in order'));\n return redirect()->route(auth()->user()->position . '.order.create');\n }\n\n $request->validate([\n \"vessel_name\" => 'required|min:2|max:255',\n ]);\n\n $product_list = $this->order_to_array();\n $this->update_price(true);\n\n $order = new Order();\n $order->total_price = $request->session()->get('total');\n $order->vessel_name = $request->vessel_name;\n $order->customer_id = auth()->user()->customer_id;\n $order->status_id = 1;\n $order->user_id = auth()->user()->id;\n $order->save();\n\n $order->product()->attach($product_list);\n $order->statusDate()->attach([\n 'status_id' => 1\n ]);\n\n \\Session::forget('total');\n \\Session::forget('order');\n\n alert()->success(__('Success'), __('Add new order success'));\n return redirect()->route(auth()->user()->position . '.order.index');\n }", "public function created(Order $order)\n {\n //\n }", "public function store(OrderRequest $request)\n {\n // validate the request\n $validated = $request->validated();\n\n // get the selected items\n $items = $validated['items'];\n\n // create the new order\n $order = Order::create([\n 'table' => $validated['table'],\n ]);\n\n // attach items\n foreach ($items as $item) {\n $order->items()->attach($item['id'], [\n 'amount' => $item['amount'],\n 'notes' => $item['notes'] ?? null,\n ]);\n }\n\n return new OrderResource(Order::with('items')->findOrFail($order->id));\n }", "public function store(Request $request)\n {\n $betkoks = session('cart.reservation_info');\n $order = Order::create([\n 'name' =>$betkoks['name'], \n 'email' => $betkoks['email'],\n 'table_name' => $betkoks['table_name'],\n 'contact_person' => $betkoks['contact_person'],\n 'phone' => $betkoks['phone'],\n 'order_time' => $betkoks['order_time'],\n 'order_date' => $betkoks['order_date'],\n 'number_of_persons' => $betkoks['number_of_persons'],\n\n 'total' => session('cart.total'),\n 'date' => \\Carbon\\Carbon::now(),\n 'user_id' => \\Auth::user()->id,\n\n ]);\n foreach (session('cart.items') as $item){\n OrderLine::create([\n 'name' =>$betkoks['name'],\n 'order_id' => $order->id,\n 'dish_id' => $item['id'],\n 'quantity' => $item['quantity'],\n 'total' => $item['total'],\n\n 'contact_person' => $request->get('contact_person'),\n 'phone' => $request->get('phone'),\n 'order_date' => $request->get('order_date'),\n 'order_time' => $request->get('order_time')\n ]);\n }\n $this->clearCart();\n return redirect()->route('contacts.index')->with('message', [\n 'text' => 'uzsakymas priimtas',\n 'type' => 'success'\n ]);\n }", "public static function storeOrderItem($orderId,$item)\n {\n try{\n DB::table('order_items')\n ->insert([\n 'order_id'=>$orderId,\n 'item_id'=>$item->id,\n 'quantity'=>$item->quantity,\n 'price'=>$item->price\n ]);\n }\n catch(QueryException $e){\n return false;\n }\n }" ]
[ "0.7364539", "0.726374", "0.7106978", "0.71015745", "0.70642054", "0.7025518", "0.6959", "0.6905181", "0.68016165", "0.679637", "0.6722248", "0.6704766", "0.6697388", "0.66618663", "0.664563", "0.6625681", "0.6620079", "0.66118896", "0.6610366", "0.6610225", "0.6592862", "0.65362495", "0.65137565", "0.6498862", "0.6487764", "0.6474308", "0.6465126", "0.6456237", "0.64419925", "0.6428874", "0.6419901", "0.6405592", "0.6365974", "0.63536644", "0.6350632", "0.63469714", "0.63450646", "0.6344773", "0.63375527", "0.63369775", "0.63360816", "0.63293093", "0.63224405", "0.6312013", "0.63097155", "0.6297876", "0.62886447", "0.6284516", "0.62811536", "0.6280285", "0.6277397", "0.62764496", "0.62753487", "0.6274281", "0.6271508", "0.62704116", "0.62657076", "0.6265331", "0.6262096", "0.62615764", "0.62527776", "0.62410396", "0.62410396", "0.6238493", "0.62336814", "0.62311405", "0.62310815", "0.6230498", "0.62041926", "0.6199687", "0.6172627", "0.61622745", "0.6154615", "0.6144736", "0.61378807", "0.6133296", "0.6121276", "0.6120626", "0.6112385", "0.61067885", "0.6105584", "0.61035544", "0.60928124", "0.60927105", "0.609084", "0.60882086", "0.6083266", "0.60693157", "0.60675144", "0.6062876", "0.60583323", "0.60578936", "0.605468", "0.60534525", "0.60487646", "0.6041638", "0.6035975", "0.603389", "0.603285", "0.6028046", "0.6026731" ]
0.0
-1
Tests that random posts are generated
public function testRandomPosts() { // remove all existing posts $all = Post::all(); foreach ($all as $post) { $post->delete(); } // create some Posts $posts = []; $posts[0] = $this->createPost(0, TRUE); $posts[1] = $this->createPost(1, TRUE); $posts[2] = $this->createPost(2, TRUE); $posts[3] = $this->createPost(3, TRUE); $posts[4] = $this->createPost(4, TRUE); $posts[5] = $this->createPost(5, TRUE); $posts[6] = $this->createPost(6, TRUE); $random_posts = $this->createRandomPostsComponent(); $generated_posts = $random_posts->posts(); // amount of posts should be equal to default value self::assertEquals(5, count($generated_posts)); // ensure all Posts are from posts created $found_all = TRUE; foreach ($generated_posts as $generated_post) { $found = FALSE; foreach ($posts as $post) { if ($post->id == $generated_post->id) { $found = TRUE; break; } } if (!$found) { $found_all = FALSE; break; } } self::assertTrue($found_all, 'All posts exist in original array'); // check for non-repeating $ids = []; foreach ($generated_posts as $post) { self::assertArrayNotHasKey($post->id, $ids, 'Post is not already present in the generated array'); $ids[$post->id] = $post->id; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testRandomPostsUnpublished() {\n // create posts, some of them unpublished (note that there is seeded post with id=1)\n $posts = [];\n $posts[0] = $this->createPost(0, TRUE);\n $posts[1] = $this->createPost(1, FALSE);\n $posts[2] = $this->createPost(2, TRUE);\n $posts[3] = $this->createPost(3, FALSE);\n\n\n // get random posts of same quantity\n $random_posts = $this->createRandomPostsComponent();\n $generated_posts = $random_posts->posts();\n\n // ensure there are no unpublished posts in the array\n $ids = $generated_posts->pluck('id');\n self::assertTrue(in_array($posts[0]->id, $ids->all()), 'Published post is in generated array');\n self::assertFalse(in_array($posts[1]->id, $ids->all()), 'Unpublished post is not in generated array');\n self::assertFalse(in_array($posts[3]->id, $ids->all()), 'Unpublished post is not in generated array');\n }", "function get_random_posts( $category_id, $post_count ) {\n\n $posts = get_posts( array(\n 'posts_per_page' => $post_count,\n 'orderby' => 'rand',\n 'cat' => $category_id,\n 'post_status' => 'publish',\n ) );\n\n return $posts;\n}", "public function run(Faker $faker)\n {\n for($i = 0; $i < 10; $i++) {\n $newPost = new Post();\n $newPost->title = $faker->sentence(3);\n $newPost->content = $faker->text(500);\n\n $userCount = Count(User::all()->toArray());\n $newPost->user_id = rand(1,$userCount);\n\n $slug = Str::slug($newPost->title);\n $slugIniziale = $slug;\n \n $postPresente = Post::where('slug',$slug)->first();\n\n $contatore = 1;\n\n while($postPresente) {\n $slug = $slugIniziale . '-' . $contatore;\n $postPresente = Post::where('slug',$slug)->first();\n $contatore++;\n }\n\n $newPost->slug = $slug;\n\n\n $newPost->save();\n }\n }", "public function run()\n {\n factory(App\\Models\\Post::class, 40)->create();\n\n// $tags = App\\Models\\PostTag::all()->pluck('id')->toArray();\n// $posts = App\\Models\\Post::all()->each(function ($post) use ($tags) {\n// echo( $tags->random(rand(1, $tags->count() - 1))->pluck('id')->toArray());\n// $post->tags()->attach(\n// array_rand($tags,rand(0,count($tags)-1))\n//// $tags->random(rand(1, $tags->count() - 1))->pluck('id')->toArray()\n// );\n// });\n }", "function sp_random_posts($numberOfPosts = 5 , $thumb = true){\n\tglobal $post;\n\t$orig_post = $post;\n\n\t$lastPosts = get_posts('orderby=rand&numberposts='.$numberOfPosts);\n\tforeach($lastPosts as $post): setup_postdata($post);\n?>\n<li>\n\t<?php if ( $thumb && sp_post_image('sp-small') ) : ?>\t\t\t\n\t\t<div class=\"post-thumbnail\">\n\t\t\t<a href=\"<?php the_permalink(); ?>\" title=\"<?php printf( __( 'Permalink to %s', 'sptheme' ), the_title_attribute( 'echo=0' ) ); ?>\" rel=\"bookmark\">\n\t\t\t<img src=\"<?php echo sp_post_image('sp-small') ?>\" width=\"110\" height=\"83\" />\n </a>\n\t\t</div><!-- post-thumbnail /-->\n\t<?php endif; ?>\n\t<h3><a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?></a></h3>\n\t<?php //sp_get_score(); ?> <div class=\"entry-meta\"><?php echo sp_posted_on(); ?></div>\n</li>\n<?php endforeach;\n\t$post = $orig_post;\n}", "public function run(Faker $faker)\n {\n for ($i=0; $i<10; $i++) {\n $new_post = new Post();\n\n $new_post->title = $faker->sentence(rand(1,5));\n $new_post->content = $faker->text();\n \n // genero lo slug\n $slug = Str::slug($new_post->title, '-');\n $slug_base = $slug;\n\n //verifico che lo slug non sia già presente nel db\n $slug_present = Post::where('slug', $slug)->first();\n $counter = 1;\n\n //ciclo fino a quando slug_present diventa true\n while($slug_present) {\n $slug = $slug_base.'-'.$counter;\n $counter++; \n $slug_present = Post::where('slug', $slug)->first();\n }\n\n $new_post->slug = $slug;\n\n //perchè ho solo 1 utente\n $new_post->user_id = 1;\n\n $new_post->save();\n }\n }", "function vip_get_random_posts( $number = 1, $post_type = 'post', $return_ids = false ) {\n\t$query = new WP_Query( array( 'posts_per_page' => 100, 'fields' => 'ids', 'post_type' => $post_type ) );\n\n\t$post_ids = $query->posts;\n\tshuffle( $post_ids );\n\t$post_ids = array_splice( $post_ids, 0, $number );\n\n\tif ( $return_ids )\n\t\treturn $post_ids;\n\n\t$random_posts = get_posts( array( 'post__in' => $post_ids, 'numberposts' => count( $post_ids ), 'post_type' => $post_type ) );\n\n\treturn $random_posts;\n}", "public function run()\n {\n factory(\\App\\Models\\Post::class, 500)->create();\n\n $categories = \\App\\Models\\Categories::all();\n\n \\App\\Models\\Post::all()->each(function($post) use ($categories){\n $post->category()->attach(\n $categories->random(rand(1,3))->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n \t$faker = Faker\\Factory::create();\n\n for ($i=0; $i < 50; $i++) { \n \t\t$post = new post();\n \t\t$post->cat_ID = rand(1, 9);\n $post->postTitle = $faker->text('10');\n $post->postContent = $faker->text('500');\n $post->user_ID = rand(1, 4);\n $post->save();\n }\n }", "public function run()\n {\n $faker = Faker::create();\n $user = User::all()->pluck('id');\n $postCategory = PostCategory::all()->pluck('id');\n for($i = 0; $i < 50; $i++) {\n $created = $faker->dateTimeThisDecade($max = 'now');\n $updated = $faker->dateTimeThisDecade($max = 'now');\n if($created <= $updated) {\n DB::table('posts')->insert([\n 'name' => $faker->sentence($nbWords = 6, $variableNbWords = true),\n 'title' => $faker->sentence($nbWords =10, $variableNbWords = true),\n 'description' => $faker->text(),\n 'image' => '',\n 'video' => '',\n 'user_id' => $faker->randomElement($user->toArray()),\n 'post_category_id' => $faker->randomElement($postCategory->toArray()),\n 'created_at' => $created,\n 'updated_at' => $updated,\n ]);\n } else {\n $i--;\n }\n\n }\n}", "public function run()\n {\n //\n $posts = Post::where('type', '=', 'post')->orWhere('type', '=', 'image')->get();\n $userCount = count(User::all());\n\n foreach ($posts as $post) {\n\n $i = random_int(1, 8);\n\n while($i < 6) {\n $comment = new Reply;\n $faker = Factory::create();\n\n $comment->parent_id = $post->id;\n $comment->title = $faker->catchPhrase();\n $comment->content = $faker->paragraphs(5, true);\n $comment->user_id = random_int(1, $userCount);\n $comment->published_at = now();\n $comment->save();\n $i++;\n\n }\n }\n }", "public function run()\n {\n $tags = Tag::all();\n factory(App\\Post::class, 20)->create()->each(function ($post) {\n $tags = Tag::all()->pluck('id')->all();\n $randomTags = array_rand($tags, 3);\n $tt = array();\n foreach ($randomTags as $key => $value) {\n array_push($tt, $tags[$value]);\n }\n $post->tags()->attach($tt);\n }\n );\n }", "public function run()\n {\n \t$faker = Faker\\Factory::create();\n\n $limit = 15;\n\n for ($i = 0; $i < $limit; $i++) {\n \t$random_user = User::orderBy(DB::raw('RAND()'))->take(1)->get();\n DB::table('posts')->insert([\n 'post_image_link' => \"profile-default.png\",\n 'post_user_id' => $random_user[0]['id'],\n 'image_caption' => $faker->word, \n 'hashtags' => \"#new #good\",\n ]);\n }\n }", "function getLatestPosts($count = 5)\n{\n $posts = [];\n $postTypes = [\"urgent\", \"warning\", \"normal\"];\n\n for($i=1; $i<=$count; $i++) {\n do {\n $id = rand(1, 1000);\n } while (array_key_exists($id, $posts));\n\n $type = $postTypes[rand(0, count($postTypes)-1)];\n\n $posts[$id] = [\n \"title\" => \"Başlık \" . $i,\n \"type\" => $type\n ];\n }\n\n return $posts;\n}", "public function run()\n {\n factory(App\\Post::class, 50)->create()->each(function ($post){\n $a=App\\Tag::inRandomOrder();\n $numbers = range(1, 100);\n shuffle($numbers);\n $tags = array($numbers[0],$numbers[1],$numbers[2]); \n $post->tags()->attach($tags);\n $post->save(); \n }\n );\n }", "public function run(Faker $faker)\n {\n for ($i = 0; $i < 10; $i++){\n $newPost = new Post;\n $newPost->title = $faker->name;\n $newPost->subtitle = $faker->name;\n $newPost->author = $faker->name;\n $newPost->description = $faker->name;\n $newPost->date = $faker->dateTime($max = 'now', $timezone = null);\n $newPost->save();\n }\n }", "public function run()\n {\n Post::all()->each(function ($post){\n Image::factory()->times(rand(0,5))->create(['post_id' => $post->id]);\n\n// $image = Image::factory()->make();\n// $image->post_id = $post->id;\n// $image->save();\n });\n }", "function random_post() {\n\t$randomComicQuery = new WP_Query(); $randomComicQuery->query('showposts=1&orderby=rand&cat=-'.exclude_comic_categories());\n\twhile ($randomComicQuery->have_posts()) : $randomComicQuery->the_post();\n\t\t$random_comic_id = get_the_ID();\n\tendwhile;\n\twp_redirect( get_permalink( $random_comic_id ) );\n\texit;\n}", "function random_featured_items($count = 5, $hasImage = null)\n{\n $items = get_random_featured_items($count, $hasImage);\n if ($items) {\n $html = '';\n foreach ($items as $item) {\n $html .= get_view()->partial('items/single.php', array('item' => $item));\n release_object($item);\n }\n } else {\n $html = '<p>' . __('No featured items are available.') . '</p>';\n }\n return $html;\n}", "public function run()\n {\n foreach (Post::get() as $post) {\n $numberOfUsers = rand(0, 10);\n $randomUserIDs = User::inRandomOrder()->where('id', '<>', $post->user->id)->limit($numberOfUsers)->pluck('id');\n $post->likedBy()->attach($randomUserIDs);\n }\n }", "public function run(Faker $faker)\n {\n \n for ($i=0; $i < 100; $i++) { \n $newPost = new Post();\n $newPost->title = $faker->word(3);\n $newPost->body = $faker->text(300);\n $newPost->save();\n }\n \n\n }", "public function run()\n {\n // reset the posts table\n DB::table('posts')->truncate();\n \n //genrate 10 dummy posts data\n $posts = [];\n $faker = Factory::create();\n \n for ($i = 1; $i <= 10; $i++){\n $image = \"Post_Image_\" . rand(1,5) . \".jpg\";\n $posts[] = [\n 'excerpt' => $faker->text(rand(250, 300)),\n 'body' => $faker->paragraphs(rand(10, 15), true),\n 'image' => rand(0, 1) == 1? $image : NULL\n ];\n }\n }", "public function run()\n {\n factory(User::class, 10)->create();\n factory(Thread::class, 50)->create()->each(function ($thread){\n for ($i=0; $i<rand(0, 20); $i++) {\n $rand_user = User::inRandomOrder()->first();\n factory(Post::class, 1)->create(\n ['thread_id' => $thread->id, 'user_id' => $rand_user->id]);\n }\n });\n }", "public function run(Faker $faker)\n {\n /* Usiamo FAKER per risultati random */\n for($count = 0; $count < 5; $count++) {\n $new_post = new Post();\n $new_post->title = $faker->words(4, true);\n $new_post->content = $faker->paragraphs(4, true);\n $new_post->slug = Str::slug($new_post->title, '-');\n $new_post->save();\n }\n }", "public function run()\n {\n Post::truncate();\n $total=30;\n $faker=Faker::create('zh_TW');\n\n foreach (range(1,$total) as $number){\n Post::create([\n// 'title'=> $faker->sentence,\n// 'content'=> $faker->paragraph,\n 'title'=> $faker->realText(20),\n 'content'=> $faker->realText(400),\n 'is_feature'=>rand(0,1),\n 'user_id'=>rand(1,5),\n 'created_at'=> Carbon::now()->subDays($total-$number),\n 'updated_at'=> Carbon::now()->subDays($total-$number)->addHours(1,24),\n ]);\n\n }\n\n }", "public function run(Faker $faker)\n {\n for ($i = 0; $i < 10; $i++) {\n $randomCategory = Category::inRandomOrder()->first();\n $title = $faker->sentence(4);\n\n $newPost = new Post;\n $newPost->category_id = $randomCategory->id;\n $newPost->title = $title;\n $newPost->slug = Str::slug($title);\n $newPost->content = $faker->text;\n\n $newPost->save();\n }\n }", "public function testRandom()\n {\n $widget = 'MeCms.Photos::random';\n\n $expected = [\n ['div' => ['class' => 'widget mb-4']],\n 'h4' => ['class' => 'widget-title'],\n 'Random photo',\n '/h4',\n ['div' => ['class' => 'widget-content']],\n ['a' => ['href' => '/albums']],\n ['img' => ['src', 'alt', 'class' => 'img-fluid thumbnail']],\n '/a',\n '/div',\n '/div',\n ];\n $this->assertHtml($expected, $this->Widget->widget($widget)->render());\n\n //Tries another limit\n $expected = [\n ['div' => ['class' => 'widget mb-4']],\n 'h4' => ['class' => 'widget-title'],\n 'Random 2 photos',\n '/h4',\n ['div' => ['class' => 'widget-content']],\n ['a' => ['href' => '/albums']],\n ['img' => ['src', 'alt', 'class' => 'img-fluid thumbnail']],\n '/a',\n ['a' => ['href' => '/albums']],\n ['img' => ['src', 'alt', 'class' => 'img-fluid thumbnail']],\n '/a',\n '/div',\n '/div',\n ];\n $this->assertHtml($expected, $this->Widget->widget($widget, ['limit' => 2])->render());\n\n //Empty on same controllers\n foreach (['Photos', 'PhotosAlbums'] as $controller) {\n $request = $this->Widget->getView()->getRequest()->withParam('controller', $controller);\n $this->Widget->getView()->setRequest($request);\n $this->assertEmpty($this->Widget->widget($widget)->render());\n }\n $this->Widget->getView()->setRequest(new ServerRequest());\n\n //Tests cache\n $this->assertEquals(3, Cache::read('widget_random_1', $this->Table->getCacheName())->count());\n $this->assertEquals(3, Cache::read('widget_random_2', $this->Table->getCacheName())->count());\n\n //With no photos\n $this->Table->deleteAll(['id IS NOT' => null]);\n $this->assertEmpty($this->Widget->widget($widget)->render());\n }", "function postit(){\r\n $rand = rand(1, 4);\r\n return \"postit\" . $rand;\r\n}", "public function run()\n {\n $users = User::factory(10)->create();\n Post::factory(30)->state(new Sequence(fn () => ['author' => $users->random()],))->create();\n }", "public function testViewPosts()\n {\n $posts = factory(\\App\\Models\\Post::class, 22)->create();\n $this->browse(function (Browser $browser) use ($posts) {\n $title = $this->faker->sentence();\n $browser->visit(\"/\")\n ->assertSee($posts[0]->title)\n ->assertSee($posts[19]->title)\n ->visit(\"/?page=2\")\n ->assertSee($posts[20]->title)\n ->assertSee($posts[21]->title)\n ->screenshot(\"testViewPosts\");\n });\n }", "public function run(Faker $faker)\n {\n\n\n for ($i = 0; $i < 5; $i++){\n\n $image_name = Str::random(40) . '.jpg';\n\n $newPost = new Post();\n\n $newPost->title = $faker->sentence();\n $newPost->slug = $slug = Str::slug($newPost->title, '-');\n $newPost->content = $faker-> text();\n $newPost->public = $faker->boolean();\n $newPost->date = $faker->date(); \n\n if ( $this->saveRandomImage('public/storage/images/' . $image_name) ) {\n $newPost->image = 'images/' . $image_name;\n }\n \n $newPost->save();\n }\n\n }", "public function run()\n {\n $faker=Faker\\Factory::create();\n for($i=0;$i<100;$i++){\n $name=$faker->name;\n $post=new Post();\n $post->title=$name;\n $post->slug=str_slug($name);\n $post->image=$faker->imageUrl();\n $post->content=$faker->text(250);\n $post->category_id=$faker->numberBetween(1,20);\n $post->save();\n }\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 7; $i++) {\n $post = new Post;\n $post->title = $faker->realText($maxNbChars = 20, $indexSize = 1);\n $post->author = $faker->name;\n $post->description = $faker->realText($maxNbChars = 400, $indexSize = 2);\n $post->img = $faker->imageUrl();\n\n $post->save();\n }\n }", "public function testRandom() {\n\t\t$results = array();\n\t\tforeach (range(0, 100) as $run) {\n\t\t\t$results[] = _::random(10);\n\t\t}\n\t\t$this->assertContainsOnly('int', $results);\n\t\t$this->assertGreaterThanOrEqual(0, min($results));\n\t\t$this->assertLessThanOrEqual(10, max($results));\n\t}", "public function run()\n {\n\n $faker= Faker\\Factory::create();\n $data=[];\n for($i=0;$i<10;$i++){\n $data[]=[\n 'title'=> $faker->word,\n 'body'=> $faker->text(250),\n 'id_user'=>1,\n 'created_at'=>date('Y-m-d H:i:s')\n ];\n }\n $this->insert('posts',$data);\n }", "public function run() {\n\t\t$admin = App\\User::where('email', 'admin@example.com')->select('id')->first();\n\t\t//\n\t\t$faker = Faker\\Factory::create();\n\t\tfor ($i = 0; $i < 20; $i++) {\n\t\t\tApp\\Post::create([\n\t\t\t\t'user_id' => $admin->id,\n\t\t\t\t'title' => $faker->sentence,\n\t\t\t\t'content' => implode('', $faker->sentences(5)),\n\t\t\t\t'thumbnail_url' => 'https://unsplash.it/700/300?image='.$i,\n\t\t\t\t'status' => rand(1, 2),\n\t\t\t]);\n\t\t}\n\t}", "public function run()\n {\n $faker = Faker::create();\n $users = User::all()->pluck('id');\n $tags = Tag::all()->pluck('id');\n // ->random()\n for ($i = 0; $i < 100; $i++) {\n $post = [\n \"user_id\" => $users->random(),\n \"title\" => $faker->realText($faker->numberBetween(20, 40)),\n \"content\" => $faker->realText($faker->numberBetween(20, 800)),\n // 'access_level' => $accessLevelId,\n 'tags' => '',\n 'comments' => [\n 'total' => 0,\n ],\n 'reacts' => [\n 'total' => 0\n ],\n 'views' => [\n 'total' => 0\n ]\n ];\n $arrTag = [];\n $amountTag = $faker->numberBetween(2, 6);\n for ($j = 0; $j < $amountTag; $j++) {\n array_push($arrTag, $tags->random());\n }\n $post['tags'] = $arrTag;\n\n Post::create($post);\n }\n }", "public function run()\n {\n $author1 = User::where('email', 'user@gmail.com')->first();\n $author2 = User::where('email', 'admin@gmail.com')->first();\n $faker = Faker\\Factory::create();\n for ($i = 0; $i < 10; $i++) {\n $title = $faker->sentence($nbWords = 6, $variableNbWords = true);\n $post = Category::create([\n 'title' => $title,\n 'description' => $faker->text($maxNbChars = 100),\n 'status' => rand(0, 1),\n 'user_id' => $author1->id\n ]);\n $title = $faker->sentence($nbWords = 6, $variableNbWords = true);\n $post = Category::create([\n 'title' => $title,\n 'description' => $faker->text($maxNbChars = 100),\n 'status' => rand(0, 1),\n 'user_id' => $author2->id\n ]);\n }\n }", "public function run()\n {\n factory(Post::class, 100)->create()->each(function ($post) {\n $faker = Faker::create();\n $image = 'https://loremflickr.com/640/680?kitten=' . $faker->numberBetween(1, 30);\n $post->addMediaFromUrl($image)->toMediaCollection('post_images');\n });\n }", "public function run()\n {\n $faker = Faker::create();\n for( $i = 0; $i <5 ; $i++){\n $time = new DateTime();\n $post = new Post();\n $post->title = $faker->sentence;\n $post->slug = str_slug($post->title).\"-\".$time->getTimestamp();\n $post->content = $faker->paragraph(20);\n $post->type = \"dich-vu\";\n $post->typeName = \"Dịch vụ\";\n $post->username = 'admin';\n $post->save();\n }\n for( $i = 0; $i <5 ; $i++){\n $time = new DateTime();\n $post = new Post();\n $post->title = $faker->sentence;\n $post->slug = str_slug($post->title).\"-\".$time->getTimestamp();\n $post->content = $faker->paragraph(20);\n $post->type = \"du-an\";\n $post->typeName = \"Dự án\";\n $post->username = 'admin';\n $post->save();\n }\n for( $i = 0; $i <5 ; $i++){\n $time = new DateTime();\n $post = new Post();\n $post->title = $faker->sentence;\n $post->slug = str_slug($post->title).\"-\".$time->getTimestamp();\n $post->content = $faker->paragraph(20);\n $post->type = \"doi-tac\";\n $post->typeName = \"Đối tác\";\n $post->username = 'admin';\n $post->save();\n }\n for( $i = 0; $i <5 ; $i++){\n $time = new DateTime();\n $post = new Post();\n $post->title = $faker->sentence;\n $post->slug = str_slug($post->title).\"-\".$time->getTimestamp();\n $post->content = $faker->paragraph(20);\n $post->type = \"tuyen-dung\";\n $post->typeName = \"Tuyển dụng\";\n $post->username = 'admin';\n $post->save();\n }\n for( $i = 0; $i <5 ; $i++){\n $time = new DateTime();\n $post = new Post();\n $post->title = $faker->sentence;\n $post->slug = str_slug($post->title).\"-\".$time->getTimestamp();\n $post->content = $faker->paragraph(20);\n $post->type = \"tin-tuc\";\n $post->typeName = \"Tin tức\";\n $post->username = 'admin';\n $post->save();\n }\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i<30; $i++) {\n\t\t\t$new_post = new Post();\n\t\t\t$new_post['title'] \t = $faker->sentence(rand(2,6));\n\t\t\t$new_post['content'] = $faker->paragraphs($faker->numberBetween(5,20),true);\n\n\t\t\t// slug deve essere unico\n\t\t\t$slug = Str::slug($new_post->title,'-');\n\t\t\t$slug_tmp = $slug;\n\t\t\t$slug_is_present = Post::where('slug',$slug)->first();\n\t\t\t$counter = 1;\n\t\t\twhile ($slug_is_present) {\n\t\t\t\t$slug = $slug_tmp.'-'.$counter;\n\t\t\t\t$counter++;\n\t\t\t\t$slug_is_present = Post::where('slug',$slug)->first();\n\t\t\t}\n\n\t\t\t$new_post['slug'] \t = $slug;\n\t\t\t$new_post['user_id'] = 1;\n\t\t\t$new_post->save(); // ! DB writing here ! \n\t\t}\n }", "public function run()\n {\n // $faker = Faker::create();\n // $states = array('active', 'waiting', 'hidden', 'rejected');\n // $types = array('buy', 'sell');\n // $users = User::all()->pluck('id');\n // $provinces = Province::all()->pluck('id');\n // $districts = District::all()->pluck('id');\n // $wards = Ward::all()->pluck('id');\n // for ($i=0; $i < 300; $i++) {\n // $title = $faker->text;\n // Post::create([\n // 'user_id' => $faker->randomElement($users->toArray()),\n // 'province_id' => $faker->randomElement($provinces->toArray()),\n // 'district_id' => $faker->randomElement($districts->toArray()),\n // 'ward_id' => $faker->randomElement($wards->toArray()),\n // 'title' => $title,\n // 'price' => rand(1, 50) * 10,\n // 'state' => $states[rand(0, 3)],\n // 'type' => $types[rand(0, 1)],\n // 'phone' => $faker->phoneNumber,\n // 'address' => $faker->address,\n // 'slug' => str_slug($title),\n // 'description' => $faker->text,\n // 'created_at' => $faker->dateTimeThisYear($max = 'now')\n // ]);\n // }\n $this->createDummyPosts();\n }", "static function add_shuffle_posts(): void {\r\n self::add_acf_field(self::shuffle_posts, [\r\n 'label' => 'Shuffle the order of small posts within slides?',\r\n 'default_value' => 0,\r\n 'message' => '',\r\n 'ui' => 1,\r\n 'type' => 'true_false',\r\n 'instructions' => '',\r\n 'required' => 0,\r\n 'conditional_logic' => [\r\n [\r\n [\r\n 'field' => self::qualify_field(self::shuffle_all_posts),\r\n 'operator' => '!=',\r\n 'value' => '1',\r\n ],\r\n ],\r\n ],\r\n 'wrapper' => [\r\n 'width' => '25',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n ]);\r\n }", "public function orderRandom();", "public function run()\n {\n //rest post table\n DB::table('posts')->truncate();\n\n // generate 10 dummy posts\n $posts = [];\n $faker = Factory::create();\n for ($i=1; $i <=10 ; $i++) { \n $image = 'Post_image_' . rand(1,5) . '.jpg';\n $category_id = rand(1, 5);\n $posts[] = [\n 'author_id' => rand(1,3),\n 'title' => $faker->sentence(rand(8,12)),\n 'excerpt' => $faker->text(rand(250,300)),\n 'description' => $faker->paragraphs(rand(10,15),true),\n 'slug' => $faker->slug(),\n 'image' => rand(0,1) == 1 ? $image : Null,\n 'category_id' => $category_id,\n 'view_count' => rand(1,10) * 10\n ];\n }\n DB::table('posts')->insert($posts);\n }", "public function run(Faker $faker)\n {\n for ($i = 0; $i < 20; $i++) {\n $new_post = new Post();\n $new_post->title = $faker->sentence();\n $new_post->author = $faker->name();\n $new_post->text = $faker->text(1000);\n $new_post->save();\n }\n }", "public function run()\n {\n $posts = factory(App\\Post::class, 10)->create()->each(function ($post) {\n $post->categories()->attach(App\\Category::all()->random()->id);\n $post->tags()->attach(App\\Tag::all()->random()->id);\n });\n }", "function aecom_soft_rand_shuffle( $posts, $query ) {\n if ( aecom_should_randomize_query( $query ) ) {\n // save original order - mainly for use in project archive's ?qp=...\n // (for paging thru individual projects)\n $i = ( ( $query->is_paged() ? $query->get( 'paged' ) : 1 ) - 1 ) * $query->get( 'posts_per_page' );\n foreach( $posts as &$post ) {\n $post->original_query_order = $i + 1;\n $i += 1;\n }\n // randomize order - or special semi-rand order for projects\n if ( $query->get( 'post_type' ) === 'project' ) {\n usort( $posts, 'aecom_sort_projects' );\n } else {\n shuffle( $posts );\n }\n }\n return $posts;\n}", "public function testGetAllPosts() : void {\n $expected = 0;\n $this->assertEquals($expected, count($this->dataManager->getAllPosts(PostType::Page)));\n }", "public function run()\n {\n $categories = \\App\\Models\\Category::factory()->count(10)->create();\n\n $tags = \\App\\Models\\Tag::factory()->count(100)->create();\n\n $posts = Post::factory()->count(10)->make(['category_id' => null]);\n\n $posts->each(function (Post $post) use ($categories) {\n $post->category()->associate($categories->random());\n $post->save();\n });\n\n $posts->each(function (Post $post) use ($tags) {\n $post->tags()->attach($tags->random(rand(3, 5))->pluck('id'));\n });\n }", "public function run()\n {\n $array_categories = Category::get()->pluck('id')->toArray();\n // dd($arrayIdOfCategories);\n $array_posts = Post::get()->pluck('id')->toArray();\n // dd($array_categories[array_rand($array_categories)]);\n for ($i = 0; $i < 4; $i++) {\n $random_category_id = $array_categories[array_rand($array_categories)];\n $random_post_id = $array_posts[array_rand($array_posts)];\n\n $category_post_exists = DB::table('category_post')\n ->where('category_id', $random_category_id)\n ->where('post_id', $random_post_id)\n ->exists();\n // dd($category_post_exists);\n if ($category_post_exists == false) {\n // dd('aa');\n DB::table('category_post')->insert(\n [\n 'category_id' => $random_category_id,\n 'post_id' => $random_post_id\n ]\n );\n }\n }\n }", "public static function seed() {\r\n $posts = [];\r\n\r\n // post data objects pushing to the end of the $posts array\r\n $posts[] = new Post(\r\n 'mikey1983',\r\n '25/12/2017',\r\n '3:57pm',\r\n 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minus molestias quas dolorem, quos illo fuga. Voluptates minima tempora illo, distinctio!',\r\n '../images/guitar.jpg'\r\n );\r\n\r\n $posts[] = new Post(\r\n 'sue_zipy',\r\n '5/01/2018',\r\n '8:13am',\r\n 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tenetur nemo delectus dicta!',\r\n '../images/barbie.jpg'\r\n );\r\n\r\n $posts[] = new Post(\r\n 'joXyz',\r\n '26/02/2018',\r\n '11:30pm',\r\n 'Ipsam neque aspernatur consectetur, voluptate consequatur maiores ullam porro, dolores rerum veniam beatae minus itaque autem temporibus repellendus at sit. Quidem assumenda ipsa aspernatur, et odio placeat maxime officia, dignissimos consequatur, consectetur, minima ut vel illum omnis eligendi atque recusandae.',\r\n '../images/spiderman.jpg'\r\n );\r\n\r\n return $posts;\r\n }", "public function run()\n {\n $faker = Faker::create();\n foreach (range(1, 100) as $index) {\n Post::create([\n 'user_id' => 1,\n 'title' => $faker->sentence(4),\n 'body' => $faker->paragraph(4),\n ]);\n }\n }", "public function testOnePost()\n {\n $response = $this->client->request('GET', '/post/0');\n $this->assertEquals(200, $response->getStatusCode());\n\n $body = $response->getBody();\n $content = $body->getContents();\n\n /*\n * Match post title.\n */\n $this->assertRegExp('/<h2>[\\n a-zA-Z]+<span>/', $content);\n\n /*\n * Match post ID.\n */\n $re = \"/(<span>[\\n <]+ID:)(.)([ ]+<\\/span>)/\";\n $matches = [];\n\n preg_match_all($re, $content, $matches);\n\n $this->assertEquals(4, count($matches));\n $this->assertEquals(0, $matches[2][0]);\n\n /*\n * Match post content.\n */\n $this->assertRegExp('/<p>[\\na-zA-Z ,.]+<\\/p>/', $content);\n }", "public function run()\n {\n factory(Post::class, 100)\n ->create()\n ->each(function(Post $post) {\n $post->comments()->saveMany(\n factory(\\App\\Comment::class, rand(0, 10))->make()\n );\n });\n\n// for ($i = 0; $i < 10; $i++) {\n// $post = new Post;\n// $post->name = 'Title no. ' . ($i + 1);\n// $post->content = 'Post content ' . Str::random(100);\n// $post->save();\n// }\n }", "public function run()\n {\n Post::create([\n 'title' => $faker->title,\n 'slug' => Str::slug($faker->sentence()),\n 'body' => $faker->body\n ]);\n\n }", "public function randomQuestion(): void\n {\n $expectedQuestion = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $randomQuestions = $this->user->randomUserQuestion();\n\n $this->assertTrue($randomQuestions->contains($expectedQuestion));\n }", "public function run()\n {\n for ($i = 1; $i < 20; $i++) {\n Post::create([\n 'user_id' => rand(1,19),\n 'title' => \"Post title {$i}\",\n 'content' => Str::random(50),\n 'is_active' => rand(0,1)\n ]);\n }\n }", "public function run()\n {\n //\n $faker=Faker::create();\n $posts=Post::all();\n\n foreach($posts as $post){\n Comment::create(['user_id'=>rand(1,10),'post_id'=>$post->id,'text'=>$faker->text]);\n Comment::create(['user_id'=>rand(1,10),'post_id'=>$post->id,'text'=>$faker->text]);\n }\n }", "public function run()\n {\n factory(Post::class,50) -> make() -> each(function($post){\n $employee = Employee::inRandomOrder() -> first();\n $post -> employee()->associate($employee);\n $post ->save();\n\n\n });\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n factory(\\App\\Post::class, 50)->create()->each(function(\\App\\Post $post) use ($faker) {\n $post->image_url = url('images/' . $this->images[$faker->numberBetween(0, 8)]);\n $post->user_id = $faker->numberBetween(1, \\App\\User::count());\n $post->available = $faker->numberBetween(0, 1);\n $post->save();\n });\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Post::create([\n 'title' => $faker->name,\n 'description' => $faker->text($maxNbChars = 50),\n 'content' => $faker->text($maxNbChars = 100),\n 'category_id' => Category::all()->random()->id, //lay ngau nhien gia trị ơ khóa ngoại id của table categories\n ]);\n }\n }", "public function generatePosts()\n {\n if (request('quantityOfPosts') > 50) {\n return 'Du kannst maximal 50 Posts generieren lassen';\n }\n Post::factory()->count(request('quantityOfPosts'))->create();\n return redirect()->back();\n }", "public function run()\n {\n factory(App\\Post::class, 50)\n ->create()\n ->each(function ($post) {\n $post->comments()->saveMany(\n factory(App\\Comment::class, mt_rand(1, 10))->make()\n );\n });\n }", "function get_random_quote($content = null) {\r\n\t//remove_all_filters('posts_orderby');\r\n\t$args = array( 'post_type' => 'quote', 'posts_per_page' => 1, 'post_status' => 'publish', 'orderby' => 'rand' );\r\n\r\n\t$quote_posts = new WP_Query( $args );\r\n\tob_start();\r\n\tif($quote_posts->have_posts()) {\r\n\t\tglobal $post;\r\n\t\t//$posts_list = array();\r\n\t\twhile($quote_posts->have_posts()): $quote_posts->the_post();\r\n\t\t\t//$posts_list[] = $post->ID;\r\n\t\t\t?>\r\n\t\t\t<div class=\"quote_of_the_day\">\r\n\t\t\t\t<p><?php echo get_the_excerpt(); ?></p>\r\n\t\t\t\t<a href=\"<?php echo get_permalink(); ?>\" class=\"more_link\">Read More</a>\r\n\t\t\t</div>\r\n\t\t\t<?php\r\n\r\n\t\tendwhile;\r\n\t\twp_reset_postdata();\r\n\t}\r\n\r\n\r\n\t$content = ob_get_clean();\r\n\treturn $content;\r\n}", "public function run() {\n // создать связи между постами и тегами\n foreach(Post::all() as $post) {\n foreach(Tag::all() as $tag) {\n if (rand(1, 20) == 10) {\n $post->tags()->attach($tag->id);\n }\n }\n }\n }", "public function run()\n {\n News::factory()->count(50)->create()->each(\n function (News $news){\n $news->tags()->sync(Tag::inRandomOrder()->limit(rand(1,5))->get());\n }\n );\n \n }", "public function run()\r\n {\r\n $faker = Factory::create();\r\n $comments = [];\r\n\r\n $posts = Post::limit(5)->get();\r\n foreach ($posts as $post) {\r\n for ($i = 0; $i <= rand(1, 10); $i++) {\r\n $commentDate = $post->created_at->modify(\"+{$i} hour\");\r\n $comments[] = [\r\n 'fullname' => $faker->name,\r\n 'email' => $faker->email,\r\n 'comment' => $faker->paragraphs(rand(1, 5), true),\r\n 'post_id' => $post->id,\r\n 'created_at' => $commentDate,\r\n 'updated_at' => $commentDate,\r\n ];\r\n\r\n\r\n }\r\n }\r\n comment::truncate();\r\n comment::insert($comments);\r\n\r\n\r\n }", "public function run()\n {\n factory(\\App\\User::class, 5)->create()->each(function($user) {\n /** @var \\App\\User $user */\n $nbPost = random_int(2,5);\n for($i = 0; $i <= $nbPost; $i++) {\n /** @var \\App\\Post $post */\n\n $post = factory(\\App\\Post::class)->make();\n $post->author_id = $user->id;\n $post->save();\n }\n });\n }", "public function getOneRandomPost()\n\t{\n\t\t$result = array(\n\t\t\t'jd_vars' => $this->jd_vars,\n\t\t\t'post' => $this->JDBlogPost->getRandomPosts(1)[0],\n\t\t\t'cache' => true,\n\t\t);\n\n\t\treturn $result;\n\t}", "public function run()\n {\n $faker = Faker\\Factory::create();\n\n for($i = 1; $i <= 1000; $i++){\n Post::create([\n 'title' => $faker->text,\n 'description' => $faker->text,\n 'image' => $faker->imageUrl\n ]);\n\n PostLocation::create([\n 'post_id' => $i,\n 'longitude' => $faker->longitude,\n 'latitude' => $faker->latitude,\n 'name' => $faker->text\n ]);\n }\n }", "public function run()\n {\n $allUsers = User::all();\n if ($allUsers->isEmpty()) {\n User::factory()->count(5)->create();\n $allUsers = User::all();\n }\n\n $allTags = Tag::all();\n if ($allTags->isEmpty()) {\n Tag::factory()->count(30)->create();\n $allTags = Tag::all();\n }\n\n\n Post::factory()\n ->count(10)\n ->hasImage()\n ->afterCreating(function (Post $post) use ($allTags, $allUsers) {\n $myTags = $allTags->random(rand(0, 5))->pluck('id');\n $post->tags()->sync($myTags);\n $post->user()->associate($allUsers->random(1)->first());\n $post->user()->associate(User::find(1));\n $post->save();\n })\n ->create();\n }", "public function run()\n {\n $users = \\App\\Models\\User::all();\n $posts = \\App\\Models\\Post::all();\n\n foreach ($posts as $post)\n {\n $likes = $users->random(10)\n ->filter(\n function ($id) use ($post)\n {\n return $id != $post;\n });\n $post->likes()->sync($likes);\n }\n }", "public function run(Faker $faker)\n { \n $posts= Post::all();\n foreach($posts as $post) {\n for ($i = 0; $i < 10; $i++) {\n\n $newComment = new Comment();\n $newComment->name = $faker->name;\n $newComment->email = $faker->email;\n $newComment->title = $faker->sentence(3);\n $newComment->body = $faker->text(150);\n $newComment->post_id = $post->id;\n $newComment->save(); \n }\n\n \n }\n }", "public function run()\n {\n $faker=Faker::create();\n for($i=0;$i<20;$i++)\n {\n DB::table('posts')->insert([\n 'title'=>$faker->text($maxNbchars=50),\n 'text'=>$faker->text,\n 'price'=>$faker->randomNumber(4),\n 'user_id'=>rand(1,5),\n 'category_id'=>rand(1,5),\n 'country_id'=>rand(1,6),\n\n ]);\n\n }\n }", "public function run()\n {\n DB::table('post_tag')->truncate();\n\n $post_ids = range(1, 30);\n $tag_ids = range(1, 10);\n\n foreach($post_ids as $post_id)\n {\n $i = rand(1, 3);\n $keys = array_rand($tag_ids, $i);\n $keys = is_array($keys) ? $keys : [$keys];\n foreach($keys as $j)\n {\n DB::table('post_tag')->insert([\n 'post_id' => $post_id,\n 'tag_id' => $tag_ids[$j]\n ]);\n }\n }\n }", "static function add_shuffle_all_posts(): void {\r\n self::add_acf_field(self::shuffle_all_posts, [\r\n 'label' => 'Shuffle the order of all individual posts across all slides?',\r\n 'default_value' => 0,\r\n 'message' => '',\r\n 'ui' => 1,\r\n 'type' => 'true_false',\r\n 'instructions' => '',\r\n 'required' => 0,\r\n 'conditional_logic' => 0,\r\n 'wrapper' => [\r\n 'width' => '100',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n ]);\r\n }", "public function run()\n {\n $postsCount = (int)$this->command->ask('How many posts would you like?', 10);\n\n $users = User::all();\n\n factory(Post::class, $postsCount)->make()->each(function($post) use ($users) {\n $post->author_id = $users->random()->id;\n $post->save();\n });\n }", "function get_random_featured_items($num = 5, $hasImage = null)\n{\n return get_records('Item', array('featured' => 1,\n 'sort_field' => 'random',\n 'hasImage' => $hasImage), $num);\n}", "public function run()\n {\n \tfor ($i=0; $i < 10 ; $i++) { \n \t\tArticles::create([\n \t\t\t\"title\"=> Str::random(10).$i,\n \t\t\t\"content\"=> $i . Str::random(10)\n \t\t]);\n \t}\n }", "function test_sample()\n\t{\n\t\t// $post_id = $this->factory->post->create();\n\t\t// add_post_meta($post_id, 'unit_code', '1996-96482');\n\t\t//\n\t\t// $unit = Client::get('units/1996-96482');\n\t\t// var_dump($unit);\n\t\t//\n // $post = new VacationRental($post, $unit);\n\t\t//\n\t\t// // Replace this with some actual testing code.\n\t\t// $this->assertTrue( true );\n\t}", "public function run()\n {\n\n\t $faker = Faker::create();\n\t foreach (range(1,10) as $index) {\n\t\t DB::table('posts')->insert([\n\t\t\t 'post_title' => $faker->realText($maxNbChars = 50, $indexSize = 2),\n\t\t\t 'post_content' => $faker->realText($maxNbChars = 1000, $indexSize = 2),\n\t\t\t 'created_at' => $faker->dateTimeBetween($startDate = '-5 years', $endDate = 'now')\n\t\t ]);\n\t }\n\n }", "public function run()\n {\n Post::truncate();\n factory(Post::class, 10)->create(); //create random posts\n\n //attach Tags to posts\n $posts = Post::all();\n foreach ($posts as $post) {\n $tags = Tag::where('id', '>', rand(0, 6))->take(rand(0,3))->get();\n $post->tags()->saveMany($tags);\n }\n }", "public function run()\n {\n //\n Post::all()->each(function (Post $post){\n $reviews = factory(Review::class, random_int(2, 10))->make();\n\n $post->reviews()->saveMany($reviews);\n });\n\n }", "public function run()\n {\n factory(\\App\\News::class, rand(25, 55))->create()->each(function (\\App\\News $post) {\n $tagsIds = \\App\\Tag::takeRandom(rand(2, 5))->get('id');\n $post->tags()->sync($tagsIds);\n $post->comments()->saveMany(factory(\\App\\Comment::class, rand(3, 7))->make());\n });\n }", "public function run()\n {\n $faker =Faker::create();\n for ($i=0; $i < 30 ; $i++) {\n $new_post = new Post();\n\n // parte del faker commentata.\n\n // $new_post->title = $faker->sentence();\n // $new_post->content = $faker->text(2000);\n // $new_post->author = $faker->firstName . ' ' . $faker->lastName;\n // $new_post->slug = Str::slug($new_post->title);\n\n $titulo = $faker->sentence();\n // fill richiede array di dati:\n $dati_post =[\n 'title'=> $titulo,\n 'content'=> $faker->text(2000),\n 'author'=> $faker->firstName . ' ' . $faker->lastName,\n 'slug'=> Str::slug($titulo)\n ];\n $new_post->fill($dati_post);\n $new_post->save();\n // PER FAR PARTIRE IL SEED FACCIO DA PROMPT : PHP ARTISAN DB:SEED\n }\n }", "public function run()\n {\n $faker = Faker::create();\n for($i = 0; $i<40; $i++){\n Question::create([\n 'title' =>$faker->name,\n 'desc' => $faker->text,\n 'img' => $faker->name,\n 'visited' => rand(1, 10000),\n 'created' => \\Carbon\\Carbon::now(),\n 'status' => 'open',\n 'cat_id' => rand(1, 5),\n 'user_id' => rand(11, 20)\n ]);\n }\n }", "public function run()\n {\n //\n DB::table('tbl_posts')->insert([\n 'post_content'=>'test content',\n 'post_image'=>rand().'.jpg'\n ]);\n }", "public function run()\n {\n\n $faker = Faker\\Factory::create();\n\n for($i = 0; $i < 50; $i++){\n $newPost = new Post();\n\n $newPost->title = $faker->sentence;\n $newPost->author = $faker->name;\n $newPost->category_id = $faker->numberBetween(1, 10);\n\n $newPost->save();\n\n $postId = $newPost->id;\n\n $newPostInformation = new PostInformation();\n\n $newPostInformation->description = $faker->paragraph;\n $newPostInformation->slug = Str::slug($newPost->title, '-');\n $newPostInformation->post_id = $postId;\n\n $newPostInformation->save();\n\n }\n }", "public function run()\n {\n \\App\\Models\\Tag::factory(30)->create();\n\n $tags = \\App\\Models\\Tag::all();\n\n \\App\\Models\\Post::all()->each(function ($post) use ($tags) {\n $post->tags()->sync(\n $tags->random(rand(1, 6))->pluck('id')->toArray()\n );\n });\n }", "public function test_a_guest_can_see_post()\n {\n $post = factory(Post::class)->create();\n $response = $this->get('/blog');\n $response->assertSee($post->title);\n }", "public function run()\n {\n User::factory(10)->create();\n User::factory(15)->hasPosts(4)->create();\n Comment::factory(80)->create();\n Tag::factory(25)->create();\n\n $categoryCount = Tag::count();\n $postCount = Post::count();\n for($i = 0 ; $i < 150 ; $i++){\n DB::table('tags_posts')->insertOrIgnore(\n ['tag_id' => rand(1, $categoryCount), \n 'post_id' => rand(1, $postCount)]\n );\n }\n PremiumAccount::factory(5)->create();\n for($i = 1 ; $i < 6 ; $i++){\n DB::table('users')->where('id', $i)->update(['premium_id' => $i]);\n }\n for($i = 0 ; $i < 20 ; $i++){\n DB::table('posts')->where('id', rand(1, Post::count()))->update(['premium' => true]);\n }\n }", "public function run()\n {\n $faker = Faker::create('App\\Post');\n\n for($i=0; $i<=22; $i++) {\n DB::table('posts')->insert([\n 'title' => $faker->text(30),\n 'body' => implode($faker->paragraphs(rand(18,28))),\n 'slug' => $faker->slug,\n 'created_at' => \\Carbon\\Carbon::now(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n ]);\n }\n\n }", "public function testSeeAllPostsTest()\n {\n $response = $this->get('/posts');\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n $response->assertSeeText('Next');\n }", "public function run()\n {\n $faker = Faker\\Factory::create('pt_br');\n\t\t\n\t\tfor($i = 0; $i < SEEDERS_POST_EDITS; $i++) {\n\n\t\t\t$post = Post::find(rand(1, SEEDERS_POSTS));\n\n $postEdit = PostEdit::create([ \n 'text' => $faker->paragraph(5), \n 'user_id' => $post->author->id, \n 'post_id' => $post->id \n ]);\n\n\t\t\t$data = new DateTime($post->created_at); \n\t\t\t$data->add(new DateInterval('PT'.rand(5,30).'H')); \n\n\t\t\t$postEdit->date = $data->format('Y-m-d H:i:s');\n\n\t\t\t$postEdit->save();\n }\n\n\n }", "public function testGetSinglePost() {\n $i = new Instagram();\n $result = $i->getPost('B9qmWk7BDzI');\n $this->assertNotEmpty($result->images);\n $this->assertEquals('2263790439947844808', $result->postId);\n $this->assertEquals([], $i->getErrors());\n }", "public function get_footer_random_posts($limit)\r\n {\r\n $this->set_filter_query();\r\n $this->db->order_by('rand()');\r\n $this->db->limit($limit);\r\n $query = $this->db->get('posts');\r\n return $query->result();\r\n }", "public function run()\n {\n $this->table('post')->truncate();\n\n $faker = Faker\\Factory::create();\n $data = [];\n for ($i = 0; $i < 20; $i++) {\n $data[] = [\n 'title' => $faker->realText(25),\n 'content' => $faker->text(500),\n 'image' => $faker->imageUrl(),\n 'short_content' => $faker->text(150),\n 'created_at' => date('Y-m-d ') . rand(0, 23) . ':' . rand(0, 59) . ':' . rand(0,59)\n ];\n }\n\n $this->insert('post', $data);\n }", "public function run()\n {\n $array_categories = Categorie::get()->pluck('id')->toArray();\n \n $array_posts = Post::get()->pluck('id')->toArray();\n // dd($array_categories[array_rand($array_categories)]);\n for ($i = 0; $i < 5; $i++) {\n DB::table('categorie_post')->insert(\n [\n 'category_id' => $array_categories[array_rand($array_categories)],\n 'post_id' => $array_posts[array_rand($array_posts)]\n ]\n );\n }\n }" ]
[ "0.75761914", "0.6967798", "0.6700877", "0.66783607", "0.6643939", "0.66387373", "0.6596647", "0.6590039", "0.6573584", "0.65329933", "0.6512199", "0.64968675", "0.6485306", "0.6483764", "0.6442064", "0.6433763", "0.64238304", "0.64238137", "0.6383252", "0.6377551", "0.6371587", "0.6303604", "0.6301874", "0.62786293", "0.6272196", "0.62699383", "0.6267735", "0.6240343", "0.62373155", "0.6219168", "0.62176037", "0.6204235", "0.61864245", "0.6185939", "0.6181693", "0.6179221", "0.6179197", "0.617478", "0.6173889", "0.6173684", "0.61701906", "0.61486477", "0.61459404", "0.6141803", "0.61414564", "0.6138196", "0.6129561", "0.6103948", "0.6099918", "0.6099626", "0.6095844", "0.6095821", "0.6085593", "0.607213", "0.6071791", "0.60674995", "0.6064252", "0.6059034", "0.60499614", "0.6042253", "0.603571", "0.6029704", "0.6029562", "0.6029004", "0.602535", "0.6019299", "0.60093266", "0.60000044", "0.599421", "0.59934753", "0.59906244", "0.59719944", "0.5971894", "0.5963385", "0.5960532", "0.59568363", "0.59441084", "0.59432846", "0.5942002", "0.59380263", "0.5937415", "0.59347725", "0.5931936", "0.5931308", "0.5915692", "0.5890702", "0.58904696", "0.5889256", "0.5887997", "0.5887955", "0.58866173", "0.5865279", "0.5852331", "0.58485216", "0.5845059", "0.58406395", "0.5832396", "0.5823495", "0.58189535", "0.58129025" ]
0.8225586
0
Tests that random posts won't contain unpublished posts
public function testRandomPostsUnpublished() { // create posts, some of them unpublished (note that there is seeded post with id=1) $posts = []; $posts[0] = $this->createPost(0, TRUE); $posts[1] = $this->createPost(1, FALSE); $posts[2] = $this->createPost(2, TRUE); $posts[3] = $this->createPost(3, FALSE); // get random posts of same quantity $random_posts = $this->createRandomPostsComponent(); $generated_posts = $random_posts->posts(); // ensure there are no unpublished posts in the array $ids = $generated_posts->pluck('id'); self::assertTrue(in_array($posts[0]->id, $ids->all()), 'Published post is in generated array'); self::assertFalse(in_array($posts[1]->id, $ids->all()), 'Unpublished post is not in generated array'); self::assertFalse(in_array($posts[3]->id, $ids->all()), 'Unpublished post is not in generated array'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testRandomPosts() {\n // remove all existing posts\n $all = Post::all();\n foreach ($all as $post) {\n $post->delete();\n }\n\n // create some Posts\n $posts = [];\n $posts[0] = $this->createPost(0, TRUE);\n $posts[1] = $this->createPost(1, TRUE);\n $posts[2] = $this->createPost(2, TRUE);\n $posts[3] = $this->createPost(3, TRUE);\n $posts[4] = $this->createPost(4, TRUE);\n $posts[5] = $this->createPost(5, TRUE);\n $posts[6] = $this->createPost(6, TRUE);\n\n $random_posts = $this->createRandomPostsComponent();\n $generated_posts = $random_posts->posts();\n\n // amount of posts should be equal to default value\n self::assertEquals(5, count($generated_posts));\n\n // ensure all Posts are from posts created\n $found_all = TRUE;\n foreach ($generated_posts as $generated_post) {\n $found = FALSE;\n foreach ($posts as $post) {\n if ($post->id == $generated_post->id) {\n $found = TRUE;\n break;\n }\n }\n if (!$found) {\n $found_all = FALSE;\n break;\n }\n }\n self::assertTrue($found_all, 'All posts exist in original array');\n\n // check for non-repeating\n $ids = [];\n foreach ($generated_posts as $post) {\n self::assertArrayNotHasKey($post->id, $ids, 'Post is not already present in the generated array');\n $ids[$post->id] = $post->id;\n }\n }", "function get_random_posts( $category_id, $post_count ) {\n\n $posts = get_posts( array(\n 'posts_per_page' => $post_count,\n 'orderby' => 'rand',\n 'cat' => $category_id,\n 'post_status' => 'publish',\n ) );\n\n return $posts;\n}", "function vip_get_random_posts( $number = 1, $post_type = 'post', $return_ids = false ) {\n\t$query = new WP_Query( array( 'posts_per_page' => 100, 'fields' => 'ids', 'post_type' => $post_type ) );\n\n\t$post_ids = $query->posts;\n\tshuffle( $post_ids );\n\t$post_ids = array_splice( $post_ids, 0, $number );\n\n\tif ( $return_ids )\n\t\treturn $post_ids;\n\n\t$random_posts = get_posts( array( 'post__in' => $post_ids, 'numberposts' => count( $post_ids ), 'post_type' => $post_type ) );\n\n\treturn $random_posts;\n}", "function aecom_soft_rand_shuffle( $posts, $query ) {\n if ( aecom_should_randomize_query( $query ) ) {\n // save original order - mainly for use in project archive's ?qp=...\n // (for paging thru individual projects)\n $i = ( ( $query->is_paged() ? $query->get( 'paged' ) : 1 ) - 1 ) * $query->get( 'posts_per_page' );\n foreach( $posts as &$post ) {\n $post->original_query_order = $i + 1;\n $i += 1;\n }\n // randomize order - or special semi-rand order for projects\n if ( $query->get( 'post_type' ) === 'project' ) {\n usort( $posts, 'aecom_sort_projects' );\n } else {\n shuffle( $posts );\n }\n }\n return $posts;\n}", "public function testGetAllPosts() : void {\n $expected = 0;\n $this->assertEquals($expected, count($this->dataManager->getAllPosts(PostType::Page)));\n }", "function getLatestPosts($count = 5)\n{\n $posts = [];\n $postTypes = [\"urgent\", \"warning\", \"normal\"];\n\n for($i=1; $i<=$count; $i++) {\n do {\n $id = rand(1, 1000);\n } while (array_key_exists($id, $posts));\n\n $type = $postTypes[rand(0, count($postTypes)-1)];\n\n $posts[$id] = [\n \"title\" => \"Başlık \" . $i,\n \"type\" => $type\n ];\n }\n\n return $posts;\n}", "public function randomQuestionWithEmptyBag(): void\n {\n $expectedQuestion1 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $expectedQuestion2 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n\n $questionsList = $this->user->randomUserQuestion('soft', []);\n\n $this->assertTrue($questionsList->contains($expectedQuestion1));\n $this->assertTrue($questionsList->contains($expectedQuestion2));\n }", "public function testEmptyBlogPostListWhenNoBlogPostInDatabase()\n {\n $response = $this->get('/posts');\n\n $response->assertSeeText('the list is empty');\n }", "public function products_could_be_queried_with_published_status()\n {\n $publishedProductQty = random_int(1, 10);\n factory(Product::class, $publishedProductQty)\n ->states('published')\n ->create();\n\n $unpublishedProductQty = random_int(1, 10);\n factory(Product::class, $unpublishedProductQty)\n ->states('unpublished')\n ->create();\n\n //status\n //act + assert\n $queryResult = $this->productFilter->getList(['published' => true]);\n $this->assertCount($publishedProductQty, $queryResult);\n\n //act + assert\n $queryResult = $this->productFilter->getList(['published' => false]);\n $this->assertCount($unpublishedProductQty, $queryResult);\n }", "public function randomQuestionWithNonEmptyBag(): void\n {\n $expectedQuestion1 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $expectedQuestion2 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $unexpectedQuestion = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n\n $questionsList = $this->user->randomUserQuestion('soft', [$unexpectedQuestion->id]);\n\n $this->assertTrue($questionsList->contains($expectedQuestion1));\n $this->assertTrue($questionsList->contains($expectedQuestion2));\n\n $this->assertFalse($questionsList->contains($unexpectedQuestion));\n }", "function test_has_published_pages_when_nav_menus_created_posts() {\n\t\tforeach ( get_pages() as $page ) {\n\t\t\twp_delete_post( $page->ID, true );\n\t\t}\n\t\t$this->assertFalse( $this->manager->has_published_pages() );\n\n\t\twp_set_current_user( $this->factory()->user->create( array( 'role' => 'editor' ) ) );\n\t\t$this->manager->nav_menus->customize_register();\n\t\t$setting_id = 'nav_menus_created_posts';\n\t\t$setting = $this->manager->get_setting( $setting_id );\n\t\t$this->assertInstanceOf( 'WP_Customize_Filter_Setting', $setting );\n\t\t$auto_draft_page = $this->factory()->post->create( array( 'post_type' => 'page', 'post_status' => 'auto-draft' ) );\n\t\t$this->manager->set_post_value( $setting_id, array( $auto_draft_page ) );\n\t\t$setting->preview();\n\t\t$this->assertTrue( $this->manager->has_published_pages() );\n\t}", "function wp_bottom_featured_bar_post() {\n global $post;\n // show only if the post type is a blog post\n if($post && $post->post_type != \"post\")\n return null;\n\n // load categories \n $categories = wp_get_post_categories($post->ID);\n $args = array( 'posts_per_page' => 5, 'orderby' => 'rand', 'exclude' => $post->ID ); \n\n if ( $count = count($categories) > 0 ) {\n if ( $count == 1 && $categories[0] == 1) {\n // ignore the filter.\n } else {\n $args['category'] = implode($categories, \",\");\n }\n }\n\n $rand_posts = get_posts( $args );\n\n return $rand_posts[0];\n}", "public function randomQuestionWithNoUser(): void\n {\n QuestionUserHelper::removeAllQuestionsForUser($this->user);\n QuestionHelper::newQuestion();\n\n $questionsList = User::randomQuestions();\n\n $this->assertFalse($this->user->questions()->get()->contains($questionsList));\n }", "function aecom_should_randomize_query( $query ) {\n if ( ! aecom_should_filter_query( $query ) ) return false;\n if ( ! $post_type = $query->get( 'post_type' ) ) return false;\n\n if ( in_array( $post_type, array( 'person', 'project' ) ) ) return true;\n\n return false;\n}", "function sp_random_posts($numberOfPosts = 5 , $thumb = true){\n\tglobal $post;\n\t$orig_post = $post;\n\n\t$lastPosts = get_posts('orderby=rand&numberposts='.$numberOfPosts);\n\tforeach($lastPosts as $post): setup_postdata($post);\n?>\n<li>\n\t<?php if ( $thumb && sp_post_image('sp-small') ) : ?>\t\t\t\n\t\t<div class=\"post-thumbnail\">\n\t\t\t<a href=\"<?php the_permalink(); ?>\" title=\"<?php printf( __( 'Permalink to %s', 'sptheme' ), the_title_attribute( 'echo=0' ) ); ?>\" rel=\"bookmark\">\n\t\t\t<img src=\"<?php echo sp_post_image('sp-small') ?>\" width=\"110\" height=\"83\" />\n </a>\n\t\t</div><!-- post-thumbnail /-->\n\t<?php endif; ?>\n\t<h3><a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?></a></h3>\n\t<?php //sp_get_score(); ?> <div class=\"entry-meta\"><?php echo sp_posted_on(); ?></div>\n</li>\n<?php endforeach;\n\t$post = $orig_post;\n}", "public function dailyQuestionDoesNotReturnMemorizedQuestions(): void\n {\n $unwantedMemorizedQuestion = QuestionUserHelper::createMemorizedQuestionsForUser($this->user);\n $dailyQuestions = $this->user->dailyQuestions()->get();\n\n $this->assertFalse($dailyQuestions->contains($unwantedMemorizedQuestion));\n }", "function random_featured_items($count = 5, $hasImage = null)\n{\n $items = get_random_featured_items($count, $hasImage);\n if ($items) {\n $html = '';\n foreach ($items as $item) {\n $html .= get_view()->partial('items/single.php', array('item' => $item));\n release_object($item);\n }\n } else {\n $html = '<p>' . __('No featured items are available.') . '</p>';\n }\n return $html;\n}", "function random_post() {\n\t$randomComicQuery = new WP_Query(); $randomComicQuery->query('showposts=1&orderby=rand&cat=-'.exclude_comic_categories());\n\twhile ($randomComicQuery->have_posts()) : $randomComicQuery->the_post();\n\t\t$random_comic_id = get_the_ID();\n\tendwhile;\n\twp_redirect( get_permalink( $random_comic_id ) );\n\texit;\n}", "public function testIsUnPublishScheduled()\n {\n $page = SiteTree::create();\n $page->Title = 'My page';\n $page->PublishOnDate = '2010-01-01 00:00:00';\n $page->AllowEmbargoedEditing = false;\n $page->write();\n\n $this->assertFalse($page->getIsUnPublishScheduled());\n\n $page->UnPublishOnDate = '2016-02-01 00:00:00';\n DBDatetime::set_mock_now('2016-01-16 00:00:00');\n $this->assertTrue($page->getIsUnPublishScheduled());\n\n DBDatetime::set_mock_now('2016-02-16 00:00:00');\n $this->assertFalse($page->getIsUnPublishScheduled());\n }", "function getPublishedPostsOnly() {\n\tglobal $conn;\n\t$sql = \"SELECT * FROM posts WHERE published=true order by created_at DESC LIMIT 3\";\n\t$result = mysqli_query($conn, $sql);\n\n\t// fetch all posts as an associative array called $posts\n\t$posts = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\t$final_posts = array();\n\tforeach ($posts as $post) {\n\t\t$post['topic'] = getPostTopic($post['id']); \n\t\tarray_push($final_posts, $post);\n\t}\n\treturn $final_posts;\n}", "public function randomQuestion(): void\n {\n $expectedQuestion = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $randomQuestions = $this->user->randomUserQuestion();\n\n $this->assertTrue($randomQuestions->contains($expectedQuestion));\n }", "static function add_shuffle_all_posts(): void {\r\n self::add_acf_field(self::shuffle_all_posts, [\r\n 'label' => 'Shuffle the order of all individual posts across all slides?',\r\n 'default_value' => 0,\r\n 'message' => '',\r\n 'ui' => 1,\r\n 'type' => 'true_false',\r\n 'instructions' => '',\r\n 'required' => 0,\r\n 'conditional_logic' => 0,\r\n 'wrapper' => [\r\n 'width' => '100',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n ]);\r\n }", "public function randomQuestionWithSelfsameBag(): void\n {\n $unexpectedQuestion1 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $unexpectedQuestion2 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n\n $questionsList = $this->user->randomUserQuestion('soft', [$unexpectedQuestion1->id, $unexpectedQuestion2->id]);\n\n $this->assertFalse($questionsList->contains($questionsList));\n $this->assertEmpty($questionsList);\n }", "function block_core_calendar_has_published_posts()\n {\n }", "static function add_shuffle_posts(): void {\r\n self::add_acf_field(self::shuffle_posts, [\r\n 'label' => 'Shuffle the order of small posts within slides?',\r\n 'default_value' => 0,\r\n 'message' => '',\r\n 'ui' => 1,\r\n 'type' => 'true_false',\r\n 'instructions' => '',\r\n 'required' => 0,\r\n 'conditional_logic' => [\r\n [\r\n [\r\n 'field' => self::qualify_field(self::shuffle_all_posts),\r\n 'operator' => '!=',\r\n 'value' => '1',\r\n ],\r\n ],\r\n ],\r\n 'wrapper' => [\r\n 'width' => '25',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n ]);\r\n }", "function remove_unpublished_posts($post_ID_query){\n\tglobal $wpdb;\n\t$date_object = count($post_ID_query);\n\t\n\t//build query to find is posts within the results are not published\n\t$post_query .= \"SELECT ID FROM $wpdb->posts WHERE post_status != 'publish' AND (\";\n\tfor($i=0; $i<$date_object;$i++){\n\t\t$current_object = $post_ID_query[$i];\n\t\t$post_query .= \"ID='$current_object->post_id'\";\n\t\tif ($i<($date_object-1)){//add or at the end of each query, expect the last one\n\t\t\t$post_query .= \" OR \";\n\t\t} else{\n\t\t\t$post_query .= \");\";\n\t\t}\n\t}\n\t$trashed_post_id = $wpdb->get_results($post_query);\n\t//make array of id's of trashed posts\n\t$trashed_post_id = get_just_post_ids($trashed_post_id);\n\t//cycle though results or date query, unsetting trashed id's\n\tif (is_array($trashed_post_id)){//check to see $trashed_post_id has results\n\t\tforeach($post_ID_query as $key=>$post){\n\t\t\t//is post id in trashed list?\n\t\t\n\t\t\tif(in_array($post->post_id,$trashed_post_id)){\n\t\t\t\tunset($post_ID_query[$key]);\n\t\t\t}\n\t\t}\n\t} \n\treturn $post_ID_query;\n}", "function block_core_calendar_update_has_published_posts() {\n\tglobal $wpdb;\n\t$has_published_posts = (bool) $wpdb->get_var( \"SELECT 1 as test FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1\" );\n\tupdate_option( 'wp_calendar_block_has_published_posts', $has_published_posts );\n\treturn $has_published_posts;\n}", "public function testRandom() {\n\t\t$results = array();\n\t\tforeach (range(0, 100) as $run) {\n\t\t\t$results[] = _::random(10);\n\t\t}\n\t\t$this->assertContainsOnly('int', $results);\n\t\t$this->assertGreaterThanOrEqual(0, min($results));\n\t\t$this->assertLessThanOrEqual(10, max($results));\n\t}", "function has_posts() {\n\tif(($posts = IoC::resolve('posts')) === false) {\n\t\t$params['sortby'] = 'id';\n\t\t$params['sortmode'] = 'desc';\n\t\t\n\t\t$posts = Posts::list_all($params);\n\t\tIoC::instance('posts', $posts, true);\n\t}\n\t\n\treturn $posts->length() > 0;\n}", "public function renderForNoPublicationHashSetInPiVarsReturnsPublishFailedMessage()\n {\n self::assertEquals(\n $this->fixture->translate('message_publishingFailed'),\n $this->fixture->render()\n );\n }", "public function run()\n {\n $faker = Faker::create();\n $user = User::all()->pluck('id');\n $postCategory = PostCategory::all()->pluck('id');\n for($i = 0; $i < 50; $i++) {\n $created = $faker->dateTimeThisDecade($max = 'now');\n $updated = $faker->dateTimeThisDecade($max = 'now');\n if($created <= $updated) {\n DB::table('posts')->insert([\n 'name' => $faker->sentence($nbWords = 6, $variableNbWords = true),\n 'title' => $faker->sentence($nbWords =10, $variableNbWords = true),\n 'description' => $faker->text(),\n 'image' => '',\n 'video' => '',\n 'user_id' => $faker->randomElement($user->toArray()),\n 'post_category_id' => $faker->randomElement($postCategory->toArray()),\n 'created_at' => $created,\n 'updated_at' => $updated,\n ]);\n } else {\n $i--;\n }\n\n }\n}", "function check_and_publish_future_post($post)\n {\n }", "function xgb_check_post_count($post_id) {\n\tglobal $wpdb;\n\t\n\t$post = get_post($post_id);\n\t$author_id = $post->post_author;\n\t$user_info = get_userdata(get_current_user_id());\n\t\n\t\t$published_post_count = $wpdb->get_var(\"SELECT COUNT(ID) FROM wp_posts WHERE post_status='publish' AND post_type='post' AND post_author=$author_id\");\n\t\tif($published_post_count > $GLOBALS['live_article_limit'] ) {\n\t\t\t$wpdb->query(\"UPDATE wp_posts SET post_status='pending' WHERE ID=$post_id\");\n\t\t\t// Set the transient for admin notice\n\t\t\tset_transient( get_current_user_id().'publisherror', $GLOBALS['live_article_limit'] ); \n\t\t}\n}", "public function isPublished()\n {\n return $this->postID > 0;\n }", "function block_core_calendar_update_has_published_posts()\n {\n }", "function block_core_calendar_has_published_posts() {\n\t// Multisite already has an option that stores the count of the published posts.\n\t// Let's use that for multisites.\n\tif ( is_multisite() ) {\n\t\treturn 0 < (int) get_option( 'post_count' );\n\t}\n\n\t// On single sites we try our own cached option first.\n\t$has_published_posts = get_option( 'wp_calendar_block_has_published_posts', null );\n\tif ( null !== $has_published_posts ) {\n\t\treturn (bool) $has_published_posts;\n\t}\n\n\t// No cache hit, let's update the cache and return the cached value.\n\treturn block_core_calendar_update_has_published_posts();\n}", "function getCountDefault_exclude( $id ) {\n $args = array( \n 'post_type' => 'idem_pop_up',\n 'meta_key' => 'idem_pop_up_default',\n 'meta_value' => 1,\n 'post__not_in' => [ $id ],\n 'post_status' => ['publish', 'future']\n );\n $posts = get_posts( $args );\n\n if(count($posts) < 1) \n return 0;\n else\n return 1;\n \n}", "public function testPublished()\n {\n $feed = $this->eventFeed;\n\n // Assert that all entry's have an Atom Published object\n foreach ($feed as $entry) {\n $this->assertTrue($entry->getPublished() instanceof Zend_Gdata_App_Extension_Published);\n }\n\n // Assert one of the entry's Published dates\n $entry = $feed[2];\n $this->verifyProperty2($entry, \"published\", \"text\", \"2007-05-09T16:44:38.000Z\");\n }", "public function all_post() {\n return false;\n }", "public function all_post() {\n return false;\n }", "function get_random_featured_items($num = 5, $hasImage = null)\n{\n return get_records('Item', array('featured' => 1,\n 'sort_field' => 'random',\n 'hasImage' => $hasImage), $num);\n}", "public function testRandom()\n {\n $widget = 'MeCms.Photos::random';\n\n $expected = [\n ['div' => ['class' => 'widget mb-4']],\n 'h4' => ['class' => 'widget-title'],\n 'Random photo',\n '/h4',\n ['div' => ['class' => 'widget-content']],\n ['a' => ['href' => '/albums']],\n ['img' => ['src', 'alt', 'class' => 'img-fluid thumbnail']],\n '/a',\n '/div',\n '/div',\n ];\n $this->assertHtml($expected, $this->Widget->widget($widget)->render());\n\n //Tries another limit\n $expected = [\n ['div' => ['class' => 'widget mb-4']],\n 'h4' => ['class' => 'widget-title'],\n 'Random 2 photos',\n '/h4',\n ['div' => ['class' => 'widget-content']],\n ['a' => ['href' => '/albums']],\n ['img' => ['src', 'alt', 'class' => 'img-fluid thumbnail']],\n '/a',\n ['a' => ['href' => '/albums']],\n ['img' => ['src', 'alt', 'class' => 'img-fluid thumbnail']],\n '/a',\n '/div',\n '/div',\n ];\n $this->assertHtml($expected, $this->Widget->widget($widget, ['limit' => 2])->render());\n\n //Empty on same controllers\n foreach (['Photos', 'PhotosAlbums'] as $controller) {\n $request = $this->Widget->getView()->getRequest()->withParam('controller', $controller);\n $this->Widget->getView()->setRequest($request);\n $this->assertEmpty($this->Widget->widget($widget)->render());\n }\n $this->Widget->getView()->setRequest(new ServerRequest());\n\n //Tests cache\n $this->assertEquals(3, Cache::read('widget_random_1', $this->Table->getCacheName())->count());\n $this->assertEquals(3, Cache::read('widget_random_2', $this->Table->getCacheName())->count());\n\n //With no photos\n $this->Table->deleteAll(['id IS NOT' => null]);\n $this->assertEmpty($this->Widget->widget($widget)->render());\n }", "public function unpublish_expired_posts() {\n $expired_posts = $this->get_expired_posts();\n foreach ( $expired_posts as $expired_post ) {\n // Only automatically unpublish if the corresponding option is enabled for this post\n if ( $expired_post->bbx_best_before_unpublish_when_expired ) {\n // Set post to draft\n wp_update_post(\n array(\n 'ID' => $expired_post->ID,\n 'post_status' => 'draft'\n )\n );\n }\n }\n }", "public function notSure() {\n return $this->randomItem(\n \"I'm not sure.\",\n \"I have absolutely no idea.\",\n \"Beats me!\",\n \"Um... good question!\"\n );\n }", "function get_random_quote($content = null) {\r\n\t//remove_all_filters('posts_orderby');\r\n\t$args = array( 'post_type' => 'quote', 'posts_per_page' => 1, 'post_status' => 'publish', 'orderby' => 'rand' );\r\n\r\n\t$quote_posts = new WP_Query( $args );\r\n\tob_start();\r\n\tif($quote_posts->have_posts()) {\r\n\t\tglobal $post;\r\n\t\t//$posts_list = array();\r\n\t\twhile($quote_posts->have_posts()): $quote_posts->the_post();\r\n\t\t\t//$posts_list[] = $post->ID;\r\n\t\t\t?>\r\n\t\t\t<div class=\"quote_of_the_day\">\r\n\t\t\t\t<p><?php echo get_the_excerpt(); ?></p>\r\n\t\t\t\t<a href=\"<?php echo get_permalink(); ?>\" class=\"more_link\">Read More</a>\r\n\t\t\t</div>\r\n\t\t\t<?php\r\n\r\n\t\tendwhile;\r\n\t\twp_reset_postdata();\r\n\t}\r\n\r\n\r\n\t$content = ob_get_clean();\r\n\treturn $content;\r\n}", "public function testArchivesShoudBeVisibleTest()\n {\n // given I have to posts in the DB\n $firstPost = factory(Post::class)->create();\n $secondPost = factory(Post::class)->create([\n 'created_at' => Carbon::now()->subMonth()\n ]);\n\n // when I fetch archives\n $posts = Post::archives();\n\n // checking output to prepare test\n // dd($posts->toArray()); // using array to get quick info as it is Collection\n // dd(Carbon::Parse($firstPost->created_at)->format('F Y'));\n // dd($firstPost->created_at->format('F Y'));\n // dd([Carbon::Parse($firstPost->created_at)->format('F Y') => []]);\n\n // then\n $this->assertCount(2, $posts);\n $this->assertEquals([\n $firstPost->created_at->format('F Y') => [\n 0 => [\n \"id\" => $firstPost->id,\n \"created_at\" => $firstPost->created_at->format('Y-m-d H:i:s')\n ]\n ],\n $secondPost->created_at->format('F Y') => [\n 0 => [\n \"id\" => $secondPost->id,\n \"created_at\" => $secondPost->created_at->format('Y-m-d H:i:s')\n ]\n ]\n ], $posts->toArray());\n }", "function feedgeomashup_unmapped_posts( $posts , $link ) {\n\n\t//get the site-wide preference for keeping all or only mapped posts\n\t$sitewide_setting = get_option( 'feedwordpress_feedgeomashup_posts' );\n\tif ( $sitewide_setting == 'mapped' ) :\n\t\t$keep_posts = 'mapped';\n\t//keep all posts is the default\n\telse :\n\t\t$keep_posts = 'all';\n\tendif;\n\n\t//override with the individual feed setting if appropriate\n\t$feed_setting = $link->settings['feedgeomashup posts'];\n\tif ( $feed_setting == 'mapped' ) :\n\t\t$keep_posts = 'mapped';\n\telseif ($feed_setting == 'all' ) :\n\t\t$keep_posts = 'all';\n\tendif;\n\n\t//if the setting works out to 'all', just return the array\n\tif ( $keep_posts == 'all' ) {\n\t\treturn $posts;\n\t}\n\n\t//otherwise, go through the array of items\n\t$link->magpie->originals = $posts;\n\n\tif ( is_array( $posts )) :\n\t\tforeach ( $posts as $key => $item ) :\n\t\t\t$post = new SyndicatedPost( $item , $link );\t\n\t\t\t$post_point = $post->item['http://www.georss.org/georss']['point']; \n\t\t\tif ( !$post_point ) :\n\t\t\t\tunset( $posts[$key] );\n\t\t\tendif;\n\t\tendforeach;\n\tendif;\n\n\treturn $posts;\n}", "function get_others_unpublished_posts($user_id, $type = 'any')\n {\n }", "public function getRandomUntranscribedEntries($amount){\n\t\tif(!isset($amount))$amount = 1;\n\n\t\t// check whether logged in\n\t\t// and get lowest ratings\n\t\t$user = $this->getUser();\n\t\t$query = Queries::getrandomuntranscribedids();\n\n\t\t$ids = $this->query($query);\n\t\tif(!$ids||count($ids)==0)return false;\n\n\t\tif(count($ids)==1){\n\t\t\treturn $this->getEntry($ids[0][\"id\"]);\n\t\t}\n\n\t\t// randomize list\n\t\tshuffle($ids);\n\n\t\t// get entries with those rating\n\t\t$e = DBConfig::$tables[\"entries\"];\n\t\t$where = \"`$e`.id = \".$ids[0][\"id\"];\n\t\tfor($i=1;$i<count($ids)&&$i<$amount;$i++){\n\t\t\t$where .= \" OR `$e`.id = \".$ids[$i][\"id\"];\n\t\t}\n\t\t$query = Queries::getEntry(false,$where);\n\n\t\t$entries = $this->query($query);\n\n\t\tif(!$entries)return false;\n\t\t$entries = $this->addExtras($entries, $user[\"id\"]);\n\t\tshuffle($entries);\n\t\treturn $entries;\n\t}", "function publicacoes_relacionadas() { \n $limitpost = 3;\n global $post;\n \n $tags = wp_get_post_tags($post->ID);\n $tag_ids = array();\n foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;\n $args_tags = array( 'tag__in' => $tag_ids, 'post__not_in' => array($post->ID), 'order' => 'RAND', 'posts_per_page'=> $limitpost, 'ignore_sticky_posts'=> 1 );\n $my_query_tags = new WP_Query($args_tags);\n \n \n if ($my_query_tags->have_posts()) {\n $i = 1;\n while($my_query_tags->have_posts()) {\n $my_query_tags->the_post();\n ?>\n \n <div class=\"item\" style=\"background-image: url('<?php thumb_url(); ?>');\">\n <a href=\"<?php the_permalink(); ?>\"><h5><?php the_title(); ?></h5></a>\n </div> \n\n\n <?php $i++; }\n }\n \n else {}\n wp_reset_query();\n}", "function random_featured_collection()\n{\n $collection = get_random_featured_collection();\n if ($collection) {\n $html = get_view()->partial('collections/single.php', array('collection' => $collection));\n release_object($collection);\n } else {\n $html = '<p>' . __('No featured collections are available.') . '</p>';\n }\n return $html;\n}", "public function test_search_returns_results_for_published_posts() {\n\t\trequire_once ABSPATH . 'wp-admin/includes/nav-menu.php';\n\n\t\t// This will make sure that WP_Query sets is_admin to true.\n\t\tset_current_screen( 'nav-menu.php' );\n\n\t\tself::factory()->post->create(\n\t\t\tarray(\n\t\t\t\t'post_type' => 'post',\n\t\t\t\t'post_status' => 'publish',\n\t\t\t\t'post_title' => 'Publish',\n\t\t\t\t'post_content' => 'FOO',\n\t\t\t)\n\t\t);\n\t\tself::factory()->post->create(\n\t\t\tarray(\n\t\t\t\t'post_type' => 'post',\n\t\t\t\t'post_status' => 'draft',\n\t\t\t\t'post_title' => 'Draft',\n\t\t\t\t'post_content' => 'FOO',\n\t\t\t)\n\t\t);\n\t\tself::factory()->post->create(\n\t\t\tarray(\n\t\t\t\t'post_type' => 'post',\n\t\t\t\t'post_status' => 'pending',\n\t\t\t\t'post_title' => 'Pending',\n\t\t\t\t'post_content' => 'FOO',\n\t\t\t)\n\t\t);\n\t\tself::factory()->post->create(\n\t\t\tarray(\n\t\t\t\t'post_type' => 'post',\n\t\t\t\t'post_status' => 'future',\n\t\t\t\t'post_title' => 'Future',\n\t\t\t\t'post_content' => 'FOO',\n\t\t\t\t'post_date' => gmdate(\n\t\t\t\t\t'Y-m-d H:i:s',\n\t\t\t\t\tstrtotime( '+1 month' )\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$request = array(\n\t\t\t'type' => 'quick-search-posttype-post',\n\t\t\t'q' => 'FOO',\n\t\t);\n\t\t$output = get_echo( '_wp_ajax_menu_quick_search', array( $request ) );\n\n\t\t$this->assertNotEmpty( $output );\n\t\t$results = explode( \"\\n\", trim( $output ) );\n\t\t$this->assertCount( 1, $results );\n\t}", "public function has_published_pages()\n {\n }", "public function run(Faker $faker)\n {\n for($i = 0; $i < 10; $i++) {\n $newPost = new Post();\n $newPost->title = $faker->sentence(3);\n $newPost->content = $faker->text(500);\n\n $userCount = Count(User::all()->toArray());\n $newPost->user_id = rand(1,$userCount);\n\n $slug = Str::slug($newPost->title);\n $slugIniziale = $slug;\n \n $postPresente = Post::where('slug',$slug)->first();\n\n $contatore = 1;\n\n while($postPresente) {\n $slug = $slugIniziale . '-' . $contatore;\n $postPresente = Post::where('slug',$slug)->first();\n $contatore++;\n }\n\n $newPost->slug = $slug;\n\n\n $newPost->save();\n }\n }", "function get_uncategorized_news() {\r\n $args = array(\r\n 'post_type' => 'news',\r\n 'posts_per_page' => -1,\r\n 'post_status' => 'publish',\r\n 'tax_query' => array(\r\n array(\r\n 'taxonomy' => 'dept',\r\n 'operator' => 'NOT EXISTS',\r\n ),\r\n ),\r\n );\r\n return get_posts($args);\r\n}", "public function testSeeAllPostsTest()\n {\n $response = $this->get('/posts');\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n $response->assertSeeText('Next');\n }", "public function get_footer_random_posts($limit)\r\n {\r\n $this->set_filter_query();\r\n $this->db->order_by('rand()');\r\n $this->db->limit($limit);\r\n $query = $this->db->get('posts');\r\n return $query->result();\r\n }", "public function randomQuestionWithUserInStormMode(): void\n {\n QuestionUserHelper::removeAllQuestionsForUser($this->user);\n QuestionHelper::newQuestion();\n\n $questionsList = User::randomQuestions('storm', [], Question_user::DEFAULT_BAG_LIMIT ,$this->user);\n\n $this->assertFalse($this->user->questions()->get()->contains($questionsList));\n }", "public function testBlog()\n {\n $resp = $this->client->get('/en/blog/');\n $this->assertEquals('200', $resp->getStatusCode(), 'top page status code');\n $this->assertStringContainsString(\n 'No posts found',\n $resp->getBody()->getContents()\n );\n }", "public function testUnauthenticatedUserCantReviewPosts()\n {\n // $northstarId = $this->faker->northstar_id;\n $post = factory(Post::class)->create();\n\n $response = $this->postJson('api/v3/posts/' . $post->id . '/reviews', [\n 'status' => 'accepted',\n ]);\n\n $response->assertStatus(401);\n }", "public function get_noPublishedRecipes() {\n\n $query = $this->db\n ->from('recipes')\n ->where('published', 0)\n ->order_by('created_at', 'DESC')\n ->get();\n\n return $result = $query->result();\n }", "public function test_a_guest_can_see_post()\n {\n $post = factory(Post::class)->create();\n $response = $this->get('/blog');\n $response->assertSee($post->title);\n }", "public function removeAllPosts() {}", "function rfi_should_stop_post_publishing( $post ) {\n $is_watched_post_type = rfi_is_supported_post_type( $post );\n $is_after_enforcement_time = rfi_is_in_enforcement_window( $post );\n $large_enough_image_attached = rfi_post_has_large_enough_image_attached( $post );\n\n if ( $is_after_enforcement_time && $is_watched_post_type ) {\n return !$large_enough_image_attached;\n }\n return false;\n}", "public function testRandomValuesAreVaried() {\n\t\t$this->Message = new Message();\n\t\tfor ($i = 1; $i <= 100; $i++) {\n\t\t\t$this->Message->create();\n\t\t\t$this->Message->saveField('name', 'Test ' . str_pad($i, 3, '0', STR_PAD_LEFT));\n\t\t}\n\t\t$count = $this->Message->find('count');\n\t\t$this->Message->randomize();\n\t\t$randomVals = $this->Message->find('all', array(\n\t\t\t'fields' => array('random', 'count(random) as counter'),\n\t\t\t'group' => 'random',\n\t\t\t'order' => 'count(random) DESC'\n\t\t));\n\t\t$randomVals = Set::combine($randomVals, '/Message/random', '/0/counter');\n\t\t$distinctValues = count($randomVals);\n\t\t$maxDuplicates = current($randomVals);\n\t\tif (!$this->assertTrue($distinctValues > $count * 0.7)) {\n\t\t\tdebug(\"30% overlap detected for random values - Many rows have the same random value.\\r\\n\" .\n\t\t\t\t\"Due to the nature of random number generation this test may fail - it should not fail consistently.\");\n\t\t}\n\t\tif (!$this->assertTrue($maxDuplicates <= 5)) {\n\t\t\tdebug(\"The most common random number is used for $maxDuplicates different rows.\\r\\n\" .\n\t\t\t\t\"Due to the nature of random number generation this test may fail - it should not fail consistently.\");\n\t\t}\n\t}", "public function run(Faker $faker)\n {\n for ($i=0; $i<10; $i++) {\n $new_post = new Post();\n\n $new_post->title = $faker->sentence(rand(1,5));\n $new_post->content = $faker->text();\n \n // genero lo slug\n $slug = Str::slug($new_post->title, '-');\n $slug_base = $slug;\n\n //verifico che lo slug non sia già presente nel db\n $slug_present = Post::where('slug', $slug)->first();\n $counter = 1;\n\n //ciclo fino a quando slug_present diventa true\n while($slug_present) {\n $slug = $slug_base.'-'.$counter;\n $counter++; \n $slug_present = Post::where('slug', $slug)->first();\n }\n\n $new_post->slug = $slug;\n\n //perchè ho solo 1 utente\n $new_post->user_id = 1;\n\n $new_post->save();\n }\n }", "public function hasPublished() {\n return $this->_has(6);\n }", "public function testViewPosts()\n {\n $posts = factory(\\App\\Models\\Post::class, 22)->create();\n $this->browse(function (Browser $browser) use ($posts) {\n $title = $this->faker->sentence();\n $browser->visit(\"/\")\n ->assertSee($posts[0]->title)\n ->assertSee($posts[19]->title)\n ->visit(\"/?page=2\")\n ->assertSee($posts[20]->title)\n ->assertSee($posts[21]->title)\n ->screenshot(\"testViewPosts\");\n });\n }", "public function testPublicBlogPost(): void\n {\n $client = static::createClient();\n // the service container is always available via the test client\n $blogPost = $client->getContainer()->get('doctrine')->getRepository(Post::class)->find(1);\n $client->request('GET', sprintf('/en/blog/posts/%s', $blogPost->getSlug()));\n\n $this->assertResponseIsSuccessful();\n }", "static public function published($limit = -1) {\n $compliant_posts = array();\n\n $wp_posts = CompliantPost::wp_posts('publish', $limit);\n\n foreach ( $wp_posts as $wp_post ) {\n $compliant_posts[] = new CompliantPost($wp_post);\n }\n\n // Would be nice if this returned a lazy iterator. But not sure how to do that in PHP.\n return $compliant_posts;\n }", "public function run()\n {\n foreach (Post::get() as $post) {\n $numberOfUsers = rand(0, 10);\n $randomUserIDs = User::inRandomOrder()->where('id', '<>', $post->user->id)->limit($numberOfUsers)->pluck('id');\n $post->likedBy()->attach($randomUserIDs);\n }\n }", "private function requested_post_is_valid(){\n return (get_post_type((int) $_GET['post_id']) === $this->post_type && get_post_status((int) $_GET['post_id']) === 'publish');\n }", "public function testPostEmpty()\n {\n $this->assertArrayEmpty($this->get_reflection_property_value('post'));\n }", "public function test_treatments_can_get_public_list_true()\n {\n $this->seed();\n $number = rand(2,5);\n Treatment::factory()\n ->count($number)\n ->create(['public'=>1]);\n $response = $this->json('GET','/api/treatments/list');\n\n $response->assertStatus(200)->assertJsonCount($number, 'data');\n }", "protected function _getRandAuthorsExceptCorrect($count = 1)\n {\n if (!empty($this->_correctAuthor)) {\n $sth = $this->_dbObj->prepare('SELECT author FROM ' . $this->_quotesTable . ' WHERE author NOT LIKE (?)', array($this->_correctAuthor))->execute();\n $authors = $sth->fetchAllAssoc();\n\n $randAuthors = array();\n if (is_array($authors) && !empty($authors) && $count > 0) {\n do {\n $randomKey = array_rand($authors);\n\n if (!in_array($authors[$randomKey]['author'], $randAuthors)) {\n $randAuthors[] = $authors[$randomKey]['author'];\n }\n } while (count($randAuthors) < $count);\n }\n\n return $randAuthors;\n }\n }", "public function justPublished()\n {\n\n return $this->created_at->gt(Carbon::now()->subMinute());\n }", "function ppo_categorized_blog() {\n if (false === ( $all_the_cool_cats = get_transient('ppo_category_count') )) {\n // Create an array of all the categories that are attached to posts\n $all_the_cool_cats = get_categories(array(\n 'hide_empty' => 1,\n ));\n\n // Count the number of categories that are attached to the posts\n $all_the_cool_cats = count($all_the_cool_cats);\n\n set_transient('ppo_category_count', $all_the_cool_cats);\n }\n\n if (1 !== (int) $all_the_cool_cats) {\n // This blog has more than 1 category so ppo_categorized_blog should return true\n return true;\n } else {\n // This blog has only 1 category so ppo_categorized_blog should return false\n return false;\n }\n}", "function exa_is_published_today( $post ) {\n\t$post = get_post($post);\n\t$postTime = get_post_time('U',true);\n\t$today = strtotime('midnight',current_time('timestamp'));\n\treturn ($postTime >= $today);\n}", "function onlyStickyPosts()\r\n{\r\n\t$sticky = get_option('sticky_posts');\r\n\t// check if there are any\r\n\tif (!empty($sticky)) {\r\n\t\t// optional: sort the newest IDs first\r\n\t\trsort($sticky);\r\n\t\t// override the query\r\n\t\t$args = array(\r\n\t\t\t'post__in' => $sticky\r\n\t\t);\r\n\t\tquery_posts($args);\r\n\t\t// the loop\r\n\t\twhile (have_posts()) {\r\n\t\t\tthe_post();\r\n\t\t\t// your code\r\n\t\t\tget_template_part('article');\r\n\t\t}\r\n\t}\r\n\twp_reset_query();\r\n}", "function clear_unknown_post_metas()\n {\n global $wpdb;\n\n $query = \"SELECT count(*) FROM {$wpdb->postmeta} WHERE ( meta_key LIKE 'prli%' OR meta_key LIKE 'pretty-link%' OR meta_key LIKE '_prli%' OR meta_key LIKE '_pretty-link%' ) AND post_id=0\";\n $count = $wpdb->get_var($query);\n\n if($count)\n {\n $query = \"DELETE FROM {$wpdb->postmeta} WHERE ( meta_key LIKE 'prli%' OR meta_key LIKE 'pretty-link%' OR meta_key LIKE '_prli%' OR meta_key LIKE '_pretty-link%' ) AND post_id=0\";\n $wpdb->query($query);\n }\n }", "function get_question_random_simple() {\n global $default_terms_array;\n $session = new Session();\n $questions = get_questions($default_terms_array);\n\n for ($i = 0; $i < sizeof($questions); $i++) {\n\n $question = $questions[array_rand($questions) ];\n\n // if the question hasn't already been asked recently OR we're not remembering things in the session, return it\n if ((!$session->get('random_questions_asked') || ($session->get('random_questions_asked') && !in_array($question->get_ID(), $session->get('random_questions_asked'))))) {\n return $question;\n }\n }\n\n return $questions[array_rand($questions) ];\n}", "public function testFutureBookingsAreNotDeleted(): void\n {\n Booking::factory()->create([\n 'start_time' => now()->addMonths(1),\n 'end_time' => now()->addMonths(2),\n ]);\n\n $this->artisan('model:prune');\n\n $this->assertCount(1, Booking::all());\n }", "function test_insert_post_returns_0() {\n\n\t\t$post = get_post( $this->post_id );\n\n\t\t$updated_id = wp_insert_post( array(\n\t\t\t'ID' => $this->post_id,\n\t\t\t'post_name' => 'post_before_post_name',\n\t\t) );\n\n\t\t$this->assertEquals( 0, $updated_id );\n\n\t}", "public function testAdminCanNotAddADuplicatedPageTitle()\n {\n $existPage = Post::factory()->create(['post_type' => Post::PAGE]);\n\n $params = [\n 'title' => $existPage->title,\n ];\n\n $response = $this\n ->actingAs($this->admin)\n ->post('/admin/blog/pages', $params);\n\n $response->assertStatus(302);\n $response->assertSessionHasErrors();\n\n $errors = session('errors');\n $this->assertEquals('The title has already been taken.', $errors->get('title')[0]);\n }", "public function testExample()\n {\n\n $order = \\App\\Order::orderByRaw(\"RAND()\")->with('products')->first();\n\n $orders = \\App\\Order::getByState('complite')->paginate(10);\n\n// print_r($orders);\n $this->assertNotEmpty($order->amount);\n\n }", "public function testA_post_can_be_liked(){\n $this->actingAs(factory(User::class)->create());\n $post =factory(Post::class)->create();\n // $user =factory(User::class)->create();\n $post->like();\n \n $this->assertCount(1, $post->likes);\n $this->assertTrue($post->likes->contains('id', auth()->id()));\n }", "function test_treatments_not_found_true()\n {\n $this->seed();\n \n $user = User::where('email', '=', 'a@a.com')->first();\n \n $token = JWTAuth::fromUser($user);\n $response = $this->json('GET', '/api/treatments/'.rand(11,50).'?token='.$token);\n $response->assertNotFound();\n }", "public function isPubliclyAvailable() {\n $id = $this->getID();\n $the_post = $this->find('first', array(\n 'conditions' => array(\n 'Post.id' => $id,\n ),\n 'fields' => array(\n 'Post.enabled',\n 'Post.published',\n ),\n 'recursive' => -1,\n 'callbacks' => false,\n ));\n\n $invalid_post = empty($the_post);\n\n// Don't try to process any more logic unless we know the Post even exists.\n if ($invalid_post) {\n return false;\n }\n\n $disabled_post = $the_post['Post']['enabled'] === false;\n $unpublished_post = new DateTime($the_post['Post']['published']) > new DateTime();\n\n if ($disabled_post || $unpublished_post) {\n return false;\n }\n else {\n return true;\n }\n }", "protected function doTestPublishedStatus() {\n $storage = $this->container->get('entity_type.manager')\n ->getStorage($this->entityTypeId);\n $storage->resetCache([$this->entityId]);\n $entity = $storage->load($this->entityId);\n\n // Unpublish translations.\n foreach ($this->langcodes as $index => $langcode) {\n if ($index > 0) {\n $url = $entity->toUrl('edit-form', ['language' => ConfigurableLanguage::load($langcode)]);\n $edit = ['content_translation[status]' => FALSE];\n $this->drupalGet($url);\n $this->submitForm($edit, $this->getFormSubmitAction($entity, $langcode));\n $storage = $this->container->get('entity_type.manager')\n ->getStorage($this->entityTypeId);\n $storage->resetCache([$this->entityId]);\n $entity = $storage->load($this->entityId);\n $this->assertFalse($this->manager->getTranslationMetadata($entity->getTranslation($langcode))->isPublished(), 'The translation has been correctly unpublished.');\n }\n }\n\n // Check that the last published translation cannot be unpublished.\n $this->drupalGet($entity->toUrl('edit-form'));\n $this->assertSession()->fieldDisabled('content_translation[status]');\n $this->assertSession()->fieldValueEquals('content_translation[status]', TRUE);\n }", "function more_posts() \n{\n global $wp_query;\n return $wp_query->current_post + 1 < $wp_query->post_count;\n}", "function randomDomains_exists()\t{\n\t\treturn $this->recordNumber(self::RNDDOMAINSC_NAME) > 0;\n\t}", "public function testUnauthorized()\n {\n factory(User::class)->create(); \n $response = $this->json('GET', '/api/users/posts');\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n }", "public function test404IfPostDoesntExist()\n {\n // Review a post that doesn't exist.\n $northstarId = $this->faker->northstar_id;\n $response = $this->withAccessToken($northstarId, 'admin')->postJson('api/v3/reviews/posts/z/reviews', [\n 'post_id' => 88,\n 'status' => 'accepted',\n ]);\n\n $response->assertStatus(404);\n }", "function widget_ara_randomposts( $args ) {\n extract( $args );\n $options = get_option( 'widget_ara_randomposts' );\n echo $before_widget;\n if ( $options['title'] )\n echo $before_title . $options['title'] . $after_title;\n echo ara_random_posts( $options );\n echo $after_widget;\n }", "public function test_a_user_can_unlike_a_post(){\n \n //we have a signed in user\n \n //user likes the model\n $this->post->likes();\n\n $this->post->unlike();\n\n $this->assertFalse($this->post->isLiked());\n\n }", "public function getPublishedPosts(){\n $query = \"SELECT * FROM `posts` WHERE `published`='1';\";\n $result = $this->executeQuery($query);\n $result = $result->fetchAll();\n\n if($result != null && count($result)>0){\n return $result;\n } else {\n return null;\n }\n }", "public function testCurrentBookingsAreNotDeleted(): void\n {\n Booking::factory()->create([\n 'start_time' => now()->subMonth(),\n 'end_time' => now()->addMonth(),\n ]);\n\n $this->artisan('model:prune');\n\n $this->assertCount(1, Booking::all());\n }", "public function testMissing()\n {\n $result = $this->writedown->getService('api')->tag()->delete(mt_rand(1000, 9999));\n\n $this->assertFalse($result['success']);\n $this->assertEquals(['Not found.'], $result['data']);\n }", "protected function _testLoad($posts) {\n\t\t$expected = array(\n\t\t\t'post1' => array(\n\t\t\t\t'title' => 'My First Post',\n\t\t\t\t'content' => 'First Content...'\n\t\t\t),\n\t\t\t'post2' => array(\n\t\t\t\t'title' => 'My Second Post',\n\t\t\t\t'content' => 'Also some foobar text'\n\t\t\t),\n\t\t\t'post3' => array(\n\t\t\t\t'title' => 'My Third Post',\n\t\t\t\t'content' => 'I like to write some foobar foo too'\n\t\t\t)\n\t\t);\n\n\t\t$this->assertEqual($expected['post1'], $posts->first());\n\t\t$this->assertEqual($expected['post1'], $posts->current());\n\t\t$this->assertEqual($expected['post2'], $posts->next());\n\t\t$this->assertEqual($expected['post2'], $posts->current());\n\t\t$this->assertEqual($expected['post1'], $posts->prev());\n\t\t$this->assertEqual($expected['post2'], $posts->next());\n\t\t$this->assertEqual($expected['post3'], $posts->next());\n\t\t$this->assertEqual($expected['post2'], $posts->prev());\n\t\t$this->assertEqual($expected['post1'], $posts->rewind());\n\t\t$this->assertEqual($expected['post1'], $posts['post1']);\n\t}", "function create_nonsense() {\n\t$url = \"https://en.wikipedia.org/wiki/Special:Random\";\n\t$r = \"\";\n\t//echo(\"entering loop\");\n\t\n\t$i = rand(1,3);\n\tfor($j = 0; $j < $i; $j++) {\n\t\t$content = url_get_contents($url);\n\t\t$clean = filter_var($content, FILTER_SANITIZE_STRING);\n\t\t\n\t\t$scrape = scrape_between($clean,\"nomin\",\"Not logged in\");\n\t\t\n\t\t$margin = 500;\n\t\t$sLength = strlen($scrape);\n\t\t$randLength1 = (rand($margin,$sLength) / 3);\n\t\t$randLength2 = (rand($randLength1,$sLength) / 3);\n\t\t\n\t\t$scrape = substr($scrape,$randLength1,$randLength2);\n\t\t$scrape = wiki_sanitize($scrape);\n\n\t\t$r .= purge_parenth($scrape);\n\t\t//echo($r);\n\t}\n\t\n\t\t//echo(\"exiting loop\");\n\t\n\treturn $r;\n}" ]
[ "0.75930405", "0.65305233", "0.61184144", "0.6089835", "0.6082943", "0.60762495", "0.6016858", "0.60119396", "0.59983504", "0.59980017", "0.5941354", "0.5931737", "0.5872487", "0.5846286", "0.5835297", "0.58351773", "0.57483065", "0.5705633", "0.5665867", "0.5640566", "0.56245214", "0.5623989", "0.5607538", "0.5592615", "0.558848", "0.5551909", "0.5549673", "0.55413395", "0.55352455", "0.5530998", "0.55135053", "0.54906076", "0.54791254", "0.5474094", "0.5471514", "0.54623157", "0.5460586", "0.5425517", "0.5414307", "0.5414307", "0.5391421", "0.53893846", "0.5378244", "0.5368717", "0.5366586", "0.5365944", "0.5358484", "0.5347574", "0.5333285", "0.5331645", "0.5322221", "0.5314713", "0.530935", "0.53062433", "0.53017616", "0.5299017", "0.5296241", "0.52856624", "0.5278544", "0.526845", "0.5263985", "0.5252537", "0.52258897", "0.5218568", "0.5213573", "0.5210565", "0.5210523", "0.52071124", "0.5205322", "0.5202432", "0.51878834", "0.5177199", "0.51707745", "0.5167649", "0.51644754", "0.5163244", "0.51620245", "0.5157675", "0.5157044", "0.51540434", "0.51504844", "0.5150296", "0.51435673", "0.5130291", "0.51290876", "0.5122865", "0.51227367", "0.5121009", "0.5114928", "0.51099116", "0.5094593", "0.5093681", "0.50933385", "0.5082978", "0.50817245", "0.50812256", "0.5068477", "0.50675035", "0.50645626", "0.5058731" ]
0.88239396
0
Creates RandomPosts component to test
protected function createRandomPostsComponent() { // Spoof all the objects we need to make a page object $theme = Theme::load('test'); $page = Page::load($theme, 'index.htm'); $layout = Layout::load($theme, 'content.htm'); $controller = new Controller($theme); $parser = new CodeParser($page); $pageObj = $parser->source($page, $layout, $controller); $manager = ComponentManager::instance(); $object = $manager->makeComponent('randomPosts', $pageObj); return $object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testRandomPosts() {\n // remove all existing posts\n $all = Post::all();\n foreach ($all as $post) {\n $post->delete();\n }\n\n // create some Posts\n $posts = [];\n $posts[0] = $this->createPost(0, TRUE);\n $posts[1] = $this->createPost(1, TRUE);\n $posts[2] = $this->createPost(2, TRUE);\n $posts[3] = $this->createPost(3, TRUE);\n $posts[4] = $this->createPost(4, TRUE);\n $posts[5] = $this->createPost(5, TRUE);\n $posts[6] = $this->createPost(6, TRUE);\n\n $random_posts = $this->createRandomPostsComponent();\n $generated_posts = $random_posts->posts();\n\n // amount of posts should be equal to default value\n self::assertEquals(5, count($generated_posts));\n\n // ensure all Posts are from posts created\n $found_all = TRUE;\n foreach ($generated_posts as $generated_post) {\n $found = FALSE;\n foreach ($posts as $post) {\n if ($post->id == $generated_post->id) {\n $found = TRUE;\n break;\n }\n }\n if (!$found) {\n $found_all = FALSE;\n break;\n }\n }\n self::assertTrue($found_all, 'All posts exist in original array');\n\n // check for non-repeating\n $ids = [];\n foreach ($generated_posts as $post) {\n self::assertArrayNotHasKey($post->id, $ids, 'Post is not already present in the generated array');\n $ids[$post->id] = $post->id;\n }\n }", "public function run()\n {\n factory(App\\Models\\Post::class, 40)->create();\n\n// $tags = App\\Models\\PostTag::all()->pluck('id')->toArray();\n// $posts = App\\Models\\Post::all()->each(function ($post) use ($tags) {\n// echo( $tags->random(rand(1, $tags->count() - 1))->pluck('id')->toArray());\n// $post->tags()->attach(\n// array_rand($tags,rand(0,count($tags)-1))\n//// $tags->random(rand(1, $tags->count() - 1))->pluck('id')->toArray()\n// );\n// });\n }", "public function run()\n {\n $posts = factory(App\\Post::class, 10)->create()->each(function ($post) {\n $post->categories()->attach(App\\Category::all()->random()->id);\n $post->tags()->attach(App\\Tag::all()->random()->id);\n });\n }", "public function run()\n {\n $tags = Tag::all();\n factory(App\\Post::class, 20)->create()->each(function ($post) {\n $tags = Tag::all()->pluck('id')->all();\n $randomTags = array_rand($tags, 3);\n $tt = array();\n foreach ($randomTags as $key => $value) {\n array_push($tt, $tags[$value]);\n }\n $post->tags()->attach($tt);\n }\n );\n }", "public static function seed() {\r\n $posts = [];\r\n\r\n // post data objects pushing to the end of the $posts array\r\n $posts[] = new Post(\r\n 'mikey1983',\r\n '25/12/2017',\r\n '3:57pm',\r\n 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minus molestias quas dolorem, quos illo fuga. Voluptates minima tempora illo, distinctio!',\r\n '../images/guitar.jpg'\r\n );\r\n\r\n $posts[] = new Post(\r\n 'sue_zipy',\r\n '5/01/2018',\r\n '8:13am',\r\n 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tenetur nemo delectus dicta!',\r\n '../images/barbie.jpg'\r\n );\r\n\r\n $posts[] = new Post(\r\n 'joXyz',\r\n '26/02/2018',\r\n '11:30pm',\r\n 'Ipsam neque aspernatur consectetur, voluptate consequatur maiores ullam porro, dolores rerum veniam beatae minus itaque autem temporibus repellendus at sit. Quidem assumenda ipsa aspernatur, et odio placeat maxime officia, dignissimos consequatur, consectetur, minima ut vel illum omnis eligendi atque recusandae.',\r\n '../images/spiderman.jpg'\r\n );\r\n\r\n return $posts;\r\n }", "public function testRandomPostsUnpublished() {\n // create posts, some of them unpublished (note that there is seeded post with id=1)\n $posts = [];\n $posts[0] = $this->createPost(0, TRUE);\n $posts[1] = $this->createPost(1, FALSE);\n $posts[2] = $this->createPost(2, TRUE);\n $posts[3] = $this->createPost(3, FALSE);\n\n\n // get random posts of same quantity\n $random_posts = $this->createRandomPostsComponent();\n $generated_posts = $random_posts->posts();\n\n // ensure there are no unpublished posts in the array\n $ids = $generated_posts->pluck('id');\n self::assertTrue(in_array($posts[0]->id, $ids->all()), 'Published post is in generated array');\n self::assertFalse(in_array($posts[1]->id, $ids->all()), 'Unpublished post is not in generated array');\n self::assertFalse(in_array($posts[3]->id, $ids->all()), 'Unpublished post is not in generated array');\n }", "public function run()\n {\n factory(App\\Post::class, 50)->create()->each(function ($post){\n $a=App\\Tag::inRandomOrder();\n $numbers = range(1, 100);\n shuffle($numbers);\n $tags = array($numbers[0],$numbers[1],$numbers[2]); \n $post->tags()->attach($tags);\n $post->save(); \n }\n );\n }", "public function run()\n {\n factory(\\App\\Models\\Post::class, 500)->create();\n\n $categories = \\App\\Models\\Categories::all();\n\n \\App\\Models\\Post::all()->each(function($post) use ($categories){\n $post->category()->attach(\n $categories->random(rand(1,3))->pluck('id')->toArray()\n );\n });\n }", "public function testViewPosts()\n {\n $posts = factory(\\App\\Models\\Post::class, 22)->create();\n $this->browse(function (Browser $browser) use ($posts) {\n $title = $this->faker->sentence();\n $browser->visit(\"/\")\n ->assertSee($posts[0]->title)\n ->assertSee($posts[19]->title)\n ->visit(\"/?page=2\")\n ->assertSee($posts[20]->title)\n ->assertSee($posts[21]->title)\n ->screenshot(\"testViewPosts\");\n });\n }", "static function add_shuffle_posts(): void {\r\n self::add_acf_field(self::shuffle_posts, [\r\n 'label' => 'Shuffle the order of small posts within slides?',\r\n 'default_value' => 0,\r\n 'message' => '',\r\n 'ui' => 1,\r\n 'type' => 'true_false',\r\n 'instructions' => '',\r\n 'required' => 0,\r\n 'conditional_logic' => [\r\n [\r\n [\r\n 'field' => self::qualify_field(self::shuffle_all_posts),\r\n 'operator' => '!=',\r\n 'value' => '1',\r\n ],\r\n ],\r\n ],\r\n 'wrapper' => [\r\n 'width' => '25',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n ]);\r\n }", "public function run()\n {\n\n $faker = Faker\\Factory::create();\n // Create 10 random posts\n for($i = 1; $i <= 10; $i++){\n $post = new \\App\\Post();\n $post->title = $faker->name;\n $post->user_id = 1;\n $post->contents = $faker->text(2500);\n $post->publish = 1;\n $post->image = \"default.png\";\n $post->save();\n $post->categories()->attach([1, 2, 3]);\n }\n\n }", "function get_random_posts( $category_id, $post_count ) {\n\n $posts = get_posts( array(\n 'posts_per_page' => $post_count,\n 'orderby' => 'rand',\n 'cat' => $category_id,\n 'post_status' => 'publish',\n ) );\n\n return $posts;\n}", "public function run()\n {\n // $faker = Faker::create();\n // $states = array('active', 'waiting', 'hidden', 'rejected');\n // $types = array('buy', 'sell');\n // $users = User::all()->pluck('id');\n // $provinces = Province::all()->pluck('id');\n // $districts = District::all()->pluck('id');\n // $wards = Ward::all()->pluck('id');\n // for ($i=0; $i < 300; $i++) {\n // $title = $faker->text;\n // Post::create([\n // 'user_id' => $faker->randomElement($users->toArray()),\n // 'province_id' => $faker->randomElement($provinces->toArray()),\n // 'district_id' => $faker->randomElement($districts->toArray()),\n // 'ward_id' => $faker->randomElement($wards->toArray()),\n // 'title' => $title,\n // 'price' => rand(1, 50) * 10,\n // 'state' => $states[rand(0, 3)],\n // 'type' => $types[rand(0, 1)],\n // 'phone' => $faker->phoneNumber,\n // 'address' => $faker->address,\n // 'slug' => str_slug($title),\n // 'description' => $faker->text,\n // 'created_at' => $faker->dateTimeThisYear($max = 'now')\n // ]);\n // }\n $this->createDummyPosts();\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Post::create([\n 'title' => $faker->name,\n 'description' => $faker->text($maxNbChars = 50),\n 'content' => $faker->text($maxNbChars = 100),\n 'category_id' => Category::all()->random()->id, //lay ngau nhien gia trị ơ khóa ngoại id của table categories\n ]);\n }\n }", "public function run()\n {\n // Populate tags\n factory(App\\Tag::class, 10)->create();\n\n // Populate posts\n factory(App\\Post::class, 30)->create();\n\n // Get all the tags attaching up to 3 random tags to each post\n $tags = App\\Tag::all();\n\n // Populate the pivot table\n App\\Post::all()->each(function ($post) use ($tags) {\n $post->tags()->attach(\n $tags->random(rand(1, 3))->pluck('id')->toArray()\n );\n});\n }", "public function run()\n {\n $faker=Faker\\Factory::create();\n for($i=0;$i<100;$i++){\n $name=$faker->name;\n $post=new Post();\n $post->title=$name;\n $post->slug=str_slug($name);\n $post->image=$faker->imageUrl();\n $post->content=$faker->text(250);\n $post->category_id=$faker->numberBetween(1,20);\n $post->save();\n }\n }", "public function run()\n {\n Post::truncate();\n $total=30;\n $faker=Faker::create('zh_TW');\n\n foreach (range(1,$total) as $number){\n Post::create([\n// 'title'=> $faker->sentence,\n// 'content'=> $faker->paragraph,\n 'title'=> $faker->realText(20),\n 'content'=> $faker->realText(400),\n 'is_feature'=>rand(0,1),\n 'user_id'=>rand(1,5),\n 'created_at'=> Carbon::now()->subDays($total-$number),\n 'updated_at'=> Carbon::now()->subDays($total-$number)->addHours(1,24),\n ]);\n\n }\n\n }", "public function run() {\n // создать связи между постами и тегами\n foreach(Post::all() as $post) {\n foreach(Tag::all() as $tag) {\n if (rand(1, 20) == 10) {\n $post->tags()->attach($tag->id);\n }\n }\n }\n }", "public function run()\n {\n User::truncate();\n Post::truncate();\n Category::truncate();\n \n Post::factory(5)->create();\n //you can specify which attribute dont want random\n User::factory()->create([\n 'name' => 'John Doe'\n ]);\n // $user = User::factory()->create();\n \n // $personal = Category::create([\n // 'name' => 'Personal',\n // 'slug' => 'personal'\n // ]);\n\n // $family = Category::create([\n // 'name' => 'Family',\n // 'slug' => 'family'\n // ]);\n\n // $work = Category::create([\n // 'name' => 'Work',\n // 'slug' => 'work'\n // ]);\n\n // Post::create([\n // 'user_id' => $user->id,\n // 'category_id' => $family->id,\n // 'title' => 'My Family Post',\n // 'slug' => 'my-family-post',\n // 'excerpt' => '<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Dignissimos tenetur</p>',\n // 'body' => '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi lectus lacus, solliciudin id auctor sed, congue ut turpis. Curabitur sit amet tortor elit. Donec lacinia, ante faucibus auctor ultricies, odio eros dapibus quam, ac euismod est quam at urna. Aenean rutrum condimentum ultricies. Nunc faucibus pellentesque ornare. Phasellus ac faucibus dui. Mauris venenatis mauris urna, id interdum quam facilisis vel. Etiam mauris augue, mollis ut magna in, tincidunt finibus neque. Ut imperdiet felis rhoncus, rutrum dolor ut, imperdiet mi. Donec at orci purus.</p>'\n // ]);\n\n // Post::create([\n // 'user_id' => $user->id,\n // 'category_id' => $work->id,\n // 'title' => 'My Work Post',\n // 'slug' => 'my-word-post',\n // 'excerpt' => '<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Dignissimos tenetur</p>',\n // 'body' => '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi lectus lacus, solliciudin id auctor sed, congue ut turpis. Curabitur sit amet tortor elit. Donec lacinia, ante faucibus auctor ultricies, odio eros dapibus quam, ac euismod est quam at urna. Aenean rutrum condimentum ultricies. Nunc faucibus pellentesque ornare. Phasellus ac faucibus dui. Mauris venenatis mauris urna, id interdum quam facilisis vel. Etiam mauris augue, mollis ut magna in, tincidunt finibus neque. Ut imperdiet felis rhoncus, rutrum dolor ut, imperdiet mi. Donec at orci purus.</p>'\n // ]);\n\n // Post::create([\n // 'user_id' => $user->id,\n // 'category_id' => $personal->id,\n // 'title' => 'My Personal Post',\n // 'slug' => 'my-personal-post',\n // 'excerpt' => '<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Dignissimos tenetur</p>',\n // 'body' => '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi lectus lacus, solliciudin id auctor sed, congue ut turpis. Curabitur sit amet tortor elit. Donec lacinia, ante faucibus auctor ultricies, odio eros dapibus quam, ac euismod est quam at urna. Aenean rutrum condimentum ultricies. Nunc faucibus pellentesque ornare. Phasellus ac faucibus dui. Mauris venenatis mauris urna, id interdum quam facilisis vel. Etiam mauris augue, mollis ut magna in, tincidunt finibus neque. Ut imperdiet felis rhoncus, rutrum dolor ut, imperdiet mi. Donec at orci purus.</p>'\n // ]);\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i<10; $i++) {\n $new_post = new Post();\n\n $new_post->title = $faker->sentence(rand(1,5));\n $new_post->content = $faker->text();\n \n // genero lo slug\n $slug = Str::slug($new_post->title, '-');\n $slug_base = $slug;\n\n //verifico che lo slug non sia già presente nel db\n $slug_present = Post::where('slug', $slug)->first();\n $counter = 1;\n\n //ciclo fino a quando slug_present diventa true\n while($slug_present) {\n $slug = $slug_base.'-'.$counter;\n $counter++; \n $slug_present = Post::where('slug', $slug)->first();\n }\n\n $new_post->slug = $slug;\n\n //perchè ho solo 1 utente\n $new_post->user_id = 1;\n\n $new_post->save();\n }\n }", "public function run(Faker $faker)\n {\n for ($i = 0; $i < 10; $i++){\n $newPost = new Post;\n $newPost->title = $faker->name;\n $newPost->subtitle = $faker->name;\n $newPost->author = $faker->name;\n $newPost->description = $faker->name;\n $newPost->date = $faker->dateTime($max = 'now', $timezone = null);\n $newPost->save();\n }\n }", "public function run()\n {\n \t$faker = Faker\\Factory::create();\n\n for ($i=0; $i < 50; $i++) { \n \t\t$post = new post();\n \t\t$post->cat_ID = rand(1, 9);\n $post->postTitle = $faker->text('10');\n $post->postContent = $faker->text('500');\n $post->user_ID = rand(1, 4);\n $post->save();\n }\n }", "public function testProfilePrototypeCreatePosts()\n {\n\n }", "public function run(Faker $faker)\n {\n for($i = 0; $i < 10; $i++) {\n $newPost = new Post();\n $newPost->title = $faker->sentence(3);\n $newPost->content = $faker->text(500);\n\n $userCount = Count(User::all()->toArray());\n $newPost->user_id = rand(1,$userCount);\n\n $slug = Str::slug($newPost->title);\n $slugIniziale = $slug;\n \n $postPresente = Post::where('slug',$slug)->first();\n\n $contatore = 1;\n\n while($postPresente) {\n $slug = $slugIniziale . '-' . $contatore;\n $postPresente = Post::where('slug',$slug)->first();\n $contatore++;\n }\n\n $newPost->slug = $slug;\n\n\n $newPost->save();\n }\n }", "public function run()\n {\n $faker = Faker::create();\n $user = User::all()->pluck('id');\n $postCategory = PostCategory::all()->pluck('id');\n for($i = 0; $i < 50; $i++) {\n $created = $faker->dateTimeThisDecade($max = 'now');\n $updated = $faker->dateTimeThisDecade($max = 'now');\n if($created <= $updated) {\n DB::table('posts')->insert([\n 'name' => $faker->sentence($nbWords = 6, $variableNbWords = true),\n 'title' => $faker->sentence($nbWords =10, $variableNbWords = true),\n 'description' => $faker->text(),\n 'image' => '',\n 'video' => '',\n 'user_id' => $faker->randomElement($user->toArray()),\n 'post_category_id' => $faker->randomElement($postCategory->toArray()),\n 'created_at' => $created,\n 'updated_at' => $updated,\n ]);\n } else {\n $i--;\n }\n\n }\n}", "public function run()\n {\n factory(Post::class, 100)->create()->each(function ($post) {\n $faker = Faker::create();\n $image = 'https://loremflickr.com/640/680?kitten=' . $faker->numberBetween(1, 30);\n $post->addMediaFromUrl($image)->toMediaCollection('post_images');\n });\n }", "public function run()\n {\n for ($i = 0; $i < 20; $i++) {\n $post = new App\\Post;\n $post->title = \"Mi primer post\";\n $post->url= Str::slug(\"Mi primer post\");\n $post->excerpt = \"Extracto de mi primer post\";\n $post->body = \"<p> Contenido de este post </p>\";\n $post->published_at = Carbon::now();\n $post->category_id = App\\Category::inRandomOrder()->get()->first()->id;\n $post->save();\n\n $post->tags()->attach(Tag::create(['name'=>\"etiqueta \". Str::random('1')]));\n\n }\n }", "public function testCreateNewPost()\n {\n $response = $this->call('Post', '/post', [\n 'title' => 'Php Unit test',\n 'body' => 'Php unit test body',\n 'tag' => 'phpunit,test'\n ]);\n \n $this->seeHeader('content-type', 'application/json');\n $this->seeStatusCode(200);\n $this->seeInDatabase('posts', ['title' => 'Php Unit test']);\n \n $data = json_decode($response->getContent(true), true);\n $this->assertArrayHasKey('id', $data['data']);\n \n \n }", "public function run()\n {\n $faker = Faker::create();\n $users = User::all()->pluck('id');\n $tags = Tag::all()->pluck('id');\n // ->random()\n for ($i = 0; $i < 100; $i++) {\n $post = [\n \"user_id\" => $users->random(),\n \"title\" => $faker->realText($faker->numberBetween(20, 40)),\n \"content\" => $faker->realText($faker->numberBetween(20, 800)),\n // 'access_level' => $accessLevelId,\n 'tags' => '',\n 'comments' => [\n 'total' => 0,\n ],\n 'reacts' => [\n 'total' => 0\n ],\n 'views' => [\n 'total' => 0\n ]\n ];\n $arrTag = [];\n $amountTag = $faker->numberBetween(2, 6);\n for ($j = 0; $j < $amountTag; $j++) {\n array_push($arrTag, $tags->random());\n }\n $post['tags'] = $arrTag;\n\n Post::create($post);\n }\n }", "public function testRandom()\n {\n $widget = 'MeCms.Photos::random';\n\n $expected = [\n ['div' => ['class' => 'widget mb-4']],\n 'h4' => ['class' => 'widget-title'],\n 'Random photo',\n '/h4',\n ['div' => ['class' => 'widget-content']],\n ['a' => ['href' => '/albums']],\n ['img' => ['src', 'alt', 'class' => 'img-fluid thumbnail']],\n '/a',\n '/div',\n '/div',\n ];\n $this->assertHtml($expected, $this->Widget->widget($widget)->render());\n\n //Tries another limit\n $expected = [\n ['div' => ['class' => 'widget mb-4']],\n 'h4' => ['class' => 'widget-title'],\n 'Random 2 photos',\n '/h4',\n ['div' => ['class' => 'widget-content']],\n ['a' => ['href' => '/albums']],\n ['img' => ['src', 'alt', 'class' => 'img-fluid thumbnail']],\n '/a',\n ['a' => ['href' => '/albums']],\n ['img' => ['src', 'alt', 'class' => 'img-fluid thumbnail']],\n '/a',\n '/div',\n '/div',\n ];\n $this->assertHtml($expected, $this->Widget->widget($widget, ['limit' => 2])->render());\n\n //Empty on same controllers\n foreach (['Photos', 'PhotosAlbums'] as $controller) {\n $request = $this->Widget->getView()->getRequest()->withParam('controller', $controller);\n $this->Widget->getView()->setRequest($request);\n $this->assertEmpty($this->Widget->widget($widget)->render());\n }\n $this->Widget->getView()->setRequest(new ServerRequest());\n\n //Tests cache\n $this->assertEquals(3, Cache::read('widget_random_1', $this->Table->getCacheName())->count());\n $this->assertEquals(3, Cache::read('widget_random_2', $this->Table->getCacheName())->count());\n\n //With no photos\n $this->Table->deleteAll(['id IS NOT' => null]);\n $this->assertEmpty($this->Widget->widget($widget)->render());\n }", "public function run()\n {\n Post::create([\n 'title' => $faker->title,\n 'slug' => Str::slug($faker->sentence()),\n 'body' => $faker->body\n ]);\n\n }", "static function add_shuffle_all_posts(): void {\r\n self::add_acf_field(self::shuffle_all_posts, [\r\n 'label' => 'Shuffle the order of all individual posts across all slides?',\r\n 'default_value' => 0,\r\n 'message' => '',\r\n 'ui' => 1,\r\n 'type' => 'true_false',\r\n 'instructions' => '',\r\n 'required' => 0,\r\n 'conditional_logic' => 0,\r\n 'wrapper' => [\r\n 'width' => '100',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n ]);\r\n }", "function sp_random_posts($numberOfPosts = 5 , $thumb = true){\n\tglobal $post;\n\t$orig_post = $post;\n\n\t$lastPosts = get_posts('orderby=rand&numberposts='.$numberOfPosts);\n\tforeach($lastPosts as $post): setup_postdata($post);\n?>\n<li>\n\t<?php if ( $thumb && sp_post_image('sp-small') ) : ?>\t\t\t\n\t\t<div class=\"post-thumbnail\">\n\t\t\t<a href=\"<?php the_permalink(); ?>\" title=\"<?php printf( __( 'Permalink to %s', 'sptheme' ), the_title_attribute( 'echo=0' ) ); ?>\" rel=\"bookmark\">\n\t\t\t<img src=\"<?php echo sp_post_image('sp-small') ?>\" width=\"110\" height=\"83\" />\n </a>\n\t\t</div><!-- post-thumbnail /-->\n\t<?php endif; ?>\n\t<h3><a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?></a></h3>\n\t<?php //sp_get_score(); ?> <div class=\"entry-meta\"><?php echo sp_posted_on(); ?></div>\n</li>\n<?php endforeach;\n\t$post = $orig_post;\n}", "public function run()\n {\n \n //factory(FoodCategory::class,10)->create();\n /*\n factory(FoodCategory::class, 5)->create()->each(function ($food_category) {\n //create 5 posts for each user\n factory(FoodItem::class)->create(['category_id'=>$food_category->id]);\n });\n */\n //factory(App\\FoodCategory::class, 5)->create();\n /*$food_categories = App\\FoodCategory::all();\n App\\FoodItem::all()->each(function ($food_item) use ($food_categories) {\n $food_item->food_category()->attach(\n $food_categories->random()->pluck('id')->toArray()\n );\n });\n */ \n }", "public function run()\n {\n $posts = [\n [\n 'title' => 'Spaghetti alla Carbonara',\n 'content' => \"Il Vicolo della Scrofa, per chi conosce Roma, è una delle stradine più caratteristiche e ricche di simboli. Proprio in una trattoria di questa strada, da cui il nome del vicolo, pare sia stata realizzata la prima Carbonara, nel 1944. La storia più attendibile infatti racconta l'incontro tra gli ingredienti a disposizione dei soldati americani e la fantasia di un cuoco romano. Il risultato fu il prototipo degli spaghetti alla carbonara: uova, bacon (poi guanciale) e formaggio. Man a mano la ricetta è evoluta fino a quella che tutti conosciamo oggi e possiamo apprezzare a casa di amici romani veraci (e voraci!), nelle trattorie come nei ristoranti stellati della Capitale, in tutta Italia e all'estero, nelle innumerevoli versioni: con o senza pepe, con un tuorlo per persona o l'aggiunta di almeno un uovo intero, con guanciale o pancetta tesa.\",\n 'cooking_time' => '15 Minuti',\n 'people' => 4,\n 'suggested' => 'yes',\n 'category_id' => 3,\n 'img_path' => 'posts-cover/spaghetti-carbonara.jpg'\n ],\n [\n 'title' => 'Parmigiana di melanzane',\n 'content' => \"Basta nominarla perché a tavola ci sia un'ovazione. E' la regina dei piatti unici, la consolatrice di umori avviliti: la Parmigiana di melanzane. Una ricetta condivisa e contesa come origini da nord a sud: Emilia Romagna, Campania (Parmigiana 'e mulignane) e Sicilia (Parmiciana o Patrociane) con alcune varianti di ingredienti e modalità di composizione, ma tutte assolutamente favolose! Vi siete mai chiesti perché si chiami così? Il nome 'Parmigiana' deriverebbe proprio dal siciliano 'Parmiciana', che in dialetto indica la pila di listelle di legno delle persiane: pensate infatti a come vengono disposte le fette di melanzane in teglia e noterete le similitudini. Pochi ingredienti, tanto sapore per un piatto simbolo della cucina mediterranea: pomodoro, melanzane, basilico e formaggio... un mix che si abbina perfettamente anche agli gnocchi o alla pasta come nella ricetta dei lumaconi alla parmigiana. Ma ora preparate insieme a noi una succulenta parmigiana di melanzane!\",\n 'cooking_time' => '40 minuti',\n 'people' => 8,\n 'suggested' => 'yes',\n 'category_id' => 4,\n 'img_path' => 'posts-cover/parmigiana-di-melanzane.jpg'\n ],\n [\n 'title' => 'New York Cheesecake',\n 'content' => \"Quando si parla di ricette di cheesecake c’è l’imbarazzo della scelta: cotta o fredda, mini o maxi, con mascarpone o ricotta oppure senza panna per una versione più leggera… ma l’unica vera regina incontrastata è lei, la New York cheesecake! La classica base di biscotti e burro accoglie una crema morbida e avvolgente realizzata con formaggio e panna. La gelatina non è necessaria perché sarà l’amido di mais ad addensarla durante la cottura in forno. Caratterizzato da un bordo alto e spesso, questo dolce iconico è guarnito con un topping di panna acida e frutti di bosco come vuole la tradizione. Voi però potete scegliere la copertura che preferite: che sia una salsa al cioccolato o al caramello oppure un semplice strato di confettura, con la New York cheesecake si va sempre sul sicuro!\",\n 'cooking_time' => '30 minuti',\n 'people' => 8,\n 'suggested' => 'yes',\n 'category_id' => 6,\n 'img_path' => 'posts-cover/newyork-cheesecake.jpg'\n ],\n [\n 'title' => 'Polpette di zucchine',\n 'content' => \"Per tanti bambini le polpette sono l’unico modo per mangiare le verdure e la moda dello street food ne ha rinverdito il successo. Sono un evergreen della cucina di recupero e infatti ne esistono infinite versioni, prime fra tutte quelle della nonna! Oggi prepariamo insieme una delle varianti più povere e buone: le polpette di zucchine. Vi sveleremo tutti i segreti di preparazione e cottura per un risultato dorato e croccante, così gustoso che la cena si trasformerà in una gara all’ultima polpetta! E voi, lascerete vincere i più piccoli o la bontà irresistibile delle polpette di zucchine vi farà dimenticare le buone maniere?! Se preferite una cottura più light, non perdetevi le polpette di zucchine alla pizzaiola o le polpette di zucchine al forno, anche nella versione con la ricotta o arricchite con lo speck.\",\n 'cooking_time' => '30 minuti',\n 'people' => 4,\n 'suggested' => 'yes',\n 'category_id' => 5,\n 'img_path' => 'posts-cover/polpette-di-zucchine.jpg'\n ],\n [\n 'title' => 'Risotto allo Zafferano',\n 'content' => \"Lo zafferano è una spezia antica, conosciuta già al tempo degli egizi. In principio si usava solo per tingere le stoffe e realizzare profumi e unguenti ma una volta scoperte le sue stupefacenti proprietà culinarie, divenne un ingrediente pregiato con il quale realizzare gustosi piatti dalle sfumature dorate come il risotto allo zafferano o la pasta. Questo primo piatto, nella sua essenzialità, esalta al meglio le qualità aromatiche dello zafferano ma non solo, grazie al forte potere colorante, i chicchi di riso si impreziosiscono di un gradevole e accattivante color oro che rende così speciale questa pietanza. Una piccola magia che unita al tocco cremoso della mantecatura, immancabile nella preparazione dei risotti, vi restituirà un risotto dal gusto unico e inconfondibile. E per rendere ancora più accattivante questa degustazione, vi verrà in aiuto la mitologia greca che narra il leggendario e contrastato amore tra il giovane Crocus e la seducente ninfa Smilace, contesa dal Dio Ermes, il quale, accecato dalla gelosia, trasformò Crocos in un delicato fiore di zafferano.\",\n 'cooking_time' => '30 Minuti',\n 'people' => 4,\n 'suggested' => '',\n 'category_id' => 3,\n 'img_path' => 'posts-cover/risotto-zafferano.jpg'\n ],\n [\n 'title' => 'Polpette al sugo',\n 'content' => 'Tutti noi abbiamo una ricetta del cuore, quella che ci rimanda ad un momento particolare... che sia dolce o salata. Ma esiste una ricetta che è amatissima dai più, specialmente dai bambini: si tratta delle polpette al sugo, l’amarcord per eccellenza! Ne esistono tante versioni, come quella con i funghi, i fagioli, gli spinaci, le patate o il pesce, e ognuno ha la sua preferita, perché questi sfiziosissimi bocconcini sono davvero irresistibili! Per questa ricetta con il sugo, non dimenticate di servire in tavola del buon pane casereccio per \"la scarpetta\" finale, una consuetudine imprescindibile per questo piatto! Se preferite una versione senza pomodoro, provate le nostre polpette in bianco!',\n 'cooking_time' => '30 Minuti',\n 'people' => 5,\n 'suggested' => '',\n 'category_id' => 4,\n 'img_path' => 'posts-cover/polpette-sugo.jpg'\n ],\n [\n 'title' => 'Gnocchi alla sorrentina',\n 'content' => \"Uno dei piatti campani più conosciuti in Italia e all’estero... sono gli gnocchi alla sorrentina, preparati davvero in tutti i ristoranti del mondo! Ciò che rende questo piatto di gnocchi così amato è la sua semplicità: sapori mediterranei e la genuinità misti alla facile preparazione. Fare a mano gli gnocchi vi riporterà alla mente le domeniche passate a casa della nonna a carpire tutti i segreti celati dietro alla consistenza perfetta di quelle piccole gemme di patate e farina. Gli gnocchi alla sorrentina poi sono avvolti da un cremoso sugo di pomodoro e basilico, insaporiti da mozzarella e formaggio grattugiato... proprio gli ingredienti che renderanno ancora più goduriosi gli gnocchi creando un effetto filante dopo il brevissimo passaggio in forno. E per variare provate anche a realizzare gli gnocchi di zucchine, in alternativa al classico impasto con le patate. Vi abbiamo fatto venire l'acquolina in bocca? Preparate insieme a noi gli gnocchi alla sorrentina!\",\n 'cooking_time' => '35 Minuti',\n 'people' => 4,\n 'suggested' => '',\n 'category_id' => 4,\n 'img_path' => 'posts-cover/gnocchi-sorrentina.jpg'\n ],\n [\n 'title' => 'Dorayaki',\n 'content' => \"Avete mai sentito parlare di Doraemon? Lo ricorderanno non solo i 'figli degli anni Ottanta' ma anche i bambini di oggi; questo simpatico gatto di colore blu, che ne combina di tutti i colori, va matto per i dorayaki una delle merende più famose del Giappone! Queste golose frittelline, realizzabili anche in versione mini, ricordano molto i pancakes americani, ma vengono preparati senza l'aggiunta di grassi e farciti a mò di panino. In Giappone si usa servirli ripieni di una salsa dolce a base di fagioli azuki. Noi abbiamo optato per una farcitura più 'occidentale'... così in redazione abbiamo scelto crema di nocciole, mentre operatori e fotografi hanno preferito la confettura di frutti di bosco! Realizzate anche voi con le vostre creme e confetture preferite questi soffici dolci, per una colazione nutriente o per una merenda golosa e farete la gioia dei vostri bambini, che si sentiranno protagonisti del loro cartone preferito!\",\n 'cooking_time' => '15 minuti',\n 'people' => 3,\n 'suggested' => '',\n 'category_id' => 6,\n 'img_path' => 'posts-cover/dorayaki.jpg'\n ],\n [\n 'title' => 'Calamarata',\n 'content' => \"Riconoscete questo particolare formato di pasta? Si tratta della calamarata, molto utilizzato nella cucina campana! Sì presta benissimo per condimenti veloci e saporiti come il ragù di pesce spada. Vi state domandando se hanno qualcosa in comune con i paccheri? Non siete del tutto fuori strada: la calamarata, nel napoletano, è conosciuta con il nome di mezzi paccheri. Oltre ad essere un formato di pasta è anche un condimento il cui protagonista, nemmeno a dirlo, è il calamaro. Tagliato ad anelli spessi un paio di centimetri risulta praticamente simile al formato di pasta. Grazie al nostro modo molto originale per servire la calamarata potrebbe facilmente rappresentare un piatto delle grandi occasioni, delle feste o per sorprendere gli ospiti. Infatti il cartoccio serve a preservare i profumi che fuoriusciranno dall'involucro inebriando gli ospiti. Preparate insieme a noi la buonissima calamarata: e buon appetito!\",\n 'cooking_time' => '40 Minuti',\n 'people' => 4,\n 'suggested' => '',\n 'category_id' => 3,\n 'img_path' => 'posts-cover/calamarata.jpg'\n ],\n [\n 'title' => 'Insalata di gamberi',\n 'content' => \"Avete mai pensato di preparare una sfiziosa insalata di gamberi? Probabilmente sì ma non avevate in mente come condirla per renderla davvero speciale! Non preoccupatevi, grazie ai nostri consigli scoprirete quanto è semplice realizzarne una davvero strepitosa! Intanto cominciamo dalla scelta degli ingredienti di accompagnamento, la frutta tropicale come mango e avocado, che ritroviamo spesso in sfiziose insalatone o ricette esotiche come il ceviche di gamberi. Stavolta però abbiamo deciso di combinarli insieme e il risultato ci ha convinti all'istante! Non vi resta che scoprire insieme a noi la ricetta dell'insalata di gamberi e stuzzicare così l'appetito dei vostri ospiti!\",\n 'cooking_time' => '25 Minuti',\n 'people' => 4,\n 'suggested' => '',\n 'category_id' => 2,\n 'img_path' => 'posts-cover/insalata-gamberi.jpg'\n ],\n [\n 'title' => 'Hummus',\n 'content' => \"Oggi faremo un salto nel Medio Oriente per presentarvi una delle ricette vegetariane veloci più conosciute: l’hummus. Molti paesi ne rivendicano la paternità, ma ancora ad oggi non se ne conosce esattamente l’origine. E' una delle preparazioni più antiche e diffusa nel tempo in tutti i paesi arabi, grazie alla semplicità dei suoi ingredienti. Una deliziosa crema, dal sapore molto particolare: delicato e aromatico, per la presenza dei ceci e della tahina, ma anche leggermente asprigno per l’aggiunta del succo di limone che conferisce il giusto equilibrio a questa ricetta. In questa versione abbiamo voluto rispolverare la tradizione antica, realizzando la tahina fatta in casa. Per l'occasione ci siamo armati di 'suribachi' e 'surikogi' con cui un tempo si realizzava la farina e che noi abbiamo usato per miscelare e pestare tutti gli ingredienti, per un fantastico e ancora più genuino hummus! Lasciatevi conquistare da questa pietanza molto versatile, utilizzata per accompagnare le felafel, o come crema da spalmare. Un pizzico di paprika affumicata e il vostro hummus andrà letteralmente a ruba durante vostri aperitivi!\",\n 'cooking_time' => '10 Minuti',\n 'people' => 6,\n 'suggested' => '',\n 'category_id' => 1,\n 'img_path' => 'posts-cover/hummus.jpg'\n ],\n [\n 'title' => 'Zuppa di mais',\n 'content' => \"La zuppa di mais è un primo piatto della cucina messicana dalla preparazione facile e veloce. Un comfort food adatto ai pasti quoditiani. Questa ricetta l'abbiamo realizzata insieme ad Antonieta Ruiz, signora messicana che vive da molti anni a Milano e che ci ha dato la sua versione, quella che prepara in famiglia.\n In questa ricetta abbiamo utilizzato un mix di mais giallo dolce precotto, quello che si trova comunemente al supermercato e dei chicchi di mais bianco sgranati da una pannocchia fresca. Visto che reperirla non è così scontato - si può trovare nei negozi etnici o in mercati che hanno anche frutta e verdura internazionale - la zuppa si può preparare anche con il solo mais giallo, in quantità di 600 grammi.\n La consistenza della zuppa può essere più o meno cremosa, a seconda dei gusti. Il piatto di base è vegetariano, ma può essere arricchito anche con della pancetta a cubetti e servito con tortillas o nachos. In questo caso abbiamo optato per delle tortillas di mais, tagliate a striscioline e fritte in padella, così da diventare irresistibilmente croccanti.\",\n 'cooking_time' => '35 Minuti',\n 'people' => 4,\n 'suggested' => '',\n 'category_id' => 3,\n 'img_path' => 'posts-cover/zuppa-mais.jpg'\n ]\n ];\n\n foreach ($posts as $post){\n $newPost = new Post();\n $newPost->title = $post['title'];\n $newPost->content = $post['content'];\n $newPost->cooking_time = $post['cooking_time'];\n $newPost->people = $post['people'];\n $newPost->suggested = $post['suggested'];\n $newPost->category_id = $post['category_id'];\n $newPost->img_path = $post['img_path'];\n //Questa funzione formatterà in automatico il title renendolo uno slug\n $newPost->slug = Str::slug($newPost->title, '-');\n $newPost->save();\n }\n }", "public function testSeeCreatePostTest()\n {\n $response = $this->actingAs(\\App\\User::firstOrFail())->get('/posts/create');\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function run(Faker $faker)\n {\n for ($i = 0; $i < 10; $i++) {\n $randomCategory = Category::inRandomOrder()->first();\n $title = $faker->sentence(4);\n\n $newPost = new Post;\n $newPost->category_id = $randomCategory->id;\n $newPost->title = $title;\n $newPost->slug = Str::slug($title);\n $newPost->content = $faker->text;\n\n $newPost->save();\n }\n }", "public function run()\n {\n // reset the posts table\n DB::table('posts')->truncate();\n \n //genrate 10 dummy posts data\n $posts = [];\n $faker = Factory::create();\n \n for ($i = 1; $i <= 10; $i++){\n $image = \"Post_Image_\" . rand(1,5) . \".jpg\";\n $posts[] = [\n 'excerpt' => $faker->text(rand(250, 300)),\n 'body' => $faker->paragraphs(rand(10, 15), true),\n 'image' => rand(0, 1) == 1? $image : NULL\n ];\n }\n }", "public function run()\n {\n factory(PostCategory::class, 5)->create()->each(function ($c) {\n $c->posts()->saveMany(\n factory(Post::class, 10)->make()\n );\n });\n\n factory(PostCategory::class)->create([\n 'title' => 'Test'\n ]);\n\n factory(Post::class)->create([\n 'title' => 'Um mercado seguro: invista em Cannabis Medicinal (TESTE)',\n 'image' => env('APP_URL').'/img/blog-1.png', \n 'post_category_id' => 6,\n ]);\n\n factory(Post::class)->create([\n 'title' => 'Você conhece o mercado da Cannabis Medicinal (TESTE)',\n 'image' => env('APP_URL').'/img/blog-2.png', \n 'post_category_id' => 6,\n ]);\n\n factory(Post::class)->create([\n 'title' => 'Como investir em commodities no mercado americano (TESTE)',\n 'image' => env('APP_URL').'/img/blog-3.png', \n 'post_category_id' => 6,\n ]);\n }", "public function testShouldReturnAllPosts(){\n $this->get(\"/api/v1/post\", []);\n $this->seeStatusCode(200);\n $this->seeJsonStructure([\n 'data' => ['*' =>\n [\n 'id_post',\n 'username',\n 'tanggal',\n 'caption'\n ]\n ]\n ]);\n }", "public function run() {\n\t\t$admin = App\\User::where('email', 'admin@example.com')->select('id')->first();\n\t\t//\n\t\t$faker = Faker\\Factory::create();\n\t\tfor ($i = 0; $i < 20; $i++) {\n\t\t\tApp\\Post::create([\n\t\t\t\t'user_id' => $admin->id,\n\t\t\t\t'title' => $faker->sentence,\n\t\t\t\t'content' => implode('', $faker->sentences(5)),\n\t\t\t\t'thumbnail_url' => 'https://unsplash.it/700/300?image='.$i,\n\t\t\t\t'status' => rand(1, 2),\n\t\t\t]);\n\t\t}\n\t}", "public function __construct() {\n $this->posts = array();\n }", "public function testSeeAllPostsTest()\n {\n $response = $this->get('/posts');\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n $response->assertSeeText('Next');\n }", "public function run()\n {\n $faker = Faker::create();\n\n $categoryIds = \\App\\Category::lists('id')->toArray();\n $tagIds = \\App\\Tag::lists('id')->toArray();\n\n foreach (range(1, 30) as $index) {\n\n $post = \\App\\Post::create([\n 'title' => $faker->title(),\n 'description' => $faker->sentence(),\n 'category_id' => $faker->randomElement($categoryIds),\n 'content' => $faker->paragraph()\n ]);\n\n $tags = $faker->randomElements($tagIds, 3);\n\n $post->tags()->sync($tags);\n\n }\n }", "public function run()\n {\n Tag::factory()\n ->count(5)\n ->hasPosts(3)\n ->create();\n }", "public function run()\n {\n $users = User::factory(10)->create();\n Post::factory(30)->state(new Sequence(fn () => ['author' => $users->random()],))->create();\n }", "public function run()\n {\n\n $faker= Faker\\Factory::create();\n $data=[];\n for($i=0;$i<10;$i++){\n $data[]=[\n 'title'=> $faker->word,\n 'body'=> $faker->text(250),\n 'id_user'=>1,\n 'created_at'=>date('Y-m-d H:i:s')\n ];\n }\n $this->insert('posts',$data);\n }", "public function run()\n {\n $author1 = User::where('email', 'user@gmail.com')->first();\n $author2 = User::where('email', 'admin@gmail.com')->first();\n $faker = Faker\\Factory::create();\n for ($i = 0; $i < 10; $i++) {\n $title = $faker->sentence($nbWords = 6, $variableNbWords = true);\n $post = Category::create([\n 'title' => $title,\n 'description' => $faker->text($maxNbChars = 100),\n 'status' => rand(0, 1),\n 'user_id' => $author1->id\n ]);\n $title = $faker->sentence($nbWords = 6, $variableNbWords = true);\n $post = Category::create([\n 'title' => $title,\n 'description' => $faker->text($maxNbChars = 100),\n 'status' => rand(0, 1),\n 'user_id' => $author2->id\n ]);\n }\n }", "public function run()\n {\n $allUsers = User::all();\n if ($allUsers->isEmpty()) {\n User::factory()->count(5)->create();\n $allUsers = User::all();\n }\n\n $allTags = Tag::all();\n if ($allTags->isEmpty()) {\n Tag::factory()->count(30)->create();\n $allTags = Tag::all();\n }\n\n\n Post::factory()\n ->count(10)\n ->hasImage()\n ->afterCreating(function (Post $post) use ($allTags, $allUsers) {\n $myTags = $allTags->random(rand(0, 5))->pluck('id');\n $post->tags()->sync($myTags);\n $post->user()->associate($allUsers->random(1)->first());\n $post->user()->associate(User::find(1));\n $post->save();\n })\n ->create();\n }", "public function run()\n {\n factory(Post::class, 100)\n ->create()\n ->each(function(Post $post) {\n $post->comments()->saveMany(\n factory(\\App\\Comment::class, rand(0, 10))->make()\n );\n });\n\n// for ($i = 0; $i < 10; $i++) {\n// $post = new Post;\n// $post->name = 'Title no. ' . ($i + 1);\n// $post->content = 'Post content ' . Str::random(100);\n// $post->save();\n// }\n }", "public function run()\n {\n //rest post table\n DB::table('posts')->truncate();\n\n // generate 10 dummy posts\n $posts = [];\n $faker = Factory::create();\n for ($i=1; $i <=10 ; $i++) { \n $image = 'Post_image_' . rand(1,5) . '.jpg';\n $category_id = rand(1, 5);\n $posts[] = [\n 'author_id' => rand(1,3),\n 'title' => $faker->sentence(rand(8,12)),\n 'excerpt' => $faker->text(rand(250,300)),\n 'description' => $faker->paragraphs(rand(10,15),true),\n 'slug' => $faker->slug(),\n 'image' => rand(0,1) == 1 ? $image : Null,\n 'category_id' => $category_id,\n 'view_count' => rand(1,10) * 10\n ];\n }\n DB::table('posts')->insert($posts);\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n\n\n $post = factory(App\\Post::class, 20)->create([\n 'title' => $faker->title,\n 'body' => $faker->text,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n $categories = \\App\\Models\\Category::factory()->count(10)->create();\n\n $tags = \\App\\Models\\Tag::factory()->count(100)->create();\n\n $posts = Post::factory()->count(10)->make(['category_id' => null]);\n\n $posts->each(function (Post $post) use ($categories) {\n $post->category()->associate($categories->random());\n $post->save();\n });\n\n $posts->each(function (Post $post) use ($tags) {\n $post->tags()->attach($tags->random(rand(3, 5))->pluck('id'));\n });\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 7; $i++) {\n $post = new Post;\n $post->title = $faker->realText($maxNbChars = 20, $indexSize = 1);\n $post->author = $faker->name;\n $post->description = $faker->realText($maxNbChars = 400, $indexSize = 2);\n $post->img = $faker->imageUrl();\n\n $post->save();\n }\n }", "public function generatePosts()\n {\n if (request('quantityOfPosts') > 50) {\n return 'Du kannst maximal 50 Posts generieren lassen';\n }\n Post::factory()->count(request('quantityOfPosts'))->create();\n return redirect()->back();\n }", "public function run(Faker $faker)\n {\n /* Usiamo FAKER per risultati random */\n for($count = 0; $count < 5; $count++) {\n $new_post = new Post();\n $new_post->title = $faker->words(4, true);\n $new_post->content = $faker->paragraphs(4, true);\n $new_post->slug = Str::slug($new_post->title, '-');\n $new_post->save();\n }\n }", "public function run()\n {\n Post::all()->each(function ($post){\n Image::factory()->times(rand(0,5))->create(['post_id' => $post->id]);\n\n// $image = Image::factory()->make();\n// $image->post_id = $post->id;\n// $image->save();\n });\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create('ru_RU');\n for ($i = 1; $i <= 10; $i++) {\n $form = collect([\n 'title' => $faker->text(64),\n 'description' => $faker->text(200),\n 'user_id' => 1,\n ]);\n $post = \\App\\Eloquent\\Posts::create($form->toArray());\n\n for ($b = 1; $b <= 4; $b++) {\n $id = $faker->biasedNumberBetween(1, 10);\n $pt = \\App\\Eloquent\\PostTags::where('post_id', $post->id)->where('tag_id', $id)->first();\n if (!$pt) {\n $form = collect([\n 'post_id' => $post->id,\n 'tag_id' => $id\n ]);\n \\App\\Eloquent\\PostTags::create($form->toArray());\n }\n }\n }\n }", "public function run()\n {\n $brands = Brand::pluck('id')->toArray();\n $faker = Faker\\Factory::create();\n foreach($brands as $brand){\n Post::create([\n \"title\" => $faker->name,\n \"description\" => $faker->text(250),\n \"content\" => $faker->text(500),\n \"brand_id\" => $brand,\n ]);\n }\n }", "public function run()\n {\n for ($i = 1; $i < 20; $i++) {\n Post::create([\n 'user_id' => rand(1,19),\n 'title' => \"Post title {$i}\",\n 'content' => Str::random(50),\n 'is_active' => rand(0,1)\n ]);\n }\n }", "public function run()\n {\n factory(\\Modules\\Posts\\Entities\\Post::class, 100)->create();\n }", "public function run(Faker $faker)\n {\n \n for ($i=0; $i < 100; $i++) { \n $newPost = new Post();\n $newPost->title = $faker->word(3);\n $newPost->body = $faker->text(300);\n $newPost->save();\n }\n \n\n }", "public function definition()\n {\n // $users = collect(User::where('id','>',2)->get()->modelKeys());\n // $posts = collect(Post::wherePostType('post')->whereStatus(1)->whereCommentAble(1)->get());\n // $id = $posts->random()->id;\n // $created_at = $posts->where('id',$id)->first()->created_at->timestamp;\n // $current_date = Carbon::now()->timestamp;\n // $created_at = date('Y-m-d H:i:s',rand($created_at,$current_date));\n // return [\n // 'name'=>$this->faker->name,\n // 'email'=>$this->faker->email,\n // 'url'=>$this->faker->url,\n // 'ip_address'=>$this->faker->ipv4,\n // 'comment'=>$this->faker->paragraph(2,true),\n // 'status'=>rand(0,1),\n // 'post_id'=>$id,\n // 'user_id'=>$users->random(),\n // 'created_at'=>$created_at,\n // 'updated_at'=>$created_at,\n // ];\n\n return [\n 'name'=>$this->faker->name,\n 'email'=>$this->faker->email,\n 'url'=>$this->faker->url,\n 'ip_address'=>$this->faker->ipv4,\n 'comment'=>$this->faker->paragraph(2,true),\n 'status'=>rand(0,1),\n // 'post_id'=>$id,\n // 'user_id'=>$users->random(),\n // 'created_at'=>$created_at,\n // 'updated_at'=>$created_at,\n ];\n }", "public function run()\n {\n $faker = FakerFactory::create();\n for ($i = 0; $i < 30; $i++) {\n\n Product::create([\n 'title' => $faker->sentence(5),\n 'slug' => $faker->slug,\n 'subtitle' => $faker->sentence(4),\n 'price' => $faker->numberBetween(15, 300) * 100,\n 'description'=>$faker->text ,\n // 'image' => 'https://via.placeholder.com/200×250' \n 'image'=> 'https://picsum.photos/200/300?random='.$faker->numberBetween(1,200)\n\n ])->categories()->attach([\n rand(1,4),\n rand(1,4)\n ]);\n }\n }", "public function run()\n {\n factory(Post::class, 25)->create()->each(function ($post) {\n $post->tags()->attach(factory(Tag::class, 2)->create());\n });\n }", "public function testPost()\n {\n try {\n $category = factory(Category::class)->create();\n } catch (\\Exception $e) {\n $this->assertTrue(false);\n }\n\n /**\n * |-------------------------------------------\n * | Creation of an post\n * |-------------------------------------------\n */\n try {\n factory(Post::class)->create([\n 'category_id' => $category->id\n ]);\n } catch (\\Exception $e) {\n $this->assertTrue(false);\n }\n\n $this->assertEquals($category->name, (Post::find(1)->category)->name);\n\n }", "public function run()\n {\n $authors = App\\Author::all();\n $subcategories = App\\Category::all();\n\n\n $tags = App\\Tag::all();\n factory(App\\Book::class, 100)\n ->create()\n ->each(function($b) use ($tags, $subcategories, $authors) {\n if(rand(0,1)===0){\n $b->authors()->sync($authors[rand(0,count($authors)-1)]);\n }\n else{\n $b->authors()->sync($authors[rand(0,count($authors)-1)]);\n $b->authors()->sync($authors[rand(0,count($authors)-1)]);\n }\n\n\n if(rand(0,1)===0){\n $b->categories()->sync($subcategories[rand(0,count($subcategories)-1)]);\n }\n else{\n $b->categories()->sync($subcategories[rand(0,count($subcategories)-1)]);\n $b->categories()->sync($subcategories[rand(0,count($subcategories)-1)]);\n }\n\n if(rand(0,1)===0){\n $b->tags()->sync($tags[rand(0,count($tags)-1)]);\n }\n else{\n $b->tags()->sync($tags[rand(0,count($tags)-1)]);\n $b->tags()->sync($tags[rand(0,count($tags)-1)]);\n }\n\n\n\n\n\n });\n \n }", "function random_featured_items($count = 5, $hasImage = null)\n{\n $items = get_random_featured_items($count, $hasImage);\n if ($items) {\n $html = '';\n foreach ($items as $item) {\n $html .= get_view()->partial('items/single.php', array('item' => $item));\n release_object($item);\n }\n } else {\n $html = '<p>' . __('No featured items are available.') . '</p>';\n }\n return $html;\n}", "public function run()\n {\n $faker = Faker::create();\n foreach (range(1, 100) as $index) {\n Post::create([\n 'user_id' => 1,\n 'title' => $faker->sentence(4),\n 'body' => $faker->paragraph(4),\n ]);\n }\n }", "public function run()\n {\n $faker = Factory::create();\n Post::create([\n 'title'=>'About Us',\n 'body'=>$faker->paragraph(),\n 'status'=>1,\n 'comment_able'=>1,\n 'post_type'=>'page',\n 'user_id'=>1,\n 'category_id'=>1,\n ]);\n\n Post::create([\n 'title'=>'Our Vision',\n 'body'=>$faker->paragraph(),\n 'status'=>1,\n 'comment_able'=>1,\n 'post_type'=>'page',\n 'user_id'=>1,\n 'category_id'=>1,\n ]);\n\n\n Post::create([\n 'title'=>'Contact Us',\n 'body'=>$faker->paragraph(),\n 'status'=>1,\n 'comment_able'=>1,\n 'post_type'=>'page',\n 'user_id'=>1,\n 'category_id'=>1,\n ]);\n }", "public function run()\n {\n $client = new Client();\n $crawler = $client->request('GET', 'https://medium.com/topics');\n $topics = $crawler->filter('.u-flexColumn.u-flex0 a:first-child')->each(function ($node) {\n return $node->attr('href');\n });\n\n foreach ($topics as $topic) {\n $client = new Client();\n $crawler = $client->request('GET', $topic);\n $posts = $crawler->filter('div.u-flex0.u-sizeFullWidth a')->each(function ($node) {\n return $node->attr('href');\n });\n\n foreach ($posts as $post) {\n $client = new Client();\n $crawler = $client->request('GET', $post);\n $title = $crawler->filter('.section-inner h1')->each(function ($node) {\n return $node->text();\n });\n $body = $crawler->filter('.section-inner p')->each(function ($node) {\n return $node->text();\n });\n $image = $crawler->filter('.section-inner img')->each(function ($node) {\n return $node->attr('src');\n });\n\n $array = array($title, $image);\n $key = array_column($array, 0);\n $textTitle = $key[0];\n\n $arrayBody = array();\n foreach ($body as $value) {\n $arrayBody [] = '<p>'.$value.'</p>';\n }\n $textBody = implode('', $arrayBody);\n\n if (empty($textTitle) || empty($textBody) || Post::where('title', '=', $textTitle)->first() || empty($key[1])) {\n break;\n } else {\n $file = file_get_contents($key[1]);\n if (pathinfo($key[1], PATHINFO_EXTENSION)) {\n $extension = pathinfo($key[1], PATHINFO_EXTENSION);\n } else {\n $extension = 'jpg';\n }\n $fileName = time() . '_' . str_random(9) . '.' . $extension;\n File::put(public_path('storage/posts/') . $fileName, $file); \n }\n\n $posts = array();\n $faker = Faker::create();\n $timestamps = Carbon\\Carbon::now();\n $userId = \\App\\User::inRandomOrder()->select('id')->first();\n $topicId = \\App\\Topic::inRandomOrder()->select('id')->first();\n\n $posts [] = [\n 'id' => $faker->uuid,\n 'user_id' => $userId['id'],\n 'topic_id' => $topicId['id'],\n 'title' => $textTitle,\n 'slug' => str_slug($textTitle),\n 'body' => $textBody,\n 'image' => $fileName,\n 'view' => rand(1, 9000),\n 'created_at' => $timestamps,\n 'updated_at' => $timestamps\n ];\n \n Post::insert($posts);\n }\n }\n }", "public function run()\n {\n $faker = Faker\\Factory::create('fr_FR');\n\n foreach (User::all() as $user) {\n foreach (Category::all() as $category) {\n for ($i = 0; $i < 5; $i++) {\n $name = $faker->sentence(random_int(5, 10));\n\n Post::create([\n 'user_id' => $user->id,\n 'category_id' => $category->id,\n 'name' => $name,\n 'slug' => Str::slug($name),\n 'content' => $faker->realText(1000),\n 'created' => $faker->dateTime->format('Y-m-d H:i:s'),\n ]);\n }\n }\n }\n }", "public function run()\n {\n for($i = 1; $i <= 10; $i++) {\n\n $newPost = new Post();\n\n $newPost->title = 'Articolo ' . $i;\n $newPost->slug = Str::slug($newPost->title, '-');\n $newPost->content = 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Placeat repellendus esse ratione saepe hic reiciendis quibusdam maxime amet corrupti vel tempore provident corporis, non reprehenderit laudantium mollitia magnam possimus iste id perferendis sunt. Nulla doloremque vel recusandae architecto voluptatum magni corrupti et. Voluptatem recusandae beatae aspernatur blanditiis commodi? Adipisci vero rem cupiditate aliquid fugit iste, quod perspiciatis eveniet tempora labore, iusto minima similique harum cumque. Ab sapiente omnis ullam accusamus mollitia tempore tempora, aut quaerat rem optio nam delectus placeat odio officiis non voluptatum ratione, esse commodi quidem consequatur repudiandae, quod perferendis? Molestiae nemo dolorum culpa delectus itaque quis earum?';\n $newPost->save();\n }\n }", "public function run()\n {\n\n $faker = Faker\\Factory::create();\n\n for($i = 0; $i < 50; $i++){\n $newPost = new Post();\n\n $newPost->title = $faker->sentence;\n $newPost->author = $faker->name;\n $newPost->category_id = $faker->numberBetween(1, 10);\n\n $newPost->save();\n\n $postId = $newPost->id;\n\n $newPostInformation = new PostInformation();\n\n $newPostInformation->description = $faker->paragraph;\n $newPostInformation->slug = Str::slug($newPost->title, '-');\n $newPostInformation->post_id = $postId;\n\n $newPostInformation->save();\n\n }\n }", "public function run()\n {\n /** @var \\Illuminate\\Database\\Eloquent\\Collection $categories */\n $categories = \\App\\Models\\Category::all();\n\n factory(\\App\\Models\\Post::class, 50)\n ->create()\n ->each(function(\\App\\Models\\Post $post) use($categories){\n $categoriesAttach = $categories->random(2);\n $post->categories()->sync($categoriesAttach);\n });\n }", "public function run()\n {\n factory('App\\Product', 30)->create()->each(function ($product) {\n $product->categories()->attach([\n rand(1, 4),\n rand(1, 4),\n ]);\n });\n }", "public function run()\n {\n factory(Post::class,50) -> make() -> each(function($post){\n $employee = Employee::inRandomOrder() -> first();\n $post -> employee()->associate($employee);\n $post ->save();\n\n\n });\n }", "public function run()\n {\n factory(App\\Post::class, 50)\n ->create()\n ->each(function ($post) {\n $post->comments()->saveMany(\n factory(App\\Comment::class, mt_rand(1, 10))->make()\n );\n });\n }", "public function definition()\n {\n $faker_ru = Faker::create('ru_RU');\n $title = $this->faker->unique()->text(40);\n $description = \"\";\n $preview_text = \"\";\n\n $count_p = rand(2, 10);\n $date = $this->faker->dateTimeBetween('-4 months', '-2 months');\n $user_id = 1;\n $is_published = rand(0, 10) > 2;\n\n for ($i = 0; $i <= $count_p; $i++) {\n $random_length_text = rand(200, 500);\n // $random_text = $this->faker->text($random_length_text);\n $random_text = $faker_ru->text($random_length_text);\n $preview_text = strlen($random_text) <= 240 ? $random_text : substr($random_text, 0, 240);\n $description .= \"<p>{$random_text}<p>\";\n }\n\n $random_image_file = null;\n if (rand(0, 10) >= 2) {\n $files = scandir(public_path() . '\\upload');\n $random_image_file = $files[rand(2, count($files) - 1)];\n if($random_image_file === \"no-image.jpg\") {\n $random_image_file = null;\n }\n }\n\n $publication = [\n 'slug' => Str::slug($title),\n 'title' => $title,\n 'description' => $description,\n 'is_published' => $is_published,\n 'published_at' => $is_published ? $date : null,\n 'created_at' => $date,\n 'updated_at' => $date,\n 'user_id' => $user_id,\n 'preview_text' => $preview_text,\n 'preview_image' => $random_image_file\n ];\n\n return $publication;\n }", "public function run()\n {\n $products = Product::inRandomOrder()->get();\n\n factory('App\\Category', 5)->create()\n ->map(function($category) use ($products) {\n $category->products()\n ->sync($products->take(rand(4, 10)));\n });\n }", "public function run()\n {\n $faker = Faker::create();\n for( $i = 0; $i <5 ; $i++){\n $time = new DateTime();\n $post = new Post();\n $post->title = $faker->sentence;\n $post->slug = str_slug($post->title).\"-\".$time->getTimestamp();\n $post->content = $faker->paragraph(20);\n $post->type = \"dich-vu\";\n $post->typeName = \"Dịch vụ\";\n $post->username = 'admin';\n $post->save();\n }\n for( $i = 0; $i <5 ; $i++){\n $time = new DateTime();\n $post = new Post();\n $post->title = $faker->sentence;\n $post->slug = str_slug($post->title).\"-\".$time->getTimestamp();\n $post->content = $faker->paragraph(20);\n $post->type = \"du-an\";\n $post->typeName = \"Dự án\";\n $post->username = 'admin';\n $post->save();\n }\n for( $i = 0; $i <5 ; $i++){\n $time = new DateTime();\n $post = new Post();\n $post->title = $faker->sentence;\n $post->slug = str_slug($post->title).\"-\".$time->getTimestamp();\n $post->content = $faker->paragraph(20);\n $post->type = \"doi-tac\";\n $post->typeName = \"Đối tác\";\n $post->username = 'admin';\n $post->save();\n }\n for( $i = 0; $i <5 ; $i++){\n $time = new DateTime();\n $post = new Post();\n $post->title = $faker->sentence;\n $post->slug = str_slug($post->title).\"-\".$time->getTimestamp();\n $post->content = $faker->paragraph(20);\n $post->type = \"tuyen-dung\";\n $post->typeName = \"Tuyển dụng\";\n $post->username = 'admin';\n $post->save();\n }\n for( $i = 0; $i <5 ; $i++){\n $time = new DateTime();\n $post = new Post();\n $post->title = $faker->sentence;\n $post->slug = str_slug($post->title).\"-\".$time->getTimestamp();\n $post->content = $faker->paragraph(20);\n $post->type = \"tin-tuc\";\n $post->typeName = \"Tin tức\";\n $post->username = 'admin';\n $post->save();\n }\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n factory(\\App\\Post::class, 50)->create()->each(function(\\App\\Post $post) use ($faker) {\n $post->image_url = url('images/' . $this->images[$faker->numberBetween(0, 8)]);\n $post->user_id = $faker->numberBetween(1, \\App\\User::count());\n $post->available = $faker->numberBetween(0, 1);\n $post->save();\n });\n }", "public function run()\n {\n $post = new Post();\n $post->thread_id = 1;\n $post->user_id = 1;\n $post->post_comment = \"Test Post Comment\";\n $post->edited_by = \" \";\n \n $post->save();\n // $post->tags()->attach(1);\n // $post->tags()->attach(12);\n // $post->tags()->attach(16);\n \n // Generate random data\n factory(App\\Post::class, 500)->create();\n\n $tags = App\\Tag::all();\n // Generate random data\n App\\Post::all()->each(function ($post) use ($tags){\n $post->tags()->attach( $tags->random(rand(1, 4))->pluck('id')->toArray()\n );\n });\n \n }", "public function run()\n {\n $count = 25;\n\n for ($i = 0; $i < $count; $i++) {\n $entity = Entity::create ([\n 'entity_type' => 'post',\n ]);\n Post::create ([\n 'id' => $entity->id,\n 'title' => 'Test post title'.$i,\n 'body' => 'Test post body '.$i,\n 'user_id' => 1,\n 'cover_image' => 'noimage.jpg',\n 'created_at' => Carbon::now()->addSeconds($i*2),\n ]);\n }\n }", "public function run()\n {\n $faker = Faker::create('App\\Post');\n\n for($i=0; $i<=22; $i++) {\n DB::table('posts')->insert([\n 'title' => $faker->text(30),\n 'body' => implode($faker->paragraphs(rand(18,28))),\n 'slug' => $faker->slug,\n 'created_at' => \\Carbon\\Carbon::now(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n ]);\n }\n\n }", "public function index( )\n {\n $faker = \\Faker\\Factory::create();\n\n $posts = array();\n for( $i = 0 ; $i < 8 ; $i++ )\n {\n $post = new StdClass;\n $post->thumbnail = $faker->imageUrl(242, 200);\n $post->title = $faker->sentence(4);\n $post->text = $faker->realText($faker->numberBetween(170,180));\n $posts[] = $post;\n }\n\n return view( 'pages.post', compact('posts') );\n }", "public function test_posts_indexing() {\n global $DB;\n\n // Returns the instance as long as the area is supported.\n $searcharea = \\core_search\\manager::get_search_area($this->forumpostareaid);\n $this->assertInstanceOf('\\mod_forum\\search\\post', $searcharea);\n\n $user1 = self::getDataGenerator()->create_user();\n $user2 = self::getDataGenerator()->create_user();\n\n $course1 = self::getDataGenerator()->create_course();\n $course2 = self::getDataGenerator()->create_course();\n\n $this->getDataGenerator()->enrol_user($user1->id, $course1->id, 'student');\n $this->getDataGenerator()->enrol_user($user2->id, $course1->id, 'student');\n\n $record = new stdClass();\n $record->course = $course1->id;\n\n // Available for both student and teacher.\n $forum1 = self::getDataGenerator()->create_module('forum', $record);\n\n // Create discussion1.\n $record = new stdClass();\n $record->course = $course1->id;\n $record->userid = $user1->id;\n $record->forum = $forum1->id;\n $record->message = 'discussion';\n $discussion1 = self::getDataGenerator()->get_plugin_generator('mod_forum')->create_discussion($record);\n\n // Create post1 in discussion1.\n $record = new stdClass();\n $record->discussion = $discussion1->id;\n $record->parent = $discussion1->firstpost;\n $record->userid = $user2->id;\n $record->message = 'post2';\n $discussion1reply1 = self::getDataGenerator()->get_plugin_generator('mod_forum')->create_post($record);\n\n // All records.\n $recordset = $searcharea->get_recordset_by_timestamp(0);\n $this->assertTrue($recordset->valid());\n $nrecords = 0;\n foreach ($recordset as $record) {\n $this->assertInstanceOf('stdClass', $record);\n $doc = $searcharea->get_document($record);\n $this->assertInstanceOf('\\core_search\\document', $doc);\n\n // Static caches are working.\n $dbreads = $DB->perf_get_reads();\n $doc = $searcharea->get_document($record);\n $this->assertEquals($dbreads, $DB->perf_get_reads());\n $this->assertInstanceOf('\\core_search\\document', $doc);\n $nrecords++;\n }\n // If there would be an error/failure in the foreach above the recordset would be closed on shutdown.\n $recordset->close();\n $this->assertEquals(2, $nrecords);\n\n // The +2 is to prevent race conditions.\n $recordset = $searcharea->get_recordset_by_timestamp(time() + 2);\n\n // No new records.\n $this->assertFalse($recordset->valid());\n $recordset->close();\n\n // Context test: create another forum with 1 post.\n $forum2 = self::getDataGenerator()->create_module('forum', ['course' => $course1->id]);\n $record = new stdClass();\n $record->course = $course1->id;\n $record->userid = $user1->id;\n $record->forum = $forum2->id;\n $record->message = 'discussion';\n self::getDataGenerator()->get_plugin_generator('mod_forum')->create_discussion($record);\n\n // Test indexing with each forum then combined course context.\n $rs = $searcharea->get_document_recordset(0, context_module::instance($forum1->cmid));\n $this->assertEquals(2, iterator_count($rs));\n $rs->close();\n $rs = $searcharea->get_document_recordset(0, context_module::instance($forum2->cmid));\n $this->assertEquals(1, iterator_count($rs));\n $rs->close();\n $rs = $searcharea->get_document_recordset(0, context_course::instance($course1->id));\n $this->assertEquals(3, iterator_count($rs));\n $rs->close();\n }", "public function run()\n {\n\n\t $faker = Faker::create();\n\t foreach (range(1,10) as $index) {\n\t\t DB::table('posts')->insert([\n\t\t\t 'post_title' => $faker->realText($maxNbChars = 50, $indexSize = 2),\n\t\t\t 'post_content' => $faker->realText($maxNbChars = 1000, $indexSize = 2),\n\t\t\t 'created_at' => $faker->dateTimeBetween($startDate = '-5 years', $endDate = 'now')\n\t\t ]);\n\t }\n\n }", "public function run()\n {\n factory(\\App\\News::class, rand(25, 55))->create()->each(function (\\App\\News $post) {\n $tagsIds = \\App\\Tag::takeRandom(rand(2, 5))->get('id');\n $post->tags()->sync($tagsIds);\n $post->comments()->saveMany(factory(\\App\\Comment::class, rand(3, 7))->make());\n });\n }", "public function run()\n {\n \tfor ($i=0; $i < 10 ; $i++) { \n \t\tArticles::create([\n \t\t\t\"title\"=> Str::random(10).$i,\n \t\t\t\"content\"=> $i . Str::random(10)\n \t\t]);\n \t}\n }", "public function run()\n {\n factory(User::class, 10)->create();\n factory(Thread::class, 50)->create()->each(function ($thread){\n for ($i=0; $i<rand(0, 20); $i++) {\n $rand_user = User::inRandomOrder()->first();\n factory(Post::class, 1)->create(\n ['thread_id' => $thread->id, 'user_id' => $rand_user->id]);\n }\n });\n }", "public function run()\n {\n //\n $faker = Factory::create('es_ES'); // create a Spanish faker\n \n $posts = Guia::all();\n \n $users = User::inRandomOrder()->limit(rand(3, 7))->get();\n \n foreach ($posts as $post) {\n \n\n foreach ($users as $user) {\n Comment::create([\n 'comment' => $faker->sentence(rand(6, 20)),\n 'guia_id' => $post->id,\n 'user_id' => $user->id\n ]);\n }\n }\n }", "public function run()\n {\n Post::truncate();\n factory(Post::class, 10)->create(); //create random posts\n\n //attach Tags to posts\n $posts = Post::all();\n foreach ($posts as $post) {\n $tags = Tag::where('id', '>', rand(0, 6))->take(rand(0,3))->get();\n $post->tags()->saveMany($tags);\n }\n }", "public function run(Faker $faker)\n {\n\n\n for ($i = 0; $i < 5; $i++){\n\n $image_name = Str::random(40) . '.jpg';\n\n $newPost = new Post();\n\n $newPost->title = $faker->sentence();\n $newPost->slug = $slug = Str::slug($newPost->title, '-');\n $newPost->content = $faker-> text();\n $newPost->public = $faker->boolean();\n $newPost->date = $faker->date(); \n\n if ( $this->saveRandomImage('public/storage/images/' . $image_name) ) {\n $newPost->image = 'images/' . $image_name;\n }\n \n $newPost->save();\n }\n\n }", "public function run(Faker $faker)\n {\n for ($i = 0; $i < 20; $i++) {\n $new_post = new Post();\n $new_post->title = $faker->sentence();\n $new_post->author = $faker->name();\n $new_post->text = $faker->text(1000);\n $new_post->save();\n }\n }", "public function run()\n {\n $faker =Faker::create();\n for ($i=0; $i < 30 ; $i++) {\n $new_post = new Post();\n\n // parte del faker commentata.\n\n // $new_post->title = $faker->sentence();\n // $new_post->content = $faker->text(2000);\n // $new_post->author = $faker->firstName . ' ' . $faker->lastName;\n // $new_post->slug = Str::slug($new_post->title);\n\n $titulo = $faker->sentence();\n // fill richiede array di dati:\n $dati_post =[\n 'title'=> $titulo,\n 'content'=> $faker->text(2000),\n 'author'=> $faker->firstName . ' ' . $faker->lastName,\n 'slug'=> Str::slug($titulo)\n ];\n $new_post->fill($dati_post);\n $new_post->save();\n // PER FAR PARTIRE IL SEED FACCIO DA PROMPT : PHP ARTISAN DB:SEED\n }\n }", "public function run()\n {\n $productsCount = (int)$this->command->ask('How many posts would you like?', 120);\n $categories = Category::all();\n\n Product::factory($productsCount)->make()->each(function($product) use ($categories) { \n $faker = Factory::create();\n $product->category_id = $categories->random()->id;\n $category = Category::where('id', $product->category_id)->first();\n\n $product->preview_image = $faker->image('public/images', 690, 690, strtoupper($category->name), false, false, $product->name, true);\n $product->save();\n });\n }", "public function run()\n {\n for ($i=0; $i < 10; $i++) { \n \n $new_post = new Post();\n $new_post->title = \"Titolo post \".($i + 1); \n $new_post->slug = Str::slug($new_post->title, '-');\n $new_post->content = ($i + 1) . \" Lorem ipsum dolor sit amet consectetur adipisicing elit. Dignissimos assumenda eos dolore minus cumque vel quaerat omnis sapiente? Repellendus similique mollitia ad quod cupiditate praesentium a quas unde adipisci ut.\"; \n $new_post->save(); \n }\n }", "public function testGetAllPosts() : void {\n $expected = 0;\n $this->assertEquals($expected, count($this->dataManager->getAllPosts(PostType::Page)));\n }", "public function run()\n {\n $faker = Factory::create();\n\n for ($i=0; $i < 10; $i++) { \n # code...\n Topic::create([\n 'name' => $faker->name,\n 'description' => $faker->sentence(),\n 'image' => $faker->imageUrl(300, 300, 'topic'.$i),\n ]);\n }\n }" ]
[ "0.70400953", "0.6592865", "0.6346125", "0.627272", "0.62547296", "0.6215031", "0.6163028", "0.616032", "0.60183364", "0.60179716", "0.5968055", "0.59449637", "0.59403133", "0.5887402", "0.58600533", "0.5852678", "0.58472747", "0.5838907", "0.5835784", "0.5830114", "0.581949", "0.5812681", "0.5811688", "0.5799507", "0.57948893", "0.5785108", "0.5755166", "0.574851", "0.5740906", "0.57404065", "0.5737666", "0.5735996", "0.5721402", "0.57095796", "0.5708959", "0.5708329", "0.5704304", "0.57026124", "0.5699534", "0.56812495", "0.5678925", "0.5674014", "0.5673657", "0.56518126", "0.5645239", "0.56440747", "0.56428444", "0.5640052", "0.56347656", "0.56330645", "0.5631068", "0.56290436", "0.56264406", "0.5623983", "0.56133723", "0.5607708", "0.560421", "0.559594", "0.5592903", "0.5572712", "0.55687594", "0.5566866", "0.55609643", "0.5555412", "0.55540484", "0.5552972", "0.5548479", "0.5540359", "0.5539989", "0.55398357", "0.55358565", "0.55246305", "0.5512306", "0.5504002", "0.55025667", "0.5495887", "0.5491608", "0.5490172", "0.54782796", "0.5474451", "0.54741424", "0.5462141", "0.5461113", "0.54586273", "0.5453059", "0.54509145", "0.54472667", "0.54401076", "0.54369724", "0.5436381", "0.5413008", "0.5411049", "0.5410453", "0.5403571", "0.54008204", "0.53981817", "0.539365", "0.53919613", "0.5390833", "0.5386667" ]
0.8144884
0
Creates post and makes it published if needed
protected function createPost($index, $published = TRUE) { $post = new Post(); $post->title = 'Some title ' . $index; $post->slug = 'some_slug_' . $index; $post->content = 'Post content ' . $index; if ($published) { $post->published = TRUE; // make it 10 seconds ago because isPublished() scope use '<' for comparison $post->published_at = Carbon::createFromTimestamp(time() - 10); } $post->save(); return $post; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function publish() {\n if($this->exists) {\n $post = Post::create($this->getDraftData());\n $this->delete();\n return $post;\n }\n }", "public function publish(Post $post){\n $this->posts()->save($post);\n }", "public function createPost()\n {\n if ($this->issetPostSperglobal('title') &&\n $this->issetPostSperglobal('description') &&\n $this->issetPostSperglobal('content') &&\n $this->issetPostSperglobal('categorie') &&\n $this->issetPostSperglobal('publish'))\n {\n $empty_field = 0;\n foreach ($_POST as $key => $post) {\n if ($key !== 'publish' && empty(trim($post))) {\n $empty_field++;\n }\n }\n if ($empty_field === 0) {\n $User = $this->session->read('User');\n $this->posts_manager->create($_POST, $User->getIdUser());\n $this->session->writeFlash('success', \"L'article a été créé avec succès.\");\n $this->redirect('dashboard');\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont vides.\");\n }\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont manquants.\");\n }\n $_post = $this->getSpecificPost($_POST);\n $categories = $this->categories_manager->listAll();\n $this->render('admin_post', ['head'=>['title'=>'Création d\\'un article', 'meta_description'=>''], 'categories'=>$categories, '_post'=>isset($_post) ? $_post : ''], 'admin');\n }", "public function get_publish( $template = 'publish' )\n\t{\n\t\t$extract = $this->handler_vars->filter_keys( 'id', 'content_type_name' );\n\t\tforeach ( $extract as $key => $value ) {\n\t\t\t$$key = $value;\n\t\t}\n\t\t$content_type = Post::type($content_type_name);\n\n\t\t// 0 is what's assigned to new posts\n\t\tif ( isset( $id ) && ( $id != 0 ) ) {\n\t\t\t$post = Post::get( array( 'id' => $id, 'status' => Post::status( 'any' ) ) );\n\t\t\tPlugins::act('admin_publish_post', $post);\n\t\t\tif ( !$post ) {\n\t\t\t\tSession::error( _t( \"You don't have permission to edit that post\" ) );\n\t\t\t\t$this->get_blank();\n\t\t\t}\n\t\t\tif ( ! ACL::access_check( $post->get_access(), 'edit' ) ) {\n\t\t\t\tSession::error( _t( \"You don't have permission to edit that post\" ) );\n\t\t\t\t$this->get_blank();\n\t\t\t}\n\t\t\t$this->theme->post = $post;\n\t\t}\n\t\telse {\n\t\t\t$post = new Post();\n\t\t\tPlugins::act('admin_publish_post', $post);\n\t\t\t$this->theme->post = $post;\n\t\t\t$post->content_type = Post::type( ( isset( $content_type ) ) ? $content_type : 'entry' );\n\n\t\t\t// check the user can create new posts of the set type.\n\t\t\t$user = User::identify();\n\t\t\t$type = 'post_' . Post::type_name( $post->content_type );\n\t\t\tif ( ACL::user_cannot( $user, $type ) || ( ! ACL::user_can( $user, 'post_any', 'create' ) && ! ACL::user_can( $user, $type, 'create' ) ) ) {\n\t\t\t\tSession::error( _t( 'Access to create posts of type %s is denied', array( Post::type_name( $post->content_type ) ) ) );\n\t\t\t\t$this->get_blank();\n\t\t\t}\n\t\t}\n\n\t\t$this->theme->admin_page = _t( 'Publish %s', array( Plugins::filter( 'post_type_display', Post::type_name( $post->content_type ), 'singular' ) ) );\n\t\t$this->theme->admin_title = _t( 'Publish %s', array( Plugins::filter( 'post_type_display', Post::type_name( $post->content_type ), 'singular' ) ) );\n\n\t\t$statuses = Post::list_post_statuses( false );\n\t\t$this->theme->statuses = $statuses;\n\n\t\t$form = $post->get_form( 'admin' );\n\n\t\t$this->theme->form = $form;\n\n\t\t$this->theme->wsse = Utils::WSSE();\n\t\t$this->display( $template );\n\t}", "public function created(Post $post)\n {\n //\n }", "public function future_to_published($post) {\n\t\t\n\t\tdefine(\"WPU_JUST_POSTED_{$postID}\", TRUE);\n\t\t$this->handle_new_post($post->ID, $post, true);\n\t}", "public function createPost()\n {\n $this->validate(['body' => 'required|min:15']);\n $post = auth()->user()->posts()->create(['body' => $this->body]);\n\n $this->emit('postAdded', $post->id); //emit de l'event\n\n $this->body = \"\"; //vidage du body\n\n }", "public function store(CreatePostRequest $request)\n {\n // $post->title = $request->get('title');\n // $post->body = $request->get('body');\n // $post->is_published = $request->get('is_published', false);\n\n // $post->save();\n\n $data = $request->validated();\n\n // $newPost = Post::create($data);\n\n $newPost = auth()->user()->posts()->create($data);\n\n $newPost->tags()->attach($data['tags']); // mozemo koristiti sync umjesto attach\n // $newPost = Post::create([\n // 'title' => $request->get('title'),\n // 'body' => $request->get('body'),\n // 'is_published' => $request->get('is_published'),\n // 'user_id' => auth()->user()->id,\n // ]);\n\n return redirect(route('post', ['post' => $newPost]));\n }", "private function runPost()\n {\n $numDraftPost = (int) $this->ask('How many records do you want to create for the draft posts table?');\n $numPublicPost = (int) $this->ask('How many records do you want to create for the public posts table?');\n\n $sum = (int) ($numDraftPost + $numPublicPost);\n\n for ($i = 0; $i < $sum; $i++) {\n factory(Post::class)->create(\n [\n 'publication_status' => ($i < $numDraftPost) ? 'draft' : 'public',\n ]\n );\n }\n }", "public function publish(Post $p)\n {\n if ($p->status === 'draft') {\n $p->status = 'published';\n $p->save();\n }\n\n return $p;\n }", "public function post_publish()\n\t{\n\t\t$this->get_publish();\n\t}", "public function created(Post $post)\n {\n $post->recordActivity('created');\n }", "public function publishPost($params = [])\n {\n $post = $this->posts()->save(\n new Post([\n 'user_id' => auth()->id(),\n 'body' \t\t => $params['body'],\n 'meta_description' => $params['meta_description'], \n 'title' => $params['title'], \n ])\n );\n\n return $post;\n }", "public function createActionPost(): object\n {\n // Connects to db\n $this->app->db->connect();\n\n if (hasKeyPost(\"doCreate\")) {\n $title = getPost(\"contentTitle\");\n\n // Calls createProduct method\n $this->admin->createBlogpost($title);\n\n // Retrieves id\n $id = $this->app->db->lastInsertId();\n }\n\n // Redirects\n return $this->app->response->redirect(\"admin/edit?id=$id\");\n }", "public function post()\n\t{\n\t\t$crud = $this->generate_crud('blog_posts');\n\t\t$crud->columns('author_id', 'category_id', 'title', 'image_url', 'tags', 'publish_time', 'status');\n\t\t$crud->set_field_upload('image_url', UPLOAD_BLOG_POST);\n\t\t$crud->set_relation('category_id', 'blog_categories', 'title');\n\t\t$crud->set_relation_n_n('tags', 'blog_posts_tags', 'blog_tags', 'post_id', 'tag_id', 'title');\n\t\t\n\t\t$state = $crud->getState();\n\t\tif ($state==='add')\n\t\t{\n\t\t\t$crud->field_type('author_id', 'hidden', $this->mUser->id);\n\t\t\t$this->unset_crud_fields('status');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$crud->set_relation('author_id', 'admin_users', '{first_name} {last_name}');\n\t\t}\n\n\t\t$this->mPageTitle = 'Blog Posts';\n\t\t$this->render_crud();\n\t}", "public function create()\n {\n $json = [\n 'status' => false,\n 'message' => 'You cannot create post',\n ];\n\n if($this->isUserAuth()){\n $template = new Template();\n\n $template->data['post_id'] = 0;\n\n $json = [\n 'status' => true,\n 'html' => $template->fetch('add_post_form'),\n ];\n }\n\n $this->jsonAnswer($json);\n }", "function check_and_publish_future_post($post)\n {\n }", "public function postPublish(Post $post)\n {\n $this->postRepository->postPublished($post);\n return redirect(config('blog.prefix', 'admin/blog') . '/' . 'post');\n }", "function wp_publish_post($post)\n {\n }", "function wp_newPost( $args ) {\n\n global $wp_xmlrpc_server;\n $wp_xmlrpc_server->escape($args);\n\n $blog_ID = (int) $args[0]; // for future use\n $username = $args[1];\n $password = $args[2];\n $content_struct = $args[3];\n $publish = isset( $args[4] ) ? $args[4] : false;\n\n if ( ! $user = $wp_xmlrpc_server->login( $username, $password ) )\n return $wp_xmlrpc_server->error;\n \n $post_type = get_post_type_object( $content_struct['post_type'] );\n if( ! ( (bool)$post_type ) )\n return new IXR_Error( 403, __( 'Invalid post type' ) );\n\n if( ! current_user_can( $post_type->cap->edit_posts ) )\n return new IXR_Error( 401, __( 'Sorry, you are not allowed to create posts in this post type' ));\n\n // this holds all the post data needed\n $post_data = array();\n $post_data['post_type'] = $content_struct['post_type'];\n\n $post_data['post_status'] = $publish ? 'publish' : 'draft';\n\n if( isset ( $content_struct[\"{$content_struct['post_type']}_status\"] ) )\n $post_data['post_status'] = $content_struct[\"{$post_data['post_type']}_status\"];\n\n\n switch ( $post_data['post_status'] ) {\n\n case 'draft':\n break;\n case 'pending':\n break;\n case 'private':\n if( ! current_user_can( $post_type->cap->publish_posts ) )\n return new IXR_Error( 401, __( 'Sorry, you are not allowed to create private posts in this post type' ));\n break;\n case 'publish':\n if( ! current_user_can( $post_type->cap->publish_posts ) )\n return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts in this post type' ));\n break;\n default:\n return new IXR_Error( 401, __( 'Invalid post status' ) );\n break;\n \n }\n\n // Only use a password if one was given.\n if ( isset( $content_struct['wp_password'] ) ) {\n\n if( ! current_user_can( $post_type->cap->publish_posts ) )\n return new IXR_Error( 401, __( 'Sorry, you are not allowed to create password protected posts in this post type' ) );\n $post_data['post_password'] = $content_struct['wp_password'];\n \n }\n\n // Let WordPress generate the post_name (slug) unless one has been provided.\n $post_data['post_name'] = \"\";\n if ( isset( $content_struct['wp_slug'] ) )\n $post_data['post_name'] = $content_struct['wp_slug'];\n\n if ( isset( $content_struct['wp_page_order'] ) ) {\n\n if( ! post_type_supports( $content_struct['post_type'] , 'page-attributes' ) )\n return new IXR_Error( 401, __( 'This post type does not support page attributes.' ) );\n\n $post_data['menu_order'] = (int)$content_struct['wp_page_order'];\n \n }\n\n if ( isset( $content_struct['wp_page_parent_id'] ) ) {\n\n if( ! $post_type->hierarchical )\n return new IXR_Error( 401, __( 'This post type does not support post hierarchy.' ) );\n\n // validating parent ID\n $parent_ID = (int)$content_struct['wp_page_parent_id'];\n if( $parent_ID != 0 ) {\n\n $parent_post = (array)wp_get_single_post( $parent_ID );\n if ( empty( $parent_post['ID'] ) )\n return new IXR_Error( 401, __( 'Invalid parent ID.' ) );\n\n if ( $parent_post['post_type'] != $content_struct['post_type'] )\n return new IXR_Error( 401, __( 'The parent post is of different post type.' ) );\n\n }\n\n $post_data['post_parent'] = $content_struct['wp_page_parent_id'];\n\n }\n\n // page template is only supported only by pages\n if ( isset( $content_struct['wp_page_template'] ) ) {\n\n if( $content_struct['post_type'] != 'page' )\n return new IXR_Error( 401, __( 'Page templates are only supported by pages.' ) );\n\n // validating page template\n $page_templates = get_page_templates( );\n $page_templates['Default'] = 'default';\n \n if( ! array_key_exists( $content_struct['wp_page_template'], $page_templates ) )\n return new IXR_Error( 403, __( 'Invalid page template.' ) );\n\n $post_data['page_template'] = $content_struct['wp_page_template'];\n\n }\n\n $post_data['post_author '] = $user->ID;\n\n // If an author id was provided then use it instead.\n if( isset( $content_struct['wp_author_id'] ) && ( $user->ID != (int)$content_struct['wp_author_id'] ) ) {\n\n if( ! post_type_supports( $content_struct['post_type'] , 'author' ) )\n return new IXR_Error( 401, __( 'This post type does not support to set author.' ) );\n\n if( ! current_user_can( $post_type->cap->edit_others_posts ) )\n return new IXR_Error( 401, __( 'You are not allowed to create posts as this user.' ) );\n \n $author_ID = (int)$content_struct['wp_author_id'];\n\n $author = get_userdata( $author_ID );\n if( ! $author )\n return new IXR_Error( 404, __( 'Invalid author ID.' ) );\n \n $post_data['post_author '] = $author_ID;\n \n }\n\n if( isset ( $content_struct['title'] ) ) {\n\n if( ! post_type_supports( $content_struct['post_type'] , 'title' ) )\n return new IXR_Error( 401, __('This post type does not support title attribute.') );\n $post_data['post_title'] = $content_struct['title'];\n \n }\n\n if( isset ( $content_struct['description'] ) ) {\n\n if( ! post_type_supports( $content_struct['post_type'] , 'editor' ) )\n return new IXR_Error( 401, __( 'This post type does not support post content.' ) );\n $post_data['post_content'] = $content_struct['description'];\n \n }\n\n if( isset ( $content_struct['mt_excerpt'] ) ) {\n\n if( ! post_type_supports( $content_struct['post_type'] , 'excerpt' ) )\n return new IXR_Error( 401, __( 'This post type does not support post excerpt.' ) );\n $post_data['post_excerpt'] = $content_struct['mt_excerpt'];\n \n }\n\n if( post_type_supports( $content_struct['post_type'], 'comments' ) ) {\n\n $post_data['comment_status'] = get_option('default_comment_status');\n\n if( isset( $content_struct['mt_allow_comments'] ) ) {\n\n if( ! is_numeric( $content_struct['mt_allow_comments'] ) ) {\n\n switch ( $content_struct['mt_allow_comments'] ) {\n case 'closed':\n $post_data['comment_status']= 'closed';\n break;\n case 'open':\n $post_data['comment_status'] = 'open';\n break;\n default:\n return new IXR_Error( 401, __( 'Invalid comment option.' ) );\n }\n\n } else {\n\n switch ( (int) $content_struct['mt_allow_comments'] ) {\n case 0: // for backward compatiblity\n case 2:\n $post_data['comment_status'] = 'closed';\n break;\n case 1:\n $post_data['comment_status'] = 'open';\n break;\n default:\n return new IXR_Error( 401, __( 'Invalid comment option.' ) );\n }\n\n }\n \n }\n\n } else {\n\n if( isset( $content_struct['mt_allow_comments'] ) )\n return new IXR_Error( 401, __( 'This post type does not support comments.' ) );\n\n }\n\n\n if( post_type_supports( $content_struct['post_type'], 'trackbacks' ) ) {\n\n $post_data['ping_status'] = get_option('default_ping_status');\n\n if( isset( $content_struct['mt_allow_pings'] ) ) {\n\n if ( ! is_numeric( $content_struct['mt_allow_pings'] ) ) {\n\n switch ( $content_struct['mt_allow_pings'] ) {\n case 'closed':\n $post_data['ping_status']= 'closed';\n break;\n case 'open':\n $post_data['ping_status'] = 'open';\n break;\n default:\n return new IXR_Error( 401, __( 'Invalid ping option.' ) );\n }\n\n } else {\n\n switch ( (int) $content_struct['mt_allow_pings'] ) {\n case 0:\n case 2:\n $post_data['ping_status'] = 'closed';\n break;\n case 1:\n $post_data['ping_status'] = 'open';\n break;\n default:\n return new IXR_Error( 401, __( 'Invalid ping option.' ) );\n }\n\n }\n\n }\n\n } else {\n\n if( isset( $content_struct['mt_allow_pings'] ) )\n return new IXR_Error( 401, __( 'This post type does not support trackbacks.' ) );\n\n }\n\n $post_data['post_more'] = null;\n if( isset( $content_struct['mt_text_more'] ) ) {\n\n $post_data['post_more'] = $content_struct['mt_text_more'];\n $post_data['post_content'] = $post_data['post_content'] . '<!--more-->' . $post_data['post_more'];\n \n }\n\n $post_data['to_ping'] = null;\n if ( isset( $content_struct['mt_tb_ping_urls'] ) ) {\n\n $post_data['to_ping'] = $content_struct['mt_tb_ping_urls'];\n if ( is_array( $to_ping ) )\n $post_data['to_ping'] = implode(' ', $to_ping);\n \n }\n\n // Do some timestamp voodoo\n if ( ! empty( $content_struct['date_created_gmt'] ) )\n $dateCreated = str_replace( 'Z', '', $content_struct['date_created_gmt']->getIso() ) . 'Z'; // We know this is supposed to be GMT, so we're going to slap that Z on there by force\n elseif ( !empty( $content_struct['dateCreated']) )\n $dateCreated = $content_struct['dateCreated']->getIso();\n\n if ( ! empty( $dateCreated ) ) {\n $post_data['post_date'] = get_date_from_gmt( iso8601_to_datetime( $dateCreated ) );\n $post_data['post_date_gmt'] = iso8601_to_datetime( $dateCreated, 'GMT' );\n } else {\n $post_data['post_date'] = current_time('mysql');\n $post_data['post_date_gmt'] = current_time('mysql', 1);\n }\n\n // we got everything we need\n $post_ID = wp_insert_post( $post_data, true );\n\n if ( is_wp_error( $post_ID ) )\n return new IXR_Error( 500, $post_ID->get_error_message() );\n\n if ( ! $post_ID )\n return new IXR_Error( 401, __( 'Sorry, your entry could not be posted. Something wrong happened.' ) );\n\n // the default is to unstick\n if( $content_struct['post_type'] == 'post' ) {\n\n $sticky = $content_struct['sticky'] ? true : false;\n if( $sticky ) {\n\n if( $post_data['post_status'] != 'publish' )\n return new IXR_Error( 401, __( 'Only published posts can be made sticky.' ));\n\n if( ! current_user_can( $post_type->cap->edit_others_posts ) )\n return new IXR_Error( 401, __( 'Sorry, you are not allowed to stick this post.' ) );\n\n stick_post( $post_ID );\n\n\n } else {\n\n unstick_post( $post_ID );\n\n }\n\n } else {\n\n if( isset ( $content_struct['sticky'] ) )\n return new IXR_Error( 401, __( 'Sorry, only posts can be sticky.' ) );\n \n }\n\n if( isset ( $content_struct['custom_fields'] ) ) {\n\n if( ! post_type_supports( $content_struct['post_type'], 'custom-fields' ) )\n return new IXR_Error( 401, __( 'This post type does not support custom fields.' ) );\n $wp_xmlrpc_server->set_custom_fields( $post_ID, $content_struct['custom_fields'] );\n \n } \n\n $post_type_taxonomies = get_object_taxonomies( $content_struct['post_type'] );\n\n if( isset( $content_struct['terms'] ) ) {\n\n $terms = $content_struct['terms'];\n $taxonomies = array_keys( $terms );\n\n // validating term ids\n foreach( $taxonomies as $taxonomy ) {\n\n if( ! in_array( $taxonomy , $post_type_taxonomies ) )\n return new IXR_Error( 401, __( 'Sorry, one of the given taxonomy is not supported by the post type.' ));\n\n $term_ids = $terms[ $taxonomy ];\n foreach ( $term_ids as $term_id) {\n\n $term = get_term( $term_id, $taxonomy );\n\n if ( is_wp_error( $term ) )\n return new IXR_Error( 500, $term->get_error_message() );\n\n if ( ! $term )\n return new IXR_Error( 401, __( 'Invalid term ID' ) );\n\n }\n\n }\n\n foreach( $taxonomies as $taxonomy ) {\n\n $term_ids = $terms[ $taxonomy ];\n $term_ids = array_map( 'intval', $term_ids );\n $term_ids = array_unique( $term_ids );\n wp_set_object_terms( $post_ID , $term_ids, $taxonomy , $append);\n\n }\n\n return true;\n\n }\n\n // backward compatiblity\n\t\tif ( isset( $content_struct['categories'] ) ) {\n\n if( ! in_array( 'category', $post_type_taxonomies ) )\n return new IXR_Error( 401, __( 'Sorry, Categories are not supported by the post type' ));\n \n\t\t\t$category_names = $content_struct['categories'];\n\n foreach( $category_names as $category_name ) {\n $category_ID = get_cat_ID( $category_name );\n if( ! $category_ID )\n return new IXR_Error( 401, __( 'Sorry, one of the given categories does not exist!' ));\n $post_categories[] = $category_ID;\n }\n\n wp_set_post_categories ($post_ID, $post_categories );\n\n\t\t}\n\n if( isset( $content_struct['mt_keywords'] ) ) {\n\n if( ! in_array( 'post_tag' , $post_type_taxonomies ) )\n return new IXR_Error( 401, __( 'Sorry, post tags are not supported by the post type' ));\n\n wp_set_post_terms( $post_id, $tags, 'post_tag', false); // append is set false here\n\n }\n\n if( isset( $content_struct['wp_post_format'] ) ) {\n\n if( ! in_array( 'post_format' , $post_type_taxonomies ) )\n return new IXR_Error( 401, __( 'Sorry, post formats are not supported by the post type' ));\n \n wp_set_post_terms( $post_ID, array( 'post-format-' . $content_struct['wp_post_format'] ), 'post_format' );\n\n }\n\n // Handle enclosures\n $thisEnclosure = isset($content_struct['enclosure']) ? $content_struct['enclosure'] : null;\n $wp_xmlrpc_server->add_enclosure_if_new($post_ID, $thisEnclosure);\n $wp_xmlrpc_server->attach_uploads( $post_ID, $post_data['post_content'] );\n\n return strval( $post_ID );\n\n}", "public function run()\n\t{\n\t\tPost::create([\n\t\t\t'title'=>'Fourth post',\n\t\t\t'slug'=>'Fourth -post',\n\t\t\t'excerpt'=>'<strong>Fourth post body</strong>',\n\t\t\t'content'=>'<strong>Content Fourth post body</strong>',\n\t\t\t'published'=>false ,\n\t\t\t'published_at'=>DB::raw('CURRENT_TIMESTAMP')]);\n}", "public function creating(Post $post)\n {\n $post->slug = Str::slug($post->title);\n $post->author_id = Auth::user()->id;\n }", "function new_post($post){\n $this->newPost($post);\n }", "function wv_create_post($title, $content, $postType = 'page') {\n $my_post = array(\n 'post_title' => $title,\n 'post_content' => $content,\n 'post_status' => 'publish',\n 'post_author' => 1,\n 'post_type' => $postType\n );\n\n // Insert the post into the database\n $pid = wp_insert_post($my_post);\n return $pid;\n }", "public function publish(Post $post)\n {\n $post->updated_at = null;\n\n $post->published = true;\n\n $query = DB::table('threads')\n ->where('id', $post->thread_id)\n ->update(['lastpost_uid' => $post->user_id, 'lastpost_date' => $post->created_at]);\n\n $post->save();\n\n return back();\n }", "function publish( $parent_id = null, $post_status = null ) {\n\n\t\tglobal $wpdb;\n\t\tglobal $src_hash;\n\n\t\t// Add parent ID if specified\n\t\tif( $parent_id ) {\n\t\t\t$this->post[ 'post_parent' ] = $parent_id;\n\t\t}\n\t\t\n\t\t$this->post[ 'post_status' ] = $post_status ? $post_status : 'publish';\n\n\t\t// Create post\n\t\t$new_id = wp_insert_post( $this->post );\n\t\tif( ! $new_id ) {\n\t\t\tdie( 'Failed to insert post.' );\n\t\t}\n\n\t\t// Add template if specified\n\t\tif( 'page' == $this->post['post_type'] && $this->post_template ) {\n\t\t\tupdate_post_meta( $new_id, '_wp_page_template', $this->post_template );\n\t\t}\n\n\t\t// Add subsite root if specified\n\t\tif( $this->is_subsite_root ) {\n\t\t\tupdate_post_meta( $new_id, 'subsite_root', 1 );\n\t\t}\n\n\t\t// ACF gives every modular page a 'modules' key that corresponds to a list\n\t\t// of included modules types (or in ACF terms, layouts) in the order they\n\t\t// appear on the page.\n\t\tupdate_post_meta( $new_id, 'modules', $this->module_list );\n\t\tupdate_post_meta( $new_id, '_modules', 'field_524b16d70ce72' );\n\n\t\t// Loop through the modules, adding postmeta in the same format ACF would.\n\t\tforeach( $this->modules as $index=>$module ) {\n\n\t\t\t// Do any necessary setup (i.e. download images)\n\t\t\t$module->before_publish( $new_id );\n\n\t\t\t// Fetch postmeta for module\n\t\t\t$postmeta_rows = $module->get_postmeta_rows( $index );\n\n\t\t\t// Update in database\n\t\t\tforeach( $postmeta_rows as $key => $value ) {\n\t\t\t\tupdate_post_meta( $new_id, $key, $value );\n\t\t\t}\n\n\t\t}\n\n\t\tif( ! empty( $this->featured_image ) ) {\n\n\t\t\t// Get media ID\n\t\t\tif( $this->featured_image instanceof I2M_Module__image ){\n\t\t\t\t$thumbnail_id = $this->featured_image->get_media_id();\n\t\t\t}\n\t\t\telse if( $this->featured_image instanceof I2M_Module__slideshow ){\n\t\t\t\t$thumbnail_id = $this->featured_image->get_media_id( $this->featured_image_slide );\n\t\t\t}\n\n\t\t\t// Set\n\t\t\tif( $thumbnail_id ){\n\t\t\t\tupdate_post_meta( $new_id, '_thumbnail_id', $thumbnail_id );\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo \"Error: Failed to update featured image for post \" . $new_id . \".<br />\";\n\t\t\t}\n\t\t}\n\n\t\t// Loop through and publish children\n\t\tforeach( $this->children as $child ) {\n\t\t\t$child->publish( $new_id );\n\t\t}\n\n\t\treturn $new_id;\n\n\t}", "public function skyword_post( $args ) {\n\t\tglobal $coauthors_plus;\n\t\t$login = $this->login( $args );\n\t\tif ( 'success' == $login['status'] ) {\n\t\t\t$data = $args[3];\n\t\t\tif ( null != $data['publication-date'] ) {\n\t\t\t\t$dateCreated = $data['publication-date']->getIso();\n\t\t\t\t$post_date = get_date_from_gmt( iso8601_to_datetime( $dateCreated ) );\n\t\t\t} else {\n\t\t\t\t$post_date = current_time('mysql');\n\t\t\t}\n\t\t\tif ( null != $data['publication-state'] ) {\n\t\t\t\t$state = sanitize_text_field( $data['publication-state'] );\n\t\t\t} else {\n\t\t\t\t$state = \"draft\";\n\t\t\t}\n\n\t\t\t$categories = $data['categories'];\n\t\t\t$post_category = array();\n\t\t\tforeach ( $categories as $category ) {\n\t\t\t\t$categoryId = (int) $category['id'];\n\t\t\t\tif ( $categoryId != null && $categoryId != 0 ){\n\t\t\t\t\t$post_category[] = $category['id'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t$data['post-id'] = $this->check_content_exists( $data['skyword_content_id'] , $data['post-type'] );\n\t\t\t$new_post = array(\n\t\t\t\t'post_status' => $state,\n\t\t\t\t'post_date' => $post_date,\n\t\t\t\t'post_excerpt' => wp_kses_post( $data['excerpt'] ),\n\t\t\t\t'post_type' => sanitize_text_field( $data['post-type'] ),\n\t\t\t\t'comment_status' => 'open',\n\t\t\t\t'post_category' => $post_category\t//sanitized above\n\t\t\t);\n\n\t\t\tif (null != $data['title']) {\n\t\t\t\t$new_post['post_title'] = wp_kses_post( $data['title'] );\n\t\t\t}\n\t\t\tif (null != $data['description']) {\n\t\t\t\t$new_post['post_content'] = wp_kses_post ( $data['description'] );\n\t\t\t}\n\t\t\tif (null != $data['slug']) {\n\t\t\t\t$new_post['post_name'] = sanitize_text_field( $data['slug'] );\n\t\t\t}\n\t\t\tif (null != $data['post-id']) {\n\t\t\t\t$new_post['ID'] = (int) $data['post-id'];\n\t\t\t}\n\t\t\tif (null != $data['user-id'] && is_numeric( trim( $data['user-id'] ) ) ) {\n\t\t\t\t$new_post['post_author'] = $data['user-id'];\n\t\t\t}\n\n\t\t\t$post_id = wp_insert_post($new_post);\n\t\t\n\t\t\t$utf8string = html_entity_decode( $data['tags-input'] );\n\t\t\twp_set_post_tags( $post_id, $utf8string, false );\n\n\t\t\t//attach attachments to new post;\n\t\t\t$this->attach_attachments( $post_id, $data );\n\t\t\t//add content template/attachment information as meta\n\t\t\t$this->create_custom_fields( $post_id, $data );\n\t\t\t$this->update_custom_field( $post_id, 'skyword_tracking_tag', $data['tracking'] );\n\t\t\t$this->update_custom_field( $post_id, 'skyword_seo_title', wp_kses_post( $data['metatitle'] ) );\n\t\t\t$this->update_custom_field( $post_id, 'skyword_metadescription', wp_kses_post( $data['metadescription'] ) );\n\t\t\t$this->update_custom_field( $post_id, 'skyword_keyword', wp_kses_post( $data['metakeyword'] ) );\n\t\t\t$this->update_custom_field( $post_id, 'skyword_content_id', wp_kses_post( $data['skyword_content_id'] ) );\n\t\t\t\n\t\t\t//add custom taxonomy values\n\t\t\tforeach ( $data[\"taxonomies\"] as $taxonomy ) { \n\t\t\t wp_set_post_terms( $post_id, $taxonomy['values'], $taxonomy['name'], true );\n\t\t\t}\n\t\t\t\n\t\t\t//Create sitemap information\n\t\t\t//@todo the input below should be sanitized before being inserted into the DB.\n\t\t\tif ( 'news' == $data['publication-type'] ) {\n\t\t\t\t$this->update_custom_field($post_id, 'skyword_publication_type', 'news');\n\t\t\t\tif ( null != $data['publication-access'] ) {\n\t\t\t\t\t$this->update_custom_field($post_id, 'skyword_publication_access', wp_kses_post( ['publication-access'] ) );\n\t\t\t\t}\n\t\t\t\tif ( null != $data['publication-name'] ) {\n\t\t\t\t\t$this->update_custom_field($post_id, 'skyword_publication_name', wp_kses_post( $data['publication-name'] ) );\n\t\t\t\t}\n\t\t\t\tif ( null != $data['publication-geolocation'] ) {\n\t\t\t\t\t$this->update_custom_field($post_id, 'skyword_geolocation', wp_kses_post( $data['publication-geolocation'] ) );\n\t\t\t\t}\n\t\t\t\tif ( null != $data['publication-keywords'] ) {\n\t\t\t\t\t$this->update_custom_field($post_id, 'skyword_tags', wp_kses_post( $data['publication-keywords'] ) );\n\t\t\t\t}\n\t\t\t\tif ( null != $data['publication-stocktickers'] ) {\n\t\t\t\t\t$this->update_custom_field($post_id, 'skyword_stocktickers', wp_kses_post( $data['publication-stocktickers'] ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->update_custom_field($post_id, 'skyword_publication_type', 'evergreen');\n\t\t\t}\n\t\t\tif ( null != $coauthors_plus) {\n\t\t\t\tif ( !is_numeric( trim ( $data['user-id'] ) ) ) {\n\t\t\t\t\t$data['user-id'] = str_replace( 'guest-', '', $data['user-id'] );\n\t\t\t\t\t$author = $coauthors_plus->guest_authors->get_guest_author_by( 'ID', $data['user-id'] );\n\t\t\t\t\t$author_term = $coauthors_plus->update_author_term( $author );\n\t\t\t\t\twp_set_post_terms( $post_id, $author_term->slug, $coauthors_plus->coauthor_taxonomy, true );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn esc_html( strval($post_id) );\n\t\t} else {\n\t\t\treturn esc_html( $login['message'] );\n\t\t}\n\t}", "function _publish_post_hook($post_id)\n {\n }", "public function created(Post $post)\n {\n // Category\n Category::find($post->category)->increment('num');\n\n // Tag\n Tag::whereIn('id', explode(',', $post->tags))->increment('num');\n\n // Archive\n Archive::updateOrCreate(\n ['month' => $post->archive],\n ['num' => 0]\n )->increment('num');\n }", "public function create()\n {\n\n $attributes = request()->validate([\n 'post_heading' => ['required', 'max:255'],\n 'post_title' => ['required', 'max:255'],\n 'post_content' => ['required'],\n 'thumbnail' => ['image', 'required']\n ]);\n $attributes['post_content'] = addslashes(preg_replace(\"@[\\n\\r]@\", \"\", $attributes['post_content']));\n $path = request()->file('thumbnail')->store('thumb');\n Post::create(array_merge($attributes, [\n 'user_id' => auth()->user()->id,\n 'thumbnail' => $path\n ]));\n return redirect('/')->with('success', 'Post was successfully published.');\n }", "public function CreateNewPost(Request $request){\n\n $okay = $this->getfailsvalidator($request);\n if($okay!='pas'){\n return $okay;\n }\n\n $inputs = $request->all();\n\n $titleslug = str_slug($inputs['title'], \"-\");\n\n if(empty($titleslug)){\n\n $titleslug = preg_replace(\"/[\\s-]+/\", \" \", $inputs['title']);\n\n $titleslug = preg_replace(\"/[\\s_]/\", '-', $titleslug);\n\n }\n $imgWW = $this->resizepostimage($inputs['thumb'], $titleslug);\n\n\t\t$ordertype = null;\n\t\tif(isset($inputs['ordertype'])){\n $ordertype = $inputs['ordertype'];\n if($ordertype == 'none'){\n $ordertype = null;\n }\n\t\t}\n\t\t\n $post = new Posts;\n $post->slug = $titleslug;\n $post->title = $inputs['title'];\n $post->body = $inputs['description'];\n $post->category_id = $inputs['category'];\n if(isset($inputs['pagination'])){\n $post->pagination = $inputs['pagination'] == 0 ? null : $inputs['pagination'];\n }\n $post->type = $inputs['type'];\n $post->tags = isset($inputs['tags']) ? $inputs['tags'] : '';\n $post->ordertype = $ordertype;\n $post->thumb = $imgWW;\n\n if($inputs['datapostt']=='draft'){\n $post->approve = 'draft';\n }elseif(getcong('AutoApprove')=='true' or Auth::user()->usertype == 'Staff' or Auth::user()->usertype == 'Admin' and Auth::user()->email !== 'demo@admin.com'){\n $post->approve = 'yes';\n }else{\n $post->approve = 'no';\n }\n\n $post->published_at = Carbon::now();\n\n\n Auth::user()->posts()->save($post);\n\n $this->createentrys($request, $post);\n\n\n //burda aynı resim adresini kulllanıyordur.\n \\File::delete($inputs['thumb']); //delete tmp image\n\n \\Session::flash('success.message', trans('index.successcreated'));\n\n return array('url' => makeposturl($post) );\n\n }", "public function addPost() {\n\n if ($this->request->is('post')) {\n\n $this->Post->create();\n\n $data = $this->getPreparedPostData($this->request);\n\n if ($this->Post->save($data)) {\n $this->Session->setFlash('Your post has been saved.');\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash('Unable to add your post.');\n }\n }\n }", "public function actionCreate()\n {\n $model = new Post();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->alias = Inflector::slug($model->title);\n $model->created_date = time();\n $model->publish_date = time();\n if($model->save()) {\n \\Yii::$app->session->setFlash('success', Module::t('general', 'Create post successfull'));\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store()\n {\n $input = array(\n 'title' => Binput::get('title'),\n 'summary' => Binput::get('summary'),\n 'body' => Binput::get('body'),\n 'user_id' => $this->getUserId(),\n );\n\n $rules = Post::$rules;\n\n $val = Validator::make($input, $rules);\n if ($val->fails()) {\n return Redirect::route('blog.posts.create')->withInput()->withErrors($val->errors());\n }\n\n $post = PostProvider::create($input);\n\n Session::flash('success', 'Your post has been created successfully.');\n return Redirect::route('blog.posts.show', array('posts' => $post->getId()));\n }", "public function p_add() {\n\t\t\n\t\t# Check to see if content was entered\n\t\t# If not, redirect to add post page with variable to trigger error message\n\t\tif ($_POST['content'] == \"\") {\n\t\t\tRouter::redirect('/posts/add/error');\n\t\t}\n\t\t\n\t\t# If so, add to DB with created and modified set to now\n\t\telse {\n\t\t\t$_POST['created'] = Time::now();\n\t\t\t$_POST['modified'] = Time::now();\n\t\t\t$_POST['user_id'] = $this->user->user_id;\n\t\t\tDB::instance(DB_NAME)->insert('posts', $_POST);\n\t\t\tRouter::redirect('/posts/stream/yours');\n\t\t}\n\t}", "public function create() {\n\t\treturn view('post.post_create');\n\t}", "public function createPost(Request $request)\n {\n \t//if (!self::isAdmin()) return redirect('/');\n \t \n \t$post = Post::firstOrNew(['url' => $request->url]);\n \t//$post = new Post;\n \t/*\n \ttry {\n \t\t$post = Post::where('url', '=', $request->url)->firstOrFail();\n \t} catch (\\Exception $e) {\n \t\t$post = new Post;\n \t}\n \t*/\n \t$url = urldecode(trim($request->url));\n \t$parse = parse_url($url);\n \t$sourcedomain = $parse['host'];\n \t \n \t$post->url = $url;\n \t$post->sourcedomain = $sourcedomain;\n \t$post->title = trim($request->title);\n \t$post->description = trim($request->description);\n \tif (is_array($request->tags) && (count($request->tags) >= 1)) {\n \t\t// tags separated by ',' , such as 'a,b,c,d'\n \t\t$post->tags = trim(implode(\",\", $request->tags));\n \t} else {\n \t\t$post->tags = \"\";\n \t}\n \t$post->isfeatured = $request->isfeatured;\n \t$post->hasvideo = $request->hasvideo;\n \t$post->ogimage = trim($request->ogimage);\n \t$post->content = trim($request->editor1);\n \t \n \t// default show on list, for upload all post by self\n \t$post->isapproved = 1;\n \n \t$post->save();\n \n \treturn redirect('/admin/list');\n }", "public function store(PostsRequest $request)\n {\n $post = new Post;\n $post->title = $request->title;\n $post->body = $request->body;\n $post->image = UploadImages('posts', $request->file('image'));\n $post->slug = $request->slug;\n $post->later_publish = $request->later_publish;\n if ($request->later_publish == 'yes') {\n $post->publish_date = $request->publish_date;\n $post->publish_time = $request->publish_time;\n $post->status = 'pending';\n } else {\n if (userCan('Change Posts Status')) {\n $post->status = $request->status;\n } else {\n $post->status = 'pending';\n }\n }\n $post->user_id = auth()->user()->id;\n $post->save();\n \n foreach ($request->tags as $t) {\n if ($tag = Tag::find($t)) {\n $post_tag = new PostTags;\n $post_tag->post_id = $post->id;\n $post_tag->tag_id = $t;\n $post_tag->save();\n\n event(new SendNotificationsForSubscripers($tag, $post->slug));\n }\n }\n\n // if ($post->status == 'approved') {\n // $ids = UserSubscribedTags::whereIn('tag_id', $request->tags)->get()->pluck('user_id')->toArray();\n //\n // foreach (User::findMany($ids) as $user) {\n // Notification::send($user, new NewPostAdded($post));\n // }\n // }\n\n\n session()->flash('success', trans('main.added-message'));\n return redirect()->route('posts.index');\n }", "public function store(PostCreateRequest $request)\n {\n $post = Post::create($request->postFillData());\n $post->syncTags($request->get('tags', []));\n\n Session::set('_new-post', trans('canvas::messages.create_success', ['entity' => 'post']));\n\n return redirect()->route('canvas.admin.post.edit', $post->id);\n }", "public function test_store_post()\n {\n $topic = Topic::factory()->create();\n $resp =\n $this->actingAs($this->user)\n ->withHeaders([\n 'Content-Type' => 'application/json',\n 'Accept' => 'application/json',\n ])\n ->postJson(\n '/api/topics/' . $topic->id . '/posts',\n [\n \"body\" => \"testsqx test\",\n ]\n );\n $resp->assertStatus(201);\n }", "public function action_publish_post( $post, $form )\n\t{\n\t\t$this->action_form_publish($form, $post);\n\t\t\n\t\tif( $form->notes->value != NULL ) {\n\t\t\t$note = new Note( $form->note_key->value );\n\t\t\t$note->content = $form->notes->value;\n\n\t\t\t$note->update();\n\t\t\t\n\t\t\t// Utils::debug( $note, $note->update(), $this->get_notes() );\n\n\t\t\t$post->info->note_key = $note->key;\n\t\t}\n\t\t\n\t\t\n\t\t// exit;\n\t\t\n\t}", "public function store(PostRequest $request)\n {\n return new PostResource(Post::create([\n 'user_id' => 120,\n 'body' => $request->body,\n 'status' => $request->has('status') ? $request->status : 'draft'\n ]));\n }", "public function store()\n\t{\n $post = new Post;\n //$post->title='test title';\n //$post->body='test body';\n $data = [\n 'title'=>'title',\n 'body'=>'body',\n 'user_id'=>1\n ];;\n Posts::create($data);\n $post->save();\n\t}", "public function actionCreate()\n {\n\t$this->layout='wide';\n $post=new Post;\n if(isset($_POST['Post']))\n {\n $post->attributes=$_POST['Post'];\n if(isset($_POST['previewPost']))\n $post->validate();\n else if(isset($_POST['submitPost']) && $post->save())\n {\n if(Yii::app()->user->status==User::STATUS_VISITOR)\n {\n Yii::app()->user->setFlash('message','Thank you for your post. Your post will be posted once it is approved.');\n $this->redirect(Yii::app()->homeUrl);\n }\n $this->redirect(array('show','slug'=>$post->slug));\n }\n }\n $this->pageTitle=Yii::t('lan','New Post');\n $this->render('create',array('post'=>$post));\n }", "public function create(PostRequest $request)\n {\n\n $post = $this->repository->newInstance([]);\n return $this->response->setMetaTitle(trans('app.new') . ' ' . trans('channels::post.name')) \n ->view('channels::post.create', true) \n ->data(compact('post'))\n ->output();\n }", "public function create()\n {\n return Viewer::make('posts.create');\n }", "public function CrearPost(){\n\n\n }", "public function store(CreatePostRequest $request)\n {\n $request->user()->posts()->create([\n 'title' => $request->input('title'),\n 'description' => $request->input('description'),\n 'publication_date' => now()\n ]);\n\n Cache::tags('posts')->flush();\n\n return redirect('dashboard');\n }", "public function store(CreatePostRequest $request)\n {\n if (!auth()->user()->ability('admin', 'create_posts')) {\n return abort(403);\n }\n $post = auth()->user()->posts()->create($request->all());\n if ($request->images && count($request->images) > 0) {\n store_image_for_posts($post, $request);\n }\n if ($request->status == 1) {\n Cache::forget('recent_posts');\n }\n return redirect()->route('admin.posts.index')->with([\n 'message' => 'Post created successfully',\n 'alert-type' => 'success',\n ]);\n }", "public function run()\n\t{\n\t\tPost::create(array(\n\t\t\t'post_title' => \"Have a Happy Day\",\n\t\t\t'post_body' => 'Welcome family! I wish you all the \n\t\t\tbest day :)',\n\t\t\t'post_author' => '3'\n\t\t\t));\n\t\tPost::create(array(\n\t\t\t'post_title' => \"Up To Two Posts\",\n\t\t\t'post_body' => 'Hey everybody! We need more posts! :)',\n\t\t\t'post_author' => '3'\n\t\t\t));\n\t}", "public function create()\n {\n return $this->postService->create();\n }", "public function create(Request $request)\n {\n $this->validate($request, [\n 'content' => 'required',\n ]); \n\n $post = new Post();\n $post->content = $request->input('content');\n $post->user_id = Auth::id();\n $post->save();\n\n $post = Post::with('user')->find($post->id);\n $pusher = \\Illuminate\\Support\\Facades\\App::make('pusher');\n $channels = [];\n $friends = Friend::getFriends();\n foreach ($friends as $f) {\n $channels[] = 'private-larawall'.$f;\n }\n if(!empty($channels)){\n $pusher->trigger($channels,'newpost',$post);\n }\n\n\n return $post;\n }", "public function store(){\n $validatedData = $this->validate([\n 'title'=>'required',\n 'content'=>'required'\n ]);\n\n //Validate the data\n Post::create($validatedData);\n\n //Set a message\n session()->flash('message','Post Created Successfully!');\n\n //Call Reset Input field function\n $this->resetInputFields();\n\n //Emit to close modal after submiting it\n $this->emit('postAdded');\n }", "public function p_add() {\n\t\t\t#print_r($_POST);\n\t\t\t\n\t\t\t\n\t\t\t$_POST['created'] = Time::now();\n \t\t\t$_POST['modified'] = Time::now();\n\t\t\t$_POST['poster'] = $this->user->user_id;\n\t\t\t\n\t\t\t#Write Post to the Database\n\t\t $post_id= DB::instance(DB_NAME)->insert('posts', $_POST);\n\t\t\t#Call the parser to look for hashtags: \n\t\t\t$_POST['post'] = $this->parse(\"#\",$_POST['post'],$post_id);\n\t\t\t#Call the parser to look for mentions, and the 'reply_to' for the post\n\t\t\t$_POST['post'] = $this->parse(\"@\",$_POST['post'],$post_id);\n\t\t\t#Update the Post record with new post, updated in the parser:\n\t\t\tDB::instance (DB_NAME)->update('posts',$_POST,\"where post_id = '\".$post_id.\"'\");\t\n\t\t\t\n\t\t Router::redirect('/users/');\n\t\t\t\n\t\t\t\t\t\t\n\t\t}", "public function add(Post $post);", "public function add(Post $post);", "function create_post()\n {\n //Create the post with information submitted\n if(isset($_POST['note-text']) && !($_POST['note-text'] == \"\"))\n {\n $query = $this->pdo->prepare('INSERT INTO note (title, description, created_at, updated_at) VALUES(:title,:description, NOW(), NOW())');\n $query->execute(array(\n ':title' => $_POST['note-title'],\n ':description' => $_POST['note-text']\n ));\n }\n }", "public function store(CreatePostRequest $request)\n {\n $categories = [];\n foreach($request->categories as $category) {\n $foundCategory = $this->categoryRepository->findWhere([\n 'name' => $category\n ])->first();\n if(empty($foundCategory)) {\n return $this->sendError( $category.'category not found.');\n }\n $categories[] = $foundCategory;\n }\n\n $post = $this->postService->store(\n $request->only('title', 'body', 'excerpt', 'status'),\n// $request->tags,\n $categories\n );\n\n\n $post->addMediaFromBase64($request->image)->toMediaCollection();\n\n return $this->sendResponse($post, 'Post created successfully.');\n }", "public function run()\n {\n $posts = [\n [ \n 'content' => 'Looking for someone to mow my lawn.',\n 'user_id' => 1\n ],\n [\n 'content' => 'Can someone buy my weekly shopping?',\n 'user_id' => 2\n ],\n [\n 'content' => 'Looking for someone to set up my Wi-Fi network with WPA2 encrpytion -- 7 devices.',\n 'user_id' => 3\n ],\n [\n 'content' => 'I would like a back massage.',\n 'user_id' => 4\n ]\n ];\n\n foreach ($posts as $post) {\n Post::create($post);\n }\n }", "public function publish();", "public function publish();", "public function publish(Post $post)\n\t{\n\t\t$q = \"UPDATE in_posts \";\n\t\t$q .= \"SET publish_flag=1, read_length=:read_length, publish_time=Now() WHERE id=:post_id\";\n\t\t$vars = array(\n\t\t\t':read_length'=>$post->read_length,\n\t\t\t':post_id'=>$post->id\n\t\t);\n\t\t//$this->logger->logInfo($q);\n\t\t$ps = $this->execute($q, $vars);\n\t}", "public function publish()\n {\n $message = new MailMessage;\n $message->greeting(\"Hi {$this->post->reporting->name}!\");\n $message->line(\"The post {$this->post->titile} has been published successfully.\"); \n foreach ($this->workflow as $key => $value) {\n if ($key == 0) {\n $message->action($value->action, url('workflows/workflow/' . $value->id));\n continue;\n }\n $message->line('<a href=\"'.url('workflows/workflow/' . $value->id).'\">'.$value->action.'</a>');\n }\n\n return $message;\n }", "public function postcreate(){\n if($this->check() == true){\n $page_id = @$_POST['page'];\n $text = @htmlentities($_POST['text'], ENT_QUOTES);\n\n\n $this->admindb->insert(\"post\", array(\n\n \"text\" => $text,\n \"pages_id\" => $page_id\n\n ))->get();\n\n $data['pages'] = $this->admindb->selectAll('pages');\n $this->view(\"admin/post/postcreate\", $data);\n }\n }", "public function createPost($data) {\n $stmt = $this->pdo->prepare('INSERT INTO posts (post_title, post_src, id_user, created_at, view_count)\n VALUES (:post_title, :post_src, :id_user, :created_at, :view_count)');\n $stmt->bindValue(':post_title', $data['title']);\n $stmt->bindValue(':post_src', $data['src']);\n $stmt->bindValue(':id_user', $data['id_user']);\n $stmt->bindValue(':created_at', $data['created_at']);\n $stmt->bindValue(':view_count', '0');\n $stmt->execute();\n }", "public function createPostTypes()\n {\n }", "public function publishPost($POST) {\r\n\t\t$sql = 'UPDATE `posts` SET `post_status` = :post_status\r\n\t\t\t\tWHERE `ID` = :ID AND `post_author` = :post_author LIMIT 1';\r\n\t\t$sth = $this->db->prepare($sql);\r\n\r\n\t\t$ret = $sth->execute(array('ID' => $POST['id'],\r\n\t\t\t\t\t\t\t\t 'post_author' => $GLOBALS['user']['id'],\r\n\t\t\t\t\t\t\t\t 'post_status' => 'publish'));\r\n\r\n\t\tif ($ret) {\r\n\t\t\t$this->putMsg('Successfully published');\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "public function store() {\n\t\t$post = new Post;\n\t\t$post->title = Input::get('title');\n\t\t$post->body = Input::get('body');\n\t\t$post->save();\n\n\t\t$post->category()->sync([\n\t\t\tInput::get('category_id'), $post->post_id\n\t\t]);\n\t}", "public function create()\n {\n $post = Post::create([\n 'title' => session('title'),\n 'description' => session('description'),\n 'create_user_id' => Auth::id(),\n 'updated_user_id' => Auth::id(),\n ]);\n log::info('created post:');\n log::info($post);\n return $post;\n }", "public function create(array $values = array()) {\n // Add values that are specific to our Post\n $values += array( \n 'post_id' => '',\n 'is_new' => TRUE,\n 'title' => '',\n 'created' => '',\n 'changed' => '',\n 'data' => '',\n );\n \n $post = parent::create($values);\n return $post;\n }", "public static function action_wp_insert_post( $post_id, $post ) {\n\t\tif ( 'publish' !== $post->post_status ) {\n\t\t\treturn;\n\t\t}\n\t\tself::purge_post_with_related( $post );\n\t}", "public function save() {\n\t\tif (!$this->backUser) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!post('category')) {\n\t\t\tthrow new ValidationException(['category[]' => 'You must pick at least one category!']);\n\t\t\treturn false; //['#blogfront-flash' => '<div class=\"alert alert-danger\">You must pick at least one category!</div>'];\n\t\t}\n\n\t\tif (!$this->post = $this->loadPost()) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$this->post->user_id = $this->backUser;\n\t\t$this->post->author_id = $this->user->id;\n\t\t$this->post->title = post('title');\n\t\t$this->post->event_date = post('event_date');\n\t\t$this->post->location = post('location');\n\t\t$this->post->organizer = post('organizer');\n\t\t$this->post->contact = post('contact');\n\t\t$this->post->preside = post('preside');\n\t\t\n\t\n\n\n\t\tif (!$this->post->slug) {\n\t\t\t$this->post->slug =$this->getSlug(md5(post('title')));\n\t\t}\n\t\t$this->post->content = post('content');\n\t\tif ($this->allowpublish) {\n\t\t\t$this->post->published_at = post('published') ? (\n\t\t\t\t$this->post->published_at ?: date('Y-m-d H:i:s'))\n\t\t\t: $this->post->published_at;\n\t\t\t$this->post->published = post('published') ? true : false;\n\t\t} else {\n\t\t\t$this->post->published = $this->post->published ? true : false;\n\t\t\t$this->post->published_at = $this->post->published ? (\n\t\t\t\t$this->post->published_at ?: date('Y-m-d H:i:s'))\n\t\t\t: $this->post->published_at;\n\t\t}\n\t\t\n\t\t$id = $this->post->save();\n\n\t\tif ($this->post->categories()->exists()) {\n\t\t\t$this->post->categories()->\n\t\t\t\tdetach(\n\t\t\t\t$this->categoryIds\n\t\t\t);\n\t\t}\n\n\t\tif (post('category')) {\n\t\t\t$this->post->categories()->\n\t\t\t\tattach(array_intersect(post('category'), $this->categoryIds));\n\t\t}\n\n\t\tif (post('ititle') && $this->allow_images) {\n\t\t\t$this->onImageText();\n\t\t}\n\n\t\tif (post('notify_groups')) {\n\t\t\t$groups = array_intersect(post('notify_groups'), array_flip($this->user_groups));\n\t\t\t$this->notifyGroups($groups, $this->post, $this->postPage);\n\t\t}\n\t\treturn $id;\n\t}", "public function createPost(array $post)\n {\n $post[\"porcelain\"] = null; // wp-Cli returns only id\n return intval($this->runWpCliCommand('post', 'create', $post));\n }", "public function testCreateNewPost()\n {\n $response = $this->call('Post', '/post', [\n 'title' => 'Php Unit test',\n 'body' => 'Php unit test body',\n 'tag' => 'phpunit,test'\n ]);\n \n $this->seeHeader('content-type', 'application/json');\n $this->seeStatusCode(200);\n $this->seeInDatabase('posts', ['title' => 'Php Unit test']);\n \n $data = json_decode($response->getContent(true), true);\n $this->assertArrayHasKey('id', $data['data']);\n \n \n }", "public function createPost()\n {\n // create a new post\n $data['title'] = __('posts.add');\n $data['post'] = $this->schema;\n $data['post']['categories'] = CategoryModel::all();\n $data['post']['form'] = config('app.admin_prefix').'/post/store';\n\n return admin_view('Posts::CreateEdit', $data);\n }", "public function create(User $user, Post $post);", "function restrict_access_install(){\n\n $post = array(\n 'comment_status' => 'closed',\n 'ping_status' => 'closed' ,\n 'post_author' => 1,\n 'post_date' => date('Y-m-d H:i:s'),\n 'post_name' => 'restrict_access',\n 'post_status' => 'publish' ,\n 'post_title' => 'Restrict Access',\n 'post_type' => 'page',\n );\n\n wp_insert_post( $post, false );\n}", "public function duplicatePost()\n {\n global $wpdb;\n\n if (!(isset($_GET['post']) || isset($_POST['post']) || (isset($_REQUEST['action']) && 'duplicate_post' == $_REQUEST['action']))) {\n wp_die(__('No post to duplicate has been supplied!', 'event-manager'));\n }\n\n $post_id = (isset($_GET['post']) ? absint($_GET['post']) : absint($_POST['post']));\n $post = get_post($post_id);\n\n $current_user = wp_get_current_user();\n $new_post_author = $current_user->ID;\n\n if (!isset($post) || empty($post)) {\n wp_die(__('Event creation failed, could not find original event', 'event-manager').': ' . $post_id);\n return;\n }\n\n $args = array(\n 'comment_status' => $post->comment_status,\n 'ping_status' => $post->ping_status,\n 'post_author' => $new_post_author,\n 'post_content' => $post->post_content,\n 'post_excerpt' => $post->post_excerpt,\n 'post_name' => '',\n 'post_parent' => $post->post_parent,\n 'post_password' => $post->post_password,\n 'post_status' => 'draft',\n 'post_title' => '',\n 'post_type' => $post->post_type,\n 'to_ping' => $post->to_ping,\n 'menu_order' => $post->menu_order\n );\n\n $new_post_id = wp_insert_post($args);\n\n // get current post terms and set them to the new event draft\n $taxonomies = get_object_taxonomies($post->post_type);\n foreach ($taxonomies as $taxonomy) {\n $post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'slugs'));\n wp_set_object_terms($new_post_id, $post_terms, $taxonomy, false);\n }\n\n // duplicate all post meta\n $post_meta_infos = $wpdb->get_results(\"SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id\");\n\n if (count($post_meta_infos) != 0) {\n $sql_query = \"INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) \";\n // Filter certain values from imported events\n foreach ($post_meta_infos as $meta_info) {\n $meta_key = $meta_info->meta_key;\n switch ($meta_key) {\n case 'import_client':\n continue 2;\n\n case 'imported_post':\n $meta_value = addslashes(0);\n break;\n\n case 'sync':\n $meta_value = addslashes(0);\n break;\n\n default:\n $meta_value = addslashes($meta_info->meta_value);\n break;\n }\n\n $sql_query_sel[]= \"SELECT $new_post_id, '$meta_key', '$meta_value'\";\n }\n\n $sql_query.= implode(\" UNION ALL \", $sql_query_sel);\n $wpdb->query($sql_query);\n }\n\n wp_redirect(admin_url('post.php?action=edit&post=' . $new_post_id.'&duplicate=' . $post_id));\n exit;\n }", "public function run()\n {\n\n App\\Post::create ([\n 'postcategory_id' \t=>\t1,\n 'profile_id'\t\t=>\t1,\n 'title' \t\t\t=>\t'This is the dyingt post',\n 'slug' \t\t\t=>\t'this-is-the-dying-post',\n 'subtitle' \t\t\t=>\t'And of course this is the dying',\n 'image'\t\t\t\t=>\t'dying.jpg',\n 'published_at'\t\t=>\t'2018-04-26 03:24:25',\n 'body'\t\t\t\t=>\t'\n \t\t\t\t\t\t<p>When we were working on <a href=\"https://www.ait-themes.club/wordpress-themes/expedition/\" target=\"_blank\">Expedition Theme</a> development, we made a research of the current offer of templates specialized on travelling, travelers and travel guides. The research showed that the WordPress travel themes available on the market are all very similar and most of them work as a travel blog only. Travelers can use such a template for recording their travel experiences in the form of blog posts.</p>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t<li>Travel guide template</li>\n\t\t\t\t\t\t\t\t<li>Mountain guide theme</li>\n\t\t\t\t\t\t\t\t<li>Website for road trip and driving tours planning</li>\n\t\t\t\t\t\t\t\t<li>City tours theme</li>\n\t\t\t\t\t\t\t\t<li>Travel agency theme</li>\n\t\t\t\t\t\t\t\t<li>Theme for travelers / travel blog</li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t<p>This template has a wide range of use in travelling and tourist guidance. It can be used for a presentation of a tourist guide, travel or entertainment agency. But it can be used also as a presentation of traveler. It is suitable for use wherever it is practical to show a map with different places linked by continuous route.</p>\n\t\t\t\t\t\t\t\t<h3>Oriented on Maps</h3>\n\t\t\t\t\t\t\t\t<p>What’s the best and fastest way to attract tourist and reader’s attention? By previewing what is waiting for them directly on the map. We’ve incorporated maps and advanced functionalities for their use to the travel WordPress theme. Maps are definitely the key to tourist interest.</p>',\n ]);\n App\\Post::create ([\n 'postcategory_id' \t=>\t1,\n 'profile_id'\t\t=>\t2,\n 'title' \t\t\t=>\t'Hamburg',\n 'slug' \t\t\t=>\t'hamburg',\n 'subtitle' \t\t\t=>\t'And of course this is hamburg',\n 'image'\t\t\t\t=>\t'hamburg.jpg',\n 'published_at'\t\t=>\t'2018-03-06 03:24:25',\n 'body'\t\t\t\t=>\t'\n \t\t\t\t\t\tThe city is a forum for and has specialists in world economics and international law with such consular and diplomatic missions as the International Tribunal for the Law of the Sea, the EU-LAC Foundation, and the UNESCO Institute for Lifelong Learning. In recent years, the city has played host to multipartite international political conferences and summits such as Europe and China and the G20. Former German Chancellor Helmut Schmidt, who governed Germany for eight years, came from Hamburg.\n\n\t\t\t\t\t\t\t\tThe city is a major international and domestic tourist destination. It ranked 18th in the world for livability in 2016.[6] The Speicherstadt and Kontorhausviertel were declared World Heritage sites by UNESCO in 2015.[7]',\n ]);\n App\\Post::create ([\n 'postcategory_id' \t=>\t1,\n 'profile_id'\t\t=>\t3,\n 'title' \t\t\t=>\t'gorrion',\n 'slug' \t\t\t=>\t'gorrion',\n 'subtitle' \t\t\t=>\t'And of course this is gorrion',\n 'image'\t\t\t\t=>\t'gorrion.jpg',\n 'published_at'\t\t=>\t'2017-12-06 03:24:25',\n 'body'\t\t\t\t=>\t'\n \t\t\t\t\t\tMustaine, who went on to found Megadeth, has expressed his dislike for Hammett in interviews, saying Hammett \"stole\" his job.[20] Mustaine was \"pissed off\" because he believes Hammett became popular by playing guitar leads that Mustaine himself had written.[21] In a 1985 interview with Metal Forces, Mustaine said, \"its real funny how Kirk Hammett ripped off every lead break Id played on that No Life til Leather tape and got voted No. 1 guitarist in your magazine.[22] On Megadeths debut album Killing Is My Business... and Business Is Good! (1985), Mustaine included the song Mechanix, which Metallica had previously reworked and retitled The Four Horsemen on Kill Em All. Mustaine said he did this to straighten Metallica up because Metallica referred to Mustaine as a drunk and said he could not play guitar.[22] Metallicas first live performance with Hammett was on April 16, 1983, at a nightclub in Dover, New Jersey called The Showplace;[16] the support act was Anthraxs original line-up, which included Dan Lilker and Neil Turbin.[23] This was the first time the two bands performed live together.[16]',\n ]);\n App\\Post::create ([\n 'postcategory_id' \t=>\t2,\n 'profile_id'\t\t=>\t1,\n 'title' \t\t\t=>\t'Metallica',\n 'slug' \t\t\t=>\t'metallica',\n 'subtitle' \t\t\t=>\t'And of course this is the subtitlet',\n 'image'\t\t\t\t=>\t'metallica.jpg',\n 'published_at'\t\t=>\t'2018-01-05 03:24:25',\n 'body'\t\t\t\t=>\t'\n \t\t\t\t\t\tFormation and early years (1981–1982)\n\t\t\t\t\t\t\t\t\tThe classic Metallica logo, used on most of their releases. Designed by James Hetfield[8][9]\n\n\t\t\t\t\t\t\t\t\tMetallica was formed in Los Angeles, California, in late 1981 when Danish-born drummer Lars Ulrich placed an advertisement in a Los Angeles newspaper, The Recycler, which read, \"Drummer looking for other metal musicians to jam with Tygers of Pan Tang, Diamond Head and Iron Maiden.\"[10] Guitarists James Hetfield and Hugh Tanner of Leather Charm answered the advertisement. Although he had not formed a band, Ulrich asked Metal Blade Records founder Brian Slagel if he could record a song for the labels upcoming compilation album, Metal Massacre. Slagel accepted, and Ulrich recruited Hetfield to sing and play rhythm guitar.[10] The band was officially formed on October 28, 1981, five months after Ulrich and Hetfield first met.\n\n\t\t\t\t\t\t\t\t\tUlrich talked to his friend Ron Quintana, who was brainstorming names for a fanzine. Quintana had proposed the names MetalMania and Metallica. Ulrich named his band Metallica. A second advertisement was placed in The Recycler for a position as lead guitarist. Dave Mustaine answered; Ulrich and Hetfield recruited him after seeing his expensive guitar equipment. In early 1982, Metallica recorded its first original song, \"Hit the Lights\", for the Metal Massacre I compilation. Hetfield played bass on the song, and Lloyd Grant was credited with a guitar solo.[10] Metal Massacre I was released on June 14, 1982; early pressings listed the band incorrectly as \"Mettallica\".[13] Although angered by the error, Metallica created enough \"buzz\" with the song, and the band played its first live performance on March 14, 1982, at Radio City in Anaheim, California, with newly recruited bassist Ron McGovney.[14] The bands first taste of live success came early; they were chosen to open for British heavy metal band Saxon at one gig of their 1982 US tour. This was Metallicas second gig. Metallica recorded its first demo, Power Metal, whose name was inspired by Quintanas early business cards in early 1982.',\n ]);\n App\\Post::create ([\n 'postcategory_id' \t=>\t2,\n 'profile_id'\t\t=>\t2,\n 'title' \t\t\t=>\t'Concussion',\n 'slug' \t\t\t=>\t'concussion',\n 'subtitle' \t\t\t=>\t'And of course this is the subtitlet',\n 'image'\t\t\t\t=>\t'1524650039-1521753687-concussion.jpg',\n 'published_at'\t\t=>\t'2018-01-09 03:24:25',\n 'body'\t\t\t\t=>\t'\n\t\t\t\t\t\t\t\t<h2>How We Can Help</h2>\n\t\t\t\t\t\t\t\t<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae.<span class=\"Apple-converted-space\"> <br></span></p>\n\n\t\t\t\t\t\t\t\t<ul class=\"ait-sc-lists style4 layout-half\">\n\t\t\t\t\t\t\t\t<li>Nemo enim ipsam voluptatem quia</li>\n\t\t\t\t\t\t\t\t<li>Voluptas sit aspernatur aut<span class=\"Apple-converted-space\"><br></span></li>\n\t\t\t\t\t\t\t\t<li>Facilis est et expedita distinctio</li>\n\t\t\t\t\t\t\t\t<li>Duis aute irure dolor in reprehenderit<span class=\"Apple-converted-space\"> <br></span></li>\n\t\t\t\t\t\t\t\t<li>Perspiciatis unde omnis iste natus<span class=\"Apple-converted-space\"> <br></span></li>\n\t\t\t\t\t\t\t\t<li>Tempora incidunt ut labore</li>\n\t\t\t\t\t\t\t\t<li>Assumenda est omnis<span class=\"Apple-converted-space\"> <br></span></li>\n\t\t\t\t\t\t\t\t<li>Excepteur sint occaecat cupidatat</li>\n\t\t\t\t\t\t\t\t<li>Sequi nesciunt neque porro<span class=\"Apple-converted-space\"> <br></span></li>\n\t\t\t\t\t\t\t\t<li>Maiores alias consequatur aut<span class=\"Apple-converted-space\"> <br></span></li>\n\t\t\t\t\t\t\t\t</ul>',\n ]);\n App\\Post::create ([\n 'postcategory_id' \t=>\t2,\n 'profile_id'\t\t=>\t3,\n 'title' \t\t\t=>\t'Pirate club',\n 'slug' \t\t\t=>\t'pirate-club',\n 'subtitle' \t\t\t=>\t'And of course this is the subtitlet',\n 'image'\t\t\t\t=>\t'1524587215-1521788317-pirates-of-the-caribbean',\n 'published_at'\t\t=>\t'2018-02-21 03:24:25',\n 'body'\t\t\t\t=>\t'\n \t\t\t\t\t\t<h2>New York, New York</h2>\n \t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t<li>May the joy this season brings never leave your heart and even more I pray that your smile masks no tears and your tears reflect your happiness. Merry Christmas.</li>\n\t\t\t\t\t\t\t\t<li>I can’t seem to find the perfect gift for you or the perfect words to convey my gratitude but more than anything I wish you a perfect Christmas.</li>\n\t\t\t\t\t\t\t\t<li>Past the lights and pretty gifts, past the trees and joyful charm, past the feasts and merry songs, you are the reason my Christmas is perfect. Merry Christmas my love and friend.</li>\n\t\t\t\t\t\t\t\t<li>In the manger He lay, the hope we cling to, the reason we celebrate and the secret to our Joy. Wishing you a Merry Christmas.</li>\n\t\t\t\t\t\t\t\t<li>I pray that this season reminds you that love is all we need and may it bring you peace and courage to begin a new chapter. Merry Christmas and a happy new year.</li>\n\t\t\t\t\t\t\t\t<li>May this season open your eyes to the goodness in the world that we sometimes forget and inspire you to love even more boldly than before. Wishing you a Merry Christmas and a happy new year.</li>\n\t\t\t\t\t\t\t\t<li>Christmas is the season of love, joy and laughter, all the things I pray will be with you forever. Merry Christmas.</li>\n\t\t\t\t\t\t\t\t</ul>',\n ]);\n App\\Post::create ([\n 'postcategory_id' \t=>\t3,\n 'profile_id'\t\t=>\t4,\n 'title' \t\t\t=>\t'Let me tell you something',\n 'slug' \t\t\t=>\t'let-me-tell-you-something',\n 'subtitle' \t\t\t=>\t'And of course this is the subtitlet',\n 'image'\t\t\t\t=>\t'1524564807-1521790195-pixels.jpg',\n 'published_at'\t\t=>\t'2018-04-02 03:24:25',\n 'body'\t\t\t\t=>\t'\n \t\t\t\t\t\t<h3>Everything important about Tours in one place</h3>\n\t\t\t\t\t\t\t\t<p>Further tailor-made features arose from the need to offer visitors the most detailed information on each of the available tours. That’s why Tours work as a Custom Post Type where you can add new and edit the existing Tours. It is a unique feature that can be found only in this template.</p>\n\t\t\t\t\t\t\t\t<p>1st part contains basic <strong>Tour Options</strong>. Apart from defining the header layout (either Image only or Image+small map or Fullsize map), you can enter here the locality and individual checkpoints on the route.</p>\n\t\t\t\t\t\t\t\t<p><span style=\"color: #ff0000;\"><a href=\"https://www.ait-themes.club/wp-content/uploads/2017/10/tour-options.jpg\" rel=\"prettyPhoto[contentGallery]\"><img class=\"aligncenter size-large wp-image-68678 load-finished\" src=\"https://www.ait-themes.club/wp-content/uploads/2017/10/tour-options-1024x512.jpg\" alt=\"Tour Options\" width=\"1024\" height=\"512\"></a></span></p>\n\t\t\t\t\t\t\t\t<p>2nd part consists of <strong>Additional information</strong>, where in addition to the tour dates (date range from – to), you can find several unique input fields for adding detailed tour description.</p>',\n ]);\n App\\Post::create ([\n 'postcategory_id' \t=>\t3,\n 'profile_id'\t\t=>\t4,\n 'title' \t\t\t=>\t'Auto clásico en La Habana',\n 'slug' \t\t\t=>\t'auto-clasico-en-la-habana',\n 'subtitle' \t\t\t=>\t'And of course this is the subtitlet',\n 'image'\t\t\t\t=>\t'auto-clasico.jpg',\n 'published_at'\t\t=>\t'2018-01-28 03:24:25',\n 'body'\t\t\t\t=>\t'\n \t\t\t\t\t\t<h4>Key checkpoints on the map</h4>\n\t\t\t\t\t\t\t\t<p>A specific feature, tailor made for our WordPress travel theme Expedition, is the <strong>possibility to add pins to the map</strong>. Pins show the interesting stops that are on the planned route.</p>\n\t\t\t\t\t\t\t\t<p><span style=\"color: #ff0000;\"><a href=\"https://www.ait-themes.club/wp-content/uploads/2017/10/map_pin.jpg\" rel=\"prettyPhoto[contentGallery]\"><img class=\"aligncenter wp-image-68676 size-large load-finished\" src=\"https://www.ait-themes.club/wp-content/uploads/2017/10/map_pin-1024x512.jpg\" alt=\"Pins on the map\" width=\"1024\" height=\"512\"></a></span></p>\n\t\t\t\t\t\t\t\t<p>Custom icons are available to be set for pins individually therefore you can choose the icon that best reflects the type of place. You can also add a name and a description of the place for each checkpoint.</p>\n\t\t\t\t\t\t\t\t<p><span style=\"color: #ff0000;\"><a href=\"https://www.ait-themes.club/wp-content/uploads/2017/10/map_pin_description.jpg\" rel=\"prettyPhoto[contentGallery]\"><img class=\"aligncenter size-large wp-image-68677 load-finished\" src=\"https://www.ait-themes.club/wp-content/uploads/2017/10/map_pin_description-1024x512.jpg\" alt=\"Pins with description\" width=\"1024\" height=\"512\"></a></span></p>\n\t\t\t\t\t\t\t\t<p>Manipulation with pins is also very practical. They can be moved around the map via drag &amp; drop functionality.</p>\n\t\t\t\t\t\t\t\t<p>The best advantage of this feature is that it can provide tourists with an immediate display of entire route with the various types of places where they will certainly make a stop during their trip. Whether it is a camping break, refreshment or a visit of a specific city, historical monument or museum.</p>\n\t\t\t\t\t\t\t\t<p><span style=\"color: #ff0000;\"></span></p><div class=\"ait-sc-notification info\">\n\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"close\" title=\"Close notification\">close</a>\n\t\t\t\t\t\t\t\t\t<div class=\"notify-wrap\">\n\t\t \t\t\t\t\t\t<p> Since it is easy to <strong>highlight all the planned stops</strong> in the sightseeing tours via pins, the Expedition Theme is often used as a travel guide template or&nbsp;tourists guide WordPress theme. Thanks to the checkpoints tourists can better decide which trip to choose. <span style=\"color: #ff0000;\"></span></p>\t</div>',\n ]);\n App\\Post::create ([\n 'postcategory_id' \t=>\t2,\n 'profile_id'\t\t=>\t2,\n 'title' \t\t\t=>\t'Berlin ist in Deutschland',\n 'slug' \t\t\t=>\t'berlin-ist-in-deutschland',\n 'subtitle' \t\t\t=>\t'And of course this is the subtitlet',\n 'image'\t\t\t\t=>\t'berlin.jpg',\n 'published_at'\t\t=>\t'2018-01-28 13:24:23',\n 'body'\t\t\t\t=>\t'\n \t\t\t\t\t\t<p>Expedition Theme shows what’s the most important. <strong>Points, routes and tours on the map</strong>. This theme is popular among guides regardless if it is the climbing guide, hiking tours or city sightseeing tours. What matters the most is the possibility to prepare any route by entering the start and destination address or GPS coordinates.</p>\n\t\t\t\t\t\t\t\t<blockquote><p>Thanks to GPS coordinates, the route can cross the cities, mountains or rivers.</p></blockquote>\n\t\t\t\t\t\t\t\t<h4>First contact with the map via Tour Slider</h4>\n\t\t\t\t\t\t\t\t<p>Tour Slider is a special element developed only for this travel theme that works as a Header on the web page. You can turn it on or off individually. It’s purpose is to attract the user’s attention. It’s a great demonstration of a particular tour right on the map. Whether it is the most favourite trip or the one closest to you.</p>\n\t\t\t\t\t\t\t\t<p><a href=\"https://www.ait-themes.club/doc/tours-slider/\" target=\"_blank\">Admin can set up the Tour Slider</a> according to his needs – there is a space for insertion of the presentation image, the start date of the tour, the short description and of course the map with the marked out route is displayed too.</p>\n\t\t\t\t\t\t\t\t<p>This is absolutely the best way how to attract tourists right on the homepage!</p>',\n ]);\n App\\Post::create ([\n 'postcategory_id' \t=>\t2,\n 'profile_id'\t\t=>\t3,\n 'title' \t\t\t=>\t'Merry Christmass',\n 'slug' \t\t\t=>\t'merry-christmass',\n 'subtitle' \t\t\t=>\t'This is with my best wishes',\n 'image'\t\t\t\t=>\t'merry-christmas.jpg',\n 'published_at'\t\t=>\t'2017-12-23 03:24:25',\n 'body'\t\t\t\t=>\t'\n\t\t\t\t\t\t\t\t<h2>Top Merry Christmas Wishes Text</h2>\n\t\t\t\t\t\t\t\t<p>In this category, you can choose good Christmas wishes greetings text that you can send to your family or friends. Some of these Christmas wishes are inspirational, cute and religious. Select the ones perfect for your needs.</p>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t<li>If Santa truly granted wishes, I would make only one wish for Christmas that your Smile never fades. Merry Christmas.</li>\n\t\t\t\t\t\t\t\t<li>I pray this season brings you unending bliss, Peace that transcends your soul and laughter for all your days. Merry Christmas.</li>\n\t\t\t\t\t\t\t\t<li>I hoped for a miracle to make believe in love, then I met you. Now I pray you never leave, this is my Christmas prayer. Merry Christmas my darling.</li>\n\t\t\t\t\t\t\t\t<li>Just like the uniqueness of every snowflake remains a mystery, you are just as special and magical to me. Merry Christmas and a happy new year.</li>\n\t\t\t\t\t\t\t\t<li>Christmas won’t be special without you, we miss you and wish you a perfect Christmas and a happy New Year wherever you are.</li>\n\t\t\t\t\t\t\t\t<li>I have but one wish my dearest that you make this season perfect by sharing it with me!<br>\n\t\t\t\t\t\t\t\tMerry Christmas with all my heart.</li>\n\t\t\t\t\t\t\t\t<li>My darling, my love, you will always be my Christmas miracle. I love you more than words can express and I wish a merry Christmas.</li>\n\t\t\t\t\t\t\t\t<li>I pray this season brings to you the courage to brave new storms, Joy that numbs all pain and a love that envelops you forever. Best wishes and a very Merry Christmas to you.</li>\n\t\t\t\t\t\t\t\t</ul>',\n ]);\n App\\Post::create ([\n 'postcategory_id' \t=>\t3,\n 'profile_id'\t\t=>\t1,\n 'title' \t\t\t=>\t'Happy new Year',\n 'slug' \t\t\t=>\t'happy-new-year',\n 'subtitle' \t\t\t=>\t'And of course this is the subtitlet',\n 'image'\t\t\t\t=>\t'merry-christmas-text-images.jpg',\n 'published_at'\t\t=>\t'2017-12-30 03:24:25',\n 'body'\t\t\t\t=>\t'\n \t\t\t\t\t\t<p><h2>Top Merry Christmas Wishes Text</h2>\n\t\t\t\t\t\t\t\t<p>In this category, you can choose good Christmas wishes greetings text that you can send to your family or friends. Some of these Christmas wishes are inspirational, cute and religious. Select the ones perfect for your needs.</p>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t<li>If Santa truly granted wishes, I would make only one wish for Christmas that your Smile never fades. Merry Christmas.</li>\n\t\t\t\t\t\t\t\t<li>I pray this season brings you unending bliss, Peace that transcends your soul and laughter for all your days. Merry Christmas.</li>\n\t\t\t\t\t\t\t\t<li>I hoped for a miracle to make believe in love, then I met you. Now I pray you never leave, this is my Christmas prayer. Merry Christmas my darling.</li>',\n ]);\n \n }", "public function store(StorePostRequest $request)\n {\n if (!\\auth()->user()->ability('admin', 'create_posts')) {\n return redirect('admin/index');\n }\n\n $data['title'] = $request->title;\n $data['description'] = $request->description;\n $data['status'] = $request->status;\n $data['post_type'] = 'post';\n $data['comment_able'] = $request->comment_able;\n $data['category_id'] = $request->category_id;\n\n $post = auth()->user()->posts()->create($data);\n\n if ($request->images && count($request->images) > 0) {\n $i = 1;\n foreach ($request->images as $file) {\n $filename = $post->slug . '-' . time() . '-' . $i . '.' . $file->getClientOriginalExtension();\n $file_size = $file->getSize();\n $file_type = $file->getMimeType();\n $path = public_path('assets/posts/' . $filename);\n Image::make($file->getRealPath())->resize(800, null, function ($constraint) {\n $constraint->aspectRatio();\n })->save($path, 100);\n $post->media()->create([\n 'image_name' => $filename,\n 'image_size' => $file_size,\n 'image_type' => $file_type,\n ]);\n $i++;\n }\n }\n\n if ($request->status == 1) {\n Cache::forget('recent_posts');\n }\n\n return redirect()->route('admin.posts.index')->with([\n 'message' => 'Post Added Successfully',\n 'alert-type' => 'success',\n ]);\n }", "function publish() {\n\t\tif (! $this->id) {\n\t\t\treturn false;\n\t\t}\n\t\t/* This method formerly updated the published_date, but that was removed in \n\t\t * favor of giving manual control of the published_date to the author\n\t\t * $this->saveField('published_date', date('Y-m-d', time()).' 00:00:00') */\n\t\treturn $this->saveField('is_published', 1);\n\t}", "public function store()\n\t{\n if ( !$this->newPostForm->validate($input = Input::only(['title', 'category', 'body'])))\n {\n return Redirect::back()->with(Flash::error('The form is invalid'));\n }\n\n $this->post->createPost($input);\n\n return Redirect::route('admin.posts.index')->with(Flash::success('Post created'));\n\t}", "public function run()\n {\n $post = new Post;\n $post->thumbnail = \"lomba.jpeg\";\n $post->title = \"testing post\";\n $post->content = \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Ex architecto illo, earum fuga officiis distinctio tenetur unde temporibus eaque nostrum doloremque laudantium consectetur ipsa quidem voluptates, quos assumenda ad accusamus.\";\n $post->slug = \"testing10\";\n $post->published = \"1\";\n $post->category_id = \"3\";\n $post->user_id = \"1\";\n $post->save();\n\n $post = new Post;\n $post->thumbnail = \"lomba.jpeg\";\n $post->title = \"testing post\";\n $post->content = \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Ex architecto illo, earum fuga officiis distinctio tenetur unde temporibus eaque nostrum doloremque laudantium consectetur ipsa quidem voluptates, quos assumenda ad accusamus.\";\n $post->slug = \"testing11\";\n $post->published = \"1\";\n $post->category_id = \"3\";\n $post->user_id = \"1\";\n $post->save();\n\n $post = new Post;\n $post->thumbnail = \"lomba.jpeg\";\n $post->title = \"testing post\";\n $post->content = \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Ex architecto illo, earum fuga officiis distinctio tenetur unde temporibus eaque nostrum doloremque laudantium consectetur ipsa quidem voluptates, quos assumenda ad accusamus.\";\n $post->slug = \"testing12\";\n $post->published = \"1\";\n $post->category_id = \"3\";\n $post->user_id = \"1\";\n $post->save();\n \n\n\n }", "public function create()\n {\n $this->authorize('create', \\App\\Post::class);\n return view('post.create');\n }", "public function sendPost(){\n\t\t\t// record the post in the database\n\t\t\t\n\t\t}", "function newPost($post){\n $rval = false;\n $now = strtotime(gmdate(\"M d Y H:i:s\"));\n $sections = ':';\n if(isset($post['frm_sections']) && count($post['frm_sections'])>0) {\n $sections = ':'.implode(\":\", $post['frm_sections']).':';\n }\n $title = $post['frm_post_title'];\n $body = $post['frm_post_body'];\n $posttime = (isset($post['posttime'])) ? $post['posttime'] : $now;\n $modifytime = $posttime;\n $status = $post['frm_post_status'];\n $modifier = $post['frm_modifier'];\n $ownerid = (isset($post['ownerid'])) ? intval($post['ownerid']) : $_SESSION['user_id'];\n $hidefromhome = (isset($post['frm_post_hidefromhome']) && $post['frm_post_hidefromhome'] == 1) ? 1: 0;\n $allowcomments = (isset($post['frm_post_allowcomments']) && $post['frm_post_allowcomments'] == ('allow' or 'disallow' or 'timed')) ? $post['frm_post_allowcomments'] : 'disallow';\n # TODO this needs refactored as everytime the post is edited, the disable date will auto-change (unintended). Make it use a definite date\n $autodisabledate = 'null';\n if(isset($post['disallowcommentsdays']) && in_array($post['disallowcommentsdays'], array(7, 14, 30, 90))){\n \t$inc = $post['disallowcommentsdays'];\n \t$rs['autodisabledate'] = strtotime(\"+$inc days\");\n }\n $sql = 'INSERT INTO `'.T_POSTS.'` VALUES(null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0)';\n $stmt = $this->_db->Prepare($sql);\n $this->_db->debug = true;\n if($this->_db->Execute($stmt, array($title, $body, $posttime, $modifytime, $status, $modifier, $sections, $ownerid, $hidefromhome, $allowcomments, $autodisabledate )) !== false){\n\t\t\t$rval = intval($this->_db->insert_id());\n if(isset($post['send_trackback']) && $post['send_trackback'] == true){\n \tinclude_once(LOQ_APP_ROOT.'includes/trackbackhandler.class.php');\n \t$tb = new trackbackhandler($this->_db);\n \t$tb->send_trackback('', $post['title'], $post['excerpt'], $post['tburl']);\n }\n }\n else{\n $this->_last_error = $this->_db->ErrorMsg();\n }\n return $rval;\n //return $this->modifyPost($post, 'INSERT');\n }", "public function store(PostFormRequest $request)\n {\n $inputs = $request->all();\n \n $tags = $inputs['tag'];\n\n $post = new Post([\n 'title' => title_case($request->title),\n 'slug' => str_slug($request->title, '-'),\n 'category_id' => $request->post_category,\n 'user' => $request->post_user,\n 'content' => $request->content\n ]);\n\n // $post->status = $request->post_status;\n \n $post->save();\n\n if ($request->post_status == 'published') {\n\n $post->statuses()->attach(Status::where('type', 'published')->first());\n\n }\n\n if ($request->post_status == 'draft') {\n\n $post->statuses()->attach(Status::where('type', 'draft')->first());\n\n }\n\n foreach($tags as $tag) {\n $post->tags()->attach($tag);\n }\n\n return redirect()->route('posts')->with('status', 'Post created successfully!');\n \n }", "public function attachPostToBlogAtTheEnd() {}", "private function PostSaver(){\n if ($this->updateMode){\n $post = Post::find($this->postId);\n } else {\n $post = new Post();\n }\n $post->user_id = Auth::user()->id;\n $post->title = $this->title;\n $post->category_id = (int)$this->categories;\n $post->caption = $this->caption;\n $post->url = $this->imagePath;\n $post->save();\n $post->Tag()->sync($this->tags);\n }", "public function store(Request $r) {\n // $post->title = $r->title;\n // $post->body = $r->body;\n // $post->save();\n\n $r->validate([\n 'title' => 'required|max:150',\n 'body' => 'required'\n ]);\n\n // Post::create([\n // 'title' => $r->title,\n // 'body' => $r->body,\n // 'user_id' => \\Auth::id()\n // ]);\n\n \\Auth::user()->publish(\n new Post([\n 'title' => $r->title,\n 'body' => $r->body\n ])\n );\n\n return redirect('/posts/create');\n }", "public function store()\n\t{\n\t\t// validate\n\t\t// read more on validation at http://laravel.com/docs/validation\n\t\t$rules = array(\n\t\t\t'title' => 'required',\n\t\t\t'desc_md' => 'required'\n\t\t);\n\n\t\t//dd(Input::get('event_maps'));\n\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\t// process the login\n\t\tif ($validator->fails()) {\n\t\t\tSession::flash('message', 'post faikled post!');\n\t\t\treturn Redirect::to('posts/create')\n\t\t\t\t->withErrors($validator)\n\t\t\t\t->withInput(Input::except('password'));\n\t\t}\n\n\n\n\t\t// store\n\t\t$html_desc = Markdown::string(Input::get('desc_md'));\n\n\t\t$post = new Post;\n\t\t$post->title = Input::get('title');\n\t\t$post->desc_md = Input::get('desc_md');\n\t\t$post->desc = $html_desc;\n\t\t$post->slug = Str::slug(Input::get('title'));\n\n\t\t$post->event = Input::get('event');\n\t\t//$post->event_maps = implode(',', Input::get('event_maps'));\n\n\t\t$dom = new domDocument;\n\t\t$dom->loadHTML($html_desc);\n\t\t$dom->preserveWhiteSpace = false;\n\t\t$xpath = new DOMXPath($dom);\n\t\t\t$src = $xpath->evaluate(\"string(//img/@src)\");\n\n\t\t$post->featured_image = $src;\n\t\t$post->created_by = Auth::user()->id;\n\n\t\t//$post->author = Auth::User()->name;\n\t\t$post->save();\n\n\t\t// redirect\n\t\tSession::flash('message', 'Successfully created post!');\n\t\treturn Redirect::to('admin/posts');\n\t}", "public function creating(Post $post)\n {\n // Se ejecute si no se esta ingresando registros desde la consola\n if (! \\App::runningInConsole()) {\n $post->user_id = auth()->user()->id;\n }\n }", "public function run()\n {\n PostType::create(['name' => 'Topic']);\n PostType::create(['name' => 'Report']);\n PostType::create(['name' => 'Help']);\n PostType::create(['name' => 'Campaign']);\n }", "public function p_add() {\n $_POST['user_id'] = $this->user->user_id;\n\n # Unix timestamp of when this post was created / modified\n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n\n # Insert\n # Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us\n DB::instance(DB_NAME)->insert('posts', $_POST);\n\n \t\tRouter::redirect('/posts/myposts');\n }", "function submitted_events_insert_post($submission, $title, $content) {\n\t// post meta data needed\n\t$meta_data = array (\n\t\t\t'event-date' => $submission->date,\n\t\t\t'event-time' => $submission->starttime,\n\t\t\t'event-days' => 1,\n\t\t\t'event-repeat' => 0,\n\t\t\t'event-end' => 0 \n\t);\n\t\n\t$postarr = array (\n\t\t\t'post_title' => $title,\n\t\t\t'post_type' => 'event-list-cal',\n\t\t\t'post_content' => $content,\n\t\t\t'post_category' => submitted_events_calendar ( $submission ),\n\t\t\t'meta_input' => $meta_data \n\t);\n\t\n\t$post_id = wp_insert_post ( $postarr );\n\t\n\t// echo ID of created event?\n\techo '<p>Created event ID ' . $post_id . '</p>';\n}", "public function new_post( $post_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'new_post', 'new_group_forum_post' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_group_forum_post', $post_id, $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_group_forum_post',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['new_post']['creds'],\n\t\t\t\t$this->prefs['new_post']['log'],\n\t\t\t\t$post_id,\n\t\t\t\t'bp_fpost',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}", "private function runTagPost()\n {\n $num = (int) $this->ask('How many records do you want to create for the tag_post table?');\n factory(TagPost::class, $num)->create();\n }", "public function insert()\n {\n $postDateGMT = $this->_pubDate;\n $postDateGMT->setTimezone( new Datetimezone( 'GMT' ) );\n\n $post = array\n (\n 'post_content' => $this->_excerpt,\n 'post_date' => $this->_pubDate->format( 'Y-m-d H:i:s' ),\n 'post_date_gmt' => $postDateGMT->format( 'Y-m-d H:i:s' ),\n 'post_parent' => $this->_feedID,\n 'post_status' => 'publish',\n 'post_title' => $this->_title,\n 'post_type' => 'fs_feed_entry'\n );\n\n remove_action( 'save_post', array( 'FS', 'onWPSavePost' ) );\n $postID = wp_insert_post( $post );\n add_action( 'save_post', array( 'FS', 'onWPSavePost' ) );\n\n if( $postID === 0 )\n {\n return false;\n }\n\n add_post_meta( $postID, 'fs_feed_entry_url', $this->_url, true );\n\n return true;\n }", "public function run()\n {\n $a = new Post;\n $a->post_content = \"I am Jack and I am cool :)\";\n $a->user_id = 1;\n $a->like_count = 4;\n $a->post_title = \"Post\";\n $a->image = \"/......\";\n $a->save();\n\n factory(\\App\\Post::class, 8)->create();\n }", "function create_new_user_posts($user_id){\n if (!$user_id>0)\n return;\n //here we know the user has been created so to create \n //3 posts we call wp_insert_post 3 times.\n // Create post object\n $user = get_user_by('id', $user_id); \n $streamer_account = array(\n 'post_title' => $user->user_nicename,\n 'post_status' => 'publish',\n 'post_author' => $user_id,\n 'post_type' => 'streamers'\n );\n\n // Insert the post into the database\n $streamer_act = wp_insert_post( $streamer_account );\n update_user_meta( $user_id, 'useracct', $streamer_act ); //this gets the id of the use, adds a meta useracct and places the added post id for the account, so that there will be only 1 streamer post per user account\n wp_update_post();\n\n}" ]
[ "0.7788773", "0.7525096", "0.7386439", "0.715038", "0.705672", "0.7034603", "0.6939653", "0.69309384", "0.6922982", "0.69153583", "0.6877489", "0.68527776", "0.6787075", "0.6772028", "0.6766103", "0.6734667", "0.6716004", "0.6711254", "0.6702637", "0.66898775", "0.6661466", "0.66417867", "0.66130996", "0.6603282", "0.6596402", "0.65192074", "0.6517734", "0.64870477", "0.64840084", "0.6477655", "0.6470645", "0.6468592", "0.646088", "0.6453202", "0.64142567", "0.6412096", "0.64106286", "0.6404155", "0.63970816", "0.63953286", "0.63937825", "0.63871765", "0.6375003", "0.6373548", "0.6370776", "0.6353472", "0.63486695", "0.63383305", "0.63367707", "0.6336729", "0.63357615", "0.63319445", "0.6320757", "0.6300645", "0.6295229", "0.6295229", "0.62833995", "0.62765026", "0.6268253", "0.62640965", "0.62640965", "0.6254892", "0.62328416", "0.62314", "0.6226762", "0.62192947", "0.621632", "0.62127167", "0.6204546", "0.62037736", "0.620131", "0.61987615", "0.619525", "0.61934084", "0.6186287", "0.61842", "0.6182449", "0.6176514", "0.616495", "0.6158772", "0.61539465", "0.6153704", "0.6152888", "0.6148917", "0.61485744", "0.61484337", "0.6147246", "0.6145016", "0.6141498", "0.6131305", "0.6126591", "0.6114957", "0.6113502", "0.6112626", "0.6108075", "0.610735", "0.6102351", "0.60990727", "0.6097076", "0.6090611" ]
0.6749019
15
Store a tracking Url
public function store( StoreTrackingUrlRequest $request, CreateTrackingUrlInterface $createTrackingUrl ): JsonResponse { try { $data = $createTrackingUrl->handle($request->url); return response()->json([ 'message' => 'The resource was created successfully', 'data' => $data, ]); } catch (Exception $exception) { return response()->json([ 'exception' => $exception, 'message' => $exception->getMessage(), ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function analytics_trackurl() {\n global $DB, $PAGE, $COURSE;\n $pageinfo = get_context_info_array($PAGE->context->id);\n $trackurl = \"'/\";\n\n // Adds course category name.\n if (isset($pageinfo[1]->category)) {\n if ($category = $DB->get_record('course_categories', array('id'=>$pageinfo[1]->category))) {\n $cats=explode(\"/\",$category->path);\n foreach (array_filter($cats) as $cat) {\n if ($categorydepth = $DB->get_record(\"course_categories\", array(\"id\" => $cat))) {;\n $trackurl .= urlencode($categorydepth->name).'/';\n }\n }\n }\n }\n\n // Adds course full name.\n if (isset($pageinfo[1]->fullname)) {\n if (isset($pageinfo[2]->name)) {\n $trackurl .= urlencode($pageinfo[1]->fullname).'/';\n } else if ($PAGE->user_is_editing()) {\n $trackurl .= urlencode($pageinfo[1]->fullname).'/'.get_string('edit', 'local_analytics');\n } else {\n $trackurl .= urlencode($pageinfo[1]->fullname).'/'.get_string('view', 'local_analytics');\n }\n }\n\n // Adds activity name.\n if (isset($pageinfo[2]->name)) {\n $trackurl .= urlencode($pageinfo[2]->modname).'/'.urlencode($pageinfo[2]->name);\n }\n \n $trackurl .= \"'\";\n return $trackurl;\n}", "private function _get_url($track) {\n\t\t$site_url = ( is_ssl() ? 'https://':'http://' ).$_SERVER['HTTP_HOST'];\n\t\tforeach ($track as $k=>$value) {\n\t\t\tif (strpos(strtolower($value), strtolower($site_url)) === 0) {\n\t\t\t\t$track[$k] = substr($track[$k], strlen($site_url));\n\t\t\t}\n\t\t\tif ($k == 'data') {\n\t\t\t\t$track[$k] = preg_replace(\"/^https?:\\/\\/|^\\/+/i\", \"\", $track[$k]);\n\t\t\t}\n\n\t\t\t//This way we don't lose search data.\n\t\t\tif ($k == 'data' && $track['code'] == 'search') {\n\t\t\t\t$track[$k] = urlencode($track[$k]);\n\t\t\t} else {\n\t\t\t\t$track[$k] = preg_replace(\"/[^a-z0-9\\.\\/\\+\\?=-]+/i\", \"_\", $track[$k]);\n\t\t\t}\n\n\t\t\t$track[$k] = trim($track[$k], '_');\n\t\t}\n\t\t$char = (strpos($track['data'], '?') === false)? '?':'&amp;';\n\t\treturn str_replace(\"'\", \"\\'\", \"/{$track['code']}/{$track['data']}{$char}referer=\" . urlencode( isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : '' ) );\n\t}", "function insertIntoTrack($URL, $album, $artist, $track, $featuring) {\n scraperwiki::save_sqlite(array(\"UniqURL\"), array(\"UniqURL\"=>$URL, \"Album\"=>$album, \"Artist\"=>$artist, \"Track\"=>$track, \"Featuring\"=>$featuring), $table_name=\"Track\");\n}", "function insertIntoTrack($URL, $album, $artist, $track, $featuring) {\n scraperwiki::save_sqlite(array(\"UniqURL\"), array(\"UniqURL\"=>$URL, \"Album\"=>$album, \"Artist\"=>$artist, \"Track\"=>$track, \"Featuring\"=>$featuring), $table_name=\"Track\");\n}", "public function getPageviewUrl () {\n $urlPixel = 'https://www.google-analytics.com/collect?v=1'\n . '&tid=' . $this->GAtrackingID\n . '&t=pageview'\n . '&dp=' . $this->getPath()\n . '&dt=' . urlencode($this->title)\n . '&cn=' . urlencode($this->campaign)\n . '&cs=' . urlencode($this->source)\n . '&cm=' . urlencode($this->medium)\n . '&cc=' . urlencode($this->content)\n . '&cid=' . $this->supporterID; \n return $urlPixel;\n }", "public function track($trackingNumber);", "protected function save($url)\n {\n $shortLink = Generator::getRandomString();\n\n $item = array(\n 'created' => new \\MongoDate(),\n 'key' => $shortLink,\n 'target' => $url\n );\n\n $this->getCollection(self::MONGO_COLLECTION)->insert($item);\n\n $this->set(\"link\", 'http://' . $_SERVER['SERVER_NAME'] . '/' . $shortLink);\n }", "public static function getTrackingUrl($orderToken)\n {\n return Configs::TRACKING_URL . \"#/{$orderToken}\";\n }", "public function getSpotifyURI()\n\t{\n\t\treturn 'spotify:track:' . toSpotifyId($this->id);\n\t}", "private function updateUrl(){\n $this->url->status_code = $this->response['status_code'];\n $this->url->reason_phrase = $this->response['reason_phrase'];\n $this->url->location = $this->response['location'];\n $this->url->content_type = $this->response['content_type'];\n $this->url->content_length = $this->response['content_length'];\n $this->url->save();\n }", "public function getTrackingLink( $strTracking ) \r\n {\r\n // original link is still unknown\r\n return 'http://trackthepack.com/track/'.$strTracking;\r\n }", "function track(){\n\n\t\tif($params = $this->getURLParams()) {\n\n\t\t\t//different link versions, for maintaining backwards compatability\n\t\t\tif(isset($params['Version']) && $params['Version'] == \"v2\"){\n\n\t\t\t\tif($decrypted = $this->decryptHash()){\n\n\t\t\t\t\tif($recipient = DataObject::get_one(\"Newsletter_SentRecipient\",\"\\\"Email\\\" = '\".$decrypted['e'].\"' AND \\\"ParentID\\\" = \".$decrypted['nl'])){\n\t\t\t\t\t\t$recipient->recordClick();\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($decrypted['l']) && is_numeric($decrypted['l']) && $link = DataObject::get_by_id('Newsletter_TrackedLink', (int)$decrypted['l'])){\n\t\t\t\t\t\t$link->recordClick();\n\t\t\t\t\t\treturn $this->redirect($link->Original, 301);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}elseif(isset($params['Hash']) && ($hash = Convert::raw2sql($params['Hash']))) {\n\t\t\t\t$link = DataObject::get_one('Newsletter_TrackedLink', \"\\\"Hash\\\" = '$hash'\");\n\t\t\t\tif($link) {\n\t\t\t\t\t// check for them visiting this link before\n\t\t\t\t\t$link->recordClick();\n\t\t\t\t\treturn $this->redirect($link->Original, 301);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn $this->httpError(404);\n\t}", "private function get_tracking_url($type, $tracking_number) {\n\t\t$url = '';\n\n\t\tswitch($type)\n\t\t{\n\t\t\tcase \"fedex\":\n\t\t\t\t$url = 'http://www.fedex.com/Tracking?language=english&cntry_code=us&tracknumbers=' . $tracking_number;\n\t\t\t\tbreak;\n\n\t\t\tcase \"ups\":\n\t\t\t\t$url = 'http://wwwapps.ups.com/WebTracking/processInputRequest?TypeOfInquiryNumber=T&InquiryNumber1=' . $tracking_number;\n\t\t\t\tbreak;\n\n\t\t\tcase \"usps\":\n\t\t\t\t$url = 'https://tools.usps.com/go/TrackConfirmAction?qtc_tLabels1=' . $tracking_number;\n\t\t\t\tbreak;\t\t\n\n\t\t}\n\n\t\treturn $url;\n\n\t\t\n\t}", "function timetracking_uri(timetracking $timetracking){\n return array(\n 'path' => 'timetracking/' . $timetracking->timetracking_id,\n );\n}", "static function storeLocation() {\n if ($_SERVER['REQUEST_METHOD'] == 'GET') {\n $_SESSION['forwardingUrl'] = \"http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n }\n }", "public function hitURL($url)\n\t{\n\t\t$this->statpro->insert(\n\t\t\t6,\n\t\t\tarray(\n\t\t\t\t$url,\n\t\t\t\ttime(),\n\t\t\t)\n\t\t);\n\t}", "function get_trackback_url()\n {\n }", "function writeUrl() {\n\n }", "function google_analytics_config()\n{\n\n $tracking_code = $this->getRequest()->getParam('google_analytics_tracking_code');\n set_option('google_analytics_tracking_code', $tracking_code);\n\n}", "function addTrack($URL, $trackMeta) {\n insertIntoTrack($URL, $trackMeta['album'], $trackMeta['artist'], $trackMeta['track'], count($trackMeta['featuring']));\n if (count($trackMeta['featuring']) > 0) {\n foreach ($trackMeta['featuring'] as $i => $artist) {\n insertIntoFeaturedArtist($URL, $artist);\n }\n }\n}", "function addTrack($URL, $trackMeta) {\n insertIntoTrack($URL, $trackMeta['album'], $trackMeta['artist'], $trackMeta['track'], count($trackMeta['featuring']));\n if (count($trackMeta['featuring']) > 0) {\n foreach ($trackMeta['featuring'] as $i => $artist) {\n insertIntoFeaturedArtist($URL, $artist);\n }\n }\n}", "function df_store_url($s, $type) {return df_store($s)->getBaseUrl($type);}", "public function tracker_store(){\n\t\tif(!$this->env_get('tracker:event')) return;\n\n\t\t// get exact request time\n\t\t$request_time =\tround($_SERVER['REQUEST_TIME_FLOAT'], 4);\n\n\t\t// set a value (if not already set from a concurrent process) to block concurrent processes\n\t\t$unique = uniqid(rand(), true);\n\t\t$this->us_set('tracker:session_created', $unique, true);\n\n\n\t\t// check if unique key matched uncached session value\n\t\tif($this->us_is('tracker:session_created', $unique, true)){\n\n\t\t\t// if already session update data is found\n\t\t\t$session_data = $this->env_get('tracker:session_data') ?: [];\n\n\t\t\t// add redisjob to add session\n\t\t\t$res = traffic_session::delayed_create_session([\n\t\t\t\t// base param\n\t\t\t\t'persistID' \t\t\t\t=> $this->us_get('persistID'),\n\t\t\t\t'createTime'\t\t\t\t=> $_SERVER['REQUEST_TIME'],\n\t\t\t\t'domainID'\t\t\t\t\t=> $this->env_get('nexus:domainID'),\n\t\t\t\t'pageID'\t\t\t\t\t=> $this->env_get('nexus:pageID'),\n\t\t\t\t'publisherID'\t\t\t\t=> $this->env_get('nexus:publisherID'),\n\n\t\t\t\t// special param\n\t\t\t\t'publisher_uncover_key'\t\t=> $this->env_get('nexus:publisher_uncover_key'),\n\t\t\t\t'publisher_uncover_name'\t=> $this->env_get('nexus:publisher_uncover_name'),\n\t\t\t\t'publisher_affiliate_key'\t=> $this->env_get('nexus:publisher_affiliate_key'),\n\t\t\t\t'usID'\t\t\t\t\t\t=> $this->us->usID,\n\t\t\t\t'ipv4'\t\t\t\t\t\t=> (strpos($_SERVER['REMOTE_ADDR'], ':') === false) ? $_SERVER['REMOTE_ADDR'] : null,\n\t\t\t\t'ipv6'\t\t\t\t\t\t=> (strpos($_SERVER['REMOTE_ADDR'], ':') !== false) ? $_SERVER['REMOTE_ADDR'] : null,\n\t\t\t\t'useragent'\t\t\t\t\t=> !empty($_SERVER['HTTP_USER_AGENT']) ? substr($_SERVER['HTTP_USER_AGENT'], 0, 255) : null,\n\t\t\t\t'referer'\t\t\t\t\t=> $_SERVER['HTTP_REFERER'] ?? null,\n\n\t\t\t\t// options\n\t\t\t\t'ipv4_range_detection'\t\t=> $this->env_get('domain:ipv4range_detection') ? true : false,\n\t\t\t\t'delayed_parsing'\t\t\t=> true,\n\t\t\t\t] + $session_data);\n\n\t\t\t// on error\n\t\t\tif($res->status != 204){\n\n\t\t\t\t// log error\n\t\t\t\te::logtrigger('Failed to create RedisJob for create_session: '.$res->status);\n\n\t\t\t\t// and abort\n\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t// else if session update data is ready\n\t\telseif($this->env_get('tracker:session_data')){\n\n\t\t\t// add redisjob to update session\n\t\t\t$res = traffic_session::delayed_update_session([\n\t\t\t\t'persistID' \t=> $this->us_get('persistID'),\n\t\t\t\t] + $this->env_get('tracker:session_data')\n\t\t\t\t);\n\n\t\t\t// on error\n\t\t\tif($res->status != 204){\n\n\t\t\t\t// log error\n\t\t\t\te::logtrigger('Failed to create RedisJob for update_session: '.$res->status);\n\n\t\t\t\t// and abort\n\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t// if this is a new click\n\t\tif($this->env_is('nexus:new_click_request')){\n\n\t\t\t// get click request data\n\t\t\t$request_data = $this->env_get('nexus:new_click_request');\n\n\t\t\t// save in session\n\t\t\t$this->us_set('tracker:last_click_request', $request_data);\n\n\t\t\t// add redisjob to add click to session\n\t\t\t$res = traffic_session::delayed_create_click([\n\t\t\t\t// base param\n\t\t\t\t'persistID'\t\t=> $this->us_get('persistID'),\n\t\t\t\t'createTime'\t=> $_SERVER['REQUEST_TIME'],\n\n\t\t\t\t// special param\n\t\t\t\t'referer'\t\t=> $_SERVER['HTTP_REFERER'] ?? null,\n\t\t\t\t'request'\t\t=> $request_data,\n\t\t\t\t]);\n\n\t\t\t// on error\n\t\t\tif($res->status != 204){\n\n\t\t\t\t// log error\n\t\t\t\te::logtrigger('Failed to create RedisJob for create_click: '.$res->status);\n\n\t\t\t\t// and abort\n\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t// if we have a new blocked click\n if($this->env_is('nexus:blocked_click')){\n\n // get data\n $blocked_click = $this->env_get('nexus:blocked_click');\n\n // add redisjob to add click to session\n\t\t\t$res = traffic_session::delayed_create_blocked_click([\n\t\t\t\t// base param\n\t\t\t\t'persistID'\t\t=> $this->us_get('persistID'),\n\t\t\t\t'createTime'\t=> $_SERVER['REQUEST_TIME'],\n\t\t\t\t'pageID'\t\t=> $blocked_click->pageID,\n\t\t\t\t'publisherID'\t=> $blocked_click->publisherID,\n\t\t\t\t'status'\t\t=> $blocked_click->status,\n\n\t\t\t\t// special param\n\t\t\t\t'referer'\t\t=> $blocked_click->referer ?: null,\n\t\t\t\t'request'\t\t=> $blocked_click->pubdata ?: null,\n\t\t\t\t]);\n\n\t\t\t// on error\n\t\t\tif($res->status != 204){\n\n\t\t\t\t// log error\n\t\t\t\te::logtrigger('Failed to create RedisJob for create_blocked_click: '.$res->status);\n\n\t\t\t\t// and abort\n\t\t\t\treturn;\n\t\t\t\t}\n }\n\n\n\t\t// create pageview_data\n\t\t$pageview_data = $this->env_get('tracker:callinfo');\n\t\tif(!is_array($pageview_data)) $pageview_data = [];\n\t\t$pageview_data['url'] = $this->env_get('nexus:url');\n\n\t\t// add redisjob to add session_pageview\n\t\t$res = traffic_session::delayed_create_session_pageview([\n\t\t\t// base param\n\t\t\t'persistID'\t\t=> $this->us_get('persistID'),\n\t\t\t'createTime'\t=> $_SERVER['REQUEST_TIME'],\n\t\t\t'data'\t\t\t=> $pageview_data,\n\t\t\t]);\n\n\t\t// on error\n\t\tif($res->status != 204){\n\n\t\t\t// log error\n\t\t\te::logtrigger('Failed to create RedisJob for session_pageview: '.$res->status);\n\n\t\t\t// and abort\n\t\t\treturn;\n\t\t\t}\n\t\t}", "public function store(TrackingRequest $request)\n {\n $request['code'] = $this->getCode();\n Tracking::create($request->all());\n return redirect('/tracking')->with('success',\"Your tracking has been created\");\n\n }", "public function store(Request $request)\n {\n $long_url = $request->long_url;\n if (filter_var($long_url, FILTER_VALIDATE_URL) === FALSE) {\n return \"NOT VALID URL!\";\n }\n\t\t//return $long_url;\n\t\t$user_id = $request->user_id;\n\t\tif ($user_id === NULL) {\n\t\t\t$user_id = -1;\n\t\t}\n $url = new Url(['long_url' => $long_url, 'user_id' => $user_id]);\n\t\t$url->save();\n\t\t//$url = shortener\\Url::create(['long_url' => $long_url]);\n\t\treturn $this->indexToUrl($url->id);\n }", "public function getEventUrl () {\n $urlPixel = 'https://www.google-analytics.com/collect?v=1'\n . '&tid=' . $this->GAtrackingID\n . '&t=event'\n . '&ec=' . urlencode($this->category)\n . '&ea=' . urlencode($this->action)\n . '&cn=' . urlencode($this->campaign)\n . '&cs=' . urlencode($this->source)\n . '&cm=' . urlencode($this->medium)\n . '&cc=' . urlencode($this->content)\n . '&cid=' . $this->supporterID;\n return $urlPixel;\n }", "public function autoTrackUrl() {\n\t\treturn apply_filters( 'aioseo_google_autotrack', plugin_dir_url( AIOSEO_FILE ) . 'app/Common/Assets/js/autotrack.js' );\n\t}", "function track_visitor()\n{\n $dbh = new db;\n $dbh->createTables();\n\n $ip_address = checkParam($_SERVER,\"REMOTE_ADDR\",'');\n $page_name = checkParam($_SERVER,\"SCRIPT_NAME\",'');\n $query_string = checkParam($_SERVER,\"QUERY_STRING\",'');\n $current_page = $page_name.\"?\".$query_string;\n\n if( isset($_SESSION['visitor_id']) )\n $visitor_id = $_SESSION['visitor_id'];\n else\n $visitor_id = $dbh->getNewVisitorID();\n\n if( isset($_SESSION[\"tracking\"]) )\n {\n // If it's a new page, add new tracking entry\n if($_SESSION[\"current_page\"] != $current_page)\n {\n $dbh->addEntry($visitor_id,$ip_address,$page_name,$query_string);\n }\n }\n else\n {\n $_SESSION[\"tracking\"] = TRUE;\n $_SESSION[\"visitor_id\"] = $visitor_id;\n $dbh->addEntry($visitor_id,$ip_address,$page_name,$query_string);\n }\n $_SESSION[\"current_page\"] = $current_page;\n}", "public static function getTrackUploadURL(): string {\n return Helper::getUploadDirectoryURL(self::TRACK_UPLOAD_PATH);\n }", "public function getTrackingUrlTemplate()\n {\n return isset($this->tracking_url_template) ? $this->tracking_url_template : '';\n }", "public function addUrl() {\r\n\t\t$current = $this->params['url']['url'];\r\n\t\t$accept = array('show', 'admin_show', 'admin_index');\r\n\t\tif(in_array($this->action, $accept)) {\r\n\t\t\tif ($this->Session->read('history.current') != $current){\r\n\t\t\t\t//$this->Session->write('history.previous', $this->Session->read('history.current'))->write('history.current', $current);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getHTTPLink()\n\t{\n\t\treturn 'http://open.spotify.com/track/' . toSpotifyId($this->id);\n\t}", "public function trackingUrl($trackingNumber, $language = null, $params = [])\n {\n return $this->trackingUrl . '?tracknumbers=' . $trackingNumber;\n }", "function trackPageView() {\n $timeStamp = time();\n $domainName = $_SERVER[\"SERVER_NAME\"];\n if (empty($domainName)) {\n $domainName = \"\";\n }\n\n // Get the referrer from the utmr parameter, this is the referrer to the\n // page that contains the tracking pixel, not the referrer for tracking\n // pixel.\n $documentReferer = $_GET[\"utmr\"];\n if (empty($documentReferer) && $documentReferer !== \"0\") {\n $documentReferer = \"-\";\n } else {\n $documentReferer = urldecode($documentReferer);\n }\n $documentPath = $_GET[\"utmp\"];\n if (empty($documentPath)) {\n $documentPath = \"\";\n } else {\n $documentPath = urldecode($documentPath);\n }\n\n $account = $_GET[\"utmac\"];\n $userAgent = $_SERVER[\"HTTP_USER_AGENT\"];\n if (empty($userAgent)) {\n $userAgent = \"\";\n }\n\n // Try and get visitor cookie from the request.\n $cookie = isset($_COOKIE[COOKIE_NAME]) ? $_COOKIE[COOKIE_NAME] : '';\n\n $dcmguid = isset($_SERVER[\"HTTP_X_DCMGUID\"]) ? $_SERVER[\"HTTP_X_DCMGUID\"] : '';\n $visitorId = getVisitorId(\n $dcmguid, $account, $userAgent, $cookie);\n\n // Always try and add the cookie to the response.\n setrawcookie(\n COOKIE_NAME,\n $visitorId,\n $timeStamp + COOKIE_USER_PERSISTENCE,\n COOKIE_PATH);\n\n $utmGifLocation = \"http://www.google-analytics.com/__utm.gif\";\n\n // Construct the gif hit url.\n $utmUrl = $utmGifLocation . \"?\" .\n \"utmwv=\" . VERSION .\n \"&utmn=\" . getRandomNumber() .\n \"&utmhn=\" . urlencode($domainName) .\n \"&utmr=\" . urlencode($documentReferer) .\n \"&utmp=\" . urlencode($documentPath) .\n \"&utmac=\" . $account .\n \"&utmcc=__utma%3D999.999.999.999.999.1%3B\" .\n \"&utmvid=\" . $visitorId .\n \"&utmip=\" . getIP($_SERVER[\"REMOTE_ADDR\"]);\n\n sendRequestToGoogleAnalytics($utmUrl);\n\n // If the debug parameter is on, add a header to the response that contains\n // the url that was used to contact Google Analytics.\n if (!empty($_GET[\"utmdebug\"])) {\n header(\"X-GA-MOBILE-URL:\" . $utmUrl);\n }\n // Finally write the gif data to the response.\n writeGifData();\n }", "public function saveUrl($value) {\n return $this->setProperty('saveUrl', $value);\n }", "private function log_url($args) {\n\n\t\t@preg_match('/((\\d+).(\\d+).(\\d+).(\\d+))/', $args[1], $ip);\n\t\t@$ip = $ip[0];\n\t\tmysql_query(\"INSERT INTO log SET source='$ip', destination='$args[0]'\");\n\n\t}", "public static function optin_track_usage() {\n\n\t\t/** update week day for tracking */\n\t\t$track_week_day = date( 'w' );\n\t\tupdate_option( 'xl_track_day', $track_week_day, false );\n\n\t\t$data = self::collect_data();\n\n\t\t//posting data to api\n\t\tXL_API::post_tracking_data( $data );\n\t}", "function df_store_url_web($s = null) {return df_store_url($s, S::URL_TYPE_WEB);}", "public function store()\n {\n $validator = Validator::make($this->inputs, ['url' => 'required']);\n $validator->validate();\n \n $msg = ($hash = $this->service->addUrl($this->inputs['url']))\n ? ('URL ' . $this->inputs['url'] . ' was added with alias: ' . $hash)\n : ('An error occurred. URL ' . $this->inputs['url'] . ' was not added.');\n\n\n return redirect()->route('tiny.create')->with('message', $msg);\n }", "public function getTrackingId()\n {\n return $this->trackingId;\n }", "public function getTrackingID()\n {\n return $this->trackingID;\n }", "public function getTrackerUrl($trackingCode, $orderId=null);", "function track_link($slug,$values)\n {\n global $wpdb, $prli_click, $prli_options, $prli_link, $prli_update;\n \n $query = \"SELECT * FROM \".$prli_link->table_name.\" WHERE slug='$slug' LIMIT 1\";\n $pretty_link = $wpdb->get_row($query);\n $pretty_link_target = apply_filters('prli_target_url',array('url' => $pretty_link->url, 'link_id' => $pretty_link->id));\n $pretty_link_url = $pretty_link_target['url'];\n \n if(isset($pretty_link->track_me) and $pretty_link->track_me)\n {\n $first_click = 0;\n \n $click_ip = isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:'';\n $click_referer = isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:'';\n $click_uri = isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI']:'';\n $click_user_agent = isset($_SERVER['HTTP_USER_AGENT'])?$_SERVER['HTTP_USER_AGENT']:'';\n\n //Set Cookie if it doesn't exist\n $cookie_name = 'prli_click_' . $pretty_link->id;\n\n //Used for unique click tracking\n $cookie_expire_time = time()+60*60*24*30; // Expire in 30 days\n \n if(!isset($_COOKIE[$cookie_name]))\n {\n setcookie($cookie_name,$slug,$cookie_expire_time,'/');\n $first_click = 1;\n }\n \n if(isset($prli_options->extended_tracking) and $prli_options->extended_tracking == 'extended')\n {\n $click_browser = $this->php_get_browser();\n $click_host = gethostbyaddr($click_ip);\n\n $visitor_cookie = 'prli_visitor';\n //Used for visitor activity\n $visitor_cookie_expire_time = time()+60*60*24*365; // Expire in 1 year\n \n // Retrieve / Generate visitor id\n if(!isset($_COOKIE[$visitor_cookie]))\n {\n $visitor_uid = $prli_click->generateUniqueVisitorId();\n setcookie($visitor_cookie,$visitor_uid,$visitor_cookie_expire_time,'/');\n }\n else\n $visitor_uid = $_COOKIE[$visitor_cookie];\n }\n else\n {\n $click_browser = array( 'browser' => '', 'version' => '', 'platform' => '', 'crawler' => '' );\n $click_host = '';\n $visitor_uid = '';\n }\n \n if($prli_options->extended_tracking != 'count')\n {\n //Record Click in DB\n $insert_str = \"INSERT INTO {$prli_click->table_name} (link_id,vuid,ip,browser,btype,bversion,os,referer,uri,host,first_click,robot,created_at) VALUES (%d,%s,%s,%s,%s,%s,%s,%s,%s,%s,%d,%d,NOW())\";\n $insert = $wpdb->prepare($insert_str, $pretty_link->id,\n $visitor_uid,\n $click_ip,\n $click_user_agent,\n $click_browser['browser'],\n $click_browser['version'],\n $click_browser['platform'],\n $click_referer,\n $click_uri,\n $click_host,\n $first_click,\n $this->this_is_a_robot($click_user_agent,$click_browser));\n \n $results = $wpdb->query( $insert );\n \n do_action('prli_record_click',array('link_id' => $pretty_link->id, 'click_id' => $wpdb->insert_id, 'url' => $pretty_link_url));\n }\n else\n {\n global $prli_link_meta;\n $exclude_ips = explode(\",\", $prli_options->prli_exclude_ips);\n if(!in_array($click_ip, $exclude_ips) and !$this->this_is_a_robot($click_user_agent,$click_browser))\n {\n $clicks = $prli_link_meta->get_link_meta($pretty_link->id, 'static-clicks', true);\n $clicks = (empty($clicks) or $clicks === false)?0:$clicks;\n $prli_link_meta->update_link_meta($pretty_link->id, 'static-clicks', $clicks+1);\n\n if($first_click)\n {\n $uniques = $prli_link_meta->get_link_meta($pretty_link->id, 'static-uniques', true);\n $uniques = (empty($uniques) or $uniques === false)?0:$uniques;\n $prli_link_meta->update_link_meta($pretty_link->id, 'static-uniques', $uniques+1);\n }\n }\n }\n }\n \n // Reformat Parameters\n $param_string = '';\n \n if(isset($pretty_link->param_forwarding) and ($pretty_link->param_forwarding == 'custom' OR $pretty_link->param_forwarding == 'on') and isset($values) and count($values) >= 1)\n {\n $first_param = true;\n foreach($values as $key => $value)\n {\n if($first_param)\n {\n $param_string = (preg_match(\"#\\?#\", $pretty_link_url)?\"&\":\"?\");\n $first_param = false;\n }\n else\n $param_string .= \"&\";\n \n $param_string .= \"$key=$value\";\n }\n }\n \n if(isset($pretty_link->nofollow) and $pretty_link->nofollow)\n header(\"X-Robots-Tag: noindex, nofollow\", true);\n\n switch($pretty_link->redirect_type)\n {\n case '301':\n header(\"HTTP/1.1 301 Moved Permanently\");\n header('Location: '.$pretty_link_url.$param_string);\n break;\n default:\n if( $pretty_link->redirect_type == '307' or\n !$prli_update->pro_is_installed_and_authorized() )\n {\n if($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0')\n header(\"HTTP/1.1 302 Found\");\n else\n header(\"HTTP/1.1 307 Temporary Redirect\");\n header('Location: '.$pretty_link_url.$param_string);\n }\n else\n do_action('prli_issue_cloaked_redirect', $pretty_link->redirect_type, $pretty_link, $pretty_link_url, $param_string);\n }\n }", "public function tracking_field() {\n\t\techo cyprus_get_settings( 'mts_analytics_code' );\n\t}", "public static function setTracker($mixable, sfGoogleAnalyticsTracker $tracker)\n {\n sfContext::getInstance()->getRequest()->setAttribute('tracker', $tracker, 'sf_google_analytics_plugin');\n }", "function df_store_url_link($s = null) {return df_store_url($s, S::URL_TYPE_LINK);}", "public function getShotsUrl(): string\n\t{\n\t\treturn $this->shotsUrl;\n\t}", "public function getStorePageUrl()\n {\n return $this->storePage;\n }", "function pmproex_track($experiment, $url, $goal = NULL)\r\n{\r\n\t$stats = get_option('pmpro_experiments_stats', array());\t\r\n\r\n\t//create experiment element if not there\r\n\tif(empty($stats[$experiment]))\r\n\t{\r\n\t\t$stats[$experiment] = array('entrances'=>0);\r\n\t}\r\n\t\r\n\tif(empty($goal))\r\n\t{\r\n\t\t//tracking an entrance\t\t\r\n\t\t$stats[$experiment]['entrances']++;\r\n\t\tif(empty($stats[$experiment][$url]))\r\n\t\t\t$stats[$experiment][$url] = array('entrances'=>0);\r\n\t\t$stats[$experiment][$url]['entrances']++;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t//tracking a goal\r\n\t\tif(empty($stats[$experiment][$url]))\r\n\t\t\t$stats[$experiment][$url] = array('entrances'=>0, $goal=>0);\r\n\t\telseif(empty($stats[$experiment][$url][$goal]))\r\n\t\t\t$stats[$experiment][$url][$goal] = 0;\r\n\t\t$stats[$experiment][$url][$goal]++;\r\n\t}\r\n\t\r\n\t//delete_option('pmpro_experiments_stats');\t\t\r\n\tupdate_option('pmpro_experiments_stats', $stats, 'no');\r\n}", "public function setUrl( $url );", "public function getTakeUrl() { }", "protected function prepareUrlForTracking($url)\n {\n // Ensure it's clean\n $url = trim($url);\n\n // Ensure these are & for the sake of parsing\n while (strpos($url, '&amp;') !== false) {\n $url = str_replace('&amp;', '&', $url);\n }\n\n // Default key and final URL to the given $url\n $trackableKey = $trackableUrl = $url;\n\n // Convert URL\n $urlParts = parse_url($url);\n\n // Ensure a valid scheme\n if (isset($urlParts['scheme']) && !in_array($urlParts['scheme'], array('http', 'https', 'ftp', 'ftps'))) {\n\n return false;\n }\n\n // Ensure a applicable URL (rule out URLs as just #)\n if (!isset($urlParts['host']) && !isset($urlParts['path'])) {\n\n return false;\n }\n\n // Extract any tokens that are part of the query\n $tokenizedParams = $this->extractTokensFromQuery($urlParts);\n\n // Check if URL is trackable\n $tokenizedHost = (!isset($urlParts['host']) && isset($urlParts['path'])) ? $urlParts['path'] : $urlParts['host'];\n if (preg_match('/^(\\{\\S+?\\})/', $tokenizedHost, $match)) {\n $token = $match[1];\n\n // Tokenized hosts shouldn't use a scheme since the token value should contain it\n if ($scheme = (!empty($urlParts['scheme'])) ? $urlParts['scheme'] : false) {\n // Token has a schema so let's get rid of it before replacing tokens\n $this->contentReplacements['first_pass'][$scheme.'://'.$tokenizedHost] = $tokenizedHost;\n unset($urlParts['scheme']);\n }\n\n // Validate that the token is something that can be trackable\n if (!$this->validateTokenIsTrackable($token, $tokenizedHost)) {\n\n return false;\n }\n\n $trackableUrl = (!empty($urlParts['query'])) ? $this->contentTokens[$token].'?'.$urlParts['query'] : $this->contentTokens[$token];\n $trackableKey = $trackableUrl;\n\n // Replace the URL token with the actual URL\n $this->contentReplacements['first_pass'][$url] = $trackableUrl;\n } else {\n // Regular URL without a tokenized host\n $trackableUrl = $this->httpBuildUrl($urlParts);\n\n if ($this->isInDoNotTrack($trackableUrl)) {\n\n return false;\n }\n }\n\n // Append tokenized params to the end of the URL as these will not be part of the stored redirect URL\n // They'll be passed through as regular parameters outside the trackable token\n // For example, {trackable=123}?foo={bar}\n if ($tokenizedParams) {\n // The URL to be tokenized is without the tokenized parameters\n $trackableKey = $trackableUrl . ($this->usingClickthrough || (strpos($trackableUrl, '?') !== false) ? '&' : '?').\n $this->httpBuildQuery($tokenizedParams);\n\n // Replace the original URL with the updated URL before replacing with tokens\n if ($trackableKey !== $url) {\n $this->contentReplacements['first_pass'][$url] = $trackableKey;\n }\n }\n\n return array($trackableKey, $trackableUrl);\n }", "public function saveToCache(){\r\n\t\t$n = \"hotspot_\" . $this->id;\r\n\r\n\t\t\\CacheHandler::setToCache($n,$this,20*60);\r\n\t}", "function storeYoutube()\n {\n }", "function setUrl($url);", "public function getCarrierTrackingUrl()\n {\n return $this->carrierTrackingUrl;\n }", "public function recordAnalytics($icid, $url, $repoICID) {\n $sql = \"INSERT INTO outbound_link (ic_id, url, repo_ic_id) VALUES ($1, $2, $3)\";\n $result = $this->sdb->query($sql, array($icid, $url, $repoICID));\n }", "public function store()\n {\n $this->user_id = Auth::user()->id;\n\n $validatedDate = $this->validate([\n 'title' => 'required',\n 'original_url' => 'required',\n 'platform_id' => 'required',\n 'user_id' => 'required'\n ]);\n \n Url::create($validatedDate);\n \n session()->flash('message', 'Shorten URL Created Successfully.');\n \n $this->resetInputFields();\n }", "public static function gaReferrer()\n {\n return self::isReferred() ? 'ga(\"BaseTracker.set\", \"dimension3\", \"'.$_SERVER['HTTP_REFERER'].'\");' : '';\n }", "protected function setUrl() {\r\n\t\t$this->url = htmlspecialchars(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), ENT_QUOTES);\r\n\t}", "public function setLocation($url);", "function blogolytics_google_tracking() {\n\t?>\n\t<!-- Google Analytics by Blogolytics -->\n\t<script type=\"text/javascript\">\n\t\twindow.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;\n\t\tga('create', '<?php echo blogolytics_get_option( 'connection', 'tracking_code'); ?>', 'auto');\n\t\tga('send', 'pageview');\n\t</script>\n\t<script async src='https://www.google-analytics.com/analytics.js'></script>\n\t<!-- End Google Analytics by Blogolytics -->\n\t<?php\n}", "function google_analytics_insertGATC()\n{\n\n echo get_option('google_analytics_tracking_code');\n\n}", "public function setUrl($url) {}", "public function getStoreUrl()\r\n\t{\r\n\t\treturn Mage::getBaseUrl();\r\n\t}", "public function setSiteUrl()\n {\n }", "function tsuiseki_tracking_get_data($ref = '') {\n $ref = (string)($ref);\n $opts = _tsuiseki_tracking_extract_data_from_url($ref);\n $c_network = '';\n $c_partner = '';\n $c_query = '';\n\n if (isset($_SESSION[TSUISEKI_TRACKER_COOKIE_NAME])) {\n $cookie_data = $_SESSION[TSUISEKI_TRACKER_COOKIE_NAME];\n if (_tsuiseki_tracking_validate_cookie_value($cookie_data)) {\n $parts = _tsuiseki_tracking_extract_cookie_data($cookie_data);\n $data = (string)trim($parts['data']);\n $c_opts = _tsuiseki_tracking_extract_data_from_url($data);\n // Get the values from the cookie.\n $c_network = _tsuiseki_tracking_get_network($c_opts);\n $c_partner = _tsuiseki_tracking_get_partner_id($c_opts);\n $c_query = _tsuiseki_tracking_get_query($c_opts);\n }\n }\n\n $output = '';\n $network = _tsuiseki_tracking_get_network($opts);\n if (!empty($c_network) && ($network == 'free' && $network != $c_network)) {\n // If the network parameter is 'free' and we have a different entry in the\n // session cookie the cookie entry is prefered.\n $network = _check_plain($c_network);\n }\n if (!empty($network)) {\n $output .= '&network='. $network;\n }\n\n $partner = _tsuiseki_tracking_get_partner_id($opts);\n if (empty($partner) && !empty($c_partner)) {\n $partner = _check_plain($c_partner);\n }\n if (!empty($partner)) {\n $output .= '&partner='. $partner;\n }\n\n $query = _tsuiseki_tracking_get_query($opts);\n if (empty($query) && !empty($c_query)) {\n $query = _check_plain($c_query);\n }\n if (!empty($query)) {\n $output .= '&query='. $query;\n }\n return $output;\n}", "function edduh_ajax_track_history() {\n\n\t$page_url = isset( $_REQUEST['page_url'] ) ? esc_url( urldecode( $_REQUEST['page_url'] ) ) : false;\n\t$referrer = isset( $_REQUEST['referrer'] ) ? esc_url( urldecode( $_REQUEST['referrer'] ) ) : false;\n\n\tif ( $page_url ) {\n\t\tdo_action( 'edduh_visited_url', $page_url, time(), $referrer );\n\t}\n\n\twp_send_json_success( array( 'page_url' => $page_url ) );\n}", "function track_insert($array)\n{\n\t$id=track_get_id_from_url($array['url']);\n\tif($id)\n\t\treturn $id;\n\n\t$db=new db_class();\n\t$columns=$db->get_columns(TRACK_TABLE);\n\t$values=array();\n\tforeach($columns as $key)\n\t{\n\t\tif(!strcmp($key, \"url\"))\n\t\t\t$values[$key]=strtolower($array[$key]);\n\t\telse if(!in_array($key, array(\"id\", \"updated\")) && isset($array[$key]))\n\t\t\t$values[$key]=$array[$key];\n\t}\n\tif(!empty($values))\n\t{\n\t\tif($db->insert_from_array(TRACK_TABLE, $values))\n\t\t\treturn $db->insert_id;\n\t\tadd_error(sprintf(_(\"Could not insert track. %s\"), $db->error));\n\t}\n\treturn FALSE;\n}", "public function setURL($url);", "public function setURL($url);", "public function getTrackingNumber()\n {\n return $this->tracking_number;\n }", "public function siteUrl() {}", "function plugin_tb_save($url, $tb_id)\n{\n\tglobal $vars, $trackback;\n\tstatic $fields = array( /* UTIME, */ 'url', 'title', 'excerpt', 'blog_name');\n\n\t$die = '';\n\tif (! $trackback) $die .= 'TrackBack feature disabled. ';\n\tif ($url == '') $die .= 'URL parameter is not set. ';\n\tif ($tb_id == '') $die .= 'TrackBack Ping ID is not set. ';\n\tif ($die != '') return array(PLUGIN_TB_ERROR, $die);\n\n\tif (! file_exists(TRACKBACK_DIR)) return array(PLUGIN_TB_ERROR, 'No such directory: TRACKBACK_DIR');\n\tif (! is_writable(TRACKBACK_DIR)) return array(PLUGIN_TB_ERROR, 'Permission denied: TRACKBACK_DIR');\n\n\t$page = tb_id2page($tb_id);\n\tif ($page === FALSE) return array(PLUGIN_TB_ERROR, 'TrackBack ID is invalid.');\n\n\t// URL validation (maybe worse of processing time limit)\n\t$result = http_request($url, 'HEAD');\n\tif ($result['rc'] !== 200) return array(PLUGIN_TB_ERROR, 'URL is fictitious.');\n\n\t// Update TrackBack Ping data\n\t$filename = tb_get_filename($page);\n\t$data = tb_get($filename);\n\n\t$items = array(UTIME);\n\tforeach ($fields as $key) {\n\t\t$value = isset($vars[$key]) ? $vars[$key] : '';\n\t\tif (preg_match('/[,\"' . \"\\n\\r\" . ']/', $value))\n\t\t\t$value = '\"' . str_replace('\"', '\"\"', $value) . '\"';\n\t\t$items[$key] = $value;\n\t}\n\t$data[rawurldecode($items['url'])] = $items;\n\n\t$fp = fopen($filename, 'w');\n\tset_file_buffer($fp, 0);\n\tflock($fp, LOCK_EX);\n\trewind($fp);\n\tforeach ($data as $line) {\n\t\t$line = preg_replace('/[\\r\\n]/s', '', $line); // One line, one ping\n\t\tfwrite($fp, join(',', $line) . \"\\n\");\n\t}\n\tflock($fp, LOCK_UN);\n\tfclose($fp);\n\n\treturn array(PLUGIN_TB_NOERROR, '');\n}", "function setSyncUrl()\n {\n }", "public static function trackBookmarkVisit(){\r\n\t\tif(self::isBookmarkVisit()) {\r\n\t\t\t$bookmark_count = self::getBookmarkCount();\r\n\t\t\tif($bookmark_count > 10) {\r\n\t\t\t\t$bookmark_count = '10+';\r\n\t\t\t}\r\n\t\t\t$bookmark_position = Helper_Request::getRequest('fb_bmpos', '', 'STR');\r\n\t\t\t$bookmark_source = Helper_Request::getRequest('fb_source', '', 'STR');\r\n\t\t\tif($bookmark_position != '' && $bookmark_source != '') {\r\n\t\t\t\t$position_prepend = $bookmark_source == 'bookmarks_apps' ? 'apps_' : 'favs_';\r\n\t\t\t\t$position_parts = explode('_', $bookmark_position);\r\n\t\t\t\tif(count($position_parts) == 2) {\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function get_tracking_code(): string {\n global $OUTPUT, $USER;\n\n $settings = $this->record->get_property('settings');\n\n $template = new \\stdClass();\n $template->siteid = $settings['siteid'];\n $template->siteurl = $settings['siteurl'];\n $custompiwikjs = (isset($settings['piwikjsurl']) && !empty($settings['piwikjsurl']));\n $template->piwikjsurl = $custompiwikjs ? $settings['piwikjsurl'] : $settings['siteurl'];\n $template->imagetrack = $settings['imagetrack'];\n\n $template->userid = false;\n\n if (!empty($settings['userid']) && !empty($settings['usefield']) && !empty($USER->{$settings['usefield']})) {\n $template->userid = $USER->{$settings['usefield']};\n }\n\n $template->doctitle = \"\";\n\n if (!empty($this->record->get_property('cleanurl'))) {\n $template->doctitle = \"_paq.push(['setDocumentTitle', '\" . $this->trackurl() . \"']);\\n\";\n }\n\n return $OUTPUT->render_from_template('watool_matomo/tracking_code', $template);\n }", "function site($url) {\n\t\t$this->url = $url;\n\t}", "private function saveGoogleResult($url,$key){\n\t\tpreg_match('/\\\"(.*)\\\"/',$url,$realUrl);\n\t\tif(isset($realUrl[1])){\n\t\t\t$newUrl = $realUrl[1];\n\t\t\tSearch::insert(['key' => $key,'url'=>$newUrl,'result'=>strip_tags($url)]);\n\t\t}\n\t}", "function tsuiseki_tracking_install() {\n add_option('tsuiseki_tracking_key', NULL, NULL, 'no');\n $css = TSUISEKI_TRACKER_CSS_CLASS;\n if (empty($css)) {\n $css = 'a.tsuiseki-link';\n }\n add_option('tsuiseki_tracking_css_class', $css, NULL, 'no');\n add_option('tsuiseki_tracking_excluded_uris', 'wp-admin/*', NULL, 'no');\n}", "protected function storeReturnUrl(TemporaryCredentials $temp)\n {\n if ($url = $this->request->input('return_url')) {\n $key = 'oauth_return_url_'.$temp->getIdentifier();\n $this->cache->put($key, $url, ProviderContract::CACHE_TTL);\n }\n }", "public function url()\n\t{\n\t\t/*\n\t\t * Retrieve the ping from the database.\n\t\t */\n\t\t$ping = db()->table('ping')->get('url', $_GET['url'])->where('deleted', null)->where('target', null)->all();\n\t\t\n\t\t/*\n\t\t * Pass the data onto the view.\n\t\t */\n\t\t$this->view->set('notifications', $ping);\n\t}", "function tsuiseki_tracking_view($data) {\n if (!empty($data)) {\n $t_data = (string)(trim($data));\n // We need to cut the first \"ref=\" as it comes from the javascript part\n // and may overlay the partner field.\n if (preg_match('/^ref=.*/', $t_data)) {\n $t_data = mb_substr($t_data, mb_strpos($t_data, '=') + 1);\n }\n $t_parts = preg_split('/;;/', $t_data);\n $src_url = (string)(trim($t_parts[0]));\n $width = (string)(trim($t_parts[1]));\n $height = (string)(trim($t_parts[2]));\n $browser = (string)(trim($t_parts[3]));\n $browser_version = (string)(trim($t_parts[4]));\n $referer = (string)(trim($t_parts[5]));\n if (!empty($referer)) {\n // Wir extrahieren nur die Domain!\n $r_parts = array();\n preg_match('/[a-z]{3,5}:\\/\\/(.+?)[\\/?:]/', $referer, $r_parts);\n if (!empty($r_parts[1])) {\n $referer = 'referer='. (string)trim($r_parts[1]);\n }\n }\n }\n $key = (string)trim($_SESSION['TSUISEKI_TRACKER_KEY']);\n if (!empty($src_url) && !empty($key)) {\n $ref = urldecode($src_url);\n $data = (string)(trim(tsuiseki_tracking_get_data($ref)));\n $data .= '&'. $width .'&'. $height .'&'. $browser .'&'. $browser_version .'&'. $referer;\n $data = urlencode($data);\n $ip = ip2long($_SERVER['REMOTE_ADDR']);\n $url = \"http://tracker.tsuiseki.com/tsuiseki.php?q=$key;0;$ip;$data&ajax=1\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_USERAGENT, (string)trim($_SERVER['HTTP_USER_AGENT']));\n curl_setopt($ch, CURLOPT_REFERER, $src_url);\n $result = curl_exec($ch);\n if (curl_errno($ch) > 0) {\n trigger_error(curl_error($ch), curl_errno($ch));\n }\n curl_close($ch);\n }\n\n // generate the response\n $response = json_encode( array( 'success' => true ) );\n // response output\n header( \"Content-Type: application/json\" );\n echo $response;\n exit;\n //return 0;\n}", "public function create(): void {\r\n if (array_key_exists('SERVER_NAME', $_SERVER)) {\r\n $url = $_SERVER['SERVER_NAME'];\r\n } else {\r\n $url = self::UNKNOWN_SERVER_NAME;\r\n }\r\n $found = $this->loadByUrl($url);\r\n if (! $found) {\r\n $this->url = $url;\r\n $this->name = $url;\r\n $this->save();\r\n }\r\n }", "public function get_tracking_url( $link_identifier = '' ) {\n\t\t$tracking_vars = array(\n\t\t\t'utm_campaign' => $this->get_product_name() . '_licensing',\n\t\t\t'utm_medium' => 'link',\n\t\t\t'utm_source' => $this->get_product_name(),\n\t\t\t'utm_content' => $link_identifier\n\t\t);\n\n\t\t// url encode tracking vars\n\t\t$tracking_vars = urlencode_deep( $tracking_vars );\n\t\t$query_string = build_query( $tracking_vars );\n\n\t\treturn 'https://www.download-monitor.com/extensions/' . str_ireplace( 'dlm-', '', $this->get_product_id() ) . '?' . $query_string;\n\t}", "public function getTrackingNumber()\n {\n return $this->trackingNumber;\n }", "public function store(Request $request)\n {\n Url::create([\n 'url_site' => $request->url_site,\n 'views' => 0,\n 'user_id' => Auth::user()->id,\n 'status' => $request->status,\n ]);\n return redirect()->route('urls.index')->with('success', __('admin.created-success'));\n }", "public function setUrl($url);", "public function setUrl($url);", "public function setUrl($url);", "public function setUrl($url);", "function setUrl( &$value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Url = ( $value );\n }", "function put_sprdh_url() {\n\treturn ('http://www.sprdh.com/');\n}", "function url_save($post_ID) {\n global $post;\n\n if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) {\n return $post_id;\n }\n \n if (isset($_POST)) {\n update_post_meta( $post_ID, '_url_name', strip_tags( $_POST['url_name'] ) );\n }\n}", "public function getLuUrl()\n {\n return Mage::getStoreConfig(self::GENERAL_SETTINGS_PATH . 'lu_url', $this->getStoreId());\n }", "public static function trackId(): string\n {\n return 'tid';\n }", "public function setTrackingURL(SS_HTTPRequest $request, $trackingID)\n {\n $this->trackingURL = Director::makeRelative(Controller::join_links($request->getURL(true), '?t=' . $trackingID));\n return $this;\n }", "public function getTrackingNumber() : string\n\t{\n\t\treturn $this->trackingNumber;\n\t}", "public function getStoreURL(){\r\n\t\t//$this->initDb();\r\n\t\t$this->store_url='';\r\n\t\tif($this->car_id !=0 && $this->getStoreId()!=''){\r\n\t\t\t$this->store_url = getValue(\"SELECT storeurl FROM tbl_store WHERE store_id=\".$this->getStoreId());\r\n\t\t}\r\n\t\treturn $this->store_url;\t\r\n\t}", "public static function setWebsiteURL($paramURL){\n getDatabase()->update(\"settings\",array(\n \"value\" => $paramURL\n ), \"setting = 'website_url'\");\n Cache::store('website_url', $paramURL);\n }" ]
[ "0.6214102", "0.6156579", "0.6023334", "0.6023334", "0.59226966", "0.59196866", "0.5886967", "0.58724874", "0.5849496", "0.582932", "0.58195484", "0.57896745", "0.576315", "0.5739965", "0.57388383", "0.5714585", "0.5711977", "0.5673177", "0.56511813", "0.56464374", "0.56464374", "0.56369954", "0.5624798", "0.5617067", "0.5604551", "0.5602318", "0.5598355", "0.5585184", "0.5583079", "0.5577943", "0.5548853", "0.5537681", "0.5528793", "0.5513558", "0.5504128", "0.54856205", "0.548017", "0.54723877", "0.547136", "0.54474545", "0.542894", "0.5404937", "0.5403848", "0.5393442", "0.53864676", "0.5385757", "0.53827673", "0.53633547", "0.5362843", "0.5360561", "0.5359069", "0.5350496", "0.5341973", "0.5340951", "0.5340198", "0.5324146", "0.53160614", "0.5307775", "0.53048575", "0.5303802", "0.5301", "0.5293704", "0.529175", "0.52915967", "0.52879906", "0.52512306", "0.5248212", "0.5232953", "0.52305096", "0.522219", "0.522219", "0.5221412", "0.52117515", "0.5210388", "0.5209652", "0.52078843", "0.5200271", "0.51973534", "0.51958907", "0.51870674", "0.5186472", "0.5185676", "0.51852834", "0.51712257", "0.5170935", "0.51615757", "0.51587075", "0.51581293", "0.51581293", "0.51581293", "0.51581293", "0.51535964", "0.51522315", "0.514366", "0.51392806", "0.51385003", "0.51317346", "0.51289666", "0.5127834", "0.51273865" ]
0.55283654
33
Update a tracking Url
public function update( UpdateTrackingUrlRequest $request, int $id, UpdateTrackingUrlInterface $updateTrackingUrl ): JsonResponse { try { $data = $updateTrackingUrl->handle($id, $request->url, $request->hash, $request->opens); return response()->json([ 'message' => 'The resource was updated successfully', 'data' => $data, ]); } catch (Exception $exception) { return response()->json([ 'exception' => $exception, 'message' => $exception->getMessage(), ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function updateUrl(){\n $this->url->status_code = $this->response['status_code'];\n $this->url->reason_phrase = $this->response['reason_phrase'];\n $this->url->location = $this->response['location'];\n $this->url->content_type = $this->response['content_type'];\n $this->url->content_length = $this->response['content_length'];\n $this->url->save();\n }", "abstract public function get_url_update();", "public function update()\n {\n $validatedDate = $this->validate([\n 'title' => 'required',\n 'original_url' => 'required',\n 'platform_id' => 'required'\n ]);\n \n $link = Url::find($this->link_id);\n $link->update([\n 'title' => $this->title,\n 'shorten_url' => $this->shorten_url,\n ]);\n \n $this->updateMode = false;\n \n session()->flash('message', 'Shorten URL Updated Successfully.');\n $this->resetInputFields();\n }", "public function &setExternalUpdateProfileUrl($value);", "public function testUpdateUrlUsingPOST()\n {\n }", "function setUrl($url);", "function update() {\n\t\t$vars = $this->params['url'];\n\t\t$this->Event->id = $vars['id'];\n\t\t$this->Event->saveField('start', $vars['start']);\n\t\t$this->Event->saveField('end', $vars['end']);\n\t\t$this->Event->saveField('all_day', $vars['allday']);\n\t}", "function wpmu_admin_redirect_add_updated_param($url = '')\n {\n }", "function setSyncUrl()\n {\n }", "function setUrl( &$value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Url = ( $value );\n }", "function update_refurls()\n{\n\tglobal $database;\n\n\t// IF URL IS NOT EMPTY\n\t$referring_url = $_SERVER[\"HTTP_REFERER\"];\n\tif(strpos(strtolower($referring_url), strtolower($_SERVER[\"HTTP_HOST\"])) !== FALSE) { return; }\n\n\tif( $referring_url )\n {\n\t // IS URL ALREADY IN DATABASE? IF YES, ADD TO HITS. IF NO, ADD NEW ROW\n\t $referring_url = str_replace(\"http://www.\", \"http://\", $referring_url);\n\t $database->database_query(\"\n INSERT INTO se_statrefs\n (statref_hits, statref_url)\n VALUES\n ('1', '{$referring_url}')\n\t\t\tON DUPLICATE KEY UPDATE\n statref_hits=statref_hits+1\n \");\n \n\t // IF 1000 ROWS REACHED, DELETE ONE TO MAKE ROOM\n\t $refurl_totalrows = $database->database_num_rows($database->database_query(\"SELECT statref_id FROM se_statrefs\"));\n \n\t if( $refurl_totalrows > 1000 )\n $database->database_query(\"DELETE FROM se_statrefs WHERE statref_hits='1' ORDER BY statref_id ASC LIMIT 1\");\n\t}\n}", "function updateHitCount($short_url_id){\n\t\t$this->query('UPDATE short_urls SET hit_count = hit_count + 1, modified = NOW() WHERE id='.$short_url_id);\n\t}", "public function change_details_url() {\n\t\t\tglobal $change_details_plugin_url_script, $pagenow;\n\t\t\t$plugins = get_plugin_updates();\n\t\t\tif ( ! $change_details_plugin_url_script && in_array( $pagenow, array( 'update-core.php', 'plugins.php' ) ) && ! empty( $plugins ) ) {\n\t\t\t\t$plugins_string = '';\n\t\t\t\tforeach ( $plugins as $plugin_key => $plugin_value ) {\n\t\t\t\t\t$plugin_key = strtolower( $plugin_key );\n\t\t\t\t\tif ( strpos( $plugin_key, 'cherry' ) !== false ) {\n\t\t\t\t\t\t$plugins_string .= '\"' . $plugin_value ->update ->slug . '\" : \"' . $plugin_value ->update ->url .'\", ';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<script>\n\t\t\t\t\t( function( $ ){\n\t\t\t\t\t\tvar plugin_updates = {<?php echo $plugins_string; ?>};\n\t\t\t\t\t\tfor ( var plugin in plugin_updates ) {\n\t\t\t\t\t\t\t$('[href*=\"' + plugin + '\"].thickbox').removeClass('thickbox').attr( {'href': plugin_updates[plugin], 'target' : \"_blank\" } );\n\t\t\t\t\t\t};\n\t\t\t\t\t}( jQuery ) )\n\t\t\t\t</script>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t$change_details_plugin_url_script = true;\n\t\t}", "public function update(Request $request, $url)\n {\n $this->urlSrvc->update($request->only('long_url', 'meta_title'), $url);\n\n return redirect()->route('dashboard')\n ->withFlashSuccess(__('Link changed successfully !'));\n }", "public function update(Request $request, Url $url)\n { \n $url->update([\n 'full_url' => $request->full_url,\n 'short_code' => $request->short_code,\n 'counter' => $request->counter,\n 'expiry' => $request->expiry\n ]);\n\n return redirect()->route('admin.url.index')->withFlashSuccess('Url have been submitted!');\n }", "function update_home_siteurl($old_value, $value)\n {\n }", "public function setLocation($url);", "function track(){\n\n\t\tif($params = $this->getURLParams()) {\n\n\t\t\t//different link versions, for maintaining backwards compatability\n\t\t\tif(isset($params['Version']) && $params['Version'] == \"v2\"){\n\n\t\t\t\tif($decrypted = $this->decryptHash()){\n\n\t\t\t\t\tif($recipient = DataObject::get_one(\"Newsletter_SentRecipient\",\"\\\"Email\\\" = '\".$decrypted['e'].\"' AND \\\"ParentID\\\" = \".$decrypted['nl'])){\n\t\t\t\t\t\t$recipient->recordClick();\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($decrypted['l']) && is_numeric($decrypted['l']) && $link = DataObject::get_by_id('Newsletter_TrackedLink', (int)$decrypted['l'])){\n\t\t\t\t\t\t$link->recordClick();\n\t\t\t\t\t\treturn $this->redirect($link->Original, 301);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}elseif(isset($params['Hash']) && ($hash = Convert::raw2sql($params['Hash']))) {\n\t\t\t\t$link = DataObject::get_one('Newsletter_TrackedLink', \"\\\"Hash\\\" = '$hash'\");\n\t\t\t\tif($link) {\n\t\t\t\t\t// check for them visiting this link before\n\t\t\t\t\t$link->recordClick();\n\t\t\t\t\treturn $this->redirect($link->Original, 301);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn $this->httpError(404);\n\t}", "public function autoTrackUrl() {\n\t\treturn apply_filters( 'aioseo_google_autotrack', plugin_dir_url( AIOSEO_FILE ) . 'app/Common/Assets/js/autotrack.js' );\n\t}", "public function setUrl(?string $url): void;", "public function setUrl($url) {}", "public static function setWebsiteURL($paramURL){\n getDatabase()->update(\"settings\",array(\n \"value\" => $paramURL\n ), \"setting = 'website_url'\");\n Cache::store('website_url', $paramURL);\n }", "function analytics_trackurl() {\n global $DB, $PAGE, $COURSE;\n $pageinfo = get_context_info_array($PAGE->context->id);\n $trackurl = \"'/\";\n\n // Adds course category name.\n if (isset($pageinfo[1]->category)) {\n if ($category = $DB->get_record('course_categories', array('id'=>$pageinfo[1]->category))) {\n $cats=explode(\"/\",$category->path);\n foreach (array_filter($cats) as $cat) {\n if ($categorydepth = $DB->get_record(\"course_categories\", array(\"id\" => $cat))) {;\n $trackurl .= urlencode($categorydepth->name).'/';\n }\n }\n }\n }\n\n // Adds course full name.\n if (isset($pageinfo[1]->fullname)) {\n if (isset($pageinfo[2]->name)) {\n $trackurl .= urlencode($pageinfo[1]->fullname).'/';\n } else if ($PAGE->user_is_editing()) {\n $trackurl .= urlencode($pageinfo[1]->fullname).'/'.get_string('edit', 'local_analytics');\n } else {\n $trackurl .= urlencode($pageinfo[1]->fullname).'/'.get_string('view', 'local_analytics');\n }\n }\n\n // Adds activity name.\n if (isset($pageinfo[2]->name)) {\n $trackurl .= urlencode($pageinfo[2]->modname).'/'.urlencode($pageinfo[2]->name);\n }\n \n $trackurl .= \"'\";\n return $trackurl;\n}", "public function updateTinyUrl(TinyUrl $tinyUrl): void;", "public function setSiteUrl()\n {\n }", "public function updatePhotoUrl($id, $url){\n\t\treturn DB::table('company')->where('user_id', $id)->update(['pic_url' => $url]);\n\t}", "public function setUrl( $url );", "public function hitURL($url)\n\t{\n\t\t$this->statpro->insert(\n\t\t\t6,\n\t\t\tarray(\n\t\t\t\t$url,\n\t\t\t\ttime(),\n\t\t\t)\n\t\t);\n\t}", "public function testUpdateSite()\n {\n }", "public function url()\n\t{\n\t\t/*\n\t\t * Retrieve the ping from the database.\n\t\t */\n\t\t$ping = db()->table('ping')->get('url', $_GET['url'])->where('deleted', null)->where('target', null)->all();\n\t\t\n\t\t/*\n\t\t * Pass the data onto the view.\n\t\t */\n\t\t$this->view->set('notifications', $ping);\n\t}", "public function update($l_event_url)\n {\n $query=\"UPDATE l_event_url \".\n\t \"SET \".\n \"id= \".$l_event_url->id.\" ,\".\n \"link= \".$l_event_url->link.\" ,\".\n \"entity0= \".$l_event_url->entity0.\" ,\".\n \"entity1= \".$l_event_url->entity1.\" ,\".\n \"edits_pending= \".$l_event_url->edits_pending.\" ,\".\n \"last_updated='\".$this->sqlSafe($l_event_url->last_updated).\"',\".\n \"link_order= \".$l_event_url->link_order.\" ,\".\n \"entity0_credit='\".$this->sqlSafe($l_event_url->entity0_credit).\"',\".\n \"entity1_credit='\".$this->sqlSafe($l_event_url->entity1_credit).\"' \". \n\t \"WHERE id=\".$l_event_url->id;\n\n $this->executeQuery($query);\n }", "public function setUrl(string $url): void;", "public static function setUrl(): void\n\t{\n\n\t\tif (strpos(static::$fullUrl, '?')) {\n\t\t\tstatic::$url = substr(static::$fullUrl, 0, strpos(static::$fullUrl, '?'));\n\t\t} else {\n\t\t\tstatic::$url = static::$fullUrl;\n\t\t}\n\n\t}", "protected function setUrl() {\r\n\t\t$this->url = htmlspecialchars(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), ENT_QUOTES);\r\n\t}", "public function getTrackingLink( $strTracking ) \r\n {\r\n // original link is still unknown\r\n return 'http://trackthepack.com/track/'.$strTracking;\r\n }", "function get_url($uniqueid) {\n $db = connect_to_database();\n $sql = <<<EOD\n UPDATE shortenerLogs \n\t\tSET views = views + 1 WHERE id = ?;\nEOD;\n\n $stmt = $db->prepare($sql);\n $params = [$uniqueid];\n $stmt->execute($params);\n\t\n $sql = <<<EOD\n SELECT * FROM shortenerLogs WHERE id =?;\nEOD;\n\n $stmt = $db->prepare($sql);\n $params = [$uniqueid];\n $stmt->execute($params);\n\t\n $res = $stmt->fetch(PDO::FETCH_ASSOC);\n\n print_r($res);\n\n return $res['link'];\n}", "public function setURL($url);", "public function setURL($url);", "public function getUrl($updateId);", "public function setUrl($url){\n $this->url = $url;\n }", "public function setUrl($url);", "public function setUrl($url);", "public function setUrl($url);", "public function setUrl($url);", "protected function set_url($location=null)\n\t{\n\n\t\t$this->url = $this->api_host.$location;\n\t\t\n\t}", "public function update(Request $request, $id)\n {\n if (Url::where('user_id', Auth::user()->id)) {\n Url::find($id)->update([\n 'url_site' => $request->url_site,\n 'status' => $request->status\n ]);\n return redirect()->route('urls.index')->with('success', __('admin.updated-success'));\n } else\n abort(403);\n }", "function update_file_url( $fn, $fu ){\n // Prepare UPDATE statement to update file url\n $update = \"UPDATE files SET url = :fileurl WHERE\n filename = :filename\";\n $stmt = $this->pdo->prepare($update);\n\n // Bind parameters\n $stmt->bindParam(':filename', $fn);\n $stmt->bindParam(':fileurl', $fu);\n\n // Execute statement\n $stmt->execute();\n\n return;\n }", "public function addUrl() {\r\n\t\t$current = $this->params['url']['url'];\r\n\t\t$accept = array('show', 'admin_show', 'admin_index');\r\n\t\tif(in_array($this->action, $accept)) {\r\n\t\t\tif ($this->Session->read('history.current') != $current){\r\n\t\t\t\t//$this->Session->write('history.previous', $this->Session->read('history.current'))->write('history.current', $current);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function track_link($slug,$values)\n {\n global $wpdb, $prli_click, $prli_options, $prli_link, $prli_update;\n \n $query = \"SELECT * FROM \".$prli_link->table_name.\" WHERE slug='$slug' LIMIT 1\";\n $pretty_link = $wpdb->get_row($query);\n $pretty_link_target = apply_filters('prli_target_url',array('url' => $pretty_link->url, 'link_id' => $pretty_link->id));\n $pretty_link_url = $pretty_link_target['url'];\n \n if(isset($pretty_link->track_me) and $pretty_link->track_me)\n {\n $first_click = 0;\n \n $click_ip = isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:'';\n $click_referer = isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:'';\n $click_uri = isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI']:'';\n $click_user_agent = isset($_SERVER['HTTP_USER_AGENT'])?$_SERVER['HTTP_USER_AGENT']:'';\n\n //Set Cookie if it doesn't exist\n $cookie_name = 'prli_click_' . $pretty_link->id;\n\n //Used for unique click tracking\n $cookie_expire_time = time()+60*60*24*30; // Expire in 30 days\n \n if(!isset($_COOKIE[$cookie_name]))\n {\n setcookie($cookie_name,$slug,$cookie_expire_time,'/');\n $first_click = 1;\n }\n \n if(isset($prli_options->extended_tracking) and $prli_options->extended_tracking == 'extended')\n {\n $click_browser = $this->php_get_browser();\n $click_host = gethostbyaddr($click_ip);\n\n $visitor_cookie = 'prli_visitor';\n //Used for visitor activity\n $visitor_cookie_expire_time = time()+60*60*24*365; // Expire in 1 year\n \n // Retrieve / Generate visitor id\n if(!isset($_COOKIE[$visitor_cookie]))\n {\n $visitor_uid = $prli_click->generateUniqueVisitorId();\n setcookie($visitor_cookie,$visitor_uid,$visitor_cookie_expire_time,'/');\n }\n else\n $visitor_uid = $_COOKIE[$visitor_cookie];\n }\n else\n {\n $click_browser = array( 'browser' => '', 'version' => '', 'platform' => '', 'crawler' => '' );\n $click_host = '';\n $visitor_uid = '';\n }\n \n if($prli_options->extended_tracking != 'count')\n {\n //Record Click in DB\n $insert_str = \"INSERT INTO {$prli_click->table_name} (link_id,vuid,ip,browser,btype,bversion,os,referer,uri,host,first_click,robot,created_at) VALUES (%d,%s,%s,%s,%s,%s,%s,%s,%s,%s,%d,%d,NOW())\";\n $insert = $wpdb->prepare($insert_str, $pretty_link->id,\n $visitor_uid,\n $click_ip,\n $click_user_agent,\n $click_browser['browser'],\n $click_browser['version'],\n $click_browser['platform'],\n $click_referer,\n $click_uri,\n $click_host,\n $first_click,\n $this->this_is_a_robot($click_user_agent,$click_browser));\n \n $results = $wpdb->query( $insert );\n \n do_action('prli_record_click',array('link_id' => $pretty_link->id, 'click_id' => $wpdb->insert_id, 'url' => $pretty_link_url));\n }\n else\n {\n global $prli_link_meta;\n $exclude_ips = explode(\",\", $prli_options->prli_exclude_ips);\n if(!in_array($click_ip, $exclude_ips) and !$this->this_is_a_robot($click_user_agent,$click_browser))\n {\n $clicks = $prli_link_meta->get_link_meta($pretty_link->id, 'static-clicks', true);\n $clicks = (empty($clicks) or $clicks === false)?0:$clicks;\n $prli_link_meta->update_link_meta($pretty_link->id, 'static-clicks', $clicks+1);\n\n if($first_click)\n {\n $uniques = $prli_link_meta->get_link_meta($pretty_link->id, 'static-uniques', true);\n $uniques = (empty($uniques) or $uniques === false)?0:$uniques;\n $prli_link_meta->update_link_meta($pretty_link->id, 'static-uniques', $uniques+1);\n }\n }\n }\n }\n \n // Reformat Parameters\n $param_string = '';\n \n if(isset($pretty_link->param_forwarding) and ($pretty_link->param_forwarding == 'custom' OR $pretty_link->param_forwarding == 'on') and isset($values) and count($values) >= 1)\n {\n $first_param = true;\n foreach($values as $key => $value)\n {\n if($first_param)\n {\n $param_string = (preg_match(\"#\\?#\", $pretty_link_url)?\"&\":\"?\");\n $first_param = false;\n }\n else\n $param_string .= \"&\";\n \n $param_string .= \"$key=$value\";\n }\n }\n \n if(isset($pretty_link->nofollow) and $pretty_link->nofollow)\n header(\"X-Robots-Tag: noindex, nofollow\", true);\n\n switch($pretty_link->redirect_type)\n {\n case '301':\n header(\"HTTP/1.1 301 Moved Permanently\");\n header('Location: '.$pretty_link_url.$param_string);\n break;\n default:\n if( $pretty_link->redirect_type == '307' or\n !$prli_update->pro_is_installed_and_authorized() )\n {\n if($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0')\n header(\"HTTP/1.1 302 Found\");\n else\n header(\"HTTP/1.1 307 Temporary Redirect\");\n header('Location: '.$pretty_link_url.$param_string);\n }\n else\n do_action('prli_issue_cloaked_redirect', $pretty_link->redirect_type, $pretty_link, $pretty_link_url, $param_string);\n }\n }", "public function getUpdateUrl()\n {\n return $this->urlBuilder->getUrl('walleycheckout/update');\n }", "public function update_track_number($track_id,$track) { \n\n\t\t$playlist_id\t= Dba::escape($this->id); \n\t\t$track_id\t= Dba::escape($track_id); \n\t\t$track\t\t= Dba::escape($track); \n\n\t\t$sql = \"UPDATE `playlist_data` SET `track`='$track' WHERE `id`='$track_id' AND `playlist`='$playlist_id'\"; \n\t\t$db_results = Dba::query($sql); \n\n\t}", "public function setRedirectTinyUrlVisitCount(int $id, int $count): void\n {\n if(!filled($count)) {\n $udatedCount = 1; //first time visit to tinyUrl\n } \n else {\n $udatedCount = $count + 1;\n }\n self::where('id', $id)->update(array('url_visit' => $udatedCount));\n }", "private function setUrl(): void\n {\n $completeUrl = $_SERVER['REQUEST_URI'];\n $explodedUrl = \\explode('?', $completeUrl);\n $this->url = trim($explodedUrl[0], '/'); // Cleaned URL\n }", "function it_exchange_custom_url_tracking_addon_increment_custom_url_click() {\n\n\t// Don't add if using default permalinks\n\tif ( ! get_option( 'permalink_structure' ) )\n\t\treturn;\n\n\t$post_id = get_query_var( 'p' );\n\t$custom_url = get_query_var( 'it_exchange_custom_url' );\n\t$custom_url = empty( $custom_url ) ? false : urldecode( $custom_url );\n\n\t// Set cookie on first time today\n\tif ( ! empty( $custom_url ) && empty( $_COOKIE['it-exchange-custom-url-' . sanitize_title_with_dashes( $custom_url )] ) ) {\n\t\tsetcookie( 'it-exchange-custom-url-' . sanitize_title_with_dashes( $custom_url ), true, time()+3600*24 );\n\t\t$first_time = true;\n\t}\n\n\tif ( ! empty( $first_time) && ! empty( $post_id ) && ! empty( $custom_url ) ) {\n\t\t$custom_url_clicks = get_post_meta( $post_id, '_it_exchange_custom_url_clicks', true );\n\t\t$custom_url_clicks[$custom_url] = empty( $custom_url_clicks[$custom_url] ) ? 1 : $custom_url_clicks[$custom_url] + 1;\n\t\tupdate_post_meta( $post_id, '_it_exchange_custom_url_clicks', $custom_url_clicks );\n\t}\n\tunset( $custom_url );\n}", "private function _get_url($track) {\n\t\t$site_url = ( is_ssl() ? 'https://':'http://' ).$_SERVER['HTTP_HOST'];\n\t\tforeach ($track as $k=>$value) {\n\t\t\tif (strpos(strtolower($value), strtolower($site_url)) === 0) {\n\t\t\t\t$track[$k] = substr($track[$k], strlen($site_url));\n\t\t\t}\n\t\t\tif ($k == 'data') {\n\t\t\t\t$track[$k] = preg_replace(\"/^https?:\\/\\/|^\\/+/i\", \"\", $track[$k]);\n\t\t\t}\n\n\t\t\t//This way we don't lose search data.\n\t\t\tif ($k == 'data' && $track['code'] == 'search') {\n\t\t\t\t$track[$k] = urlencode($track[$k]);\n\t\t\t} else {\n\t\t\t\t$track[$k] = preg_replace(\"/[^a-z0-9\\.\\/\\+\\?=-]+/i\", \"_\", $track[$k]);\n\t\t\t}\n\n\t\t\t$track[$k] = trim($track[$k], '_');\n\t\t}\n\t\t$char = (strpos($track['data'], '?') === false)? '?':'&amp;';\n\t\treturn str_replace(\"'\", \"\\'\", \"/{$track['code']}/{$track['data']}{$char}referer=\" . urlencode( isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : '' ) );\n\t}", "public function setTrackingURL(SS_HTTPRequest $request, $trackingID)\n {\n $this->trackingURL = Director::makeRelative(Controller::join_links($request->getURL(true), '?t=' . $trackingID));\n return $this;\n }", "public function updateSettings(Request $request)\n {\n \t$GoogleAnalyticsSettings = GoogleAnalyticsSettings::find(1);\n \t$GoogleAnalyticsSettings->tracking_code = $request->tracking_code;\n \t$GoogleAnalyticsSettings->view_id = $request->view_id;\n \t$GoogleAnalyticsSettings->update();\n\n \treturn redirect()->action( \"GoogleAnalyticsController@indexSettings\" );\n }", "function setApiUrl($value)\n {\n $this->_props['ApiUrl'] = $value;\n }", "public function setUrl($ip)\n {\n $this->url = $this->baseUrl . $ip . \"?access_key=\" . $this->apiKey;\n }", "function trackback_url($deprecated_echo = \\true)\n {\n }", "function update_callback_url($callback_url, $xPub, $blockonomics,$existing_api)\n\t{\n\t $blockonomics->update_callback(\n\t $existing_api,\n\t $callback_url,\n\t $xPub\n\t );\n\t}", "public function update(){\n foreach (the()->project->languages as $lang){\n $field=\"url_$lang\";\n if($this->urlExists($this->$field,$lang)){\n $increment=1;\n $url=$this->$field.'-'.$increment;\n while($this->urlExists($url,$lang)){\n $increment++;\n $url=$this->$field.'-'.$increment;\n }\n $this->$field=$url;\n }\n $this->$field=strtolower($this->$field);\n $this->$field=pov()->utils->string->clean($this->$field,\"/\");\n }\n\n\n parent::update();\n\n }", "function setURL($url){\n $this->urltoopen = $url;\n }", "public function setUrl($url) {\n $this->url = $url;\n }", "public function getURL()\n {\n return $this->site->getURL() . 'unl_progress/edit/';\n\n }", "public function track($trackingNumber);", "function wprss_change_fb_url( $post_id, $url ) {\n if ( stripos( $url, 'http://facebook.com' ) === 0\n || stripos( $url, 'http://www.facebook.com' ) === 0\n || stripos( $url, 'https://facebook.com' ) === 0\n || stripos( $url, 'https://www.facebook.com' ) === 0\n ) {\n # Generate the new URL to FB Graph\n $com_index = stripos( $url, '.com' );\n $fb_page = substr( $url, $com_index + 4 ); # 4 = length of \".com\"\n $fb_graph_url = 'http://graph.facebook.com' . $fb_page;\n # Contact FB Graph and get data\n $response = wp_remote_get( $fb_graph_url );\n # If the repsonse successful and has a body\n if ( !is_wp_error( $response ) && isset( $response['body'] ) ) {\n # Parse the body as a JSON string\n $json = json_decode( $response['body'], true );\n # If an id is present ...\n if ( isset( $json['id'] ) ) {\n # Generate the final URL for this feed and update the post meta\n $final_url = \"http://www.facebook.com/feeds/page.php?format=rss20&id=\" . $json['id'];\n update_post_meta( $post_id, 'wprss_url', $final_url, $url );\n }\n }\n }\n }", "protected function get_url()\n {\n return $this->base_url + $this->api_version; \n }", "public function getDataUpdaterUrl(): string\n {\n return $this->getUrl('realthanks/config/update');\n }", "public function trackingUrl($trackingNumber, $language = null, $params = [])\n {\n return $this->trackingUrl . '?tracknumbers=' . $trackingNumber;\n }", "public function setURL($url)\n {\n $this->url = $url;\n }", "public function statusUpdate($theTweet,$shrinkURLs=true){\n\t\tif(true===$shrinkURLs){\t\t\t\n\t\t\t$regex = '@((https?://)?([-\\w]+\\.[-\\w\\.]+)+\\w(:\\d+)?(/([-\\w/_\\.]*(\\?\\S+)?)?)*)@';\n\t\t\t$theTweet = preg_replace_callback($regex, array(&$this, 'createTinyURLCallback'), $theTweet);\n\t\t}\n\t\t\n\t\tif(Configure::read('debug') == 0) $this->save(array('status' => $theTweet));\n\t\telse debug($theTweet);\n\t}", "function update_carrier_url()\n{\n // Get all carriers\n $sql = '\n\t\tSELECT c.`id_carrier`, c.`url`\n\t\tFROM `' . _DB_PREFIX_ . 'carrier` c';\n $carriers = Db::getInstance()->executeS($sql);\n\n // Check each one and erase carrier URL if not correct URL\n foreach ($carriers as $carrier) {\n if (empty($carrier['url']) || !preg_match('/^https?:\\/\\/[:#%&_=\\(\\)\\.\\? \\+\\-@\\/a-zA-Z0-9]+$/', $carrier['url'])) {\n Db::getInstance()->execute('\n\t\t\t\tUPDATE `' . _DB_PREFIX_ . 'carrier`\n\t\t\t\tSET `url` = \\'\\'\n\t\t\t\tWHERE `id_carrier`= ' . (int) ($carrier['id_carrier']));\n }\n }\n}", "public function setUrl($value)\n {\n $this->_url = $value;\n }", "public function setUpdateUrlOverride($url) {\n update_option($this->updateUrlOverrideOptName, $url);\n }", "function writeUrl() {\n\n }", "public function getPageviewUrl () {\n $urlPixel = 'https://www.google-analytics.com/collect?v=1'\n . '&tid=' . $this->GAtrackingID\n . '&t=pageview'\n . '&dp=' . $this->getPath()\n . '&dt=' . urlencode($this->title)\n . '&cn=' . urlencode($this->campaign)\n . '&cs=' . urlencode($this->source)\n . '&cm=' . urlencode($this->medium)\n . '&cc=' . urlencode($this->content)\n . '&cid=' . $this->supporterID; \n return $urlPixel;\n }", "public function update()\n {\n // ...\n // ...\n // ...\n // ...\n\n // Maintenant je redirige vers la page 'mon-panier'\n header('Location: '.$this->baseUrl.'/mon-panier/');\n }", "public function setUrl($url)\r\n {\r\n $this->path['url'] = $url;\r\n }", "function setUrl($url) {\n\t\t$this->_url = $url;\n\t}", "function setUrl($url) {\n\t\t$this->_url = $url;\n\t}", "private function TrafficUpdate() {\n $this->getTraffic(); //Chamando o metodo getTraffic\n $ArrSiteViews = ['siteviews_pages' => $this->Traffic['siteviews_pages'] + 1]; //Atualizando a pages\n $updatePageViews = new Update; //instanciando a classe Update\n $updatePageViews->ExeUpdate('siteviews', $ArrSiteViews, \"WHERE siteviews_date = :date\", \"date={$this->Date}\"); //Executando o metodo ExeUpdate, neste informando tabela e quais dados atualizar\n\n $this->Traffic = null; //Liberado espaço da memoria\n }", "function trackPageView() {\n $timeStamp = time();\n $domainName = $_SERVER[\"SERVER_NAME\"];\n if (empty($domainName)) {\n $domainName = \"\";\n }\n\n // Get the referrer from the utmr parameter, this is the referrer to the\n // page that contains the tracking pixel, not the referrer for tracking\n // pixel.\n $documentReferer = $_GET[\"utmr\"];\n if (empty($documentReferer) && $documentReferer !== \"0\") {\n $documentReferer = \"-\";\n } else {\n $documentReferer = urldecode($documentReferer);\n }\n $documentPath = $_GET[\"utmp\"];\n if (empty($documentPath)) {\n $documentPath = \"\";\n } else {\n $documentPath = urldecode($documentPath);\n }\n\n $account = $_GET[\"utmac\"];\n $userAgent = $_SERVER[\"HTTP_USER_AGENT\"];\n if (empty($userAgent)) {\n $userAgent = \"\";\n }\n\n // Try and get visitor cookie from the request.\n $cookie = isset($_COOKIE[COOKIE_NAME]) ? $_COOKIE[COOKIE_NAME] : '';\n\n $dcmguid = isset($_SERVER[\"HTTP_X_DCMGUID\"]) ? $_SERVER[\"HTTP_X_DCMGUID\"] : '';\n $visitorId = getVisitorId(\n $dcmguid, $account, $userAgent, $cookie);\n\n // Always try and add the cookie to the response.\n setrawcookie(\n COOKIE_NAME,\n $visitorId,\n $timeStamp + COOKIE_USER_PERSISTENCE,\n COOKIE_PATH);\n\n $utmGifLocation = \"http://www.google-analytics.com/__utm.gif\";\n\n // Construct the gif hit url.\n $utmUrl = $utmGifLocation . \"?\" .\n \"utmwv=\" . VERSION .\n \"&utmn=\" . getRandomNumber() .\n \"&utmhn=\" . urlencode($domainName) .\n \"&utmr=\" . urlencode($documentReferer) .\n \"&utmp=\" . urlencode($documentPath) .\n \"&utmac=\" . $account .\n \"&utmcc=__utma%3D999.999.999.999.999.1%3B\" .\n \"&utmvid=\" . $visitorId .\n \"&utmip=\" . getIP($_SERVER[\"REMOTE_ADDR\"]);\n\n sendRequestToGoogleAnalytics($utmUrl);\n\n // If the debug parameter is on, add a header to the response that contains\n // the url that was used to contact Google Analytics.\n if (!empty($_GET[\"utmdebug\"])) {\n header(\"X-GA-MOBILE-URL:\" . $utmUrl);\n }\n // Finally write the gif data to the response.\n writeGifData();\n }", "function wprss_update_feed_meta( $meta_id, $post_id, $meta_key, $meta_value ) {\n $post = get_post( $post_id );\n if ( $post !== NULL && $post->post_status === 'publish' && $post->post_type === 'wprss_feed' ) {\n if ( $meta_key === 'wprss_url' )\n wprss_change_fb_url( $post_id, $meta_value );\n }\n }", "public function tracking()\n {\n if (Request::has('h')) {\n $track = Tracking::getByHash(Request::input('h'));\n if ($track->isActive()) {\n $data = [\n 'tracking_id' => $track->tracking_id,\n 'data' => json_encode(Request::except('h'))\n ];\n Tracking::log($data);\n }\n }\n\n // if we have a mail_id, we update the mail status and the date where it is opened\n if (Request::has(Tracking::MAIL_ID)) {\n if (Mail::exists(uuid('bytes', Request::input(Tracking::MAIL_ID)))) {\n $mail = Mail::getById(uuid('bytes', Request::input(Tracking::MAIL_ID)));\n\n if ($mail->mail_status_id != Mail::STATUS_OPENED) {\n $mail->mail_status_id = Mail::STATUS_OPENED;\n $mail->opened_at = Carbon::now();\n $mail->save();\n }\n }\n }\n\n header('Content-type:image/jpg');\n header(\"Pragma: no-cache\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0, public\");\n header(\"Expires: 0\");\n exit;\n }", "public function update_traffic($param){\n }", "function google_analytics_config()\n{\n\n $tracking_code = $this->getRequest()->getParam('google_analytics_tracking_code');\n set_option('google_analytics_tracking_code', $tracking_code);\n\n}", "public function setCurrentUrl(Url $url): void;", "public function setUrl($url)\r\n {\r\n $this->url = $url;\r\n }", "function edduh_ajax_track_history() {\n\n\t$page_url = isset( $_REQUEST['page_url'] ) ? esc_url( urldecode( $_REQUEST['page_url'] ) ) : false;\n\t$referrer = isset( $_REQUEST['referrer'] ) ? esc_url( urldecode( $_REQUEST['referrer'] ) ) : false;\n\n\tif ( $page_url ) {\n\t\tdo_action( 'edduh_visited_url', $page_url, time(), $referrer );\n\t}\n\n\twp_send_json_success( array( 'page_url' => $page_url ) );\n}", "public function getUrl()\n {\n return WEB_SERVER_BASE_URL . '/badges/' . $this->data['id'];\n }", "public function setURL($url)\n\t\t{\n\t\t\t$this->url = preg_replace(\"#/$#\", \"\", $url);\n\t\t}", "public function setUrl($url) {\n\t\t$this->url = $url;\n\t}", "private function get_tracking_url($type, $tracking_number) {\n\t\t$url = '';\n\n\t\tswitch($type)\n\t\t{\n\t\t\tcase \"fedex\":\n\t\t\t\t$url = 'http://www.fedex.com/Tracking?language=english&cntry_code=us&tracknumbers=' . $tracking_number;\n\t\t\t\tbreak;\n\n\t\t\tcase \"ups\":\n\t\t\t\t$url = 'http://wwwapps.ups.com/WebTracking/processInputRequest?TypeOfInquiryNumber=T&InquiryNumber1=' . $tracking_number;\n\t\t\t\tbreak;\n\n\t\t\tcase \"usps\":\n\t\t\t\t$url = 'https://tools.usps.com/go/TrackConfirmAction?qtc_tLabels1=' . $tracking_number;\n\t\t\t\tbreak;\t\t\n\n\t\t}\n\n\t\treturn $url;\n\n\t\t\n\t}", "public static function setTracker($mixable, sfGoogleAnalyticsTracker $tracker)\n {\n sfContext::getInstance()->getRequest()->setAttribute('tracker', $tracker, 'sf_google_analytics_plugin');\n }", "private function setUrl($sourceUrl)\n {\n $rawUrl = parse_url($sourceUrl);\n $rawQuery = (isset($rawUrl['query'])) ? $rawUrl['query'] : \"\";\n\n $url = str_replace($rawQuery, '', $sourceUrl);\n\n $query = preg_replace('/([\\?|&]{0,1}p=\\d*)/i', '', $rawQuery);\n\n $hasQuery = false;\n\n if (substr($url, -2) !== \"/?\") {\n \n $lastChar = substr($url, -1);\n\n if ($lastChar !== '/') {\n\n if ($lastChar === '?') {\n \n $url = substr($url, 0, -1) . \"/?\";\n }\n else {\n \n $url.= '/';\n }\n }\n }\n else {\n $hasQuery = true;\n }\n\n $this->url = $url . $query;\n\n if ($query === '') { \n\n if ($hasQuery === false) {\n\n $this->url.= '?';\n }\n }\n else {\n\n $this->url.= '&';\n }\n\n $this->url.= 'p=';\n }", "public function send() {\n\n\t\t$current_time = time();\n\t\tif ( ! $this->should_send_tracking( $current_time ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$collector = $this->get_collector();\n\n\t\t$request = new WPSEO_Remote_Request( $this->endpoint );\n\t\t$request->set_body( $collector->get_as_json() );\n\t\t$request->send();\n\n\t\tupdate_option( $this->option_name, $current_time, 'yes' );\n\t}", "public function setLocation($url = null);", "private static function forgeURLExternal($url) {\n\t\tlog::add(__CLASS__, 'debug', 'URL received : ' . $url);\n\t\t$urlUpdated = $url;\n\t\t$urlParsed = parse_url($url);\n\t\t// Replace Scheme\n\t\t$configScheme = config::byKey('https', 'surveillanceStation') == 1 ? 'https' : 'http';\n\t\tif ($configScheme != $urlParsed['scheme']) {\n\t\t\t$urlUpdated = str_replace($urlParsed['scheme'], $configScheme, $urlUpdated);\n\t\t}\n\t\t// Replace host\n\t\tif (config::byKey('ip', 'surveillanceStation') != $urlParsed['host']) {\n\t\t\t$urlUpdated = str_replace($urlParsed['host'], config::byKey('ip', 'surveillanceStation'), $urlUpdated);\n\t\t}\n\t\t// Replace Port\n\t\t$configPort = empty(config::byKey('port', 'surveillanceStation')) ? '443' : config::byKey('port', 'surveillanceStation');\n\t\tif (intval($configPort) != $urlParsed['port']) {\n\t\t\t$urlUpdated = str_replace($urlParsed['port'], $configPort, $urlUpdated);\n\t\t}\n\t\tlog::add(__CLASS__, 'debug', 'URL modified based on configuration : ' . $urlUpdated);\n\t\treturn htmlentities($urlUpdated, ENT_COMPAT);\n\t}", "function link_label_Update($label, $linkURI, $projectUUID, $db){\n\t $db = $this->startDB();\n\t $where = array();\n\t $where[] = \"linkedURI = '$linkURI' \";\n\t $where[] = \"fk_project_uuid = '$projectUUID' \";\n\t $data = array(\"linkedLabel\" => $label);\n\t $db->update(\"linked_data\", $data, $where);\n}" ]
[ "0.71558666", "0.7030248", "0.59854704", "0.5977514", "0.59643215", "0.59371215", "0.59224194", "0.5901954", "0.58747643", "0.5865422", "0.58361214", "0.58118975", "0.57498205", "0.5747831", "0.57473856", "0.5744224", "0.5702908", "0.5702057", "0.57009745", "0.5694497", "0.5690903", "0.5654024", "0.5606527", "0.5588037", "0.5587135", "0.55860764", "0.5579032", "0.557827", "0.55776125", "0.5574479", "0.556417", "0.5549721", "0.55472654", "0.5545686", "0.5543314", "0.5536971", "0.55186546", "0.55186546", "0.5511189", "0.5495158", "0.5493111", "0.5493111", "0.5493111", "0.5493111", "0.5463139", "0.54529727", "0.54436445", "0.54357404", "0.54314536", "0.5431231", "0.54254407", "0.542064", "0.5416305", "0.540584", "0.53987235", "0.53780437", "0.53737336", "0.5372574", "0.53700304", "0.53541446", "0.5351383", "0.5346856", "0.5346588", "0.53448355", "0.5343636", "0.5338462", "0.53223187", "0.53130853", "0.5310165", "0.53085905", "0.529995", "0.52953386", "0.5295217", "0.5293745", "0.528866", "0.52783227", "0.5276708", "0.5273467", "0.526532", "0.5253001", "0.5253001", "0.5249579", "0.5247392", "0.52470064", "0.5246137", "0.52331287", "0.5230817", "0.521845", "0.52062184", "0.5204039", "0.5200492", "0.51976204", "0.51973736", "0.51930434", "0.51911575", "0.51889336", "0.5188613", "0.5175695", "0.51622534", "0.51606035" ]
0.5891709
8
Delete a tracking Url
public function destroy(int $id): JsonResponse { try { $trackingUrl = TrackingUrl::find($id); if ($trackingUrl) { $trackingUrl->delete(); $message = 'The resource was deleted successfully'; } else { $message = 'The resource no exist'; } return response()->json([ 'message' => $message ]); } catch (Exception $exception) { return response()->json([ 'exception' => $exception, 'message' => $exception->getMessage(), ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function url_delete () {\n\t\tif ( ! $this->get(\"id\") ) {\n\t\t\t$this->response(array(\n\t\t\t\t\"status\" => false,\n\t\t\t\t\"error_code\" => 400\n\t\t\t), 400);\n\t\t}\n\n\t\t$this->db->delete(\"statistic_urls\", array(\n\t\t\t\"id\" => $this->get(\"id\")\n\t\t));\n\t}", "public function purgeUrl($url);", "public function delete()\n {\n self::$db->query(\n 'DELETE FROM public.short_urls\n WHERE short_url_id = $1',\n [$this->short_url_id]\n );\n }", "public function delete($id)\n {\n Url::find($id)->delete();\n session()->flash('message', 'Shorten URL Deleted Successfully.');\n }", "public function delete($id)\n {\n $query=\"DELETE FROM l_event_url WHERE id=\".$id;\n\n $this->executeQuery($query);\n }", "public function purge($url)\n {\n }", "public function delete() {\n\t\t$url = UserUrl::where('id', request()->id)->firstOrFail();\n\t\t$url->delete();\n\t\treturn redirect('/dashboard');\n\t}", "public function destroy(Tracking $tracking)\n {\n $tracking->delete();\n return redirect('/tracking')->with('success',\"Your tracking has been deleted\");\n }", "public function Delete( $sUrl, array $aFields = array() );", "public function deleteTrack(DeleteTrackRequest $request): void\n\t{\n\t\t$request->album()->deleteTrack();\n\t}", "function timetracking_type_delete(timetrackingType $type) {\n $type->delete();\n}", "public function delete($location);", "public function destroy($id)\n {\n // if (!$request->ajax()) return redirect('/');\n $hwb_tracker = HwbTracker::findOrFail($id);\n $hwb_tracker -> delete();\n \n }", "public function destroy(Request $request)\n {\n $request->validate([\n 'url' => 'required|url'\n ]);\n\n $code = explode('/', $request->input('url'));\n $code = end($code);\n $deletedRows = ShortLink::where('code', $code)->delete();\n\n if($deletedRows) {\n return $this->sendResponse('', 'URL deleted')->setStatusCode(200);\n } else {\n return $this->sendError('URL not found')->setStatusCode(404);\n }\n }", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function deleteAction()\n {\n $id = $this->_request->getParam('id');\n\n if (is_null($id))\n {\n $this->sendAlteredResponse(400, 'ID Must Be Specified When Deleting a Tracking Request');\n }\n else\n {\n try\n {\n $this->trackingService->changeFulfillmentStatus(array('content' => array('id' => $id)), true);\n $this->sendAlteredResponse(204);\n }\n catch (SE\\Infrastructure\\Tracking\\Exception $e)\n {\n $this->sendAlteredResponse(403, 'No Tracking Request Resource With This ID');\n }\n \n }\n }", "public static function delete($url)\n {\n return self::fetch($url, array (\n CURLOPT_CUSTOMREQUEST => 'DELETE'\n ));\n }", "public function DBremoveTrack(int $trackid);", "public function destroy($id)\n {\n DB::table('track')->where('track_id', '=', $id)->delete();\n return redirect('/track');\n }", "function delete($id) {\n Ad::deleteAd($id);\n unset($_GET['delete']);\n }", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "function tsuiseki_tracking_uninstall() {\n delete_option('tsuiseki_tracking_key');\n delete_option('tsuiseki_tracking_css_class');\n delete_option('tsuiseki_tracking_excluded_uris');\n}", "public function meta_box_delete_tracking() {\n\t\tcheck_ajax_referer( 'delete-tracking-item', 'security', true );\n\n\t\t$order_id = wc_clean( $_POST['order_id'] );\n\t\t$tracking_id = wc_clean( $_POST['tracking_id'] );\n\n\t\t$this->delete_tracking_item( $order_id, $tracking_id );\n\t}", "function urlDelete(Request $request) {\n $urlFile = env('PBS_KIOSK_DIR').'/urls.list';\n $newContent = '';\n $urlToDel = $request->fName;\n error_log(\"Url to del \" . $urlToDel);\n $contents = file_get_contents($urlFile);\n $parsedLines = preg_split(\"/\\r?\\n|\\r/\", $contents);\n $found = false;\n $rVal = false;\n\n foreach( $parsedLines as $rurl ) {\n if( trim($urlToDel) != trim($rurl) ) { \n $newContent .= $rurl.\"\\r\\n\";\n } else {\n $rVal = true;\n $deleted = $rurl;\n }\n }\n \n // var_dump($newContent);\n if (file_put_contents($urlFile, $newContent)) {\n echo(\"File written\");\n }\n if($rVal) {\n $status = 'OK';\n $msg = \"L'url à été supprimée.\";\n } else {\n $status = 'OK';\n $msg = \"Problème lors de la suppression de l'url\";\n }\n $retVal = array('status' => $status, 'msg' => $msg, 'deleted' => $deleted);\n\n return response()->json($retVal);\n }", "public function delete($url, $query = array(), $headers = array());", "function delete_track($id)\r\n {\r\n $script_location = $this->script_location.'Soundcloud_delete_track.py';\r\n $params = $this->sc_client_id.\" \".$this->sc_secret.\" \".$this->sc_user.\" \".$this->sc_pass.\" \".$id;\r\n //Execute python script and save results\r\n exec(\"python \\\"\".$script_location.\"\\\" \".$params, $result);\r\n if($result[0] == \"ok\")\r\n return true;\r\n return false;\r\n }", "public function deleteAction($id)\n {\n if(!parent::isValidId($id)) {\n return parent::redirect('url');\n }\n\n $manager = new TransactionManager();\n $transaction = $manager->get();\n \n try {\n $url = Url::findFirst($id);\n if($url) {\n $url->setTransaction($transaction);\n \n $batches = $url->getBatch();\n foreach($batches as $batch) {\n $batch->setTransaction($transaction);\n \n $pings = $batch->getPing();\n foreach($pings as $ping) {\n $ping->setTransaction($transaction);\n $ping->delete();\n }\n \n $batch->delete();\n }\n $url->delete();\n \n $this->flash->success('Url deleted succesfully.');\n $transaction->commit();\n \n } else {\n $this->flash->notice('Url not found, operation aborted.');\n }\n } catch(\\Exception $ex) {\n $this->flash->error('Error deleting url.');\n $transaction->rollback($ex->getMessage());\n }\n \n return $this->redirect('url');\n }", "public function delete(){\r\n\t\t$mysqli = \\Database::Instance()->get();\r\n\r\n\t\t$stmt = $mysqli->prepare(\"DELETE FROM `hotspots` WHERE `id` = ?\");\r\n\t\t$stmt->bind_param(\"i\",$this->id);\r\n\t\t$stmt->execute();\r\n\t\t$stmt->close();\r\n\r\n\t\t\\CacheHandler::deleteFromCache(\"hotspot_\" . $this->id);\r\n\t}", "public function deleteCache($url){\n unlink($this->cacheFilename(($url)));\n }", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "function deleteactivity() {\n $this->auth(WL_ADM_LEVEL);\n $activity_id = $this->uri->segment(3);\n $this->m_activities->delete($activity_id);\n $this->activities();\n }", "public function delete()\n {\n $this->socrates->deleteSite($this->id);\n }", "function delete($url=''){\n\n $file_pointer = $url;\n if (!unlink($file_pointer)) {\n echo ($file_pointer.\" cannot be deleted due to an error\");\n\n echo '<script> window.history.back();</script>';\n }\n else {\n echo ($file_pointer.\" has been deleted\");\n echo '<script> window.history.back();</script>';\n }\n}", "public function testDeleteUrlUsingDELETE()\n {\n }", "public static function delete() {\n\n\n\t\t}", "public function deleteTinyUrlByKey(string $tinyUrlKey): void;", "public function _delete($url = null, array $parameters = []);", "function time_tracker_activity_delete($entity) {\n entity_get_controller('time_tracker_activity')->delete($entity);\n}", "public function delete()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $tacgia->delete();\n\n go_back();\n }", "public function destroy(Request $request, Track $track)\n {\n $logon_user = Auth::user();\n if ($logon_user->id != $track->user_id && !$logon_user->is_admin) { \n return response()->json(['message' => 'You have no access rights to delete track','code'=>401], 401); \n } \n if ($request->delink_skills){\n $track->skills()->detach();\n } \n\n if(sizeof($track->skills) > 0){\n return response()->json(['message'=>'There are skills belonging to this track. Do you want to delink them?','skills'=>$track->skills,'code'=>'delink_skills'], 409); \n }\n if(sizeof($track->courses)>0 || sizeof($track->houses)>0){\n return response()->json(['message'=>'This track belongs to a class or course. You will need to go to the course or class to delink them first','classes'=>$track->houses, 'courses'=>$track->courses,'code'=>409], 409);\n }\n $track->delete();\n return response()->json(['message'=>'Track has been deleted.'], 200);\n }", "public function deleteDownloadFile()\r\n\t{\r\n\t\t@unlink($this->reference);\r\n\t}", "public function DELETE() {\n #\n }", "public function delete($url)\n {\n $this->authorize('forceDelete', $url);\n\n $this->urlSrvc->delete($url);\n\n return redirect()->back()\n ->withFlashSuccess(__('Link was successfully deleted.'));\n }", "public function del($database, $url);", "public function delete($url)\n {\n return $this->sendRequest($url, 'DELETE', [], []);\n }", "public function delete($filepath);", "public function destroy(Track $track)\n {\n $track->delete();\n\n return redirect()->route('communication.track.index')->withStatus(__('Track successfully deleted.'));\n }", "public static function delete(){\r\n }", "public function removePageUrl($url);", "public function delAction(Request $request)\n {\n $id = (int)$request->get(\"id\");\n if (!$id) {\n return $this->getJsonResponse(1, \"id参数为空!\");\n }\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('QihooToolBundle:AutoDownUrl')->find($id);\n if (!$entity) {\n return $this->getJsonResponse(2, \"id ($id) 在数据库不存在!(是否已经删除?)\");\n }\n $em->remove($entity);\n $em->flush();\n return $this->getJsonResponse(0, \"\"); //删除成功\n }", "public function destroy($id)\n {\n $ads = Ads::find($id);\n $image_path=public_path().'/upload/ads/'.$ads->photo;\n if(file_exists($image_path)){\n unlink($image_path);\n }\n $ads->delete();\n Ads_webpage::where('ads_id',$id)->delete();\n }", "public function destroy($id)\n {\n $ads = Ads::find($id);\n $image_path=public_path().'/upload/ads/'.$ads->photo;\n if(file_exists($image_path)){\n unlink($image_path);\n }\n $ads->delete();\n Ads_webpage::where('ads_id',$id)->delete();\n }", "public function delete($metricaevotranspiracion);", "public function deleteById($dpRedirectId);", "private function delete($url) {\n\t\t$url = $this->api_url . $url;\n\n\t\t// Open curl.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->api_username . \":\" . $this->api_password);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $output;\n\t}", "public function delete_track($id) { \n\n\t\t$id \t= Dba::escape($id);\n\n\t\t/* delete the track its self */\n\t\t$sql = \"DELETE FROM `tmp_playlist_data` \" . \n\t\t\t\" WHERE `id`='$id'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\treturn true;\n\n\t}", "public function delete() {\r\r\n //product id \r\r\n $id = $this->uri->segment(4);\r\r\n $this->sites_model->delete_site($id);\r\r\n redirect('admin/sites');\r\r\n }", "public function destroy($url)\n {\n foreach ($this->paths($url) as $path) {\n $this->filesystem->delete($path);\n }\n }", "function dh_cwsserviceareamap_form_submit_delete(&$form, &$form_state) {\n list($pg, $us, $id) = explode('/', $_GET['destination']);\n unset($_GET['destination']);\n drupal_goto(\n 'admin/content/dh_adminreg_feature/manage/' . $form_state['dh_adminreg_feature']->fid . '/delete',\n array('query' => array(\n 'destination' => $pg\n )\n ) \n );\n}", "public function delete(){\n\t\t$db = new Database();\n\t\t$sql = \"DELETE FROM reportKinds WHERE id=?\";\n\t\t$sql = $db->prepareQuery($sql, $this->id);\n\t\t$db->query($sql);\n\t}", "public function delete(): void;", "public final function delete() {\n }", "public function delete_track($id) { \n\n\t\t$this_id = Dba::escape($this->id); \n\t\t$id = Dba::escape($id); \n\t\n\t\t$sql = \"DELETE FROM `playlist_data` WHERE `playlist_data`.`playlist`='$this_id' AND `playlist_data`.`id`='$id' LIMIT 1\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\treturn true; \n\n\t}", "public function destroy($id)\n {\n if (Url::where('user_id', Auth::user()->id)) {\n Url::find($id)->delete();\n return redirect()->route('urls.index')->with('success', __('admin.information-deleted'));\n } else\n abort(403);\n }", "function wp_delete_link($link_id)\n {\n }", "public function delete($entity)\n {\n $this->getEventDispatcher()->dispatch(\n TrackingHistoryEvents::PRE_DELETE,\n new TrackingHistoryEvent($entity)\n );\n\n parent::delete($entity);\n\n $this->getEventDispatcher()->dispatch(\n TrackingHistoryEvents::POST_DELETE,\n new TrackingHistoryEvent($entity)\n );\n }", "public function destroy(Url $url)\n { \n $url->delete();\n\n return redirect()->route('admin.url.index')->withFlashSuccess('Url have been submitted!');\n }", "public function delete($episode);", "function delete_trackers_federated($id)\n {\n return $this->db->delete('trackers_federated',array('id'=>$id));\n }", "public function delete()\n\t{\n\t\t$id=$this->uri->segment(3);\n\t\t$this->cazuri_m->delete($id);\n\t\tredirect('cazuri','refresh'); //redirectioneaza utilizatorul pe pagina cu cazuri\n\t}", "public function delete() {\n\t\t\tif ( isset( $_GET['location_id'] ) ) {\n\t\t\t\t$id = intval( wp_unslash( $_GET['location_id'] ) );\n\t\t\t\t$connection = WPGMP_Database::connect();\n\t\t\t\t$this->query = $connection->prepare( \"DELETE FROM $this->table WHERE $this->unique='%d'\", $id );\n\t\t\t\treturn WPGMP_Database::non_query( $this->query, $connection );\n\t\t\t}\n\t\t}", "public function deleteById($customRedirectId);", "public static function delete() {\r\n\t\t\r\n\t}", "public function deleteAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Gou_Service_Ad::getAd($id);\r\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\r\n//\t\tUtil_File::del(Common::getConfig('siteConfig', 'attachPath') . $info['img']);\r\n\t\t$result = Gou_Service_Ad::deleteAd($id);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "function entry_delete($entry_id, $channel_id, $url_title='')\n\t{\n\t\tif ( ! empty($url_title)\n\t\t\t&& (isset($this->settings['channel_url'][$channel_id]['uri']) && !empty($this->settings['channel_url'][$channel_id]['uri']))\n\t\t\t&& (isset($this->settings['channel_url'][$channel_id]['uri']) && !empty($this->settings['channel_url'][$channel_id]['uri'])) )\n\t\t{\n\t\t\n\t\t\t$entry_url = trim($this->settings['channel_url'][$channel_id]['uri'],'/').'/'.$url_title;\n\t\t\n\t\t\t// remove this entry\n\t\t\t$this->EE->db->delete(\n\t\t\t\t'detours',\n\t\t\t\tarray(\n\t\t\t\t\t'new_url' => $entry_url,\n\t\t\t\t\t'site_id' => $this->site_id\n\t\t\t\t)\n\t\t\t);\n\t\t\n\t\t}\n\t\n\t}", "public function destroy(Visit $visit)\n {\n //\n }", "function delete_episode($id_user, $id_parcours, $id_episode) {\n\tglobal $wpdb;\n\n \t$updated = $wpdb->delete( \n\t 'tracking', \n\t array( 'id_user' => $id_user , 'id_episode' => $id_episode , 'id_parcours' => $id_parcours ), \n\t array( \n\t '%d' , '%d', '%d'\n\t )\n\t);\n\n\treturn $updated;\n}", "public function destroy(Referral $referral)\n {\n //\n }", "function deleteAnswer( $id_track ) {\n\t\t\n\t\t\n\t\treturn sql_query(\"\n\t\tDELETE FROM \".$GLOBALS['prefix_lms']\t.\"_testtrack_answer \n\t\tWHERE idTrack = '\".(int)$id_track.\"' AND \n\t\t\tidQuest = '\".$this->id.\"'\");\n\t}", "public function purgeInvalidUrls();", "public function delete() {\r\n }", "public function destroy($id)\n {\n $ga = Gallery::find($id);\n $ga->delete();\n return redirect()->route('gallery.index')->with('success','تم الحذف بنجاح');\n\n\n }", "function delete()\n {\n }" ]
[ "0.75683886", "0.6694052", "0.66164714", "0.6510795", "0.6453089", "0.63942075", "0.62401414", "0.62193257", "0.62058806", "0.61912835", "0.6161337", "0.61563486", "0.6139274", "0.6126971", "0.6100731", "0.6100731", "0.6100731", "0.6100731", "0.6100731", "0.6100731", "0.6100731", "0.6100731", "0.6100731", "0.6100731", "0.6100731", "0.6100731", "0.6100731", "0.6100731", "0.6100731", "0.6067256", "0.6040852", "0.60356516", "0.60308623", "0.6027688", "0.6024905", "0.6023967", "0.6023967", "0.60222465", "0.5994628", "0.5993273", "0.5991531", "0.5987609", "0.59284145", "0.59193397", "0.590799", "0.59033024", "0.59016556", "0.59016556", "0.589", "0.58719563", "0.58574414", "0.5838532", "0.5835671", "0.5834822", "0.58316535", "0.582375", "0.58161074", "0.5812535", "0.58027923", "0.5799821", "0.5791699", "0.57755226", "0.5770101", "0.5746144", "0.57417035", "0.57397944", "0.57371837", "0.57271445", "0.57237643", "0.57237643", "0.57224107", "0.571524", "0.5707046", "0.570636", "0.56994545", "0.5686079", "0.5681827", "0.5671481", "0.5665366", "0.5663108", "0.5655438", "0.5649967", "0.5639004", "0.5637675", "0.5626467", "0.56229985", "0.5621683", "0.5614702", "0.55971766", "0.55931544", "0.5591509", "0.558786", "0.55796236", "0.5577403", "0.5567167", "0.55662715", "0.55659634", "0.5555783", "0.5553373", "0.5551228", "0.55507404" ]
0.0
-1
/ To change this template, choose Tools | Templates and open the template in the editor.
function connect() { //db connection $server = 'CMT-CIMS\CIMS'; $connectionInfo = array( "Database"=>"CMT", "UID"=>"CIMSADMIN", "PWD"=>"Hook2015"); return sqlsrv_connect($server, $connectionInfo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __() {\n }", "public function custom()\n\t{\n\t}", "public function helper()\n\t{\n\t\n\t}", "public function forTemplate() {\n\t\treturn; \n\t}", "private function _i() {\n }", "public function __construct ()\n { // TODO Auto-generated constructor\n }", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "function __construct() {\n\t\t\n\t//TODO - Insert your code here\n\t}", "private function __construct()\r\r\n {\r\r\n // TODO - Insert your code here\r\r\n }", "public function __construct ()\n {\n // TODO Auto-generated constructor\n }", "public function __construct ()\n {\n // TODO Auto-generated constructor\n }", "private function __construct () \n\t{\n\t}", "private function __construct()\t{}", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "private function __construct() {\r\n\t\t\r\n\t}", "public function __construct()\r\n {\r\n // TODO Auto-generated constructor\r\n }", "public function __construct()\r\n {\r\n // TODO Auto-generated constructor\r\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "public function ogs()\r\n {\r\n }", "public function __construct() {\r\n\t\t\r\n\t}", "public function __construct() {\n\n \t}", "public function __construct()\n\t{\n\t\t// nothing to do\t\n\t}", "private function __construct( )\n {\n\t}", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "public function init()\n {\n \treturn;\n }", "public function __construct(){\n\t\t\tparent::__construct(); \n\t\t}", "public function __construct()\n\t{}", "function __construct(){\n\t\t parent::__construct();\n\t\t \n }", "public function __construct () {\n\t}", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "public function package()\n\t{\n\t\t\n\t}", "public function __construct()\n {\n\t;\n }", "private function __construct()\n\t{\n\t\t\n\t}", "function __construct()\n \t{\n \t\tparent::__construct();\n\n \t}", "private function __construct()\r\r\n\t{\r\r\n\t}", "public function __construct() {\n \t\t \t\n\t\t}", "function __construct()\n\t{\n\t}", "function __construct()\n\t{\n\t}", "function __construct()\n\t{\n\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "private function __construct() {;}", "public function __construct()\n\t{\n \n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "function __construct()\n\t{\n \n\t}", "function __construct()\r\n\t{\r\n\t}", "final private function __construct(){\r\r\n\t}", "public function init() {\t\t\n\n }", "private function __construct() \n {\n\t\t\n }", "public function __construct() {\r\n ;\r\n }", "public function __construct()\n\t{\n\t\t// TODO Auto-generated constructor\n\t}", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "public function __construct()\n {\n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "public function main()\n\t{\n\t}", "public function __init()\n {\n\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "function __construct()\n\t{\n\t\tparent::__construct();\t\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function __construct()\n\t{\n\t\n\t}", "public function __construct()\n\t{\n\t\n\t}", "public function __construct () {\n\n\t}", "private function public_hooks()\n\t{\n\t}", "function __construct(){\n parent::__construct();\n\n \t}", "public function __construct(){\n\t\t\n\t}", "public function __construct(){\n\t\t\n\t}", "private function __construct()\r\n\t{\r\n\t}", "private function __construct() {\r\n\t\r\n\t}", "function __construct()\n\t{\n\n\t}", "private function __construct() { \n\t\t\n\n\t}" ]
[ "0.62700677", "0.6248361", "0.61421496", "0.6070692", "0.60316306", "0.6026291", "0.59377235", "0.59041375", "0.58800167", "0.58745855", "0.58745855", "0.5855732", "0.58555144", "0.5851929", "0.5836274", "0.58354235", "0.58354235", "0.5831013", "0.5831013", "0.5831013", "0.5831013", "0.5831013", "0.5831013", "0.5831013", "0.5831013", "0.5830841", "0.5830841", "0.5830841", "0.5830841", "0.5830841", "0.5825706", "0.5816293", "0.5816293", "0.5815288", "0.58130795", "0.5809733", "0.5809337", "0.580239", "0.58005786", "0.57926285", "0.57865596", "0.5778755", "0.577756", "0.5763484", "0.57591224", "0.5742263", "0.5737489", "0.5736149", "0.573282", "0.5732817", "0.5731111", "0.5725788", "0.57202834", "0.57202834", "0.57202834", "0.5718084", "0.57177806", "0.5716328", "0.5710182", "0.5710182", "0.5710182", "0.57082003", "0.57082003", "0.57082003", "0.57082003", "0.57082003", "0.57082003", "0.57082003", "0.57082003", "0.57082003", "0.57082003", "0.57054865", "0.5703135", "0.5702803", "0.570157", "0.56997156", "0.5699469", "0.5698038", "0.56958187", "0.5689642", "0.56867146", "0.56867146", "0.56867146", "0.56867146", "0.56867146", "0.5680203", "0.5673695", "0.5672031", "0.56690043", "0.56675696", "0.5666082", "0.5666082", "0.56658965", "0.5664479", "0.5664268", "0.56631017", "0.56631017", "0.565868", "0.56560844", "0.5645607", "0.5643622" ]
0.0
-1
get curl time and write into xhprof dir .
public static function getCurlTime($time_start, $request_url = '', $request_params = [], $request_method = 'GET', $respone = '') { if (self::isNeedXhprof()) { $time_end = self::microtimeFloat(); $curl_time = $time_end - $time_start; $xhprof_dir = empty(ini_get("xhprof.output_dir")) ? sys_get_temp_dir() : ini_get("xhprof.output_dir"); $xhprof_dir .= "/"; $pathinfo = pathinfo($_SERVER['REQUEST_URI']); $xhprof_path_name = !empty($pathinfo['filename']) ? str_replace(['?','&','=','[',']','%','.'], '-', $pathinfo['filename']) : date("Y-m-d-H-i-s"); $xhprof_host = empty($_SERVER['HTTP_HOST']) ? '' : $_SERVER['HTTP_HOST']; $xhprof_curl_name = $xhprof_dir . "curl-" . $xhprof_host . '-' . $xhprof_path_name; if(strlen($xhprof_curl_name)>250) { $xhprof_curl_name = substr($xhprof_curl_name, 0, 150); } if (is_writable($xhprof_dir)) { file_put_contents($xhprof_curl_name, "url:" . print_r($request_url, true) . ' ' . $curl_time .PHP_EOL, FILE_APPEND); file_put_contents($xhprof_curl_name, "method:" . print_r($request_method, true) . ' ' . $curl_time .PHP_EOL, FILE_APPEND); file_put_contents($xhprof_curl_name, "time:" . print_r($curl_time, true). ' ' . $curl_time .PHP_EOL, FILE_APPEND); file_put_contents($xhprof_curl_name, "params:" . print_r($request_params, true) . ' ' . PHP_EOL, FILE_APPEND); if (isset($_REQUEST['rs']) && $_REQUEST['rs']==1) { file_put_contents($xhprof_curl_name, "respone:" . print_r($respone, true) . ' ' . PHP_EOL, FILE_APPEND); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function epfl_stats_webservice_call_duration($url, $duration, $in_local_cache=false)\n{\n /* If we are in CLI mode, it's useless to update in APC because it's the APC for mgmt container and not httpd\n container */\n if(php_sapi_name()=='cli') return;\n\n global $wp;\n\n $url_details = parse_url($url);\n\n /* Building target host name with scheme */\n $target_host = $url_details['scheme'].\"://\".$url_details['host'];\n if(array_key_exists('port', $url_details) && $url_details['port'] != \"\") $target_host .= \":\".$url_details['port'];\n\n /* Generating date/time in correct format: yyyy-MM-dd'T'HH:mm:ss.SSSZZ (ex: 2019-03-27T12:46:14.078Z ) */\n $log_array = array(\"@timegenerated\" => date(\"Y-m-d\\TH:i:s.v\\Z\"),\n \"priority\" => \"INFO\",\n \"verb\" => \"GET\",\n \"code\" => \"200\",\n \"localcache\" => ($in_local_cache) ? \"hit\" : \"miss\",\n \"src\" => home_url( $wp->request ),\n \"targethost\" => $target_host,\n \"targetpath\" => $url_details['path'],\n \"targetquery\" => (array_key_exists('query', $url_details)) ? $url_details['query'] : \"\",\n \"responsetime\" => ($in_local_cache) ? 0 : floor($duration*1000));\n\n $log_file = '/call_logs/ws_call_log.'.gethostname().'.log';\n /* We write in file only if we can open it */\n if(($h = fopen($log_file, 'a'))!==false)\n {\n fwrite($h, json_encode($log_array).\"\\n\");\n fclose($h);\n }\n\n}", "function performanceCheck($url) {\n\n\t//Getting HTML from URL\n\t$ch = curl_init($url);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false);\n\tcurl_setopt($ch, CURLOPT_FRESH_CONNECT, true);\n\tcurl_setopt($ch, CURLOPT_COOKIESESSION, true);\n\t\n\t$content = curl_exec($ch);\n\t\t\n\treturn array(\n\t\tURL => $url, \n\t\tTOTAL_TIME => curl_getinfo($ch, CURLINFO_TOTAL_TIME), // Total transaction time in seconds for last transfer\n\t\t//NAMELOOKUP_TIME => curl_getinfo($ch, CURLINFO_NAMELOOKUP_TIME), //Time in seconds until name resolving was complete\n\t\t//PRETRANSFER_TIME => curl_getinfo($ch, CURLINFO_PRETRANSFER_TIME), //Time in seconds from start until just before file transfer begins\n\t\tHTTP_CODE => curl_getinfo($ch, CURLINFO_HTTP_CODE) );\n\n\tcurl_close($ch);\n\n}", "function epfl_stats_generic_duration($category, $action, $duration, $in_local_cache=false)\n{\n /* If we are in CLI mode, it's useless to update in APC because it's the APC for mgmt container and not httpd\n container */\n if(php_sapi_name()=='cli') return;\n global $wp;\n /* Generating date/time in correct format: yyyy-MM-dd'T'HH:mm:ss.SSSZZ (ex: 2019-03-27T12:46:14.078Z ) */\n $log_array = array(\"@timegenerated\" => date(\"Y-m-d\\TH:i:s.v\\Z\"),\n \"localcache\" => ($in_local_cache) ? \"hit\" : \"miss\",\n \"src\" => home_url( $wp->request ),\n \"category\" => $category,\n \"action\" => $action,\n \"responsetime\" => ($in_local_cache) ? 0 : floor($duration*1000));\n $log_file = '/call_logs/gen_call_log.'.gethostname().'.log';\n /* We write in file only if we can open it */\n if(($h = fopen($log_file, 'a'))!==false)\n {\n fwrite($h, json_encode($log_array).\"\\n\");\n fclose($h);\n }\n}", "function getProfile()\n{\n\tglobal $time_start, $db;\n\n\t$start = $time_start;\n\t$end = gettimeofday();\n\t$dbcalls = count($db->queries);\n\t$dbtime = $db->time;\n\n\t$total = (float)($end['sec'] - $start['sec']) + ((float)($end['usec'] - $start['usec'])/1000000);\n\t$script = $total - $dbtime;\n\t$scriptper = $script / $total;\n\n\t$ret = round($total, 3) . 's, ' . round(100 * $scriptper, 1) . '% PHP, ' . round(100* (1 - $scriptper), 1) . '% SQL with ' . $dbcalls . ' ' . makeLink('queries', $_SERVER['QUERY_STRING'] . '&sqlprofile');\n\n\treturn $ret;\n}", "function tpc_get_stats() {\n\ttry {\n\t\tglobal $ydb;\n\n\t\t//Process `url` or `shorturl` parameter\n\t\tif(!isset($_REQUEST[\"url\"]) && !isset($_REQUEST[\"shorturl\"])) {\n\t\t\treturn array(\n\t\t\t\t\"errorCode\" => 400,\n\t\t\t\t\"message\" => \"error: Missing 'url' or 'shorturl' parameter.\",\n\t\t\t);\t\n\t\t}\n\n\t\tif(isset($_REQUEST[\"url\"])) {\n\t\t\t$keywords = tpc_get_url_keywords($_REQUEST[\"url\"]);\n\t\t} else {\n\t\t\t$pos = strrpos($_REQUEST[\"shorturl\"], \"/\");\n\t\t\t//Accept \"http://sho.rt/abc\"\n\t\t\tif($pos !== false) {\n\t\t\t\t$keywords = array(substr($_REQUEST[\"shorturl\"], $pos + 1));\n\t\t\t//Accept \"abc\"\n\t\t\t} else {\n\t\t\t\t$keywords = array($_REQUEST[\"shorturl\"]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(empty($keywords[0]) || !yourls_is_shorturl($keywords[0])) {\n\t\t\treturn array(\n\t\t\t\t\"errorCode\" => 404,\n\t\t\t\t\"message\" => \"error: not found\",\n\t\t\t);\t\n\t\t}\n\t\t\n\t\t//Process `since` and `until` parameters.\n\t\tif(isset($_REQUEST[\"since\"])) {\n\t\t\t$since = intval($_REQUEST[\"since\"]);\n\t\t} else {\n\t\t\t$since = 0; //Default to the Unix Epoch\n\t\t}\n\n\t\tif(isset($_REQUEST[\"until\"])) {\n\t\t\t$until = intval($_REQUEST[\"until\"]);\n\t\t} else {\n\t\t\t$until = time(); //Default to now\n\t\t}\n\n\t\tif($since >= $until) {\n\t\t\treturn array(\n\t\t\t\t\"errorCode\" => 400,\n\t\t\t\t\"message\" => \"error: The 'since' value ($since) must be smaller than the 'until' value ($until).\",\n\t\t\t);\n\t\t}\n\t\t\n\t\t$params = array(\n\t\t\t\"shorturls\" => $keywords,\n\t\t\t\"since\" => date(\"Y-m-d H:i:s\", $since),\n\t\t\t\"until\" => date(\"Y-m-d H:i:s\", $until),\n\t\t);\n\t\n\t $sql = \"SELECT COUNT(*)\n\t FROM \" . YOURLS_DB_TABLE_LOG . \"\n\t WHERE\n\t\t\t\t\tshorturl IN (:shorturls) AND\n\t\t\t\t\tclick_time > :since AND\n\t\t\t\t\tclick_time <= :until\";\n\n\t\t$result = $ydb->fetchValue($sql, $params);\n\n\t\treturn array(\n\t\t\t\"statusCode\" => 200,\n\t\t\t\"message\" => \"success\",\n\t\t\t\"url-stats-period\" => array(\n\t\t\t\t\"clicks\" => $result\n\t\t\t)\n\t\t);\n\t} catch (Exception $e) {\n\t\treturn array(\n\t\t\t\"errorCode\" => 500,\n\t\t\t\"message\" => \"error: \" . $e->getMessage(),\n\t\t);\n\t}\n}", "protected function getStats()\n {\n $endTime = microtime() - $this->startTime;\n $stats = sprintf(\n 'Request-response cycle finished: %1.3fs'\n . ' - Memory usage: %1.2fMB (peak: %1.2fMB)'\n ,\n $endTime,\n memory_get_usage(true) / 1048576,\n memory_get_peak_usage(true) / 1048576\n );\n\n return $stats;\n }", "function init_performance_info() {\n\n global $PERF, $CFG, $USER;\n\n $PERF = new object();\n $PERF->logwrites = 0;\n if (function_exists('microtime')) {\n $PERF->starttime = microtime();\n }\n if (function_exists('memory_get_usage')) {\n $PERF->startmemory = memory_get_usage();\n }\n if (function_exists('posix_times')) {\n $PERF->startposixtimes = posix_times();\n }\n if (function_exists('apd_set_pprof_trace')) {\n // APD profiling\n if ($USER->id > 0 && $CFG->perfdebug >= 15) {\n $tempdir = $CFG->dataroot . '/temp/profile/' . $USER->id;\n mkdir($tempdir);\n apd_set_pprof_trace($tempdir);\n $PERF->profiling = true;\n }\n }\n}", "public function gatherSpeedData()\n {\n $speedTotals = array();\n\n $speedTotals['total'] = $this->getReadableTime((microtime(true) - $this->startTime) * 1000);\n $speedTotals['allowed'] = ini_get(\"max_execution_time\");\n\n $this->output['speedTotals'] = $speedTotals;\n }", "function monitor_slow_urls()\n{\n if (isset($_SERVER['REQUEST_TIME_FLOAT'])) {\n $time = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];\n $slow = ($time > floatval(get_value('monitor_slow_urls')));\n } else {\n $time = time() - $_SERVER['REQUEST_TIME'];\n $slow = ($time > intval(get_value('monitor_slow_urls')));\n }\n if ($slow) {\n require_code('urls');\n if (php_function_allowed('error_log')) {\n error_log('Over time limit @ ' . get_self_url_easy(true) . \"\\t\" . strval($time) . ' secs' . \"\\t\" . date('Y-m-d H:i:s', time()), 0);\n }\n }\n}", "public static function times( $time ){\n\t\t$txt = date(\"H:i:s\") . \" Remote IP: [\".$_SERVER['REMOTE_ADDR'] . \"]:\\t[\" . \" time: \" . round( ( $time ), 3).\"s ]\\t\\tRequserURI: \".$_SERVER['REQUEST_URI'];\n\t\tself::_doWrite( self::getFileName( self::TMP_DIR . date('Y-m-d_') . self::FILE_TIMES ), $txt );\n\t}", "public function logPerformance();", "public function logPerformance();", "public function checkLoadTime($url)\n {\n $time = microtime( true);\n file_get_contents($url);\n $time = microtime( true) - $time;\n\n return round($time * 1000); //output in miliseconds\n }", "function pageLoadTime() {\n $time = microtime();\n $time = explode(' ', $time);\n $time = $time[1] + $time[0];\n $start = time; // start\n}", "function log_stats($page_id)\n {\n global $app, $HTTP_USER_AGENT, $REMOTE_ADDR;\n\t\t$app[current_page] = $page_id;\n\t\t$year = date('Y');\n $hour = date('g a');\n $week = date('w');\n $month = date('F');\n\n\t\t## total hit \n $sql = \"select * from {$app[table][stats_hit]}\n where year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_hit]} \n set counter = counter + 1\n where year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_hit]} (counter, year) values(1,'$year')\";\n endif;\n db::qry($sql);\n \n ## by page\n $sql = \"select * from {$app[table][stats_page]}\n where page_id = '$page_id' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_page]} \n \tset counter = counter + 1\n\t\t\t\t\twhere page_id = '$page_id' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_page]} (page_id, counter, year) values('$page_id',1,'$year')\";\n endif;\n db::qry($sql);\n\t\n ## by browser\n if (eregi(\"Nav\", $HTTP_USER_AGENT) || eregi(\"Gold\", $HTTP_USER_AGENT) || eregi(\"X11\", $HTTP_USER_AGENT) || eregi(\"en-US\", $HTTP_USER_AGENT) || eregi(\"Netscape\", $HTTP_USER_AGENT) || eregi(\"Mozilla/4.74\", $HTTP_USER_AGENT)):\n $browser = \"Netscape\";\n elseif (eregi(\"Lynx\", $HTTP_USER_AGENT)): \n $browser = \"Lynx\";\n elseif (eregi(\"Opera\", $HTTP_USER_AGENT)): \n $browser = \"Opera\";\n elseif (eregi(\"Konqueror\", $HTTP_USER_AGENT)): \n $browser = \"Konqueror\";\n elseif (eregi(\"Bot\", $HTTP_USER_AGENT) || eregi(\"Google\", $HTTP_USER_AGENT) || eregi(\"Slurp\", $HTTP_USER_AGENT) || eregi(\"Scooter\", $HTTP_USER_AGENT) || eregi(\"Spider\", $HTTP_USER_AGENT) || eregi(\"Infoseek\", $HTTP_USER_AGENT)):\n $browser = \"Bot\";\n elseif (eregi(\"MSIE\", $HTTP_USER_AGENT)):\n $browser = \"MSIE\";\n else:\n $browser = \"Other\";\n endif;\n \n $sql = \"select * from {$app[table][stats_browser]}\n where browser = '$browser' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_browser]} \n set counter = counter + 1\n where browser = '$browser' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_browser]} (browser, counter, year) values('$browser',1,'$year')\";\n endif; \n db::qry($sql); \n\t\n ## by OS\n if (eregi(\"Win\", $HTTP_USER_AGENT)):\n $os = \"Windows\";\n elseif (eregi(\"Mac\", $HTTP_USER_AGENT)): \n $os = \"Mac\";\n elseif (eregi(\"PPC\", $HTTP_USER_AGENT)): \n $os = \"Mac\";\n elseif (eregi(\"Linux\", $HTTP_USER_AGENT)): \n $os = \"Linux\";\n elseif (eregi(\"FreeBSD\", $HTTP_USER_AGENT)): \n $os = \"FreeBSD\";\n elseif (eregi(\"SunOS\", $HTTP_USER_AGENT)):\n $os = \"SunOS\";\n elseif (eregi(\"IRIX\", $HTTP_USER_AGENT)):\n $os = \"IRIX\";\n elseif (eregi(\"BeOS\", $HTTP_USER_AGENT)):\n $os = \"BeOS\";\n elseif (eregi(\"OS/2\", $HTTP_USER_AGENT)):\n $os = \"OS2\";\n elseif (eregi(\"AIX\", $HTTP_USER_AGENT)):\n $os = \"AIX\";\n else:\n $os = \"Other\";\n endif;\n \n $sql = \"select * from {$app[table][stats_os]}\n where os = '$os' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_os]} \n set counter = counter + 1\n where os = '$os' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_os]} (os, counter, year) values('$os',1,'$year')\";\n endif;\n\t\tdb::qry($sql);\n\t\n\t\t## by hour\n\t\t$sql = \"select * from {$app[table][stats_hour]}\n where jam = '$hour' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_hour]} \n set counter = counter + 1\n where jam = '$hour' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_hour]} (jam, counter, year) values('$hour',1,'$year')\";\n endif;\n\t\tdb::qry($sql);\n\t\t\n\t\t## by weekday\n\t\t$sql = \"select * from {$app[table][stats_week]}\n where hari = '$week' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_week]} \n set counter = counter + 1\n where hari = '$week' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_week]} (hari, counter, year) values('$week',1,'$year')\";\n endif;\n\t\tdb::qry($sql);\n\t\t\t\n ## by month\n $sql = \"select * from {$app[table][stats_month]}\n where bulan = '$month' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_month]} \n set counter = counter + 1\n where bulan = '$month' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_month]} (bulan, counter, year) values('$month',1,'$year')\";\n endif;\n\t\tdb::qry($sql);\n \t\n \t## by IP\n \t$ip = $REMOTE_ADDR;\n \t#$hostname = @gethostbyaddr($ip);\n\t\t$hostname = $ip;\n\t\t$sql = \"select * from {$app[table][stats_ip]} where ip = '$ip' and year = '$year'\";\n\t\t#echo $sql;exit;\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_ip]} \n set counter = counter + 1\n where ip = '$ip' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_ip]} (ip, hostname, counter, year) values('$ip','$hostname', 1, '$year')\";\n endif;\n db::qry($sql);\n\t}", "function stats() {\n\t\techo '<h2>Summary</h2>';\n\t\techo '<p>';\n\t\techo '<strong>Engine</strong>: ' . Cache::engine_name( $this->_config->get_string( array( 'fragmentcache', 'engine' ) ) ) . '<br />';\n\t\techo '<strong>Caching</strong>: ' . ( $this->_caching ? 'enabled' : 'disabled' ) . '<br />';\n\n\t\tif ( !$this->_caching ) {\n\t\t\techo '<strong>Reject reason</strong>: ' . $this->cache_reject_reason . '<br />';\n\t\t}\n\n\t\techo '<strong>Total calls</strong>: ' . $this->cache_total . '<br />';\n\t\techo '<strong>Cache hits</strong>: ' . $this->cache_hits . '<br />';\n\t\techo '<strong>Cache misses</strong>: ' . $this->cache_misses . '<br />';\n\t\techo '<strong>Total time</strong>: '. round( $this->time_total, 4 ) . 's';\n\t\techo '</p>';\n\n\t\techo '<h2>Cache info</h2>';\n\n\t\tif ( $this->_debug ) {\n\t\t\techo '<table cellpadding=\"0\" cellspacing=\"3\" border=\"1\">';\n\t\t\techo '<tr><td>#</td><td>Status</td><td>Source</td><td>Data size (b)</td><td>Query time (s)</td><td>ID:Group</td></tr>';\n\n\t\t\tforeach ( $this->debug_info as $index => $debug ) {\n\t\t\t\techo '<tr>';\n\t\t\t\techo '<td>' . ( $index + 1 ) . '</td>';\n\t\t\t\techo '<td>' . ( $debug['cached'] ? 'cached' : 'not cached' ) . '</td>';\n\t\t\t\techo '<td>' . ( $debug['internal'] ? 'internal' : 'persistent' ) . '</td>';\n\t\t\t\techo '<td>' . $debug['data_size'] . '</td>';\n\t\t\t\techo '<td>' . round( $debug['time'], 4 ) . '</td>';\n\t\t\t\techo '<td>' . sprintf( '%s:%s', $debug['id'], $debug['group'] ) . '</td>';\n\t\t\t\techo '</tr>';\n\t\t\t}\n\n\t\t\techo '</table>';\n\t\t} else {\n\t\t\techo '<p>Enable debug mode.</p>';\n\t\t}\n\t}", "final public function fetch_time()\r\n\t{\r\n\t\t$r = '';\r\n\t\t$t = self::ms();\r\n\t\tforeach ($this->users('list') as $user) {\r\n\t\t\tif (is_dir($this->dir . $user)) {\r\n\t\t\t\t$p = \"{$this->dir}$user/\";\r\n\t\t\t\t$dbs = self::_scandir($p);\r\n\t\t\t\tforeach ($dbs as $db) {\r\n\t\t\t\t\t$tbs = self::_scandir($db);\r\n\t\t\t\t\tforeach ($tbs as $file) {\r\n\t\t\t\t\t\tif (file_exists($file)) {\r\n\t\t\t\t\t\t\t$data = self::data($file);\r\n\t\t\t\t\t\t\t$rows = $data['row'];\r\n\t\t\t\t\t\t\tforeach ($rows as $pk => $row) {\r\n\t\t\t\t\t\t\t\t$r .= self::ra2str($row);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$t = self::ms() - $t;\r\n\t\treturn ($t / 1000) . ' sec';\r\n\t}", "function trace($msg)\n{\n $file = CIMAGE_DEBUG_FILE;\n if (!is_writable($file)) {\n return;\n }\n\n $timer = number_format((microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"]), 6);\n $details = \"{$timer}ms\";\n $details .= \":\" . round(memory_get_peak_usage()/1024/1024, 3) . \"MB\";\n $details .= \":\" . count(get_included_files());\n file_put_contents($file, \"$details:$msg\\n\", FILE_APPEND);\n}", "public function stats() {\n\t\techo \"<p>\";\n\t\techo \"<strong>Cache Hits:</strong> {$this->cache_hits}<br />\";\n\t\techo \"<strong>Cache Misses:</strong> {$this->cache_misses}<br />\";\n\t\techo \"</p>\";\n\t\techo '<ul>';\n\t\tforeach ( $this->cache as $group => $cache ) {\n\t\t\techo \"<li><strong>Group:</strong> $group - ( \" . number_format( strlen( serialize( $cache ) ) / 1024, 2 ) . 'k )</li>';\n\t\t}\n\t\techo '</ul>';\n\t}", "public function stats()\n\t{\n\t\t$stat = View::factory('profiler/stats');\n\t\t// echo $stat;\n\t}", "public function timeTransfer($verbose = false)\n {\n try\n {\n $ch = curl_init($this->getUrl());\n curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n curl_setopt($ch, CURLOPT_TIMEOUT, 15);\n \n $start = microtime(true);\n $doc = curl_exec($ch);\n $stop = microtime(true);\n curl_close($ch);\n\n if($verbose){ echo \"Bytes: \" . strlen($doc) . \"\\n\"; }\n if(strlen($doc) < 1){ return null; }\n\n return $stop - $start;\n }\n catch(Exception $ex)\n {\n echo $ex->getMessage() . \"\\n\";\n return null;\n }\n }", "function updateWebstats(){\n\t\tglobal $skipUpdateWebstats;\n\t\tif($skipUpdateWebstats or $this->miscconfig['enablewebstats']=='') {\n\t\t\t# if you put webstats.sh in crontab\n\t\t\techo \"\\nSkipping \".__FUNCTION__.\" because of config directive (\\$skipUpdateWebstats) or enablewebstats is not checked in options.\\n\";\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->requireCommandLine(__FUNCTION__);\n\t\t$res=$this->query(\"select domainname,homedir from domains where status='$this->status_active' and homedir<>''\");\n\t\t$str='';\n\t\tforeach($res as $dom){\n\t\t\tif ($this->miscconfig['enablecommonwebstats']=='') {\n\t\t\t\tpassthru2(\"mkdir -p \".$dom['homedir'].\"/httpdocs/webstats/\");\n\t\t\t\t$str.=\"webalizer -q -p -n www.\".$dom['domainname'].\" -o \".$dom['homedir'].\"/httpdocs/webstats \".$dom['homedir'].\"/logs/access_log -R 100 TopReferrers -r \".$dom['domainname'].\" HideReferrer \\n\";\n\t\t\t}else {\n\t\t\t\tpassthru2(\"mkdir -p \" .$this->miscconfig[\"commonwebstatsdir\"] .\"/\".$dom['domainname']);\n\t\t\t\t$str.=\"webalizer -q -p -n www.\".$dom['domainname']\n\t\t\t\t\t. \" -o \"\n\t\t\t\t\t. $this->miscconfig['commonwebstatsdir']\n\t\t\t\t\t. \"/\"\n\t\t\t\t\t. $dom['domainname']\n\t\t\t\t\t. \" \"\n\t\t\t\t\t. $dom['homedir']\n\t\t\t\t\t. \"/logs/access_log -R 100 TopReferrers -r \"\n\t\t\t\t\t. $dom['domainname'].\" HideReferrer \\n\";\n\n\t\t\t}\n\n\n\t\t}\n\t\techo $str;\n\n\t\twriteoutput2(\"/etc/ehcp/webstats.sh\",$str,\"w\");\n\t\tpassthru2(\"chmod a+x /etc/ehcp/webstats.sh\");\n\t#\tpassthru2(\"/etc/ehcp/webstats.sh\");\n\t\techo \"\\nwrite webstats file to /etc/ehcp/webstats.sh complete... need to put this in crontab or run automatically.. \\n\";\n\n\t}", "function trace(){\n\t\techo($this->get_trace()/(1024*1024).\" MB\");\n\t}", "function counterHits(){\n\tglobal $pth; include($pth['app']['globals']);\n\t$count \t\t= '';\n\t$counterHits= $pth['site']['counterHits'];\n\tclearstatcache();\n\tif(!is_file($counterHits)){ $handle\t= fopen($counterHits,'w'); fwrite($handle,'0'); fclose($handle); }\n\t// get current Hits + count\n\t$count\t= file_get_contents($counterHits);\n\tif(!$adm){\n\t\t$count = $count+1;\n\t\t// save Hits\n\t\t$files = fopen($counterHits,'w'); \n\t\tfwrite($files,$count);\n\t\tfclose($files);\n\t}\n\t\n\treturn '<p><strong>'.$count.'</strong> '.$txt['counterHits']['views'].'.</p>';\n}", "function curl_get(&$handle, $url, $fields = '', &$info = NULL) {\r\n\tglobal $curl_last_timestamp, $curl_throttle;\r\n\tif (! $curl_throttle) {\r\n\t\t$curl_throttle = 5;\r\n\t}\r\n\tif ($curl_last_timestamp && time() - $curl_last_timestamp < $curl_throttle * 60) {\r\n\t\t$delay = min(array(\r\n\t\t\t$curl_throttle, time() - $curl_last_timestamp\r\n\t\t));\r\n\t\tif ($delay) {\r\n\t\t\t//log_msg('CURL', \"Sleeping for $delay second(s)\");\r\n\t\t\tusleep($delay * 1000000);\r\n\t\t}\r\n\t}\r\n\tif ($fields) {\r\n\t\tif (is_array($fields))\r\n\t\t\t$fields = http_build_query2($fields, '', '&');\r\n\t\t$url = \"$url?$fields\";\r\n\t}\r\n\tcurl_setopt($handle, CURLOPT_HTTPGET, TRUE);\r\n\tcurl_setopt($handle, CURLOPT_URL, $url);\r\n\tcurl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);\r\n\t$result = curl_exec($handle);\r\n\t$info = curl_getinfo($handle);\r\n\t$curl_last_timestamp = time();\r\n\t//log_msg('CURL', \"Get $url ; result info=\" . json_encode($info));\r\n\treturn $result;\r\n}", "function curl($url,$opt=[],$curl_info=false){\n $ch = curl_init();\n//2.设置URL和相应的选项\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n if(!empty($opt)){\n curl_setopt_array($ch,$opt);\n }\n//3.抓取URL并把它传递给浏览器\n $res = curl_exec($ch);\n// echo curl_getinfo($ch)['total_time'].'<br/>';\n\n if($curl_info === true){\n return curl_getinfo($ch);\n }\n //4.关闭cURL资源,并且释放系统资源\n curl_close($ch);\n return json_decode($res,true);\n}", "private static function time_exec()\n {\n $current = self::time();\n self::$time_exec = $current-self::$time_start;\n }", "function L_PageLoadTime() {\n\t\n\t/*\n\t\t$time = microtime();\n\t\t$time = explode(' ', $time);\n\t\t$time = $time[1] + $time[0];\n\t\t$finish = $time;\n\t\t$total_time = round(($finish - $start), 4);\n\t\t\n\t*/\n\t\n\t/*\n\t\t$end_time = microtime(TRUE);\n\t\t$time_taken = $end_time - $start_time;\n\t\t$time_taken = round($time_taken,5);\n\t\t\n\t*/\n\t\n\t\t// Start of code\n\t\t$time = microtime(true); // Gets microseconds\n\n\t\t// End of code\n\t\t$time_taken = (microtime(true) - $time);\n\t\t\n\t\treturn _e('Page generated in ' . $time_taken . ' seconds.','leonite');\n\n\t}", "public function PrintStats(){\n\n ##Check for bad jumps\n for($i = 0; $i < count($this->jumps); $i++){\n if(!in_array( $this->jumps[$i], $this->labels)){\n $this->COUNTERS[BADJUMPS] += 1;\n $this->COUNTERS[FWJUMPS] -= 1;\n }\n }\n\n for($i = 0; $i < count($this->statfiles); $i++){\n\n $filename = $this->statfiles[$i];\n $filehandler = fopen($filename, \"w\");\n if(false){\n $this->Error(ERROR_OUTPUT_FILES, \"Unable to open file {$filename}\");\n }\n \n $statFlag = $this->statFlags[$i];\n\n for($j = 0; $j < count($statFlag); $j++){\n fwrite($filehandler,$this->COUNTERS[$this->FLAGS[$statFlag[$j]]].\"\\n\");\n #fwrite($filehandler,\"\\n\"); \n }\n fclose($filehandler);\n }\n }", "public function retrieveServerTime(){\n //http://www.thetvdb.com/api/Updates.php?type=none\n\t \n\t if(!$this->t_mirrors){\n\t\t$this->retrieveMirrors;\n\t }\n\t \n $url = $this->t_mirrors[0].'/api/Updates.php?type=none';\n \n //$xmlStr=$this->curl_get_file_contents($url);\n\t $c = curl_init();\n curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($c, CURLOPT_URL, $url);\n $xmlStr = curl_exec($c);\n curl_close($c);\n \n $xmlServerTime = new SimpleXMLElement($xmlStr);\n return $xmlServerTime->Time;\n }", "function tbt_ax_timestamp(){\r\n\techo \"ajax response in zweb:\".time();\r\n\t//echo \"slide\";\r\n\tdie();\r\n\r\n\t//\r\n}", "public function curl_scrap() {\n\t\tif (!isset($this->url)) return false;\n\n\t\t$curl_session = curl_init($this->url);\n\n\t\t// CURLOPT_RETURNTRANSFER this option means that the curl_exec must put the output in a var instead of only printing it.\n\t\tcurl_setopt($curl_session, CURLOPT_RETURNTRANSFER, true);\n\n\t\t// CURLOPT_FILETIME this option means that the scraping will occur whilst retrieving the modification time of the remote file scrapped\n\t\tcurl_setopt($curl_session, CURLINFO_FILETIME, true);\n\t\t\n\t\t$scrapped_page = curl_exec($curl_session);\n\t\tif (curl_errno($curl_session))\n\t\t\t//kill the script and throw an error if there is an error in curl_exec;\n\t\t\tdie('An error occured while scraping: '.$this->url.' ERROR::'. curl_error($curl_session).\"\\n\");\n\n\t\t$filetime = curl_getinfo($curl_session, CURLINFO_FILETIME); //unix time or -1 if undef\n\t\tcurl_close($curl_session);\n\n\t\treturn $scrapped_page? array(\n\t\t\t\t\t'scrapped_page' => $scrapped_page,\n\t\t\t\t\t'filetime' => $filetime,\n\t\t\t\t):\n\t\t\t\tfalse;\n\t}", "function prof_print()\r\n{\r\n global $prof_timing, $prof_names, $profiling;\r\n $size = count($prof_timing);\r\n for($i=0;$i<$size - 1; $i++)\r\n {\r\n \tif($profiling)\r\n \t{\r\n \techo \"{$prof_names[$i]}\\n\";\r\n \techo sprintf(\" %f\\n\", $prof_timing[$i+1]-$prof_timing[$i]);\r\n \t}\r\n }\r\n if($profiling)\r\n {\r\n \techo \"{$prof_names[$size-1]}\\n\";\r\n\t}\r\n}", "function fetch_url($url, $expiry = CACHE_EXPIRY_TIMESPAN, $post_params = null) {\n global $cookie;\n global $calendar_url;\n\n if ($post_params) {\n $post = array();\n foreach ($post_params as $key => $value) {\n $post []= $key.'='.htmlentities($value);\n }\n $post = implode('&', $post);\n } else {\n $post = '';\n }\n\n $cache_path = CACHE_PATH.md5($calendar_url).md5($url.$post);\n echo 'Fetching '.$url.'...memory: '.memory_get_usage().'...';\n if (file_exists($cache_path) &&\n filemtime($cache_path) >= time() - $expiry) {\n echo 'from cache.'.\"\\n\";\n $data = file_get_contents($cache_path);\n } else {\n echo 'from web...';\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n //curl_setopt($ch, CURLOPT_VERBOSE, true);\n curl_setopt($ch, CURLOPT_COOKIE, $cookie);\n curl_setopt($ch, CURLOPT_USERAGENT, 'UWDataSpider/1.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.7)');\n if ($post_params) {\n curl_setopt($ch, CURLOPT_POST, count($post_params));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n }\n $data = curl_exec($ch);\n\n/*\n $context = stream_context_create(array(\n 'http' => array(\n 'method'=>\"GET\",\n 'header'=>\"Accept-language: en-us,en;q=0.5\\r\\n\".\n \"Referrer: http://uwdata.ca\\r\\n\".\n \"User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7\\r\\n\"\n )\n ));\n $data = file_get_contents($url, 0, $context);*/\n if ($data) {\n file_put_contents($cache_path, $data);\n }\n echo 'done.'.\"\\n\";\n }\n return $data;\n}", "function dp_wget($url , $postvars = null , $curlOpts = array()){\r\n // Purpose : refresh session token every hour\r\n $piTrCurlHandle = curl_init();\r\n curl_setopt($piTrCurlHandle, CURLOPT_HTTPGET, 1);\r\n curl_setopt($piTrCurlHandle, CURLOPT_RESUME_FROM, 0);\r\n curl_setopt($piTrCurlHandle, CURLOPT_URL, $url);\r\n curl_setopt($piTrCurlHandle, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($piTrCurlHandle, CURLOPT_FOLLOWLOCATION, 1);\r\n\r\n curl_setopt($piTrCurlHandle, CURLOPT_SSL_VERIFYHOST, 0);\r\n curl_setopt($piTrCurlHandle, CURLOPT_SSL_VERIFYPEER, 0);\r\n\r\n curl_setopt($piTrCurlHandle, CURLOPT_TIMEOUT, 500); // 500 secs\r\n\r\n if($postvars){\r\n curl_setopt($piTrCurlHandle, CURLOPT_POST, 1);\r\n curl_setopt($piTrCurlHandle, CURLOPT_POSTFIELDS, $postvars);\r\n curl_setopt($piTrCurlHandle, CURLOPT_CUSTOMREQUEST, \"POST\");\r\n }\r\n\r\n if($curlOpts)\r\n foreach($curlOpts as $opt=>$value)\r\n curl_setopt($piTrCurlHandle, $opt, $value);\r\n\r\n\r\n $data = curl_exec($piTrCurlHandle);\r\n\r\n return $data;\r\n}", "function sessionStats()\n{\n return generateQuery('-st | sed \\'s/ */ /g\\' '); \n}", "public function stream_stat() {}", "function process_host_info($host_data)\n{\n global $API_version;\n global $CGM_version;\n\n $arr = array ('command'=>'config','parameter'=>'');\n $config_arr = send_request_to_host($arr, $host_data);\n \n $arr = array ('command'=>'summary','parameter'=>'');\n $summary_arr = send_request_to_host($arr, $host_data);\n \n $up_time = $summary_arr['SUMMARY']['0']['Elapsed'];\n $days = floor($up_time / 86400);\n $up_time -= $days * 86400;\n $hours = floor($up_time / 3600);\n $up_time -= $hours * 3600;\n $mins = floor($up_time / 60);\n $seconds = $up_time - ($mins * 60);\n \n $output = \"\n <tr>\n <th>CGminer version</th>\n <th>API version</th>\n <th>Up time</th>\n <th>Found H/W</th>\n <th>Using ADL</th>\n <th>Pools and Strategy</th>\n </tr>\n <tr>\n <td>\".$CGM_version.\"</td>\n <td>\".$API_version.\"</td>\n <td>\".$days.\"d \".$hours.\"h \".$mins.\"m \".$seconds.\"s</td>\n <td>\".$config_arr['CONFIG']['0']['CPU Count'].\" CPUs, \".$config_arr['CONFIG']['0']['GPU Count'].\" GPUs, \".$config_arr['CONFIG']['0']['BFL Count'].\" BFLs</td>\n <td>\".$config_arr['CONFIG']['0']['ADL in use'].\"</td>\n <td>\".$config_arr['CONFIG']['0']['Pool Count'].\" pools, using \".$config_arr['CONFIG']['0']['Strategy'].\"</td>\n </tr>\";\n\n return $output;\n}", "protected function startTime()\n {\n return microtime(true);\n }", "public function run()\r\n\t\t\t {\r\n $ch = curl_init();\r\n curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt ($ch, CURLOPT_URL, $this->url);\r\n curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 20);\r\n curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11');\r\n curl_setopt($ch, CURLOPT_HEADER, true); // header will be at output\r\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD'); // HTTP request is 'HEAD'\r\n $this->headers = curl_exec ($ch);\r\n curl_close ($ch);\r\n\t\t\t }", "function count_site_visit($from_admin_overview=false) {\r\n\tif (file_exists(COUNTER_FILE)) {\r\n\t\t$ignore = false;\r\n\t\t$current_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? addslashes(trim($_SERVER['HTTP_USER_AGENT'])) : \"no agent\";\r\n\t\t$current_time = time();\r\n\t\t$current_ip = $_SERVER['REMOTE_ADDR']; \r\n\t \r\n\t\t// daten einlesen\r\n\t\t$c_file = array();\r\n\t\t$handle = fopen(COUNTER_FILE, \"r\");\r\n\t \r\n\t \tif ($handle) {\r\n\t\t\twhile (!feof($handle)) {\r\n\t\t\t\t$line = trim(fgets($handle, 4096)); \r\n\t\t\t\tif ($line != \"\") {\r\n\t\t\t\t\t$c_file[] = $line;\r\n\t\t\t\t}\t\t \r\n\t\t\t}\r\n\t\t\tfclose ($handle);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$ignore = true;\r\n\t\t}\r\n\t \r\n\t\t// bots ignorieren \r\n\t\tif (substr_count($current_agent, \"bot\") > 0) {\r\n\t\t\t$ignore = true;\r\n\t\t}\r\n\t\t \r\n\t \r\n\t\t// hat diese ip einen eintrag in den letzten expire sec gehabt, dann igornieren?\r\n\t\tfor ($i = 1; $i < sizeof($c_file); $i++) {\r\n\t\t\tlist($counter_ip, $counter_time) = explode(\"||\", $c_file[$i]);\r\n\t\t\t$counter_time = trim($counter_time);\r\n\t\t \r\n\t\t\tif ($counter_ip == $current_ip && $current_time-COUNTER_IP_EXPIRE < $counter_time) {\r\n\t\t\t\t// besucher wurde bereits gezählt, daher hier abbruch\r\n\t\t\t\t$ignore = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t \r\n\t\t// counter hochzählen\r\n\t\tif (!$ignore) {\r\n\t\t\tif (sizeof($c_file) == 0) {\r\n\t\t\t\t// wenn counter leer, dann füllen \r\n\t\t\t\t$add_line1 = date(\"z\") . \":1||\" . date(\"W\") . \":1||\" . date(\"n\") . \":1||\" . date(\"Y\") . \":1||1||1||\" . $current_time . \"\\n\";\r\n\t\t\t\t$add_line2 = $current_ip . \"||\" . $current_time . \"\\n\";\r\n\t\t\t \r\n\t\t\t\t// daten schreiben\r\n\t\t\t\t$fp = fopen(COUNTER_FILE,\"w+\");\r\n\t\t\t\tif ($fp) {\r\n\t\t\t\t\tflock($fp, LOCK_EX);\r\n\t\t\t\t\tfwrite($fp, $add_line1);\r\n\t\t\t\t\tfwrite($fp, $add_line2);\r\n\t\t\t\t\tflock($fp, LOCK_UN);\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t}\r\n\t\t\t \r\n\t\t\t\t// werte zur verfügung stellen\r\n\t\t\t\t$day = $week = $month = $year = $all = $record = 1;\r\n\t\t\t\t$record_time = $current_time;\r\n\t\t\t\t$online = 1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// counter hochzählen\r\n\t\t\t\tlist($day_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = explode(\"||\", $c_file[0]);\r\n\t\t\t \r\n\t\t\t\t// day\r\n\t\t\t\t$day_data = explode(\":\", $day_arr);\r\n\t\t\t\t$day = $day_data[1];\r\n\t\t\t\tif ($day_data[0] == date(\"z\")) $day++; else $day = 1;\r\n\t\t\t \r\n\t\t\t\t// week\r\n\t\t\t\t$week_data = explode(\":\", $week_arr);\r\n\t\t\t\t$week = $week_data[1];\r\n\t\t\t\tif ($week_data[0] == date(\"W\")) $week++; else $week = 1;\r\n\t\t\t \r\n\t\t\t\t// month\r\n\t\t\t\t$month_data = explode(\":\", $month_arr);\r\n\t\t\t\t$month = $month_data[1];\r\n\t\t\t\tif ($month_data[0] == date(\"n\")) $month++; else $month = 1;\r\n\t\t\t \r\n\t\t\t\t// year\r\n\t\t\t\t$year_data = explode(\":\", $year_arr);\r\n\t\t\t\t$year = $year_data[1];\r\n\t\t\t\tif ($year_data[0] == date(\"Y\")) $year++; else $year = 1;\r\n\t\t\t \r\n\t\t\t\t// all\r\n\t\t\t\t$all++;\r\n\t\t\t \r\n\t\t\t\t// neuer record?\r\n\t\t\t\t$record_time = trim($record_time);\r\n\t\t\t\tif ($day > $record) {\r\n\t\t\t\t\t$record = $day;\r\n\t\t\t\t\t$record_time = $current_time;\r\n\t\t\t\t}\r\n\t\t\t \r\n\t\t\t\t// speichern und aufräumen und anzahl der online leute bestimmten\r\n\t\t\t \r\n\t\t\t\t$online = 1;\r\n\t\t\t \t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// daten schreiben\r\n\t\t\t\t$fp = fopen(COUNTER_FILE,\"w+\");\r\n\t\t\t\tif ($fp) {\r\n\t\t\t\t\tflock($fp, LOCK_EX);\r\n\t\t\t\t\t$add_line1 = date(\"z\") . \":\" . $day . \"||\" . date(\"W\") . \":\" . $week . \"||\" . date(\"n\") . \":\" . $month . \"||\" . date(\"Y\") . \":\" . $year . \"||\" . $all . \"||\" . $record . \"||\" . $record_time . \"\\n\";\t\t \r\n\t\t\t\t\tfwrite($fp, $add_line1);\r\n\r\n\t\t\t\t\tfor ($i = 1; $i < sizeof($c_file); $i++) {\r\n\t\t\t\t\t\tlist($counter_ip, $counter_time) = explode(\"||\", $c_file[$i]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// übernehmen\r\n\t\t\t\t\t\tif ($current_time-COUNTER_IP_EXPIRE < $counter_time) {\r\n\t\t\t\t\t\t\t$counter_time = trim($counter_time);\r\n\t\t\t\t\t\t\t$add_line = $counter_ip . \"||\" . $counter_time . \"\\n\";\r\n\t\t\t\t\t\t\tfwrite($fp, $add_line);\r\n\t\t\t\t\t\t\t$online++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$add_line = $current_ip . \"||\" . $current_time . \"\\n\";\r\n\t\t\t\t\tfwrite($fp, $add_line);\r\n\t\t\t\t\tflock($fp, LOCK_UN);\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function count_access($base_path, $name) {\r\n $filename = $base_path . DIRECTORY_SEPARATOR . \"stats.json\";\r\n $stats = json_decode(file_get_contents($filename), true);\r\n $stats[$name][mktime(0, 0, 0)] += 1;\r\n file_put_contents($filename, json_encode($stats, JSON_PRETTY_PRINT));\r\n}", "function write($token, $collectors, $ip, $url, $time);", "public static function logDailyBenchmarks() {\n\n\t\t$dbprefix = elgg_get_config('dbprefix');\n\n\t\t$svc = new LoggingService();\n\n\t\t$ia = elgg_set_ignore_access();\n\n\t\t$users = elgg_get_entities([\n\t\t\t'types' => 'user',\n\t\t\t'count' => true,\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'users:total',\n\t\t\t'value' => $users,\n\t\t]);\n\n\t\t$banned = elgg_get_entities([\n\t\t\t'types' => 'user',\n\t\t\t'count' => true,\n\t\t\t'joins' => [\n\t\t\t\t\"JOIN {$dbprefix}users_entity ue ON ue.guid = e.guid\",\n\t\t\t],\n\t\t\t'wheres' => [\n\t\t\t\t\"ue.banned = 'yes'\",\n\t\t\t],\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'users:banned',\n\t\t\t'value' => $banned,\n\t\t]);\n\n\t\t$validated = elgg_get_entities_from_metadata([\n\t\t\t'types' => 'user',\n\t\t\t'count' => true,\n\t\t\t'metadata_name_value_pairs' => [\n\t\t\t\t'validated' => true,\n\t\t\t],\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'users:validated',\n\t\t\t'value' => $validated,\n\t\t]);\n\n\t\t$groups = elgg_get_entities([\n\t\t\t'types' => 'group',\n\t\t\t'count' => true,\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'groups:total',\n\t\t\t'value' => $groups,\n\t\t]);\n\n\t\t$posts = elgg_get_entities([\n\t\t\t'types' => 'object',\n\t\t\t'count' => true,\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'posts:total',\n\t\t\t'value' => $posts,\n\t\t]);\n\n\t\t$subtypes = get_registered_entity_types('object');\n\n\t\tforeach ($subtypes as $subtype) {\n\t\t\t$posts = elgg_get_entities([\n\t\t\t\t'types' => 'object',\n\t\t\t\t'subtypes' => $subtype,\n\t\t\t\t'count' => true,\n\t\t\t]);\n\n\t\t\t$svc->logBenchmark([\n\t\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t\t'metric' => \"posts:$subtype\",\n\t\t\t\t'value' => $posts,\n\t\t\t]);\n\t\t}\n\n\t\telgg_set_ignore_access($ia);\n\t}", "function awstats() {\n\t $this->awfile = paramload('SHELL','prpath') . \"awstats012005.example.com.txt\"; \n\t $this->aw = new awfile($this->awfile); \n }", "public function stat()\n\t{\n\t\treturn csscrush_stat(\n\t\t\t$this->get_params('stat_name')\n\t\t);\n\t}", "function getLastModifiedTime(){\n /*$output = dbcCmd(\"getLastModifiedTime\\n\");\n \n //Error Check\n if($output[\"stdout\"] == \"failed\\n\"){\n return str_replace(\"\\n\",\"\",$output[\"stdout\"]);\n }\n \n $rtn = array(\"lastModifiedTime\"=>str_replace(\"\\n\",\"\",$output[\"stdout\"]));\n return json_encode($rtn);*/\n return;\n}", "function xhprof_disable()\n{\n}", "function load_stats($dir) {\n\n\t\t$diff = array();\n\n\t\t$before = file(\"$dir/stats-before.log\");\n\t\t$after = file(\"$dir/stats-after.log\");\n\n\t\t// pg_stat_bgwriter\n\n\t\t$matches_before = array();\n\t\tpreg_match('/^\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)$/', $before[2], $matches_before);\n\n\t\t$matches_after = array();\n\t\tpreg_match('/^\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)$/', $after[2], $matches_after);\n\n\t\t$diff['checkpoints_timed'] = $matches_after[1] - $matches_before[1];\n\t\t$diff['checkpoints_req'] = $matches_after[2] - $matches_before[2];\n\t\t$diff['buffers_checkpoint'] = $matches_after[3] - $matches_before[3];\n\t\t$diff['buffers_clean'] = $matches_after[4] - $matches_before[4];\n\t\t$diff['maxwritten_clean'] = $matches_after[5] - $matches_before[5];\n\t\t$diff['buffers_backend'] = $matches_after[6] - $matches_before[6];\n\t\t$diff['buffers_alloc'] = $matches_after[7] - $matches_before[7];\n\n\t\t// pg_stat_database\n\n\t\t$matches_before = array();\n\t\tpreg_match('/^\\s+([0-9]+)\\s\\|\\s+([a-z]+)\\s+\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)$/', $before[7], $matches_before);\n\n\t\t$matches_after = array();\n\t\tpreg_match('/^\\s+([0-9]+)\\s\\|\\s+([a-z]+)\\s+\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)\\s\\|\\s+([0-9]+)$/', $after[7], $matches_after);\n\n\t\t$diff['xact_commit'] = $matches_after[4] - $matches_before[4];\n\t\t$diff['xact_rollback'] = $matches_after[5] - $matches_before[5];\n\t\t$diff['blks_read'] = $matches_after[6] - $matches_before[6];\n\t\t$diff['blks_hit'] = $matches_after[7] - $matches_before[7];\n\t\t$diff['tup_returned'] = $matches_after[8] - $matches_before[8];\n\t\t$diff['tup_fetched'] = $matches_after[9] - $matches_before[9];\n\t\t$diff['tup_inserted'] = $matches_after[10] - $matches_before[10];\n\t\t$diff['tup_updated'] = $matches_after[11] - $matches_before[11];\n\t\t$diff['tup_deleted'] = $matches_after[12] - $matches_before[12];\n\n\t\t$diff['hit_ratio'] = round(floatval(100*$diff['blks_hit']) / ($diff['blks_hit'] + $diff['blks_read']),1);\n\n\t\treturn $diff;\n\n\t}", "public static function &profile() {\n\t\t$_profile=self::$global['PROFILE'];\n\t\t// Compute elapsed time\n\t\t$_profile['TIME']['start']=&self::$global['TIME'];\n\t\t$_profile['TIME']['elapsed']=microtime(TRUE)-self::$global['TIME'];\n\t\t// Reset PHP's stat cache\n\t\tforeach (get_included_files() as $_file)\n\t\t\t// Gather includes\n\t\t\t$_profile['FILES']['includes']\n\t\t\t\t[basename($_file)]=filesize($_file);\n\t\t// Compute memory consumption\n\t\t$_profile['MEMORY']['current']=memory_get_usage();\n\t\t$_profile['MEMORY']['peak']=memory_get_peak_usage();\n\t\treturn $_profile;\n\t}", "function phpTrafficA_logit($c,$config_table,$table, $site, $page, $ip, $agent, $time, $referer, $recordCrawler, $tmpdir, $ip2c,$resolution) {\n// basic stuff\n$hour = date(\"H\", $time);\n$day = date(\"w\", $time);\n$datestring = date(\"Y-m-d\",$time);\n$date = date(\"Y-m-d H:i:s\",$time);\n// mysql_query(\"SET NAMES 'utf8'\", $c);\n// Read configurations\n$conf = phpTrafficA_read_config($config_table, $c);\n$save_host = $conf['save_host'];\n$engine_id = $conf['engine_id'];\n$engine_url = $conf['engine_url'] ;\n$engine_kwd = $conf['engine_kwd'];\n$engine_charset = $conf['engine_charset'];\n$blacklist= $conf['blacklist'];\n$seAreRef = $conf['seAreRef'];\n$visitCutoff = $conf['visitcutoff'];\n// Extracting the OS and webbrowser\nlist($wb,$os)=explode(\";\",phpTrafficA_ExtractAgent($agent,$conf['browser_id'],$conf['browser_label'],$conf['os_id'],$conf['os_label']));\n$crawlerArray = array (\"Crawler\", \"Googlebot\", \"Google Adwords\");\nif ( $recordCrawler || (!$recordCrawler && (array_search ($wb,$crawlerArray) === FALSE)) ) {\n\t// If we record crawlers, or if it is not a crawler, go ahead\n\t// Fixing pagename\n\t$page = preg_replace(\"/\\/+/\", \"/\", $page); // replace all // with / in the page url\n\t// replace all possible index by an empty page name\n\t$patterns = array(\"index.html\", \"index.shtml\", \"index.asp\", \"index.xml\", \"index.php\", \"index.php3\", \"index.php4\", \"index.php5\");\n\t$page = str_replace($patterns, \"\", $page);\n\t// $page = ereg_replace (\"index.(html|shtml|asp|xml|php|php3|php4|php5){1}$\", \"\", $page);\n\t// SPECIAL ZONEO: / Becomes index.php This should be fixed... FIX ME!\n\t$isindex = substr($page, -1);\n\tif ($isindex == \"/\") {\n\t\t$page = $page.\"index.php\";\n\t}\n\t$page = phpTrafficA_cleanTextNoAmp($page);\n\t// Find out if this page has been audited yet, and get the index\n\t$pageid = phpTrafficA_pageid(\"${table}_pages\", $c, $page, $datestring);\n\tif ($pageid == -1) { break;}\n\t// Hour and day of the week\n\t$test = phpTrafficA_updateCount(\"${table}_hour\", $c, $hour);\n\t$test = phpTrafficA_updateCount(\"${table}_day\", $c, $day);\n\t// Referrer, search engines, keywords\n\t$how = phpTrafficA_figureOutRefOrSE ($c, $referer, $site, $table, $engine_id,$engine_url,$engine_kwd,$engine_charset, $blacklist, $date, $pageid,$seAreRef);\n\t// Add page view + way we got here\n\t$pageview = phpTrafficA_add_access($table,$c,$datestring,$pageid,$how);\n\t// IP Based stats are in a different function\n\t// includes OS, browser, and country stats\n\t// Move after record of page views to avoid more unique visitors than page views issue...\n\tphpTrafficA_ipbased($c,$pageid,$ip,$agent,$time,$conf,$table,$site,$visitCutoff,$tmpdir, $ip2c,$resolution);\n}\n// Insert access in latest hosts table, even if it is a crawler\n$cleanref = phpTrafficA_cleanText($referer);\n$iplong = ip2long($ip);\n$sql3 =\"INSERT INTO `${table}_host` SET date='$date', host='', hostname='', page='$page', ref='$cleanref', agent='$agent', longIP='$iplong'\";\n$res3 = mysql_query($sql3);\n// Cleanup the host table, we do not want that many... Just keep the last ones.\n// We will keep twice more hosts than keep_hosts so we do not have to clear up the table all the time. This is for the sake of speeeeed!\n$req3 = \"SELECT COUNT(*) as count FROM ${table}_host\";\n$res3 = mysql_query($req3);\n$tmp=mysql_fetch_array($res3);\nif (($tmp['count']-2*$save_host)>0) {\n\t$hostdelete = $tmp['count']-$save_host;\n\t$req3 = \"ALTER TABLE `${table}_host` ORDER BY `date`\";\n\t$res3 = mysql_query($req3);\n\t$req3 = \"DELETE FROM `${table}_host` LIMIT $hostdelete\";\n\t$res3 = mysql_query($req3);\n\t$req3 = \"OPTIMIZE TABLE `${table}_host` \";\n\t$res3 = mysql_query($req3);\n}\nreturn $pageview;\n}", "function aggregateStats($pageid, $firstUrl, $firstHtmlUrl, $statusInfo) {\n\tglobal $gPagesTable, $gRequestsTable, $gUrlsTable;\n\t$link = getDBConnection();\n\n\t// CVSNO - move this error checking to the point before this function is called\n\tif ( ! $firstUrl ) {\n\t\tdprint(\"ERROR($gPagesTable pageid: $pageid): no first URL found.\");\n\t\treturn false;\n\t}\n\tif ( ! $firstHtmlUrl ) {\n\t\tdprint(\"ERROR($gPagesTable pageid: $pageid): no first HTML URL found.\");\n\t\treturn false;\n\t}\n\n\t// initialize variables for counting the page's stats\n\t$bytesTotal = 0;\n\t$reqTotal = 0;\n\t$hSize = array();\n\t$hCount = array();\n\t// This is a list of all mime types AND file formats that we care about.\n\tforeach(array(\"css\", \"image\", \"script\", \"html\", \"font\", \"other\", \"audio\", \"video\", \"text\", \"xml\", \"gif\", \"jpg\", \"png\", \"webp\", \"svg\", \"ico\", \"flash\", \"swf\", \"mp4\", \"flv\", \"f4v\") as $type) {\n\t\t// initialize the hashes\n\t\t$hSize[$type] = 0;\n\t\t$hCount[$type] = 0;\n\t}\n\t$hDomains = array();\n\t$maxageNull = $maxage0 = $maxage1 = $maxage30 = $maxage365 = $maxageMore = 0;\n\t$bytesHtmlDoc = $numRedirects = $numErrors = $numGlibs = $numHttps = $numCompressed = $maxDomainReqs = 0;\n\n\t$result = doQuery(\"select type, format, urlShort, resp_content_type, respSize, expAge, firstHtml, status, resp_content_encoding, req_host from $gRequestsTable where pageid = $pageid;\");\n\twhile ($row = mysqli_fetch_assoc($result)) {\n\t\t$url = $row['urlShort'];\n\t\t$prettyType = $row['type'];\n\t\t$respSize = intval($row['respSize']);\n\t\t$reqTotal++;\n\t\t$bytesTotal += $respSize;\n\t\t$hCount[$prettyType]++;\n\t\t$hSize[$prettyType] += $respSize;\n\n\t\t$format = $row['format'];\n\t\tif ( $format && (\"image\" === $prettyType || \"video\" === $prettyType) ) {\n\t\t\t$hCount[$format]++;\n\t\t\t$hSize[$format] += $respSize;\n\t\t}\n\n\t\t// count unique domains (really hostnames)\n\t\t$aMatches = array();\n\t\tif ( $url && preg_match('/http[s]*:\\/\\/([^\\/]*)/', $url, $aMatches) ) {\n\t\t\t$hostname = $aMatches[1];\n\t\t\tif ( ! array_key_exists($hostname, $hDomains) ) {\n\t\t\t\t$hDomains[$hostname] = 0;\n\t\t\t}\n\t\t\t$hDomains[$hostname]++; // count hostnames\n\t\t}\n\t\telse {\n\t\t\tdprint(\"ERROR($gPagesTable pageid: $pageid): No hostname found in URL: $url\");\n\t\t}\n\n\t\t// count expiration windows\n\t\t$expAge = $row['expAge'];\n\t\t$daySecs = 24*60*60;\n\t\tif ( NULL === $expAge ) {\n\t\t\t$maxageNull++;\n\t\t}\n\t\telse if ( 0 === intval($expAge) ) {\n\t\t\t$maxage0++;\n\t\t}\n\t\telse if ( $expAge <= (1 * $daySecs) ) {\n\t\t\t$maxage1++;\n\t\t}\n\t\telse if ( $expAge <= (30 * $daySecs) ) {\n\t\t\t$maxage30++;\n\t\t}\n\t\telse if ( $expAge <= (365 * $daySecs) ) {\n\t\t\t$maxage365++;\n\t\t}\n\t\telse {\n\t\t\t$maxageMore++;\n\t\t}\n\n\t\tif ( $row['firstHtml'] ) {\n\t\t\t$bytesHtmlDoc = $respSize; // CVSNO - can we get this UNgzipped?!\n\t\t}\n\n\t\t$status = $row['status'];\n\t\tif ( 300 <= $status && $status < 400 && 304 != $status ) {\n\t\t\t$numRedirects++;\n\t\t}\n\t\telse if ( 400 <= $status && $status < 600 ) {\n\t\t\t$numErrors++;\n\t\t}\n\n\t\tif ( 0 === stripos($url, \"https://\") ) {\n\t\t\t$numHttps++;\n\t\t}\n\n\t\tif ( FALSE !== stripos($row['req_host'], \"googleapis.com\") ) {\n\t\t\t$numGlibs++;\n\t\t}\n\n\t\tif ( \"gzip\" == $row['resp_content_encoding'] || \"deflate\" == $row['resp_content_encoding'] ) {\n\t\t\t$numCompressed++;\n\t\t}\n\t}\n\tmysqli_free_result($result);\n\t$numDomains = count(array_keys($hDomains));\n\tforeach (array_keys($hDomains) as $domain) {\n\t\t$maxDomainReqs = max($maxDomainReqs, $hDomains[$domain]);\n\t}\n\n\t$cmd = \"UPDATE $gPagesTable SET reqTotal = $reqTotal, bytesTotal = $bytesTotal\" .\n\t\t\", reqHtml = \" . $hCount['html'] . \", bytesHtml = \" . $hSize['html'] .\n\t\t\", reqJS = \" . $hCount['script'] . \", bytesJS = \" . $hSize['script'] .\n\t\t\", reqCSS = \" . $hCount['css'] . \", bytesCSS = \" . $hSize['css'] .\n\t\t\", reqImg = \" . $hCount['image'] . \", bytesImg = \" . $hSize['image'] .\n\t\t\", reqGif = \" . $hCount['gif'] . \", bytesGif = \" . $hSize['gif'] .\n\t\t\", reqJpg = \" . $hCount['jpg'] . \", bytesJpg = \" . $hSize['jpg'] .\n\t\t\", reqPng = \" . $hCount['png'] . \", bytesPng = \" . $hSize['png'] .\n\t\t\", reqFlash = \" . $hCount['flash'] . \", bytesFlash = \" . $hSize['flash'] .\n\t\t\", reqFont = \" . $hCount['font'] . \", bytesFont = \" . $hSize['font'] .\n\t\t\", reqOther = \" . $hCount['other'] . \", bytesOther = \" . $hSize['other'] .\n\t\t\", reqAudio = \" . $hCount['audio'] . \", bytesAudio = \" . $hSize['audio'] .\n\t\t\", reqVideo = \" . $hCount['video'] . \", bytesVideo = \" . $hSize['video'] .\n\t\t\", reqText = \" . $hCount['text'] . \", bytesText = \" . $hSize['text'] .\n\t\t\", reqXml = \" . $hCount['xml'] . \", bytesXml = \" . $hSize['xml'] .\n\t\t\", reqWebp = \" . $hCount['webp'] . \", bytesWebp = \" . $hSize['webp'] .\n\t\t\", reqSvg = \" . $hCount['svg'] . \", bytesSvg = \" . $hSize['svg'] .\n\t\t\", numDomains = $numDomains\" .\n\t\t\", maxageNull = $maxageNull\" .\n\t\t\", maxage0 = $maxage0\" .\n\t\t\", maxage1 = $maxage1\" .\n\t\t\", maxage30 = $maxage30\" .\n\t\t\", maxage365 = $maxage365\" .\n\t\t\", maxageMore = $maxageMore\" .\n\t\t( $bytesHtmlDoc ? \", bytesHtmlDoc = $bytesHtmlDoc\" : \"\" ) .\n\t\t\", numRedirects = $numRedirects\" .\n\t\t\", numErrors = $numErrors\" .\n\t\t\", numGlibs = $numGlibs\" .\n\t\t\", numHttps = $numHttps\" .\n\t\t\", numCompressed = $numCompressed\" .\n\t\t\", maxDomainReqs = $maxDomainReqs\" .\n\t\t\", wptid = \" . \"'\" . mysqli_real_escape_string($link, $statusInfo['wptid']) . \"'\" . \n\t\t\", wptrun = \" . $statusInfo['medianRun'] . \n\t\t( $statusInfo['rank'] ? \", rank = \" . $statusInfo['rank'] : \"\" ) .\n\t\t\" where pageid = $pageid;\";\n\tdoSimpleCommand($cmd);\n\n\treturn true;\n}", "function phpTrafficA_ipbased($c,$pageid,$ip,$agent,$time,$conf,$table,$site,$visitCutoff,$tmpdir,$ip2c,$resolution) {\n\n$max_keep_ipbased = $visitCutoff*60; // 1800 = 30 minutes, 3600 = 1 hour\n$pageid = trim($pageid, \" \\n\\r\");\n$tmpfile = \"$tmpdir/ipbased.$table.dat\";\nif (!file_exists($tmpfile)) {\n\ttouch($tmpfile);\n}\n$stats = file(\"$tmpfile\");\n$found = FALSE;\n$newpath = TRUE;\n$newString = \"\";\nforeach($stats as $log) {\n\t$log_arr = explode(\"|>|\", $log);\n\t$host = $log_arr[0];\n\t$first = $log_arr[1];\n\t$last = $log_arr[2];\n\t$clicks = $log_arr[3];\n\t$thispath = $log_arr[4];\n\tif ($first>100) {\n\t\tif ($host==$ip) {\n\t\t\tif ($last+$max_keep_ipbased > $time) {\n\t\t\t\t$newpath = FALSE;\n\t\t\t\t$clicks += 1;\n\t\t\t\t$thispath .= \"|$pageid\";\n\t\t\t\t$newString .= \"$ip|>|$first|>|$time|>|$clicks|>|$thispath|>|\\n\";\n\t\t\t} else {\n\t\t\t\tphpTrafficA_insert_ipbased_entry($c, $table, $first, $last, $clicks, $thispath, $host,$tmpdir);\n\t\t\t\t$newString .= \"$ip|>|$time|>|$time|>|1|>|$pageid|>|\\n\";\n\t\t\t}\n\t\t\t$found = TRUE;\n\t\t} else {\n\t\t\tif ($last+$max_keep_ipbased > $time) {\n\t\t\t\t$newString .= \"$host|>|$first|>|$last|>|$clicks|>|$thispath|>|\\n\";\n\t\t\t} else {\n\t\t\t\tphpTrafficA_insert_ipbased_entry($c, $table, $first, $last, $clicks, $thispath, $host,$tmpdir);\n\t\t\t}\n\t\t}\n\t}\n}\nif (!$found) { $newString .= \"$ip|>|$time|>|$time|>|1|>|$pageid|>|\\n\";}\n$newstats =fopen(\"$tmpfile\", \"w\");\nflock ($newstats,2);\nfwrite($newstats,$newString);\n// @flock ($newstats,3); Removed. No need to free the lock since it is done automatically when closing.\nfclose($newstats);\n\nif ($newpath) {\n\t// Add country, OS, and browser\n\t$monthstring = date(\"Y-m\",$time).\"-01\";\n\tlist($wb,$os)=explode(\";\",phpTrafficA_ExtractAgent($agent,$conf['browser_id'],$conf['browser_label'],$conf['os_id'],$conf['os_label']));\n\t$test = phpTrafficA_addDB_LDC(\"${table}_os\",$c,$monthstring,$os);\n\t$test = phpTrafficA_addDB_LDC(\"${table}_browser\",$c,$monthstring,$wb);\n\tif (!(preg_match(\"/Crawler/i\", $wb))) {\n\t\tif (!(preg_match(\"/Google/i\", $wb))) {\n\t\t\t$country = ip2Country($ip,$ip2c);\n\t\t\t$test = phpTrafficA_addDB_LDC(\"${table}_country\",$c,$monthstring,$country);\n\t\t}\n\t}\n}\n\n// If screen resolution has been recorded, store it for this IP\nif (trim($resolution)!=\"\") {\n\t$tmpfile = \"$tmpdir/resolution.$table.dat\";\n\tif (!file_exists($tmpfile)) {\n\t\ttouch($tmpfile);\n\t}\n\t$stats = file(\"$tmpfile\");\n\t$found = FALSE;\n\t$newString = \"\";\n\tforeach($stats as $log) {\n\t\t$log_arr = explode(\"|>|\", $log);\n\t\t$host = $log_arr[0];\n\t\t$res = $log_arr[1];\n\t\tif ($host==$ip) {\n\t\t\t$newString .= \"$ip|>|$resolution\\n\";\n\t\t\t$found = true;\n\t\t} else if (trim($host) != '') $newString .= \"$host|>|$res\\n\";\n\t}\n\tif (!$found) $newString .= \"$ip|>|$resolution\\n\";\n\t$newstats =fopen(\"$tmpfile\", \"w\");\n\tflock ($newstats,2);\n\tfwrite($newstats,$newString);\n\t// @flock ($newstats,3);Removed. No need to free the lock since it is done automatically when closing.\n\tfclose($newstats);\n}\n\nreturn 1;\n}", "function gethwinfo () {\n\t\t$ret[cpu] = server::cpu_info();\n\t\t$ret[mem] = round(server::mem_total() / 1024);\n\t\treturn $ret;\n\t\t\n\t}", "function logTime($dir_root,$script_name,$begin,$end) {\n $file = fopen($dir_root . 'log/tempsChargement.log','a');\n $temps = $end - $begin;\n fputs($file,date('Y-m-d H:i:s') . \" - Chargement de la page '\". basename($script_name) . \"' en : $temps ms.\\n\"); \n fclose($file);\n}", "public static function time() {\n if (is_null(self::$_time)) {\n self::$_time = microtime(true);\n } else {\n echo 'Time-Consumed:- ' . (microtime(true) - self::$_time) . PHP_EOL;\n }\n }", "private function stats($status = array())\n\t{\n\t\t$html = \"<table border=\\\"1\\\">\";\n\t\t$html .= \"<tr><td>Memcache Server version:</td><td>$status[version]</td></tr>\";\n\t\t$html .= \"<tr><td>Process id of this server process </td><td>$status[pid]</td></tr>\";\n\t\t$html .= \"<tr><td>Number of seconds this server has been running </td><td>$status[uptime]</td></tr>\";\n\t\t$html .= \"<tr><td>Accumulated user time for this process </td><td>$status[rusage_user] seconds</td></tr>\";\n\t\t$html .= \"<tr><td>Accumulated system time for this process </td><td>$status[rusage_system] seconds</td></tr>\";\n\t\t$html .= \"<tr><td>Total number of items stored by this server ever since it started </td><td>$status[total_items]</td></tr>\";\n\t\t$html .= \"<tr><td>Number of open connections </td><td>$status[curr_connections]</td></tr>\";\n\t\t$html .= \"<tr><td>Total number of connections opened since the server started running </td><td>$status[total_connections]</td></tr>\";\n\t\t$html .= \"<tr><td>Number of connection structures allocated by the server </td><td>$status[connection_structures]</td></tr>\";\n\t\t$html .= \"<tr><td>Cumulative number of retrieval requests </td><td>$status[cmd_get]</td></tr>\";\n\t\t$html .= \"<tr><td>Cumulative number of storage requests </td><td>$status[cmd_set]</td></tr>\";\n\t\t$percCacheHit = ((real)$status[\"get_hits\"] / (real)$status[\"cmd_get\"] * 100);\n\t\t$percCacheHit = round($percCacheHit, 3);\n\t\t$percCacheMiss = 100 - $percCacheHit;\n\t\t$html .= \"<tr><td>Number of keys that have been requested and found present </td><td>$status[get_hits] ($percCacheHit%)</td></tr>\";\n\t\t$html .= \"<tr><td>Number of items that have been requested and not found </td><td>$status[get_misses] ($percCacheMiss%)</td></tr>\";\n\t\t$MBRead = (real)$status[\"bytes_read\"] / (1024 * 1024);\n\t\t$html .= \"<tr><td>Total number of bytes read by this server from network </td><td>$MBRead Mega Bytes</td></tr>\";\n\t\t$MBWrite = (real)$status[\"bytes_written\"] / (1024 * 1024);\n\t\t$html .= \"<tr><td>Total number of bytes sent by this server to network </td><td>$MBWrite Mega Bytes</td></tr>\";\n\t\t$MBSize = (real)$status[\"limit_maxbytes\"] / (1024 * 1024);\n\t\t$html .= \"<tr><td>Number of bytes this server is allowed to use for storage.</td><td>$MBSize Mega Bytes</td></tr>\";\n\t\t$html .= \"<tr><td>Number of valid items removed from cache to free memory for new items.</td><td>$status[evictions]</td></tr>\";\n\t\t$html .= \"</table>\";\n\t\treturn $html;\n\t}", "public function stats(){\n\t\treturn apc_cache_info('user',true);\n\t}", "function memory_trace_point($name=NULL)\n{\n\tglobal $MEMORY_POINTS;\n\tif (is_null($name)) $name='#'.integer_format(count($MEMORY_POINTS)+1);\n\t$MEMORY_POINTS[]=array(memory_get_usage(),$name);\n}", "public function __construct()\n {\n $this->level = 100;\n $this->watching = false;\n $this->trace = true;\n $this->coverage = true;\n $this->watching = false;\n $this->collectReturn = false;\n $this->collectParams = self::COLLECT_PARAMS_NONE;\n\n preg_match('/0\\.(?P<decimal>\\d+)/', microtime(), $matches);\n $traceFile = date('Y_m_d_h_i_s_').$matches['decimal'];\n\n $this->setTraceFile($traceFile);\n\n file_put_contents(\n $this->traceFile.'.svr',\n json_encode(\n [\n 'time' => time(),\n 'server' => $_SERVER,\n 'post' => $_POST,\n 'get' => $_GET,\n 'files' => $_FILES,\n ],\n JSON_PRETTY_PRINT\n )\n );\n }", "function phpTrafficA_getmicrotime() {\nlist($usec, $sec) = explode(\" \", microtime());\nreturn ((float)$usec + (float)$sec);\n}", "public static function profile()\n\t{\n\t\t// Return the view\n\t\treturn View::factory('benchmark/profile')\n\t\t\t->set('memory', (memory_get_usage() - START_MEMORY) / 1024)\n\t\t\t->set('time', round(microtime(TRUE) - START_TIME, 5))\n\t\t\t->set('memory_limit', 131072) // 128M\n\t\t\t->set('time_limit', 30)\n\t\t\t->render();\n\t}", "public function microtime();", "protected function renderStats() {\n\t\t$stats = WCF::getCache()->get('stat');\n\t\tWCF::getTPL()->assign('stats', $stats);\n\t}", "public function dumpTime($name = 'XOOPS', $unset = false)\n {\n if (!$this->activated) {\n return null;\n }\n\n if (!isset($this->logstart[$name])) {\n return 0;\n }\n $stop = isset($this->logend[$name]) ? $this->logend[$name] : microtime(true);\n $start = $this->logstart[$name];\n\n if ($unset) {\n unset($this->logstart[$name]);\n unset($this->logend[$name]);\n }\n\n return $stop - $start;\n }", "private function ping()\n {\n if ($this->project->url) {\n $ch = curl_init($this->project->url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n if (curl_exec($ch)) {\n $info = curl_getinfo($ch);\n curl_close($ch);\n return $info['total_time'];\n }\n\n curl_close($ch);\n return -1;\n }\n return null;\n }", "protected function printCachedInfo() {}", "function torrent_scrape_url($scrape, $hash) {\t\r\n\tif (function_exists(\"curl_exec\")) {\t\t\r\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt ($ch, CURLOPT_URL, $scrape.'?info_hash='.escape_url($hash));\r\n\t\tcurl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\t\tcurl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\r\n\t\t$fp = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\t} else {\r\n\t\tini_set('default_socket_timeout',10);\r\n\t\t$fp = @file_get_contents($scrape.'?info_hash='.escape_url($hash));\t\r\n\t}\r\n\t$ret = array();\t\r\n\tif ($fp) {\r\n\t\trequire_once(WP_TRADER_ABSPATH . '/includes/BDecode.php');\r\n\t\t$stats = BDecode($fp);\r\n\t\t$binhash = pack(\"H*\", $hash);\r\n\t\t$seeds = $stats['files'][$binhash]['complete'];\r\n\t\t$peers = $stats['files'][$binhash]['incomplete'];\r\n\t\t$downloaded = $stats['files'][$binhash]['downloaded'];\r\n\t\t$ret['seeds'] = $seeds;\r\n\t\t$ret['peers'] = $peers;\r\n\t\t$ret['downloaded'] = $downloaded;\r\n\t}\r\n\tif ($ret['seeds'] === null) {\r\n\t\t$ret['seeds'] = -1;\r\n\t\t$ret['peers'] = -1;\r\n\t\t$ret['downloaded'] = -1;\r\n\t}\t\r\n\treturn $ret;\r\n}", "public function hitURL($url)\n\t{\n\t\t$this->statpro->insert(\n\t\t\t6,\n\t\t\tarray(\n\t\t\t\t$url,\n\t\t\t\ttime(),\n\t\t\t)\n\t\t);\n\t}", "public function generateStats()\n {\n $this->cache = json_decode (file_get_contents ($this->cfg_cache_file), true);\n if (!is_array ($this->cache)) $this->cache = array();\n if (!isset ($this->cache['index'])) $this->cache['index'] = array();\n if (!isset ($this->cache['total'])) $this->cache['total'] = 0;\n if (!isset ($this->cache['size'])) $this->cache['size'] = 0;\n $edited = false;\n if (!isset ($this->cache['timecache']))\n {\n //print \"No cache\";\n $this->generateTimeInterval();\n $this->cache['timecache'] = array (\n \"generated\" => date (\"d-m-Y\"),\n \"day\" => $this->stats->screenshots_per_day,\n \"month\" => $this->stats->screenshots_per_month\n );\n }\n else\n {\n $today = date (\"d-m-Y\");\n $gen_month = false; $gen_day = false;\n if (substr ($today, 3) != substr ($this->cache['timecache']['generated'], 3))\n $gen_month = true;\n if ($today != $this->cache['timecache']['generated'])\n $gen_day = true;\n if ($gen_day || $gen_month)\n {\n $this->generateTimeInterval ($gen_month, $gen_day);\n //print \"Generating timecache: [{$gen_month} / {$gen_day}]\";\n $this->cache['timecache']['generated'] = $today;\n if ($gen_day)\n $this->cache['timecache']['day'] = $this->stats->screenshots_per_day;\n else\n $this->stats->screenshots_per_day = $this->cache['timecache']['day'];\n if ($gen_month)\n $this->cache['timecache']['month'] = $this->stats->screenshots_per_month;\n else\n $this->stats->screenshots_per_month = $this->cache['timecache']['month'];\n $edited = true;\n }\n else\n {\n $this->stats->screenshots_per_day = $this->cache['timecache']['day'];\n $this->stats->screenshots_per_month = $this->cache['timecache']['month'];\n }\n }\n // $this->cache = array ( 'total' => n, 'size' => n, 'index' => array ('name' => date)) )\n $flist = glob (\"{$this->cfg_img_path}/*.{{$this->cfg_extensions}}\", GLOB_BRACE);\n foreach ($flist as $file)\n {\n if (!isset ($this->cache['index'][$file]))\n {\n $edited = true;\n $_stat = stat ($file);\n $this->cache['index'][$file] = date ('d-m-Y', $_stat['mtime']) . '/' . $_stat['size'];\n $this->cache['size'] += $_stat['size'];\n $this->cache['total'] += 1;\n }\n $_date = substr ($this->cache['index'][$file], 0, strpos ($this->cache['index'][$file], '/'));\n $month = substr ($_date, 3);\n if (isset ($this->stats->screenshots_per_day[$_date]))\n $this->stats->screenshots_per_day[$_date]++;\n if (isset ($this->stats->screenshots_per_month[$month]))\n $this->stats->screenshots_per_month[$month]++;\n }\n if ($this->cfg_check_deleted)\n {\n foreach (array_diff (array_keys ($this->cache['index']), $flist) as $deleted)\n {\n $edited = true;\n $this->cache['size'] -= intval (substr ($this->cache['index'][$deleted], strpos ($this->cache['index'][$deleted], '/') + 1));\n $this->cache['total'] -= 1;\n unset ($this->cache['index'][$deleted]);\n }\n }\n $this->stats->total_files = $this->cache['total'];\n $this->stats->used_space = $this->cache['size'];\n //print_r ($this->stats->screenshots_per_day);\n //print($edited);\n if ($edited)\n file_put_contents ($this->cfg_cache_file, json_encode ($this->cache));\n return $this;\n }", "protected function _logTraffic() {\n if ('testing' !== APPLICATION_ENV) {\n $lastRequest = $this->_client->getLastRequest();\n $lastResponse = $this->_client->getLastResponse();\n $filename = date('Y-m-d') . '-gofilex.log';\n $logMessage = \"\\n\";\n $logMessage .= '[REQUEST]' . \"\\n\";\n $logMessage .= $lastRequest . \"\\n\\n\";\n $logMessage .= '[RESPONSE]' . \"\\n\";\n $logMessage .= $lastResponse . \"\\n\\n\";\n\n $logger = Garp_Log::factory($filename);\n $logger->log($logMessage, Garp_Log::INFO);\n }\n }", "public function send_cached_file($video)\n {\n $id=$video[\"id\"];\n\n //\n // Open cache file.\n //\n bench(\"start\");\n if (($fp = fopen($this->cache_filename, 'rb')) === FALSE) {\n $this->log(2,__FUNCTION__,\"Cannot open cache file: [{$this->cache_filename}]\");\n return FALSE;\n }\n // Log it.\n $this->log(1,__FUNCTION__,\"Cache file opened for reading\");\n // Insert visit into db.\n $this->add_visit($id,filesize($this->cache_filename));\n $this->file_access_time=bench();\n \n //\n // Read headers using fgets\n //\n $hs=unserialize($video[\"reply_headers\"]);\n/*\n $hs = array();\n while (!feof($fp)) {\n if (($ln = fgets($fp)) === FALSE)\n $this->logdie(2,__FUNCTION__,\"Cannot read cache file: [{$this->cache_filename}]\");\n else if (($ln = rtrim($ln)) == '')\n break;\n else if (!preg_match('/^([^:]+): *(.*)$/', $ln, $mo))\n $this->logdie(2,__FUNCTION__,\"Invalid cached header in [{$this->cache_filename}]: [{$ln}]\");\n else\n $hs[$mo[1]] = $mo[2];\n }\n*/\n // Range request\n if (isset($this->client_request_headers['Range'])) {\n $range = $this->client_request_headers['Range'];\n if (!preg_match('/bytes[=\\s]+([0-9]+)/', $range, $mo))\n $this->log(2,__FUNCTION__,\"Unsupported Range header value: [{$range}]\");\n else {\n $firstbyte = $mo[1];\n $size = $hs['Content-Length'];\n $lastbyte = $size - $firstbyte - 1;\n $hs['Content-Range'] = \"bytes $firstbyte-$lastbyte/$size\";\n $hs['Content-Length'] -= $firstbyte;\n header('HTTP/1.0 206 Partial Content');\n if (fseek($fp, $firstbyte, SEEK_CUR))\n $this->log(2,__FUNCTION__,\"Cannot seek to position $firstbyte: [{$this->cache_filename}]\");\n }\n } // range\n // Set headers\n foreach ($hs as $n => $v) {\n header(\"$n: $v\");\n $this->log(0,__FUNCTION__,\"Cached header > client: [$n: $v]\");\n }\n $this->send_dynamic_headers_to_client();\n\n //\n // Send content.\n //\n // 'fpassthru($fp)' seems to attempt to mmap the file, and hits the PHP memory limit.\n // As a workaround, use a 'feof / fread / echo' loop.\n //\n\n $transferred=0;$tcount=0;\n bench(\"start\");\n while (!feof($fp)) {\n if (($data = fread($fp, $this->chunksize)) === FALSE) {\n $this->log(2,__FUNCTION__,\"Cannot read cache file: [{$this->cache_filename}]\");\n fclose($fp);\n return FALSE;\n } else {\n $transferred+=strlen($data);$tcount++;\n if ($tcount==1) //first packet\n if (substr($data,0,4)==chr(0x12).chr(00).chr(03).chr(0x4b)) //header missing, try to fix it\n $data=\"FLV\".chr(0x01).chr(0x05).chr(00).chr(00).chr(00).chr(0x09).chr(00).chr(00).chr(00).chr(00).$data;\n echo $data;\n }\n }\n fclose($fp);\n $transfer_time=bench();\n if ($transfer_time<1) $transfer_time=1;\n $bytes_per_sec=ROUND($transferred/ROUND($transfer_time/1000));\n $this->troughput_local=$bytes_per_sec;\n $this->log(1,__FUNCTION__,\"Served request {$this->cache_request} from cache, {$transferred} bytes transferred\");\n return true;\n }", "function load_pgbench_tps($dir, $threshold) {\n\n\t\t$o = array();\n\n\t\t$d = file(\"$dir/results.log\");\n\n\t\t$matches = array();\n\t\tpreg_match('/^number of transactions actually processed: ([0-9]+)$/', $d[6], $matches);\n\n\t\t$o['transactions'] = $matches[1];\n\n\t\t$matches = array();\n\t\tpreg_match('/^tps = ([0-9]+\\.[0-9]+) \\(including connections establishing\\)$/', $d[7], $matches);\n\n\t\t$matches = array();\n\t\tpreg_match('/^tps = ([0-9]+\\.[0-9]+) \\(including connections establishing\\)$/', $d[7], $matches);\n\n\t\t$o['tps'] = $matches[1];\n\n\t\t$x = load_pgbench_log($dir, $threshold);\n\n\t\t$o['hit_ratio'] = $x['hit_ratio'];\n\t\t$o['latency/avg'] = $x['avg'];\n\t\t$o['latency/var'] = $x['var'];\n\t\t$o['latency/med'] = $x['med'];\n\n\t\treturn $o;\n\n\t}", "function timestamp()\n {\n return microtime(true);\n }", "function http_throttle($sec = null, $bytes = null) {}", "public static function report()\n {\n $report = [\n 'request_time' => $_SERVER['REQUEST_TIME_FLOAT'],\n 'execution_time' => self::$logs[count(self::$logs) - 1]['timestamp']\n - $_SERVER['REQUEST_TIME_FLOAT'],\n 'peak_memory_usage' => memory_get_peak_usage(),\n 'max_execution_time' => ini_get('max_execution_time'),\n 'memory_limit' => ini_get('memory_limit'),\n 'included_files' => count(get_included_files()),\n 'logs' => self::$logs,\n ];\n\n self::$logs = [];\n self::$timers = [];\n\n return $report;\n }", "public function create()\n {\n var_dump('Slow HTTP request in progress.');\n }", "function _get_time()\n{\n $_mtime = microtime();\n $_mtime = explode(\" \", $_mtime);\n\n return (double) ($_mtime[1]) + (double) ($_mtime[0]);\n}", "function getRemoteFileModifyTime($uri,$timeout=null)\n\t{\n\t $uri = parse_url($uri);\n\t $handle = @fsockopen($uri['host'],80);\n\t if (!is_null($timeout)) stream_set_timeout($handle,$timeout);\n\t if(!$handle)\n\t\t return 0;\n\t fputs($handle,\"GET $uri[path] HTTP/1.1\\r\\nHost: $uri[host]\\r\\n\\r\\n\");\n\t $result = 0;\n\t while(!feof($handle))\n\t {\n\t\t $line = fgets($handle,1024);\n\t\t if(!trim($line))\n\t\t break;\n\t\t $col = strpos($line,':');\n\t\t if($col !== false)\n\t\t {\n\t\t $header = trim(substr($line,0,$col));\n\t\t $value = trim(substr($line,$col+1));\n\t\t if(strtolower($header) == 'last-modified')\n\t\t {\n\t\t $result = strtotime($value);\n\t\t break;\n\t\t }\n\t\t }\n\t }\n\t fclose($handle);\n\t return $result;\n\t}", "function now() {\n return microtime(true)*1000;\n}", "function calc_gen_time()\r\n{\r\n static $a = NULL;\r\n\r\n if ($a == NULL)\r\n {\r\n $a = microtime(true);\r\n }\r\n else\r\n {\r\n $b = (microtime(true) - $a);\r\n $a = NULL;\r\n\r\n log_debug('Page generated in '. number_format($b, 3) .' sec');\r\n\r\n return $b;\r\n }\r\n}", "function getThumbProgress()\n {\n // release the locks, session not needed\n $session = \\cmsSession::getInstance();\n $session->releaseLocks();\n session_write_close();\n \n $key = isset($_GET['key']) ? $_GET['key'] : '';\n $processFile = $session->getTempPath() .'/progress' . $key . '.txt';\n \n $process = 0;\n if (file_exists($processFile)) {\n $process = file_get_contents($processFile);\n if ($process == 100) {\n \\Cx\\Lib\\FileSystem\\FileSystem::delete_file($processFile);\n }\n }\n \n echo $process;\n die;\n }", "function ip_information_curl($ip_address) /* I don't know why it's still named curl... */\n {\n $fp = file_get_contents($GLOBALS[\"ip_website\"] . $ip_address);\n return $fp;\n }", "public function time() {\n return $this->info['total_time'];\n }", "public function saveTotalDuration( StopwatchEvent $event ) {\n\t\t$this->filesystem->dumpFile( '.executionTime', $this->getDuration( $event ) );\n\t}", "function get_execution_time() {\n\treturn microtime(true) - __CHV_TIME_EXECUTION_STARTS__;\n}", "public static function getTimer()\n {\n return microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n }", "public function finPerformance(){\n $memoria = memory_get_usage() - $this->memoria;\n $tiempo = microtime(true) - $this->tiempo;\n\n echo \"<pre>\";\n print_r(array(\"memoria\" => $memoria.\" bytes \", \"tiempo\" => $tiempo.\" segundos\" ));\n die;\n }", "protected static function _time()\n\t{\n\t\treturn time();\n\t}", "public static function uptime() {\n return sprintf ( '%.6f', microtime ( true ) - microtime(true) );\n }", "function virustotalscan_get_report($resource, $key)\r\n{\r\n $url = 'https://www.virustotal.com/api/get_file_report.json';\r\n\t$fields = array('resource' => $resource, 'key' => $key);\r\n $fields_string = \"\";\r\n\tforeach($fields as $key => $value) {\r\n $fields_string .= $key.'='.$value.'&'; \r\n }\r\n\t$fields_string = rtrim($fields_string, '&');\r\n // se initializeaza o cerere\r\n\t$ch = curl_init();\r\n // se seteaza optiunile cererii\r\n\tcurl_setopt($ch,CURLOPT_URL,$url);\r\n\tcurl_setopt($ch,CURLOPT_POST,count($fields));\r\n\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n // se intoarce rezultatul cererii\r\n\t$result = curl_exec($ch);\r\n // se inchide cererea\r\n\tcurl_close($ch);\r\n // se decodeaza rezultatul de pe server\r\n\t$result = json_decode($result, true);\r\n // se intoarce rezultatul\r\n\tif(isset($result['result'])) {\r\n return $result;\r\n\t}\r\n else {\r\n\t\treturn false;\r\n\t}\r\n}", "function process_time(){\n $time = number_format( microtime(true) - LIM_START_MICROTIME, 6);\n return($time);\n}", "function dumpOptimizationReport($testPath, $run, $cached, $includeHeader = false)\r\n{\r\n // load the raw results\r\n $cachedText='';\r\n if((int)$cached == 1)\r\n $cachedText='_Cached';\r\n $fileName = $testPath . '/' . $run . $cachedText . '_optimization.txt';\r\n $lines = file($fileName, FILE_IGNORE_NEW_LINES);\r\n if( $lines)\r\n {\r\n if( $includeHeader )\r\n echo '<h3>Statistics:</h3>';\r\n \r\n $needsClose = true;\r\n $display = false;\r\n echo '<p class=\"indented1\">';\r\n\r\n // loop through each line in the file\r\n foreach($lines as $linenum => $line) \r\n {\r\n $line = htmlspecialchars(trim($line));\r\n if( !strcmp($line,\"Enable browser caching of static assets:\") ||\r\n !strcmp($line,\"Use one CDN for all static assets:\") ||\r\n !strcmp($line,\"Combine static CSS and JS files:\") ||\r\n !strncmp($line,\"GZIP encode all appropriate text assets (text responses > 1400 bytes):\", 20) ||\r\n !strcmp($line,\"Compress Images:\") ||\r\n !strcmp($line,\"Use persistent connections (keep alive):\") ||\r\n !strcmp($line,\"Proper cookie usage:\") ||\r\n !strcmp($line,\"Minify JS:\") ||\r\n !strcmp($line,\"JQuery Selectors not descended from an ID:\") ||\r\n !strcmp($line,\"No ETag headers (ETag headers should generally not be used unless you have an explicit reason to need them):\") )\r\n {\r\n if( $needsClose )\r\n echo '</p>';\r\n\r\n echo \"<h3>\" . $line . '</h3><p class=\"indented1\">' . \"\\n\";\r\n $needsClose = true;\r\n $display = true;\r\n }\r\n else\r\n {\r\n if( !$display && $includeHeader && (strpos($line, 'Page load time:') !== false) )\r\n $display = true;\r\n \r\n if( $display )\r\n {\r\n if( strpos($line, \"Cache score :\") !== false || \r\n strpos($line, \"CDN score (static objects) :\") !== false || \r\n strpos($line, \"Combine score :\") !== false || \r\n strpos($line, \"GZIP score :\") !== false || \r\n strpos($line, \"Image Compression score :\") !== false || \r\n strpos($line, \"Keep-Alive score :\") !== false || \r\n strpos($line, \"Cookie score :\") !== false || \r\n strpos($line, \"Minify score :\") !== false || \r\n strpos($line, \"ETag score :\") !== false )\r\n {\r\n echo '<br><b>' . $line . \"</b><br>\\n\";\r\n }\r\n elseif( !strncmp($line, 'cookie:', 7) || !strncmp($line, 'Line ', 5) || !strncmp($line, '...', 3) )\r\n {\r\n echo '<span class=\"indented1\">' . $line . \"</span><br>\\n\";\r\n }\r\n else\r\n {\r\n echo $line . \"<br>\\n\";\r\n }\r\n }\r\n }\r\n }\r\n if( $needsClose )\r\n echo '</p>';\r\n }\r\n}", "private function getCurrentTime()\n {\n return microtime(true);\n }", "public function getExecutionTime()/*# : float */;", "function prof_print()\n{\n global $prof_timing, $prof_names;\n $size = count($prof_timing);\n for ($i = 0; $i < $size - 1; $i++) {\n echo \"<b>{$prof_names[$i]}</b><br>\";\n echo sprintf(\"&nbsp;&nbsp;&nbsp;%f<br>\", $prof_timing[$i + 1] - $prof_timing[$i]);\n }\n echo \"<b>{$prof_names[$size - 1]}</b><br>\";\n}", "public function time()\n {\n return $this->_requestTime;\n }", "function driver_stats($option = array()) {\n $res = array(\n \"info\" => \"\",\n \"size\" => \"\",\n \"data\" => \"\",\n );\n\n $path = $this->getPath();\n $dir = @opendir($path);\n if(!$dir) {\n throw new Exception(\"Can't read PATH:\".$path,94);\n }\n\n $total = 0;\n $removed = 0;\n while($file=readdir($dir)) {\n if($file!=\".\" && $file!=\"..\" && is_dir($path.DIRECTORY_SEPARATOR.$file)) {\n // read sub dir\n $subdir = @opendir($path.DIRECTORY_SEPARATOR.$file);\n if(!$subdir) {\n throw new Exception(\"Can't read path:\".$path.DIRECTORY_SEPARATOR.$file,93);\n }\n\n while($f = readdir($subdir)) {\n if($f!=\".\" && $f!=\"..\") {\n $file_path = $path.DIRECTORY_SEPARATOR.$file.DIRECTORY_SEPARATOR.$f;\n $size = filesize($file_path);\n $object = $this->decode($this->readfile($file_path));\n if($this->isExpired($object)&&file_exists($file_path)) {\n @unlink($file_path);\n clearstatcache(TRUE, $file_path);\n $removed = $removed + $size;\n }\n $total = $total + $size;\n }\n } // end read subdir\n } // end if\n } // end while\n\n $res['size'] = $total - $removed;\n $res['info'] = array(\n \"Total\" => $total,\n \"Removed\" => $removed,\n \"Current\" => $res['size'],\n );\n return $res;\n }", "function fetchUrl($url){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 20);\n $retData = curl_exec($ch);\n curl_close($ch); \n \n return $retData;\n}", "function find_score( $url, $device, $key = '' ) {\n\n $url = \n \"https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=\" . $url . \"&category=performance&fields=lighthouseResult%2Fcategories%2F*%2Fscore&prettyPrint=false&strategy=\" . $device . \"&key=\" . $key;\n\n $init = curl_init();\n\n curl_setopt($init, CURLOPT_URL, $url);\n curl_setopt($init, CURLOPT_RETURNTRANSFER, true);\n\n $responce = curl_exec( $init );\n curl_close($init);\n\n $responce = json_decode( $responce );\n\n if ( ! empty( $responce->lighthouseResult->categories->performance->score ) ) {\n $score = $responce->lighthouseResult->categories->performance->score;\n $score = $score * 100;\n } else {\n $score = 'API Error';\n }\n\n return $score;\n}" ]
[ "0.640823", "0.6321931", "0.6060934", "0.57695085", "0.56709605", "0.54980594", "0.5496281", "0.54742", "0.546847", "0.54298246", "0.541716", "0.541716", "0.535876", "0.5353101", "0.5304129", "0.53001624", "0.5286675", "0.52853054", "0.52751696", "0.52609426", "0.52469873", "0.5227107", "0.520904", "0.5195386", "0.51816845", "0.5166747", "0.515601", "0.5147939", "0.51428294", "0.512101", "0.5115776", "0.5108811", "0.5106113", "0.5105886", "0.5101216", "0.50956666", "0.50867486", "0.50862324", "0.50823414", "0.50727886", "0.5049967", "0.50379574", "0.5022058", "0.5017496", "0.50013715", "0.49915075", "0.4991431", "0.49911427", "0.4990659", "0.4980912", "0.49762562", "0.49728578", "0.4962568", "0.49590963", "0.49451968", "0.49273235", "0.49180603", "0.49150226", "0.4904391", "0.49009976", "0.48951504", "0.4891482", "0.4879229", "0.48715174", "0.4870845", "0.48707917", "0.48514494", "0.4846325", "0.4842933", "0.4841194", "0.48343563", "0.48324075", "0.48258206", "0.48256242", "0.4818616", "0.481624", "0.48122516", "0.48097047", "0.48077154", "0.48063818", "0.4805264", "0.4805251", "0.47984532", "0.47858903", "0.47795427", "0.47776312", "0.47689596", "0.4763523", "0.47629163", "0.47585025", "0.47580174", "0.4756161", "0.47560686", "0.47546476", "0.47533676", "0.47523555", "0.47518176", "0.4747002", "0.47447783", "0.47445482" ]
0.7301977
0
Display a listing of the resource.
public function index() { $business_id = request()->session()->get('user.business_id'); $is_admin = $this->commonUtil->is_admin(auth()->user(), $business_id); $user = request()->session()->get('user'); $statuses = ProjectTask::taskStatuses(); if (!(auth()->user()->can('superadmin') || $this->moduleUtil->hasThePermissionInSubscription($business_id, 'project_module'))) { abort(403, 'Unauthorized action.'); } if (request()->ajax()) { $project_task = ProjectTask::with(['members', 'createdBy', 'project', 'comments']) ->where('business_id', $business_id) ->select('*'); //if user is not admin get assiged task only $user_id = $user['id']; if (empty(request()->get('project_id')) && !$is_admin) { $project_task->whereHas('members', function ($q) use ($user_id) { $q->where('user_id', $user_id); }); } //filter by project id if (!empty(request()->get('project_id'))) { $project_task->where('project_id', request()->get('project_id')); } //filter by assigned to if (!empty(request()->get('user_id'))) { $user_id = request()->get('user_id'); $project_task->whereHas('members', function ($q) use ($user_id) { $q->where('user_id', $user_id); }); } // filter by status if (!empty(request()->get('status'))) { $project_task->where('status', request()->get('status')); } // filter by priority if (!empty(request()->get('priority'))) { $project_task->where('priority', request()->get('priority')); } // filter by due date if (!empty(request()->get('due_date'))) { if (request()->get('due_date') == 'overdue') { $project_task->where('due_date', '<', Carbon::today()) ->where('status', '!=', 'completed'); } elseif (request()->get('due_date') == 'today') { $project_task->where('due_date', Carbon::today()) ->where('status', '!=', 'completed'); } elseif (request()->get('due_date') == 'less_than_one_week') { $project_task->whereBetween('due_date', [Carbon::today(), Carbon::today()->addWeek()]) ->where('status', '!=', 'completed'); } } // check if user can crud task $project_id = request()->get('project_id'); $project = Project::find($project_id); $is_lead = $this->projectUtil->isProjectLead(auth()->user()->id, $project_id); $is_member = $this->projectUtil->isProjectMember(auth()->user()->id, $project_id); $can_crud = false; if ($is_admin || $is_lead) { $can_crud = true; } elseif ($is_member && (isset($project->settings['members_crud_task']) && $project->settings['members_crud_task'])) { $can_crud = true; } if (request()->get('task_view') == 'list_view') { return Datatables::of($project_task) ->addColumn('action', function ($row) use ($can_crud) { $html = '<div class="btn-group"> <button class="btn btn-info dropdown-toggle btn-xs" type="button" data-toggle="dropdown" aria-expanded="false"> '. __("messages.action").' <span class="caret"></span> <span class="sr-only">' . __("messages.action").' </span> </button> <ul class="dropdown-menu dropdown-menu-left" role="menu"> <li> <a data-href="' . action('\Modules\Project\Http\Controllers\TaskController@show', ['id' => $row->id, 'project_id' => $row->project_id]) . '" class="cursor-pointer view_a_project_task"> <i class="fa fa-eye"></i> '.__("messages.view").' </a> </li> <li> <a data-href="' . action('\Modules\Project\Http\Controllers\TaskController@getTaskStatus', ['id' => $row->id, 'project_id' => $row->project_id]) . '"class="cursor-pointer change_status_of_project_task"> <i class="fa fa-check"></i> '.__("project::lang.change_status").' </a> </li>'; if ($can_crud) { $html .= '<li> <a data-href="' . action('\Modules\Project\Http\Controllers\TaskController@edit', ['id' => $row->id, 'project_id' => $row->project_id]) . '" class="cursor-pointer edit_a_project_task"> <i class="fa fa-edit"></i> '.__("messages.edit").' </a> </li> <li> <a data-href="' . action('\Modules\Project\Http\Controllers\TaskController@destroy', ['id' => $row->id, 'project_id' => $row->project_id]) . '" class="cursor-pointer delete_a_project_task"> <i class="fas fa-trash"></i> '.__("messages.delete").' </a> </li>'; } $html .= '</ul> </div>'; return $html; }) ->editColumn('priority', function ($row) { $priority = __('project::lang.'.$row->priority); $html = '<span class="label '.$this->priority_colors[$row->priority].'">'. $priority .'</span>'; return $html; }) ->editColumn('start_date', ' @if(isset($start_date)) {{@format_date($start_date)}} @endif ') ->editColumn('due_date', ' @if(isset($due_date)) {{@format_date($due_date)}} @endif ') ->editColumn('createdBy', function ($row) { return optional($row->createdBy)->user_full_name; }) ->editColumn('project', function ($row) { return $row->project->name; }) ->editColumn('members', function ($row) { $html = '&nbsp;'; foreach ($row->members as $member) { if (isset($member->media->display_url)) { $html .= '<img class="user_avatar" src="'.$member->media->display_url.'" data-toggle="tooltip" title="'.$member->user_full_name.'">'; } else { $html .= '<img class="user_avatar" src="https://ui-avatars.com/api/?name='.$member->first_name.'" data-toggle="tooltip" title="'.$member->user_full_name.'">'; } } return $html; }) ->editColumn('status', function ($row) { if ($row->status == 'completed') { $status = __('project::lang.completed'); $bg = 'bg-green'; } elseif ($row->status == 'cancelled') { $status = __('project::lang.cancelled'); $bg = 'bg-red'; } elseif ($row->status == 'on_hold') { $status = __('project::lang.on_hold'); $bg = 'bg-yellow'; } elseif ($row->status == 'in_progress') { $status = __('project::lang.in_progress'); $bg = 'bg-info'; } elseif ($row->status == 'not_started') { $status = __('project::lang.not_started'); $bg = 'bg-red'; } $href = action("\Modules\Project\Http\Controllers\TaskController@getTaskStatus", ["id" => $row->id, "project_id" => $row->project_id]); $html = '<span class="cursor-pointer change_status_of_project_task label '.$bg.'" data-href="'.$href.'"> '. $status .'</span>'; return $html; }) ->editColumn('subject', ' <a data-href="{{action("\Modules\Project\Http\Controllers\TaskController@show", ["id" => $id, "project_id" => $project_id])}}" class="cursor-pointer view_a_project_task text-black"> {{$subject}} <code>{{$task_id}}</code> </a> ') ->removeColumn('id') ->rawColumns(['action', 'project', 'subject', 'members', 'priority', 'start_date', 'due_date', 'status', 'createdBy']) ->make(true); } elseif (request()->get('task_view') == 'kanban') { $project_task = $project_task->get()->groupBy('status'); //sort array based on status $project_tasks = []; foreach ($statuses as $key => $value) { if (!isset($project_task[$key])) { $project_tasks[$key] = []; } else { $project_tasks[$key] = $project_task[$key]; } } $kanban_tasks = []; foreach ($project_tasks as $key => $tasks) { //get all the card for particular board(status) $cards = []; foreach ($tasks as $task) { $edit = ''; $delete = ''; if ($can_crud) { $edit = action('\Modules\Project\Http\Controllers\TaskController@edit', ['id' => $task->id, 'project_id' => $task->project_id]); $delete = action('\Modules\Project\Http\Controllers\TaskController@destroy', ['id' => $task->id, 'project_id' => $task->project_id]); } $view = action('\Modules\Project\Http\Controllers\TaskController@show', ['id' => $task->id, 'project_id' => $task->project_id]); //if member then get their avatar if ($task->members->count() > 0) { $assigned_to = []; foreach ($task->members as $member) { if (isset($member->media->display_url)) { $assigned_to[$member->user_full_name] = $member->media->display_url; } else { $assigned_to[$member->user_full_name] = "https://ui-avatars.com/api/?name=".$member->first_name; } } } $cards[] = [ 'id' => $task->id, 'title' => $task->subject, 'project_id' => $task->project_id, 'project' => $task->project->name, 'subtitle' => $task->task_id, 'viewUrl' => $view, 'viewUrlClass' => 'view_a_project_task', 'editUrl' => $edit, 'editUrlClass' => 'edit_a_project_task', 'deleteUrl' => $delete, 'deleteUrlClass' => 'delete_a_project_task', 'hasDescription' => !empty($task->description) ?: false, 'hasComments' => ($task->comments->count() > 0) ?: false, 'dueDate' => $task->due_date, 'assigned_to' => $assigned_to, 'tags' => [__('project::lang.'.$task->priority)], ]; } //get all the card & board title for particular board(status) $kanban_tasks[] = [ 'id' => $key, 'title' => __('project::lang.'.$key), 'cards' => $cards, ]; } $output = [ 'success' => true, 'project_tasks' => $kanban_tasks, 'msg' => __('lang_v1.success') ]; return $output; } } $business_id = request()->session()->get('user.business_id'); $users = User::forDropdown($business_id, false); $priorities = ProjectTask::prioritiesDropdown(); $due_dates = ProjectTask::dueDatesDropdown(); // if not admin get assigned project for filter $user_id = null; if (!$is_admin) { $user_id = $user['id']; } $projects = Project::projectDropdown($business_id, $user_id); return view('project::my_task.index') ->with(compact('users', 'statuses', 'priorities', 'due_dates', 'projects', 'is_admin')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { $project_id = request()->get('project_id'); $project_members = ProjectMember::projectMembersDropdown($project_id); $priorities = ProjectTask::prioritiesDropdown(); $statuses = ProjectTask::taskStatuses(); return view('project::task.create') ->with(compact('project_members', 'priorities', 'project_id', 'statuses')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create()\n {\n return view('student::students.student.create');\n }" ]
[ "0.7593198", "0.7593198", "0.75881755", "0.75787884", "0.7570936", "0.74992913", "0.7436037", "0.7431172", "0.7386512", "0.7351077", "0.7337819", "0.73100585", "0.7295612", "0.72803086", "0.7272473", "0.72422874", "0.7229479", "0.7224403", "0.7184453", "0.7177193", "0.7173551", "0.71482", "0.71424824", "0.7141885", "0.7135663", "0.7126202", "0.7121413", "0.7113729", "0.7113729", "0.7113729", "0.7110717", "0.7092118", "0.7083616", "0.7080794", "0.7078082", "0.70561296", "0.70561296", "0.7054459", "0.703925", "0.70373696", "0.70346737", "0.70324355", "0.70287114", "0.7025425", "0.7025232", "0.7018496", "0.7016745", "0.7002774", "0.70019513", "0.69991785", "0.69942427", "0.69936013", "0.69929653", "0.6988009", "0.69856364", "0.6965122", "0.6964889", "0.6955187", "0.69511235", "0.69497", "0.6947041", "0.69432163", "0.6940678", "0.6939846", "0.6936846", "0.6936846", "0.6936506", "0.6933589", "0.69309", "0.69273484", "0.6925485", "0.6921386", "0.6917649", "0.6913987", "0.6910826", "0.6909406", "0.69085246", "0.6907409", "0.69021183", "0.6900961", "0.68997645", "0.68991655", "0.6894049", "0.68920606", "0.6892033", "0.6891114", "0.6890811", "0.6890811", "0.6887868", "0.6887327", "0.68854356", "0.688366", "0.68805534", "0.68766564", "0.68753666", "0.6872474", "0.68717086", "0.6869974", "0.6869806", "0.6868809", "0.68685615" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { try { $input = $request->only('subject', 'project_id', 'description', 'priority', 'custom_field_1', 'custom_field_2', 'custom_field_3', 'custom_field_4', 'status'); $input['start_date'] = !empty($request->input('start_date')) ? $this->commonUtil->uf_date($request->input('start_date')) : null; $input['due_date'] = !empty($request->input('due_date')) ? $this->commonUtil->uf_date($request->input('due_date')) : null; $input['created_by'] = $request->user()->id; $input['business_id'] = request()->session()->get('user.business_id'); $input['task_id'] = $this->projectUtil->generateTaskId($input['business_id'], $input['project_id']); $members = $request->input('user_id'); $project_task = ProjectTask::create($input); $task_members = $project_task->members()->sync($members); // send notification to task members if (!empty($task_members['attached'])) { //check if user is a creator then don't notify him foreach ($task_members['attached'] as $key => $value) { if ($value == $project_task->created_by) { unset($task_members['attached'][$key]); } } //Used for broadcast notification $project_task['title'] = __('project::lang.task'); $project_task['body'] = strip_tags(__( 'project::lang.new_task_assgined_notification', [ 'created_by' => $request->user()->user_full_name, 'subject' => $project_task->subject, 'task_id' => $project_task->task_id ] )); $project_task['link'] = action('\Modules\Project\Http\Controllers\ProjectController@show', ['id' => $project_task->project_id]); $this->projectUtil->notifyUsersAboutAssignedTask($task_members['attached'], $project_task); } $output = [ 'success' => true, 'msg' => __('lang_v1.success') ]; } catch (Exception $e) { \Log::emergency("File:" . $e->getFile(). "Line:" . $e->getLine(). "Message:" . $e->getMessage()); $output = [ 'success' => false, 'msg' => __('messages.something_went_wrong') ]; } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Show the specified resource.
public function show($id) { $project_id = request()->get('project_id'); $project_task = ProjectTask::with(['members', 'createdBy', 'project', 'comments' => function ($query) { $query->latest(); }, 'comments.media', 'comments.commentedBy', 'timeLogs', 'timeLogs.user']) ->where('project_id', $project_id) ->findOrFail($id); $business_id = request()->session()->get('user.business_id'); $is_admin = $this->commonUtil->is_admin(auth()->user(), $business_id); $is_lead = $this->projectUtil->isProjectLead(auth()->user()->id, $id); $is_lead_or_admin = false; if ($is_admin || $is_lead) { $is_lead_or_admin = true; } $can_crud_timelog = $this->projectUtil->canMemberCrudTimelog($business_id, auth()->user()->id, $project_id); return view('project::task.show') ->with(compact('project_task', 'is_lead_or_admin', 'can_crud_timelog')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function show($id) {}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function show(Question $question) // the show part requires an id (default)\n {\n //Show function does Route Model Binding, is the simple way of telling that this\n // function provides the id of the question by default\n return new QuestionResource($question);\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n { \n \n }", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show($id)\n {\n // ..\n }", "public function show(Resena $resena)\n {\n }", "public function show($id)\n {\n $obj = Obj::where('id',$id)->first();\n \n $this->authorize('view', $obj);\n if($obj)\n return view('appl.'.$this->app.'.'.$this->module.'.show')\n ->with('obj',$obj)->with('app',$this);\n else\n abort(404);\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n // Code Goes Here\n }", "public function show(Show $show)\n {\n $this->authorize('basicView', $show);\n\n if (Auth::user()->can('view', $show)) {\n return $show->with(['hosts', 'invitees'])->first();\n }\n\n return new ShowResource($show);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "public function show($id) {\n\n\t}", "public function show($id){\n \n }", "public function show($id) {\n }", "public function show($id)\n {\n\n }", "public function show($id) {\n //\n }", "public function show($id) {\n //\n }", "public function show($id) {\n //\n }", "public function show($id) {\r\n //\r\n }", "public function show($id) {\r\n //\r\n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show($id)\r\r\n {\r\r\n //\r\r\n }", "public function show($id)\r\r\n {\r\r\n //\r\r\n }", "public function show($id)\r\n {\r\n \r\n }", "public function show($id)\n {\n \n \n }", "public function show($id)\n {\n \n \n }", "public function show($id) {\n\t //\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }" ]
[ "0.8661945", "0.8655518", "0.70617014", "0.70157945", "0.6972034", "0.6936089", "0.6916712", "0.6891719", "0.68023425", "0.6679236", "0.66607267", "0.6638694", "0.6617495", "0.6607225", "0.6594313", "0.65942454", "0.658194", "0.658077", "0.65533966", "0.6550209", "0.6550209", "0.6550209", "0.6550209", "0.6550209", "0.6550209", "0.6550209", "0.6550209", "0.6550209", "0.6550209", "0.65432423", "0.65432423", "0.65432423", "0.65432423", "0.65432423", "0.65432423", "0.65432423", "0.65432423", "0.65432423", "0.65432423", "0.654101", "0.65349215", "0.6526978", "0.65207326", "0.65170187", "0.6515921", "0.65077204", "0.6507069", "0.6507069", "0.6507069", "0.65060925", "0.65060925", "0.6500031", "0.6500031", "0.6500031", "0.6500031", "0.64969707", "0.64969707", "0.64907444", "0.64907444", "0.64907444", "0.64907444", "0.6489605", "0.6489174", "0.6488905", "0.6488905", "0.6482979", "0.6481028", "0.6481028", "0.6480175", "0.64769554", "0.6475207", "0.6472861", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503", "0.6472503" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $project_id = request()->get('project_id'); $project_task = ProjectTask::with('members') ->where('project_id', $project_id) ->findOrFail($id); $project_members = ProjectMember::projectMembersDropdown($project_id); $priorities = ProjectTask::prioritiesDropdown(); $statuses = ProjectTask::taskStatuses(); return view('project::task.edit') ->with(compact('project_members', 'priorities', 'project_task', 'statuses')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }" ]
[ "0.78557473", "0.76946205", "0.72731614", "0.7241571", "0.71700776", "0.70650244", "0.7052897", "0.698311", "0.69465625", "0.6944826", "0.69399333", "0.69286525", "0.69031185", "0.68969506", "0.68969506", "0.6878258", "0.6862812", "0.6859171", "0.68560475", "0.68436426", "0.6834711", "0.6810601", "0.680613", "0.6804975", "0.68015367", "0.6795471", "0.6791821", "0.6791821", "0.6787303", "0.6783644", "0.67790574", "0.67766285", "0.6767741", "0.67610145", "0.67455536", "0.67455536", "0.6744367", "0.6743159", "0.6739656", "0.67351145", "0.67246765", "0.67128825", "0.6692859", "0.66916454", "0.6687554", "0.66875297", "0.6687494", "0.6684443", "0.668203", "0.66689324", "0.66680384", "0.6664605", "0.6664605", "0.66621166", "0.66604865", "0.66589504", "0.6655767", "0.66542184", "0.665213", "0.66422516", "0.6631665", "0.663077", "0.6627607", "0.6627607", "0.66193914", "0.6618503", "0.66160196", "0.66146857", "0.6609641", "0.6608315", "0.6605284", "0.6595882", "0.65947276", "0.6594626", "0.65895563", "0.6589339", "0.6587281", "0.65805006", "0.6579201", "0.6579166", "0.657641", "0.6576111", "0.65740323", "0.65692765", "0.6568046", "0.6567221", "0.6565346", "0.6560687", "0.6560687", "0.6560384", "0.65577257", "0.65569293", "0.65558636", "0.6555392", "0.65553015", "0.65542984", "0.655418", "0.6554106", "0.6547678", "0.65473104", "0.6543329" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { try { $input = $request->only('subject', 'description', 'priority', 'custom_field_1', 'custom_field_2', 'custom_field_3', 'custom_field_4', 'status'); $input['start_date'] = !empty($request->input('start_date')) ? $this->commonUtil->uf_date($request->input('start_date')) : null; $input['due_date'] = !empty($request->input('due_date')) ? $this->commonUtil->uf_date($request->input('due_date')) : null; $members = $request->input('user_id'); $project_id = $request->get('project_id'); $project_task = ProjectTask::where('project_id', $project_id) ->findOrFail($id); $project_task->update($input); $task_members = $project_task->members()->sync($members); // send notification to task members if (!empty($task_members['attached'])) { //check if user is a creator then don't notify him foreach ($task_members['attached'] as $key => $value) { if ($value == $project_task->created_by) { unset($task_members['attached'][$key]); } } //Used for broadcast notification $project_task['title'] = __('project::lang.task'); $project_task['body'] = strip_tags(__( 'project::lang.new_task_assgined_notification', [ 'created_by' => $request->user()->user_full_name, 'subject' => $project_task->subject, 'task_id' => $project_task->task_id ] )); $project_task['link'] = action('\Modules\Project\Http\Controllers\ProjectController@show', ['id' => $project_task->project_id]); $this->projectUtil->notifyUsersAboutAssignedTask($task_members['attached'], $project_task); } $output = [ 'success' => true, 'msg' => __('lang_v1.success') ]; } catch (Exception $e) { \Log::emergency("File:" . $e->getFile(). "Line:" . $e->getLine(). "Message:" . $e->getMessage()); $output = [ 'success' => false, 'msg' => __('messages.something_went_wrong') ]; } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update($request, $id);", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "abstract public function put($data);", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update($id, $input);", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.74238616", "0.7062842", "0.7057816", "0.6897868", "0.65820867", "0.64505464", "0.6347915", "0.62114644", "0.6145006", "0.61231726", "0.6115922", "0.6100021", "0.6089019", "0.60542375", "0.60187906", "0.6008231", "0.5974106", "0.5944986", "0.59397626", "0.59393746", "0.58937186", "0.58607864", "0.5853811", "0.5853811", "0.58521867", "0.5815276", "0.58061725", "0.57518756", "0.57518756", "0.5736318", "0.57246256", "0.5715636", "0.5696208", "0.5691033", "0.5687788", "0.56692934", "0.56556624", "0.5652178", "0.56494987", "0.5636202", "0.56355816", "0.5632871", "0.563206", "0.56291884", "0.5621382", "0.56087434", "0.5602465", "0.55928403", "0.55825645", "0.55821884", "0.5581833", "0.5576869", "0.55712104", "0.5568173", "0.55648434", "0.5562885", "0.5560537", "0.5560537", "0.5560537", "0.5560537", "0.5560537", "0.55592597", "0.5556131", "0.5555849", "0.5555397", "0.5553912", "0.55530137", "0.5543831", "0.55430055", "0.5540152", "0.5539437", "0.55359006", "0.5535772", "0.5534487", "0.552458", "0.5518245", "0.5515452", "0.55145514", "0.5509227", "0.55079365", "0.55065364", "0.55039924", "0.5501616", "0.5500345", "0.5499738", "0.54980725", "0.5496017", "0.5496017", "0.5494488", "0.5494334", "0.54936594", "0.54934716", "0.5491019", "0.54835314", "0.54795796", "0.5479442", "0.5478275", "0.54646415", "0.54637444", "0.5461914", "0.54562414" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { try { $project_id = request()->get('project_id'); $project_task = ProjectTask::where('project_id', $project_id) ->findOrFail($id); $project_task->delete(); $output = [ 'success' => true, 'msg' => __('lang_v1.success') ]; } catch (Exception $e) { \Log::emergency("File:" . $e->getFile(). "Line:" . $e->getLine(). "Message:" . $e->getMessage()); $output = [ 'success' => false, 'msg' => __('messages.something_went_wrong') ]; } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
get task status for update.
public function getTaskStatus() { $task_id = request()->get('id'); $project_id = request()->get('project_id'); $statuses = ProjectTask::taskStatuses(); $project_task = ProjectTask::where('project_id', $project_id) ->findOrFail($task_id); return view('project::task.change_status') ->with(compact('project_task', 'statuses')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUpdateStatus() {\n return $this->_statusManager->getStatus ();\n }", "public static function getUpdateStatus()\n {\n /* get the command */\n $command = self::getUpdateCommand();\n\n /* execute command */\n return self::executeCommand($command['command'], $command['statusMessages'], $command['hints']);\n }", "public function projectTaskStatusUpdate(){\r\n\t\t//fetch activity feed list\r\n\t\t$post = $this->input->post(null, true);\r\n\t\t$parent_id = $post['pid'];\r\n\t\t$task_id = $post['tid'];\r\n\t\t$status_id = $post['stat'];\r\n\t\t$completed_time = gmdate('Y-m-d H:i:s');\r\n\r\n\t\t//$task = new Task();\r\n\t\t$data = array('status_id' => $status_id, 'completed_date'=>$completed_time);\r\n\t\t$this->db->where(\"parent_id\", $parent_id);\r\n\t\t$this->db->where(\"task_id\", $task_id);\r\n\t\t$this->db->update(\"sc_tasks\", $data);\r\n\r\n\t}", "public function update_status();", "public function refreshTaskStatus(){\n\n $webCronResult = $this->webCronResults()->orderBy('code', 'desc')->first();\n\n if ($webCronResult) {\n\n if ($webCronResult->code >= 300) {\n // bad status\n $this->status = 0 ;\n }else{\n // good status\n $this->status = 2 ;\n };\n\n $this->save();\n\n };\n\n }", "public function getStatus() {\n\t\tif(!$this->server) {\n\t\t\treturn false;\n\t\t}\n\t\tif(!$this->status_new) {\n\t\t\t$this->update();\n\t\t}\n\t\treturn $this->status_new;\n\t}", "public function getStatus()\n {\n return $this->query('mnsync status');\n }", "public function status () {\n\n //GETS CURRENT NOTEPADID FROM REQUEST AND STORES IN VARIABLE\n $NotepadID = request('NotepadID');\n \n //FINDS TASK RECORD WITH ID REQUEST AND STORES IN OBJECT\n $data=Tasks::find(request('id'));\n \n //IF TASK STATUS EQUALS TRUE, THEN SET FALSE AND IF TASK STATUS\n //EQUALS FALSE THEN SET TRUE\n if ($data->status) {\n $data->status=0;\n } \n else {\n $data->status=1;\n }\n\n //SAVE DB\n $data->save();\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$NotepadID\");\n }", "public function testUpdateTask()\n {\n }", "public function updateTaskStatus($request)\n {\n try {\n $requestStatus = $request->status;\n $user = Auth::user();\n $statusArray = $this->getStatusArray();\n\n $task = Task::select(Task::table.'.id',\n Task::table.'.'.Task::org_id,\n Task::table.'.'.Task::task_status_id,\n Task::table.'.'.Task::creator_user_id,\n Task::table.'.'.Task::responsible_person_id,\n Task::table.'.'.Task::approver_user_id,\n Task::table.'.'.Task::approve_task_completed\n )\n ->whereIn(Task::table.'.'.Task::slug, $request->tasks)->firstOrFail();\n\n DB::beginTransaction();\n\n if ($request->action == 'single') {\n $taskStatus = $this->getTaskStatus($requestStatus);\n $task->{Task::task_status_id} = $taskStatus->id;\n\n //echo $task->{Task::creator_user_id} . '.' . $task->{Task::responsible_person_id}. '.' .$task->{Task::approver_user_id}. '.' .$user->id;die;\n if (($task->{Task::creator_user_id} == $user->id) && ($task->{Task::responsible_person_id} == $user->id) && ($task->{Task::approver_user_id} == $user->id)) {\n if ($requestStatus == 'complete') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::completed_approved];\n $task->{Task::task_completed_user_id} = $user->id;\n } else if ($requestStatus == 'accepted') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::completed_approved];\n } else if ($requestStatus == 'returnTask') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::active];\n }\n } else if (($task->{Task::responsible_person_id} == $user->id) && ($task->{Task::approver_user_id} == $user->id)) {\n if ($requestStatus == 'complete') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::completed_approved];\n $task->{Task::task_completed_user_id} = $user->id;\n } else if ($requestStatus == 'accepted') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::completed_approved];\n } else if ($requestStatus == 'returnTask') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::active];\n }\n } else if (($task->{Task::creator_user_id} == $user->id) && ($task->{Task::responsible_person_id} == $user->id)) {\n if ($requestStatus == 'complete' && $task->{Task::approve_task_completed}) {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::completed_approved];\n $task->{Task::task_completed_user_id} = $user->id;\n } else if ($requestStatus == 'accepted') {\n throw new \\Exception(\"You have no permission to aprrove\", Response::HTTP_UNPROCESSABLE_ENTITY);\n } else if ($requestStatus == 'returnTask') {\n throw new \\Exception(\"You have no permission to reject\", Response::HTTP_UNPROCESSABLE_ENTITY);\n }\n }else if (($task->{Task::creator_user_id} == $user->id) && ($task->{Task::approver_user_id} == $user->id)) {\n if ($requestStatus == 'complete') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::completed_approved];\n $task->{Task::task_completed_user_id} = $user->id;\n } else if ($requestStatus == 'accepted') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::completed_approved];\n } else if ($requestStatus == 'returnTask') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::active];\n }\n } else if ($task->{Task::approver_user_id} == $user->id) {\n\n if ($requestStatus == 'start') {\n throw new \\Exception(\"You have no permission to start\", Response::HTTP_UNPROCESSABLE_ENTITY);\n }\n\n if ($requestStatus == 'complete') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::completed_approved];\n } else if ($requestStatus == 'accepted') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::completed_approved];\n } else if ($requestStatus == 'returnTask') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::active];\n }\n } else if ($task->{Task::responsible_person_id} == $user->id) {\n if ($requestStatus == 'complete' && $task->{Task::approve_task_completed}) {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::completed_approved];\n $task->{Task::task_completed_user_id} = $user->id;\n } else if ($requestStatus == 'complete') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::completed_waiting_approval];\n $task->{Task::task_completed_user_id} = $user->id;\n } else if ($requestStatus == 'accepted') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::completed_approved];\n } else if ($requestStatus == 'returnTask') {\n $task->{Task::task_status_id} = $statusArray[TaskStatus::active];\n }\n } else if ($task->{Task::creator_user_id} == $user->id) {\n throw new \\Exception(\"Creator cant update a status\", Response::HTTP_UNPROCESSABLE_ENTITY);\n }\n }\n\n $task->save();\n\n $activityStreamNoteVar = \"\";\n\n if ($requestStatus == 'start')\n $activityStreamNoteVar = 'taskStarted';\n else if ($requestStatus == 'pause')\n $activityStreamNoteVar = 'taskStarted';\n else if ($requestStatus == 'complete')\n $activityStreamNoteVar = 'taskCompleted';\n else if ($requestStatus == 'accepted')\n $activityStreamNoteVar = 'taskAccepted';\n else if ($requestStatus == 'returnTask')\n $activityStreamNoteVar = 'taskRejected';\n\n $this->addTaskStatusLog($task, $user);\n $this->setDataForActivityStream($task, $activityStreamNoteVar);\n\n DB::commit();\n } catch (\\Exception $e) {\n DB::rollBack();\n $this->content['error'] = $e->getMessage();\n $this->content['code'] = Response::HTTP_UNPROCESSABLE_ENTITY;\n $this->content['status'] = ResponseStatus::ERROR;\n return $this->content;\n }\n\n $this->content['data'] = array(\n 'taskStatus' => $requestStatus,\n 'taskStatusId' => $task->{Task::task_status_id},\n 'userStatusButtons' => $this->getUserButtons($task, $user, $statusArray)\n );\n $this->content['code'] = 200;\n $this->content['status'] = ResponseStatus::OK;\n return $this->content;\n\n }", "function get_status() {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status = $this->get()->post_status;\n }", "public function getJobStatus()\n {\n }", "public function getStatus()\n {\n $this->execute();\n \n return $this->status;\n }", "public function get_status() {\n return $this->status;\n }", "public function getLastStatusUpdate() {\n\t\treturn self::$_lastStatusUpdate;\n\t}", "protected function getRemainingUpdatesStatus() {}", "public function updateStatus() {\n try {\n if (!($this->toDoList instanceof Base_Model_ObtorLib_App_Core_Crm_Entity_ToDoList)) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception(\" ToDoList Entity not intialized\");\n } else {\n $objToDoList = new Base_Model_ObtorLib_App_Core_Crm_Dao_ToDoList();\n $objToDoList->toDoList = $this->toDoList;\n return $objToDoList->updateStatus();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception($ex);\n }\n }", "function updateTask() {\n\t\t$rating = $this -> getTaskRating();\n\t\tif (!is_null($this -> data)) {\n\t\t\tif (!empty($this -> data)) {\n\t\t\t\t//if user has not missed any events and not added any events rate his task with 1\n\t\t\t\tif ($this -> missed == 0) {\n\t\t\t\t\tif (empty($this -> rating)) {\n\t\t\t\t\t\t$rating = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$sql = \"UPDATE Task SET rating =\" . $rating . \", isRated=1, missed=\" . $this -> missed . \" WHERE TaskId=\" . $this -> data[0]['TaskId'];\n\t\t\t\t$stmt = $this -> DB -> prepare($sql);\n\t\t\t\tif ($stmt -> execute()) {\n\t\t\t\t\t$this -> updateUser();\n\t\t\t\t} else {\n\t\t\t\t\tinclude_once \"Email.php\";\n\t\t\t\t\tnew Email('failed', 'update task with id=' . $this -> data[0]['TaskId'] . ' error' . $stmt -> errorInfo(), $this -> id);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tinclude_once \"Email.php\";\n\t\t\t\tnew Email('failed', 'update task, data is empty error', $this -> id);\n\t\t\t}\n\t\t} else {\n\t\t\tinclude_once \"Email.php\";\n\t\t\tnew Email('failed', 'update task, data is empty', $this -> id);\n\t\t}\n\t}", "function getStatus()\n\t{\n\t\tif(!$this->body)\n\t\t{\n\t\t\tthrow new CeleryException('Called getStatus before task was ready');\n\t\t}\n\t\treturn $this->body->status;\n\t}", "public function get_status() {\n return $this->_status;\n }", "public function getTaskState()\n {\n return $this->get('state');\n }", "public function actionDownloadTaskStatusChanged()\n {\n $taskId = Yii::app()->request->getQuery('task_id', 0);\n $status = Yii::app()->request->getQuery('task_status', '');\n if (empty($taskId) || !in_array($status, Task::$statuses))\n return;\n \n $task = Task::model()->findByPk($taskId);\n if ($task instanceof Task) {\n if ($task->isDownload())\n $this->logFileDownload($task->id, '', '', $status);\n }\n\n $file_name = Yii::app()->request->getPost('file_name');\n if ($file_name) {\n $project = NetflixBacklotProject::model()->findByAttributes(['download_task_id' => $taskId]);\n if ($project instanceof NetflixBacklotProject) {\n $project->video_file_name = $file_name;\n }\n }\n }", "public function get_status(){\n return $this->status;\n }", "public function getUpdated();", "public function getUpdated();", "public function getTaskState()\n {\n return $this->get(self::TASK_STATE);\n }", "function getStatus() {\n\t\treturn $this->getData('status');\n\t}", "public function getStatus($status) {\n $statusArray = $this->getAllTaskStatusArray();\n return $statusArray[$status];\n }", "public function testUpdate()\n {\n $this->actingAs(User::factory()->make());\n $task = new Task();\n $task->title = 'refined_task';\n $task->completed = false;\n $task->save();\n\n $response = $this->put('/tasks/' . $task->id);\n\n $updated = Task::where('title', '=', 'refined_task')->first();\n\n $response->assertStatus(200);\n $this->assertEquals(true, $updated->completed);\n }", "public function status()\r\n {\r\n return $this->status;\r\n }", "function getStatus() \n {\n return $this->instance->getStatus();\n }", "public function status()\n {\n return $this->status;\n }", "public function stateUpdate(){\n return $this->update;\n }", "public function getStatus()\n {\n return $this->getIfSet('status');\n }", "function getInProgressTask(){\n $item = new RepairServiceModel();\n return $item->viewInProgressTask();\n }", "public function getStatus($taskID)\n {\n $xmlResponse = $this->client->taskGetStatus(array(\n 'taskID' => $taskID\n ));\n return $xmlResponse;\n }", "public function get_status()\n {\n }", "public function get_status()\n {\n }", "protected function _saveStatus()\n {\n try {\n\n /**\n * update task statuses with completion days\n */\n foreach( $this->_status as $key => $val ) {\n\n if ( in_array( $key, $this->_tasks ) ) {\n $task = Mage::getModel('jirafe_analytics/install')\n ->getCollection()\n ->addFieldToFilter( 'task', $key )\n ->getFirstItem();\n\n $task->setCompletedDt( $val );\n $task->save();\n }\n }\n\n /**\n * refresh status values in cache\n *\n */\n $this->_saveStatusToCache();\n\n return true;\n\n } catch (Exception $e) {\n Mage::helper('jirafe_analytics')->log('ERROR', 'Jirafe_Analytics_Model_Installer::_saveStatus()', $e->getMessage(), $e);\n return false;\n }\n }", "public function getStatus()\n {\n return $this->file->get('status');\n }", "public function get_update_availability()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $payload = $this->request('CheckForUpdate');\n\n if (preg_match('/' . self::CONSTANT_DO_UPDATE . 'true/i', $payload))\n return TRUE;\n else\n return FALSE;\n }", "public function status()\n {\n return $this->_status;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getStatus()\n {\n return $this->getData('status');\n }", "public function getIsUpdated()\n {\n return $this->isUpdated;\n }", "public function getUpdated()\n {\n return $this->getState()->getUpdated();\n }", "public function _getStatus() {\n\t\treturn $this->_status;\n\t}", "public function status() {\n\t\treturn $this->_status;\n\t}", "public function actionStatus($info){\n \n $infoedit = Task::getInfo($info);\n Task::changeStatus($info);\n header('Location: http://youtask/index');\n return true;\n \n }", "public function getUpdated(): int\n {\n return $this->updated;\n }", "public function update()\n {\n if(!isset($_SESSION['login']) || $_SESSION['login'] != 'admin123') {\n return redirect('page-not-found');\n }\n $status = (isset($_POST['status'])) ? 1 : 0;\n $this->task->updateTask($_POST['id'], $_POST['text'], $status);\n\n return redirect('');\n }", "function loadUpdateTaskInfo()\n {\n $task_id = $_POST['task_id'];\n $taskModel = new Task;\n $taskInfo = $taskModel->getLoggedInUsesSingleTask($task_id);\n if ($taskInfo) {\n $this->view('inc/loads/load_task_update', false, $taskInfo);\n } else {\n $this->redirect('login');\n }\n }", "public function status()\n {\n return $this->status->get($this->entity->status);\n }", "public function getStatus(){\n\t\treturn $this->status;\n\t}", "public function update_task_status(){\n \n if($this->input->post('updateType') == 'status'){\n $condition = array('taskId' => $this->input->post('taskId'));\n $data_update = array('Status' => $this->input->post('taskStatus'));\n if($this->input->post('taskStatus') == 'I'){\n $check_status = $this->task_model->selectData('task',$condition,'Status');\n if($check_status[0]->Status == 'H'){\n $data_update['HoldETS'] = date('Y-m-d H:i:s');\n }else{\n $data_update['StartTS'] = date('Y-m-d H:i:s');\n }\n }elseif($this->input->post('taskStatus') == 'H'){\n $data_update['HoldSTS'] = date('Y-m-d H:i:s');\n }elseif($this->input->post('taskStatus') == 'C'){\n $data_update['CompletedTS'] = date('Y-m-d H:i:s');\n }\n $log_data = array('taskId' => $this->input->post('taskId'),'LogDetail' => $this->input->post('taskLog'),'CreatedTS' => date('Y-m-d H:i:s'),'UpdatedTS' => date('Y-m-d H:i:s'));\n try{\n $this->task_model->updateData('task',$data_update,$condition);\n $this->task_model->insertData('task_log',$log_data);\n echo TRUE;\n } catch (Exception $ex){\n echo FALSE;\n exit;\n }\n }elseif($this->input->post('updateType') == 'log'){\n $log_data = array('taskId' => $this->input->post('taskId'),'LogDetail' => $this->input->post('taskLog'),'CreatedTS' => date('Y-m-d H:i:s'),'UpdatedTS' => date('Y-m-d H:i:s'));\n try{\n $this->task_model->insertData('task_log',$log_data);\n echo TRUE;\n } catch (Exception $ex){\n echo FALSE;\n exit;\n }\n }elseif($this->input->post('updateType') == 'deletelog'){\n $condition = array('LogId' => $this->input->post('taskId'));\n $log_data = array('Status' => 'D','UpdatedTS' => date('Y-m-d H:i:s'));\n try{\n $this->task_model->updateData('task_log',$log_data,$condition);\n echo TRUE;\n } catch (Exception $ex){\n echo FALSE;\n exit;\n }\n }elseif($this->input->post('updateType') == 'deletefile'){\n $condition = array('FileId' => $this->input->post('taskId'));\n $log_data = array('Status' => 'D','UpdatedTS' => date('Y-m-d H:i:s'));\n try{\n $reffile = $this->task_model->selectData('task_reference_files',array('FileId' => $this->input->post('taskId')),'FileName');\n $file = 'uploads/'.$reffile[0]->FileName;\n if (is_readable($file)) {\n unlink($file);\n $this->task_model->updateData('task_reference_files',$log_data,$condition);\n echo TRUE;\n }\n } catch (Exception $ex){\n echo FALSE;\n exit;\n }\n }elseif($this->input->post('updateType') == 'deletetask'){\n $condition = array('TaskId' => $this->input->post('taskId'));\n $log_data = array('Status' => 'D','UpdatedTS' => date('Y-m-d H:i:s'));\n try{\n $this->task_model->updateData('task',$log_data,$condition);\n echo TRUE;\n } catch (Exception $ex){\n echo FALSE;\n exit;\n }\n }\n }", "public function getStatus()\n {\n return $this->_makeCall('status');\n }", "public function getUpdated() \n\t{\n\t\treturn $this->updated;\n\t}", "public function update_status() {\n\t\tif ($_POST) {\n\t\t\t$data = array(\n\t\t\t\t'pos_id' => Arr::get($_POST,'pos_id'),\n\t\t\t\t'session_id' => Arr::get($_POST,'session_id'),\n\t\t\t\t'ts' => Arr::get($_POST,'ts'),\n\t\t\t);\n\t\t\t\n\t\t\tif ($this->_check_sig(Arr::get($_POST,'sig'), $data)) {\n\t\t\t\treturn $this->_get_status();\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function updateStatus($id){\n\n $task = Task::find($id);\n $task->status = ! $task->status;\n $task->save();\n\n return redirect()->back();\n\n }", "public function getStatus()\r\n {\r\n return $this->status;\r\n }", "public function getStatus()\r\n {\r\n return $this->status;\r\n }", "public function getJobStatus()\n {\n return $this->jobStatus;\n }", "function getStatus()\n {\n return $this->status;\n }", "public function status()\n {\n return $this->UserAPI->request_status_check();\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }" ]
[ "0.74143", "0.7337405", "0.6751841", "0.67367446", "0.6725768", "0.6347731", "0.6304357", "0.6301014", "0.62635076", "0.62358946", "0.6198621", "0.61566603", "0.6153166", "0.61222297", "0.6104478", "0.60952514", "0.6085839", "0.60814816", "0.605029", "0.60349923", "0.60246", "0.60140705", "0.60096663", "0.6000662", "0.59917986", "0.59917986", "0.5981727", "0.5974266", "0.59693795", "0.59356207", "0.59344506", "0.5918469", "0.59115237", "0.59002215", "0.5896003", "0.5876068", "0.58727074", "0.58709335", "0.58709335", "0.5861384", "0.5861118", "0.58600825", "0.58596206", "0.58584696", "0.58584696", "0.58584696", "0.58584696", "0.58584696", "0.58584696", "0.58584696", "0.58584696", "0.58584696", "0.58528626", "0.5850373", "0.58488274", "0.58344954", "0.5831762", "0.5827955", "0.5819081", "0.58073455", "0.5807173", "0.58040196", "0.5803418", "0.5799517", "0.57908654", "0.57899046", "0.5787266", "0.5778798", "0.5778798", "0.57787275", "0.5777657", "0.5777657", "0.57774705", "0.57773", "0.57739663", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267", "0.5768267" ]
0.667776
5
Setups object table and fields
public function __construct(Object $object) { $this->_object = $object; $this->_table = $object->getConfigData('table'); $this->_fields = $object->getConfigData('fields'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp() {\n $this->object = new Table;\n }", "protected function setUp()\n {\n $this->object = new \\Yana\\Db\\Ddl\\Table('table');\n }", "function init(){\n\t\t/*\n\t\t * Redefine this object, call parent then use addField to specify which fields\n\t\t * you are going to use\n\t\t */\n\t\tparent::init();\n\t\t$this->table_name = get_class($this);\n\t}", "protected function _initsTable() {}", "public static function createTable(){\n if (RBModel::recreateTable(get_called_class()) == false){\n return;\n }\n\n $bean = R::dispense( strtolower(get_called_class()));\n $fields = get_class_vars(get_called_class());\n \n foreach( $fields as $field=>$value){\n\n \n //ignora as variaveis que começam com _\n if ($field[0] == \"_\" || $field == \"id\"){\n continue;\n }\n\n $r = new ReflectionProperty(get_called_class(), $field);\n $comment = strtolower($r->getDocComment());\n\n if (strstr($comment,\"@varchar\")){\n $value = \"\";\n } else\n if (strstr($comment,\"@int\")){\n $value = 0;\n } else\n if (strstr($comment,\"@date\")){\n $value = \"1990-01-01\";\n } else\n if (strstr($comment,\"@datetime\")){\n $value = \"1990-01-01 00:00:00\";\n } else\n if (strstr($comment,\"@double\")){\n $value = 0.0;\n } else\n if (strstr($comment,\"@bool\")){\n $value = false;\n } else\n if (strstr($comment,\"@money\")){\n $value = \"10.00\";\n }\n \n \n $bean->$field = $value;\n }\n \n R::store($bean);\n R::trash($bean);\n }", "protected function _setup() {\n // $this->_createTable();\n parent::_setup();\n }", "public function initTable(){\n\t\t\t\n\t\t}", "protected function setUpObjectRouteModel()\n {\n $container = $this->getContainer();\n\n $route = $container['model/factory']->get(ObjectRoute::class);\n if ($route->source()->tableExists() === false) {\n $route->source()->createTable();\n }\n }", "public function initialize()\n {\n $this->setSource('tblEntry');\n\n $this->hasOne('userId', '\\Soul\\Model\\User', 'userId', ['alias' => 'user']);\n $this->belongsTo('eventId', '\\Soul\\Model\\Event', 'eventId', ['alias' => 'event']);\n $this->hasOne('paymentId', '\\Soul\\Model\\Payment', 'paymentId', ['alias' => 'payment']);\n }", "public function __construct(){\n \n $this->create_tables();\n \n }", "public function set_table_vars() {\n\t\tglobal $wpdb;\n\n\t\t$this->table = $wpdb->prefix . self::TABLE_NAME;\n\t\t$this->ms_table = $wpdb->base_prefix . self::MS_TABLE_NAME;\n\n\t\t/* Register the snippet table names with WordPress */\n\t\t$wpdb->snippets = $this->table;\n\t\t$wpdb->ms_snippets = $this->ms_table;\n\n\t\t$wpdb->tables[] = self::TABLE_NAME;\n\t\t$wpdb->ms_global_tables[] = self::MS_TABLE_NAME;\n\t}", "protected function setUp() {\n\t\t$this->object = new TemporalFieldDefinition;\n\t}", "protected function init()\r\n {\r\n $this->table_name = 'libelles';\r\n $this->table_type = 'system';\r\n $this->table_gateway_alias = 'Sbm\\Db\\SysTableGateway\\Libelles';\r\n $this->id_name = array(\r\n 'nature',\r\n 'code'\r\n );\r\n }", "protected function initTableFields()\r\n {\r\n $this->addField(self::$ID, STRING, \"\");\r\n $this->addField(self::$USER_ID, STRING, \"\");\r\n $this->addField(self::$LOGIN_TIME, STRING, date('Y-m-d H:i:s'));\r\n $this->addField(self::$LOGOUT_TIME, STRING, date('Y-m-d H:i:s'));\r\n $this->addField(self::$STATUS, INTEGER, USER_ACCESS_TOKEN_STATUS_INVALID);\r\n $this->addField(self::$LONGITUDE, INTEGER, 0);\r\n $this->addField(self::$LATITUDE, INTEGER, 0);\r\n $this->addField(self::$CLIENT_IP, STRING, \"\");\r\n }", "public function setUp() {\n\t\t$this->PDO = $this->getConnection();\n\t\t$this->createTable();\n\t\t$this->populateTable();\n\n\t\t$this->ItemsTable = new ItemsTable($this->PDO);\n\t}", "public function __construct () {\n $this->model = 'App\\\\' . $this->model;\n $this->model = new $this->model();\n\n // Get the column listing for a given table\n $this->table_columns = Schema::getColumnListing( $this->table );\n }", "protected function _initialize()\r\n {\r\n $this->metadata()->setTablename('comentarios');\r\n $this->metadata()->setPackage('system.application.models.dao');\r\n \r\n # nome_do_membro, nome_da_coluna, tipo, comprimento, opcoes\r\n \r\n $this->metadata()->addField('id', 'id', 'int', 11, array('primary' => true, 'notnull' => true, 'autoincrement' => true));\r\n $this->metadata()->addField('comentario', 'comentario', 'varchar', 45, array());\r\n $this->metadata()->addField('dataAvaliacao', 'data_avaliacao', 'datetime', null, array());\r\n $this->metadata()->addField('coordenadorId', 'coordenador_id', 'int', 11, array());\r\n $this->metadata()->addField('itemAvaliado', 'item_avaliado', 'varchar', 45, array());\r\n $this->metadata()->addField('avaliador', 'avaliador', 'varchar', 45, array());\r\n $this->metadata()->addField('tipoAvaliacao', 'tipo_avaliacao', 'varchar', 45, array());\r\n $this->metadata()->addField('subtipoAvaliacao', 'subtipo_avaliacao', 'varchar', 45, array());\r\n\r\n \r\n }", "protected function _initialize()\r\n {\r\n $this->metadata()->setTablename('funcionario');\r\n $this->metadata()->setPackage('system.application.models.dao');\r\n \r\n # nome_do_membro, nome_da_coluna, tipo, comprimento, opcoes\r\n \r\n $this->metadata()->addField('id', 'id', 'int', 11, array('primary' => true, 'notnull' => true, 'autoincrement' => true));\r\n $this->metadata()->addField('nome', 'nome', 'varchar', 255, array());\r\n $this->metadata()->addField('login', 'login', 'varchar', 45, array());\r\n $this->metadata()->addField('senha', 'senha', 'varchar', 255, array());\r\n $this->metadata()->addField('email', 'email', 'varchar', 255, array());\r\n $this->metadata()->addField('lotacao', 'lotacao', 'varchar', 45, array());\r\n\r\n \r\n }", "private function createFields(){\n //Human::log(\"------------- Create fields model \".$this->modelName);\n self::$yetInit[get_class($this)]=true;\n //let's init database.\n $modelName=get_class($this);\n $modelNameManager=$modelName.\"Manager\";\n if(!class_exists($modelNameManager)){\n $modelNameManager=\"DbManager\";\n }\n $rc=new ReflectionClass($modelName);\n $rc->setStaticPropertyValue(\"manager\", new $modelNameManager( $modelName ));\n \n //browse the class properties to find db fields and then store it in a good order (keys first, associations later)\n\t $fields=array();\n foreach ($rc->getProperties() as $field){\n if($field->isPublic()){\n\n\n //get the type from the @var type $field name comment...yes, I'm sure.\n $comments=$field->getDocComment();\n $details=CodeComments::getVariable($comments);\n\n $type=$details[\"type\"];\n $isVector=$details[\"isVector\"];\n $description=$details[\"description\"];\n $fieldName=$field->name;\n\n $fieldObject=$this->getDbField($fieldName,$type,$isVector);\n\n if($fieldObject){\n $fieldObject[\"comments\"]=$description;\n switch($fieldObject[\"type\"]){\n\n case \"OneToOneAssoc\":\n case \"NToNAssoc\":\n //associations at the end\n array_push($fields, $fieldObject);\n break;\n\n default :\n //classic fields at the beginning\n array_unshift($fields, $fieldObject);\n\n }\n\n }\n }\n }\n\t //create the fields\n\t foreach ($fields as $f){\n\t\t$f[\"options\"][Field::COMMENTS]=$f[\"comments\"];\n Field::create($modelName.\".\".$f[\"name\"],$f[\"type\"],$f[\"options\"]);\n //Human::log($this->modelName.\" Create field \".$f[\"name\"]);\n \n\t }\n \n\t //whooho!\n $this->db()->init(); \n }", "protected function setUp() {\n $this->object = new SelectQuery();\n $this->object->setEntity('table t');\n $this->object->addColumn('column');\n $criteria = new SqlCriteria();\n $criteria->add(new SqlFilter('t.id', '=', 5));\n $criteria->setBlockStatus('order', 't.id');\n $criteria->setBlockStatus('limit', 1);\n $criteria->setBlockStatus('offset', 1);\n $this->object->setCriteria($criteria);\n }", "protected function setUp() {\n $this->object = new HeaderModel;\n }", "protected function setUp()\n {\n $db = new \\Yana\\Db\\Ddl\\Database('db');\n $table = $db->addTable('table');\n $this->_form = $db->addForm('form');\n $this->_form->setTable($table->getName());\n $this->_facade = new \\Yana\\Forms\\Facade();\n $this->_facade->setBaseForm($this->_form);\n $this->_context = new \\Yana\\Forms\\Setups\\Context($this->_contextName);\n $this->_context->setAction('action');\n $this->_wrapper = new \\Yana\\Forms\\Fields\\FieldCollectionWrapper($this->_facade, $this->_context);\n $this->_setup = new \\Yana\\Forms\\Setup();\n $this->_setup->setContext($this->_context);\n $this->_facade->setSetup($this->_setup);\n $this->_column = new \\Yana\\Db\\Ddl\\Column('column');\n $this->_field = new \\Yana\\Forms\\Fields\\Field($this->_wrapper, $this->_column);\n $this->object = new \\Yana\\Forms\\Fields\\AutomatedHtmlBuilder();\n }", "protected function setUp() {\n $this->object = new acModel;\n }", "function __construct() \n {\n // Creation de la table\n self::createTableIfNeeded();\n }", "public function setUp()\n {\n parent::setUp();\n \n $this->db = Ediary_Db::getInstance();\n $this->object = new Ediary_Database_Schema($this->db);\n \n // DEBUG: THIS WILL DROP TABLES AND RECREATE THEM\n //Ediary_Db::getInstance()->upgrade();\n }", "public function initialize()\n {\n $this->setSchema(\"mydb\");\n $this->setSource(\"paying\");\n $this->belongsTo('cid', 'Customers', 'cid', array('alias' => 'alias_customers'));\n $this->belongsTo('loanid', 'LoanInformation', 'loanid', array('alias' => 'alias_loan'));\n $this->hasManyToMany(\n 'payingid',\n 'Tracking',\n 'payingid', 'oid',\n 'DeptTrackers',\n 'oid',\n array(\n 'alias' => 'alias_depttrackers'\n )\n );\n }", "protected function setUp() {\n\t\t$this->object = new Model(\"test\", new PDODatabase(DB_DSN, DB_USER, DB_PASS, DB_CHARSET));\n\t}", "protected function setUp()\n {\n $this->object = new Util_Db_Extends;\n }", "public function setUp():void\n {\n parent::setUp();\n\n $this->table = $this->model->getTable();\n $this->setupUser();\n config()->set('settings.output.admin', 'json');\n if ($this->truncateTables) $this->truncate();\n }", "protected function setUp() {\n $this->object = new TeacherDefinitionModel;\n }", "protected function init()\n {\n if (!isset($this['fields'])) {\n $model = $base = [];\n if (isset($this->options['base_model']) && $this->options['base_model']) {\n $base = static::getTableInfo($this->options['base_model']) ? : [];\n }\n if (isset($this->options['table_name']) && (!$base || $this->options['table_name'] != $base['table_name'])) {\n $model = $this->getTableInfo($this->options['table_name']) ? : [];\n }\n \n if ($model && $base) {\n $model['ext_table'] = $model['table_name'];\n $model['ext_fields'] = isset($model['master_fields']) ? $model['master_fields'] : array_keys($model['fields']);\n \n $model['master_table'] = $base['table_name'];\n $model['master_fields'] = isset($base['master_fields']) ? $base['master_fields'] : array_keys($base['fields']);\n }\n \n // merge\n $model = ArrayHelper::merge($base, $model);\n $this->setOption($model);\n }\n }", "protected function setUp()\n\t{\n\t\t$this->object = new object('obj att', 'obj att2');\n\t}", "public function setUp(): void\n {\n if ( isset($this->db) )\n {\n return;\n }\n\n (new DBConnect\\Load\\INI(self::DB_CREDENTIALS))->run();\n $this->db = DBConnect\\Connect\\Bank::get();\n\n $this->table = new DBTable\\PostgreSQL(self::TABLE_NAME);\n $this->table->runFieldLookup($this->db);\n }", "protected function createObjects() {\n\t\t$this->lblId = $this->mctHut->lblId_Create();\n\t\t$this->lstPosition = $this->mctHut->lstPosition_Create();\n\t\t$this->txtName = $this->mctHut->txtName_Create();\n\t}", "protected function typicalSetup()\n {\n $class = $this->class;\n $static = new $class;\n\n if ($static instanceof Model) {\n $this->_id (\"ID\", FieldBlueprint::PRIMARY, null);\n $this->_uid (\"UID\", FieldBlueprint::UID, null);\n }\n }", "protected static function init()\n\t{\n\t\tif( static::$table === null )\n\t\t{\n\t\t\t// set the table name by Model name\n\t\t\t// Ex: UserModel -> users\n\t\t\tstatic::$table = strtolower( preg_replace('/Model$/', '', get_called_class()) ) . \"s\";\n\t\t}\n\t}", "protected function setUp() {\n $this->object = new setoresModel;\n }", "private function init() {\n\t\tlist(, $this->db, $this->table) = explode('_', get_called_class(), 3);\n\t\t$this->db = defined('static::DB') ? static::DB : $this->db;\n\t\t$this->table = defined('static::TABLE') ? static::TABLE : $this->table;\n\t\t$this->pk = defined('static::PK') ? static::PK : 'id';\n\t}", "protected function setUp() {\n $this->object = new Entry(new \\Feeld\\DataType\\Str());\n }", "protected function setupObject()\n {\n try {\n $dom = $this->getAttribute(\"domain\");\n if ($dom) {\n $this->getDomain()->copy($this->getTable()->getDatabase()->getDomain($dom));\n } else {\n $type = strtoupper($this->getAttribute(\"type\"));\n if ($type) {\n if ($platform = $this->getPlatform()) {\n $this->getDomain()->copy($this->getPlatform()->getDomainForType($type));\n } else {\n // no platform - probably during tests\n $this->setDomain(new Domain($type));\n }\n } else {\n if ($platform = $this->getPlatform()) {\n $this->getDomain()->copy($this->getPlatform()->getDomainForType(self::DEFAULT_TYPE));\n } else {\n // no platform - probably during tests\n $this->setDomain(new Domain(self::DEFAULT_TYPE));\n }\n }\n }\n\n $this->name = $this->getAttribute(\"name\");\n $this->phpName = $this->getAttribute(\"phpName\");\n $this->phpType = $this->getAttribute(\"phpType\");\n\n if ($this->getAttribute(\"prefix\", null) !== null) {\n $this->namePrefix = $this->getAttribute(\"prefix\");\n } elseif ($this->getTable()->getAttribute('columnPrefix', null) !== null) {\n $this->namePrefix = $this->getTable()->getAttribute('columnPrefix');\n } else {\n $this->namePrefix = '';\n }\n\n // Accessor visibility\n if ($this->getAttribute('accessorVisibility', null) !== null) {\n $this->setAccessorVisibility($this->getAttribute('accessorVisibility'));\n } elseif ($this->getTable()->getAttribute('defaultAccessorVisibility', null) !== null) {\n $this->setAccessorVisibility($this->getTable()->getAttribute('defaultAccessorVisibility'));\n } elseif ($this->getTable()->getDatabase()->getAttribute('defaultAccessorVisibility', null) !== null) {\n $this->setAccessorVisibility($this->getTable()->getDatabase()->getAttribute('defaultAccessorVisibility'));\n } else {\n $this->setAccessorVisibility(self::DEFAULT_VISIBILITY);\n }\n\n // Mutator visibility\n if ($this->getAttribute('mutatorVisibility', null) !== null) {\n $this->setMutatorVisibility($this->getAttribute('mutatorVisibility'));\n } elseif ($this->getTable()->getAttribute('defaultMutatorVisibility', null) !== null) {\n $this->setMutatorVisibility($this->getTable()->getAttribute('defaultMutatorVisibility'));\n } elseif ($this->getTable()->getDatabase()->getAttribute('defaultMutatorVisibility', null) !== null) {\n $this->setMutatorVisibility($this->getTable()->getDatabase()->getAttribute('defaultMutatorVisibility'));\n } else {\n $this->setMutatorVisibility(self::DEFAULT_VISIBILITY);\n }\n\n $this->peerName = $this->getAttribute(\"peerName\");\n\n // retrieves the method for converting from specified name to a PHP name, defaulting to parent tables default method\n $this->phpNamingMethod = $this->getAttribute(\"phpNamingMethod\", $this->parentTable->getDatabase()->getDefaultPhpNamingMethod());\n\n $this->isPrimaryString = $this->booleanValue($this->getAttribute(\"primaryString\"));\n\n $this->isPrimaryKey = $this->booleanValue($this->getAttribute(\"primaryKey\"));\n\n $this->isNodeKey = $this->booleanValue($this->getAttribute(\"nodeKey\"));\n $this->nodeKeySep = $this->getAttribute(\"nodeKeySep\", \".\");\n\n $this->isNestedSetLeftKey = $this->booleanValue($this->getAttribute(\"nestedSetLeftKey\"));\n $this->isNestedSetRightKey = $this->booleanValue($this->getAttribute(\"nestedSetRightKey\"));\n $this->isTreeScopeKey = $this->booleanValue($this->getAttribute(\"treeScopeKey\"));\n\n $this->isNotNull = ($this->booleanValue($this->getAttribute(\"required\")) || $this->isPrimaryKey); // primary keys are required\n\n //AutoIncrement/Sequences\n $this->isAutoIncrement = $this->booleanValue($this->getAttribute(\"autoIncrement\"));\n $this->isLazyLoad = $this->booleanValue($this->getAttribute(\"lazyLoad\"));\n\n // Add type, size information to associated Domain object\n $this->getDomain()->replaceSqlType($this->getAttribute(\"sqlType\"));\n if (!$this->getAttribute(\"size\") && $this->getDomain()->getType() == 'VARCHAR' && $this->hasPlatform() && !$this->getAttribute(\"sqlType\") && !$this->getPlatform()->supportsVarcharWithoutSize()) {\n $size = 255;\n } else {\n $size = $this->getAttribute(\"size\");\n }\n $this->getDomain()->replaceSize($size);\n $this->getDomain()->replaceScale($this->getAttribute(\"scale\"));\n\n $defval = $this->getAttribute(\"defaultValue\", $this->getAttribute(\"default\"));\n if ($defval !== null && strtolower($defval) !== 'null') {\n $this->getDomain()->setDefaultValue(new ColumnDefaultValue($defval, ColumnDefaultValue::TYPE_VALUE));\n } elseif ($this->getAttribute(\"defaultExpr\") !== null) {\n $this->getDomain()->setDefaultValue(new ColumnDefaultValue($this->getAttribute(\"defaultExpr\"), ColumnDefaultValue::TYPE_EXPR));\n }\n\n if ($this->getAttribute('valueSet', null) !== null) {\n if (version_compare(PHP_VERSION, '5.3.0', '>=')) {\n $valueSet = str_getcsv($this->getAttribute(\"valueSet\"));\n } else {\n // unfortunately, no good fallback for PHP 5.2\n $valueSet = explode(',', $this->getAttribute(\"valueSet\"));\n }\n $valueSet = array_map('trim', $valueSet);\n $this->valueSet = $valueSet;\n } elseif (preg_match('/enum\\((.*?)\\)/i', $this->getAttribute('sqlType', ''), $matches)) {\n if (version_compare(PHP_VERSION, '5.3.0', '>=')) {\n $valueSet = str_getcsv($matches['1'], ',', '\\'');\n } else {\n // unfortunately, no good fallback for PHP 5.2\n $valueSet = array();\n foreach (explode(',', $matches['1']) as $value) {\n $valueSet[] = trim($value, \" '\");\n }\n }\n $this->valueSet = $valueSet;\n }\n\n $this->inheritanceType = $this->getAttribute(\"inheritance\");\n // here we are only checking for 'false', so don't use booleanValue()\n $this->isInheritance = ($this->inheritanceType !== null && $this->inheritanceType !== \"false\");\n\n $this->description = $this->getAttribute(\"description\");\n } catch (Exception $e) {\n throw new EngineException(\"Error setting up column \" . var_export($this->getAttribute(\"name\"), true) . \": \" . $e->getMessage());\n }\n }", "protected function _setupTableMapperArray()\n\t{\n\t\t$this->tableMapperArray = array();\n\t\t\n\t\t$this->tableMapperArray['property_id'] = 'properties';\n\t\t$this->tableMapperArray['external_property_id'] = 'properties';\n\t\t$this->tableMapperArray['sort_order'] = 'properties';\n\t\t\n\t\t$this->tableMapperArray['name'] = 'properties_description';\n\t\t$this->tableMapperArray['admin_name'] = 'properties_description';\n \n\t\t$this->languageDependentMapperArray = array('properties_description');\n\t}", "public function initTables(): void\n {\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.Surveys');\n $this->Surveys = $table;\n\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.SurveyResults');\n $this->SurveyResults = $table;\n\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.SurveyEntries');\n $this->SurveyEntries = $table;\n\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.SurveyEntryQuestions');\n $this->SurveyEntryQuestions = $table;\n }", "function createTable($objSchema);", "protected function setUp()\n {\n $this->object = new FieldSet('test', $this->fieldList);\n }", "public function __construct() {\n parent::__construct();\n $this->_table_columns = array(\"id\", \"entry_date\", \"account_type\", \"entry_value\", \"memo\", \"expense\", \"confirm\", \"deleted\", \"create_stamp\", \"modified_stamp\");\n }", "protected function setUp()\n {\n $this->object = new Sql();\n }", "public function __construct(){\n $this->TableName = 'Users';\n \n $this->EntityName = 'User';\n \n $this->PrimaryKeyName = 'UserId';\n \n $this->FieldDefinition['UserId'] = array ('Type' => 'PrimaryKey');\n \n $this->FieldDefinition['Name'] = array ('Type' => 'Normal');\n \n $this->FieldDefinition['Password'] = array ('Type' => 'Normal');\n \n $this->FieldDefinition['UserShares'] = array ('Type' => 'ManyForeignObjects', 'ModelTable' => 'UserShares','ForeignKey' => 'UserId');\n \n }", "public function setUp()\n {\n $dsn = 'mysql:host=localhost;dbname=demo';\n\n $pdo = new \\PDO($dsn, 'root', '');\n\n $driver = new MySQLDriver($pdo, 'demo');\n\n $this->table = new Table('post', $driver);\n }", "protected function _setupTableName()\n {\n parent::_setupTableName();\t\t\n\t\t $this->_name = $this->getTableName(COMMENT); \n }", "public function init()\r\n\t{\r\n\t\tif (count($this->table_fields) < 1)\r\n\t\t\treturn false;\r\n\t\tforeach ($this->table_fields as $table_field) {\r\n\t\t\tif ($table_field->get_primary_key()) {\r\n\t\t\t\t$this->id_field = $table_field->get_name();\r\n\t\t\t}\r\n\t\t\tif ($table_field->get_name_key()) {\r\n\t\t\t\t$this->name_fields[] = $table_field->get_name();\r\n\t\t\t}\r\n\t\t\tif ($table_field->get_unike_key()) {\r\n\t\t\t\t$this->unike_keys[] = $table_field->get_name();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function setUp()\n {\n global $db;\n $this->object = new testSmartObject();\n $this->object->db = $db;\n }", "function createTableModel()\r\n {\r\n?>\r\n // table model\r\n var <?php echo $this->Name; ?>_tableModel = new qx.ui.table.SimpleTableModel();\r\n <?php\r\n if ($this->owner!=null)\r\n {\r\n ?>\r\n <?php echo $this->owner->Name.\".\".$this->Name; ?>_tableModel=<?php echo $this->Name; ?>_tableModel;\r\n <?php\r\n }\r\n ?>\r\n<?php\r\n }", "public function __construct()\n\t\t{\n\t\t\t$this->_db_table = new Application_Model_DbTable_TourType();\n\t\t}", "function createTableManagerObject( $daObj, $fieldList, $primaryKeyFieldName, $labelFieldName, $dbTableDescriptionDoc, $dbTableDescriptionSQL ) \n {\n \n // get path/Name of template\n $pathToDATemplate = $this->values[ ModuleCreator::KEY_PATH_RAD_ROOT ];\n $pathToDATemplate .= 'data/'.ModuleCreator::PATH_OBJECT_DA;\n \n $fileName = $pathToDATemplate.ModuleCreator::FILE_DA_ROWMANAGER;\n $fileContents = file_get_contents( $fileName );\n \n // update sections:\n // Module Name\n // Creator Name\n $fileContents = $this->replaceCommonTags( $fileContents );\n\n \n // DAObj Name\n $tag = ModuleCreator::TAG_DAOBJ_NAME;\n $data = $daObj->getManagerName();\n $fileContents = str_replace($tag, $data, $fileContents );\n \n // DAObj Desc\n $tag = ModuleCreator::TAG_DAOBJ_DESC;\n $data = $daObj->getDescription();\n $fileContents = str_replace($tag, $data, $fileContents );\n \n // DB Table Name\n $tag = ModuleCreator::TAG_DAOBJ_DBTABLE;\n $data = $daObj->getDBTableName();\n $fileContents = str_replace($tag, $data, $fileContents );\n \n // DB Table Field Documentation\n $tag = ModuleCreator::TAG_DAOBJ_DBTABLE_DOC;\n $data = $dbTableDescriptionDoc;\n $fileContents = str_replace($tag, $data, $fileContents );\n \n // DB Table SQL code\n $tag = ModuleCreator::TAG_DAOBJ_DBTABLE_SQL;\n $data = $dbTableDescriptionSQL;\n $fileContents = str_replace($tag, $data, $fileContents );\n \n // Field List\n $tag = ModuleCreator::TAG_DAOBJ_DBFIELDLIST;\n $data = $fieldList;\n $fileContents = str_replace($tag, $data, $fileContents );\n \n // XML_NODE_NAME\n $tag = ModuleCreator::TAG_DAOBJ_XMLNODENAME;\n $data = strtolower($daObj->getName());\n $fileContents = str_replace($tag, $data, $fileContents);\n \n // State Variable Information\n $stateVarID = $daObj->getManagerInitVarID();\n $stateVar = new RowManager_StateVarManager( $stateVarID );\n if ( $stateVar->isLoaded() ) {\n $data = $stateVar->getName();\n } else {\n $data = 'initValue';\n }\n $tag = ModuleCreator::TAG_DAOBJ_STATEVAR;\n $fileContents = str_replace($tag, $data, $fileContents);\n \n // DAOBJ Primary Key Field Name\n $tag = ModuleCreator::TAG_DAOBJ_PRIMARYKEY;\n $data = $primaryKeyFieldName;\n $fileContents = str_replace($tag, $data, $fileContents);\n \n // Insert return value for getLabel() function\n // if a labelFieldName was given\n if ($labelFieldName != '' ) {\n \n // return function result\n $data = $labelFieldName;\n \n } else {\n // else\n \n // return error message\n $data = 'No Field Label Marked';\n \n } // endif\n $tag = ModuleCreator::TAG_DAOBJ_GETLABEL;\n $fileContents = str_replace($tag, $data, $fileContents);\n \n // save new file\n $modulePath = $this->values[ ModuleCreator::KEY_PATH_MODULE_ROOT ];\n $modulePath .= ModuleCreator::PATH_OBJECT_DA;\n $name = $daObj->getManagerName().'.php';\n $fileName = $modulePath . $name;\n file_put_contents( $fileName, $fileContents);\n \n return $name;\n \n }", "public function loadFromObject($object){\n foreach ($object as $property => $value) {\n //we must ignore this fields\n if(\\in_array($property,['_type','_primary_key','id'])){\n continue;\n }\n $this->{$property}=$value;\n }\n # we set the real short class name\n if(property_exists($model,'_type')){\n $this->setTableName($model->_type);\n }else{\n $modelObj->setTableName(RedBeanEngine::classNameToTableName($model)); \n }\n }", "public function __construct() {\n\n $this->tableName = \"re_event_type\";\n $this->setColumnsInfo(\"id\", \"int(11)\", 0);\n $this->setColumnsInfo(\"name\", \"varchar(250)\", \"\");\n $this->setColumnsInfo(\"id_space\", \"int(11)\", 0);\n $this->primaryKey = \"id\";\n }", "static function init($table = null){\n\t\tif(static::$object_inited){\n\t\t\treturn;\n\t\t}\n if(!static::$db){\n static::$db = DB::get();\n }\n\t\tif($table){\n\t\t\tstatic::$table = $table;\n\t\t}else{\n\t\t\t$class = get_called_class();\n\t\t\tstatic::$table = strtolower(preg_replace('/.+\\\\\\/si', '', $class).'s');\n\t\t}\n self::initFields();\n\t\tstatic::$object_inited = true;\n\t}", "public function setup()\n {\n $this->crud->setModel('SmartyStudio\\EcommerceCrud\\app\\Models\\Currency');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/currencies');\n $this->crud->setEntityNameStrings('currency', 'currencies');\n\n\t\t/*\n |--------------------------------------------------------------------------\n | COLUMNS\n |--------------------------------------------------------------------------\n */\n\t\t$this->crud->addColumns(\n\t\t\t$this->getColumns()\n\t\t);\n\n\t\t/*\n |--------------------------------------------------------------------------\n | FIELDS\n |--------------------------------------------------------------------------\n */\n\t\t$this->crud->addFields(\n\t\t\t$this->getFields()\n\t\t);\n\n\t\t/*\n |--------------------------------------------------------------------------\n | PERMISSIONS\n |-------------------------------------------------------------------------\n */\n\t\t$this->setPermissions();\n\n /*\n |--------------------------------------------------------------------------\n | AJAX TABLE VIEW\n |--------------------------------------------------------------------------\n */\n $this->crud->enableAjaxTable();\n\t}", "public function initialize()\n {\n $this->setSchema(\"taff\");\n $this->setSource(\"boardchecklist\");\n $this->hasMany('checklistId', 'Boardchecklistitem', 'checklistId', ['alias' => 'Boardchecklistitem']);\n $this->belongsTo('cardId', '\\Boardcard', 'cardId', ['alias' => 'Boardcard']);\n }", "protected function _initialize()\n {\n $this->metadata()->setTablename('turma');\n $this->metadata()->setPackage('Model');\n \n # nome_do_membro, nome_da_coluna, tipo, comprimento, opcoes\n \n $this->metadata()->addField('id', 'id', 'int', 11, array('primary' => true, 'notnull' => true, 'autoincrement' => true));\n $this->metadata()->addField('foto', 'foto', 'varchar', 45, array());\n $this->metadata()->addField('ano', 'ano', 'int', 11, array('notnull' => true));\n $this->metadata()->addField('semestre', 'semestre', 'int', 1, array('notnull' => true));\n\n \n $this->metadata()->addRelation('egressos', Lumine_Metadata::ONE_TO_MANY, 'Egresso', 'turmaId', null, null, null);\n }", "public function init()\r\n {\r\n $dbTable = new Application_Model_DbTable_Fournisseur();\r\n $this->mapper = new Application_Model_Mapper_Fournisseur($dbTable);\r\n }", "public function __construct()\n {\n parent::__construct();//, $this->fields);\n parent::findTable($this->tableName);\n }", "protected function setUp()\n {\n $this->object = new QueryCreate('foobar');\n }", "protected function setUp()\n {\n $this->object = new QueryCreate('foobar');\n }", "protected function setUp() {\n $this->object = new ServiceStructure;\n $this->object->setId(1);\n $this->object->setName('service');\n $this->object->setObjectId(2);\n }", "protected function CreateObjects() {\n\t\t$this->lblId = $this->mctAddress->lblId_Create();\n\t\t$this->lstPerson = $this->mctAddress->lstPerson_Create();\n\t\t$this->txtStreet = $this->mctAddress->txtStreet_Create();\n\t\t$this->txtCity = $this->mctAddress->txtCity_Create();\n\t}", "public function initialize()\n {\n $this->setSchema(\"fox_zeus\");\r\n $this->setSource(\"usuario\");\r\n $this->hasMany('codUsuario', 'UsuarioSistema', 'codUsuario', ['alias' => 'UsuarioSistema']);\r\n $this->belongsTo('codPersona', '\\Empleado', 'codPersona', ['alias' => 'Empleado']);\n }", "private function _set_table()\n\t{\n\t\t$dossier = $this->config->item('dossier');\n\t\tif($dossier === false)\n\t\t{\n\t\t\tlog_message('info', '\"Dossier\" params is not set');\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_dossier = $dossier;\n\t\t\t$this->_table = $this->_dossier . '.' . $this->_table;\n\t\t}\n\t}", "protected function _construct()\n {\n $this->_init(self::TABLE_NAME, self::TABLE_ID);\n }", "function _init_fields()\n\t{\n\t\tif($this->table_name)\n\t\t{\n\t\t\t$this->db_fields = $this->db->list_fields($this->table_name);\n\t\t\t\n\t\t\tforeach($this->db_fields as $field)\n\t\t\t{\n\t\t\t\t$this->{$field} = NULL;\n\t\t\t}\n\t\t}\n\t}", "abstract protected function createFields();", "protected function _initialize() {\n $this->tableName = 'user_product';\n }", "public function __construct() {\n parent::__construct();\n $this->tableName = \"variables2\";\n $this->table = \"erp_custom_fields\";\n }", "public function init() {\n $this->table = 'depenses';\n }", "public function setUpDatabaseTables()\n {\n $table = new DModuleTable();\n $table -> setName(\"currencies\");\n $table -> addBigIncrements( \"id\" , true );\n $table -> addString( \"base\" , true);\n $table -> addLongText( 'rates' , true);\n $table -> addDateTime( 'added' , true );\n $table -> addBoolean( 'status' , true);\n $table -> addString( \"extra\" , false);\n $table -> addString( \"extra2\" , false);\n $this -> addTable( $table );\n }", "protected function setUp() {\n $this->object = new LyvDAL;\n }", "public function initialize()\n {\n $this->setSchema(\"mus\");\n $this->setSource(\"sculpture\");\n $this->belongsTo(\n 'Art_Objects_id_no',\n 'ArtObjects',\n 'id_no'\n );\n }", "private function createTables() {\n \n foreach($this->G->tableInfo as $table) {\n $this->tables[$table[\"title\"]] = new IdaTable($table[\"title\"]);\n } \n }", "protected function setupFields()\n {\n }", "public function __construct()\n\t{\n\t\t$this->tableObjects = Array();\n\t\t$this->count = 0;\n\t}", "private function prepareTables() {}", "public function setUp()\n {\n $this->crud->setModel('SmartyStudio\\EcommerceCrud\\app\\Models\\Carrier');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/carriers');\n $this->crud->setEntityNameStrings('carrier', 'carriers');\n\n\t\t/*\n |--------------------------------------------------------------------------\n | COLUMNS\n |--------------------------------------------------------------------------\n */\n\t\t$this->crud->addColumns(\n\t\t\t$this->getColumns()\n\t\t);\n\n\t\t/*\n |--------------------------------------------------------------------------\n | FIELDS\n |--------------------------------------------------------------------------\n */\n\t\t$this->crud->addFields(\n\t\t\t$this->getFields()\n\t\t);\n\n /*\n |--------------------------------------------------------------------------\n | PERMISSIONS\n |-------------------------------------------------------------------------\n */\n $this->setPermissions();\n\n /*\n |--------------------------------------------------------------------------\n | AJAX TABLE VIEW\n |--------------------------------------------------------------------------\n */\n $this->crud->enableAjaxTable();\n\n }", "public function setUp()\n\t{\n\t\t$this->prepare_tables(\n\t\t\t'Model_User', \n\t\t\t'Model_Role', \n\t\t\t'Model_Roles_Users', \n\t\t\t'Model_User_Token'\n\t\t\t);\n\t}", "public function setupModel() {\n\t\tswitch ($this->dbType()) {\n\t\tcase self::DB_TYPE_MYSQL: default:\n\t\t\ttry {\n\t\t\t\t$theSql = $this->getTableDefSql(self::TABLE_Permissions);\n\t\t\t\t$this->execDML($theSql);\n\t\t\t\t$this->debugLog($this->getRes('install/msg_create_table_x_success/'.$this->tnPermissions));\n\t\t\t} catch (PDOException $pdoe){\n\t\t\t\tthrow new DbException($pdoe,$theSql);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "public function initialize()\n {\n // attributes\n $this->setName('ap_invoice_head');\n $this->setPhpName('ApInvoice');\n $this->setIdentifierQuoting(false);\n $this->setClassName('\\\\ApInvoice');\n $this->setPackage('');\n $this->setUseIdGenerator(false);\n // columns\n $this->addForeignPrimaryKey('ApveVendId', 'Apvevendid', 'VARCHAR' , 'ap_vend_mast', 'ApveVendId', true, 6, '');\n $this->addPrimaryKey('ApihPayToKey', 'Apihpaytokey', 'VARCHAR', true, 180, '');\n $this->addColumn('ApihPtName', 'Apihptname', 'VARCHAR', false, 30, null);\n $this->addColumn('ApihPtAdr1', 'Apihptadr1', 'VARCHAR', false, 30, null);\n $this->addColumn('ApihPtAdr2', 'Apihptadr2', 'VARCHAR', false, 30, null);\n $this->addColumn('ApihPtAdr3', 'Apihptadr3', 'VARCHAR', false, 30, null);\n $this->addColumn('ApihPtCtry', 'Apihptctry', 'VARCHAR', false, 4, null);\n $this->addColumn('ApihPtCity', 'Apihptcity', 'VARCHAR', false, 16, null);\n $this->addColumn('ApihPtStat', 'Apihptstat', 'VARCHAR', false, 2, null);\n $this->addColumn('ApihPtZipCode', 'Apihptzipcode', 'VARCHAR', false, 10, null);\n $this->addForeignPrimaryKey('ApihPoNbr', 'Apihponbr', 'VARCHAR' , 'po_head', 'PohdNbr', true, 8, '');\n $this->addPrimaryKey('ApihCtrlNbr', 'Apihctrlnbr', 'VARCHAR', true, 8, '');\n $this->addPrimaryKey('ApihInvNbr', 'Apihinvnbr', 'VARCHAR', true, 15, '');\n $this->addPrimaryKey('ApihSeq', 'Apihseq', 'INTEGER', true, 4, 0);\n $this->addColumn('ApihStat', 'Apihstat', 'VARCHAR', false, 1, null);\n $this->addColumn('ApihInvDate', 'Apihinvdate', 'VARCHAR', false, 8, null);\n $this->addColumn('ApihDiscDate', 'Apihdiscdate', 'VARCHAR', false, 8, null);\n $this->addColumn('ApihDueDate', 'Apihduedate', 'VARCHAR', false, 8, null);\n $this->addColumn('ApihTotAmt', 'Apihtotamt', 'DECIMAL', false, 20, null);\n $this->addColumn('ApihDiscAmt', 'Apihdiscamt', 'DECIMAL', false, 20, null);\n $this->addColumn('ApihPpChkNbr', 'Apihppchknbr', 'INTEGER', false, 8, null);\n $this->addColumn('ApihGlPd', 'Apihglpd', 'INTEGER', false, 2, null);\n $this->addColumn('ApihChkNbr', 'Apihchknbr', 'INTEGER', false, 8, null);\n $this->addColumn('ApihChkDate', 'Apihchkdate', 'VARCHAR', false, 8, null);\n $this->addColumn('ApihChkAmt', 'Apihchkamt', 'DECIMAL', false, 20, null);\n $this->addColumn('ApihChkGlAcct', 'Apihchkglacct', 'VARCHAR', false, 9, null);\n $this->addColumn('IntbWhse', 'Intbwhse', 'VARCHAR', false, 2, null);\n $this->addColumn('AptmTermCode', 'Aptmtermcode', 'VARCHAR', false, 4, null);\n $this->addColumn('ApihVendDisc', 'Apihvenddisc', 'DECIMAL', false, 20, null);\n $this->addColumn('ApihInvRef', 'Apihinvref', 'VARCHAR', false, 20, null);\n $this->addColumn('ApihCenbeeFormatId', 'Apihcenbeeformatid', 'VARCHAR', false, 1, null);\n $this->addColumn('ApihCenbeePoNbr', 'Apihcenbeeponbr', 'VARCHAR', false, 8, null);\n $this->addColumn('ApihTakeExpired', 'Apihtakeexpired', 'VARCHAR', false, 1, null);\n $this->addColumn('ApihExchCtry', 'Apihexchctry', 'VARCHAR', false, 4, null);\n $this->addColumn('ApihExchRate', 'Apihexchrate', 'DECIMAL', false, 20, null);\n $this->addColumn('DateUpdtd', 'Dateupdtd', 'VARCHAR', false, 8, null);\n $this->addColumn('TimeUpdtd', 'Timeupdtd', 'VARCHAR', false, 8, null);\n $this->addColumn('dummy', 'Dummy', 'VARCHAR', false, 1, null);\n }", "protected function setUp()\n {\n $this->object = new LazyClassDefinition('\\stdClass');\n \n }", "protected function tableModel()\n {\n }", "public function setup()\n {\n $this->crud->setModel('App\\Models\\Sala');\n $this->crud->setRoute(config('backpack.base.route_prefix') . '/sala');\n $this->crud->setEntityNameStrings('sala', 'salas');\n\n /*\n |--------------------------------------------------------------------------\n | CrudPanel Configuration\n |--------------------------------------------------------------------------\n */\n\n // TODO: remove setFromDb() and manually define Fields and Columns\n $this->crud->setFromDb();\n $this->crud->modifyField(\n 'nome',\n [\n 'name' => 'nome',\n 'label' => 'Nome da Sala',\n 'type' => 'text',\n 'attributes' => [\n 'maxlength' => '50',\n ]\n ]\n );\n\n $this->crud->modifyField(\n 'capacidade',\n [\n 'name' => 'capacidade',\n 'label' => 'Capacidade da Sala',\n 'type' => 'textnumeric',\n 'max' => '9'\n ]\n );\n // add asterisk for fields that are required in SalaRequest\n $this->crud->setRequiredFields(StoreRequest::class, 'create');\n $this->crud->setRequiredFields(UpdateRequest::class, 'edit');\n }", "public function genTable($table) {\n $this->table = $table;\n $my_class = new $table();\n $class_vars = get_class_vars(get_class($my_class));\n # remove everything that begins with _, that is not _meta or _model_meta\n # - these values creep in from SalamaAccessTable that Model extends\n $ok = array('_meta', self::$meta_model);\n foreach ($class_vars as $k => $v) {\n if (substr($k, 0, 1) == '_') {\n if (!in_array($k, $ok)) {\n unset($class_vars[$k]);\n }\n }\n }\n $fields = array();\n # PROCESS FIELD VARS\n foreach ($class_vars as $k => $v) {\n # @TODO process _meta properly\n if ($k == '_meta') {\n $metaSettings = $this->parseSettings($v);\n if (isset($metaSettings['tablename'])) {\n $this->settingsAll[$this->table][self::$meta]['tablename'] = $metaSettings['tablename'];\n }\n }\n # do not include _meta_model outside Model\n if ($k == '_meta' || ($k == self::$meta_model && $table != 'Model')) {\n continue;\n }\n $res = $this->processVars($k, $v);\n $fields[] = $res;\n }\n\n # PROCESS PK\n # check if primaryKey was defined in Model\n $hasCustomPk = false;\n foreach ($this->settingsAll[$this->table] as $k => $v) {\n foreach ($v as $k2 => $v2) {\n if (stripos($k2, 'primarykey') !== false) {\n $hasCustomPk = true;\n $pk = $v;\n $pkName = $k;\n }\n }\n }\n $this->log(\"PK status: (int) \" . intval($hasCustomPk) . \" hasCustomPk: \" . $hasCustomPk);\n if ($hasCustomPk) {\n $res = $this->processVars($pkName, $pk);\n $sql = $res['sql'];\n } else {\n $sql = \"`id` int(11) AUTO_INCREMENT NOT NULL PRIMARY KEY,\";\n $pk = 'type=IntegerField,maxLength=11,primaryKey=true,autoIncrement=true';\n $pkName = 'id';\n $this->log($sql);\n }\n // - save pk\n $this->settingsAll[$this->table][self::$meta][$this->primaryKey]['custom'] = intval($hasCustomPk);\n $this->settingsAll[$this->table][self::$meta][$this->primaryKey]['sql'] = $sql;\n $settings = $this->processVars($pkName, $pk);\n $this->settingsAll[$this->table][self::$meta][$this->primaryKey]['settings'] = $settings;\n $this->settingsAll[$this->table][self::$meta][$this->primaryKey]['name'] = $pkName;\n if (!$hasCustomPk) {\n $this->settingsAll[$this->table][self::$meta]['create'][] = $settings;\n }\n // - save fields\n foreach ($fields as $the => $field) {\n $this->settingsAll[$this->table][self::$meta]['create'][] = $field;\n }\n # field names container\n foreach ($this->settingsAll[$this->table][self::$meta]['create'] as $k => $v) {\n # purely field names (includes belongsTo)\n if (empty($v['val']['relation']) && !in_array($v['val']['name'], $ok)) {\n $this->settingsAll[$this->table][self::$meta]['fields'][] = $v['val']['name'];\n }\n }\n # relations names container\n foreach ($this->settingsAll[$this->table][self::$meta]['create'] as $k => $v) {\n # hasOne, hasMany\n if (!empty($v['val']['relation']) && !in_array($v['val']['name'], $ok)) {\n $this->settingsAll[$this->table][self::$meta]['relations'][] = $v['val']['name'];\n }\n }\n }", "public function setup()\n {\n CRUD::setModel(\\App\\Models\\DeliveryNoteDetail::class);\n CRUD::setRoute(config('backpack.base.route_prefix') . '/deliverynotedetail');\n CRUD::setEntityNameStrings('deliverynotedetail', 'delivery_note_details');\n }", "public function setTableDefinition() {\n\t\tparent::setTableDefinition();\n\t\t\n\t\t// set the table\n\t\t$this->setTableName('company');\n\t\t$this->hasColumn('type', 'integer', null, array('notblank' => true, 'default' => '1')); // 1 Partner, 2 to be continue\n\t\t$this->hasColumn('name', 'string', 255, array('notblank' => true));\n\t\t$this->hasColumn('description', 'string', 500);\n\t\t$this->hasColumn('contactperson', 'string', 255);\n\t\t$this->hasColumn('phone', 'string', 15);\n\t\t$this->hasColumn('email', 'string', 255);\n\t\t$this->hasColumn('country', 'string', 2, array('default' => 'UG'));\n\t\t$this->hasColumn('locationid', 'integer', null);\n\t\t$this->hasColumn('status', 'integer', null, array('default' => '1'));\n\t\t$this->hasColumn('farmistype', 'integer', null, array('default' => '1'));\n\t\t// 0=>'None', 1=>'All Farmers', 2=>'One Region', 3=>'Multiple Regions', 4=>'One District', 5=>'Multiple Districts', 6=>'One DNA', 7=>'Multiple DNAs'\n\t\t$this->hasColumn('regionid', 'integer', null);\n\t\t$this->hasColumn('regionids', 'string', 50);\n\t\t$this->hasColumn('districtid', 'integer', null);\n\t\t$this->hasColumn('districtids', 'string', 50);\n\t\t$this->hasColumn('dnaid', 'integer', null);\n\t\t$this->hasColumn('dnaids', 'string', 50);\n\t\t$this->hasColumn('showind', 'integer', null, array('default' => '1')); // 1=Enabled, 0=Disabled\n\t}", "protected function setUp()\n\t {\n\t\t$conn = $this->getConnection();\n\t\t$db = $conn->getConnection();\n\t\t$db->exec(\n\t\t \"CREATE TABLE IF NOT EXISTS `MySQLdatabase` (\" .\n\t\t \"id int NOT NULL AUTO_INCREMENT, \" .\n\t\t \"string text NOT NULL, \" .\n\t\t \"testblob longblob NOT NULL, \" .\n\t\t \"PRIMARY KEY (`id`)\" .\n\t\t \") ENGINE=InnoDB DEFAULT CHARSET=utf8;\"\n\t\t);\n\n\t\t$this->object = new MySQLdatabase($GLOBALS[\"DB_HOST\"], $GLOBALS[\"DB_DBNAME\"], $GLOBALS[\"DB_USER\"], $GLOBALS[\"DB_PASSWD\"]);\n\n\t\tparent::setUp();\n\t }", "private function populateDummyTable() {}", "function setUp()\n\t{\n\t\tglobal $config;\n\t\tDb::init($config);\n\t\t$this->db = Db::get_instance();\n\t\t$this->sql = SqlObject::get_instance();\n\t}", "protected function _setupTableName()\n {\n parent::_setupTableName();\t\t\n\t\t $this->_name = $this->getTableName(USER_RSS); \n }", "public function initialize()\n {\n $this->setSchema(\"dtt\");\n $this->setSource(\"house\");\n }", "protected function setUp()\n {\n $this->object = new \\Yana\\Db\\Ddl\\Functions\\Implementation();\n }", "protected function setUp()\n\t{\n\t\tparent::setUp();\n\n\t\t// Get the mocks\n\t\t$this->saveFactoryState();\n\n\t\tJFactory::$session = $this->getMockSession();\n\n\t\t$this->object = new JTableLanguage(self::$driver);\n\t}", "protected function initDatabaseRecord() {}", "public function init()\n {\n $this->yatimsModel = new Admin_Model_DbTable_GestYatims();\n $this->dateImpl = new Default_Model_DateImpl();\n }", "protected function setUp()\n {\n $this->setUpFilesystem();\n $this->object = Config::table('users');\n }" ]
[ "0.750755", "0.741791", "0.70892096", "0.6977776", "0.6864694", "0.68461263", "0.679978", "0.67295206", "0.6724247", "0.6717081", "0.6702535", "0.66814595", "0.6673262", "0.6665736", "0.66608584", "0.6659331", "0.6653224", "0.6638338", "0.66298175", "0.656662", "0.65469056", "0.65454626", "0.6507232", "0.6475246", "0.6448328", "0.64443994", "0.6441103", "0.6434618", "0.64138937", "0.64135474", "0.6412892", "0.64036614", "0.639628", "0.63961935", "0.63928276", "0.63756377", "0.636578", "0.63653326", "0.6364024", "0.6350931", "0.63387835", "0.6335506", "0.6327025", "0.63202995", "0.63148254", "0.6312323", "0.63117826", "0.6297699", "0.629351", "0.6285686", "0.62795305", "0.62771976", "0.6269892", "0.6260094", "0.6240107", "0.62300164", "0.62288857", "0.62287545", "0.6226901", "0.62215424", "0.6220098", "0.62118757", "0.6210168", "0.6210168", "0.6209134", "0.6196755", "0.6182317", "0.6180684", "0.6171576", "0.61701524", "0.6170038", "0.61688316", "0.6164648", "0.6154771", "0.6153968", "0.6152761", "0.61514336", "0.61514175", "0.61460924", "0.61457837", "0.61456513", "0.614539", "0.61444813", "0.61366737", "0.6135004", "0.6133456", "0.61257523", "0.61253077", "0.61177737", "0.61139745", "0.6106847", "0.6105449", "0.6103206", "0.6102116", "0.61006886", "0.6098125", "0.6097597", "0.60859895", "0.6082321", "0.60727566", "0.60692716" ]
0.0
-1
Process launch method, setups for wiping database
public static function createObjects($path = [], $params = []) { if ($params['clearDb']) { self::_dropTables(); } foreach($path as $root) { self::_createObjects($root, $params); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\n }", "public function run()\n {\n Ward::unguard();\n if(!Ward::find(1)) {\n $path = __DIR__.'/sql-script/ward.sql';\n DB::unprepared(file_get_contents($path));\n //$this->command->info('Country table seeded!');\n }\n }", "protected function prepareDatabase()\n {\n $this->stateSaver->setConnection($this->input->getOption('database'));\n\n if (!$this->stateSaver->repositoryExists()) {\n $options = ['--database' => $this->input->getOption('database')];\n $this->call('migrate:install', $options);\n }\n }", "public function run()\n {\n DB::table('processes')->delete();\n Process::Create([\n 'id' =>1,\n \t'type'\t\t=>1,\n \t'time'\t =>'2016-07-15 00:00:00',\n ]);\n Process::Create([\n 'id' =>2,\n 'type' =>2,\n 'time' =>'2016-08-12 00:00:00',\n ]);\n Process::Create([\n 'id' =>3,\n 'type' =>3,\n 'time' =>'2016-09-16 00:00:00',\n ]);\n }", "public function run()\n {\n $path = 'database/seeds/SQLFiles/Products.sql';\n DB::unprepared(file_get_contents($path));\n $this->command->info('Products table seeded!');\n }", "public function handle()\n {\n try {\n\n $today = date('d-m-Y');\n $day = date('d-m-Y', strtotime(date(\"d-m-Y\") . \" -6 day\"));\n\n $files = array_filter(glob(storage_path('backups/').'backup-*'), 'is_dir'); \n $sortedFiles = usort($files,\n function($file1, $file2) {\n return filemtime($file1) <=> filemtime($file2);\n });\n $database_folders = '';\n if(count($files) > 3)\n {\n $database_folders = array_slice($files,-3,1);\n }\n\n if(!empty($database_folders))\n {\n foreach ($database_folders as $database_folder) {\n $file = new Filesystem;\n $file->cleanDirectory($database_folder);\n rmdir($database_folder);\n }\n }\n\n if(!is_dir(storage_path('backups/backup-'.$today))) \n mkdir(storage_path('backups/backup-'.$today),0777, true); \n\n $this->process_common = new Process(sprintf(\n 'mysqldump -u%s -p%s %s --ignore-table='.config('database.connections.common.database').'.request_logs --ignore-table='.config('database.connections.common.database').'.auth_logs > %s',\n config('database.connections.common.username'),\n config('database.connections.common.password'),\n config('database.connections.common.database'),\n storage_path('backups/backup-'.$today.'/common.sql')\n ));\n $this->process_transport = new Process(sprintf(\n 'mysqldump -u%s -p%s %s > %s',\n config('database.connections.transport.username'),\n config('database.connections.transport.password'),\n config('database.connections.transport.database'),\n storage_path('backups/backup-'.$today.'/transport.sql')\n ));\n $this->process_order = new Process(sprintf(\n 'mysqldump -u%s -p%s %s > %s',\n config('database.connections.order.username'),\n config('database.connections.order.password'),\n config('database.connections.order.database'),\n storage_path('backups/backup-'.$today.'/order.sql')\n ));\n $this->process_service = new Process(sprintf(\n 'mysqldump -u%s -p%s %s > %s',\n config('database.connections.service.username'),\n config('database.connections.service.password'),\n config('database.connections.service.database'),\n storage_path('backups/backup-'.$today.'/service.sql')\n ));\n $this->process_delivery = new Process(sprintf(\n 'mysqldump -u%s -p%s %s > %s',\n config('database.connections.delivery.username'),\n config('database.connections.delivery.password'),\n config('database.connections.delivery.database'),\n storage_path('backups/backup-'.$today.'/delivery.sql')\n ));\n\n $this->process_common->mustRun();\n $this->process_transport->mustRun();\n $this->process_order->mustRun();\n $this->process_service->mustRun();\n $this->process_delivery->mustRun();\n \n } catch (ProcessFailedException $exception) {\n Log::error('Backup Failed');\n }\n }", "public function run()\n {\n echo PHP_EOL , 'cleaning old data....', PHP_EOL;\n\n DB::statement(\"SET foreign_key_checks=0\");\n\n User::truncate();\n Role::truncate();\n UserRole::truncate();\n Permission::truncate();\n DB::table('roles_permissions')->truncate();\n DB::table('users_permissions')->truncate();\n\n DB::statement(\"SET foreign_key_checks=1\");\n\n $this->call(RolesTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n if(config('database.default') !== 'sqlite'){\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n }\n\n \\App\\TradeType::truncate();\n $this->call(TradeTypesTableSeeder::class);\n\n \\App\\Kind::truncate();\n $this->call(KindsTableSeeder::class);\n\n \\App\\ItemType::truncate();\n $this->call(ItemTypesTableSeeder::class);\n\n \\App\\EtfType::truncate();\n $this->call(EtfTypesTableSeeder::class);\n\n\n\n if(config('database.default') !== 'sqlite'){\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }\n\n }", "public function run()\n {\n Eloquent::unguard();\n\n $this->truncateTables();\n $this->seedTables();\n }", "public function handle()\n {\n $path = database_path('dumps');\n $files = File::files($path);\n foreach ($files as $file) {\n $file_path = $file->getRealPath();\n DB::unprepared(file_get_contents($file_path));\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n District::truncate();\n Area::truncate();\n Province::truncate();\n Geography::truncate();\n\n $query = file_get_contents(base_path('database/seeds/thailand.sql'));\n DB::unprepared($query);\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \\App\\Sql::truncate(); //清空資料庫\n\n \\App\\Sql::create([\n 'name'=>'2019-03-06_init.sql',\n 'install'=>'1',\n ]);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Property::truncate();\n $this->command->info('[properties] table truncated...');\n\n $this->seed();\n\n $this->command->info('[properties] table seeded...');\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('data_types')->truncate();\n DB::table('data_rows')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n \t\n // php artisan iseed data_types,data_rows --classnameprefix=AppBread --force\n $this->call(AppBreadDataTypesTableSeeder::class);\n $this->call(AppBreadDataRowsTableSeeder::class);\n }", "public function run()\n {\n DB::statement(\"SET foreign_key_checks=0\");\n Product::truncate();\n\n $dir = storage_path('app/public/product_images');\n $leave_files = ['default.jpg'];\n foreach( glob(\"$dir/*\") as $file ) {\n if( !in_array(basename($file), $leave_files) )\n unlink($file);\n }\n\n DB::statement(\"SET foreign_key_checks=1\");\n factory(Product::class, 20)->create();\n }", "public function startDump() {\n\t\t// Get the details for the current database.\n\t\t$cmd = $this->getDatabaseCommand();\n\t\t// Run the command.\n\t\tSakeMoreHelper::runCLI($cmd);\n\t}", "public function run()\n {\n $this->truncateTables($this->truncate);\n $this->seed($this->seeders);\n }", "protected function setupDBData()\n {\n /**\n * IMPORTANT NOTE : these functions must be executed sequentially in order for the command to work.\n */\n $this->setupProducts();\n $this->setupServerTypes();\n $this->setupServers();\n $this->setupUsers();\n }", "public function run()\n {\n \tEloquent::unguard();\n //\n\n $this->command->info('Seeding districts table');\n\n DB::unprepared(file_get_contents(__DIR__ . '/districts.sql'));\n\n $this->command->info('Seeding districts done successfully');\n }", "public function prepareDatabase()\n {\n // If SQLite database does not exist, create it\n if ($this->config->database['connection'] === 'sqlite') {\n $path = $this->config->database['database'];\n if ( ! $this->fileExists($path) && is_dir(dirname($path))) {\n $this->write(\"Creating $path ...\");\n touch($path);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n PropertyName::truncate();\n $this->command->info('[property_names] table truncated...');\n\n $this->seed();\n\n $this->command->info('[property_names] table seeded...');\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n db::truncate();\n foreach ([\n 'NP'=>'Draft','NJ'=>'Pending',\n 'CN'=>'Cancle','AJ'=>'Assigned',\n 'JC'=>'Evaluate','SC'=>'Success',\n ] as $key=>$value) {\n db::create([\n 'id'=>$key,\n 'name'=>$value\n ]);\n }\n }", "private function prepareDatabase()\n {\n if ($database = $this->getStringOption('database')) {\n $this->migrator->setConnection($database);\n }\n\n if ( ! $this->migrator->repositoryExists()) {\n $this->call('migrate:install', [\n '--database' => $database,\n ]);\n }\n }", "public function run()\n {\n try{\n $this->command->info('Provincias table seed!');\n $path = 'app/developer_docs/provincias.sql';\n DB::unprepared(file_get_contents($path));\n }catch(QueryException $e){\n if ($e->getCode()==23505){\n $this->command->error('Provincias NO fueron plantados (ya existían)!');\n return 0;\n }\n }\n $this->command->info('Provincias table seeded!');\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('UserTableSeeder');\n\n\t\t// $this->call('ProjectAppTableSeeder');\n\t\t// $this->command->info('Project status table seeded!');\n\n\n\t\t// $this->call('AreaTableSeeder');\n\t\t// $this->command->info('Areas Table table seeded!');\n\n\t\t// $this->call('PhoneTypeTableSeeder');\n\t\t// $this->command->info('Phone Types table seeded!');\n\n\t\t// $this->call('ProjectClassificationSeeder');\n\t\t// $this->command->info('Project Classifications table seeded!');\n\n\t\t// $this->call('DepartmentTableSeeder');\n\t\t// $this->command->info('Department Table table seeded!');\n\n\t\t// $this->call('RoleTableSeeder');\n\t\t// $this->command->info('Role Table table seeded!');\n\n\t\t// $this->call('PermissionTableSeeder');\n\t\t// $this->command->info('Permission Table table seeded!');\n\n\t\t// $this->call('UserTableSeeder');\n\t\t// $this->command->info('Users Table table seeded!');\n\n\t\t// $this->call('ProjectContactStatusTableSeeder');\n\t\t// $this->command->info('Project contact status table seeded!');\n\n\n\t}", "public function run()\n {\n // se desahilitan los chequeos de llaves foraneas para poder truncar la tabla\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n BudgetConfig::query()->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n DB::table('budget_configs')->insert([\n 'name'=>'Material y equipo',\n 'description' => 'Solo se permite agregar productos',\n 'custom_text' => 'Material y equipo',\n 'type' => '1',\n 'active' => '1',\n 'color' => 'grey',\n 'icon' => 'fas fa-align-justify',\n 'order' => '1',\n 'created_by' => '1',\n 'updated_by' => '1'\n ]);\n DB::table('budget_configs')->insert([\n 'name'=>'Mano de obra',\n 'description' => 'Solo se permite agregar servicios',\n 'custom_text' => 'Mano de obra',\n 'type' => '1',\n 'active' => '1',\n 'color' => 'grey',\n 'icon' => 'fas fa-align-justify',\n 'order' => '2',\n 'created_by' => '1',\n 'updated_by' => '1'\n ]);\n }", "public function run()\n\t{\n\t\tModel::unguard();\n\n\t\t$this->call('DatabaseResetter');\n\t}", "public function initializeTemporaryDBmount() {}", "public function run()\n {\n Model::unguard();\n\n Process::create(['id' => '0', 'name' => 'Нет обработки', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '0', 'is_default' => '0']);\n Process::find(1)->update(['id' => '0']);\n\n Process::create(['id' => '1001', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1006', 'is_default' => '0']);\n Process::create(['id' => '1008', 'name' => 'Жареные кружочками', 'coldproc' => '5', 'hotproc' => '26', 'finalproc' => '0', 'grease' => '10', 'ch' => '2', 'protein' => '5', 'product_id' => '1014', 'is_default' => '0']);\n Process::create(['id' => '1010', 'name' => 'Печеные в кожице с последующей очисткой', 'coldproc' => '0', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '2', 'product_id' => '1014', 'is_default' => '0']);\n Process::create(['id' => '1012', 'name' => 'Жарка (Н. Зеландия, Австралия)', 'coldproc' => '24', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1018', 'is_default' => '1']);\n Process::create(['id' => '1015', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '36', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1019', 'is_default' => '1']);\n Process::create(['id' => '1016', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1019', 'is_default' => '0']);\n Process::create(['id' => '1017', 'name' => 'Котлеты натур. рубленн. в сухарях', 'coldproc' => '0', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1019', 'is_default' => '0']);\n Process::create(['id' => '1018', 'name' => 'Тушение', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1019', 'is_default' => '0']);\n Process::create(['id' => '1019', 'name' => 'Жарка охлажденой', 'coldproc' => '5', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1021', 'is_default' => '1']);\n Process::create(['id' => '1020', 'name' => 'Тушение охлажденой', 'coldproc' => '5', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1021', 'is_default' => '0']);\n Process::create(['id' => '1025', 'name' => 'Жарка дольками', 'coldproc' => '24', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1026', 'is_default' => '1']);\n Process::create(['id' => '1026', 'name' => 'Пассерование', 'coldproc' => '24', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1026', 'is_default' => '0']);\n Process::create(['id' => '1027', 'name' => 'Припускание', 'coldproc' => '24', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1026', 'is_default' => '0']);\n Process::create(['id' => '1030', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1027', 'is_default' => '1']);\n Process::create(['id' => '1035', 'name' => 'Варка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1033', 'is_default' => '0']);\n Process::create(['id' => '1036', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1033', 'is_default' => '0']);\n Process::create(['id' => '1037', 'name' => 'Варка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1034', 'is_default' => '0']);\n Process::create(['id' => '1038', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1034', 'is_default' => '0']);\n Process::create(['id' => '1039', 'name' => 'Варка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1035', 'is_default' => '0']);\n Process::create(['id' => '1040', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1035', 'is_default' => '0']);\n Process::create(['id' => '1041', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1045', 'is_default' => '0']);\n Process::create(['id' => '1046', 'name' => 'Варка крупным куском', 'coldproc' => '6', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1055', 'is_default' => '0']);\n Process::create(['id' => '1047', 'name' => 'Жарка крупным куском', 'coldproc' => '6', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1055', 'is_default' => '0']);\n Process::create(['id' => '1054', 'name' => 'Варка крупным куском', 'coldproc' => '5', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1057', 'is_default' => '1']);\n Process::create(['id' => '1055', 'name' => 'Жарка крупным куском', 'coldproc' => '5', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1056', 'name' => 'Котлетная масса жарка', 'coldproc' => '5', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1057', 'name' => 'Тушение крупным куском', 'coldproc' => '5', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1058', 'name' => 'Варка охлажденных', 'coldproc' => '0', 'hotproc' => '27', 'finalproc' => '14', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1058', 'is_default' => '0']);\n Process::create(['id' => '1059', 'name' => 'Жарка во фритюре (охлажденное)', 'coldproc' => '9', 'hotproc' => '43', 'finalproc' => '8', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1059', 'is_default' => '0']);\n Process::create(['id' => '1060', 'name' => 'Варка и тушение (охлажденное)', 'coldproc' => '9', 'hotproc' => '43', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1059', 'is_default' => '1']);\n Process::create(['id' => '1061', 'name' => 'Жарка охлажденных', 'coldproc' => '13', 'hotproc' => '25', 'finalproc' => '8', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1060', 'is_default' => '1']);\n Process::create(['id' => '1062', 'name' => 'Варка охлажденных', 'coldproc' => '13', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1060', 'is_default' => '0']);\n Process::create(['id' => '1063', 'name' => 'Жарка охлажденных', 'coldproc' => '7', 'hotproc' => '47', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1061', 'is_default' => '0']);\n Process::create(['id' => '1064', 'name' => 'Варка охлажденных', 'coldproc' => '7', 'hotproc' => '47', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1061', 'is_default' => '1']);\n Process::create(['id' => '1065', 'name' => 'Жарка охлажденной', 'coldproc' => '7', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1062', 'is_default' => '1']);\n Process::create(['id' => '1066', 'name' => 'Тушение охлажденной', 'coldproc' => '7', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1062', 'is_default' => '0']);\n Process::create(['id' => '1067', 'name' => 'Варка кусками непластованная', 'coldproc' => '19', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1064', 'is_default' => '0']);\n Process::create(['id' => '1068', 'name' => 'Жарка кусками непластованная', 'coldproc' => '19', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1064', 'is_default' => '0']);\n Process::create(['id' => '1071', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1067', 'is_default' => '1']);\n Process::create(['id' => '1072', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1067', 'is_default' => '0']);\n Process::create(['id' => '1073', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1068', 'is_default' => '1']);\n Process::create(['id' => '1074', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1068', 'is_default' => '0']);\n Process::create(['id' => '1075', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1075', 'is_default' => '0']);\n Process::create(['id' => '1076', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1075', 'is_default' => '1']);\n Process::create(['id' => '1077', 'name' => 'Жарка (Контрольная проработка)', 'coldproc' => '4', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1076', 'is_default' => '1']);\n Process::create(['id' => '1083', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1079', 'is_default' => '1']);\n Process::create(['id' => '1084', 'name' => 'Пассерование', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1079', 'is_default' => '0']);\n Process::create(['id' => '1085', 'name' => 'Припускание', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1079', 'is_default' => '0']);\n Process::create(['id' => '1087', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '40', 'finalproc' => '3', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1083', 'is_default' => '1']);\n Process::create(['id' => '1091', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '27', 'finalproc' => '3', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1103', 'is_default' => '1']);\n Process::create(['id' => '1092', 'name' => 'Котлеты из мякоти', 'coldproc' => '40', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1103', 'is_default' => '0']);\n Process::create(['id' => '1093', 'name' => 'Тушение', 'coldproc' => '0', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1103', 'is_default' => '0']);\n Process::create(['id' => '1094', 'name' => 'Жаренные ломтиками с кожицей и семянами', 'coldproc' => '10', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1112', 'is_default' => '1']);\n Process::create(['id' => '1096', 'name' => 'Припущенные без кожицы и семян', 'coldproc' => '33', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1112', 'is_default' => '0']);\n Process::create(['id' => '1097', 'name' => 'Варка', 'coldproc' => '10', 'hotproc' => '46', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1114', 'is_default' => '1']);\n Process::create(['id' => '1099', 'name' => 'Варка', 'coldproc' => '36', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1115', 'is_default' => '1']);\n Process::create(['id' => '1100', 'name' => 'Жарка', 'coldproc' => '36', 'hotproc' => '21', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1115', 'is_default' => '0']);\n Process::create(['id' => '1102', 'name' => 'Припускание', 'coldproc' => '36', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1115', 'is_default' => '0']);\n Process::create(['id' => '1107', 'name' => 'Варка крупными кусками', 'coldproc' => '20', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '2', 'ch' => '0', 'protein' => '2', 'product_id' => '1117', 'is_default' => '0']);\n Process::create(['id' => '1108', 'name' => 'Тушение', 'coldproc' => '20', 'hotproc' => '21', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1117', 'is_default' => '0']);\n Process::create(['id' => '1109', 'name' => 'Холодная обработка', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1118', 'is_default' => '1']);\n Process::create(['id' => '1111', 'name' => 'Припускание', 'coldproc' => '3', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1119', 'is_default' => '1']);\n Process::create(['id' => '1114', 'name' => 'Варка ', 'coldproc' => '48', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '2', 'ch' => '1', 'protein' => '2', 'product_id' => '1121', 'is_default' => '1']);\n Process::create(['id' => '1117', 'name' => 'Запеченый с головой', 'coldproc' => '24', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1123', 'is_default' => '1']);\n Process::create(['id' => '1120', 'name' => 'Отварной непластованный кусками', 'coldproc' => '41', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1121', 'name' => 'Жареный непластованный кусками', 'coldproc' => '41', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1124', 'name' => 'Отварной очищенный', 'coldproc' => '35', 'hotproc' => '3', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '1']);\n Process::create(['id' => '1125', 'name' => 'Жареный до готовности', 'coldproc' => '35', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '10', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1131', 'name' => 'Жарка (Контрольная проработка)', 'coldproc' => '4', 'hotproc' => '34', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1139', 'is_default' => '1']);\n Process::create(['id' => '1133', 'name' => 'Разморозка, очистка от панциря', 'coldproc' => '53', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1143', 'is_default' => '1']);\n Process::create(['id' => '1136', 'name' => 'Жарка с удалением внутренностей', 'coldproc' => '31', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1148', 'is_default' => '1']);\n Process::create(['id' => '1137', 'name' => 'Варка, разделка на мякоть без кожи', 'coldproc' => '0', 'hotproc' => '28', 'finalproc' => '47', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1154', 'is_default' => '0']);\n Process::create(['id' => '1138', 'name' => 'Жарка, запекание', 'coldproc' => '0', 'hotproc' => '31', 'finalproc' => '3', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1154', 'is_default' => '1']);\n Process::create(['id' => '1139', 'name' => 'Котлеты из мякоти', 'coldproc' => '47', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1154', 'is_default' => '0']);\n Process::create(['id' => '1140', 'name' => 'Тушение', 'coldproc' => '0', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1154', 'is_default' => '0']);\n Process::create(['id' => '1149', 'name' => 'Отварной непластованный кусками', 'coldproc' => '38', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1159', 'is_default' => '0']);\n Process::create(['id' => '1150', 'name' => 'Жареный непластованный кусками', 'coldproc' => '38', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1159', 'is_default' => '1']);\n Process::create(['id' => '1153', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1162', 'is_default' => '1']);\n Process::create(['id' => '1154', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1162', 'is_default' => '0']);\n Process::create(['id' => '1155', 'name' => 'Пассерование', 'coldproc' => '24', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1164', 'is_default' => '1']);\n Process::create(['id' => '1156', 'name' => 'Припускание', 'coldproc' => '24', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1164', 'is_default' => '0']);\n Process::create(['id' => '1157', 'name' => 'Пассерованный до готовности', 'coldproc' => '16', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1165', 'is_default' => '0']);\n Process::create(['id' => '1158', 'name' => 'Пассерованный до полуготовности', 'coldproc' => '16', 'hotproc' => '26', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1165', 'is_default' => '0']);\n Process::create(['id' => '1159', 'name' => 'Варка по СТН', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1168', 'is_default' => '1']);\n Process::create(['id' => '1160', 'name' => 'Варка по СТН', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1169', 'is_default' => '0']);\n Process::create(['id' => '1161', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1173', 'is_default' => '1']);\n Process::create(['id' => '1163', 'name' => 'Жарка', 'coldproc' => '17', 'hotproc' => '26', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1183', 'is_default' => '1']);\n Process::create(['id' => '1166', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1184', 'is_default' => '1']);\n Process::create(['id' => '1167', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1184', 'is_default' => '0']);\n Process::create(['id' => '1169', 'name' => 'Припускание и запекание с сырным соусом', 'coldproc' => '0', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1186', 'is_default' => '1']);\n Process::create(['id' => '1171', 'name' => 'Жарка', 'coldproc' => '9', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1187', 'is_default' => '1']);\n Process::create(['id' => '1185', 'name' => 'Варка', 'coldproc' => '25', 'hotproc' => '1', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1196', 'is_default' => '0']);\n Process::create(['id' => '1186', 'name' => 'Пассерование', 'coldproc' => '25', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1196', 'is_default' => '1']);\n Process::create(['id' => '1187', 'name' => 'Припускание', 'coldproc' => '25', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1196', 'is_default' => '0']);\n Process::create(['id' => '1190', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1201', 'is_default' => '1']);\n Process::create(['id' => '1191', 'name' => 'Тушение', 'coldproc' => '3', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1201', 'is_default' => '0']);\n Process::create(['id' => '1196', 'name' => 'Варка', 'coldproc' => '5', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1205', 'is_default' => '0']);\n Process::create(['id' => '1197', 'name' => 'Жарка', 'coldproc' => '5', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1205', 'is_default' => '0']);\n Process::create(['id' => '1198', 'name' => 'Котлеты из мякоти', 'coldproc' => '25', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1205', 'is_default' => '0']);\n Process::create(['id' => '1199', 'name' => 'Тушение', 'coldproc' => '5', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1205', 'is_default' => '1']);\n Process::create(['id' => '1200', 'name' => 'Запекание', 'coldproc' => '20', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1206', 'is_default' => '1']);\n Process::create(['id' => '1201', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1208', 'is_default' => '1']);\n Process::create(['id' => '1202', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1208', 'is_default' => '0']);\n Process::create(['id' => '1203', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '0', 'protein' => '2', 'product_id' => '1209', 'is_default' => '1']);\n Process::create(['id' => '1204', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1210', 'is_default' => '1']);\n Process::create(['id' => '1205', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1210', 'is_default' => '0']);\n Process::create(['id' => '1206', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1211', 'is_default' => '1']);\n Process::create(['id' => '1207', 'name' => 'Припускание с очисткой', 'coldproc' => '40', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1214', 'is_default' => '0']);\n Process::create(['id' => '1208', 'name' => 'Варка целиком (из охлажденных)', 'coldproc' => '3', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1215', 'is_default' => '0']);\n Process::create(['id' => '1209', 'name' => 'Жарка целиком (из с/м импорного пр-ва)', 'coldproc' => '24', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1215', 'is_default' => '1']);\n Process::create(['id' => '1216', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1217', 'is_default' => '1']);\n Process::create(['id' => '1217', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1217', 'is_default' => '0']);\n Process::create(['id' => '1218', 'name' => 'Котлеты', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '15', 'ch' => '0', 'protein' => '5', 'product_id' => '1217', 'is_default' => '0']);\n Process::create(['id' => '1219', 'name' => 'Припускание', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1217', 'is_default' => '0']);\n Process::create(['id' => '1224', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1220', 'is_default' => '1']);\n Process::create(['id' => '1225', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1220', 'is_default' => '0']);\n Process::create(['id' => '1226', 'name' => 'Варка', 'coldproc' => '45', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1221', 'is_default' => '0']);\n Process::create(['id' => '1227', 'name' => 'Жарка порционного куска с кожей без хрящей', 'coldproc' => '45', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1221', 'is_default' => '0']);\n Process::create(['id' => '1229', 'name' => 'Жарка неглазированное льдом', 'coldproc' => '8', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1223', 'is_default' => '0']);\n Process::create(['id' => '1231', 'name' => 'Припускание неглазированное льдом', 'coldproc' => '8', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1223', 'is_default' => '0']);\n Process::create(['id' => '1232', 'name' => 'Пассерование', 'coldproc' => '25', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '2', 'product_id' => '1224', 'is_default' => '1']);\n Process::create(['id' => '1234', 'name' => 'Жарка', 'coldproc' => '5', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1226', 'is_default' => '1']);\n Process::create(['id' => '1235', 'name' => 'Тушение', 'coldproc' => '5', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1226', 'is_default' => '0']);\n Process::create(['id' => '1236', 'name' => 'Пассеровка', 'coldproc' => '25', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1227', 'is_default' => '0']);\n Process::create(['id' => '1238', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1229', 'is_default' => '1']);\n Process::create(['id' => '1239', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1229', 'is_default' => '0']);\n Process::create(['id' => '1240', 'name' => 'Пассерование', 'coldproc' => '25', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '2', 'product_id' => '1234', 'is_default' => '1']);\n Process::create(['id' => '1244', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1237', 'is_default' => '1']);\n Process::create(['id' => '1245', 'name' => 'Тушение', 'coldproc' => '3', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1237', 'is_default' => '0']);\n Process::create(['id' => '1255', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '9', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1250', 'is_default' => '1']);\n Process::create(['id' => '1256', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1255', 'is_default' => '1']);\n Process::create(['id' => '1257', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1255', 'is_default' => '0']);\n Process::create(['id' => '1259', 'name' => 'Варка ', 'coldproc' => '25', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '5', 'ch' => '1', 'protein' => '5', 'product_id' => '1261', 'is_default' => '0']);\n Process::create(['id' => '1260', 'name' => 'Пассерование', 'coldproc' => '25', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1261', 'is_default' => '0']);\n Process::create(['id' => '1261', 'name' => 'Тушение', 'coldproc' => '25', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1261', 'is_default' => '1']);\n Process::create(['id' => '1262', 'name' => 'Варка без слива (СТН)', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1263', 'is_default' => '0']);\n Process::create(['id' => '1263', 'name' => 'Варка со сливом (СТН)', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1263', 'is_default' => '1']);\n Process::create(['id' => '1264', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1264', 'is_default' => '1']);\n Process::create(['id' => '1265', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1264', 'is_default' => '0']);\n Process::create(['id' => '1271', 'name' => 'Варка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1272', 'is_default' => '1']);\n Process::create(['id' => '1272', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1272', 'is_default' => '0']);\n Process::create(['id' => '1273', 'name' => 'Варка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1273', 'is_default' => '1']);\n Process::create(['id' => '1274', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1273', 'is_default' => '0']);\n Process::create(['id' => '1275', 'name' => 'Вареная в кожуре с посл. очисткой', 'coldproc' => '0', 'hotproc' => '2', 'finalproc' => '25', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1276', 'is_default' => '1']);\n Process::create(['id' => '1276', 'name' => 'Пассерованная', 'coldproc' => '25', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1276', 'is_default' => '0']);\n Process::create(['id' => '1277', 'name' => 'Варка', 'coldproc' => '5', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1277', 'is_default' => '0']);\n Process::create(['id' => '1278', 'name' => 'Жарка', 'coldproc' => '5', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1277', 'is_default' => '1']);\n Process::create(['id' => '1279', 'name' => 'Котлеты натур. рубл. (с сухарях)', 'coldproc' => '5', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1277', 'is_default' => '0']);\n Process::create(['id' => '1280', 'name' => 'Тушение', 'coldproc' => '5', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1277', 'is_default' => '0']);\n Process::create(['id' => '1281', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1278', 'is_default' => '0']);\n Process::create(['id' => '1282', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1278', 'is_default' => '1']);\n Process::create(['id' => '1283', 'name' => 'Жарка в сухарях', 'coldproc' => '0', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1278', 'is_default' => '0']);\n Process::create(['id' => '1284', 'name' => 'Тушение', 'coldproc' => '0', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1278', 'is_default' => '0']);\n Process::create(['id' => '1285', 'name' => 'Варка', 'coldproc' => '5', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1279', 'is_default' => '0']);\n Process::create(['id' => '1286', 'name' => 'Жарка', 'coldproc' => '5', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1279', 'is_default' => '1']);\n Process::create(['id' => '1287', 'name' => 'Котлеты', 'coldproc' => '5', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1279', 'is_default' => '0']);\n Process::create(['id' => '1288', 'name' => 'Тушение', 'coldproc' => '5', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1279', 'is_default' => '0']);\n Process::create(['id' => '1289', 'name' => 'Варка с разделкой на мякоть', 'coldproc' => '0', 'hotproc' => '11', 'finalproc' => '49', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1280', 'is_default' => '1']);\n Process::create(['id' => '1293', 'name' => 'Варка охлажденных', 'coldproc' => '2', 'hotproc' => '47', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1281', 'is_default' => '1']);\n Process::create(['id' => '1294', 'name' => 'Жарка охлажденных', 'coldproc' => '2', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1281', 'is_default' => '0']);\n Process::create(['id' => '1296', 'name' => 'Жарка в сухарях охлажденных', 'coldproc' => '2', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '5', 'product_id' => '1281', 'is_default' => '0']);\n Process::create(['id' => '1298', 'name' => 'Запекание с предварительной варкой', 'coldproc' => '5', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1282', 'is_default' => '1']);\n Process::create(['id' => '1303', 'name' => 'Пассерование', 'coldproc' => '32', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1285', 'is_default' => '1']);\n Process::create(['id' => '1304', 'name' => 'Припускание', 'coldproc' => '32', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1285', 'is_default' => '0']);\n Process::create(['id' => '1306', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1287', 'is_default' => '0']);\n Process::create(['id' => '1308', 'name' => 'Тушение', 'coldproc' => '3', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1287', 'is_default' => '1']);\n Process::create(['id' => '1309', 'name' => 'Потери при варке', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1291', 'is_default' => '1']);\n Process::create(['id' => '1311', 'name' => 'Потери при варке', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1293', 'is_default' => '1']);\n Process::create(['id' => '1314', 'name' => 'Запекание в составе блюда', 'coldproc' => '0', 'hotproc' => '33', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1297', 'is_default' => '0']);\n Process::create(['id' => '1318', 'name' => 'Запекание в составе блюда', 'coldproc' => '0', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1301', 'is_default' => '0']);\n Process::create(['id' => '1320', 'name' => 'Жарка', 'coldproc' => '16', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1304', 'is_default' => '1']);\n Process::create(['id' => '1321', 'name' => 'Отварной непластованный кусками', 'coldproc' => '38', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1306', 'is_default' => '0']);\n Process::create(['id' => '1322', 'name' => 'Жареный непластованный кусками', 'coldproc' => '38', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1306', 'is_default' => '0']);\n Process::create(['id' => '1325', 'name' => 'Варка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1307', 'is_default' => '1']);\n Process::create(['id' => '1326', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1307', 'is_default' => '0']);\n Process::create(['id' => '1327', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1308', 'is_default' => '1']);\n Process::create(['id' => '1328', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1308', 'is_default' => '0']);\n Process::create(['id' => '1329', 'name' => 'Припускание', 'coldproc' => '27', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '2', 'product_id' => '1310', 'is_default' => '1']);\n Process::create(['id' => '1330', 'name' => 'Отварной непластованный кусками', 'coldproc' => '35', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '1']);\n Process::create(['id' => '1331', 'name' => 'Жареный непластованный кусками', 'coldproc' => '35', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1336', 'name' => 'Запекание', 'coldproc' => '8', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1319', 'is_default' => '0']);\n Process::create(['id' => '1337', 'name' => 'Запекание', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1320', 'is_default' => '0']);\n Process::create(['id' => '1338', 'name' => 'Запекание', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1321', 'is_default' => '0']);\n Process::create(['id' => '1339', 'name' => 'Запекание', 'coldproc' => '3', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1322', 'is_default' => '0']);\n Process::create(['id' => '1344', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1327', 'is_default' => '0']);\n Process::create(['id' => '1345', 'name' => 'Варка', 'coldproc' => '4', 'hotproc' => '36', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1328', 'is_default' => '0']);\n Process::create(['id' => '1346', 'name' => 'Жарка', 'coldproc' => '4', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1328', 'is_default' => '1']);\n Process::create(['id' => '1347', 'name' => 'Котлеты', 'coldproc' => '4', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1328', 'is_default' => '0']);\n Process::create(['id' => '1348', 'name' => 'Припускание', 'coldproc' => '4', 'hotproc' => '36', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1328', 'is_default' => '0']);\n Process::create(['id' => '1349', 'name' => 'Припускание', 'coldproc' => '0', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1330', 'is_default' => '1']);\n Process::create(['id' => '1350', 'name' => 'Пассерование', 'coldproc' => '0', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1330', 'is_default' => '0']);\n Process::create(['id' => '1351', 'name' => 'Припускание', 'coldproc' => '0', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1331', 'is_default' => '1']);\n Process::create(['id' => '1352', 'name' => 'Пассерование', 'coldproc' => '0', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1331', 'is_default' => '0']);\n Process::create(['id' => '1353', 'name' => 'Жарка, запекание', 'coldproc' => '15', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '5', 'product_id' => '1332', 'is_default' => '0']);\n Process::create(['id' => '1355', 'name' => 'Припускание', 'coldproc' => '3', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1333', 'is_default' => '0']);\n Process::create(['id' => '1356', 'name' => 'Жарка Medium', 'coldproc' => '5', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1336', 'is_default' => '0']);\n Process::create(['id' => '1358', 'name' => 'Варка ', 'coldproc' => '30', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1337', 'is_default' => '0']);\n Process::create(['id' => '1359', 'name' => 'Жарка ломтиками', 'coldproc' => '30', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1337', 'is_default' => '1']);\n Process::create(['id' => '1361', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1338', 'is_default' => '1']);\n Process::create(['id' => '1362', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1338', 'is_default' => '0']);\n Process::create(['id' => '1363', 'name' => 'Котлеты', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '15', 'ch' => '0', 'protein' => '5', 'product_id' => '1338', 'is_default' => '0']);\n Process::create(['id' => '1364', 'name' => 'Припускание', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1338', 'is_default' => '0']);\n Process::create(['id' => '1366', 'name' => 'Жарка', 'coldproc' => '10', 'hotproc' => '35', 'finalproc' => '3', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1341', 'is_default' => '1']);\n Process::create(['id' => '1369', 'name' => 'Припускание', 'coldproc' => '10', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '10', 'ch' => '2', 'protein' => '2', 'product_id' => '1342', 'is_default' => '1']);\n Process::create(['id' => '1370', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1343', 'is_default' => '1']);\n Process::create(['id' => '1371', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1343', 'is_default' => '0']);\n Process::create(['id' => '1372', 'name' => 'Варка из замороженых', 'coldproc' => '6', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1345', 'is_default' => '1']);\n Process::create(['id' => '1373', 'name' => 'Жарка из замороженых', 'coldproc' => '6', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1345', 'is_default' => '0']);\n Process::create(['id' => '1374', 'name' => 'Котлеты', 'coldproc' => '0', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1345', 'is_default' => '0']);\n Process::create(['id' => '1375', 'name' => 'Жарка панированных п/ф', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1345', 'is_default' => '0']);\n Process::create(['id' => '1376', 'name' => 'Пассерование', 'coldproc' => '22', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '2', 'product_id' => '1355', 'is_default' => '0']);\n Process::create(['id' => '1377', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1356', 'is_default' => '1']);\n Process::create(['id' => '1378', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1356', 'is_default' => '0']);\n Process::create(['id' => '1379', 'name' => 'Варка целиком', 'coldproc' => '0', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1357', 'is_default' => '0']);\n Process::create(['id' => '1380', 'name' => 'Жарка ломтиками из сырых', 'coldproc' => '0', 'hotproc' => '60', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1357', 'is_default' => '1']);\n Process::create(['id' => '1382', 'name' => 'Жарка', 'coldproc' => '4', 'hotproc' => '53', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1362', 'is_default' => '0']);\n Process::create(['id' => '1383', 'name' => 'Котлеты', 'coldproc' => '4', 'hotproc' => '45', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1362', 'is_default' => '0']);\n Process::create(['id' => '1385', 'name' => 'Жарка', 'coldproc' => '4', 'hotproc' => '45', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1363', 'is_default' => '0']);\n Process::create(['id' => '1387', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1364', 'is_default' => '1']);\n Process::create(['id' => '1390', 'name' => 'Припускание', 'coldproc' => '26', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1365', 'is_default' => '1']);\n Process::create(['id' => '1392', 'name' => 'Варка', 'coldproc' => '24', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1367', 'is_default' => '0']);\n Process::create(['id' => '1393', 'name' => 'Припускание', 'coldproc' => '24', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1367', 'is_default' => '0']);\n Process::create(['id' => '1394', 'name' => 'Отварная непластованная кусками', 'coldproc' => '42', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1368', 'is_default' => '0']);\n Process::create(['id' => '1395', 'name' => 'Жареная непластованная кусками', 'coldproc' => '42', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1368', 'is_default' => '1']);\n Process::create(['id' => '1398', 'name' => 'Запекание с удаленными семенами', 'coldproc' => '12', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1369', 'is_default' => '0']);\n Process::create(['id' => '1408', 'name' => 'Запекание', 'coldproc' => '4', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1240', 'is_default' => '0']);\n Process::create(['id' => '1409', 'name' => 'Жарка стейка (Well Done) и мелкими кусочками', 'coldproc' => '6', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1055', 'is_default' => '1']);\n Process::create(['id' => '1410', 'name' => 'Жарка в панировке', 'coldproc' => '6', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1055', 'is_default' => '0']);\n Process::create(['id' => '1411', 'name' => 'Жарка в сухарях', 'coldproc' => '5', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1412', 'name' => 'Жарка в сухарях (Н. Зеландия, Австралия)', 'coldproc' => '24', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1018', 'is_default' => '0']);\n Process::create(['id' => '1413', 'name' => 'Жарка в сухарях', 'coldproc' => '0', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1019', 'is_default' => '0']);\n Process::create(['id' => '1414', 'name' => 'Жарка в панировке', 'coldproc' => '5', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1277', 'is_default' => '0']);\n Process::create(['id' => '1415', 'name' => 'Жарка в сухарях', 'coldproc' => '4', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1328', 'is_default' => '0']);\n Process::create(['id' => '1416', 'name' => 'Жарка в сухарях', 'coldproc' => '5', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1279', 'is_default' => '0']);\n Process::create(['id' => '1417', 'name' => 'Жарка мороженых', 'coldproc' => '20', 'hotproc' => '25', 'finalproc' => '8', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1060', 'is_default' => '0']);\n Process::create(['id' => '1418', 'name' => 'Варка мороженых', 'coldproc' => '20', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1060', 'is_default' => '0']);\n Process::create(['id' => '1419', 'name' => 'Варка мороженых', 'coldproc' => '0', 'hotproc' => '31', 'finalproc' => '14', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1058', 'is_default' => '1']);\n Process::create(['id' => '1420', 'name' => 'Жарка мороженых', 'coldproc' => '14', 'hotproc' => '52', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1061', 'is_default' => '0']);\n Process::create(['id' => '1421', 'name' => 'Варка мороженых', 'coldproc' => '14', 'hotproc' => '52', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1061', 'is_default' => '0']);\n Process::create(['id' => '1422', 'name' => 'Варка замороженных', 'coldproc' => '10', 'hotproc' => '52', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1281', 'is_default' => '0']);\n Process::create(['id' => '1423', 'name' => 'Жарка замороженных', 'coldproc' => '10', 'hotproc' => '45', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1281', 'is_default' => '0']);\n Process::create(['id' => '1424', 'name' => 'Жарка в сухарях замороженных', 'coldproc' => '10', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '5', 'product_id' => '1281', 'is_default' => '0']);\n Process::create(['id' => '1425', 'name' => 'Жарка замороженной', 'coldproc' => '17', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1062', 'is_default' => '0']);\n Process::create(['id' => '1426', 'name' => 'Тушение замороженной', 'coldproc' => '17', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1062', 'is_default' => '0']);\n Process::create(['id' => '1427', 'name' => 'Жарка мороженой', 'coldproc' => '12', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1021', 'is_default' => '0']);\n Process::create(['id' => '1428', 'name' => 'Тушение мороженой', 'coldproc' => '12', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1021', 'is_default' => '0']);\n Process::create(['id' => '1430', 'name' => 'Жарка разрезанных', 'coldproc' => '3', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1273', 'is_default' => '0']);\n Process::create(['id' => '1431', 'name' => 'Жарка разрезанных', 'coldproc' => '3', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1272', 'is_default' => '0']);\n Process::create(['id' => '1432', 'name' => 'Жарка фри панированных п/ф', 'coldproc' => '0', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1154', 'is_default' => '0']);\n Process::create(['id' => '1433', 'name' => 'Разделка на филе + жарка', 'coldproc' => '52', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1226', 'is_default' => '0']);\n Process::create(['id' => '1434', 'name' => 'Варка филе с кожей и костями', 'coldproc' => '27', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1064', 'is_default' => '0']);\n Process::create(['id' => '1435', 'name' => 'Жарка филе с кожей и костями', 'coldproc' => '27', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1064', 'is_default' => '0']);\n Process::create(['id' => '1436', 'name' => 'Варка филе с кожей без костей', 'coldproc' => '30', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1064', 'is_default' => '0']);\n Process::create(['id' => '1437', 'name' => 'Жарка филе (по СТН) с кожей без костей', 'coldproc' => '30', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1064', 'is_default' => '0']);\n Process::create(['id' => '1438', 'name' => 'Жареный непластованный', 'coldproc' => '40', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1123', 'is_default' => '0']);\n Process::create(['id' => '1439', 'name' => 'Отварной филе с кожей и костями', 'coldproc' => '47', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1440', 'name' => 'Жареный филе с кожей и костями', 'coldproc' => '47', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1441', 'name' => 'Отварной филе с кожей без костей', 'coldproc' => '51', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1442', 'name' => 'Жареный филе с кожей без костей', 'coldproc' => '51', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '1']);\n Process::create(['id' => '1443', 'name' => 'Отварной филе с кожей и костями', 'coldproc' => '46', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1159', 'is_default' => '0']);\n Process::create(['id' => '1444', 'name' => 'Жареный филе с кожей и костями', 'coldproc' => '46', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1159', 'is_default' => '0']);\n Process::create(['id' => '1445', 'name' => 'Отварной филе с кожей без костей', 'coldproc' => '54', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1159', 'is_default' => '0']);\n Process::create(['id' => '1446', 'name' => 'Жареный филе с кожей без костей', 'coldproc' => '54', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1159', 'is_default' => '0']);\n Process::create(['id' => '1447', 'name' => 'Отварной с кожей и костями', 'coldproc' => '48', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1306', 'is_default' => '0']);\n Process::create(['id' => '1448', 'name' => 'Жареный с кожей и костями', 'coldproc' => '48', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1306', 'is_default' => '0']);\n Process::create(['id' => '1449', 'name' => 'Отварной с кожей без костей', 'coldproc' => '50', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1306', 'is_default' => '0']);\n Process::create(['id' => '1450', 'name' => 'Жареный с кожей без костей', 'coldproc' => '50', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1306', 'is_default' => '1']);\n Process::create(['id' => '1451', 'name' => 'Отварной с кожей и костями', 'coldproc' => '45', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1452', 'name' => 'Жареный с кожей и костями', 'coldproc' => '45', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1453', 'name' => 'Припущенный с кожей без костей', 'coldproc' => '49', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1454', 'name' => 'Жареный с кожей без костей', 'coldproc' => '49', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1455', 'name' => 'Припущенный без кожи и костей', 'coldproc' => '52', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1456', 'name' => 'Жареный без кожи и костей', 'coldproc' => '52', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1457', 'name' => 'Припущенный неглазированный льдом', 'coldproc' => '14', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1381', 'is_default' => '0']);\n Process::create(['id' => '1458', 'name' => 'Жареный неглазированный льдом', 'coldproc' => '14', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1381', 'is_default' => '1']);\n Process::create(['id' => '1459', 'name' => 'Отварная филе с кожей и костями', 'coldproc' => '49', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1368', 'is_default' => '0']);\n Process::create(['id' => '1460', 'name' => 'Жареная филе с кожей и костями', 'coldproc' => '49', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1368', 'is_default' => '0']);\n Process::create(['id' => '1461', 'name' => 'Припущенная филе с кожей без костей', 'coldproc' => '54', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1368', 'is_default' => '0']);\n Process::create(['id' => '1462', 'name' => 'Жареная филе с кожей без костей', 'coldproc' => '54', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1368', 'is_default' => '0']);\n Process::create(['id' => '1463', 'name' => 'Запеченный целиком', 'coldproc' => '5', 'hotproc' => '16', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1221', 'is_default' => '1']);\n Process::create(['id' => '1464', 'name' => 'Варка порционными кусками', 'coldproc' => '10', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1382', 'is_default' => '0']);\n Process::create(['id' => '1465', 'name' => 'Жарка порционными кусками', 'coldproc' => '0', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1382', 'is_default' => '1']);\n Process::create(['id' => '1466', 'name' => 'Отварной в кожуре с последующей очисткой', 'coldproc' => '0', 'hotproc' => '3', 'finalproc' => '35', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1467', 'name' => 'Жареный из предв. отваренного', 'coldproc' => '35', 'hotproc' => '21', 'finalproc' => '0', 'grease' => '10', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1468', 'name' => 'Жареный до полуготовности для рагу', 'coldproc' => '35', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '10', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1469', 'name' => 'Жареный фри брусочками', 'coldproc' => '35', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1470', 'name' => 'Жареный фри соломкой', 'coldproc' => '35', 'hotproc' => '60', 'finalproc' => '0', 'grease' => '10', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1471', 'name' => 'Жареный чипсами', 'coldproc' => '35', 'hotproc' => '66', 'finalproc' => '0', 'grease' => '10', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1472', 'name' => 'Печеный в кожуре', 'coldproc' => '0', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1473', 'name' => 'Печеный в кожуре с посл. очисткой', 'coldproc' => '0', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1474', 'name' => 'Молодой очищенный отварной', 'coldproc' => '20', 'hotproc' => '6', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1475', 'name' => 'Молодой неочищенный отварной', 'coldproc' => '5', 'hotproc' => '6', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1476', 'name' => 'Холодная обработка', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1383', 'is_default' => '1']);\n Process::create(['id' => '1477', 'name' => 'Жареные кружочками очищенные', 'coldproc' => '15', 'hotproc' => '26', 'finalproc' => '0', 'grease' => '10', 'ch' => '2', 'protein' => '5', 'product_id' => '1014', 'is_default' => '0']);\n Process::create(['id' => '1478', 'name' => 'Жареные в панировке', 'coldproc' => '5', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '2', 'protein' => '5', 'product_id' => '1014', 'is_default' => '1']);\n Process::create(['id' => '1479', 'name' => 'Жареные в панировке очищенные', 'coldproc' => '15', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '2', 'protein' => '5', 'product_id' => '1014', 'is_default' => '0']);\n Process::create(['id' => '1480', 'name' => 'варка', 'coldproc' => '0', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1070', 'is_default' => '1']);\n Process::create(['id' => '1481', 'name' => 'Очистка', 'coldproc' => '20', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1117', 'is_default' => '1']);\n Process::create(['id' => '1482', 'name' => 'Шинкованная, стертая с солью', 'coldproc' => '20', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1117', 'is_default' => '0']);\n Process::create(['id' => '1483', 'name' => 'Жаренные ломтиками с кожицей, панированные', 'coldproc' => '10', 'hotproc' => '33', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1112', 'is_default' => '0']);\n Process::create(['id' => '1484', 'name' => 'Жаренные без кожицы, панированные', 'coldproc' => '20', 'hotproc' => '33', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1112', 'is_default' => '0']);\n Process::create(['id' => '1485', 'name' => 'Очищенный', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1165', 'is_default' => '1']);\n Process::create(['id' => '1486', 'name' => 'Жаренный фри кольцами', 'coldproc' => '16', 'hotproc' => '66', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1165', 'is_default' => '0']);\n Process::create(['id' => '1487', 'name' => 'Очищенный', 'coldproc' => '20', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1163', 'is_default' => '1']);\n Process::create(['id' => '1488', 'name' => 'Очистка', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1196', 'is_default' => '0']);\n Process::create(['id' => '1489', 'name' => 'Без очистки', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1212', 'is_default' => '1']);\n Process::create(['id' => '1490', 'name' => 'С очисткой кожуры', 'coldproc' => '20', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1212', 'is_default' => '0']);\n Process::create(['id' => '1491', 'name' => 'Тепличные без очистки', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1212', 'is_default' => '0']);\n Process::create(['id' => '1492', 'name' => 'Без очистки', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1214', 'is_default' => '1']);\n Process::create(['id' => '1493', 'name' => 'С очисткой', 'coldproc' => '20', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1214', 'is_default' => '0']);\n Process::create(['id' => '1494', 'name' => 'Очистка', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1227', 'is_default' => '1']);\n Process::create(['id' => '1495', 'name' => 'Холодная обработка', 'coldproc' => '26', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1233', 'is_default' => '1']);\n Process::create(['id' => '1496', 'name' => 'Холодная обработка', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1332', 'is_default' => '1']);\n Process::create(['id' => '1497', 'name' => 'Холодная обработка', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1334', 'is_default' => '1']);\n Process::create(['id' => '1498', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1333', 'is_default' => '1']);\n Process::create(['id' => '1499', 'name' => 'Холодная обработка', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1258', 'is_default' => '1']);\n Process::create(['id' => '1500', 'name' => 'Очищенный от ботвы', 'coldproc' => '37', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1259', 'is_default' => '0']);\n Process::create(['id' => '1501', 'name' => 'Очищенный от короткой ботвы (до 3см) с кожицей', 'coldproc' => '7', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1259', 'is_default' => '1']);\n Process::create(['id' => '1502', 'name' => 'Без ботвы, очищенный от кожицы', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1259', 'is_default' => '0']);\n Process::create(['id' => '1504', 'name' => 'Очистка', 'coldproc' => '30', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1260', 'is_default' => '1']);\n Process::create(['id' => '1505', 'name' => 'Листовой холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1271', 'is_default' => '1']);\n Process::create(['id' => '1506', 'name' => 'Кочанный холодная обработка', 'coldproc' => '33', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1271', 'is_default' => '0']);\n Process::create(['id' => '1507', 'name' => 'Холодная обработка', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1284', 'is_default' => '1']);\n Process::create(['id' => '1508', 'name' => 'Холодная обработка', 'coldproc' => '26', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1339', 'is_default' => '1']);\n Process::create(['id' => '1509', 'name' => 'Очистка', 'coldproc' => '36', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1348', 'is_default' => '1']);\n Process::create(['id' => '1510', 'name' => 'Очистка', 'coldproc' => '22', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1355', 'is_default' => '1']);\n Process::create(['id' => '1512', 'name' => 'Сырые для салата', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1357', 'is_default' => '0']);\n Process::create(['id' => '1513', 'name' => 'Удаление косточки', 'coldproc' => '14', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1001', 'is_default' => '1']);\n Process::create(['id' => '1514', 'name' => 'Удаление косточки', 'coldproc' => '14', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1007', 'is_default' => '1']);\n Process::create(['id' => '1515', 'name' => 'Очищенный с сердцевиной', 'coldproc' => '40', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1008', 'is_default' => '1']);\n Process::create(['id' => '1516', 'name' => 'Очищенный без сердцевины', 'coldproc' => '45', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1008', 'is_default' => '0']);\n Process::create(['id' => '1517', 'name' => 'Очищенный от кожуры', 'coldproc' => '33', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1010', 'is_default' => '0']);\n Process::create(['id' => '1518', 'name' => 'Получение сока', 'coldproc' => '56', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1010', 'is_default' => '0']);\n Process::create(['id' => '1519', 'name' => 'Нарезанный на порции', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1013', 'is_default' => '1']);\n Process::create(['id' => '1520', 'name' => 'Очищенный от коры и семян', 'coldproc' => '48', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1013', 'is_default' => '0']);\n Process::create(['id' => '1521', 'name' => 'Удаление семян', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1004', 'is_default' => '1']);\n Process::create(['id' => '1522', 'name' => 'Очистка от кожицы с удалением семян', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1004', 'is_default' => '0']);\n Process::create(['id' => '1523', 'name' => 'Очистка от кожуры', 'coldproc' => '40', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1017', 'is_default' => '1']);\n Process::create(['id' => '1524', 'name' => 'Свежая, холодная обработка', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1030', 'is_default' => '1']);\n Process::create(['id' => '1526', 'name' => 'Потери на горбыльки', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1046', 'is_default' => '1']);\n Process::create(['id' => '1527', 'name' => 'Получение сока (по СТН)', 'coldproc' => '22', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1046', 'is_default' => '0']);\n Process::create(['id' => '1528', 'name' => 'Переборка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1048', 'is_default' => '1']);\n Process::create(['id' => '1529', 'name' => 'Удаление плодоножки', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1050', 'is_default' => '0']);\n Process::create(['id' => '1530', 'name' => 'Удаление косточки', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1050', 'is_default' => '1']);\n Process::create(['id' => '1531', 'name' => 'Очистка', 'coldproc' => '40', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1071', 'is_default' => '1']);\n Process::create(['id' => '1532', 'name' => 'Удаление семян', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1080', 'is_default' => '1']);\n Process::create(['id' => '1533', 'name' => 'Удаление семян и кожицы', 'coldproc' => '27', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1080', 'is_default' => '0']);\n Process::create(['id' => '1534', 'name' => 'Варка с удалением семян', 'coldproc' => '10', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1080', 'is_default' => '0']);\n Process::create(['id' => '1535', 'name' => 'Варка с удалением семян и кожицы', 'coldproc' => '27', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1080', 'is_default' => '0']);\n Process::create(['id' => '1536', 'name' => 'Очистка от семян', 'coldproc' => '23', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1089', 'is_default' => '0']);\n Process::create(['id' => '1537', 'name' => 'Очистка от коры и семян', 'coldproc' => '36', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1089', 'is_default' => '1']);\n Process::create(['id' => '1538', 'name' => 'Холодная обработка', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1090', 'is_default' => '1']);\n Process::create(['id' => '1539', 'name' => 'Холодная обработка', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1097', 'is_default' => '1']);\n Process::create(['id' => '1540', 'name' => 'Сок с мякотью', 'coldproc' => '21', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1097', 'is_default' => '0']);\n Process::create(['id' => '1541', 'name' => 'Холодная обработка', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1132', 'is_default' => '1']);\n Process::create(['id' => '1542', 'name' => 'Получение сока', 'coldproc' => '32', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1132', 'is_default' => '0']);\n Process::create(['id' => '1543', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1151', 'is_default' => '1']);\n Process::create(['id' => '1544', 'name' => 'Очистка оснований', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1160', 'is_default' => '1']);\n Process::create(['id' => '1545', 'name' => 'Очистка от кожуры', 'coldproc' => '39', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1160', 'is_default' => '0']);\n Process::create(['id' => '1546', 'name' => 'Получение сока', 'coldproc' => '58', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1160', 'is_default' => '0']);\n Process::create(['id' => '1547', 'name' => 'Холодная обработка', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1170', 'is_default' => '1']);\n Process::create(['id' => '1549', 'name' => 'Очищенные', 'coldproc' => '26', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1171', 'is_default' => '1']);\n Process::create(['id' => '1550', 'name' => 'Получение сока', 'coldproc' => '43', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1171', 'is_default' => '0']);\n Process::create(['id' => '1551', 'name' => 'Удаление косточки', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1231', 'is_default' => '1']);\n Process::create(['id' => '1552', 'name' => 'Удаление косточки', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1289', 'is_default' => '1']);\n Process::create(['id' => '1553', 'name' => 'Холодная обработка', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1302', 'is_default' => '1']);\n Process::create(['id' => '1554', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1303', 'is_default' => '1']);\n Process::create(['id' => '1555', 'name' => 'Получение сока', 'coldproc' => '21', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1303', 'is_default' => '0']);\n Process::create(['id' => '1556', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1353', 'is_default' => '1']);\n Process::create(['id' => '1557', 'name' => 'Получение сока', 'coldproc' => '41', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1353', 'is_default' => '0']);\n Process::create(['id' => '1558', 'name' => 'Удаление плодоножки', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1352', 'is_default' => '0']);\n Process::create(['id' => '1559', 'name' => 'Удаление косточки', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1352', 'is_default' => '1']);\n Process::create(['id' => '1560', 'name' => 'Запекание с очисткой от кожицы и уд. семян', 'coldproc' => '30', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1369', 'is_default' => '0']);\n Process::create(['id' => '1561', 'name' => 'Очистка от кожицы и семян', 'coldproc' => '30', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1369', 'is_default' => '0']);\n Process::create(['id' => '1562', 'name' => 'Очистка от семян', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1369', 'is_default' => '1']);\n Process::create(['id' => '1563', 'name' => 'Очистка от скорлупы', 'coldproc' => '63', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1386', 'is_default' => '1']);\n Process::create(['id' => '1564', 'name' => 'Филе без кожи и костей', 'coldproc' => '31', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1066', 'is_default' => '1']);\n Process::create(['id' => '1565', 'name' => 'Филе с кожей и костями', 'coldproc' => '20', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1066', 'is_default' => '0']);\n Process::create(['id' => '1566', 'name' => 'Разделка на филе', 'coldproc' => '50', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1270', 'is_default' => '1']);\n Process::create(['id' => '1567', 'name' => 'Неразделанная', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1270', 'is_default' => '0']);\n Process::create(['id' => '1568', 'name' => 'Крупная разделка на филе', 'coldproc' => '50', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1286', 'is_default' => '1']);\n Process::create(['id' => '1569', 'name' => 'Средняя разделка на филе', 'coldproc' => '52', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1286', 'is_default' => '0']);\n Process::create(['id' => '1570', 'name' => 'Крупная без кожи с костями', 'coldproc' => '38', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1286', 'is_default' => '0']);\n Process::create(['id' => '1571', 'name' => 'Средняя без кожи с костями', 'coldproc' => '40', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1286', 'is_default' => '0']);\n Process::create(['id' => '1572', 'name' => 'Разделка на филе с костями и икрой', 'coldproc' => '47', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1051', 'is_default' => '1']);\n Process::create(['id' => '1573', 'name' => 'Разделка на филе без кожи с костями (Крупный)', 'coldproc' => '46', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1158', 'is_default' => '1']);\n Process::create(['id' => '1574', 'name' => 'Разделка на филе без кожи с костями (Средний)', 'coldproc' => '48', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1158', 'is_default' => '0']);\n Process::create(['id' => '1575', 'name' => 'Разделка на филе без кожи с костями (Мелкий)', 'coldproc' => '50', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1158', 'is_default' => '0']);\n Process::create(['id' => '1576', 'name' => 'Разделка без кожи с костями', 'coldproc' => '13', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1288', 'is_default' => '1']);\n Process::create(['id' => '1577', 'name' => 'Разделка на филе без кожи и костей', 'coldproc' => '26', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1288', 'is_default' => '0']);\n Process::create(['id' => '1578', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1033', 'is_default' => '1']);\n Process::create(['id' => '1579', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1034', 'is_default' => '1']);\n Process::create(['id' => '1580', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1035', 'is_default' => '1']);\n Process::create(['id' => '1581', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1036', 'is_default' => '1']);\n Process::create(['id' => '1582', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1249', 'is_default' => '1']);\n Process::create(['id' => '1583', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1250', 'is_default' => '0']);\n Process::create(['id' => '1584', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1317', 'is_default' => '1']);\n Process::create(['id' => '1585', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1318', 'is_default' => '1']);\n Process::create(['id' => '1586', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1387', 'is_default' => '1']);\n Process::create(['id' => '1587', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1363', 'is_default' => '1']);\n Process::create(['id' => '1588', 'name' => 'Без тепловой обработки', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1076', 'is_default' => '0']);\n Process::create(['id' => '1589', 'name' => 'Без тепловой обработки', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1139', 'is_default' => '0']);\n Process::create(['id' => '1590', 'name' => 'Холодная обработка', 'coldproc' => '8', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1319', 'is_default' => '1']);\n Process::create(['id' => '1591', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1320', 'is_default' => '1']);\n Process::create(['id' => '1592', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1240', 'is_default' => '1']);\n Process::create(['id' => '1594', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1321', 'is_default' => '1']);\n Process::create(['id' => '1595', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1256', 'is_default' => '1']);\n Process::create(['id' => '1596', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1257', 'is_default' => '1']);\n Process::create(['id' => '1597', 'name' => 'Запекание', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1256', 'is_default' => '0']);\n Process::create(['id' => '1598', 'name' => 'Запекание', 'coldproc' => '4', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1257', 'is_default' => '0']);\n Process::create(['id' => '1599', 'name' => 'Без обработки или варка в скорлупе', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1378', 'is_default' => '1']);\n Process::create(['id' => '1600', 'name' => 'Жарка (Глазунья)', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1378', 'is_default' => '0']);\n Process::create(['id' => '1601', 'name' => 'Жарка (Омлет)', 'coldproc' => '0', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1378', 'is_default' => '0']);\n Process::create(['id' => '1602', 'name' => 'Варка без скорлупы', 'coldproc' => '0', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1378', 'is_default' => '0']);\n Process::create(['id' => '1603', 'name' => 'Без обработки', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1379', 'is_default' => '1']);\n Process::create(['id' => '1604', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1379', 'is_default' => '0']);\n Process::create(['id' => '1605', 'name' => 'Варка без скорлупы', 'coldproc' => '0', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1379', 'is_default' => '0']);\n Process::create(['id' => '1606', 'name' => 'Удаление скорлупы', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1378', 'is_default' => '0']);\n Process::create(['id' => '1607', 'name' => 'Очистка от кожуры и косточки', 'coldproc' => '47', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1388', 'is_default' => '1']);\n Process::create(['id' => '1608', 'name' => 'Без тепловой обработки', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1391', 'is_default' => '1']);\n Process::create(['id' => '1609', 'name' => 'Обжарка', 'coldproc' => '3', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1391', 'is_default' => '0']);\n Process::create(['id' => '1610', 'name' => 'Мини - ананас, выход мякоти', 'coldproc' => '78', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1008', 'is_default' => '0']);\n Process::create(['id' => '1611', 'name' => 'Удаление кожи и костей', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1392', 'is_default' => '1']);\n Process::create(['id' => '1612', 'name' => 'Удаление кожи и хрящей', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1016', 'is_default' => '1']);\n Process::create(['id' => '1613', 'name' => 'Удаление кожи и костей', 'coldproc' => '19', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1393', 'is_default' => '1']);\n Process::create(['id' => '1614', 'name' => 'Удаление кожи и костей', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1394', 'is_default' => '1']);\n Process::create(['id' => '1615', 'name' => 'Удаление кожи и костей', 'coldproc' => '17', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1395', 'is_default' => '1']);\n Process::create(['id' => '1616', 'name' => 'Жарка', 'coldproc' => '18', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1396', 'is_default' => '1']);\n Process::create(['id' => '1617', 'name' => 'Запекание с удалением кости', 'coldproc' => '34', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1397', 'is_default' => '1']);\n Process::create(['id' => '1618', 'name' => 'Запекание с костью', 'coldproc' => '5', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1397', 'is_default' => '0']);\n Process::create(['id' => '1619', 'name' => 'Жарка (Россия)', 'coldproc' => '35', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1018', 'is_default' => '0']);\n Process::create(['id' => '1620', 'name' => 'Жарка в сухарях (Россия)', 'coldproc' => '35', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1018', 'is_default' => '0']);\n Process::create(['id' => '1621', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1398', 'is_default' => '1']);\n Process::create(['id' => '1622', 'name' => 'Запекание для сухариков (кубик)', 'coldproc' => '7', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1022', 'is_default' => '0']);\n Process::create(['id' => '1623', 'name' => 'Без обработки', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1022', 'is_default' => '1']);\n Process::create(['id' => '1625', 'name' => 'Удаление мякоти', 'coldproc' => '54', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1031', 'is_default' => '0']);\n Process::create(['id' => '1626', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1045', 'is_default' => '1']);\n Process::create(['id' => '1627', 'name' => 'Удаление шкуры и жира', 'coldproc' => '22', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1407', 'is_default' => '1']);\n Process::create(['id' => '1628', 'name' => 'Выпаривание', 'coldproc' => '0', 'hotproc' => '66', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1408', 'is_default' => '0']);\n Process::create(['id' => '1629', 'name' => 'Выпаривание для соуса', 'coldproc' => '0', 'hotproc' => '66', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1409', 'is_default' => '0']);\n Process::create(['id' => '1630', 'name' => 'Холодная обработка', 'coldproc' => '7', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1411', 'is_default' => '1']);\n Process::create(['id' => '1631', 'name' => 'Получение сока (контрольная проработка)', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '31', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1046', 'is_default' => '0']);\n Process::create(['id' => '1632', 'name' => 'Потери при варке', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1052', 'is_default' => '1']);\n Process::create(['id' => '1633', 'name' => 'Потери при разморозке и порционировании', 'coldproc' => '11', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1417', 'is_default' => '1']);\n Process::create(['id' => '1634', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1418', 'is_default' => '1']);\n Process::create(['id' => '1635', 'name' => 'Жарка стейка (Well Done)', 'coldproc' => '7', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1419', 'is_default' => '1']);\n Process::create(['id' => '1636', 'name' => 'Холодная обработка (Карпаччо)', 'coldproc' => '7', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1637', 'name' => 'На кости з/т часть - жарка, удаление кости', 'coldproc' => '22', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1638', 'name' => 'На кости з/т часть - варка, удаление кости', 'coldproc' => '22', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1639', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1420', 'is_default' => '1']);\n Process::create(['id' => '1640', 'name' => 'Жарка филе (по Контр.) с уд. костей', 'coldproc' => '58', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1064', 'is_default' => '1']);\n Process::create(['id' => '1641', 'name' => 'Холодная обработка', 'coldproc' => '17', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1422', 'is_default' => '1']);\n Process::create(['id' => '1642', 'name' => 'Получение сока', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '48', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1073', 'is_default' => '1']);\n Process::create(['id' => '1643', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '20', 'protein' => '5', 'product_id' => '1423', 'is_default' => '1']);\n Process::create(['id' => '1644', 'name' => 'Жарка', 'coldproc' => '15', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1424', 'is_default' => '1']);\n Process::create(['id' => '1645', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '20', 'protein' => '5', 'product_id' => '1425', 'is_default' => '1']);\n Process::create(['id' => '1646', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '20', 'protein' => '5', 'product_id' => '1426', 'is_default' => '1']);\n Process::create(['id' => '1647', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '20', 'protein' => '5', 'product_id' => '1427', 'is_default' => '1']);\n Process::create(['id' => '1648', 'name' => 'Жарка дольками (Контр. прораб.)', 'coldproc' => '0', 'hotproc' => '39', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1357', 'is_default' => '0']);\n Process::create(['id' => '1649', 'name' => 'Жарка Фри тонкими ломтиками', 'coldproc' => '4', 'hotproc' => '60', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1076', 'is_default' => '0']);\n Process::create(['id' => '1650', 'name' => 'Жарка Фри (ломтиками)', 'coldproc' => '0', 'hotproc' => '62', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1139', 'is_default' => '0']);\n Process::create(['id' => '1651', 'name' => 'Запекание в соли с головой и хребтом', 'coldproc' => '24', 'hotproc' => '15', 'finalproc' => '9', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1429', 'is_default' => '1']);\n Process::create(['id' => '1652', 'name' => 'Жарка, запекание в составе блюда', 'coldproc' => '29', 'hotproc' => '55', 'finalproc' => '0', 'grease' => '53', 'ch' => '0', 'protein' => '10', 'product_id' => '1431', 'is_default' => '1']);\n Process::create(['id' => '1653', 'name' => 'Холодная обработка', 'coldproc' => '27', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1432', 'is_default' => '1']);\n Process::create(['id' => '1654', 'name' => 'Холодная обработка', 'coldproc' => '13', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1433', 'is_default' => '1']);\n Process::create(['id' => '1655', 'name' => 'Холодная обработка', 'coldproc' => '32', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1434', 'is_default' => '1']);\n Process::create(['id' => '1656', 'name' => 'Холодная обработка', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1435', 'is_default' => '1']);\n Process::create(['id' => '1657', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1438', 'is_default' => '1']);\n Process::create(['id' => '1658', 'name' => 'Жарка', 'coldproc' => '4', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1441', 'is_default' => '1']);\n Process::create(['id' => '1659', 'name' => 'Холодная обработка для суши', 'coldproc' => '20', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1442', 'is_default' => '1']);\n Process::create(['id' => '1660', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '15', 'protein' => '5', 'product_id' => '1443', 'is_default' => '1']);\n Process::create(['id' => '1661', 'name' => 'Удаление основания', 'coldproc' => '17', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1444', 'is_default' => '1']);\n Process::create(['id' => '1662', 'name' => 'Удаление всей жесткой части', 'coldproc' => '59', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1444', 'is_default' => '0']);\n Process::create(['id' => '1663', 'name' => 'Жарка фри', 'coldproc' => '0', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1445', 'is_default' => '1']);\n Process::create(['id' => '1664', 'name' => 'Молодой неочищенный жареный дольками', 'coldproc' => '5', 'hotproc' => '34', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1665', 'name' => 'Жарка глазированного льдом', 'coldproc' => '18', 'hotproc' => '21', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1447', 'is_default' => '1']);\n Process::create(['id' => '1666', 'name' => 'Очистка', 'coldproc' => '21', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1448', 'is_default' => '1']);\n Process::create(['id' => '1667', 'name' => 'Получение сока', 'coldproc' => '21', 'hotproc' => '0', 'finalproc' => '46', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1448', 'is_default' => '0']);\n Process::create(['id' => '1668', 'name' => 'Нарезка шариками', 'coldproc' => '60', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1448', 'is_default' => '0']);\n Process::create(['id' => '1669', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1452', 'is_default' => '1']);\n Process::create(['id' => '1670', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1454', 'is_default' => '1']);\n Process::create(['id' => '1671', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '15', 'protein' => '5', 'product_id' => '1455', 'is_default' => '1']);\n Process::create(['id' => '1672', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '52', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1203', 'is_default' => '1']);\n Process::create(['id' => '1673', 'name' => 'Варка с разделкой на мякоть', 'coldproc' => '0', 'hotproc' => '52', 'finalproc' => '51', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1203', 'is_default' => '0']);\n Process::create(['id' => '1674', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '57', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1458', 'is_default' => '1']);\n Process::create(['id' => '1675', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '40', 'finalproc' => '10', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1459', 'is_default' => '1']);\n Process::create(['id' => '1676', 'name' => 'Жарка мякоти', 'coldproc' => '10', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1148', 'is_default' => '0']);\n Process::create(['id' => '1677', 'name' => 'Жарка', 'coldproc' => '31', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1460', 'is_default' => '1']);\n Process::create(['id' => '1678', 'name' => 'Жарка из свежемороженных', 'coldproc' => '25', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1461', 'is_default' => '0']);\n Process::create(['id' => '1679', 'name' => 'Жарка из охлажденных', 'coldproc' => '12', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1461', 'is_default' => '1']);\n Process::create(['id' => '1680', 'name' => 'Жарка из охл. с предв. запеканием', 'coldproc' => '12', 'hotproc' => '12', 'finalproc' => '31', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1461', 'is_default' => '0']);\n Process::create(['id' => '1681', 'name' => 'Варка в пароконвектомате', 'coldproc' => '6', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1345', 'is_default' => '0']);\n Process::create(['id' => '1682', 'name' => 'Варка', 'coldproc' => '41', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1463', 'is_default' => '1']);\n Process::create(['id' => '1683', 'name' => 'Варка в пароконвектомате', 'coldproc' => '41', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1463', 'is_default' => '0']);\n Process::create(['id' => '1684', 'name' => 'Разделка на мякоть с кожей и запекание', 'coldproc' => '47', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1154', 'is_default' => '0']);\n Process::create(['id' => '1685', 'name' => 'Обработка для суши', 'coldproc' => '14', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1464', 'is_default' => '1']);\n Process::create(['id' => '1686', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '43', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1465', 'is_default' => '1']);\n Process::create(['id' => '1687', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1466', 'is_default' => '1']);\n Process::create(['id' => '1688', 'name' => 'Жарка фри', 'coldproc' => '0', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1466', 'is_default' => '0']);\n Process::create(['id' => '1689', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1467', 'is_default' => '1']);\n Process::create(['id' => '1691', 'name' => 'Варка \"Аль денте\"', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1169', 'is_default' => '1']);\n Process::create(['id' => '1692', 'name' => 'Варка Аль денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1477', 'is_default' => '1']);\n Process::create(['id' => '1693', 'name' => 'Варка Аль денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1478', 'is_default' => '1']);\n Process::create(['id' => '1694', 'name' => 'Варка Аль денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1479', 'is_default' => '1']);\n Process::create(['id' => '1695', 'name' => 'Варка Аль денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1480', 'is_default' => '1']);\n Process::create(['id' => '1696', 'name' => 'Варка Аль Денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1481', 'is_default' => '1']);\n Process::create(['id' => '1697', 'name' => 'Варка Аль денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1482', 'is_default' => '1']);\n Process::create(['id' => '1698', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1495', 'is_default' => '1']);\n Process::create(['id' => '1699', 'name' => 'Получение сока', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '57', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1196', 'is_default' => '0']);\n Process::create(['id' => '1700', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '26', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1498', 'is_default' => '1']);\n Process::create(['id' => '1701', 'name' => 'Жарка фарша с холодной обработкой', 'coldproc' => '26', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1702', 'name' => 'Жарка', 'coldproc' => '24', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1504', 'is_default' => '1']);\n Process::create(['id' => '1703', 'name' => 'Варка (% по белым грибам)', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '20', 'protein' => '5', 'product_id' => '1426', 'is_default' => '0']);\n Process::create(['id' => '1704', 'name' => 'Потери при хранении', 'coldproc' => '1', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1327', 'is_default' => '1']);\n Process::create(['id' => '1705', 'name' => 'Потери при переборке', 'coldproc' => '1', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1002', 'is_default' => '1']);\n Process::create(['id' => '1706', 'name' => 'Варка (по контрольной проработке)', 'coldproc' => '0', 'hotproc' => '33', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1059', 'is_default' => '0']);\n Process::create(['id' => '1707', 'name' => 'Варка', 'coldproc' => '4', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '20', 'protein' => '5', 'product_id' => '1424', 'is_default' => '0']);\n Process::create(['id' => '1708', 'name' => 'Замачивание в кипятке (контрольная)', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1290', 'is_default' => '1']);\n Process::create(['id' => '1709', 'name' => 'потери при порцион. (Контрольная)', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1521', 'is_default' => '1']);\n Process::create(['id' => '1710', 'name' => 'Обжарка (Контрольная прораб.)', 'coldproc' => '11', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '1372', 'is_default' => '1']);\n Process::create(['id' => '1711', 'name' => 'Обжарка (контрольная)', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1526', 'is_default' => '1']);\n Process::create(['id' => '1712', 'name' => 'Замачивание кипятком', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1002', 'is_default' => '0']);\n Process::create(['id' => '1713', 'name' => 'Переборка (Контрольная проработка)', 'coldproc' => '1', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1290', 'is_default' => '0']);\n Process::create(['id' => '1714', 'name' => 'Жарка охлажденных', 'coldproc' => '0', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1345', 'is_default' => '0']);\n Process::create(['id' => '1715', 'name' => 'Жарка из сырых (Контрольная по ТУ)', 'coldproc' => '24', 'hotproc' => '51', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1357', 'is_default' => '0']);\n Process::create(['id' => '1716', 'name' => 'Жарка', 'coldproc' => '20', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1530', 'is_default' => '1']);\n Process::create(['id' => '1717', 'name' => 'Жарка глазированного льдом', 'coldproc' => '41', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1531', 'is_default' => '1']);\n Process::create(['id' => '1718', 'name' => 'Жарка глазированного льдом', 'coldproc' => '35', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1532', 'is_default' => '1']);\n Process::create(['id' => '1719', 'name' => 'Холодная обработка', 'coldproc' => '26', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1534', 'is_default' => '1']);\n Process::create(['id' => '1720', 'name' => 'Получение сока', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '25', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1212', 'is_default' => '0']);\n Process::create(['id' => '1721', 'name' => 'Варка с разделкой на мякоть из с/м', 'coldproc' => '43', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1215', 'is_default' => '0']);\n Process::create(['id' => '1722', 'name' => 'Жарка с разделкой на мякоть из с/м', 'coldproc' => '43', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1215', 'is_default' => '0']);\n Process::create(['id' => '1723', 'name' => 'Жарка глазированного льдом', 'coldproc' => '24', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1223', 'is_default' => '1']);\n Process::create(['id' => '1724', 'name' => 'Припускание глазированного льдом', 'coldproc' => '24', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1223', 'is_default' => '0']);\n Process::create(['id' => '1725', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1537', 'is_default' => '1']);\n Process::create(['id' => '1726', 'name' => 'Холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1536', 'is_default' => '1']);\n Process::create(['id' => '1727', 'name' => 'Получение сока', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '34', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1231', 'is_default' => '0']);\n Process::create(['id' => '1728', 'name' => 'Жарка фри', 'coldproc' => '0', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1538', 'is_default' => '1']);\n Process::create(['id' => '1729', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1540', 'is_default' => '1']);\n Process::create(['id' => '1730', 'name' => 'Варка с разделкой на мякоть', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '89', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1540', 'is_default' => '0']);\n Process::create(['id' => '1731', 'name' => 'Обжарка', 'coldproc' => '0', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1541', 'is_default' => '1']);\n Process::create(['id' => '1732', 'name' => 'Варка со сливом (Контрольная прораб.)', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1263', 'is_default' => '0']);\n Process::create(['id' => '1734', 'name' => 'Варка со сливом (по Контрольной прораб.)', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1264', 'is_default' => '0']);\n Process::create(['id' => '1735', 'name' => 'Варка для суши', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1542', 'is_default' => '1']);\n Process::create(['id' => '1736', 'name' => 'Разделка на филе с кожей и костями', 'coldproc' => '35', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1158', 'is_default' => '0']);\n Process::create(['id' => '1737', 'name' => 'Холодная обработка', 'coldproc' => '17', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1543', 'is_default' => '1']);\n Process::create(['id' => '1738', 'name' => 'Жарка', 'coldproc' => '20', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1546', 'is_default' => '1']);\n Process::create(['id' => '1739', 'name' => 'Тушение', 'coldproc' => '20', 'hotproc' => '33', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1546', 'is_default' => '0']);\n Process::create(['id' => '1740', 'name' => 'Удаление кости, запекание с предв. варкой', 'coldproc' => '40', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1547', 'is_default' => '1']);\n Process::create(['id' => '1741', 'name' => 'Запекание с предв. варкой на кости', 'coldproc' => '5', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1547', 'is_default' => '0']);\n Process::create(['id' => '1742', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1548', 'is_default' => '1']);\n Process::create(['id' => '1743', 'name' => 'Жарка чипсами', 'coldproc' => '32', 'hotproc' => '75', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1285', 'is_default' => '0']);\n Process::create(['id' => '1744', 'name' => 'Получение сока (из стеблей)', 'coldproc' => '44', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1284', 'is_default' => '0']);\n Process::create(['id' => '1745', 'name' => 'Филе в масле дозачистка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1286', 'is_default' => '0']);\n Process::create(['id' => '1746', 'name' => 'Удаление кожи и костей', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1549', 'is_default' => '1']);\n Process::create(['id' => '1747', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1550', 'is_default' => '1']);\n Process::create(['id' => '1748', 'name' => 'Жарка филе с кожей без костей', 'coldproc' => '37', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1551', 'is_default' => '1']);\n Process::create(['id' => '1749', 'name' => 'Разделка для суши, роллов', 'coldproc' => '44', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1551', 'is_default' => '0']);\n Process::create(['id' => '1750', 'name' => 'Запекание целиком', 'coldproc' => '14', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1551', 'is_default' => '0']);\n Process::create(['id' => '1751', 'name' => 'Приготовление на пару', 'coldproc' => '18', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1552', 'is_default' => '1']);\n Process::create(['id' => '1752', 'name' => 'Уваривание в соусе', 'coldproc' => '0', 'hotproc' => '66', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1556', 'is_default' => '1']);\n Process::create(['id' => '1753', 'name' => 'Потери при варке', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '5', 'product_id' => '1556', 'is_default' => '0']);\n Process::create(['id' => '1754', 'name' => 'Уваривание для соуса', 'coldproc' => '0', 'hotproc' => '66', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1291', 'is_default' => '0']);\n Process::create(['id' => '1755', 'name' => 'Уваривание для соуса', 'coldproc' => '0', 'hotproc' => '66', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1293', 'is_default' => '0']);\n Process::create(['id' => '1756', 'name' => 'жарка', 'coldproc' => '0', 'hotproc' => '29', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1557', 'is_default' => '1']);\n Process::create(['id' => '1757', 'name' => 'Выпаривание для фруктового соуса', 'coldproc' => '0', 'hotproc' => '90', 'finalproc' => '0', 'grease' => '2', 'ch' => '2', 'protein' => '2', 'product_id' => '1000', 'is_default' => '0']);\n Process::create(['id' => '1758', 'name' => 'Выпаривание для фруктового соуса', 'coldproc' => '0', 'hotproc' => '90', 'finalproc' => '0', 'grease' => '2', 'ch' => '2', 'protein' => '2', 'product_id' => '1011', 'is_default' => '0']);\n Process::create(['id' => '1759', 'name' => 'Выпаривание для фруктового соуса', 'coldproc' => '0', 'hotproc' => '85', 'finalproc' => '0', 'grease' => '2', 'ch' => '2', 'protein' => '2', 'product_id' => '1232', 'is_default' => '0']);\n Process::create(['id' => '1760', 'name' => 'Выпаривание для фруктового соуса', 'coldproc' => '0', 'hotproc' => '85', 'finalproc' => '0', 'grease' => '2', 'ch' => '2', 'protein' => '2', 'product_id' => '1295', 'is_default' => '0']);\n Process::create(['id' => '1761', 'name' => 'Припускание свежемороженой зеленой', 'coldproc' => '3', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '2', 'product_id' => '1310', 'is_default' => '0']);\n Process::create(['id' => '1762', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '15', 'protein' => '5', 'product_id' => '1568', 'is_default' => '1']);\n Process::create(['id' => '1763', 'name' => 'Припущенный глазированный льдом', 'coldproc' => '27', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1381', 'is_default' => '0']);\n Process::create(['id' => '1764', 'name' => 'Жареный глазированный льдом', 'coldproc' => '27', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1381', 'is_default' => '0']);\n Process::create(['id' => '1765', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1595', 'is_default' => '1']);\n Process::create(['id' => '1766', 'name' => 'Холодная обработка', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1596', 'is_default' => '1']);\n Process::create(['id' => '1767', 'name' => 'Холодная обработка', 'coldproc' => '17', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1597', 'is_default' => '1']);\n Process::create(['id' => '1768', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1598', 'is_default' => '1']);\n Process::create(['id' => '1769', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1599', 'is_default' => '1']);\n Process::create(['id' => '1770', 'name' => 'Холодная обработка', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1600', 'is_default' => '1']);\n Process::create(['id' => '1771', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1601', 'is_default' => '1']);\n Process::create(['id' => '1772', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1602', 'is_default' => '1']);\n Process::create(['id' => '1773', 'name' => 'Потери при порционировании', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1603', 'is_default' => '1']);\n Process::create(['id' => '1774', 'name' => 'Холодная обработка', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1604', 'is_default' => '1']);\n Process::create(['id' => '1775', 'name' => 'Потери при порционировании', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1605', 'is_default' => '1']);\n Process::create(['id' => '1776', 'name' => 'Потери при порционировании', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1606', 'is_default' => '1']);\n Process::create(['id' => '1777', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1607', 'is_default' => '0']);\n Process::create(['id' => '1778', 'name' => 'Запекание', 'coldproc' => '4', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '5', 'ch' => '5', 'protein' => '5', 'product_id' => '1607', 'is_default' => '1']);\n Process::create(['id' => '1779', 'name' => 'Холодная обработка', 'coldproc' => '18', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1608', 'is_default' => '1']);\n Process::create(['id' => '1781', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1322', 'is_default' => '1']);\n Process::create(['id' => '1782', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1609', 'is_default' => '1']);\n Process::create(['id' => '1783', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1610', 'is_default' => '1']);\n Process::create(['id' => '1784', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1612', 'is_default' => '1']);\n Process::create(['id' => '1785', 'name' => 'Потери при порционировании', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1613', 'is_default' => '1']);\n Process::create(['id' => '1786', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1324', 'is_default' => '1']);\n Process::create(['id' => '1787', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1239', 'is_default' => '1']);\n Process::create(['id' => '1788', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1202', 'is_default' => '1']);\n Process::create(['id' => '1789', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1323', 'is_default' => '1']);\n Process::create(['id' => '1791', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1614', 'is_default' => '1']);\n Process::create(['id' => '1792', 'name' => 'Запекание', 'coldproc' => '5', 'hotproc' => '7', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1615', 'is_default' => '1']);\n Process::create(['id' => '1793', 'name' => 'Жарка (глазированного льдом)', 'coldproc' => '39', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1616', 'is_default' => '1']);\n Process::create(['id' => '1794', 'name' => 'Жарка филе с кожей без костей', 'coldproc' => '54', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1617', 'is_default' => '1']);\n Process::create(['id' => '1795', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1618', 'is_default' => '1']);\n Process::create(['id' => '1796', 'name' => 'Запекание', 'coldproc' => '3', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1618', 'is_default' => '0']);\n Process::create(['id' => '1797', 'name' => 'Потери при порционировании', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1335', 'is_default' => '1']);\n Process::create(['id' => '1798', 'name' => 'Обработка для суши', 'coldproc' => '14', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1336', 'is_default' => '1']);\n Process::create(['id' => '1799', 'name' => 'Обработка для суши, роллов', 'coldproc' => '13', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1629', 'is_default' => '1']);\n Process::create(['id' => '1800', 'name' => 'Без обработки', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1631', 'is_default' => '1']);\n Process::create(['id' => '1801', 'name' => 'Выпаривание для декорирования', 'coldproc' => '0', 'hotproc' => '75', 'finalproc' => '0', 'grease' => '2', 'ch' => '2', 'protein' => '2', 'product_id' => '1631', 'is_default' => '0']);\n Process::create(['id' => '1802', 'name' => 'Жарка (Магре, Франция)', 'coldproc' => '4', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1632', 'is_default' => '1']);\n Process::create(['id' => '1803', 'name' => 'Жарка (Китай)', 'coldproc' => '0', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1632', 'is_default' => '0']);\n Process::create(['id' => '1804', 'name' => 'Припускание свежемороженой', 'coldproc' => '3', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '10', 'ch' => '2', 'protein' => '2', 'product_id' => '1342', 'is_default' => '0']);\n Process::create(['id' => '1805', 'name' => 'Варка на пару', 'coldproc' => '31', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '20', 'protein' => '5', 'product_id' => '1633', 'is_default' => '1']);\n Process::create(['id' => '1806', 'name' => 'Жарка', 'coldproc' => '5', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1635', 'is_default' => '1']);\n Process::create(['id' => '1807', 'name' => 'Жарка эскалопом без панировки', 'coldproc' => '4', 'hotproc' => '33', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1636', 'is_default' => '1']);\n Process::create(['id' => '1808', 'name' => 'Без обработки', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1346', 'is_default' => '1']);\n Process::create(['id' => '1809', 'name' => 'Удаление мякоти', 'coldproc' => '32', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1346', 'is_default' => '0']);\n Process::create(['id' => '1810', 'name' => 'Жарка фри', 'coldproc' => '0', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1638', 'is_default' => '1']);\n Process::create(['id' => '1812', 'name' => 'Нарезка шариками', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '60', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1369', 'is_default' => '0']);\n Process::create(['id' => '1813', 'name' => 'Обжаренные кубиком для штруделя', 'coldproc' => '30', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1369', 'is_default' => '0']);\n Process::create(['id' => '1814', 'name' => 'Получение сока', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '33', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1369', 'is_default' => '0']);\n Process::create(['id' => '1815', 'name' => 'Варка Аль денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1648', 'is_default' => '1']);\n Process::create(['id' => '1816', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1659', 'is_default' => '1']);\n Process::create(['id' => '1817', 'name' => 'Срезание корочки', 'coldproc' => '31', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1659', 'is_default' => '0']);\n Process::create(['id' => '1818', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1660', 'is_default' => '1']);\n Process::create(['id' => '1819', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1661', 'is_default' => '1']);\n Process::create(['id' => '1820', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1662', 'is_default' => '1']);\n Process::create(['id' => '1821', 'name' => 'Жарка', 'coldproc' => '4', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1669', 'is_default' => '1']);\n Process::create(['id' => '1822', 'name' => 'Без тепловой обработки', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1669', 'is_default' => '0']);\n Process::create(['id' => '1823', 'name' => 'Жарка фри тонкими ломтиками', 'coldproc' => '4', 'hotproc' => '60', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1669', 'is_default' => '0']);\n Process::create(['id' => '1824', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1670', 'is_default' => '1']);\n Process::create(['id' => '1825', 'name' => 'Припускание из свежемороженной', 'coldproc' => '3', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1673', 'is_default' => '1']);\n Process::create(['id' => '1826', 'name' => 'Холодная обработка', 'coldproc' => '26', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1675', 'is_default' => '1']);\n Process::create(['id' => '1827', 'name' => 'Холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1676', 'is_default' => '1']);\n Process::create(['id' => '1829', 'name' => 'Варка и отделение зерен', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '41', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1677', 'is_default' => '0']);\n Process::create(['id' => '1830', 'name' => 'Варка целиком', 'coldproc' => '3', 'hotproc' => '3', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1677', 'is_default' => '1']);\n Process::create(['id' => '1831', 'name' => 'Удаление косточки', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1684', 'is_default' => '1']);\n Process::create(['id' => '1832', 'name' => 'Удаление кожицы и косточек', 'coldproc' => '38', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1687', 'is_default' => '1']);\n Process::create(['id' => '1833', 'name' => 'Удаление семян и кожуры', 'coldproc' => '32', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1688', 'is_default' => '1']);\n Process::create(['id' => '1834', 'name' => 'Удаление кожуры', 'coldproc' => '39', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1689', 'is_default' => '1']);\n Process::create(['id' => '1835', 'name' => 'Удаление косточек и кожуры', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1690', 'is_default' => '1']);\n Process::create(['id' => '1836', 'name' => 'Удаление скорлупы', 'coldproc' => '17', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1692', 'is_default' => '1']);\n Process::create(['id' => '1837', 'name' => 'Потери при порционировании', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1707', 'is_default' => '1']);\n Process::create(['id' => '1838', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1710', 'is_default' => '1']);\n Process::create(['id' => '1839', 'name' => 'Варка с запеканием и удалением кости ', 'coldproc' => '20', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1736', 'is_default' => '1']);\n Process::create(['id' => '1841', 'name' => 'Жареный фри в крахмале филе с кожей без костей', 'coldproc' => '64', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1842', 'name' => 'Запеченная целиком без костей', 'coldproc' => '35', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1368', 'is_default' => '0']);\n Process::create(['id' => '1843', 'name' => 'Варка с удалением кожицы', 'coldproc' => '17', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1080', 'is_default' => '0']);\n Process::create(['id' => '1844', 'name' => 'Разделка на мякоть с кожей для фаршир. + запекание', 'coldproc' => '27', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1154', 'is_default' => '0']);\n Process::create(['id' => '1845', 'name' => 'Варка с разд. на мякоть с кожей для рулета из охл.', 'coldproc' => '28', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1215', 'is_default' => '0']);\n Process::create(['id' => '1846', 'name' => 'Потери при жарке', 'coldproc' => '0', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1763', 'is_default' => '1']);\n Process::create(['id' => '1847', 'name' => 'Варка из свежемороженной', 'coldproc' => '0', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '2', 'ch' => '1', 'protein' => '2', 'product_id' => '1121', 'is_default' => '0']);\n Process::create(['id' => '1848', 'name' => 'Жарка с разд. на мякоть с кож. д/ пулярика из охл.', 'coldproc' => '28', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1215', 'is_default' => '0']);\n Process::create(['id' => '1849', 'name' => 'Удаление кожи и хрящей', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1015', 'is_default' => '1']);\n Process::create(['id' => '1852', 'name' => 'Разделка на мякоть (Контрольная НестФуд)', 'coldproc' => '36', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1215', 'is_default' => '0']);\n Process::create(['id' => '1853', 'name' => 'Разделка на филе для фарша (Контр. Нестфуд)', 'coldproc' => '26', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1064', 'is_default' => '0']);\n Process::create(['id' => '1855', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1833', 'is_default' => '1']);\n Process::create(['id' => '1857', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '5', 'ch' => '5', 'protein' => '5', 'product_id' => '1166', 'is_default' => '0']);\n Process::create(['id' => '1858', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '57', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1908', 'is_default' => '1']);\n Process::create(['id' => '1859', 'name' => 'Удаление оснований', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1910', 'is_default' => '1']);\n Process::create(['id' => '1860', 'name' => 'Очистка от кожуры', 'coldproc' => '39', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1910', 'is_default' => '0']);\n Process::create(['id' => '1861', 'name' => 'Получение сока', 'coldproc' => '58', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1910', 'is_default' => '0']);\n Process::create(['id' => '1862', 'name' => 'Холодная обработка', 'coldproc' => '54', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1918', 'is_default' => '0']);\n Process::create(['id' => '1863', 'name' => 'Тушение', 'coldproc' => '54', 'hotproc' => '21', 'finalproc' => '0', 'grease' => '10', 'ch' => '5', 'protein' => '2', 'product_id' => '1918', 'is_default' => '1']);\n Process::create(['id' => '1864', 'name' => 'Жарка панированных п/ф (из с/м филе)', 'coldproc' => '6', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1345', 'is_default' => '0']);\n Process::create(['id' => '1865', 'name' => 'Потери при засолке', 'coldproc' => '9', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1550', 'is_default' => '0']);\n Process::create(['id' => '1866', 'name' => 'Удаление кожи и костей', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1929', 'is_default' => '1']);\n Process::create(['id' => '1867', 'name' => 'Конкассе (удаление кожицы и семян)', 'coldproc' => '53', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1332', 'is_default' => '0']);\n Process::create(['id' => '1869', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '1942', 'is_default' => '1']);\n Process::create(['id' => '1870', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '1774', 'is_default' => '1']);\n Process::create(['id' => '1871', 'name' => 'Потери при запекании', 'coldproc' => '0', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1937', 'is_default' => '1']);\n Process::create(['id' => '1872', 'name' => 'Жарка тонкими слайсами на гриле', 'coldproc' => '5', 'hotproc' => '47', 'finalproc' => '0', 'grease' => '10', 'ch' => '2', 'protein' => '5', 'product_id' => '1014', 'is_default' => '0']);\n Process::create(['id' => '1874', 'name' => 'Холодная обработка', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1963', 'is_default' => '1']);\n Process::create(['id' => '1875', 'name' => 'Жарка Конкассе', 'coldproc' => '53', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '5', 'product_id' => '1332', 'is_default' => '0']);\n Process::create(['id' => '1878', 'name' => 'Запекание', 'coldproc' => '3', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2010', 'is_default' => '1']);\n Process::create(['id' => '1879', 'name' => 'Потери при порционировании', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2022', 'is_default' => '1']);\n Process::create(['id' => '1880', 'name' => 'Запеченный с головой, хвостом и кожей без костей', 'coldproc' => '23', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1881', 'name' => 'Конкассе (летние)', 'coldproc' => '34', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1332', 'is_default' => '0']);\n Process::create(['id' => '1882', 'name' => 'Жарка Конкассе (летние)', 'coldproc' => '34', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '5', 'product_id' => '1332', 'is_default' => '0']);\n Process::create(['id' => '1884', 'name' => 'Холодная обработка', 'coldproc' => '24', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1164', 'is_default' => '0']);\n Process::create(['id' => '1885', 'name' => 'Разморозка (контрольная от 29.04.10)', 'coldproc' => '40', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1908', 'is_default' => '0']);\n Process::create(['id' => '1886', 'name' => 'Разморозка (Контрольная от 29.04.10)', 'coldproc' => '39', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1114', 'is_default' => '0']);\n Process::create(['id' => '1887', 'name' => 'Разделка на филе с кожей без костей', 'coldproc' => '37', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1551', 'is_default' => '0']);\n Process::create(['id' => '1888', 'name' => 'Жарка филе с кожей без кости', 'coldproc' => '54', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1429', 'is_default' => '0']);\n Process::create(['id' => '1889', 'name' => 'Жарка', 'coldproc' => '23', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '2108', 'is_default' => '1']);\n Process::create(['id' => '1890', 'name' => 'Жарка', 'coldproc' => '22', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1407', 'is_default' => '0']);\n Process::create(['id' => '1893', 'name' => 'Потери при порционировании', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2118', 'is_default' => '1']);\n Process::create(['id' => '1896', 'name' => 'Обработка для суши, роллов', 'coldproc' => '60', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2123', 'is_default' => '1']);\n Process::create(['id' => '1897', 'name' => 'Разделка на мякоть', 'coldproc' => '41', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2145', 'is_default' => '1']);\n Process::create(['id' => '1898', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '2160', 'is_default' => '1']);\n Process::create(['id' => '1899', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2166', 'is_default' => '1']);\n Process::create(['id' => '1900', 'name' => 'Потери при варке', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2171', 'is_default' => '1']);\n Process::create(['id' => '1903', 'name' => 'Холодная обработка', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2189', 'is_default' => '1']);\n Process::create(['id' => '1904', 'name' => 'Потери при порционировании', 'coldproc' => '17', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1651', 'is_default' => '1']);\n Process::create(['id' => '1905', 'name' => 'Удаление кожи и костей', 'coldproc' => '19', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2196', 'is_default' => '1']);\n Process::create(['id' => '1906', 'name' => 'Потери при нарезке', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1010', 'is_default' => '1']);\n Process::create(['id' => '1907', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2203', 'is_default' => '1']);\n Process::create(['id' => '1908', 'name' => 'Запекание', 'coldproc' => '3', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2203', 'is_default' => '0']);\n Process::create(['id' => '1909', 'name' => 'Потери при порционировании', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2205', 'is_default' => '1']);\n Process::create(['id' => '1910', 'name' => 'Потери при порционировании', 'coldproc' => '7', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2206', 'is_default' => '1']);\n Process::create(['id' => '1911', 'name' => 'Жарка', 'coldproc' => '48', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1121', 'is_default' => '0']);\n Process::create(['id' => '1912', 'name' => 'Очистка', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1234', 'is_default' => '0']);\n Process::create(['id' => '1913', 'name' => 'Очистка', 'coldproc' => '32', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1285', 'is_default' => '0']);\n Process::create(['id' => '1914', 'name' => 'Жарка из свежемороженой', 'coldproc' => '5', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1121', 'is_default' => '0']);\n Process::create(['id' => '1915', 'name' => 'Потери при жарке', 'coldproc' => '0', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '2236', 'is_default' => '1']);\n Process::create(['id' => '1916', 'name' => 'Очищенная без термообработки', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1276', 'is_default' => '0']);\n Process::create(['id' => '1921', 'name' => 'Потери при порционировании', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2114', 'is_default' => '1']);\n Process::create(['id' => '1925', 'name' => 'Холодная обработка', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2268', 'is_default' => '1']);\n Process::create(['id' => '1926', 'name' => 'Жарка сильно глазированного', 'coldproc' => '62', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1530', 'is_default' => '0']);\n Process::create(['id' => '1927', 'name' => 'Жарка из очищенных свежемороженных', 'coldproc' => '40', 'hotproc' => '7', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1908', 'is_default' => '0']);\n Process::create(['id' => '1928', 'name' => 'Потери при порционировании', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2274', 'is_default' => '1']);\n Process::create(['id' => '1929', 'name' => 'Жарка из с/м с предв. запек. и удал берц. кости', 'coldproc' => '18', 'hotproc' => '4', 'finalproc' => '15', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1461', 'is_default' => '0']);\n Process::create(['id' => '1930', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1711', 'is_default' => '1']);\n Process::create(['id' => '1931', 'name' => 'Варка Аль денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2287', 'is_default' => '1']);\n Process::create(['id' => '1932', 'name' => 'Потери на рассол', 'coldproc' => '35', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1144', 'is_default' => '1']);\n Process::create(['id' => '1933', 'name' => 'Потери при порционировании', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2296', 'is_default' => '1']);\n Process::create(['id' => '1934', 'name' => 'Запекание', 'coldproc' => '3', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2296', 'is_default' => '0']);\n Process::create(['id' => '1935', 'name' => 'Жарка филе', 'coldproc' => '53', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1635', 'is_default' => '0']);\n Process::create(['id' => '1936', 'name' => 'Очистка корочки', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1601', 'is_default' => '0']);\n Process::create(['id' => '1937', 'name' => 'Получение сока', 'coldproc' => '40', 'hotproc' => '0', 'finalproc' => '52', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1008', 'is_default' => '0']);\n Process::create(['id' => '1938', 'name' => 'Получение сока', 'coldproc' => '40', 'hotproc' => '0', 'finalproc' => '58', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1071', 'is_default' => '0']);\n Process::create(['id' => '1940', 'name' => 'Запеченный, фаршированный с головой и костями', 'coldproc' => '22', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1941', 'name' => 'Запеченный целиком с удаленным хребтом', 'coldproc' => '35', 'hotproc' => '16', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1221', 'is_default' => '0']);\n Process::create(['id' => '1942', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2380', 'is_default' => '1']);\n Process::create(['id' => '1943', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2381', 'is_default' => '1']);\n Process::create(['id' => '1944', 'name' => 'Потери при жарке', 'coldproc' => '0', 'hotproc' => '44', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2384', 'is_default' => '1']);\n Process::create(['id' => '1945', 'name' => 'Разделка на филе с кожей б/к+засолка', 'coldproc' => '43', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1551', 'is_default' => '0']);\n Process::create(['id' => '1946', 'name' => 'Запекание сухариков с удалением корочки', 'coldproc' => '29', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1022', 'is_default' => '0']);\n Process::create(['id' => '1947', 'name' => 'Формование валованов и запекание', 'coldproc' => '50', 'hotproc' => '42', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1614', 'is_default' => '0']);\n Process::create(['id' => '1948', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2420', 'is_default' => '1']);\n Process::create(['id' => '1949', 'name' => 'Холодная обработка', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2422', 'is_default' => '1']);\n Process::create(['id' => '1953', 'name' => 'Выпекание штучных изделий (50-70 грамм)', 'coldproc' => '0', 'hotproc' => '14', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2435', 'is_default' => '1']);\n Process::create(['id' => '1954', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2444', 'is_default' => '1']);\n Process::create(['id' => '1955', 'name' => 'Жарка соломкой для солянки', 'coldproc' => '3', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '2446', 'is_default' => '1']);\n Process::create(['id' => '1956', 'name' => 'Припускание без очистки', 'coldproc' => '10', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1214', 'is_default' => '0']);\n Process::create(['id' => '1957', 'name' => 'Потери при варке (2)', 'coldproc' => '0', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1052', 'is_default' => '0']);\n Process::create(['id' => '1959', 'name' => 'Потери при варке (1)', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1825', 'is_default' => '1']);\n Process::create(['id' => '1960', 'name' => 'Потери при варке (2)', 'coldproc' => '0', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1825', 'is_default' => '0']);\n Process::create(['id' => '1961', 'name' => 'Жарка без зачистки', 'coldproc' => '5', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1546', 'is_default' => '0']);\n Process::create(['id' => '1962', 'name' => 'Жарка на гриле с головой и костями (из охл.)', 'coldproc' => '13', 'hotproc' => '16', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1429', 'is_default' => '0']);\n Process::create(['id' => '1963', 'name' => 'Жарка на гриле с головой и костями (из охл.)', 'coldproc' => '16', 'hotproc' => '16', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1552', 'is_default' => '0']);\n Process::create(['id' => '1964', 'name' => 'Жарка на гриле целиком очищ. потрошенная (из охл.)', 'coldproc' => '18', 'hotproc' => '16', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '2452', 'is_default' => '1']);\n Process::create(['id' => '1965', 'name' => 'Жарка гриль целиком (из охл.)', 'coldproc' => '15', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1635', 'is_default' => '0']);\n Process::create(['id' => '1966', 'name' => 'Нарезка стейками с кожей и костями+жарка', 'coldproc' => '29', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1551', 'is_default' => '0']);\n Process::create(['id' => '1967', 'name' => 'Жареный гриль целиком (потрош., с головой)', 'coldproc' => '20', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1968', 'name' => 'Жарка в беконе с очисткой хвостовой части', 'coldproc' => '40', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1460', 'is_default' => '0']);\n Process::create(['id' => '1970', 'name' => 'Жарка без зачистки (Н. Зеландия, Австралия)', 'coldproc' => '3', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1018', 'is_default' => '0']);\n Process::create(['id' => '1971', 'name' => 'Тушение (охлажденное)', 'coldproc' => '8', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2467', 'is_default' => '1']);\n Process::create(['id' => '1972', 'name' => 'Варка (охлажденное)', 'coldproc' => '8', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '2467', 'is_default' => '0']);\n Process::create(['id' => '1975', 'name' => 'Варка (из охлажденного)', 'coldproc' => '9', 'hotproc' => '43', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '2466', 'is_default' => '0']);\n Process::create(['id' => '1976', 'name' => 'Тушение (из охлажденного)', 'coldproc' => '9', 'hotproc' => '43', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2466', 'is_default' => '1']);\n Process::create(['id' => '1977', 'name' => 'Варка (из мороженного)', 'coldproc' => '15', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '2466', 'is_default' => '0']);\n Process::create(['id' => '1978', 'name' => 'Тушение (из мороженного)', 'coldproc' => '15', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2466', 'is_default' => '0']);\n Process::create(['id' => '1979', 'name' => 'Жарка', 'coldproc' => '4', 'hotproc' => '53', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1093', 'is_default' => '1']);\n Process::create(['id' => '1980', 'name' => 'Жарка в составе котлет', 'coldproc' => '4', 'hotproc' => '45', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1093', 'is_default' => '0']);\n Process::create(['id' => '1981', 'name' => 'Потери при вязке колбасок', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2487', 'is_default' => '1']);\n Process::create(['id' => '1982', 'name' => 'Потери при порционировании', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2498', 'is_default' => '1']);\n Process::create(['id' => '1983', 'name' => 'Потери при разморозке (б/к)', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1050', 'is_default' => '0']);\n Process::create(['id' => '1985', 'name' => 'Разморозка и запекание с сухарным соусом', 'coldproc' => '7', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1186', 'is_default' => '0']);\n Process::create(['id' => '1986', 'name' => 'Обжаривание для штруделя', 'coldproc' => '0', 'hotproc' => '64', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1050', 'is_default' => '0']);\n Process::create(['id' => '1987', 'name' => 'Нарезка без очистки', 'coldproc' => '7', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1008', 'is_default' => '0']);\n Process::create(['id' => '1988', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2525', 'is_default' => '1']);\n Process::create(['id' => '1989', 'name' => 'Припускание', 'coldproc' => '0', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1836', 'is_default' => '1']);\n Process::create(['id' => '1990', 'name' => 'Потери при порционировании', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1428', 'is_default' => '1']);\n Process::create(['id' => '1993', 'name' => 'Варка в составе соуса', 'coldproc' => '0', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1297', 'is_default' => '0']);\n Process::create(['id' => '1994', 'name' => 'Варка без слива для плова (Контрольная проработка)', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1263', 'is_default' => '0']);\n Process::create(['id' => '1998', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '2607', 'is_default' => '1']);\n Process::create(['id' => '2001', 'name' => 'Запекание (булочки)', 'coldproc' => '0', 'hotproc' => '33', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '2609', 'is_default' => '0']);\n Process::create(['id' => '2002', 'name' => 'Запекание (плюшки)', 'coldproc' => '0', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '2609', 'is_default' => '0']);\n Process::create(['id' => '2004', 'name' => 'Потери на рассол', 'coldproc' => '7', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1065', 'is_default' => '1']);\n Process::create(['id' => '2006', 'name' => 'Запекание (булочка ореховая)', 'coldproc' => '0', 'hotproc' => '16', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '2609', 'is_default' => '0']);\n Process::create(['id' => '2008', 'name' => 'Потери при запекании в составе теста', 'coldproc' => '0', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1052', 'is_default' => '0']);\n Process::create(['id' => '2009', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2642', 'is_default' => '1']);\n Process::create(['id' => '2010', 'name' => 'Жарка в кляре (Контрольная от 01.09.2010', 'coldproc' => '39', 'hotproc' => '46', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1114', 'is_default' => '0']);\n Process::create(['id' => '2011', 'name' => 'Жарка из с/м б/г с очисткой от панциря и хвоста', 'coldproc' => '45', 'hotproc' => '14', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1908', 'is_default' => '0']);\n Process::create(['id' => '2013', 'name' => 'Жарка с удалением хребта', 'coldproc' => '17', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1278', 'is_default' => '0']);\n Process::create(['id' => '2014', 'name' => 'Обжарка', 'coldproc' => '11', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '1375', 'is_default' => '1']);\n Process::create(['id' => '2015', 'name' => 'Запекание (2)', 'coldproc' => '4', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1607', 'is_default' => '0']);\n Process::create(['id' => '2017', 'name' => 'Жарка гриль (из охлажленных)', 'coldproc' => '2', 'hotproc' => '24', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '2716', 'is_default' => '1']);\n Process::create(['id' => '2018', 'name' => 'Жарка филе без кожи и костей', 'coldproc' => '47', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '2729', 'is_default' => '1']);\n Process::create(['id' => '2019', 'name' => 'Потери при нарезке', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2759', 'is_default' => '1']);\n Process::create(['id' => '2021', 'name' => 'Разделка на мякоть + жарка', 'coldproc' => '52', 'hotproc' => '20', 'finalproc' => '10', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1459', 'is_default' => '0']);\n Process::create(['id' => '2022', 'name' => 'Разогрев', 'coldproc' => '0', 'hotproc' => '2', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2780', 'is_default' => '1']);\n Process::create(['id' => '2023', 'name' => 'Разогрев', 'coldproc' => '0', 'hotproc' => '6', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2781', 'is_default' => '1']);\n Process::create(['id' => '2024', 'name' => 'Разогрев', 'coldproc' => '0', 'hotproc' => '6', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2782', 'is_default' => '1']);\n Process::create(['id' => '2025', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '2783', 'is_default' => '1']);\n Process::create(['id' => '2026', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2784', 'is_default' => '1']);\n Process::create(['id' => '2027', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2785', 'is_default' => '1']);\n Process::create(['id' => '2028', 'name' => 'Жарка гриль (из с/м п/ф)', 'coldproc' => '2', 'hotproc' => '13', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1677', 'is_default' => '0']);\n Process::create(['id' => '2033', 'name' => 'Уваривание с сахаром из с/м', 'coldproc' => '0', 'hotproc' => '47', 'finalproc' => '0', 'grease' => '2', 'ch' => '3', 'protein' => '2', 'product_id' => '1097', 'is_default' => '0']);\n Process::create(['id' => '2034', 'name' => 'Уваривание с сахаром из с/м', 'coldproc' => '2', 'hotproc' => '48', 'finalproc' => '0', 'grease' => '2', 'ch' => '3', 'protein' => '2', 'product_id' => '1303', 'is_default' => '0']);\n Process::create(['id' => '2035', 'name' => 'Запекание до полуготовности', 'coldproc' => '0', 'hotproc' => '14', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '1774', 'is_default' => '0']);\n Process::create(['id' => '2036', 'name' => 'Допекание', 'coldproc' => '0', 'hotproc' => '7', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2868', 'is_default' => '1']);\n Process::create(['id' => '2037', 'name' => 'Потери влаги при жарке в составе блюда', 'coldproc' => '0', 'hotproc' => '16', 'finalproc' => '0', 'grease' => '5', 'ch' => '5', 'protein' => '5', 'product_id' => '1191', 'is_default' => '0']);\n Process::create(['id' => '2038', 'name' => 'Жареная с головой', 'coldproc' => '20', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '2900', 'is_default' => '1']);\n Process::create(['id' => '2039', 'name' => 'Жарка мелкими кусочками', 'coldproc' => '5', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '2040', 'name' => 'Разделка на мякоть', 'coldproc' => '69', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1476', 'is_default' => '0']);\n Process::create(['id' => '2041', 'name' => 'Потери при хранении и холодной обработки', 'coldproc' => '14', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2910', 'is_default' => '1']);\n Process::create(['id' => '2042', 'name' => 'Потери при хранении и нарезке', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2917', 'is_default' => '1']);\n Process::create(['id' => '2043', 'name' => 'Потери при непродолжительной варке', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2924', 'is_default' => '1']);\n Process::create(['id' => '2044', 'name' => 'Потери при длительной варке', 'coldproc' => '0', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2924', 'is_default' => '0']);\n Process::create(['id' => '2045', 'name' => 'Варка', 'coldproc' => '50', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2930', 'is_default' => '1']);\n Process::create(['id' => '2046', 'name' => 'Жарка, запекание', 'coldproc' => '28', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1676', 'is_default' => '0']);\n Process::create(['id' => '2048', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2948', 'is_default' => '1']);\n Process::create(['id' => '2050', 'name' => 'Потери при порционировании', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1941', 'is_default' => '1']);\n Process::create(['id' => '2051', 'name' => 'Потеря влаги при запекании воздушного п/ф', 'coldproc' => '0', 'hotproc' => '89', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '10', 'product_id' => '1667', 'is_default' => '1']);\n Process::create(['id' => '2052', 'name' => 'Холодная обработка', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1279', 'is_default' => '0']);\n Process::create(['id' => '2053', 'name' => 'Потери при запекании', 'coldproc' => '0', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2988', 'is_default' => '1']);\n Process::create(['id' => '2054', 'name' => 'Тушение из с/м', 'coldproc' => '0', 'hotproc' => '45', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1198', 'is_default' => '1']);\n Process::create(['id' => '2055', 'name' => 'Потери при варке', 'coldproc' => '0', 'hotproc' => '70', 'finalproc' => '0', 'grease' => '2', 'ch' => '2', 'protein' => '2', 'product_id' => '1011', 'is_default' => '0']);\n Process::create(['id' => '2056', 'name' => 'Жарка', 'coldproc' => '5', 'hotproc' => '42', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '3022', 'is_default' => '1']);\n Process::create(['id' => '2057', 'name' => 'Жарка гриль из свежемороженных', 'coldproc' => '31', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '3033', 'is_default' => '1']);\n Process::create(['id' => '2058', 'name' => 'Выпекание хлебных палочек', 'coldproc' => '0', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2435', 'is_default' => '0']);\n Process::create(['id' => '2059', 'name' => 'Варка', 'coldproc' => '5', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '3050', 'is_default' => '1']);\n Process::create(['id' => '2060', 'name' => 'Жарка + разделка на мякоть с кожей', 'coldproc' => '10', 'hotproc' => '35', 'finalproc' => '56', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1341', 'is_default' => '0']);\n Process::create(['id' => '2061', 'name' => 'Жарка гриль', 'coldproc' => '7', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '3061', 'is_default' => '1']);\n Process::create(['id' => '2062', 'name' => 'Холодное копчение', 'coldproc' => '12', 'hotproc' => '14', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1278', 'is_default' => '0']);\n Process::create(['id' => '2063', 'name' => 'Холодное копчение', 'coldproc' => '5', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1279', 'is_default' => '0']);\n Process::create(['id' => '2065', 'name' => 'Потери при жарке', 'coldproc' => '0', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '3074', 'is_default' => '1']);\n Process::create(['id' => '2066', 'name' => 'Жарка крупных с/м б/г с очисткой от панциря', 'coldproc' => '27', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1908', 'is_default' => '0']);\n Process::create(['id' => '2067', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '3095', 'is_default' => '1']);\n Process::create(['id' => '2068', 'name' => 'Запекание чипсами', 'coldproc' => '17', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1608', 'is_default' => '0']);\n Process::create(['id' => '2069', 'name' => 'Разморозка', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1345', 'is_default' => '0']);\n Process::create(['id' => '2070', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '3106', 'is_default' => '1']);\n Process::create(['id' => '2071', 'name' => 'Запекание в кожице без очистки', 'coldproc' => '3', 'hotproc' => '21', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1014', 'is_default' => '0']);\n Process::create(['id' => '2072', 'name' => 'Припущенные с кожицей и семенами', 'coldproc' => '3', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1112', 'is_default' => '0']);\n Process::create(['id' => '2073', 'name' => 'Удаление внутренностей', 'coldproc' => '36', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1476', 'is_default' => '1']);\n Process::create(['id' => '2074', 'name' => 'Запеченный в соли с головой и хребтом без кожи', 'coldproc' => '16', 'hotproc' => '18', 'finalproc' => '28', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '2075', 'name' => 'Тушение в масле с овощами (конфит)', 'coldproc' => '3', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '3117', 'is_default' => '1']);\n Process::create(['id' => '2076', 'name' => 'Тушение с удалением кости (до сустава)', 'coldproc' => '17', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '3117', 'is_default' => '0']);\n Process::create(['id' => '2077', 'name' => 'Запекание в фольге с холодной обработкой', 'coldproc' => '13', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1328', 'is_default' => '0']);\n Process::create(['id' => '2078', 'name' => 'Запекание гребешка в раковине', 'coldproc' => '0', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1422', 'is_default' => '0']);\n Process::create(['id' => '2079', 'name' => 'Жарка корейки теленка на кости', 'coldproc' => '19', 'hotproc' => '29', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1328', 'is_default' => '0']);\n Process::create(['id' => '2080', 'name' => 'Потери влаги при запекании в составе чизкейка', 'coldproc' => '0', 'hotproc' => '36', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1613', 'is_default' => '0']);\n Process::create(['id' => '2081', 'name' => 'Выделение хлорофила', 'coldproc' => '85', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1233', 'is_default' => '0']);\n Process::create(['id' => '2082', 'name' => 'Сушка', 'coldproc' => '15', 'hotproc' => '90', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '5', 'product_id' => '1332', 'is_default' => '0']);\n Process::create(['id' => '2083', 'name' => 'Холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '3132', 'is_default' => '1']);\n Process::create(['id' => '2084', 'name' => 'Холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '3133', 'is_default' => '1']);\n Process::create(['id' => '2085', 'name' => 'Холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '3134', 'is_default' => '1']);\n Process::create(['id' => '2086', 'name' => 'Холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '3135', 'is_default' => '1']);\n Process::create(['id' => '2087', 'name' => 'Холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '3136', 'is_default' => '1']);\n Process::create(['id' => '2088', 'name' => 'Холодная обработка', 'coldproc' => '20', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '3137', 'is_default' => '1']);\n Process::create(['id' => '2090', 'name' => 'Потери при нарезке', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1347', 'is_default' => '0']);\n }", "public function run()\n {\n if (!DB::table('users')->count()) {\n DB::unprepared(file_get_contents(__DIR__ . '/sql/elms_users.sql'));\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n\n $this->call(users::class);\n $this->call(affiliates::class);\n $this->call(productInfo::class);\n\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n Model::unguard();\n $this->call('ProdutoTableSeeder');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n Search::truncate();\n Filter::truncate();\n User::truncate();\n Model::unguard();\n\n $this->call('SearchesSeeder');\n $this->call('FiltersSeeder');\n $this->call('UsersSeeder');\n }", "public function run()\n {\n\t DB::table('cities')->delete();\n\t $file = database_path() . \"/seeds/cities.sql\";\n\t /*\n\t\t * First method with DB::unprepared\n\t\t * */\n\t DB::unprepared(file_get_contents($file));\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('leads')->truncate();\n factory(Lead::class, 2)->create(['user_id' => factory(User::class)->create()->id]);\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n DB::table('folio')->delete();\n FoliosDAO::create([\n 'numero' => '1',\n 'documento' => 'Papeleta',\n 'fecha_creado' => date('d/m/Y')\n ]);\n }", "public function run()\n {\n $SQL_FILES = [\n 'resources/developer_docs/tags.sql',\n 'resources/developer_docs/photo_tag.sql'\n ];\n \n Eloquent::unguard();\n for ($i=0; $i < count($SQL_FILES); $i++) { \n DB::unprepared(file_get_contents($SQL_FILES[$i]));\n }\n $this->command->info('tags data seeded!');\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t$this->call('DoucheJarTableSeeder');\n\t\t$this->command->info('DoucheJar table seeded!');\n\t}", "public function run() {\n ini_set('memory_limit', '-1');\n DB::unprepared(File::get(__DIR__ . '/don_vi_hanh_chinh.sql'));\n\n $this->call(CompaniesTableSeeder::class);\n $this->call(CommoditiesTableSeeder::class);\n // $this->call(CustomerTableSeeder::class);\n $this->call(RolesTableSeeder::class);\n $this->call(PermsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n }", "public function run() {\n\n // SETUP ENVIRONMENT\n if (!$this->schemaTableExists()) {\n self::errln(\"Schema table does not exist...creating\");\n $this->runFile('00000_schema.sql');\n }\n\n // TEMPORARY TABLE PRIVILEGE?\n if (!$this->root_connection_setup) {\n if (!$this->hasCreateTemporaryTablePrivilege()) {\n self::errln(sprintf(\"\nUser `%s` has no 'CREATE TEMPORARY TABLE' privilege. It is\nstrongly recommended that privilege is granted.\n\",\n Conf::$SQL_USER));\n $this->setupRootDbConnection();\n }\n }\n\n $this->createTemporaryTable();\n\n $PROTO = new TSSchema();\n $TEMPP = new TSNewSchema();\n\n // FILL TEMPORARY TABLE\n $vat = new BatchedDirListing($this->getUpDir());\n $vat->filterByRegexp('/^[0-9]{5}_.+\\.sql$/');\n\n while (($batch = $vat->nextBatch()) !== false) {\n $objs = array();\n foreach ($batch as $name) {\n $obj = new TSNewSchema();\n $obj->id = $name;\n $objs[] = $obj;\n }\n DB::insertAll($objs);\n }\n\n // DOWNGRADE FIRST\n $res = DB::getAll(\n $PROTO,\n new DBCondIn('id', DB::prepGetAll($TEMPP, null, array('id')), DBCondIn::NOT_IN)\n );\n foreach ($res as $version) {\n $this->runDowngrade($version);\n }\n\n // UPGRADE NEXT\n $res = DB::getAll(\n $TEMPP,\n new DBCondIn('id', DB::prepGetAll($PROTO, null, array('id')), DBCondIn::NOT_IN)\n );\n foreach ($res as $version) {\n $this->runFile($version->id);\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n DB::table('services')->truncate();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n // create user\n \\App\\Model\\Service::create([\n 'name' => 'Hair cutting',\n 'cost_per' => 'Per cut',\n 'price' => 600,\n 'branch_id' => 1\n ]);\n }", "public function run()\n {\n\n DB::table('projects')->truncate();\n DB::table('projects')->insert([\n [\n 'id' => '1',\n 'name' => 'Project alpha',\n ],\n [\n 'id' => '2',\n 'name' => 'Project beta',\n ],\n [\n 'id' => '3',\n 'name' => 'Project omega',\n ],\n ]);\n }", "public function run()\n {\n if(env('APP_ENV') != 'production') {\n DB::table('aulas')->truncate();\n $aulas = factory(\\App\\Aula::class, 20)->create();\n }\n }", "public function run()\n {\n Eloquent::unguard();\n $this->call('PlansTableSeeder');\n $this->call('ServersTableSeeder');\n $this->call('HostingCostsTableSeeder');\n $this->call('DomainCostsTableSeeder'); \n }", "public function run()\n {\n City::unguard();\n DB::unprepared(file_get_contents(base_path('cities.sql')));\n }", "public function run()\n {\n Model::unguard();\n \n //Desativar verificação chave estrangeira no mysql\n DB::statement('SET foreign_key_checks = 0;'); \n \n //Popular usuários\n $this->call('UserTableSeeder'); \n \n //Popular projetos\n $this->call('ProjetosTableSeeder'); \n \n //Popular necessidades\n $this->call('NecessidadesTableSeeder'); \n\n //Popular status de tarefas\n $this->call('StatusTarefaTableSeeder');\n \n //Popular tipos de tarefas personalizados\n $this->call('TiposTarefaTableSeeder');\n \n //Popular tarefas\n $this->call('TarefaTableSeeder'); \n \n //Ativar verificação chave estrangeira no mysql\n DB::statement('SET foreign_key_checks = 1;'); \n Model::reguard();\n }", "public function run()\n {\n Model::unguard();\n\n if (\\App::environment('local', 'staging')) {\n // Clear existing data\n $this->clearData();\n }\n\n //$this->call('ThingsSeeder');\n\n Model::reguard();\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('users')->truncate();\n DB::table('users')->insert([\n [\n 'id' => 1,\n 'name' => 'admin',\n 'email' => 'admin@filebank.com', \n 'password' => Hash::make('filebankadmin'), \n 'admin' => config('env.user.admin'), \n 'created_at' => Carbon::now()->toDateTimeString(), \n 'updated_at' => Carbon::now()->toDateTimeString(), \n ],\n ]);\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n MainSlider::truncate();\n $this->command->info('[main_slider] table truncated...');\n \n DB::beginTransaction();\n $this->seed();\n DB::commit();\n\n $this->command->info('[main_slider] table seeded...');\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Activity::truncate();\n User::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n $this->call(UserTableSeeder::class);\n $this->call(ActivityTableSeeder::class);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n \tApp\\Permission::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n App\\Permission::create(\n \t[\n \t'slug' => 'system-administration',\n \t'name' => 'System administration',\n \t]\n );\n\n App\\Permission::create(\n \t[\n \t'slug' => 'system-use',\n \t'name' => 'System use',\n \t]\n );\n }", "public function run()\n {\n if (DB::getDriverName() == 'sqlite')\n DB::unprepared('PRAGMA foreign_keys = OFF;');\n else //case 'mysql'\n DB::unprepared('SET FOREIGN_KEY_CHECKS = 0;');\n\n Model::unguard();\n\n $this->call(UserSeeder::class);\n $this->call(RecipeSeeder::class);\n $this->call(IngredientRecipeSeeder::class);\n\n Model::reguard();\n\n if (DB::getDriverName() == 'sqlite')\n DB::unprepared('PRAGMA foreign_keys = ON;');\n else //case 'mysql'\n DB::unprepared('SET FOREIGN_KEY_CHECKS = 1;');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n Categoria::truncate();\n Atractivo::truncate();\n Galeria::truncate();\n User::truncate();\n\n $this->call(CategoriasTableSeeder::class);\n $this->call(AtractivosTableSeeder::class);\n $this->call(GaleriasTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n }", "public function run()\n {\n Publisher::truncate();\n\n DB::connection('old')->table('publishers')->get()->each(function($publisher) {\n Publisher::create([\n 'id' => $publisher->id,\n 'name' => $publisher->name\n ]);\n });\n }", "public function run()\n\t{\n\t\t// DB::table('parameters')->truncate();\n\n\t\t$parameters = array(\n\n\t\t);\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('parameters')->insert($parameters);\n\t}", "public function run()\n {\n \\DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n MasterDocument::truncate();\n \\DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n MasterDocument::create([ 'name' => 'MASTER B/L', 'display_name' => 'MB/L']);\n MasterDocument::create([ 'name' => 'HOUSE B/L', 'display_name' => 'HB/L']);\n MasterDocument::create([ 'name' => 'PART OF B/L', 'display_name' => 'PART OFF']);\n MasterDocument::create([ 'name' => 'PEB', 'display_name' => 'PEB']);\n MasterDocument::create([ 'name' => 'SPLIT B/L', 'display_name' => 'SPLIT']);\n MasterDocument::create([ 'name' => 'DELIVERY ORDER', 'display_name' => 'DO']);\n MasterDocument::create([ 'name' => 'CONTAINER AND SEAL', 'display_name' => 'CONTAINER']);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n DB::table('car_driver')->truncate();\n factory(\\App\\CarDriver::class, 100)->create();\n }", "public function run()\n {\n User::truncate();\n Product::truncate();\n User::forceCreate([\n 'name' => 'foo',\n 'email' => 'foo@foo.com',\n 'password' => bcrypt('password'),\n ]);\n factory(User::class, 5)->create();\n factory(Product::class, 5)->create();\n }", "public function run()\n\t{\n\t\t//Model::unguard();\n\t\t/*\n\t\tFoto::truncate();\n\t\tAlbum::truncate();\n\t\tUsuario::truncate();\n\n\t\t$this->call('UsuariosSeeder');\n\t\t$this->call('AlbumesSeeder');\n\t\t$this->call('FotosSeeder');*/\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\t\tLinea::truncate();\n\t\tPedido::truncate();\n EstadoPedido::truncate();\n\t\tRepresentante::truncate();\n\t\t//Empleado::truncate();\n\t\tLibroAutor::truncate();\n\t\tLibro::truncate();\n\t\tAutor::truncate();\n\t\tTipoEdicion::truncate();\n\t\tGenero::truncate();\n\t\tNivel::truncate();\n\n\t\t$this->call('AutoresSeeder');\n\t\t$this->call('TipoEdicionesSeeder');\n\t\t$this->call('GenerosSeeder');\n\t\t$this->call('NivelesSeeder');\n\t\t$this->call('LibrosSeeder');\n\t\t$this->call('LibroAutoresSeeder');\n\t\t//$this->call('EmpleadosSeeder');\n\t\t$this->call('RepresentantesSeeder');\n $this->call('EstadoPedidosSeeder');\n\t\t$this->call('PedidosSeeder');\n\t\t$this->call('LineasSeeder');\n\t}", "public function run()\n {\n exec(\"mysql -u \" . config('database.connections.mysql.username') . \" -p\" . config('database.connections.mysql.password') . \" \" . config('database.connections.mysql.database') . \" < \" . getcwd() . \"/database/hadith.sql\");\n }", "public function run()\n {\n // factory(App\\User::class, 8)->create();\n //\\App\\EmployeeTask::truncate();\n \\App\\TaskActivity::truncate();\n \\App\\TodoList::truncate();\n \\App\\Notification::truncate();\n // \\App\\Task::truncate();\n \n // factory(App\\EmployeeTask::class, 8)->create();\n // $tasks = \\App\\Task::all();\n // foreach($tasks as $task) {\n // $task->slug = $task->id . '-' . str_slug($task->title);\n // $task->save();\n // }\n }", "public function run()\n\t{\n Eloquent::unguard();\n $this->call('UserTableSeeder');\n $this->call('ProgramTableSeeder');\n $this->call('ProgramOptionTableSeeder');\n $this->call('SchoolSessionTableSeeder');\n\t}", "public function run() {\n\t\n\t\tDB::table('vendors')->truncate();\n\n\t\t Vendors::create(array(\n\t\t \"vendor_name\"=>\"DC ALL PRODUCT\",\n\t\t \"vendor_code\"=>20100\n\t\t ));\n\t\t Vendors::create(array(\n\t\t \"vendor_name\"=>\"PHILIPPINE FAMILYMART PRODUCT\",\n\t\t \"vendor_code\"=>20999\n\t\t ));\n\t}", "public function run()\n {\n DB::table('main_info')->delete();\n\n MainInfo::create([\n 'title' => 'Helicopter view',\n 'keywords' => 'some keywords',\n 'description' => 'some description',\n 'service_title' => 'service',\n 'service_description_1' => 'We identify compelling investment opportunities, opening doors that might otherwise appear closed.',\n 'service_description_2' => 'We facilitate all aspects of deal execution.',\n 'offer_title' => 'our offer',\n ]);\n }", "public function run()\n {\n Eloquent::unguard();\n User::flushEventListeners();\n $this->truncateDatabase();\n foreach ($this->seeders as $seeder) {\n $this->call($seeder);\n }\n }", "public function run()\n {\n DB::table('notes')->delete();\n\n \\App\\Note::create(array(\n 'user_id'=> \"1\",\n 'title' => 'Note 1',\n 'content' => 'Lorem ipsum stuff stuff stuff'));\n \\App\\Note::create(array(\n 'user_id'=> \"1\",\n 'title' => 'Note 2',\n 'content' => 'Lorem ipsum 2 stuff 222 stuff'));\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Task::truncate();\n TaskList::truncate();\n User::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n $this->call(UserSeeder::class);\n $this->call(TaskListSeeder::class);\n $this->call(TaskSeeder::class);\n }", "public function run()\n {\n Model::unguard();\n\n \\DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n \\DB::table('location__countries')->truncate();\n \\DB::table('location__country_translations')->truncate();\n\n \\DB::table('location__provinces')->truncate();\n \\DB::table('location__province_translations')->truncate();\n\n \\DB::table('location__cities')->truncate();\n \\DB::table('location__city_translations')->truncate();\n \\DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n $this->call(CountryTableSeeder::class);\n $this->call(ProvinceTableSeeder::class);\n $this->call(CityTableSeeder::class);\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('UserTableSeeder');\n\n\t\t$this->call('StaticDepartmentTableSeeder');\n $this->command->info('static_departments table seeded!');\n\n\t\t$this->call('StaticHostelTableSeeder');\n $this->command->info('static_hostels table seeded!');\n\n\t\t$this->call('StaticMinorTableSeeder');\n $this->command->info('static_minors table seeded!');\n\t}", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach ($this->seeders as $table => $seeder) {\n if (is_string($table)) {\n DB::table($table)->truncate();\n }\n\n $this->call($seeder);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('licenses')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n\n License::create([\n 'license_name' => 'IFR'\n ]);\n License::create([\n 'license_name' => 'VFR'\n ]);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n $this->usersRepository->truncate();\n $this->usersRepository->create([\n 'name' => 'Omar Furrer',\n 'email' => 'omar.furrer@gmail.com',\n 'password' => '12345678'\n ], 'super admin');\n $this->usersRepository->create([\n 'name' => 'Ahmed EL Gallad',\n 'email' => 'Ahmed.algalladd@gmail.com',\n 'password' => '12345678'\n ], 'super admin');\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach($this->toTruncateTables as $table){\n DB::table($table)->truncate();\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n\n $this->call(UsersTableSeeder::class);\n $this->call(PlugsTableSeeder::class);\n $this->call(ProjectsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n DB::table('churches')->truncate();\n\n Maatwebsite\\Excel\\Facades\\Excel::import(new App\\Imports\\ChurchesImport, storage_path('churches.csv'));\n }", "public function run()\n {\n Model::unguard();\n\n DB::statement(\"SET foreign_key_checks = 0\");\n\n DB::table('roles')->truncate();\n DB::table('role_user')->truncate();\n DB::table('users')->truncate();\n DB::table('berita')->truncate();\n DB::table('kontak')->truncate();\n\n $this->call(UserTableSeeder::class);\n $this->call(BeritaTableSeeder::class);\n $this->call(KontakTableSeeder::class);\n\n $admin = App\\User::find(1);\n $admin->attachRole(1);\n $mahasiswa = App\\User::find(2);\n $mahasiswa->attachRole(2);\n \n $akademik = App\\User::find(3);\n $akademik->attachRole(3);\n\n $rektor = App\\User::find(4);\n $rektor->attachRole(4);\n\n $dekan = App\\User::find(5);\n $dekan->attachRole(5);\n\n $kemahasiswaan = App\\User::find(6);\n $kemahasiswaan->attachRole(6);\n\n $prodi = App\\User::find(7);\n $prodi->attachRole(7);\n\n Model::reguard();\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('config_boletos')->delete();\n\n\t ConfigBoletos::create(array(\n\t 'nombre' => 'General',\n\n\t ));\n\n\t ConfigBoletos::create(array(\n\t 'nombre' => 'Vip',\n\t \n\t ));\n\n\t ConfigBoletos::create(array(\n\t 'nombre' => 'Premium',\n\t \n\t ));\n\n\t ConfigBoletos::create(array(\n\t 'nombre' => 'Gold',\n\t \n\t ));\n\n\t ConfigBoletos::create(array(\n\t 'nombre' => 'Platinum',\n\t \n\t ));\n\n\t ConfigBoletos::create(array(\n\t 'nombre' => 'Cortesía',\n\t \n\t ));\n\n\t DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n }", "private function createMainDatabaseRecords()\n {\n // get the .sql file\n $sql = (string) @file_get_contents( $this->plugin->getPath() . \"/Setup/install.sql\" );\n\n // insert it\n $this->db->exec( $sql );\n }", "public function run()\n {\n\n if (DB::table('users')->exists()) {\n $this->command->getOutput()->writeln('<question>Skipping: '.__CLASS__.'</question>');\n\n return;\n }\n // 清空一数据表\n User::truncate();\n \\App\\Models\\User::factory(100)->create();\n DB::table('users')->where('id', '=', 1)\n ->update(['password' => bcrypt(123456)]);\n }", "private function resetDatabase()\n {\n $dumpFolder = APPLICATION_PATH . '/../data/dumps/';\n\n $directoryIterator = new DirectoryIterator($dumpFolder);\n /**\n * @var Zend_Db_Adapter_Abstract $db\n */\n $db = Zend_Registry::get('db');\n\n foreach ($directoryIterator as $file) {\n if (!$file->isDot()\n && $file->isFile()\n && $file->isReadable()\n ) {\n $sql = file_get_contents($file->getPathname());\n $db->query($sql);\n }\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Sources::truncate();\n\n // Create few columns\n Sources::create(['name' => 'CoinMarketCap', 'url' => 'https://coinmarketcap.com/']);\n Sources::create(['name' => 'CoinCap', 'url' => 'https://coincap.io/']);\n }", "public function run()\n {\n Eloquent::unguard();\n\n $this->createModules();\n $this->createRoles();\n $this->createWorkflows();\n $this->createWfStates();\n $this->createWfSequences();\n\n Eloquent::reguard();\n }", "private function primeDatabaseServer(): void\n {\n try {\n $this->connection->getSchemaManager()->dropAndCreateDatabase(BuoyRepository::BUOY_DATABASE_NAME);\n } catch (\\Exception $e) {\n return;\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0');\n //User::truncate();\n $this->call(SeedUserTable::class);\n $this->call(SeedAlbumTable::class);\n $this->call(SeedPhotoTable::class);\n }", "protected function seedTablesStructure()\n {\n $getStructureDump = new Process(\"mysqldump -u {$this->user} -p{$this->password} --no-data {$this->oldDbName} > {$this->oldDbName}.dump\");\n $getStructureDump->run();\n\n $fillStructureDump = new Process(\"mysql -u {$this->user} -p{$this->password} {$this->newDbName} < {$this->oldDbName}.dump\");\n $fillStructureDump->run();\n\n $removeDumpFile = new Process(\"rm -f {$this->oldDbName}.dump\");\n $removeDumpFile->run();\n }", "public function run()\n {\n Model::unguard();\n \n DB::table('users')->truncate();\n $users = [\n ['name' => 'customer', 'email' => 'customer@test.com', 'password' => Hash::make('admin')],\n ['name' => 'member', 'email' => 'member@test.com', 'password' => Hash::make('admin')],\n ];\n \n foreach ($users as $user) {\n User::create($user);\n }\n\n DB::table('admins')->truncate();\n $admins = [\n ['name' => 'superadmin', 'email' => 'superadmin@test.com', 'password' => Hash::make('admin')],\n ['name' => 'administrator', 'email' => 'administrator@test.com', 'password' => Hash::make('admin')],\n ];\n \n foreach ($admins as $admin) {\n Admin::create($admin);\n }\n\n Model::reguard();\n }", "public function run()\n {\n Model::unguard();\n\n // Temporarily increase memory limit to 2048M\n //ini_set('memory_limit', '2048M');\n\n $this->call('UserDataSeeder');\n\n $this->call('VenueDataSeeder');\n $this->call('ProfileDataSeeder');\n $this->call('EventDataSeeder');\n\n $this->call('RolesSeeder');\n }", "public function run()\n {\n if (app()->environment() === 'production') {\n exit(\"STOP! It's in production!\");\n }\n\n $tables = [\n 'business',\n 'topics',\n 'projects',\n 'posts',\n 'post_topic',\n 'users',\n 'contacts',\n 'auth_groups',\n 'auth_group_permissions',\n 'permissions',\n 'auth_group_users',\n 'auth_group_user_permissions',\n ];\n\n $this->command->info(\"Unguarding models...\");\n\n Model::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n foreach ($tables as $table) {\n DB::table($table)->truncate();\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n\n Cache::flush();\n\n $this->call(UsersTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(ProjectsTableSeeder::class);\n $this->call(PostsTableSeeder::class);\n $this->call(ContactsTableSeeder::class);\n }", "public function run()\n {\n Model::unguard();\n DB::table('provinces')->truncate();\n DB::table('districts')->truncate();\n DB::table('sectors')->truncate();\n DB::table('cells')->truncate();\n //$this->call(UsersTableSeeder::class);\n $this->call(HospitalsTableSeeder::class);\n //$this->call(PatientsTableSeeder::class);\n $this->call(RolesTableSeeder::class);\n //$this->call(AppointmentsTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(SectorsTableSeeder::class);\n //$this->call(CellsTableSeeder::class);\n Model::reguard();\n }", "public function run()\n {\n self::seedUsers();\n $this->command->info('Tabla usuarios inicializada con exito');\n\n self::seedvideos();\n $this->command->info('Tabla Videos inicializada con exito');\n }", "public function run()\n {\n $this->execute('SET FOREIGN_KEY_CHECKS = 0');\n $this->execute('TRUNCATE TABLE tbl_fact_departments');\n\n $sql = file_get_contents(__DIR__ . '/../sql/011_add_it_department.sql');\n $this->execute($sql);\n $sql = file_get_contents(__DIR__ . '/../sql/012_add_departments.sql');\n $this->execute($sql);\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n DB::unprepared(file_get_contents(database_path('sql' . DIRECTORY_SEPARATOR . 'templates.sql')));\n Schema::enableForeignKeyConstraints();\n return;\n\n $this->setupEmailTemplates();\n $this->setupCommunicationResidentTemplates();\n $this->setupCommunicationServiceTemplates();\n }", "public function run()\n {\n \tDB::statement(\"SET foreign_key_checks = 0\");\n $this->call(UserTableSeeder::class);\n $this->call(CimitireTableSeeder::class);\n $this->call(TipuriTableSeeder::class);\n $this->call(TarifeTableSeeder::class);\n $this->call(PersoaneTableSeeder::class);\n }", "public function run()\n\t{\n\t\tModel::unguard();\n\n\t\t//$this->call('UserTableSeeder');\n //$this->command->info('User table seeded!');\n\t\t\n //$this->call('SupplierTableSeeder');\n //$this->command->info('Supplier table seeded!');\n\n //$this->call('CustomerTableSeeder');\n //$this->command->info('Customer table seeded!');\n\n\t\t$this->call('StatusTableSeeder');\n\t\t$this->command->info('Status table seeded!');\n\t}", "public function run()\n {\n $this->command->info('Unguarding models');\n // Model::unguard();\n\n $tables = [\n 'kelurahan',\n 'kecamatan',\n 'kota',\n 'provinsi',\n 'roles',\n 'users',\n 'role_users'\n ];\n\n $this->command->info('Truncating existing tables');\n DB::statement('TRUNCATE TABLE ' . implode(',', $tables). ';');\n\n\n $this->call(ProvinsisTableSeeder::class);\n $this->call(KotaTableSeeder::class);\n $this->call(KecamatansTableSeeder::class);\n $this->call(KelurahanTableSeeder::class);\n $this->call(UserRolesSeeder::class);\n $this->call(UsersSeeder::class);\n $this->call(JenisSeeder::class);\n $this->call(TingkatsSeeder::class);\n $this->call(SaksiTPSSeeder::class);\n $this->call(KorsakTPSSeeder::class);\n $this->call(AdminKecamatanSeeder::class);\n $this->call(AdminKotaSeeder::class);\n $this->call(AdminProvinsiSeeder::class);\n }", "public function run()\n {\n \n\n \\DB::table('portal_user_imports')->delete();\n \n \\DB::table('portal_user_imports')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'portal_id' => 0,\n 'created_at' => '2014-11-05 10:47:32',\n 'updated_at' => '2015-10-26 08:23:54',\n ),\n ));\n \n \n }", "public function run()\n {\n for ($i = 1; $i <= 5; $i++) {\n $path = 'database/sql/simc' . $i . '.sql';\n DB::unprepared(file_get_contents($path));\n $this->command->info($path . ' seeded!');\n } \n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0;');\n DB::table('usuario')->truncate();\n DB::table('rol')->truncate();\n DB::table('rol_usuario')->truncate();\n DB::table('permiso')->truncate();\n DB::table('permiso_rol')->truncate();\n DB::table('permiso_usuario')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS = 1;');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;'); // ignore foreign\n $this->categories();\n // $this->apps();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;'); // set foreign\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n DB::table('users')->truncate();\n DB::table('users')->insert([\n 'full_name'=>'admin',\n 'email'=>'admin@gmail.com',\n 'phone'=>'0987987987',\n 'password'=>Hash::make('123456'),\n 'created_at'=>'2021-01-01'\n ]);\n }", "public function run()\n {\n Model::unguard();\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n foreach($this->toTruncate as $table) {\n DB::table($table)->truncate();\n $this->command->info(\"Truncated table: \" . $table);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n\n $this->call(VehicleClassSeeder::class);\n $this->call(VehicleTypeSeeder::class);\n $this->call(VehicleStatusSeeder::class);\n $this->call(RoleSeeder::class);\n $this->call(LineSeeder::class);\n $this->call(ServiceTypeSeeder::class);\n $this->call(ServiceStatusSeeder::class);\n $this->call(DepotLineCategorySeeder::class);\n\n\n\n $this->call(UserSeeder::class);\n $this->call(VehicleSeeder::class);\n $this->call(ServiceSeeder::class);\n $this->call(DepotSeeder::class);\n $this->call(DepotLineSeeder::class);\n\n\n\n // \\App\\Models\\User::factory(10)->create();\n\n Model::reguard();\n }", "public function main() {\n $this->retrieveUsers();\n\n // Adds genome configurations to user\n // Adds genome uploads and genome updates to genome configurations\n foreach($this->users as &$user) {\n $this->retrieveUserConfigs($user);\n foreach($user['configs'] as &$config) {\n $this->retrieveConfigUploads($config);\n $this->retrieveConfigUpdates($config);\n }\n }\n\n // Removes not used databases\n $this->dropUnusedDatabases();\n }" ]
[ "0.623118", "0.61866564", "0.6112459", "0.6110955", "0.6107453", "0.60146", "0.6013892", "0.600957", "0.6001637", "0.6000314", "0.5997427", "0.5993476", "0.59329826", "0.59306854", "0.5915294", "0.5915249", "0.5905983", "0.58931994", "0.5874136", "0.58732975", "0.5864321", "0.5847184", "0.583668", "0.58301795", "0.5822915", "0.5813139", "0.5811352", "0.58102643", "0.58044124", "0.5797309", "0.5792991", "0.57875395", "0.5785121", "0.5776846", "0.5770439", "0.5768984", "0.57649505", "0.5764075", "0.57598627", "0.5750989", "0.5734796", "0.57321244", "0.5725046", "0.57236665", "0.5722563", "0.5715023", "0.5711561", "0.5706625", "0.5703295", "0.5700042", "0.5697956", "0.5697279", "0.5694119", "0.5684415", "0.5671433", "0.5668624", "0.56643736", "0.56566924", "0.56467974", "0.56417495", "0.5641745", "0.5640885", "0.56382984", "0.563466", "0.5630323", "0.56294835", "0.5628131", "0.5624259", "0.56242216", "0.5623889", "0.56181717", "0.56169593", "0.56124204", "0.5610559", "0.5610528", "0.56092", "0.5608103", "0.56073093", "0.5603373", "0.5603061", "0.56018734", "0.56014216", "0.5596954", "0.55956197", "0.55929375", "0.55913734", "0.55837846", "0.55808645", "0.5579941", "0.55797946", "0.5579655", "0.55795497", "0.55750275", "0.5572167", "0.5571071", "0.55684406", "0.556794", "0.5564103", "0.5563034", "0.5562275", "0.55622333" ]
0.0
-1
Creates table by object name
public static function createObject($name, $params = []) { $className = Orm::detectClass($name); $schema = new Schema(new $className()); $dropTable = isset($params['dropTable']) ? true : false; $schema->create($dropTable); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTable($objSchema);", "public function create_table($name, $data) {\n\t\t$this->execute($this->engine->create_table_sql($name, $data));\n\t}", "function mscaffolding_create_table($name, $data)\n\t{\n\t\t$query_string = \"CREATE TABLE `\" . lconf_get(\"db_name\") . \"`.`\" . $name . \"` (`id` INT NOT NULL AUTO_INCREMENT,\";\n\n\t\tfor ($i = 0; $i < count($data) / 2; $i++)\n\t\t{\n\t\t\t$query_string .= \"`\" . $data[\"name\" . $i] . \"`\" . mscaffolding_get_type($data[\"type\" . $i]);\n\t\t}\n\n\t\t$query_string .= \" PRIMARY KEY ( `id` )) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_slovenian_ci\";\n\n\t\treturn ldb_query($query_string);\n\t}", "private function createTables() {\n \n foreach($this->G->tableInfo as $table) {\n $this->tables[$table[\"title\"]] = new IdaTable($table[\"title\"]);\n } \n }", "abstract public function createTable();", "public function createSchemaTable();", "private function createDummyTable() {}", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\t$table_name \t = $this->table_name;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$query = \"CREATE TABLE {$table_name} (\n\t\t\tid bigint(10) NOT NULL AUTO_INCREMENT,\n\t\t\tname text NOT NULL,\n\t\t\tdate_created datetime NOT NULL,\n\t\t\tdate_modified datetime NOT NULL,\n\t\t\tstatus text NOT NULL,\n\t\t\tical_hash text NOT NULL,\n\t\t\tPRIMARY KEY id (id)\n\t\t) {$charset_collate};\";\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $query );\n\n\t}", "private function createTable($name)\n {\n $create_method = 'createTable' . ucfirst(str_replace(['_'], '', $name));\n\n if(true === method_exists($this, $create_method)){\n $this->{$create_method}();\n } else {\n throw new Exception('Not isset create method for table ' . $name);\n }\n }", "public function makeTable($name)\n {\n $table = new Table($this);\n $table->setName($name);\n return $table;\n }", "abstract public function create_table($table_name, $fields, $primary_key = TRUE);", "protected function createTables()\n {\n $sql = $this->create_table;\n $this->connection->query($sql);\n\n // create again in schema 2\n $sql = str_replace($this->table, \"{$this->schema2}.{$this->table}\", $sql);\n $this->connection->query($sql);\n }", "function createTable($name, $rows);", "function createTables()\n {\n $sqls = $this->simplexmlObject->xpath(\"//table\");\n foreach($sqls as $sql) {\n try {\n $db = $this->getConnection();\n $db->exec($sql);\n $tablename = $sql->getName();\n print(\"Created $tablename table.\\n\");\n $this->closeConnection($db, $sql);\n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n }\n \n }", "private function createNewTable() {\n //generate the create table statement\n $sql = \"create table $this->tableName(\";\n $comma = \"\";\n $keyNameList = [];\n foreach ($this->columns as $column /* @var $column DbColumn */) {\n $sql .= \" $comma $column->columnName $column->dataType $column->extraStuff\";\n $comma = \",\";\n if ($column->primaryKey === true) {\n $keyNameList[] = $column->columnName;\n }\n }\n //generate the primary key list, if any are present\n $primaryKeySql = \"\";\n if (count($keyNameList) > 0) {\n $primaryKeySql = \"primary key(\";\n $comma = \"\";\n foreach ($keyNameList as $keyName) {\n $primaryKeySql = \"$primaryKeySql $comma $keyName\";\n $comma = \",\";\n }\n $primaryKeySql = \",$primaryKeySql)\";\n }\n\n //constraints\n $cSql = \"\";\n //we are assuming that there is at least one table. otherwise, the query would fail anyway.\n $comma = \",\";\n foreach ($this->constraints as $c) {\n $cSql .= \" $comma\";\n switch ($c->constraintType) {\n case \"foreign key\":\n $cSql .= \" FOREIGN KEY($c->columnName) REFERENCES $c->referencesTableName($c->referencesColumnName)\";\n break;\n }\n }\n $sql = \"$sql $primaryKeySql $cSql)\";\n return DbManager::nonQuery($sql);\n }", "protected abstract function createTestTable();", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n\t\tif ( $wpdb->get_var( \"SHOW TABLES LIKE '$this->table_name'\" ) == $this->table_name ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$sql = \"CREATE TABLE \" . $this->table_name . \" (\n\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\n\t\tuser_id bigint(20) NOT NULL,\n\t\tusername varchar(50) NOT NULL,\n\t\temail varchar(50) NOT NULL,\n\t\tname mediumtext NOT NULL,\n\t\tproduct_count bigint(20) NOT NULL,\n\t\tsales_value mediumtext NOT NULL,\n\t\tsales_count bigint(20) NOT NULL,\n\t\tstatus mediumtext NOT NULL,\n\t\tnotes longtext NOT NULL,\n\t\tdate_created datetime NOT NULL,\n\t\tPRIMARY KEY (id),\n\t\tUNIQUE KEY email (email),\n\t\tKEY user (user_id)\n\t\t) CHARACTER SET utf8 COLLATE utf8_general_ci;\";\n\n\t\tdbDelta( $sql );\n\n\t\tupdate_option( $this->table_name . '_db_version', $this->version );\n\t}", "public function table($name)\n {\n return Table::factory($name, $this);\n }", "public function createTable( $table ) {\n\t\t$rawTable = $this->safeTable($table,true);\n\t\t$table = $this->safeTable($table);\n\n\t\t$sql = ' CREATE TABLE '.$table.' (\n \"id\" integer AUTO_INCREMENT,\n\t\t\t\t\t CONSTRAINT \"pk_'.$rawTable.'_id\" PRIMARY KEY(\"id\")\n\t\t )';\n\t\t$this->adapter->exec( $sql );\n\t}", "public function createTable($tableName, $schemaName, $definition){ }", "function createTable ($name, $query)\n\t{\n\t\tqueryMysql(\"CREATE TABLE IF NOT EXISTS $name($query)\");\n\t\techo \"Table $name created or already exists.<br>\";\n\t}", "public static function create_tables() {\n Site::create_table();\n Membership_Area::create_table();\n Restricted_Content::create_table();\n User::create_table();\n }", "function create($tableName)\n{\n\t$this->createFromTable($tableName, PCLIB_DIR.'assets/default-tpl.tpl');\n}", "private function createTables()\n {\n $this->createConfigsTable();\n $this->createServersTable();\n $this->createSearchesTable();\n }", "function maybe_create_table($table_name, $create_ddl)\n {\n }", "public static function createByDefinition($object) {}", "public function createTable()\n\t{\n\t\t$app = Factory::getApplication();\n\n\t\tif ($app->isSite())\n\t\t{\n\t\t\techo 'Error creating DB table - Need to run this in admin area';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$user = Factory::getUser();\n\n\t\tif (!$user->authorise('core.admin'))\n\t\t{\n\t\t\techo 'Error creating DB table - You need to be superadmin user to exeacute this task';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$jinput = $app->input;\n\t\t$context = $jinput->get->get('context', '', 'cmd');\n\n\t\tif (empty($context))\n\t\t{\n\t\t\techo 'Error creating DB table - No context is passed';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$model = $this->getModel('indexer');\n\t\t$model->createTable($context);\n\t}", "function CreateTable($tableName, $tableDefinition)\n{\n $stmt = SQL_CREATE_TABLE . \" IF NOT EXISTS $tableName ($tableDefinition);\";\n return mysql_query($stmt);\n}", "protected function createTable() {\n\t\t$query = \"\n\t\tCREATE TABLE `items` (\n\t\t\t`id`\tINTEGER,\n\t\t\t`firstName`\tTEXT,\n\t\t\t`lastName`\tTEXT,\n\t\t\t`address`\tTEXT,\n\t\t\t'occupation' TEXT,\n\t\t\tPRIMARY KEY(`id`)\n\t\t);\n\t\t\";\n\t\t$this->PDO->query($query);\n\t}", "private function createDBTables(){\n\t\tif (!$this['db']->getSchemaManager()->tablesExist('bookings')){\n\t\t\t$this['db']->executeQuery(\"CREATE TABLE bookings (\n\t\t\t\tid INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\tfirstName VARCHAR(40) NOT NULL,\n\t\t\t\tlastName VARCHAR(40) NOT NULL,\n\t\t\t\tphone VARCHAR(10) NOT NULL,\n\t\t\t\temail VARCHAR(20) DEFAULT NULL,\n\t\t\t\tbirthday DATE NOT NULL,\n\t\t\t\tstartDate DATE NOT NULL,\n\t\t\t\tendDate DATE NOT NULL,\n\t\t\t\tarrivalTime TIME DEFAULT NULL,\n\t\t\t\tadditionalInformation TEXT,\n\t\t\t\tnrOfPeople INT NOT NULL,\n\t\t\t\tpayingMethod VARCHAR(10) NOT NULL\n\t\t\t\t);\");\n\t\t}\n\t}", "function create_table($table_name, $field_name, $field_type, $field_length){\n // $sql_chk = db::query(\"SELECT COUNT(*) AS TOTAL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG='\".strtoupper(db::$_dbName).\"' AND TABLE_NAME = '\".$table_name.\"'\");\n // $rec_chk = db::fetch_array($sql_chk);\n // if($rec_chk['TOTAL'] > 0)\n // {\n // echo \"<script>alert('ตาราง \".$table_name.\" ถูกใช้งานแล้ว กรุณาตรวจสอบ'); window.location.href='\".$_SERVER['HTTP_REFERER'].\"';</script>\";\n // db::db_close();\n // exit;\n // }\n\n $field_length = $field_length == \"\" ? \"\" : \"(\".$field_length.\")\";\n\n $sql_create = \" CREATE TABLE [dbo].[\".$table_name.\"]([\".$field_name.\"] \".$field_type.\" \".$field_length.\" NOT NULL, PRIMARY KEY ([\".$field_name.\"]))\";\n\n }", "public function newTable($name, $attr) {\n $t= new DBTable($name);\n foreach ($attr as $key => $definitions) {\n $t->attributes[]= new DBTableAttribute(\n $key,\n $definitions[0], // Type\n TRUE,\n FALSE,\n $definitions[1] // Length\n );\n }\n $t->indexes[]= new DBIndex(\n 'PRIMARY',\n array('deviceinfo_id')\n );\n $t->indexes[0]->unique= TRUE;\n $t->indexes[0]->primary= TRUE;\n $t->indexes[]= new DBIndex(\n 'deviceinfo_I_serial',\n array('serial_number')\n );\n return $t;\n }", "public function create_tables() {\n\t\tglobal $wpdb;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$schema = \"CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}cn_addressbooks` ( \n\t\t\t`id` INT NOT NULL AUTO_INCREMENT , `name` VARCHAR(100) NOT NULL , `address` VARCHAR(255) NULL , \n\t\t\t`phone` VARCHAR(30) NULL , `created_by` BIGINT(20) NOT NULL , `created_at` DATETIME NOT NULL , \n\t\t\tPRIMARY KEY (`id`)) \n\t\t\t$charset_collate\";\n\n\t\tif ( ! function_exists( 'dbDelta') ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\t\t}\n\n\t\tdbDelta( $schema );\n\t}", "public function createTable($name, array $opts = null);", "public function create()\n {\n parent::create();\n\n $sheet = $this->add_sheet();\n\n $this->add_table($sheet, $this->database, $this->generate_table());\n }", "function lr_make_table($db, $namespace) {\n\n $table = 'lr_'.$namespace;\n $q = \"SHOW TABLES LIKE '$table'\";\n $result = $db->query($q);\n\n // Create the table with columns 'rec', 'sort', and 'text'.\n\n if ($db->numRows($result) < 1) { // Do this only once if necessary!\n $create = \"CREATE TABLE IF NOT EXISTS ?n (rec INT NOT NULL, sort INT NOT NULL, text varchar(255), PRIMARY KEY(rec, sort))\";\n $result = $db->query($create, $table);\n }\n\n return $table;\n}", "protected function createTable() {\n $this->db->initializeQuery();\n $query = \"\nCREATE TABLE `items` (\n`id`INTEGER,\n`name`TEXT,\n`price`REAL,\nPRIMARY KEY(`id`)\n);\n\";\n\n $r = $this->db->q->Expr($query)->execute($this->db->c);\n \n }", "abstract public function setTableName();", "public function createTable( $table ) {\n\t\t$idfield = $this->getIDfield($table, true);\n\t\t$table = $this->safeTable($table);\n\t\t$sql = \"\n CREATE TABLE $table ( $idfield INTEGER PRIMARY KEY AUTOINCREMENT )\n\t\t\t\t \";\n\t\t$this->adapter->exec( $sql );\n\t}", "function createTable($conn, $table)\n { \n /*$sqlStr = \"CREATE TABLE $table(name VARCHAR(150), vendor VARCHAR(150), manufacturer VARCHAR(150), rating DECIMAL(4, 2), quantity INT, PRIMARY KEY(name, vendor))\";*/\n $sqlStr = \"CREATE TABLE $table(name VARCHAR(150) NOT NULL, vendor VARCHAR(150) NOT NULL, manufacturer VARCHAR(150) NOT NULL, rating DECIMAL(4, 2), quantity INT, productID INT primary key AUTO_INCREMENT)\";\n $result = $conn->query($sqlStr);\n if(!result) die($conn->error);\n else\n echo \"Created the $table table.<br />\";\n if(strcmp(\"NEWEGG\", strtoupper($table)) == 0)\n echo \"<br />\";\n }", "public function test_create_table()\n\t{\n\t\t$handler = DB::handler( 'phpunit_sqlite' );\n\t\t\n\t\t$handler->run( \"DROP TABLE IF EXISTS people\" );\n\t\t\n\t\t$handler->run( \n\t\t\"CREATE TABLE people ( \n\t\t\tid INTEGER PRIMARY KEY AUTOINCREMENT, \n\t\t\tname VARCHAR, \n\t\t\tage INTEGER\n\t\t);\");\n\t}", "public static function create_table($name = NULL)\n\t{\n\t\treturn new Database_SQLite_DDL_Create_Table($name);\n\t}", "public static function create($table_name, $column_data)\n {\n $query = 'CREATE TABLE IF NOT EXISTS ' .$table_name.' (';\n foreach ($column_data as $column => $type) {\n $query .= $column.' '.implode(' ', $type).', ';\n }\n $query = rtrim($query, ', ');\n $query .= ') ENGINE = INNODB;';\n Connection::getInstance()->query($query);\n }", "protected function createTables() {\n $foreignKeys = array();\n $this->sortTableQueue($this->_tableCreateQueue, $foreignKeys);\n foreach($this->_tableCreateQueue as $table => $fields) {\n $this->createTable($table, $fields);\n }\n foreach($foreignKeys as $table => $columns) {\n $this->useTable($table);\n foreach($columns as $column => $module) {\n $this->useColumn($column.\"_id\");\n $this->toForeignKey($module.\"_\".$column);\n }\n }\n $this->_tableCreateQueue = array();\n }", "public static function create($data)\n {\n $name = $data['name'];\n $language = $data['language'];\n $columnOption = $data['columnOption'];\n $specificColumns = $data['specificColumns'];\n return new TableType(self::generateId($name), $name, $language, $columnOption, $specificColumns);\n }", "function createTable() {\n print \"\\nCreate table: \".$dbtable.\"\\n\";\n if (createDB()) {\n print \"OK\\n\";\n }\n interceptExit();\n }", "protected function createTable($name)\n\t{\n\t\t$db=$this->getDbConnection();\n\n\t\t$table=new CDbTableSchema;\n\t\t$table->name=$name;\n\t\t$table->rawName=$this->quoteTableName($name);\n\n\t\tif($this->findColumns($table))\n\t\t{\n\t\t\t$this->findConstraints($table);\n\t\t\treturn $table;\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t}", "public function CreateTable($sql){\n\t\t//Create Table\n\t\tif ($this->connection->query($sql) === TRUE) {\n\t\t #echo \"Table has been created successfully\";\n\t\t} else {\n\t\t #echo \"Error to creating table: \".$this->connection->error;\n\t\t}\n\t\t#echo \"<br>\";\n\t}", "public function create()\n {\n $db = XenForo_Application::get('db');\n $db->query('CREATE TABLE `' . self::DB_TABLE . '`\n (`threema_id` CHAR(8) NOT NULL PRIMARY KEY,\n `public_key` CHAR(64) NOT NULL)\n ');\n }", "protected function createTestTables()\n {\n $db = $this->getDb();\n\n $table = 'EmailTemplateAr';\n $columns = [\n 'id' => 'pk',\n 'name' => 'string',\n 'subject' => 'string',\n 'bodyHtml' => 'text',\n ];\n $db->createCommand()->createTable($table, $columns)->execute();\n\n $columns = [\n 'name' => 'TestActiveMessage',\n 'subject' => 'test subject',\n 'bodyHtml' => 'test body HTML',\n ];\n $db->createCommand()->insert($table, $columns)->execute();\n }", "private function createTables()\n {\n $query = array();\n\n // creating games table\n $query[] = \"\n CREATE TABLE IF NOT EXISTS games (\n id INTEGER PRIMARY KEY,\n player1_hash TEXT,\n player1_name TEXT,\n player1_ships TEXT,\n player2_hash TEXT,\n player2_name TEXT,\n player2_ships TEXT,\n timestamp NUMERIC\n )\n \";\n\n // creating events table\n $query[] = \"\n CREATE TABLE IF NOT EXISTS events (\n id INTEGER PRIMARY KEY,\n game_id INTEGER,\n player INTEGER,\n event_type TEXT,\n event_value TEXT,\n timestamp NUMERIC\n )\n \";\n\n foreach ($query as $value) {\n $this->oDB->query($value);\n }\n }", "private function setTableName()\n {\n // Get table name from name of entity if not defined\n if (!$this->tableName) {\n $path = explode('\\\\', get_class($entity));\n $this->tableName = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', array_pop($path))).'s';\n }\n\n // Set table to be used\n $this->adapter->setTable($this->tableName);\n }", "public function createTable()\n {\n $this->dbInstance->query(\"CREATE TABLE IF NOT EXISTS Image\n (\n ImageID int NOT NULL AUTO_INCREMENT,\n Name varchar(255) NOT NULL,\n File varchar(255) NOT NULL,\n Thumb varchar(255) NOT NULL,\n uploadDate DATETIME DEFAULT CURRENT_TIMESTAMP,\n UserFK int,\n PRIMARY KEY (ImageID),\n FOREIGN KEY (UserFK) REFERENCES User(UserID) ON DELETE CASCADE\n )\n \");\n }", "public function createTable($index = null)\n {\n $sql = \"CREATE TABLE IF NOT EXISTS `$this->tableName` (\";\n foreach(static::FIELDS_TYPES as $field => $type) {\n $sql .= \"`$field` $type,\";\n }\n $sql = rtrim($sql, ',');\n $sql .= ') CHARACTER SET utf8 COLLATE utf8_general_ci';\n if (! empty($index)) {\n $sql .= '; ' . $index;\n }\n $this->db->query($sql);\n }", "public function createTable(Source $source, AbstractTable $table);", "function createTableToTemplates(){\n\n\tglobal $mysqli,$templatesTableName;\n\n\t$create=\"CREATE TABLE IF NOT EXISTS `$templatesTableName` (\n\t `id` int(8) NOT NULL AUTO_INCREMENT,\n\t `clienteName` varchar(100) NOT NULL,\n\t `method` text NOT NULL,\n\t `created` TIMESTAMP,\n\t PRIMARY KEY (`id`)\n\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1\";\t\n\n\tif (!$mysqli->query($create)) {\n\t\tshowErrors();\n\t}\n\treturn true;\n}", "public function createTable($tableName)\n {\n $query=\"CREATE TABLE \".$tableName.\" ( `productID` INT NOT NULL AUTO_INCREMENT , `product_name` VARCHAR(255) NOT NULL , `product_description` TEXT NOT NULL , `product_quantity` INT NOT NULL , `product_price` INT NOT NULL , `product_color` VARCHAR(255) NOT NULL , `product_status` INT NOT NULL , `product_picture` TEXT NOT NULL , `post_status` INT NOT NULL , `categoryID` INT NOT NULL , `subCategoryID` INT NOT NULL , `ownerID` INT NOT NULL , `owner_type` INT NOT NULL , `itID` INT NOT NULL , `c_date` DATETIME NOT NULL , PRIMARY KEY (`productID`)) ENGINE = InnoDB;\";\n $validate=$this->db->query($query);\n return $validate?true:false;\n }", "protected function _setupTableName()\n {\n parent::_setupTableName();\t\t\n\t\t $this->_name = $this->getTableName(COMMENT); \n }", "public function createTable()\n\t{\n\t\tphpCAS::traceBegin();\n\n\t\t// initialize the PDO object for this method\n\t\t$pdo = $this->getPdo();\n\t\t$this->setErrorMode();\n\n\t\ttry {\n\t\t\t$pdo->beginTransaction();\n\n\t\t\t$query = $pdo->query($this->_createTableSQL());\n\t\t\t$query->closeCursor();\n\n\t\t\t$pdo->commit();\n\t\t}\n\t\tcatch(PDOException $e) {\n\t\t\t// attempt rolling back the transaction before throwing a phpCAS error\n\t\t\ttry {\n\t\t\t\t$pdo->rollBack();\n\t\t\t}\n\t\t\tcatch(PDOException $e) {}\n\t\t\tphpCAS::error('error creating PGT storage table: ' . $e->getMessage());\n\t\t}\n\n\t\t// reset the PDO object\n\t\t$this->resetErrorMode();\n\n\t\tphpCAS::traceEnd();\n\t}", "function createTableModel()\r\n {\r\n?>\r\n // table model\r\n var <?php echo $this->Name; ?>_tableModel = new qx.ui.table.SimpleTableModel();\r\n <?php\r\n if ($this->owner!=null)\r\n {\r\n ?>\r\n <?php echo $this->owner->Name.\".\".$this->Name; ?>_tableModel=<?php echo $this->Name; ?>_tableModel;\r\n <?php\r\n }\r\n ?>\r\n<?php\r\n }", "private function _createTable() {\n $query = \"\n CREATE TABLE `seo_metadata` (\n `metadata_id` int(11) NOT NULL auto_increment,\n `seo_id` char(60) NOT NULL,\n `seo_title` varchar(255) NOT NULL,\n `seo_description` varchar(255) NOT NULL,\n `seo_keyword` varchar(255) NOT NULL,\n PRIMARY KEY (`metadata_id`),\n KEY `id_idx` (`id`)\n )\";\n $this->getAdapter()->query( $query );\n }", "protected function _setupTableName()\n {\n parent::_setupTableName();\t\t\n\t\t $this->_name = $this->getTableName(USER_RSS); \n }", "function createTable($table_name, $columns_array)\n{\n // $table_name = 'zoho_contact_information_v1';\n $drop_table = \"DROP TABLE IF EXISTS $table_name\";\n execute_sql($drop_table);\n $table = \"CREATE TABLE `$table_name` (\";\n $table .= 'id int NOT NULL PRIMARY KEY AUTO_INCREMENT,';\n\n foreach ($columns_array as $column) {\n $column = str_replace(' ', '__', $column);\n $table .= $column . ' varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,';\n }\n\n $table = trim($table, ',');\n $table .= ') ENGINE=InnoDB DEFAULT CHARSET=utf8;';\n\n execute_sql($table);\n}", "abstract public function getTableName();", "abstract public function getTableName();", "abstract public function getTableName();", "abstract protected function getTableName();", "abstract protected function getTableName();", "public function testTableIsCreated()\n {\n $this->assertFalse($this->connection->tableExists('insight_accounts'));\n $this->insight->getTableName('accounts');\n $this->assertTrue($this->connection->tableExists('insight_accounts'));\n }", "public function create_tables() {\n global $wpdb;\n $charset_collate = $wpdb->get_charset_collate();\n $schema = \"CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}wc_addresses` (\n `id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,\n `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `created_by` bigint(20) unsigned NOT NULL,\n `created_at` datetime DEFAULT NULL,\n PRIMARY KEY (`id`)\n ) $charset_collate\";\n if ( !function_exists( 'dbDelta' ) ) {\n require_once ABSPATH . '/wp-admin/includes/upgrade.php';\n }\n\n dbDelta( $schema );\n }", "public function createTable($table, $file){\n if ($result = $this->query(\"SHOW TABLES LIKE '\".$table.\"'\")) {\n if($result->num_rows == 1) {\n // echo \"Table exists. Skipping Creating table. Moving on to insertion\";\n return true;\n }\n }\n\n $file = fopen($file,'r');\n $column = fgetcsv($file);\n for($i=0;$i<sizeof($column);$i++){\n $this->columnName = implode(\" varchar(20),\",$column);\n }\n $createTable = \"CREATE TABLE \".$table.\"(id INT(11) NOT NULL AUTO_INCREMENT ,\".$this->columnName.\" varchar(20), PRIMARY KEY (`id`))\";\n echo $createTable;\n if($this->query($createTable)){\n // echo \"Created \";\n return true;\n } else {\n // echo \"Not Created\".$this->error;\n return false;\n }\n }", "protected function createOldTable()\n {\n $this->setUpNewTable();\n $this->getSchemaManager()->createTable($this->getOldTable());\n }", "static function create_tables(){\n\t\t$tables = self::get_tables_name();\n\t\textract($tables);\n\t\t\n\t\t$sql[] = \"CREATE TABLE IF NOT EXISTS $cookie(\n\t\t\t\tID bigint unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\tcontent text(100) NOT NULL,\n\t\t\t\ttype varchar(30) NOT NULL,\n\t\t\t\tcamp_id bigint unsigned NOT NULL,\n\t\t\t\taction varchar(30) NOT NULL\t \t\t\t\n\t\t\t)\";\n\t\t\n\t\t$sql[] = \"CREATE TABLE IF NOT EXISTS $display(\n\t\t\t\tID bigint unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\tcontent text(100) NOT NULL,\n\t\t\t\ttype varchar(30) NOT NULL,\n\t\t\t\tcamp_id bigint unsigned NOT NULL\t\t\t\t \t\t\t\n\t\t\t)\";\n\t\t\n\t\tif(!function_exists('dbDelta')) :\n\t\t\tinclude ABSPATH . 'wp-admin/includes/upgrade.php';\n\t\tendif;\n\t\tforeach($sql as $s){\n\t\t\tdbDelta($s);\n\t\t}\n\t\t\n\t}", "abstract public static function getTableName();", "abstract public static function getTableName();", "public function create($tb,$par=[]){\n\n\t\t$def = [];\n\n\t\t$def[\"id\"] = \"int(11) NOT NULL AUTO_INCREMENT,PRIMARY KEY (`id`)\";\n\n\t\t$def[\"pid\"] = \"int(11),key (`pid`)\";\n\n\t\t$def[\"ord\"] = \"int(11)\";\n\n\t\tforeach($this->address as $level=>$parent) \t{\n\n\t\t\t$parent = implode(\"_\",array_slice($this->address,0,$level+1));\n\n\t\t\t$def[\"_$parent\"] = \"int(11) NULL,key (`_$parent`)\";\t}\n\n\t\t$dest = array_merge($this->address,[$tb]);\n\n\t\t$name = end($dest);$tb = implode(\"_\",$dest);\n\n\t\tif(!in_array($tb,$this::$tables ) ){\n\n\t\t\t$cols = [];\n\n\t\t\tforeach($def as $k=>$v) array_push($cols,\"`$k` $v\");\n\n\t\t\t$cols = implode(\",\",$cols);\n\n\t\t\t$res = $this->query(\"CREATE TABLE `$tb` ($cols) ENGINE=MyISAM DEFAULT CHARSET=utf8;\");\n\n\t\t\tarray_push($this::$tables,$tb);\n\n\t\t\t$this::$root->reset();\n\n\t\t\t//if($par!=[]) eval($this->Obj($dest).'->col_add($par);');\n\n\t\t\tif($par!=[]) $this->Obj($dest)->col_add($par);\n\n\t\t}else $res= false;\n\n\t\treturn $res;//bool\n\n\t}", "private function newPostTable () {\n\t\t$query = \n\t\t\t\"CREATE TABLE IF NOT EXISTS a2_posts (hostname VARCHAR(100), url VARCHAR(100), date VARCHAR(20), image VARCHAR(100), text VARCHAR(100), PRIMARY KEY (url))\";\n\t\t$this->sendQuery($query);\n\t}", "protected function _getTableFromString($tableName) {\n\n\t\treturn Kwgl_Db_Table::factory($tableName);\n\n\t}", "public function create_or_upgrade_tables() {\n\t\tif ( is_multisite() ) {\n\t\t\t$this->create_table( $this->ms_table );\n\t\t}\n\n\t\t$this->create_table( $this->table );\n\t}", "public function classToTableName($className);", "protected function setUpObjectRouteModel()\n {\n $container = $this->getContainer();\n\n $route = $container['model/factory']->get(ObjectRoute::class);\n if ($route->source()->tableExists() === false) {\n $route->source()->createTable();\n }\n }", "function createTable($name, $query)\n {\n echo \"Creating table '$name' ... \";\n //a fuction included in functions.php\n queryMysql(\"CREATE TABLE IF NOT EXISTS $name($query)\");\n echo \"OK <br>\";\n }", "function createTable($ctx){\r\n\t\t$create =\r\n 'CREATE TABLE IF NOT EXISTS `'.$ctx.'` ('.\r\n '`key` VARCHAR( 60 ) NOT NULL ,'.\r\n '`willExpireAt` int NOT NULL DEFAULT 0 ,'.\r\n\t\t'`lastModified` int NOT NULL DEFAULT 0, '.\r\n '`content` TEXT NULL ,PRIMARY KEY ( `key` ));';\r\n\r\n\t\tif(strlen($this->stm['before_create']) > 0 ){\r\n\t\t\t$this->db->Execute($this->stm['before_create'], array()) or die();\r\n\t\t}\r\n\t\t$dict = NewDataDictionary($this->db);\r\n\t\t$x = $dict->ExecuteSQLArray(array($create)) or die();\r\n\t\treturn $x;\r\n\t}", "function table ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('ttable');\n return $rc->newInstanceArgs( $arguments ); \n}", "public function createTable()\n {\n $sql = \"\n CREATE TABLE IF NOT EXISTS `\".self::TABLE.\"`(\n `migration` VARCHAR(20) NOT NULL,\n `up` VARCHAR(1000) NOT NULL,\n `down` VARCHAR(1000) NOT NULL\n ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;\n \";\n\n $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n }", "public function insertTable($model)\n {\n\t$modelName= is_object($model) ? $model->getTableName() : $model;\n\t$sql=array();\n\t$sql[] = $this->sql('insert into [tables] values (null, %s, %s);', $model->getTableName(), $model->getHash() );\n\tforeach($model->getFields() as $field )\n\t{\n\t $sql[] = $this->sql('insert into [fields] values (null, %s, %s, %s, %s);',\n\t strtolower($field->getName()),\n\t $model->getTableName(),\n\t $field->getHash(),\n\t get_class($field));\n\t}\n\t$this->queue(\n\t PerfORMStorage::TABLE_ADD,\n\t $modelName,\n\t $sql,\n\t array(\n\t\t'model' => $model)\n\t );\n\n\t$key= $model->getHash();\n\tif ( key_exists($key, $this->renamedTables))\n\t{\n\t $array= $this->renamedTables[$key];\n\t $array->counter++;\n\t $array->to= $modelName;\n\t}\n\telse\n\t{\n\t $this->renamedTables[$key]= (object) array(\n\t 'counter' => 1,\n\t 'to' => $modelName,\n\t );\n\t}\n }", "public function createEntity($name);", "abstract protected function create(Blueprint $table);", "function createTable($mifix = \"\", $data_table, $params = array(), $debug = FALSE)\n\t\t{\n\t\t\t$c = new rex_sql;\n\t\t\t$c->debugsql = $debug;\n\t\t\t$c->setQuery('CREATE TABLE IF NOT EXISTS `'.$data_table.'` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY );');\n\n\t\t\t// Tabellenset in die Basics einbauen, wenn noch nicht vorhanden\n\t\t\t$c = new rex_sql;\n\t\t\t$c->debugsql = $debug;\n\t\t\t$c->setQuery('DELETE FROM rex_'.$mifix.'_table where table_name=\"'.$data_table.'\"');\n\t\t\t$c->setTable('rex_'.$mifix.'_table');\n\n\t\t\t$params[\"table_name\"] = $data_table;\n\t\t\tif(!isset($params[\"status\"])) { $params[\"status\"] = 1; }\n\t\t\tif(!isset($params[\"name\"])) { $params[\"name\"] = 'Tabelle \"'.$data_table.'\"'; }\n\t\t\tif(!isset($params[\"prio\"])) { $params[\"prio\"] = 100; }\n\t\t\tif(!isset($params[\"search\"])) { $params[\"search\"] = 0; }\n\t\t\tif(!isset($params[\"hidden\"])) { $params[\"hidden\"] = 0; }\n\t\t\tif(!isset($params[\"export\"])) { $params[\"export\"] = 0; }\n\n\t\t\tforeach($params as $k => $v) { $c->setValue($k, $v); }\n\t\t\t$c->insert();\n\n\t\t\treturn TRUE;\n\n\t\t}", "public function createTables()\r\n {\r\n $sql = \"\r\n CREATE TABLE IF NOT EXISTS coins\r\n (\r\n id INT NOT NULL AUTO_INCREMENT,\r\n playername VARCHAR(32) NOT NULL,\r\n coins INT NOT NULL,\r\n ip VARCHAR(32) NOT NULL,\r\n cid VARCHAR(64) NOT NULL,\r\n PRIMARY KEY (id)\r\n );\r\n \";\r\n self::update($sql);\r\n }", "function create()\n {\n $this->definitions['columns'] =& $this->columns;\n return $this->connection->create_table($this->name, $this->definitions);\n }", "function table_creation(){\n\t\tglobal $wpdb;\n\t\t\t$table = $wpdb->prefix.'wiki';\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `$table`(\n\t\t\t\t`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t`post_id` bigint(20) NOT NULL,\n\t\t\t\t`author_id` bigint(20) NOT NULL,\t\n\t\t\t\t`post_content` longtext collate utf8_general_ci,\n\t\t\t\t`percent` int(100),\n\t\t\t\t`matched_keys` longtext collate utf8_general_ci,\n\t\t\t\t`time` TIMESTAMP,\t\t\t\t\n\t\t\t\tPRIMARY KEY(id)\n\t\t\t\t\n\t\t\t\t)\";\n\t\t\t//loading the dbDelta function manually\n\t\t\tif(!function_exists('dbDelta')) :\n\t\t\t\trequire_once(ABSPATH.'wp-admin/includes/upgrade.php');\n\t\t\tendif;\n\t\t\tdbDelta($sql);\n\t}", "private function createObject($name,$object)\n {\n $this->cache->set($name, $object);\n }", "private function _createTables()\r\n {\r\n return true;\r\n }", "public function createTable()\n {\n $table = self::$table_name;\n $SQL = <<<EOD\n CREATE TABLE IF NOT EXISTS `$table` (\n `communication_usage_id` INT(11) NOT NULL AUTO_INCREMENT,\n `communication_usage_name` VARCHAR(32) NOT NULL DEFAULT '',\n `communication_usage_description` VARCHAR(255) NOT NULL DEFAULT '',\n PRIMARY KEY (`communication_usage_id`),\n UNIQUE (`communication_usage_name`)\n )\n COMMENT='The communication usage definition table'\n ENGINE=InnoDB\n AUTO_INCREMENT=1\n DEFAULT CHARSET=utf8\n COLLATE='utf8_general_ci'\nEOD;\n try {\n $this->app['db']->query($SQL);\n $this->app['monolog']->addInfo(\"Created table 'contact_communication_usage'\", array(__METHOD__, __LINE__));\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }", "public function newTable($items);", "public abstract function getCreateTable(Table $table, $config);", "protected function createTables()\n {\n $this->table = new SwooleTable;\n\n $tables = $this->container['config']->get('swoole_http.tables', []);\n foreach ($tables as $key => $value) {\n $table = new Table($value['size']);\n $columns = $value['columns'] ?? [];\n foreach ($columns as $column) {\n if (isset($column['size'])) {\n $table->column($column['name'], $column['type'], $column['size']);\n } else {\n $table->column($column['name'], $column['type']);\n }\n }\n $table->create();\n\n $this->table->add($key, $table);\n }\n }", "public function create($if_not_exists = false) {\n $db = DB::getInstance();\n\n $query = [];\n $query[] = 'CREATE TABLE';\n if ($if_not_exists) {\n $query[] = 'IF NOT EXISTS';\n }\n $query[] = $db->quoteIdentifier($this->prefix . $this->name);\n\n $fields = [];\n foreach ($this->fields as $item) {\n $fields[] = ' ' . $item;\n }\n foreach ($this->keys as $item) {\n $fields[] = ' ' . $item;\n }\n\n $query[] = \"(\\n\" . implode(\",\\n\", $fields) . \"\\n)\";\n\n return implode(' ', $query);\n }", "protected function createTableSql($name, $table) {\n $sql_fields = [];\n foreach ($table['fields'] as $field_name => $field) {\n $sql_fields[] = $this->createFieldSql($name, $field_name, $this->processField($field));\n }\n\n // Use already prefixed table name.\n $table_prefixed = $this->connection->prefixTables('{' . $name . '}');\n\n $sql = \"CREATE TABLE [{$table_prefixed}] (\" . PHP_EOL;\n $sql .= implode(\",\" . PHP_EOL, $sql_fields);\n $sql .= PHP_EOL . \")\";\n return $sql;\n }" ]
[ "0.7366268", "0.6837029", "0.6678718", "0.6641651", "0.64962053", "0.6429583", "0.64194125", "0.6418981", "0.6403893", "0.6400989", "0.6390918", "0.632641", "0.6312192", "0.6302289", "0.62765783", "0.6247956", "0.62088084", "0.62014735", "0.61837286", "0.6172391", "0.6149655", "0.6137969", "0.6135892", "0.6118978", "0.61162984", "0.6110683", "0.6054784", "0.605145", "0.6045647", "0.6037098", "0.60227984", "0.6014536", "0.60099256", "0.5992418", "0.5991568", "0.5986478", "0.5984273", "0.5976456", "0.5965677", "0.59636277", "0.59335464", "0.5929676", "0.58978325", "0.58966964", "0.58747166", "0.58676296", "0.58616143", "0.5844288", "0.58393055", "0.5833818", "0.5833044", "0.5824816", "0.5798331", "0.57982546", "0.5793023", "0.5784505", "0.57804996", "0.5779654", "0.57721275", "0.5767223", "0.57606894", "0.5752944", "0.5752353", "0.573897", "0.573897", "0.573897", "0.5726839", "0.5726839", "0.57241416", "0.57164794", "0.57020247", "0.57012236", "0.569971", "0.56988245", "0.56988245", "0.5696723", "0.5696678", "0.56947106", "0.56933033", "0.5680753", "0.56750184", "0.56718755", "0.5670379", "0.56687206", "0.56658393", "0.56617284", "0.56603307", "0.56539804", "0.56526864", "0.5646208", "0.56427056", "0.56399393", "0.5638429", "0.5635419", "0.5635394", "0.5623786", "0.56230646", "0.5621474", "0.56176394", "0.56128865" ]
0.61418855
21
Rebuilds table for object, rebuild param drops existing tables
public function create($rebuild = false) { if ($rebuild) { MySQL::query('DROP TABLE `' . $this->_table . '`'); MySQL::query('DROP TABLE `' . $this->_table . '_Lang`'); } if (isset($this->_fields['languageTable'])) { MySQL::query('CREATE TABLE IF NOT EXISTS `' . $this->_table . '_Lang` ( `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `' . strtolower($this->_table) . '_id` int NOT NULL, `lang` char(2) NOT NULL, `field` varchar(20) NOT NULL, `value` MEDIUMTEXT )'); } MySQL::query('CREATE TABLE IF NOT EXISTS `' . $this->_table . '` (' . $this->_prepareFields() . ')'); foreach ($this->_object->relations() as $relation) { if ($relation['type'] == 'multiple') { MySQL::query('CREATE TABLE IF NOT EXISTS `' . $relation['table'] . '` ( `' . $this->_table . '` int NOT NULL, `' . $relation['class'] . '` int NOT NULL )'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rebuild()\r\n {\r\n $this->delete(array());\r\n\r\n $table = new Car_Types();\r\n\r\n $this->rebuildStep($table, array(0), 0);\r\n }", "public function refreshTable();", "function buildTable($schedule,$users){\n\t\t$this->refreshTable();\n\t}", "private function rebuildIndex()\n {\n foreach ($this->rows as $id => $row) {\n $label = $row->getColumn('label');\n if ($label !== false) {\n $this->rowsIndexByLabel[$label] = $id;\n }\n }\n $this->indexNotUpToDate = false;\n }", "public function rebuildIndex()\n {\n $this->elastic->deleteIndex(self::INDEX);\n $this->elastic->addIndexCompanion(self::INDEX);\n }", "function refreshTable(){\n\t\t$this->table = array();\n\n\t\t//set the column headers\n\t\t$this->table[0] = $this->getColumnHeaders();\n\n\t\t//add a row for each user\n\t\tforeach ($this->users as $name => $schedule) {\n\t\t\t$row = array();\n\n\t\t\t//if this user is being edited\n\t\t\tif($this->currentEdit == $name) $row = $this->userEditRow($name, $schedule, $this->table[0]);\n\t\t\telse $row = $this->userDisplayRow($name, $schedule, $this->table[0]);\n\t\t\t\n\t\t\tarray_push($this->table, $row);\n\t\t}\n\n\t\tarray_push($this->table, $this->genSubmitRow());\n\n\t\tarray_push($this->table, $this->genTotalRow());\n\n\t\t$this->logMsg(SUCCESS, 'internal table constructed');\n\t}", "public function resetTable();", "function revert_table() {\r\n $this->_table = $this->_table_org;\r\n $this->_table_org = NULL;\r\n }", "public function tableModify()\n {\n }", "public function tableModify()\n {\n }", "public function tableModify()\n {\n }", "public function tableModify()\n {\n }", "function OptimizeTables() {}", "function __alter_table($table, $alterdefs)\r\n{\r\n global $g_current_db;\r\n\r\n $sql = \"SELECT sql,name,type FROM sqlite_master WHERE tbl_name = '\" . $table . \"' ORDER BY type DESC\";\r\n $result = sqlite_query($g_current_db, $sql);\r\n\r\n if (($result === false) || (sqlite_num_rows($result) <= 0)) {\r\n trigger_error('no such table: ' . $table, E_USER_WARNING);\r\n return false;\r\n }\r\n // ------------------------------------- Build the queries\r\n $row = sqlite_fetch_array($result);\r\n $tmpname = 't' . time();\r\n $origsql = trim(preg_replace(\"/[\\s]+/\", \" \", str_replace(\",\", \", \", preg_replace(\"/[\\(]/\", \"( \", $row['sql'], 1))));\r\n $createtemptableSQL = 'CREATE TEMPORARY ' . substr(trim(preg_replace(\"'\" . $table . \"'\", $tmpname, $origsql, 1)), 6);\r\n $origsql = substr($origsql, 0, strlen($origsql)-1); // chops the ) at end\r\n $createindexsql = array();\r\n $i = 0;\r\n $defs = preg_split(\"/[,]+/\", $alterdefs, -1, PREG_SPLIT_NO_EMPTY);\r\n $prevword = $table;\r\n $oldcols = preg_split(\"/[,]+/\", substr(trim($createtemptableSQL), strpos(trim($createtemptableSQL), '(') + 1), -1, PREG_SPLIT_NO_EMPTY);\r\n $oldcols = preg_split(\"/[,]+/\", substr(trim($origsql), strpos(trim($origsql), '(') + 1), -1, PREG_SPLIT_NO_EMPTY);\r\n $newcols = array();\r\n\r\n for($i = 0;$i < sizeof($oldcols);$i++) {\r\n $colparts = preg_split(\"/[\\s]+/\", $oldcols[$i], -1, PREG_SPLIT_NO_EMPTY);\r\n $oldcols[$i] = $colparts[0];\r\n $newcols[$colparts[0]] = $colparts[0];\r\n }\r\n\r\n $newcolumns = '';\r\n $oldcolumns = '';\r\n reset($newcols);\r\n\r\n while (list($key, $val) = each($newcols)) {\r\n $newcolumns .= ($newcolumns?', ':'') . $val;\r\n $oldcolumns .= ($oldcolumns?', ':'') . $key;\r\n }\r\n\r\n $copytotempsql = 'INSERT INTO ' . $tmpname . '(' . $newcolumns . ') SELECT ' . $oldcolumns . ' FROM ' . $table;\r\n $dropoldsql = 'DROP TABLE ' . $table;\r\n $createtesttableSQL = $createtemptableSQL;\r\n\r\n $newname = \"\";\r\n\r\n foreach($defs as $def) {\r\n $defparts = preg_split(\"/[\\s]+/\", $def, -1, PREG_SPLIT_NO_EMPTY);\r\n $action = strtolower($defparts[0]);\r\n\r\n switch ($action) {\r\n case 'add':\r\n\r\n if (sizeof($defparts) <= 2) {\r\n /**\r\n * * mySQL gives no such user_warning\r\n * trigger_error('near \"' . $defparts[0] . ($defparts[1]?' ' . $defparts[1]:'') . '\": SQLITE syntax error', E_USER_WARNING);\r\n *\r\n * //\r\n */\r\n return false;\r\n }\r\n $createtesttableSQL = substr($createtesttableSQL, 0, strlen($createtesttableSQL)-1) . ',';\r\n for($i = 1;$i < sizeof($defparts);$i++)\r\n $createtesttableSQL .= ' ' . $defparts[$i];\r\n $createtesttableSQL .= ')';\r\n break;\r\n\r\n case 'change':\r\n\r\n if (sizeof($defparts) <= 2) {\r\n trigger_error('near \"' . $defparts[0] . ($defparts[1]?' ' . $defparts[1]:'') . ($defparts[2]?' ' . $defparts[2]:'') . '\": SQLITE syntax error', E_USER_WARNING);\r\n return false;\r\n }\r\n if ($severpos = strpos($createtesttableSQL, ' ' . $defparts[1] . ' ')) {\r\n if ($newcols[$defparts[1]] != $defparts[1]) {\r\n trigger_error('unknown column \"' . $defparts[1] . '\" in \"' . $table . '\"', E_USER_WARNING);\r\n return false;\r\n }\r\n $newcols[$defparts[1]] = $defparts[2];\r\n $nextcommapos = strpos($createtesttableSQL, ',', $severpos);\r\n $insertval = '';\r\n for($i = 2;$i < sizeof($defparts);$i++)\r\n $insertval .= ' ' . $defparts[$i];\r\n if ($nextcommapos)\r\n $createtesttableSQL = substr($createtesttableSQL, 0, $severpos) . $insertval . substr($createtesttableSQL, $nextcommapos);\r\n else\r\n $createtesttableSQL = substr($createtesttableSQL, 0, $severpos - (strpos($createtesttableSQL, ',')?0:1)) . $insertval . ')';\r\n } else {\r\n trigger_error('unknown column \"' . $defparts[1] . '\" in \"' . $table . '\"', E_USER_WARNING);\r\n return false;\r\n }\r\n break;\r\n\r\n case 'drop';\r\n\r\n if (sizeof($defparts) < 2) {\r\n trigger_error('near \"' . $defparts[0] . ($defparts[1]?' ' . $defparts[1]:'') . '\": SQLITE syntax error', E_USER_WARNING);\r\n return false;\r\n }\r\n /**\r\n * if ($severpos = strpos($createtesttableSQL, ' ' . $defparts[1] . ' ')) {\r\n * could end with , or ) if no type!!!!\r\n *\r\n * //\r\n */\r\n if (($severpos = strpos($createtesttableSQL, ' ' . $defparts[1] . ' ')) || ($severpos = strpos($createtesttableSQL, ' ' . $defparts[1] . ',')) || ($severpos = strpos($createtesttableSQL, ' ' . $defparts[1] . ')'))) {\r\n $nextcommapos = strpos($createtesttableSQL, ',', $severpos);\r\n if ($nextcommapos)\r\n $createtesttableSQL = substr($createtesttableSQL, 0, $severpos) . substr($createtesttableSQL, $nextcommapos + 1);\r\n else\r\n $createtesttableSQL = substr($createtesttableSQL, 0, $severpos - (strpos($createtesttableSQL, ',')?0:1)) . ')';\r\n unset($newcols[$defparts[1]]);\r\n /* RUBEM */ $createtesttableSQL = str_replace(\",)\", \")\", $createtesttableSQL);\r\n } else {\r\n trigger_error('unknown column \"' . $defparts[1] . '\" in \"' . $table . '\"', E_USER_WARNING);\r\n return false;\r\n }\r\n break;\r\n\r\n case 'rename'; // RUBEM\r\n if (sizeof($defparts) < 2) {\r\n trigger_error('near \"' . $defparts[0] . ($defparts[1]?' ' . $defparts[1]:'') . '\": SQLITE syntax error', E_USER_WARNING);\r\n return false;\r\n }\r\n $newname = $defparts[2];\r\n break;\r\n\r\n default:\r\n\r\n trigger_error('near \"' . $prevword . '\": SQLITE syntax error', E_USER_WARNING);\r\n return false;\r\n } // switch\r\n $prevword = $defparts[sizeof($defparts)-1];\r\n } // foreach\r\n // This block of code generates a test table simply to verify that the columns specifed are valid\r\n // in an sql statement. This ensures that no reserved words are used as columns, for example\r\n sqlite_query($g_current_db, $createtesttableSQL);\r\n $err = sqlite_last_error($g_current_db);\r\n if ($err) {\r\n trigger_error(\"Invalid SQLITE code block: \" . sqlite_error_string($err) . \"\\n\", E_USER_WARNING);\r\n return false;\r\n }\r\n $droptempsql = 'DROP TABLE ' . $tmpname;\r\n sqlite_query($g_current_db, $droptempsql);\r\n // End test block\r\n // Is it a Rename?\r\n if (strlen($newname) > 0) {\r\n // $table = preg_replace(\"/([a-z]_)[a-z_]*/i\", \"\\\\1\" . $newname, $table);\r\n // what do want with the regex? the expression should be [a-z_]! hans\r\n // why not just\r\n $table = $newname;\r\n }\r\n $createnewtableSQL = 'CREATE ' . substr(trim(preg_replace(\"'\" . $tmpname . \"'\", $table, $createtesttableSQL, 1)), 17);\r\n\r\n $newcolumns = '';\r\n $oldcolumns = '';\r\n reset($newcols);\r\n\r\n while (list($key, $val) = each($newcols)) {\r\n $newcolumns .= ($newcolumns?', ':'') . $val;\r\n $oldcolumns .= ($oldcolumns?', ':'') . $key;\r\n }\r\n $copytonewsql = 'INSERT INTO ' . $table . '(' . $newcolumns . ') SELECT ' . $oldcolumns . ' FROM ' . $tmpname;\r\n // ------------------------------------- Perform the actions\r\n if (sqlite_query($g_current_db, $createtemptableSQL) === false) return false; //create temp table\r\n if (sqlite_query($g_current_db, $copytotempsql) === false) return false; //copy to table\r\n if (sqlite_query($g_current_db, $dropoldsql) === false) return false; //drop old table\r\n if (sqlite_query($g_current_db, $createnewtableSQL) === false) return false; //recreate original table\r\n if (sqlite_query($g_current_db, $copytonewsql) === false) return false; //copy back to original table\r\n if (sqlite_query($g_current_db, $droptempsql) === false) return false; //drop temp table\r\n return true;\r\n}", "public function rebuild()\n\t{\n\t\t$id=3;\n\t\t$dataAlbum = $this->admin->data_album($id);\n\t\t$namaAlbum = $dataAlbum->row()->nama_album;\n\t\t$albumKey = $dataAlbum->row()->kode_album;\n\t\t$data['title'] = \"Dashboard | FaceVoting Versi 1.0\";\n\t\t$data['getRebuild']= $this->_prosesRebuild($namaAlbum,$albumKey);\n\t\t$view ='v_rebuildalbum';\n\t\t$this->_template($data,$view);\n\t}", "public function reloadFromConfig($config)\n {\n $this->schema = $config;\n if (!isset($this->schema['create'])) {\n $this->schema['create'] = array();\n }\n if (!isset($this->schema['update'])) {\n $this->schema['update'] = array();\n }\n if (!isset($this->schema['seed'])) {\n $this->schema['seed'] = array();\n }\n $this->tables = array();\n foreach ($this->schema['create'] as $name => $fields) {\n $table = $this->makeTable($name);\n $columns = array_keys($fields);\n foreach ($columns as $name) {\n $table->addColumn(new Property($name));\n }\n $this->addTable($table);\n }\n }", "public function reindexAll()\n {\n\n //@todo: indexers should be dynamically injected. Probable via `$this->getIndeces()`\n /** @var St_SphinxSearch_Model_Fulltext $fulltextIndex */\n $fulltextIndex = Mage::getModel('st_sphinxsearch/fulltext');\n\n $fulltextIndex->rebuildIndex();\n\n return;\n /** @var Mage_Core_Model_Resource $resourceSingleton */\n $resourceSingleton = Mage::getSingleton('core/resource');\n\n /** @var Varien_Db_Adapter_Interface $writeAdapater */\n $writeAdapater = $resourceSingleton->getConnection('core_write');\n\n /** @var Varien_Db_Adapter_Interface $readAdapter */\n $readAdapter = $resourceSingleton->getConnection('core_read');\n\n /** @var string $tableName */\n $tableName = $readAdapter->getTableName('st_sphinxsearch_fulltext_tmp');\n\n /** @var Mage_CatalogSearch_Model_Resource_Indexer_Fulltext $indexerFulltext */\n $indexerFulltext = Mage::getResourceModel('catalogsearch/indexer_fulltext');\n\n $fulltextTableName = $indexerFulltext->getTable('fulltext');\n\n $sql = \"CREATE TABLE IF NOT EXISTS `$tableName` LIKE `$fulltextTableName`\";\n\n $writeAdapater->query($sql);\n $t=1;\n }", "private function prepareTables() {}", "public function change()\n {\n\n $query =\n <<<'EOD'\nCREATE TABLE core_acl_role (\n id INTEGER,\n name TEXT NOT NULL,\n init_obj_id INTEGER REFERENCES obj (obj_id),\n description TEXT,\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_acl_role');\nSELECT ddl_history_tbl('core_acl_role', 'recreate');\n\nINSERT INTO core_acl_role (id, name, description) VALUES\n (1, 'admin', NULL),\n (2, 'guest', NULL),\n (3, 'user', NULL);\n\nCREATE TABLE core_acl_resource (\n id INTEGER,\n name TEXT NOT NULL,\n description TEXT,\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_acl_resource');\nSELECT ddl_history_tbl('core_acl_resource', 'recreate');\n\n\nINSERT INTO core_acl_resource (id, name, description) VALUES\n (1, 'admin_area', NULL),\n (2, '*', NULL);\n\nCREATE TABLE core_acl_resource_access (\n id INTEGER NOT NULL,\n resource_id INTEGER NOT NULL,\n name TEXT NOT NULL,\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_acl_resource_access');\nSELECT ddl_history_tbl('core_acl_resource_access', 'recreate');\n\nINSERT INTO core_acl_resource_access (id, resource_id, name) VALUES\n (1, 1, '*');\n\n\nCREATE TABLE core_acl_access_list (\n id INTEGER NOT NULL,\n role_id INTEGER NOT NULL,\n resource_id INTEGER NOT NULL,\n access_id INTEGER NOT NULL,\n allowed INTEGER NOT NULL,\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_acl_resource_access');\nSELECT ddl_history_tbl('core_acl_resource_access', 'recreate');\n\n\nINSERT INTO core_acl_access_list (id, role_id, resource_id, access_id, allowed) VALUES\n (1, 1, 1, 1, 1);\n\n\nCREATE TABLE core_acl_role_inherit (\n id INTEGER NOT NULL,\n role_id INTEGER NOT NULL,\n inherit_role_id INTEGER NOT NULL,\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_acl_role_inherit');\nSELECT ddl_history_tbl('core_acl_role_inherit', 'recreate');\n\n\n/*CREATE TYPE core_menu_item_status AS ENUM ('active', 'noactive');*/\n\n\nCREATE TABLE core_menu_item (\n id INTEGER NOT NULL,\n menu_id INTEGER NOT NULL,\n controller_id INTEGER NOT NULL,\n parent_id INTEGER NOT NULL DEFAULT '0',\n alias TEXT NOT NULL,\n title TEXT NOT NULL,\n description TEXT NOT NULL DEFAULT '',\n image TEXT NOT NULL DEFAULT '',\n position INTEGER NOT NULL DEFAULT '1',\n state_id INTEGER NOT NULL REFERENCES ref (obj_id) DEFAULT state_id('core.core_menu_item.active'),\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_menu_item');\nSELECT ddl_history_tbl('core_menu_item', 'recreate');\nSELECT create_state('core.core_menu_item', 'active,noactive', NULL);\n\n\nINSERT INTO core_menu_item (id, menu_id, controller_id, parent_id, alias, title, description, image, position, state_id)\nVALUES\n (1, 1, '-1', 0, '', 'Settings', 'Project settings', '', 5, state_id('core.core_menu_item.active')),\n (2, 1, '-1', 1, '', 'User acccesses', '', '', 1, state_id('core.core_menu_item.active')),\n (3, 1, '6', 2, '', 'Roles', '', '', 1, state_id('core.core_menu_item.active')),\n (4, 1, '-1', 1, '', 'Menu', '', '', 2, state_id('core.core_menu_item.active')),\n (5, 1, '-1', 1, '', 'Mvc', '', '', 3, state_id('core.core_menu_item.active')),\n (7, 1, '2', 4, '', 'Items', '', '', 2, state_id('core.core_menu_item.active')),\n (8, 1, '3', 5, '', 'Modules', '', '', 1, state_id('core.core_menu_item.active')),\n (9, 1, '4', 5, '', 'Controllers', '', '', 2, state_id('core.core_menu_item.active')),\n (10, 1, '5', 5, '', 'Actions', '', '', 3, state_id('core.core_menu_item.active')),\n (11, 1, '1', 4, '', 'Menus', '', '', 1, state_id('core.core_menu_item.active')),\n (12, 1, '7', 2, '', 'Accesses', '', '', 4, state_id('core.core_menu_item.active')),\n (13, 1, '8', 2, '', 'Resources', '', '', 2, state_id('core.core_menu_item.active')),\n (14, 1, '9', 2, '', 'Access list', '', '', 5, state_id('core.core_menu_item.active')),\n (19, 1, '14', 15, '', 'Settings', 'Cron settings', '', 0, state_id('core.core_menu_item.active')),\n (20, 1, '15', 2, '', 'Users', '', '', 5, state_id('core.core_menu_item.active'));\n\n\nCREATE TABLE core_menu_menus (\n id INTEGER NOT NULL,\n name TEXT NOT NULL,\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_menu_item');\nSELECT ddl_history_tbl('core_menu_item', 'recreate');\n\nINSERT INTO core_menu_menus (id, name) VALUES\n (1, 'admin');\n\nCREATE TABLE core_mvc_action (\n id INTEGER NOT NULL,\n controller_id INTEGER NOT NULL,\n name TEXT NOT NULL,\n state_id INTEGER REFERENCES ref (obj_id) DEFAULT state_id('core.core_mvc_action.active'),\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_mvc_action');\nSELECT ddl_history_tbl('core_mvc_action', 'recreate');\nSELECT create_state('core.core_menu_item', 'active,not_active', NULL);\n\n\n/*CREATE TYPE core_mvc_module_status AS ENUM ('active', 'not_active');*/\n\n\nCREATE TABLE core_mvc_module (\n id INTEGER NOT NULL,\n name TEXT NOT NULL,\n state_id INTEGER NOT NULL DEFAULT state_id('core.core_mvc_module.active'),\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_mvc_module');\nSELECT ddl_history_tbl('core_mvc_module', 'recreate');\nSELECT create_state('core.core_mvc_module', 'active,noactive', NULL);\n\n\nINSERT INTO core_mvc_module (id, name, state_id) VALUES\n (1, 'admin', state_id('core.core_mvc_module.active')),\n (2, 'core', state_id('core.core_mvc_module.active')),\n (4, 'user', state_id('core.core_mvc_module.active'));\n\nCREATE TABLE core_mvc_controller (\n id INTEGER NOT NULL,\n module_id INTEGER NOT NULL,\n name TEXT NOT NULL,\n state_id INTEGER NOT NULL DEFAULT state_id('core.core_mvc_module.active'),\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_mvc_controller');\nSELECT ddl_history_tbl('core_mvc_controller', 'recreate');\nSELECT create_state('core.core_mvc_controller', 'active,noactive', NULL);\n\n\nINSERT INTO core_mvc_controller (id, module_id, name, state_id) VALUES\n (1, 2, 'menu-menus', state_id('core.core_mvc_controller.active')),\n (2, 2, 'menu-item', state_id('core.core_mvc_controller.active')),\n (3, 2, 'mvc-module', state_id('core.core_mvc_controller.active')),\n (4, 2, 'mvc-controller', state_id('core.core_mvc_controller.active')),\n (5, 2, 'mvc-action', state_id('core.core_mvc_controller.active')),\n (6, 2, 'acl-role', state_id('core.core_mvc_controller.active')),\n (7, 2, 'acl-access', state_id('core.core_mvc_controller.active')),\n (8, 2, 'acl-resource', state_id('core.core_mvc_controller.active')),\n (9, 2, 'acl-accessList', state_id('core.core_mvc_controller.active')),\n (10, 2, 'acl-roleInherit', state_id('core.core_mvc_controller.active')),\n (14, 3, 'setting', state_id('core.core_mvc_controller.active')),\n (15, 4, 'users', state_id('core.core_mvc_controller.active'));\n\n/*\nCREATE TABLE user_users (\n obj_id integer NOT NULL REFERENCES obj(obj_id),\n email text NOT NULL,\n password text NOT NULL,\n name text NOT NULL,\n core_acl_role_id integer NOT NULL,\n state_id integer NOT NULL REFERENCES ref(obj_id),\n init_obj_id integer REFERENCES obj(obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP);\nselect create_class('core.user_users');\n\nINSERT INTO user_users (obj_id,email, password, name, core_acl_role_id, state_id) VALUES\n(6, 'temafey@gmail.com', '$2a$08$GAeqa0pyDZMWBJYdAtKBI.rocjxtQ4RQV9ca1Np02LF6Z6LKUdTNu', 'Artem', 1, state_id('core.user_users.active'));*/\n\n\n/*DROP TRIGGER IF EXISTS ms_refresh_person_ns ON person_ns;\nDROP FUNCTION IF EXISTS ms_refresh_person_ns();\n\nDROP TRIGGER IF EXISTS person_ns_before_insert ON person_ns;\nDROP FUNCTION IF EXISTS person_ns_before_insert();\nDROP TRIGGER IF EXISTS person_ns_before_update ON person_ns;\nDROP FUNCTION IF EXISTS person_ns_before_update();\nDROP TRIGGER IF EXISTS person_ns_odb_after_delete_trigger ON person_ns;\nDROP TRIGGER IF EXISTS person_ns_odb_before_insert_trigger ON person_ns;\nDROP TRIGGER IF EXISTS person_ns_before_change_history_trigger ON person_ns;*/\n\n\ndrop MATERIALIZED view vw_pr;\n\n/*ALTER TABLE person_ns DROP COLUMN auth_key;\nALTER TABLE person_ns DROP COLUMN token;*/\n\n\n\n\nDROP FUNCTION IF EXISTS ms_refresh_person_ns() CASCADE ;\n\ndelete from person_ns\nwhere login not in ('soscredit');\n\nalter table person_ns drop COLUMN type_id;\nalter table person_ns drop COLUMN state_id;\n\n\nDELETE\nFROM ref\nWHERE relname = 'person_ns';\n\n\n\nALTER TABLE person_ns DROP COLUMN update_time;\nALTER TABLE person_ns DROP COLUMN create_time;\n\nALTER TABLE person_ns ADD COLUMN name text;\n\n\nselect create_class('core.person_ns',null);\nSELECT create_state('core.person_ns', 'active,noactive,deleted,blocked', NULL);\n\nalter table person_ns add COLUMN state_id integer DEFAULT state_id('core.person_ns.active');\n\nALTER TABLE person_ns ADD COLUMN update_time TIMESTAMP;\nALTER TABLE person_ns ADD COLUMN create_time TIMESTAMP;\n\n\n\n\nALTER TABLE core_acl_access_list ADD PRIMARY KEY (id);\nCREATE UNIQUE INDEX ON core_acl_access_list (role_id, resource_id, access_id);\n\nCREATE SEQUENCE core_acl_access_list_id_seq;\nALTER TABLE core_acl_access_list ALTER COLUMN id SET DEFAULT nextval('core_acl_access_list_id_seq');\nSELECT setval('core_acl_access_list_id_seq', (SELECT max(id) + 1\n FROM core_acl_access_list));\n\n\nALTER TABLE core_acl_resource ADD PRIMARY KEY (id);\nCREATE UNIQUE INDEX ON core_acl_resource (name);\n\nCREATE SEQUENCE core_acl_resource_id_seq;\nALTER TABLE core_acl_resource ALTER COLUMN id SET DEFAULT nextval('core_acl_resource_id_seq');\nSELECT setval('core_acl_access_list_id_seq', (SELECT max(id) + 1\n FROM core_acl_resource));\n\nALTER TABLE core_acl_resource_access ADD PRIMARY KEY (id);\nCREATE UNIQUE INDEX ON core_acl_resource_access (resource_id, name);\n\nCREATE SEQUENCE core_acl_resource_access_id_seq;\nALTER TABLE core_acl_resource_access ALTER COLUMN id SET DEFAULT nextval('core_acl_resource_access_id_seq');\nSELECT setval('core_acl_resource_access_id_seq', (SELECT max(id) + 1\n FROM core_acl_resource_access));\n\nALTER TABLE core_acl_role ADD PRIMARY KEY (id);\nCREATE UNIQUE INDEX ON core_acl_role (name);\n\nCREATE SEQUENCE core_acl_role_id_seq;\nALTER TABLE core_acl_role ALTER COLUMN id SET DEFAULT nextval('core_acl_role_id_seq');\nSELECT setval('core_acl_role_id_seq', (SELECT max(id) + 1\n FROM core_acl_role));\n\nALTER TABLE core_acl_role_inherit ADD PRIMARY KEY (id);\nCREATE UNIQUE INDEX ON core_acl_role_inherit (role_id, inherit_role_id);\n\n\nCREATE SEQUENCE core_acl_role_inherit_id_seq;\nALTER TABLE core_acl_role_inherit ALTER COLUMN id SET DEFAULT nextval('core_acl_role_inherit_id_seq');\nSELECT setval('core_acl_role_inherit_id_seq', (SELECT max(id) + 1\n FROM core_acl_role_inherit));\n\nALTER TABLE core_menu_item ADD PRIMARY KEY (id);\nCREATE INDEX ON core_menu_item (state_id);\n\nCREATE SEQUENCE core_menu_item_id_seq;\nALTER TABLE core_menu_item ALTER COLUMN id SET DEFAULT nextval('core_menu_item_id_seq');\nSELECT setval('core_menu_item_id_seq', (SELECT max(id) + 1\n FROM core_menu_item));\n\nALTER TABLE core_menu_menus ADD PRIMARY KEY (id);\n\nCREATE SEQUENCE core_menu_menus_id_seq;\nALTER TABLE core_menu_menus ALTER COLUMN id SET DEFAULT nextval('core_menu_menus_id_seq');\nSELECT setval('core_menu_menus_id_seq', (SELECT max(id) + 1\n FROM core_menu_menus));\n\n\nALTER TABLE core_mvc_action ADD PRIMARY KEY (id);\nCREATE UNIQUE INDEX ON core_mvc_action (controller_id, name);\n\n\nCREATE SEQUENCE core_mvc_action_id_seq;\nALTER TABLE core_mvc_action ALTER COLUMN id SET DEFAULT nextval('core_mvc_action_id_seq');\nSELECT setval('core_mvc_action_id_seq', (SELECT max(id) + 1\n FROM core_menu_menus));\n\nALTER TABLE core_mvc_controller ADD PRIMARY KEY (id);\n\nCREATE SEQUENCE core_mvc_controller_id_seq;\nALTER TABLE core_mvc_controller ALTER COLUMN id SET DEFAULT nextval('core_mvc_controller_id_seq');\nSELECT setval('core_mvc_controller_id_seq', (SELECT max(id) + 1\n FROM core_mvc_controller));\n\n\nALTER TABLE core_mvc_module ADD PRIMARY KEY (id);\n\nCREATE SEQUENCE core_mvc_module_id_seq;\nALTER TABLE core_mvc_module ALTER COLUMN id SET DEFAULT nextval('core_mvc_module_id_seq');\nSELECT setval('core_mvc_module_id_seq', (SELECT max(id) + 1\n FROM core_mvc_module));\n\n\nALTER TABLE core_acl_role_inherit ADD FOREIGN KEY (role_id) REFERENCES core_acl_role (id);\nALTER TABLE core_acl_role_inherit ADD FOREIGN KEY (inherit_role_id) REFERENCES core_acl_role_inherit (id);\nALTER TABLE core_acl_resource_access ADD FOREIGN KEY (resource_id) REFERENCES core_acl_resource (id);\nALTER TABLE core_acl_access_list ADD FOREIGN KEY (role_id) REFERENCES core_acl_role (id);\nALTER TABLE core_acl_access_list ADD FOREIGN KEY (resource_id) REFERENCES core_acl_resource (id);\nALTER TABLE core_acl_access_list ADD FOREIGN KEY (access_id) REFERENCES core_acl_resource_access (id);\n\n\nALTER TABLE person_ns ADD COLUMN core_acl_role_id INTEGER NOT NULL REFERENCES core_acl_role (id) DEFAULT 1;\nALTER TABLE person_ns drop column login;\nALTER TABLE person_ns alter column tree set DEFAULT 1;\nALTER TABLE person_ns drop column pathl;\n\n\n\ncreate UNIQUE INDEX person_ns_email_unq on person_ns(email);\n\nselect ddl_history_tbl('person_ns','recreate');\n\nupdate person_ns\nset email = 'soscredit@boss.com';\n\nINSERT INTO person_ns (email,password, name, core_acl_role_id, state_id) VALUES\n ('temafey@gmaill.com','$2a$08$GAeqa0pyDZMWBJYdAtKBI.rocjxtQ4RQV9ca1Np02LF6Z6LKUdTNu', 'Artem', 1,\n state_id('core.person_ns.active'));\n\nINSERT INTO person_ns (email,password, name, core_acl_role_id, state_id) VALUES\n ('fursin.v@gmail.com','$2a$08$GAeqa0pyDZMWBJYdAtKBI.rocjxtQ4RQV9ca1Np02LF6Z6LKUdTNu', 'Victor', 1,\n state_id('core.person_ns.active'));\n\nINSERT INTO person_ns (email,password, name, core_acl_role_id, state_id) VALUES\n ('nemolvlad@gmail.com','$2a$08$GAeqa0pyDZMWBJYdAtKBI.rocjxtQ4RQV9ca1Np02LF6Z6LKUdTNu', 'Oleg', 1,\n state_id('core.person_ns.active'));\n\nEOD;\n $count = $this->execute($query);\n }", "public function reindexAll()\n {\n $this->_getIndexer()->rebuildIndex();\n }", "public function reloadTableNames() {\n\t\t$this->_loadTableNames();\n\t}", "public function rebuild($group_id);", "function ReInitTableColumns()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::ReInitTableColumns();\" . \"<HR>\";\n foreach ($this->form_fields as $prefix => $form) {\n foreach ($form as $i => $field) {\n foreach ($field as $param => $value) {\n //if found database parameters\n if (strpos($param, \"dbfield_\") !== false) {\n $columnparam = substr($param, strlen(\"dbfield_\"), strlen($param));\n $this->Storage->setColumnParameter($field[\"field_name\"], trim($columnparam), $value);\n }\n }\n }\n }\n }", "private function _loadDataToTemporaryTable(){\n\n }", "private function updateBaseTable()\n {\n foreach ($this->mergeCollection as $key => $item)\n {\n $query = DB::table($this->baseTable);\n\n foreach ($this->associativePivots as $basePivot => $mergePivot)\n {\n $query = $query->whereIn($basePivot,[$item->$mergePivot]);\n }\n\n if(!in_array($this->primaryKey,$this->associativeColumns) && !in_array($this->primaryKey,$this->associativePivots))\n unset($item->id);\n\n if(!empty($this->associativeColumns)) {\n\n $newItem = new \\stdClass();\n\n foreach ($this->associativeColumns as $baseColumn => $mergeColumn) {\n $newItem->$baseColumn = $item->$mergeColumn;\n }\n\n $item = $newItem;\n }\n\n\n $this->rowUpdatedByMatched += $query->update(get_object_vars($item));\n }\n\n }", "private function reset(){\n\n\t\tforeach($this as $k=>$v) unset($this->$k);\n\n\t\t$this::$map = $this->maper();\n\n\t\t$this->name = \"\";\n\n\t\t$this->address = [];\n\n\t\t$this->tableclass();\n\n\t}", "function ctools_export_load_object_reset($table = NULL) {\r\n // Reset plugin cache to make sure new include files are picked up.\r\n ctools_include('plugins');\r\n ctools_get_plugins_reset();\r\n if (empty($table)) {\r\n drupal_static_reset('ctools_export_load_object');\r\n drupal_static_reset('ctools_export_load_object_all');\r\n drupal_static_reset('_ctools_export_get_defaults');\r\n }\r\n else {\r\n $cache = &drupal_static('ctools_export_load_object');\r\n $cached_database = &drupal_static('ctools_export_load_object_all');\r\n $cached_defaults = &drupal_static('_ctools_export_get_defaults');\r\n unset($cache[$table]);\r\n unset($cached_database[$table]);\r\n unset($cached_defaults[$table]);\r\n }\r\n}", "public function triggerReindex()\n {\n if (!$this->owner->ID) {\n return;\n }\n\n $id = $this->owner->ID;\n $class = $this->owner->ClassName;\n $state = SearchVariant::current_state($class);\n $base = DataObject::getSchema()->baseDataClass($class);\n $key = \"$id:$base:\" . serialize($state);\n\n $statefulids = array(array(\n 'id' => $id,\n 'state' => $state\n ));\n\n $writes = array(\n $key => array(\n 'base' => $base,\n 'class' => $class,\n 'id' => $id,\n 'statefulids' => $statefulids,\n 'fields' => array()\n )\n );\n\n SearchUpdater::process_writes($writes);\n }", "static private function regenerate_database()\n {\n self::$quick = false; // Disable quick mode.\n\n self::greeting();\n self::database_backup(); // Backup database, just in case.\n\n if(self::check_duplicates()) {\n self::link_naked_arxiv(); // Link naked arXiv IDs.\n\n self::log(\"Initiating database regeneration from INSPIRE.\");\n $stats = self::inspire_regenerate(\"SELECT inspire FROM records WHERE (inspire != '' AND inspire IS NOT NULL)\");\n\n if (sizeof($stats->found) > 0)\n self::log(sizeof($stats->found) . \" records were regenerated.\");\n if (sizeof($stats->lost) > 0)\n self::log(sizeof($stats->lost) . \" records were not found on INSPIRE: \" . implode(\", \", $stats->lost) . \".\");\n\n self::fetch_missing_bibtex();\n }\n\n self::wrapup();\n }", "public function regenerate();", "function updateProjectObjects() {\n try {\n $project_objects_table = TABLE_PREFIX . 'project_objects';\n\n DB::execute(\"ALTER TABLE $project_objects_table ADD label_id SMALLINT UNSIGNED NULL DEFAULT NULL AFTER category_id\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD INDEX (label_id)\");\n DB::execute(\"ALTER TABLE $project_objects_table DROP has_time\");\n DB::execute(\"ALTER TABLE $project_objects_table DROP comments_count\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD varchar_field_3 VARCHAR(255) NULL DEFAULT NULL AFTER varchar_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD integer_field_3 INT(11) NULL DEFAULT NULL AFTER integer_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD float_field_3 FLOAT NULL DEFAULT NULL AFTER float_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD text_field_3 LONGTEXT NULL AFTER text_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD date_field_3 DATE NULL DEFAULT NULL AFTER date_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD datetime_field_3 DATETIME NULL DEFAULT NULL AFTER datetime_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD boolean_field_3 TINYINT(1) UNSIGNED NULL DEFAULT NULL AFTER boolean_field_2\");\n\n DB::execute('DROP TABLE ' . TABLE_PREFIX . 'project_object_views');\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "private function generateCache()\n {\n $schmaTabls = [];\n foreach (self::$allSchema as $Schema) {\n $schmaTabls[] = Tools::parse_object_TO_array($Schema);\n }\n self::setgenerateCACHE_SELECT($schmaTabls);\n }", "private function populateDummyTable() {}", "public function modifyTable()\n\t{\n\t\t$table = $this->getTable();\n\t\t// add the aggregate columns if not present\n\t\t$columnNames = $this->getColumnNames();\n\t\tforeach ($columnNames as $columnName) {\n\t\t\tif( ! $table->containsColumn($columnName)) {\n\t\t\t\t$column = $table->addColumn(array(\n\t\t\t\t\t'name' => $columnName,\n\t\t\t\t\t'type' => 'INTEGER',\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\t// add behavior to foreign tables to autoupdate aggregate columns\n\t\t$foreignTables = $this->getForeignTables();\n\t\t$columns = $this->getColumns(); // get aggregate column objects\n\t\tforeach ($foreignTables as $k => $foreignTable) {\n\t\t\t//var_dump($foreignTable); //MARK\n\t\t\tif(!$foreignTable->hasBehavior('concrete_inheritance_parent')) {\n\t\t\t\t$relationBehaviorName = 'aggregate_column_relation_to_' . $table->getName() . '_' . $columnNames[$k];\n\t\t\t\t$relationBehavior = new AggregateColumnRelationBehavior();\n\t\t\t\t$relationBehavior->setName($relationBehaviorName);\n\t\t\t\t// FIXME does this really serve any purpose other than check whether a fk is defined?\n\t\t\t\t$foreignKey = $this->getForeignKey($foreignTable);\n\t\t\t\t$relationBehavior->addParameter(array('name' => 'foreign_table', 'value' => $table->getName()));\n\t\t\t\t$relationBehavior->addParameter(array('name' => 'update_method', 'value' => 'update' . $columns[$k]->getPhpName()));\n\t\t\t\t$relationBehavior->addParameter(array('name' => 'foreign_aggregate_column', 'value' => $columns[$k]->getPhpName()));\n\t\t\t\t$foreignTable->addBehavior($relationBehavior);\n\t\t\t}\n\t\t}\n\t}", "function postCreateTable(){\n\t}", "function rebuildDeviceData() {\n\t\tsystemLog::notice('Starting rebuild of device data');\n\t\t$oStmt = dbManager::getInstance()->prepare('SELECT deviceID FROM '.system::getConfig()->getDatabase('wurfl').'.devices WHERE rootDevice = 1');\n\t\tif ( $oStmt->execute() ) {\n\t\t\tforeach ( $oStmt as $row ) {\n\t\t\t\tsystemLog::getInstance()->setSource('rebuild]['.$row['deviceID']);\n\t\t\t\t$oDevice = wurflManager::getInstance($row['deviceID']);\n\t\t\t\tsystemLog::notice('Processing deviceID '.$row['deviceID']);\n\t\t\t\t$oDevice->setModelName($oDevice->getCapabilities()->getCapability('model_name'));\n\t\t\t\t\n\t\t\t\t$oMan = wurflManufacturer::getInstance($oDevice->getCapabilities()->getCapability('brand_name'));\n\t\t\t\tif ( $oMan->getManufacturerID() > 0 ) {\n\t\t\t\t\t$oDevice->setManufacturerID($oMan->getManufacturerID());\n\t\t\t\t}\n\t\t\t\t$oDevice->save();\n\t\t\t}\n\t\t}\n\t}", "function restoreTable(&$new_values, &$changes, &$address, &$reference){\n\t$primary_key_field = $reference['PrimaryKey'];\n\t$active_table = $reference['ActiveTable'];\n\t//var_dump($reference, $address);\n\t//loop all information and save new data in the database\n\t$query = \"\"; $query_condition = \"\"; $field_counter = 0;\n\t$last_address_field = \"\";\n\tforeach($address as $field=>$location){\n\t\tif($field_counter++ > 0){\n\t\t\tif($primary_key_field != $last_address_field)\n\t\t\t\t$query .= \", \";\n\t\t\tif($field_counter > 2)\n\t\t\t\t$query_condition .= \" && \";\n\t\t} else\n\t\t\t$changes[$active_table][$field][$new_values[$location]] = PDB($new_values[$location],true, $con); //keep the same value of the first expected column to Primary Key of the table\n\t\t//check if the field has any other reference\n\t\t//var_dump($primary_key_field);\n\t\tif(@$reference[$field] && is_array($reference[$field]) && $changes[$reference[$field]['table']][($reference[$field]['Field'])][$new_values[$location]] ){\n\t\t\tif($primary_key_field != $field)\n\t\t\t\t$query .= \"`{$field}`='\".PDB($changes[$reference[$field]['table']][($reference[$field]['Field'])][$new_values[$location]],true,$con).\"'\";\n\t\t\tif($field_counter > 1)\n\t\t\t\t$query_condition .= \"`{$field}`='\".PDB($changes[$reference[$field]['table']][($reference[$field]['Field'])][$new_values[$location]],true,$con).\"'\";\n\t\t} else {\n\t\t\tif($primary_key_field != $field)\n\t\t\t\t$query .= \"`{$field}`='\".PDB($new_values[$location],true,$con).\"'\";\n\t\t\tif($field_counter > 1)\n\t\t\t\t$query_condition .= \"`{$field}`='\".PDB($new_values[$location],true,$con).\"'\";\n\t\t}\n\t\t$last_address_field = $field;\n\t}\n\t\n\t//echo $query_condition;\n\t//check if the row exist before after all formatting\n\tif(!$primary_key = returnSingleField($sql = \"SELECT `{$primary_key_field}` FROM `{$active_table}`\".($query_condition?\" WHERE \".$query_condition:\"\"),$primary_key_field,true,$con)){\n\t\t//echo $sql; echo \"<br />\";\n\t\t$primary_key = saveAndReturnID($sql = \"INSERT INTO `{$active_table}` SET {$query}\",$con);\n\t\t//echo $sql; echo \"<hr />\";\n\t}\n\t//echo $primary_key;\n\t//now set new replacement value in the change variable now\n\t$changes[$active_table][$primary_key_field][$new_values[$address[$primary_key_field]]] = $primary_key;\n}", "public function change()\n {\n$query =<<<'EOD'\n\nCREATE OR REPLACE FUNCTION materialize_paging_column(integer) RETURNS VOID\nVOLATILE\nLANGUAGE SQL STRICT\nAS $$\n update paging_table\n set m_prop_column_full = full_data,\n m_prop_column_small = small_data,\n m_column = cols\n from (SELECT jsonb_build_object('columns',\n jsonb_agg(jsonb_build_object(\n 'data',p.name,\n 'visible', coalesce(p.is_visible,false),\n 'primary', coalesce(is_primary,false),\n 'title', coalesce(p.title,p.name),\n 'orderable',Coalesce(p.is_orderable,true),\n 'is_filter',p.is_filter,\n 'type', pt.name,\n 'cd',coalesce(p.condition,pt.cond_default),\n 'cdi', p.item_condition) ORDER by p.priority)) as full_data,\n jsonb_build_object('columns',\n jsonb_agg(jsonb_build_object(\n 'data',p.name ,\n 'visible',coalesce(p.is_visible,false),\n 'primary',coalesce(is_primary,false),\n 'orderable',Coalesce(p.is_orderable,true),\n 'title', coalesce(p.title,p.name),\n 'type', pt.name) ORDER by priority)) as small_data,\n string_agg(p.name,',' ORDER BY priority) as cols,\n p.paging_table_id\n from paging_column as p\n left join paging_column_type as pt on p.paging_column_type_id = pt.id\n where p.paging_table_id = $1\n and p.is_visible is true or p.is_primary is true\n GROUP BY p.paging_table_id ) as rs\n where rs.paging_table_id = paging_table.id;\n$$;\n\ncreate or replace function rebuild_paging_prop(a_vw_view text, a_descr text, a_type_name text, a_is_mat boolean) returns text\nLANGUAGE plpgsql\nAS $$\nDECLARE\n val_object_table_id INTEGER = (SELECT id\n FROM paging_table\n WHERE name =a_vw_view);\nBEGIN\n drop table if EXISTS temp_paging_col_prop;\n\n create temp table temp_paging_col_prop as\n (\n SELECT pv.viewname as tablename, isc.column_name as col, t.typname AS col_type,pgi.id as col_type_id,p.attnum as pr\n FROM pg_views AS pv\n JOIN information_schema.columns AS isc ON pv.viewname = isc.table_name\n JOIN pg_attribute AS p ON p.attrelid = isc.table_name :: REGCLASS AND isc.column_name = p.attname\n JOIN pg_type AS t ON p.atttypid = t.oid\n left join paging_column_type as pgi on pgi.name = t.typname\n WHERE schemaname = 'public' and pv.viewname = a_vw_view\n union all\n SELECT pv.tablename as tablename, isc.column_name as col, t.typname AS col_type,pgi.id as col_type_id,p.attnum as pr\n FROM pg_tables AS pv\n JOIN information_schema.columns AS isc ON pv.tablename = isc.table_name\n JOIN pg_attribute AS p ON p.attrelid = isc.table_name :: REGCLASS AND isc.column_name = p.attname\n JOIN pg_type AS t ON p.atttypid = t.oid\n left join paging_column_type as pgi on pgi.name = t.typname\n where pv.schemaname = 'public' and pv.tablename = a_vw_view\n );\n\n --- delete if table not exists\n delete from paging_table\n where id = val_object_table_id\n and not exists (select 1\n from temp_paging_col_prop limit 1)\n RETURNING id\n into val_object_table_id;\n\n --- create object if not exists (return paging_table_id)\n select get_set_paging_table_object as id\n from get_set_paging_table_object((select tablename from temp_paging_col_prop limit 1),a_descr,a_type_name,a_is_mat)\n into val_object_table_id;\n\n --- update paging_columns_prop\n update paging_column\n set paging_column_type_id = r.col_type_id,priority = coalesce(priority,r.pr)\n from (select pcp.id,t.col_type_id,t.pr\n from temp_paging_col_prop as t\n join paging_column as pcp on pcp.name = t.col\n where pcp.paging_table_id = val_object_table_id\n ) as r\n where r.id = paging_column.id;\n\n insert into paging_column(paging_table_id,paging_column_type_id,name,priority)\n select val_object_table_id,col_type_id,col,pr\n from temp_paging_col_prop\n ON CONFLICT (paging_table_id,name) DO NOTHING;\n\n\n delete from paging_column\n where paging_column_type_id = val_object_table_id\n and name not in (select col from temp_paging_col_prop);\n\n perform materialize_paging_column((select id from paging_table where name =a_vw_view));\n\n RETURN '';\nEND;\n$$;\n\ncreate or replace function paging_columns_prop_before_update_paging_table_mat_trg() returns trigger\nLANGUAGE plpgsql\nAS $$\nBEGIN \n perform materialize_paging_column(new.paging_table_id);\nRETURN NEW;\nEND;\n$$;\n\nupdate paging_table\n set last_paging_table_materialize_info_id = null\nwhere name in ('paging_table','paging_column_type','paging_column');\n\ndelete from paging_table_materialize_info\n where paging_table_id in\n (select id from paging_table\nwhere name in ('paging_table','paging_column_type','paging_column'));\n\ndelete from paging_table\nwhere name in ('paging_table','paging_column_type','paging_column');\n\ncreate or replace function get_set_paging_table_object(a_name text, a_descr text, a_type text, a_is_mat boolean) returns integer\nLANGUAGE plpgsql\nAS $$\ndeclare\n val_id integer = (select id from paging_table where name = $1);\n val_type_id integer = (select id from paging_table_type where name = $3);\nBEGIN\n if (val_id is null)\n then\n insert into paging_table(name, descr,paging_table_type_id,is_materialize)\n select $1,$2,Coalesce(val_type_id,1),coalesce(a_is_mat,false)\n RETURNING id\n into val_id;\n END IF;\n RETURN val_id;\nEND;\n$$;\n\nselect rebuild_paging_prop('paging_table',null,'table',false);\nselect rebuild_paging_prop('paging_column_type',null,'table',false);\nselect rebuild_paging_prop('paging_column',null,'table',false);\n\nupdate paging_column\nset is_visible = false\nwhere paging_table_id in (select id from paging_table where name in ('paging_table','paging_column','paging_column_type'));\n\nupdate paging_column\nset is_visible = true,is_filter = false\nwhere paging_table_id in (select id from paging_table where name = 'paging_table')\nand name in ('id','name','descr');\n\nupdate paging_column\nset is_visible = true,is_filter = false\nwhere paging_table_id in (select id from paging_table where name = 'paging_column')\nand name in ('id','paging_table_id','paging_column_type_id','name','title','is_visible','is_orderable','is_primary','priority');\n\nupdate paging_column\nset is_visible = true,is_filter = false\nwhere paging_table_id in (select id from paging_table where name = 'paging_column_type')\nand name in ('id','name');\n\nselect materialize_worker('recreate','vw_gen_materialize',null);\n\nEOD;\n$this->execute($query);\n}", "private function truncate()\n {\n // Désactivation des contraintes FK\n $this->co->executeQuery('SET foreign_key_checks = 0');\n // On tronque\n $this->co->executeQuery('TRUNCATE TABLE casting');\n $this->co->executeQuery('TRUNCATE TABLE department');\n $this->co->executeQuery('TRUNCATE TABLE genre');\n $this->co->executeQuery('TRUNCATE TABLE job');\n $this->co->executeQuery('TRUNCATE TABLE movie');\n $this->co->executeQuery('TRUNCATE TABLE movie_genre');\n $this->co->executeQuery('TRUNCATE TABLE person');\n $this->co->executeQuery('TRUNCATE TABLE review');\n $this->co->executeQuery('TRUNCATE TABLE team');\n $this->co->executeQuery('TRUNCATE TABLE user');\n }", "function execute()\n {\n $this->OldModel = $this->getOldModelToUse();\n $this->OldModel->cacheQueries = false;\n $this->OldModel->cacheSQL = false;\n $this->NewModel = $this->getNewModelToUse();\n $this->NewModel->cacheQueries = false;\n $this->NewModel->cacheSQL = false;\n \n $tableMap = $this->getTableMap();\n debug($tableMap);\n if (!$tableMap)\n {\n $this->print_instructions();\n exit();\n }\n\n foreach ($tableMap as $table => $data)\n {\n if (!$this->specialProcessing($table, $data))\n {\n $this->import($table, $data);\n }\n }\n }", "public function reindex();", "function testFieldsDontRerequestChanges() {\r\n\t\t$db = DB::getConn();\r\n\t\tDB::quiet();\r\n\t\t\r\n\r\n\t\t// Table will have been initially created by the $extraDataObjects setting\r\n\t\t\r\n\t\t\r\n\t\t// Verify that it doesn't need to be recreated\r\n\t\t$db->beginSchemaUpdate();\r\n\t\t$obj = new DataObjectSchemaGenerationTest_DO();\r\n\t\t$obj->requireTable();\r\n\t\t$needsUpdating = $db->doesSchemaNeedUpdating();\r\n\t\t$db->cancelSchemaUpdate();\r\n\t\t\r\n\t\t$this->assertFalse($needsUpdating);\r\n\t}", "protected function _initsTable() {}", "private function buildTables ($tables, $action) {\n\n \n\n // Each different method has a slightly different table make up so we continue the build seperately\n if ($action == 'INSERT' || $action == 'DELETE') {\n\n // Before the table, as this is an INSERT or DELETE we need to add 'INTO' or 'FROM' into the SQL Statement\n $out = ($action == 'INSERT') ? ' INTO' : ' FROM';\n\n // We only have one table with an INSERT and that is a key in the array so we use array_keys \n // and set it to the variable $table.... \n $table = array_keys($tables);\n \n // ....then we simply use position [0] (the only key) as the table name\n $out .= ' `' . $table[0].'`';\n\n \n } // INSERT || DELETE\n\n\n if ($action == 'UPDATE') {\n\n // We only have one table with an INSERT and that is a key in the array so we use array_keys \n // and set it to the variable $table.... \n $table = array_keys($tables);\n \n // ....then we simply use position [0] (the only key) as the table name\n $out = ' `' . $table[0].'`';\n\n // Add ' SET' t the end of the string\n $out .= ' SET';\n\n \n } // UPDATE\n\n\n if ($action == 'SELECT') {\n\n $out = ' FROM';\n // Loop through all the tables in the array - $ket is the table name\n foreach ($tables as $key => $value) {\n\n // We use two variables the wrap the table name in if it is a joined table so clear them of any old data\n $joinType = '';\n $joinOn = '';\n\n \n /** Create the table joins\n *\n * If a join has been specified, create it along with the criteria\n *\n * $joinType\n * Prepends the join type (LEFT, RIGHT etc) to the word 'JOIN'\n *\n * $joinOn\n * Adds the parameters for the join\n *\n * Starts with 'ON ' and then adds the first table.column using \n * $key.'.'.$value['join']['local_key']\n *\n * It the adds ' = ' before adding the second table.column using\n * $value['join']['foreign_table'].'.'.$value['join']['foreign_key']\n *\n **/\n\n // Prepend the join type (LEFT, RIGHT etc) to the word 'JOIN'\n\n $this->alias = (isset($value['alias'])) ? $value['alias'] . ' ' : '';\n $this->join_name = ($this->alias) ? $this->alias: $key;\n\n if(isset($value['join'])) {\n $joinType = $value['join']['join_type'] . ' JOIN';\n $joinOn = 'ON `' . $this->join_name.'`.`'.$value['join']['local_key'] . '` = `' . $value['join']['foreign_table'].'`.`'.$value['join']['foreign_key'] .'`';\n } // if join \n\n // Wrap the table name ($key) with the join parts. The join parts will be empty strings if no join was set\n $out .= $joinType.' `' . $key . '` ' .$this->alias.$joinOn;\n\n } // foreach\n\n } // SELECT\n\n\n\n // Return the tables part of the SQL statement\n return $out;\n\n }", "public function rebuild()\n {\n // Clean up unused images\n $this->clean();\n\n // Shut down the containters\n $this->destroyContainers();\n\n // Re-build new containers\n $this->buildContainers();\n }", "protected function doReindexFull()\n {\n foreach ($this->getAllRules() as $rule) {\n $this->updateRuleProductData($rule);\n $this->categoryProductReindexRow($rule->getId());\n }\n }", "public function rebuildAction() {\n $result = $this->_rebuild();\n echo json_encode($result);\n die();\n }", "public function refreshCache() {\n\t\t$this->_cache->clean(Zend_Cache::CLEANING_MODE_ALL);\n\t\t$this->_loadTableNames();\n\n\t\t$this->_tableInfo = array();\n\t}", "public function actionRebuildCache()\n {\n foreach (Yii::app()->Modules as $id => $params)\n $this->actionDb2php(array('module' => $id));\n\n }", "public function flush() {\n if ($this->c_owner) {\n if ($this->update('owner', $this->owner, Project::$tableName)) {\n $this->c_owner = false;\n }\n }\n if ($this->c_name) {\n if ($this->update('name', $this->name, Project::$tableName)) {\n $this->c_name = false;\n }\n }\n if ($this->c_description) {\n if ($this->update('description', $this->description, Project::$tableName)) {\n $this->c_description = false;\n }\n }\n \n if ($this->c_deadline) {\n if ($this->update('deadline', $this->deadline, Project::$tableName)) {\n $this->c_deadline = false;\n }\n }\n if ($this->c_time) {\n if ($this->update('time', $this->time, Project::$tableName)) {\n $this->c_time = false;\n }\n }\n }", "public function reindexAll()\n {\n }", "public function reloadSchema()\n {\n $em = $this->getEntityManager();\n $tool = new SchemaTool($em);\n $tool->dropSchema($em->getMetadataFactory()->getAllMetadata());\n $tool->createSchema($em->getMetadataFactory()->getAllMetadata());\n $this->schemaReloaded = true;\n }", "public static function buildObject($table, $data)\n {\n $objectClass = $table->getPersistClassName();\n $object = new $objectClass;\n $errors = array();\n foreach($table->getFields() as $field) {\n $name = $field->getName();\n if (!isset($data[$name])) {\n $data[$name] = null;\n }\n $postfix = '';\n foreach($table->getBinds() as $bind) {\n if($bind->getLeftField() === $field->getName()){\n $postfix = $bind->getLeftField() === $field->getName() ? OrmUtils::BIND_PREFIX : \"\";\n break;\n }\n }\n $setter = \"set\" . ucfirst($name).$postfix;\n $object->$setter($data[$name]);\n }\n return array($object, $errors);\n }", "public function regenerate(): self;", "protected function reindex()\n\t{\n\t\t// rebuild the ordered collection\n\t\t$results = array();\n\t\tforeach ($this->_data as $old => $record)\n\t\t{\n\t\t\t$key = $record->{$this->_keyfield};\n\t\t\t$results[$key] = $record;\n\t\t}\n\t\t// sort the collection\n\t\tksort($results);\n\t\t// remember the new collection\n\t\t$this->_data = $results;\n\t\t// reset the cursor\n\t\treset($this->_data);\n\t}", "private function updateExistingTable() {\n $statements = []; // this will be a list of alter table statements, but only the stuff AFTER the 'alter table [tablename]' part\n //get the list of current columns in this table\n $existingColumnsFromDb = DbManager::query(\"show columns from $this->tableName\");\n\n //get the list of constraints currently available for the columns in this table. \n $constraints = Table::getConstraints($this->tableName);\n //remove all constraints from the table\n foreach ($constraints as $c) {\n //for now, the only constraints supported are primary key and foreign key\n switch ($c->CONSTRAINT_NAME) {\n case \"PRIMARY\":\n //handled below\n break;\n default:\n //assume the constraint is a foreign key. \n $statements[] = \"drop foreign key $c->CONSTRAINT_NAME\";\n break;\n }\n }\n\n foreach ($existingColumnsFromDb as $colFromDb) {\n //if the column was not found in the list, this column that is \n ////currently in the database will need to be deleted\n if ($this->getColumn($colFromDb->Field) === null) {\n $statements[] = \"drop column $colFromDb->Field\";\n }\n }\n\n //a list of names of columns that make up the primary key\n $keyNameList = [];\n //add any new columns or update existing ones\n foreach ($this->columns as $column) {\n //see if this column does not exist in the table, it is a new column. generate a new column stmt\n if ($this->columnExistsInTable($column->columnName, $existingColumnsFromDb) === false) {\n $statements[] = \"add column $column->columnName $column->dataType $column->extraStuff\";\n } else {\n //these columns exist in the table already. create update statements for each column, even if nothing has changed. it won't harm the column\n $statements[] = \"modify column $column->columnName $column->dataType $column->extraStuff\";\n }\n //add this column to the list of primary keys if it is flagged as such\n if ($column->primaryKey === true) {\n $keyNameList[] = $column->columnName;\n }\n }\n\n //reregister the primary keys\n $primaryKeySql = \"\";\n if (count($keyNameList) > 0) {\n $primaryKeySql = \"\";\n if (Table::HasPrimaryKey($this->dbName, $this->tableName) == true) {\n $primaryKeySql = \"drop primary key,\";\n }\n\n $primaryKeySql .= \"add primary key(\";\n $comma = \"\";\n foreach ($keyNameList as $keyName) {\n $primaryKeySql = \"$primaryKeySql $comma $keyName\";\n $comma = \",\";\n }\n $primaryKeySql = \"$primaryKeySql)\";\n $statements[] = $primaryKeySql;\n }\n\n //\n //apply the alter statements\n $alter = \"alter table $this->tableName\";\n $bTotalSuccess = true;\n foreach ($statements as $s) {\n $bTotalSuccess = $bTotalSuccess && DbManager::nonQuery(\"$alter $s\");\n }\n return $bTotalSuccess;\n }", "public function compileAdminTables() {}", "function arr_reform($res)//该函数仅对 goods 表有用\n{\n for($i=0; $i<count($res); $i++)\n {\n $res[$i]['color']=array();//在res1添加一个 color数组字段\n $res[$i]['brand']=array();//在res1添加一个 brand数组字段\n $res[$i]['version']=array();//在res1添加一个version数组字段\n\n $res[$i]['color']['color_name'] = $res[$i]['goods_color'];//color数组中添加color元素\n $res[$i]['color']['color_id'] = $res[$i]['color_id'];\n unset($res[$i]['color_id']);//删除$res数组中color_id元素\n\n $res[$i]['brand']['brand_name'] = $res[$i]['brand_name'];\n $res[$i]['brand']['brand_id'] = $res[$i]['brand_id'];\n unset($res[$i]['brand_id']);\n unset($res[$i]['brand_name']);\n\n $res[$i]['version']['version_name'] = $res[$i]['goods_version'];\n $res[$i]['version']['version_id'] = $res[$i]['version_id'];\n unset($res[$i]['version_id']);\n unset($res[$i]['goods_version']);\n\n $res[$i]['goods_img']=NROOT.'/Guest/'.$res[$i]['goods_img'];//完善图片路径\n\n }\n return $res;\n}", "protected function prepareTable($table){\n $date = Factory::getDate();\n\t if(empty($table->id)){\n\t $table->created = $date->toSql();\n\t }\n\t}", "public function getTablesModify() {}", "public function _reemplazar($objeto) {\n\t\t$query = $this->_create_query_reemplazar( $objeto );\n\t\t$this->db->query( $query );\n\t\t$this->where=\"\";\t\t\n\t}", "function tree2sql() {\n\t\t$table = $this->packageInfo['table'];\n\t\twhile(list($tableNum,$tableData) = @each($table)) {\n\t\t\tunset($sql);\n\t\t\t$cols = $tableData['column'];\n\t\t\t$thistablename = $tableData['attributes']['name'];\n\t\t\twhile(list($colNum,$col) = @each($cols)) {\n\t\t\t\t$_string = \"\";\n\t\t\t\t$len = \"\";\n\t\t\t\textract($col);\n\t\t\t\t$_string .= \"$field $type \";\n\t\t\t\tif ($len) { $_string .= \"($len) \"; }\n\t\t\t\tif ($null) { $_string .=\" NULL \"; } else { $_string .= \" NOT NULL \"; }\n\t\t\t\t$_string .= \" default '$default' \";\n\t\t\t\tif ($extra) { $_string .= \" $extra \"; }\n\t\t\t\t$sql[] = $_string;\n\t\t\t}\n\t\t\t$idx = $tableData['indexes'];\n\t\t\t$col = \"\";\n\t\t\twhile(list($num,$indx) = @each($idx)) {\n\t\t\t\twhile(list($numpos,$cols) = each($indx['index'])) {\n\t\t\t\t\textract($indx['attributes'][$numpos]);\n\t\t\t\t\t$col[$name]= @implode(\",\",$cols['columns']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sqlindex = \"\";\n\t\t\t$sqlindexes = \"\";\n\t\t\twhile(list($key,$val) = @each($col)) {\n\t\t\t\tif (strtoupper($key)=='PRIMARY') { $key = \" PRIMARY KEY \"; } else { $key = \" KEY $key \"; }\n\t\t\t\t$sqlindex[] = \"$key ($val)\";\n\t\t\t}\n\t\t\t$sqlindexes = @implode(\",\",$sqlindex);\n\t\t\tif ($sqlindexes) { $sqlindexes =\" , $sqlindexes\"; }\n\t\t\t$finalsql[] = \"drop table if exists $thistablename\";\n\t\t\t$finalsql[] = \" create table $thistablename ( \".@implode(\",\",$sql).\" $sqlindexes ) \";\n\n\t\t\t$rows = $tableData['data'][$tableNum]['row'];\n\t\t\twhile(list($rownum,$rowdata) = @each($rows)) { \n\t\t\t\t$keys = \"\";\n\t\t\t\t$vals = \"\";\n\t\t\t\twhile(list($k,$v) = each($rowdata)) { \n\t\t\t\t\t$keys[]=$k;\n\t\t\t\t\t$vals[]=$v;\n\t\t\t\t}\n\t\t\t\t$datasql[] = \"insert into $thistablename (\".implode(\",\",$keys).\") values ('\".implode(\"','\",$vals).\"')\";\n\t\t\t}\n\t\t}\n\t\t$this->datasql = $datasql;\n\t\t$this->sql = $finalsql;\n\t\treturn $finalsql;\n\t}", "public function initTable(){\n\t\t\t\n\t\t}", "public function Upkeep() {\n \n $this->_Upkeep_Entry_Notes_Table();\n }", "function updateTableData($id, $tables_data) {\r\n\tglobal $import_date;\r\n\tglobal $imported_by;\r\n\tif($tables_data) {\r\n\t\t$tables_data_keys = array_keys($tables_data);\r\n\t\t$to_update = false;\r\n\t\t//Flush empty field\r\n\t\t//Should not be done in case we want to erase a data\r\n\t\t//foreach($tables_data as $table_name => $table_fields_and_data) {\r\n\t\t//\tforeach($table_fields_and_data as $field => $data) {\r\n\t\t//\t\tif(!strlen($data)) unset($tables_data[$table_name][$field]);\r\n\t\t//\t}\r\n\t\t//}\r\n\t\t//Check data passed in args\r\n\t\t$main_or_master_tablename = null;\r\n\t\tswitch(sizeof($tables_data)) {\r\n\t\t\tcase '1':\r\n\t\t\t\t$tmp_tables_data_keys = $tables_data_keys;\r\n\t\t\t\t$main_or_master_tablename = array_shift($tmp_tables_data_keys);\r\n\t\t\t\tif(!empty($tables_data[$main_or_master_tablename])) $to_update = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase '2':\r\n\t\t\tcase '3':\r\n\t\t\t\tforeach($tables_data_keys as $table_name) {\r\n\t\t\t\t\tif(preg_match('/_masters$/', $table_name)) {\r\n\t\t\t\t\t\tif(!is_null($main_or_master_tablename)) migrationDie(\"ERR_FUNCTION_updateTableData(): 2 Master tables passed in arguments: \".implode(', ',$tables_data_keys).\".\");\r\n\t\t\t\t\t\t$main_or_master_tablename = $table_name;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!empty($tables_data[$table_name])) $to_update = true;\r\n\t\t\t\t}\r\n\t\t\t\tif(is_null($main_or_master_tablename)) migrationDie(\"ERR_FUNCTION_updateTableData(): Master table not passed in arguments: \".implode(', ',$tables_data_keys).\".\");\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tmigrationDie(\"ERR_FUNCTION_updateTableData(): Too many tables passed in arguments: \".implode(', ',$tables_data_keys).\".\");\r\n\t\t}\r\n\t\tif($to_update) {\r\n\t\t\t//Master/Main Table Update\r\n\t\t\t$table_name = $main_or_master_tablename;\r\n\t\t\t$table_data = $tables_data[$main_or_master_tablename];\r\n\t\t\tunset($tables_data[$main_or_master_tablename]);\r\n\t\t\t$set_sql_strings = array();\r\n\t\t\tforeach(array_merge($table_data, array('modified' => $import_date, 'modified_by' => $imported_by)) as $key => $value) {\r\n\t\t\t if(!is_null($value) && strlen($value)) {\r\n\t\t\t $set_sql_strings[] = \"`$key` = \\\"$value\\\"\";\r\n\t\t\t } elseif(!is_null($value)) {\r\n\t\t\t $set_sql_strings[] = \"`$key` = ''\";\r\n\t\t\t } else {\r\n\t\t\t $set_sql_strings[] = \"`$key` = NULL\";\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t\t$query = \"UPDATE `$table_name` SET \".implode(', ', $set_sql_strings).\" WHERE `id` = $id;\";\r\n\t\t\tcustomQuery($query);\r\n\t\t\t//Detail or SpecimenDetail/DerivativeDetail Table Update\r\n\t\t\t$foreaign_key = str_replace('_masters', '_master_id', $main_or_master_tablename);\r\n\t\t\t$tmp_detail_tablename = null;\r\n\t\t\tforeach($tables_data as $table_name => $table_data) {\r\n\t\t\t\tif(!empty($table_data)) {\r\n\t\t\t\t\t$set_sql_strings = array();\r\n\t\t\t\t\tforeach($table_data as $key => $value) {\r\n\t\t\t\t\t if(!is_null($value) && strlen($value)) {\r\n\t\t\t\t\t $set_sql_strings[] = \"`$key` = \\\"$value\\\"\";\r\n\t\t\t\t\t } elseif(!is_null($value)) {\r\n \t\t\t $set_sql_strings[] = \"`$key` = ''\";\r\n \t\t\t } else {\r\n \t\t\t $set_sql_strings[] = \"`$key` = NULL\";\r\n \t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$query = \"UPDATE `$table_name` SET \".implode(', ', $set_sql_strings).\" WHERE `$foreaign_key` = $id;\";\r\n\t\t\t\t\tcustomQuery($query);\r\n\t\t\t\t\tif(!in_array($table_name, array('specimen_details', 'derivative_details'))) $tmp_detail_tablename = $table_name;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Keep updated tables in memory\r\n\t\t\taddToModifiedDatabaseTablesList($main_or_master_tablename, $tmp_detail_tablename);\r\n\t\t}\r\n\t}\t\r\n}", "function fillTable(): void\n{\n $sql = '\n SET autocommit=0; \n SET unique_checks=0;\n SET foreign_key_checks=0;\n INSERT INTO `products` (name, price, color) VALUES ' . generateTableData(1000001) . ';\n SET unique_checks=1;\n SET foreign_key_checks=1;\n COMMIT;\n ';\n\n DB::getInstance()->query($sql);\n}", "protected function rebuild()\n {\n $this->cleanCaches();\n $mi = new ModuleInstaller();\n $mi->silent = true;\n $mi->rebuild_modules();\n }", "public function dataRevisionsTable();", "function rebuildAll(){\n\t\t\t$this -> rebuild($_SERVER['DOCUMENT_ROOT'].\"/\".$this -> rootFolder);\t\n\t\t}", "public function modifyTable()\n {\n // create columns if they are not already added to the table\n foreach ($this->getParameter('columns') as $column) {\n if (!$this->getTable()->containsColumn($column)) {\n $this->getTable()->addColumn(array(\n 'name' => $column,\n 'type' => 'INTEGER',\n ));\n }\n }\n }", "public function loadFromObject($object){\n foreach ($object as $property => $value) {\n //we must ignore this fields\n if(\\in_array($property,['_type','_primary_key','id'])){\n continue;\n }\n $this->{$property}=$value;\n }\n # we set the real short class name\n if(property_exists($model,'_type')){\n $this->setTableName($model->_type);\n }else{\n $modelObj->setTableName(RedBeanEngine::classNameToTableName($model)); \n }\n }", "protected function resetTableInfo()\n {\n $this->constraintLoader = null;\n $this->columnLoader = null;\n $this->identityLoader = null;\n }", "public static function createTable(){\n if (RBModel::recreateTable(get_called_class()) == false){\n return;\n }\n\n $bean = R::dispense( strtolower(get_called_class()));\n $fields = get_class_vars(get_called_class());\n \n foreach( $fields as $field=>$value){\n\n \n //ignora as variaveis que começam com _\n if ($field[0] == \"_\" || $field == \"id\"){\n continue;\n }\n\n $r = new ReflectionProperty(get_called_class(), $field);\n $comment = strtolower($r->getDocComment());\n\n if (strstr($comment,\"@varchar\")){\n $value = \"\";\n } else\n if (strstr($comment,\"@int\")){\n $value = 0;\n } else\n if (strstr($comment,\"@date\")){\n $value = \"1990-01-01\";\n } else\n if (strstr($comment,\"@datetime\")){\n $value = \"1990-01-01 00:00:00\";\n } else\n if (strstr($comment,\"@double\")){\n $value = 0.0;\n } else\n if (strstr($comment,\"@bool\")){\n $value = false;\n } else\n if (strstr($comment,\"@money\")){\n $value = \"10.00\";\n }\n \n \n $bean->$field = $value;\n }\n \n R::store($bean);\n R::trash($bean);\n }", "public function rebuild($targetMigration = null)\n {\n $migrations = new Ot_Model_DbTable_Migrations($this->_tablePrefix);\n \n $this->_messages[] = 'Dropping all tables';\n \n try {\n $migrations->dropAllTables();\n } catch (Exception $e) {\n throw new Exception('Dropping all the tables failed. ' . $e->getMessage());\n }\n \n $this->_messages[] = 'All tables dropped.';\n \n $this->_messages[] = \"Recreating migration table.\";\n $migrations->createTable(); // create the migrations table\n \n // reset the applied migrations array. it should be empty, but we'll\n // check the db just to make sure\n $this->_appliedMigrations = $migrations->getAppliedMigrations();\n \n if (is_null($targetMigration)) {\n $this->_messages[] = 'Rebuilding database to latest version.';\n return $this->latest();\n } else {\n $this->_messages[] = 'Rebuilding database to version ' . $targetMigration . '.';\n return $this->up($targetMigration);\n }\n }", "private function update_table( $table ) {\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t$definition = $this->get_table_definition( $table );\n\t\tif ( $definition ) {\n\t\t\t$updated = dbDelta( $definition );\n\t\t\tforeach ( $updated as $updated_table => $update_description ) {\n\t\t\t\tif ( strpos( $update_description, 'Created table' ) === 0 ) {\n\t\t\t\t\tdo_action( 'wordcamp/queue/table_maker/created_table', $updated_table, $table );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function tptn_recreate_tables() {\n\tglobal $wpdb;\n\n\t$table_name = $wpdb->base_prefix . 'top_ten';\n\t$table_name_daily = $wpdb->base_prefix . 'top_ten_daily';\n\t$table_name_temp = $table_name . '_temp';\n\t$table_name_daily_temp = $table_name_daily . '_temp';\n\n\t$wpdb->hide_errors();\n\n\t// 1. create temporary tables with the data.\n\t$wpdb->query( \"CREATE TEMPORARY TABLE {$table_name_temp} SELECT * FROM $table_name;\" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared\n\t$wpdb->query( \"CREATE TEMPORARY TABLE {$table_name_daily_temp} SELECT * FROM $table_name_daily;\" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared\n\n\t// 2. Drop the tables.\n\t$wpdb->query( \"DROP TABLE $table_name\" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery\n\t$wpdb->query( \"DROP TABLE $table_name_daily\" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery\n\n\t// 3. Run the activation function which will recreate the tables.\n\ttptn_single_activate();\n\n\t// 4. Reinsert the data from the temporary table.\n\t$sql = \"\n\tINSERT INTO `$table_name` (postnumber, cntaccess, blog_id) (\n\t\tSELECT\n\t\t\tpostnumber,\n\t\t\tcntaccess,\n\t\t\tblog_id\n\t\tFROM `$table_name_temp`\n\t);\n\t\";\n\n\t$wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching\n\n\t$sql = \"\n\tINSERT INTO `$table_name_daily` (postnumber, cntaccess, dp_date, blog_id) (\n\t\tSELECT\n\t\t\tpostnumber,\n\t\t\tcntaccess,\n\t\t\tdp_date,\n\t\t\tblog_id\n\t\tFROM `$table_name_daily_temp`\n\t);\n\t\";\n\n\t$wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching\n\n\t// 5. Drop the temporary tables.\n\t$wpdb->query( \"DROP TABLE $table_name_temp\" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery\n\t$wpdb->query( \"DROP TABLE $table_name_daily_temp\" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery\n\n\t$wpdb->show_errors();\n}", "function update_table( Modyllic_Changeset_Table $table ) {\n $this->update['tables'][$table->name] = $table;\n }", "public function rebuildTree()\n {\n $sql = \"SELECT REBUILD_TREE();\";\n $result = new Resultset(null, $this, $this->getReadConnection()->query($sql));\n\n if (!$result)\n throw new Exception(\"Rebuild tree failed\");\n return $result;\n }", "function onReload()\n {\n try\n {\n Transaction::open( $this->connection );\n $repository = new Repository( $this->activeRecord );\n // cria um critério de seleção de dados\n $criteria = new Criteria;\n $criteria->setProperty('order', 'id');\n \n if (isset($this->filter))\n {\n $criteria->add($this->filter);\n }\n \n // carreta os objetos que satisfazem o critério\n $objects = $repository->load($criteria);\n $this->datagrid->clear();\n if ($objects)\n {\n foreach ($objects as $object)\n {\n // adiciona o objeto na DataGrid\n $this->datagrid->addItem($object);\n }\n }\n Transaction::close();\n }\n catch (Exception $e)\n {\n new Message($e->getMessage());\n }\n }", "public function routerRebuilding() {\n $this->rebuilding = TRUE;\n }", "public function change(): void\n {\n $leads = $this->table('leads');\n $leads->addColumn('id_proyecto', 'integer')\n ->addColumn('status', 'integer')\n ->addColumn('comentarios', 'text')\n ->addColumn('created_at', 'timestamp')\n ->addColumn('updated_at', 'timestamp')\n ->addForeignKey('id_proyecto', 'proyectos', 'id', ['delete' => 'NO_ACTION', 'update' => 'NO_ACTION'])\n ->create();\n\n $datos = $this->table('datos');\n $datos->addColumn('id_lead', 'integer')\n ->addColumn('campo', 'string', ['limit' => 250])\n ->addColumn('valor', 'string', ['limit' => 250])\n ->addColumn('created_at', 'timestamp')\n ->addColumn('updated_at', 'timestamp')\n ->addForeignKey('id_lead', 'leads', 'id', ['delete' => 'CASCADE', 'update' => 'CASCADE'])\n ->create();\n }", "function objectToSQL($object,$table,$field=\"\",$update=\"add\") {\n if (is_array($object)) {\n while(list($k,$v) = each($object)) {\n if (!is_numeric($k)) {\n $array[$k] = $v;\n }\n }\n } else {\n $array = get_object_vars($object);\n }\n while(list($key,$val) = @each($array)) {\n if (substr($key,0,1)!=\"_\") {\n if ($k1) { $k1 .= \",\"; }\n if ($v1) { $v1 .= \",\"; }\n if ($k2) { $k2 .= \",\"; }\n $q = \"'\";\n if (is_numeric($val)) {\n $q=\"\";\n }\n if (is_array($val) || is_object($val)) {\n $val = @serialize($val);\n } else { \n\t\t\t$val = addslashes(stripslashes($val));\n\t\t}\n $k1 .= $key;\n $v1 .= \"$q$val$q\";\n $k2 .= \"$key=$q$val$q\";\n if ($key==$field) {\n $fieldval=\"$q$val$q\";\n }\n }\n }\n if ($update==\"add\") {\n $sql = \"insert into $table ($k1) values ($v1)\";\n }\n if ($update==\"update\") {\n $sql = \"update $table set $k2 where $field=$fieldval\";\n }\n return $sql;\n}", "function set_table($args){\n\t//DEFAULTS\n\tif (! array_key_exists('table_data'\t\t, $args)) { $args['table_data'] = array();}\n\tif (! array_key_exists('name'\t\t\t, $args)) { return 'No name given'; exit;}\n\tif (! array_key_exists('hyrarchical'\t, $args)) { $args['hyrarchical'] = FALSE;}\n\t\n\t//VARIABLES\n\t$tablename = $GLOBALS['tableprefix'] . '_' . $args['name'];\n\t$create_parent_id = ($args['hyrarchical'] == TRUE ? 'parent_id INT Default \\'0\\',' : '');\n\t$create_children_ids = ($args['hyrarchical'] == TRUE ? 'children_ids INT,' : '');\n\t\n\t//Does table already exist?\n\t$sql = \"SELECT * FROM $tablename \";\n\t$exists = mysql_query($sql);\n\t\n\tif (! $exists ){\n\t\t//Create the table and its initial AI id / timestamp \n\t\t$sql = \"CREATE TABLE $tablename (\n\t\t\t\t\tid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\t\tcreation_date TIMESTAMP(8),\n\t\t\t\t\tpublish_date TIMESTAMP(8),\n\t\t\t\t\troworder INT\n\t\t\t\t)\";\n\t\tmysql_query($sql);\n\t\terror_log( \"<p class='log log_\" . (mysql_affected_rows() != -1 ? 'success' : 'failed') . \"'><date>[\" . date('d-m-Y G:i:s') . \"]</date>Table <strong>$tablename</strong> created.</p>\", 3, \"infos.log\");\n\t}\n\t\n\t//Hyrarchy change\n\t$sql = \"SELECT parent_id FROM $tablename\";\n\t$hyr = (mysql_query($sql) ? TRUE : FALSE);\n\tif ($hyr != $args['hyrarchical']){\n\t\tif ($args['hyrarchical']) {\n\t\t\t$sql = \"ALTER TABLE $tablename ADD parent_id INT Default '0'\";\n\t\t\tmysql_query($sql);\n\t\t\t\n\t\t\t$sql = \"ALTER TABLE $tablename ADD children_ids INT Default '0'\";\t\t\t\n\t\t\tmysql_query($sql);\n\t\t\t\n\t\t\terror_log( \" <p class='log log_\" . (mysql_affected_rows() != -1 ? 'success' : 'failed') . \"'><date>[\" . date('d-m-Y G:i:s') . \"]</date>Table <strong>$tablename</strong> has changed its hyrarchical state to <strong>TRUE</strong>.</p>\", 3, \"infos.log\");\n\t\t\t\n\t\t} else {\n\t\t\t$sql = \"ALTER TABLE $tablename DROP COLUMN parent_id\";\n\t\t\tmysql_query($sql);\n\t\t\n\t\t\t$sql = \"ALTER TABLE $tablename DROP COLUMN children_ids\";\n\t\t\tmysql_query($sql);\n\t\t\t\n\t\t\terror_log( \"<p class='log log_\" . (mysql_affected_rows() != -1 ? 'success' : 'failed') . \"'><date>[\" . date('d-m-Y G:i:s') . \"]</date> Table <strong>$tablename</strong> has changed its hyrarchical state to <strong>FALSE</strong>.</p>\", 3, \"infos.log\");\n\t\t}\n\t}\n\t\n\t\n//DEPRICATED/////////////////////////////////////////////////////////////\n\t//Do the columns\n\tif ($args['table_data']) {\n\t\tforeach ($args['table_data'] as $table_data) {\n\t\t\tswitch ($table_data['relation']) {\n\t\t\t\tcase 'self':\n\t\t\t\t\t$args2 = array(\n\t\t\t\t\t\t'table' => $args['name'],\n\t\t\t\t\t\t'relation' => $table_data['relation'],\n\t\t\t\t\t\t'self_name' => $table_data['self_name'],\n\t\t\t\t\t\t'self_definition' => $table_data['self_definition']\n\t\t\t\t\t);\n\t\t\t\t\tadd_table_data($args2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'm2m' || 's2m':\n\t\t\t\t\tif (! array_key_exists('hyrarchical', $table_data)) { $table_data['hyrarchical'] = FALSE;}\n\t\t\t\t\tif (! array_key_exists('table_data', $table_data)) { $table_data['table_data'] = array();}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$args2 = array(\n\t\t\t\t\t\t'table' => $args['name'],\n\t\t\t\t\t\t'relation' => $table_data['relation'],\n\t\t\t\t\t\t'target' => $table_data['target'],\n\t\t\t\t\t\t'hyrarchical' => $table_data['hyrarchical'],\n\t\t\t\t\t\t'table_data' => $table_data['table_data']\n\t\t\t\t\t);\n\t\t\t\t\tadd_table_data($args2);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t}\n\t\n\t\t}\n\t}\n//END DEPRICATED/////////////////////////////////////////////////////////////\n\t\n\t\n}", "public function update_record($table, $dataobject, $bulk=false) {\n\nerror('todo');\n\n global $db, $CFG;\n\n if (! isset($dataobject->id) ) {\n return false;\n }\n\n /// Check we are handling a proper $dataobject\n if (is_array($dataobject)) {\n debugging('Warning. Wrong call to update_record(). $dataobject must be an object. array found instead', DEBUG_DEVELOPER);\n $dataobject = (object)$dataobject;\n }\n\n /// Temporary hack as part of phasing out all access to obsolete user tables XXX\n if (!empty($CFG->rolesactive)) {\n if (in_array($table, array('user_students', 'user_teachers', 'user_coursecreators', 'user_admins'))) {\n if (debugging()) { var_dump(debug_backtrace()); }\n print_error('This SQL relies on obsolete tables ('.$table.')! Your code must be fixed by a developer.');\n }\n }\n\n /// Begin DIRTY HACK\n if ($CFG->dbfamily == 'oracle') {\n oracle_dirty_hack($table, $dataobject); // Convert object to the correct \"empty\" values for Oracle DB\n }\n /// End DIRTY HACK\n\n /// Under Oracle, MSSQL and PostgreSQL we have our own update record process\n /// detect all the clob/blob fields and delete them from the record being updated\n /// saving them into $foundclobs and $foundblobs [$fieldname]->contents\n /// They will be updated later\n if (($CFG->dbfamily == 'oracle' || $CFG->dbfamily == 'mssql' || $CFG->dbfamily == 'postgres')\n && !empty($dataobject->id)) {\n /// Detect lobs\n $foundclobs = array();\n $foundblobs = array();\n db_detect_lobs($table, $dataobject, $foundclobs, $foundblobs, true);\n }\n\n // Determine all the fields in the table\n if (!$columns = $db->MetaColumns($CFG->prefix . $table)) {\n return false;\n }\n $data = (array)$dataobject;\n\n if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; };\n\n // Pull out data matching these fields\n $update = array();\n foreach ($columns as $column) {\n if ($column->name == 'id') {\n continue;\n }\n if (array_key_exists($column->name, $data)) {\n $key = $column->name;\n $value = $data[$key];\n if (is_null($value)) {\n $update[] = \"$key = NULL\"; // previously NULLs were not updated\n } else if (is_bool($value)) {\n $value = (int)$value;\n $update[] = \"$key = $value\"; // lets keep pg happy, '' is not correct smallint MDL-13038\n } else {\n $update[] = \"$key = '$value'\"; // All incoming data is already quoted\n }\n }\n }\n\n /// Only if we have fields to be updated (this will prevent both wrong updates +\n /// updates of only LOBs in Oracle\n if ($update) {\n $query = \"UPDATE {$CFG->prefix}{$table} SET \".implode(',', $update).\" WHERE id = {$dataobject->id}\";\n if (!$rs = $db->Execute($query)) {\n debugging($db->ErrorMsg() .'<br /><br />'.s($query));\n if (!empty($CFG->dblogerror)) {\n $debug=array_shift(debug_backtrace());\n error_log(\"SQL \".$db->ErrorMsg().\" in {$debug['file']} on line {$debug['line']}. STATEMENT: $query\");\n }\n return false;\n }\n }\n\n /// Under Oracle, MSSQL and PostgreSQL, finally, update all the Clobs and Blobs present in the record\n /// if we know we have some of them in the query\n if (($CFG->dbfamily == 'oracle' || $CFG->dbfamily == 'mssql' || $CFG->dbfamily == 'postgres') &&\n !empty($dataobject->id) &&\n (!empty($foundclobs) || !empty($foundblobs))) {\n if (!db_update_lobs($table, $dataobject->id, $foundclobs, $foundblobs)) {\n return false; //Some error happened while updating LOBs\n }\n }\n\n return true;\n }", "protected function flushBuiltKeys()\n {\n $this->builtKeys = [];\n }", "public function beforeSave()\n {\n $this->rebuildTree();\n }", "public function cleanRecordVersions()\n\t{\n \t\t$this -> db -> query(\"DELETE FROM `\".$this -> table.\"` \n \t\t\t\t\t\t\t WHERE `model`='\".$this -> model.\"' \n \t\t\t\t\t\t\t AND `row_id`='\".$this -> row_id.\"'\");\n \t\treturn $this;\n \t}", "public function processConstraints() {\n foreach ($this->settingsAll as $table => $settings) {\n foreach ($settings as $name => $values) {\n if ($name == self::$meta) {\n continue;\n }\n foreach ($values as $k => $v) {\n $sql = array();\n # belongsTo (=foreign key)\n if ($k == 'belongsto') {\n $fkName = $name;\n # apply referenced PK/index settings for FK\n # @TODO currently assuming always referencing PK, could be INDEX!\n # - if referenceKey is set, and it doesnt refer to PK, do an INDEX + use the value\n $pkName = $this->settingsAll[$v][self::$meta][$this->primaryKey]['name'];\n $settingsFromPK = $this->settingsAll[$v][$pkName];\n unset($settingsFromPK['primarykey']);\n unset($settingsFromPK['autoincrement']);\n # we've got referenced table PK data here\n # - means fieldName is wrong.\n # - fix: add these settings for our belongsTo field, and process that\n $finalSettings = array_merge($values, $settingsFromPK);\n # do not add belongsTo column to its targetTable as a column\n #$this->settingsAll[$v][$fkName] = $finalSettings;\n $res = $this->processVars($fkName, $finalSettings);\n $alter = \"ALTER TABLE `\" . $this->getCustomTableName($table) . \"`\";\n # add index\n $sql[] = \"{$alter} ADD INDEX (`{$fkName}`);\";\n # create column first, then add FK constraint\n if (!empty($res['val']['maxLength'])) {\n $maxLengthSql = '(' . $res['val']['maxLength'] . ')';\n }\n # onUpdate? onDelete? more than one?\n $extra = '';\n if (isset($values['ondelete'])) {\n $extra.='ON DELETE ' . strtoupper($values['ondelete']);\n }\n if (isset($values['onupdate'])) {\n $extra.='ON UPDATE ' . strtoupper($values['onupdate']);\n }\n $sql[] = \"{$alter} ADD FOREIGN KEY (`{$fkName}`) REFERENCES `\" . $this->getCustomTableName($v) . \"` (`{$pkName}`) {$extra};\";\n # save FK info to global __meta\n $this->settingsAll[self::$meta]['rel'][$table][$v] = array(\n 'local' => $fkName,\n 'ref' => $pkName\n );\n # save FK info to table's __meta\n $this->settingsAll[$table][self::$meta]['fks'][$fkName] =\n array($v => array(\n 'local' => $fkName,\n 'ref' => $pkName\n )\n );\n # save relation SQL to global __meta\n $this->log(implode(\"\\n\", $sql));\n $this->settingsAll[self::$meta]['rel_sql'][$table][] = $sql;\n $this->unsetFromCreate($table, $fkName);\n $this->settingsAll[$table][self::$meta]['create'][] = $res;\n }\n if ($k == 'hasmany') {\n $this->settingsAll[self::$meta]['hasmany'][$v][$table][] = $name;\n $this->unsetFromCreate($table, $name);\n }\n if ($k == 'hasone') {\n $this->settingsAll[self::$meta]['hasone'][$v][$table][] = $name;\n $this->unsetFromCreate($table, $name);\n }\n if ($k == 'through') {\n $this->settingsAll[self::$meta]['through'][$v][$table][] = $name;\n #$this->unsetFromCreate($table, $name);\n }\n } // endforeach($values as $k=>$v)\n } // endforeach($settings as $name=>$values)\n } // endforeach($this->settingsAll as $table=>$settings)\n }", "function populate_table()\n\t{\n\t\t$this->table = array();\n\n\t\t$prev_row = array();\n\t\tfor ($i = -1; $i < $this->data_new_len; $i++)\n\t\t{\n\t\t\t$prev_row[$i] = 0;\n\t\t}\n\n\t\tfor ($i = 0; $i < $this->data_old_len; $i++)\n\t\t{\n\t\t\t$this_row = array('-1' => 0);\n\t\t\t$data_old_value = $this->data_old[$i];\n\n\t\t\tfor ($j = 0; $j < $this->data_new_len; $j++)\n\t\t\t{\n\t\t\t\tif ($data_old_value == $this->data_new[$j])\n\t\t\t\t{\n\t\t\t\t\t$this_row[$j] = $prev_row[$j - 1] + 1;\n\t\t\t\t}\n\t\t\t\telse if ($this_row[$j - 1] > $prev_row[$j])\n\t\t\t\t{\n\t\t\t\t\t$this_row[$j] = $this_row[$j - 1];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this_row[$j] = $prev_row[$j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->table[$i - 1] = $this->compress_row($prev_row);\n\t\t\t$prev_row = $this_row;\n\t\t}\n\t\tunset($prev_row);\n\t\t$this->table[$this->data_old_len - 1] = $this->compress_row($this_row);\n\t}", "public function updateTables()\n {\n $prefix = $this->getPrefix();\n $charset = $this->wpdb->get_charset_collate();\n\n foreach ($this->config['tables'] as $table => $createStatement) {\n $sql = str_replace(\n ['{prefix}', '{charset}'],\n [$prefix, $charset],\n $createStatement\n );\n dbDelta($sql);\n }\n }", "private function table_construct($table)\n {\n if (!isset($table->builded_at) || Carbon::parse($table->builded_at)->diffInSeconds(new Carbon($table->construct_at), false) > 0) {\n $this->table_build($table);\n }\n }", "public function expand()\n {\n $oldTable = clone $this;\n\n if ($this->cap < 1024) $this->cap *= 2;\n else $this->cap += ($this->cap >> 2);\n\n $this->reset();\n\n foreach ($oldTable as $key => $value) {\n $this->set($key, $value);\n }\n }", "public function rebuildRoutes() {\n $this->routeBuilder->rebuild();\n }", "public function build(){\r\n\r\n $columns = '';\r\n\r\n if(!is_null($this->table)){\r\n\r\n //run the drop table query before creating the new one\r\n if($this->_dropifexists){\r\n $this->database->rawQuery('DROP TABLE IF EXISTS '.$this->table.';');\r\n }\r\n \r\n $this->_sqlquery .= 'CREATE TABLE '.$this->table.' ';\r\n\r\n //process columns\r\n foreach($this->_sqlcols as $column => $attributes){\r\n $columns .= $column.' '.join(' ', $attributes).',';\r\n }\r\n\r\n //process primary column\r\n if(!is_null($this->_primary)){\r\n $columns .= 'primary key ('.$this->_primary.')';\r\n }\r\n\r\n //process unique columns\r\n if(count($this->_unique) !== 0){\r\n $columns .= 'UNIQUE ('.join(',', $this->_unique).')';\r\n }\r\n\r\n //foreign key\r\n if(count($this->_fk) !== 0){\r\n $columns .= $this->_parseFKConstraints($this->_fk);\r\n }\r\n\r\n //trim commas\r\n $columns = rtrim($columns, ',');\r\n\r\n $this->_sqlquery .= '('.$columns.')';\r\n }\r\n\r\n return $this->database->rawQuery($this->_sqlquery);\r\n }", "function createTable($objSchema);", "public function rewrite_flush()\n {\n $this->register_post_type();\n $this->build_database_table();\n flush_rewrite_rules();\n }", "function schema_alter_build(&$schema, $entity_type) {}", "function cleanTables($test = false) {\n\n\t\t$this->cleanForeignKey('sotf_blobs', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_blobs', 'object_id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_nodes', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_user_permissions', 'permission_id', 'sotf_permissions', 'id');\n\n\t\t$this->cleanForeignKey('sotf_stations', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_contacts', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_contacts', 'station_id', 'sotf_stations', 'id');\n\n\t\t$this->cleanForeignKey('sotf_series', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_series', 'station_id', 'sotf_stations', 'id');\n\n\t\t$this->cleanForeignKey('sotf_object_roles', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_object_roles', 'contact_id', 'sotf_contacts', 'id');\n\n\t\t$this->cleanForeignKey('sotf_object_roles', 'object_id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_programmes', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_programmes', 'station_id', 'sotf_stations', 'id');\n\n\t\t//// series field is not compulsory! \n\t\t//// $this->cleanForeignKey('sotf_programmes', 'series_id', 'sotf_series', 'id');\n\n\t\t$this->cleanForeignKey('sotf_rights', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_rights', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_extradata', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_extradata', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_other_files', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_other_files', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_media_files', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_media_files', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_links', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_links', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_topic_tree_defs', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_topic_trees', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_topics', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_topics', 'topic_id', 'sotf_topic_tree_defs', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_topics', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_topics', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_genres', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_roles', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_role_names', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_role_names', 'role_id', 'sotf_roles', 'role_id');\n\n\t\t$this->cleanForeignKey('sotf_deletions', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_playlists', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_ratings', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_rating', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_rating', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_refs', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_refs', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_stats', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_stats', 'prog_id', 'sotf_programmes', 'id');\n\t\t\n\t\t$this->cleanForeignKey('sotf_prog_stats', 'station_id', 'sotf_stations', 'id');\n\n\t\t$this->cleanForeignKey('sotf_stats', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_stats', 'station_id', 'sotf_stations', 'id');\n\n\t\t$this->cleanForeignKey('sotf_comments', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_to_forward', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_unique_access', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_user_progs', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_portals', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_station_mappings', 'id_at_node', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_station_mappings', 'station', 'sotf_stations', 'id');\n\n\t\t// very important! for syncing!!\n\t\t$this->cleanForeignKey('sotf_object_status', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanNodeObjects();\n\n\t}", "private function buildQuery(): void\n {\n $this->query = self::CREATE_TABLE;\n\n if ($this->ifNotExists) {\n $this->query .= self::IF_NOT_EXISTS;\n }\n\n $this->query .= $this->table . self::OPENING_BRACKET;\n\n $this->query .= join(', ', $this->columns);\n\n if (!empty($this->keys)) {\n $this->query .= ',' . join(',', $this->keys);\n }\n\n $this->query .= self::CLOSING_BRACKET;\n\n if (!empty($this->engine)) {\n $this->query .= self::ENGINE . $this->engine;\n }\n\n if (!empty($this->charset)) {\n $this->query .= self::CHARSET . $this->charset;\n }\n }", "public static function buildSchemaFromTable($table_name) {\n\t\ttry {\n\t\t\t// get all table information\n\t\t\t$sql = \"SELECT * FROM `INFORMATION_SCHEMA`.`COLUMNS` \";\n\t\t\t$sql .= \"WHERE `TABLE_SCHEMA`='\".SchemaBuilder::$db_name.\"'AND `TABLE_NAME`='\".$table_name.\"' \";\n\t\t\t$result = SchemaBuilder::$_db->query($sql);\n\n\t\t\t//changed so we dont have to recommit every schema on one change\n\t\t\t// $top_msg = \"<?php \\n/*\\n*****AUTOGENERATED FILE*****\\n CREATED ON:\".date(\"D M j Y G:i:s\").\"\\n*/\\n\";\n\t\t\t$top_msg = \"<?php \\n/*\\n*****AUTOGENERATED FILE*****\\n*/\\n\";\n\t\t\t$bottom_msg = \"\\n?>\";\n\t\t\t$out = \"\";\n\t\t\t$key = \"\";\n\t\t\t$delete_method = \"DELETE\";\n\t\t\t$prefix = \"\";\n\t\t\t// for each column\n\t\t\twhile ($result->hasNext()) {\n\t\t\t\t$row = $result->next();\n\t\t\t\t$out .= '$schema[\\''.$row['COLUMN_NAME'].'\\'] = array(\\'attributes\\'=> array(\\'type\\'=>\\''.$row['DATA_TYPE'].'\\', \\'is_null\\'=>\\''.$row['IS_NULLABLE'].'\\', ';\n\t\t\t\t$out .= '\\'max_length\\'=>\\''.$row['CHARACTER_MAXIMUM_LENGTH'].'\\', ';\n\t\t\t\t$out .= '\\'column_key\\' =>\\''.$row['COLUMN_KEY'].'\\'';\n\t\t\t\t$out .= \"));\\n\";\n\t\t\t\tif($prefix == \"\"){\n\t\t\t\t\t$prefix = current(explode(\"_\",$row['COLUMN_NAME']));\n\t\t\t\t}\n\t\t\t\tif ($row['COLUMN_KEY'] == 'PRI') {\n\t\t\t\t\t$key = $row['COLUMN_NAME'];\n\t\t\t\t}\n\t\t\t\tif( $row['COLUMN_NAME'] == $prefix.\"_disabled\" ){\n\t\t\t\t\t$delete_method = $row['COLUMN_NAME'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// add primary key\n\t\t\t$out .= '$schema[\\'pri\\'] = \\''.$key.'\\';';\n\t\t\t$out .= \"\\n\";\n\t\t\t$out .= '$schema[\\'delete_method\\'] = \\''.$delete_method.'\\';';\n\t\t\t$out .= \"\\n\";\n\t\t\t// add database name\n\t\t\t$out .= '$schema[\\'db_name\\'] = \\''.SchemaBuilder::$db_name.'\\'; ';\n\t\t\tfile_put_contents(SCHEMAPATH.SchemaBuilder::$namespace.\".\".$table_name.\".schema.php\", $top_msg.$out.$bottom_msg);\n\n\t\t} catch(Exception $e) {\n\t\t\treturn SchemaBuilder::send_error($e.\" Error building schema\", __FUNCTION__);\n\t\t}\n\n\t}" ]
[ "0.7046205", "0.61798495", "0.5847027", "0.57646143", "0.5755347", "0.5651238", "0.5610066", "0.56087756", "0.54860795", "0.54860795", "0.54860795", "0.54860795", "0.54257786", "0.5394339", "0.5362413", "0.5338738", "0.5313657", "0.5306466", "0.5301844", "0.52752036", "0.527255", "0.5265431", "0.52642256", "0.5257799", "0.5254208", "0.52478445", "0.5237576", "0.5206576", "0.52033186", "0.5193391", "0.51898545", "0.51871943", "0.5172955", "0.51651603", "0.5138898", "0.5130421", "0.5127824", "0.5103463", "0.5097958", "0.50955796", "0.50708365", "0.50615567", "0.50573367", "0.5052599", "0.50342405", "0.5031436", "0.5015657", "0.5015212", "0.50121564", "0.5008397", "0.5007121", "0.49935576", "0.49909577", "0.49851602", "0.49811408", "0.49808437", "0.49738955", "0.4964545", "0.495523", "0.4947011", "0.4940113", "0.49331468", "0.49318206", "0.49259624", "0.49236366", "0.4923356", "0.49216715", "0.49202204", "0.49156493", "0.49082813", "0.4900217", "0.48986226", "0.48900464", "0.4886544", "0.48777002", "0.4877095", "0.48743156", "0.4871562", "0.48712897", "0.48530126", "0.4851526", "0.484063", "0.48378915", "0.4836109", "0.4835782", "0.48298806", "0.48286718", "0.48274302", "0.48252237", "0.482443", "0.48207122", "0.48199624", "0.48071626", "0.48006845", "0.47969636", "0.47955534", "0.4794834", "0.478582", "0.47851756", "0.47846216" ]
0.565415
5
Launches table rebuilding for all objects in defined path
private static function _createObjects($rootPath, $params = []) { $dir = new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator($rootPath . '/Object/') ); foreach ($dir as $path => $fileInfo) { if ($fileInfo->isFile()) { $path = explode('/', $fileInfo->getPath()); $parentDir = $path[sizeof($path) - 1]; $className = str_replace('.php', '', $fileInfo->getFilename()); if ($parentDir != 'Object') { $className = $parentDir . '_' . $className; } $className = Orm::detectClass($className); $schema = new Schema(new $className()); $dropTable = isset($params['dropTable']) ? true : false; $schema->create($dropTable); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rebuild()\r\n {\r\n $this->delete(array());\r\n\r\n $table = new Car_Types();\r\n\r\n $this->rebuildStep($table, array(0), 0);\r\n }", "function execute()\n {\n $this->OldModel = $this->getOldModelToUse();\n $this->OldModel->cacheQueries = false;\n $this->OldModel->cacheSQL = false;\n $this->NewModel = $this->getNewModelToUse();\n $this->NewModel->cacheQueries = false;\n $this->NewModel->cacheSQL = false;\n \n $tableMap = $this->getTableMap();\n debug($tableMap);\n if (!$tableMap)\n {\n $this->print_instructions();\n exit();\n }\n\n foreach ($tableMap as $table => $data)\n {\n if (!$this->specialProcessing($table, $data))\n {\n $this->import($table, $data);\n }\n }\n }", "protected function _initsTable() {}", "function OptimizeTables() {}", "private function prepareTables() {}", "function buildTable($schedule,$users){\n\t\t$this->refreshTable();\n\t}", "protected function createLoadTables()\n {\n // foreach table, replace it with an empty table\n $tables = $this->schema->getTables();\n foreach ($tables as $table) {\n $this->dbcon->replaceTable($table);\n\n $msg = \"Created table '\".$table->name.\"'\";\n\n // If this table uses the Lookup table, create a view\n if ($table->usesLookup === true) {\n $this->dbcon->replaceLookupView($table, $this->schema->getLookupTable());\n $msg .= '; Lookup table created';\n }\n\n $this->log($msg);\n }\n return true;\n }", "protected function startTable() {}", "public function reloadTableNames() {\n\t\t$this->_loadTableNames();\n\t}", "private function generateCache()\n {\n $schmaTabls = [];\n foreach (self::$allSchema as $Schema) {\n $schmaTabls[] = Tools::parse_object_TO_array($Schema);\n }\n self::setgenerateCACHE_SELECT($schmaTabls);\n }", "public static function directory_smush_table() {\n\t\tif ( ! class_exists( '\\\\Smush\\\\Core\\\\Modules\\\\Abstract_Module' ) ) {\n\t\t\trequire_once __DIR__ . '/modules/class-abstract-module.php';\n\t\t}\n\n\t\tif ( ! class_exists( '\\\\Smush\\\\Core\\\\Modules\\\\Dir' ) ) {\n\t\t\trequire_once __DIR__ . '/modules/class-dir.php';\n\t\t}\n\n\t\t// No need to continue on sub sites.\n\t\tif ( ! Modules\\Dir::should_continue() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Create a class object, if doesn't exists.\n\t\tif ( ! is_object( WP_Smush::get_instance()->core()->mod->dir ) ) {\n\t\t\tWP_Smush::get_instance()->core()->mod->dir = new Modules\\Dir();\n\t\t}\n\n\t\t// Create/upgrade directory smush table.\n\t\tWP_Smush::get_instance()->core()->mod->dir->create_table();\n\t}", "public function compileAdminTables() {}", "private function _loadDataToTemporaryTable(){\n\n }", "function refreshTable(){\n\t\t$this->table = array();\n\n\t\t//set the column headers\n\t\t$this->table[0] = $this->getColumnHeaders();\n\n\t\t//add a row for each user\n\t\tforeach ($this->users as $name => $schedule) {\n\t\t\t$row = array();\n\n\t\t\t//if this user is being edited\n\t\t\tif($this->currentEdit == $name) $row = $this->userEditRow($name, $schedule, $this->table[0]);\n\t\t\telse $row = $this->userDisplayRow($name, $schedule, $this->table[0]);\n\t\t\t\n\t\t\tarray_push($this->table, $row);\n\t\t}\n\n\t\tarray_push($this->table, $this->genSubmitRow());\n\n\t\tarray_push($this->table, $this->genTotalRow());\n\n\t\t$this->logMsg(SUCCESS, 'internal table constructed');\n\t}", "public function run()\n {\n foreach (range(1,25) as $index) {\n \t$table = new Table();\n \t$table->number_of_seats=6;\n \t$table->table_name = 'Table '.$index;\n \t$table->room_id = 1;\n \t$table->table_type_id = 2;\n $table->width = 6;\n \t$table->length = 6;\n \t$table->save();\n \n }\n }", "private function rebuildIndex()\n {\n foreach ($this->rows as $id => $row) {\n $label = $row->getColumn('label');\n if ($label !== false) {\n $this->rowsIndexByLabel[$label] = $id;\n }\n }\n $this->indexNotUpToDate = false;\n }", "public function refreshTable();", "function MyMod_Handle_Files_Subdirs_Table($path,$prencells=0)\n {\n $subdirs=$this->DirSubdirs($path);\n sort($subdirs);\n\n $table=array();\n foreach ($subdirs as $subdir)\n {\n $table=array_merge($table,$this->MyMod_Handle_Files_Subdir_Rows($subdir));\n\n\n $includetree=$this->GetPOST(\"Include_\".$subdir);\n if ($includetree==1)\n {\n $table=$this->MyMod_Handle_Files_Table($path.\"/\".basename($subdir),$table,$prencells++);\n }\n }\n \n\n return $table;\n }", "public function buildTable()\n {\n\n $view = View::getActive();\n\n // Creating the Head\n $head = '<thead class=\"ui-widget-header\" >'.NL;\n $head .= '<tr>'.NL;\n\n $head .= '<th >Project Name</th>'.NL;\n //$head .= '<th>File</th>'.NL;\n $head .= '<th >Description</th>'.NL;\n $head .= '<th style=\"width:165px\" >Nav</th>'.NL;\n\n $head .= '</tr>'.NL;\n $head .= '</thead>'.NL;\n //\\ Creating the Head\n\n // Generieren des Bodys\n $body = '<tbody class=\"ui-widget-content\" >'.NL;\n\n $num = 1;\n foreach ($this->data as $key => $row) {\n $rowid = $this->name.\"_row_$key\";\n\n $body .= \"<tr class=\\\"row$num\\\" id=\\\"$rowid\\\" >\";\n\n $urlConf = 'index.php?c=Daidalos.Projects.genMask&amp;objid='.urlencode($key);\n $linkConf = '<a title=\"GenMask\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlConf.'\">'\n .Wgt::icon('daidalos/bdl_mask.png' , 'xsmall' , 'build').'</a>';\n\n $urlGenerate = 'index.php?c=Genf.Bdl.build&amp;objid='.urlencode($key);\n $linkGenerate = '<a title=\"Code generieren\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlGenerate.'\">'\n .Wgt::icon('daidalos/parser.png' , 'xsmall' , 'build').'</a>';\n\n\n $urlDeploy = 'index.php?c=Genf.Bdl.deploy&amp;objid='.urlencode($key);\n $linkDeploy = '<a title=\"Deploy the Project\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlDeploy.'\">'\n .Wgt::icon('genf/deploy.png' , 'xsmall' , 'deploy').'</a>';\n\n $urlRefreshDb = 'index.php?c=Genf.Bdl.refreshDatabase&amp;objid='.urlencode($key);\n $linkRefreshDb = '<a title=\"Refresh the database\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlRefreshDb.'\">'\n .Wgt::icon('daidalos/db_refresh.png' , 'xsmall' , 'sync db').'</a>';\n\n $urlSyncDb = 'index.php?c=Genf.Bdl.syncDatabase&amp;objid='.urlencode($key);\n $linkSyncDb = '<a title=\"Sync the database with the model\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlSyncDb.'\">'\n .Wgt::icon('daidalos/db_sync.png' , 'xsmall' , 'sync db').'</a>';\n\n $urlPatchDb = 'index.php?c=Genf.Bdl.createDbPatch&amp;objid='.urlencode($key);\n $linkPatchDb = '<a title=\"Create an SQL Patch to alter the database\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlPatchDb.'\" >'\n .Wgt::icon('genf/dump.png' , 'xsmall' , 'create alter patch').'</a>';\n\n $urlClean = 'index.php?c=Genf.Bdl.clean&amp;objid='.urlencode($key);\n $linkClean = '<a title=\"Projekt cleanen\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlClean.'\">'\n .Wgt::icon('genf/clean.png' , 'xsmall' , 'clean').'</a>';\n\n $body .= '<td valign=\"top\" >'.$row[0].'</td>'.NL;\n //$body .= '<td valign=\"top\" >'.$row[1].'</td>'.NL;\n $body .= '<td valign=\"top\" >'.$row[2].'</td>'.NL;\n $body .= '<td valign=\"top\" align=\"center\" >'.$linkConf.' | '.$linkGenerate.$linkDeploy.' | '.$linkSyncDb.' '.$linkRefreshDb.' '.$linkPatchDb.' | '.$linkClean.'</td>'.NL;\n\n $body .= '</tr>'.NL;\n\n $num ++;\n if ($num > $this->numOfColors)\n $num = 1;\n\n }// ENDE FOREACH\n\n $body .= \"</tbody>\".NL;\n //\\ Generieren des Bodys\n\n $html ='<table id=\"table_'.$this->name.'\" class=\"full\" >'.NL;\n $html .= $head;\n $html .= $body;\n $html .= '</table>'.NL;\n\n return $html;\n\n }", "private function updateFlatTables()\n {\n $connection = $this->resource->getConnection(ResourceConnection::DEFAULT_CONNECTION);\n // Update all\n foreach ($this->lsTables as $lsTable) {\n $lsTableName = $this->resource->getTableName($lsTable);\n $lsQuery = \"UPDATE $lsTableName SET scope = 'stores', scope_id = 1\";\n try {\n $connection->query($lsQuery);\n } catch (Exception $e) {\n $this->logger->debug($e->getMessage());\n }\n }\n }", "public function run()\n {\n $all_tables = DB::connection()->getDoctrineSchemaManager()->listTableNames();\n $tables = array_diff($all_tables, ['table_columns', 'products_images', 'orders_shares', 'migrations', 'roles_permissions', 'products_attributes', 'products_attachments']);\n foreach($tables as $table_name){\n $table_columns = DB::getSchemaBuilder()->getColumnListing($table_name);\n $sort_order = 0;\n foreach($table_columns as $column_name) {\n $column_type = DB::getDoctrineColumn($table_name, $column_name)->getType()->getName();\n $column_length = DB::getDoctrineColumn($table_name, $column_name)->getLength();\n DB::table('table_columns')->insert([\n 'table_name' => $table_name,\n 'column_name' => $column_name,\n 'column_type' => $column_type,\n 'is_default_column' => true,\n 'max_length' => $column_length,\n 'sort_order' => $sort_order\n ]);\n $sort_order = $sort_order + 100;\n }\n }\n\n }", "protected function createCacheTables() {}", "public function run()\n {\n $this->deleteTable();\n $i = 1;\n while ($i < 31) {\n $data = [\n [\n 'carrierId' => $i,\n 'imageId' => rand(5,8)\n ]\n ];\n\n $this->loadTable($data);\n $i++;\n }\n }", "function tables()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['tables'] == 1 ) ? 'Database Table' : 'Database Tables';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'dropped' : 'created';\n\t\t$old_data = array();\n\t\t$new_fields = array();\n\t\t\n\t\tforeach ( $this->xml_array['tables_group']['table'] as $k => $v )\n\t\t{\n\t\t\t$this->ipsclass->DB->sql_drop_table( $v['name']['VALUE'].\"_bak\" );\n\t\t\t\n\t\t\tif ( !$this->ipsclass->input['un'] && in_array( SQL_PREFIX.$v['name']['VALUE'], $this->ipsclass->DB->get_table_names() ) )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->query( \"RENAME TABLE \".SQL_PREFIX.$v['name']['VALUE'].\" TO \".SQL_PREFIX.$v['name']['VALUE'].\"_bak;\" );\n\t\t\t\t$this->ipsclass->DB->cached_tables[] = SQL_PREFIX.$v['name']['VALUE'].\"_bak\";\n\t\t\t}\n\t\t\t\n\t\t\t$this->ipsclass->DB->sql_drop_table( $v['name']['VALUE'] );\n\t\t\t\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->query( $this->fix_create_table( \"CREATE TABLE IF NOT EXISTS \".SQL_PREFIX.$v['name']['VALUE'].\" (\".$v['data']['VALUE'].\") TYPE=\".$v['type']['VALUE'] ) );\n\t\t\t\t\n\t\t\t\tif ( in_array( SQL_PREFIX.$v['name']['VALUE'].\"_bak\", $this->ipsclass->DB->get_table_names() ) )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->DB->build_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => $v['name']['VALUE'].\"_bak\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\t );\n\t\t\t\t\t$this->ipsclass->DB->exec_query();\n\t\t\t\t\t\n\t\t\t\t\tif ( $this->ipsclass->DB->get_num_rows() )\n\t\t\t\t\t{\n\t\t\t\t\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$old_data[ $v['name']['VALUE'] ][] = $r;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->ipsclass->DB->query( \"SHOW COLUMNS FROM \".SQL_PREFIX.$v['name']['VALUE'].\";\" );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $this->ipsclass->DB->get_num_rows() )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twhile ( $row = $this->ipsclass->DB->fetch_row() )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$new_fields[ $v['name']['VALUE'] ][] = $row['Field'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach ( $old_data[ $v['name']['VALUE'] ] as $kk => $vv )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$insert = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ( $vv as $field => $value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ( in_array( $field, $new_fields[ $v['name']['VALUE'] ] ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$insert[ $field ] = $this->ipsclass->txt_safeslashes( $value );\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\tif ( count( $insert ) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->ipsclass->DB->do_insert( $v['name']['VALUE'], $insert );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->ipsclass->DB->sql_drop_table( $v['name']['VALUE'].\"_bak\" );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['tables']} {$object} {$operation}....\" );\n\t}", "function MyMod_Handle_Files_Table($path,$table=array(),$prencells=0)\n {\n return\n array_merge\n (\n $this->MyMod_Handle_Files_Subdir_Rows($path),\n $this->MyMod_Handle_Files_Subdirs_Table($path,$prencells),\n $this->MyMod_Handle_Files_Path_Table($path,$prencells)\n );\n }", "public function run()\n {\n //\n DB::table('tcm_syndrome_alias_relations')->delete();\n\n for ($i=0; $i < 10; $i++) {\n for ($j = 0; $j < 10; $j++) {\n \\App\\TcmSyndromeAliasRelation::create([\n 'mtsar_id' => $i * 10 + $j + 1,\n 'mts_id' => $i + 1,\n 'mtsa_id' => $j + 1\n ]);\n }\n }\n }", "public function run()\n {\n $sizes= array(\n array('title' => 'table A',\"restaurant_profile_id\"=>1),\n array('title' => 'table B',\"restaurant_profile_id\"=>1),\n array('title' => 'table C',\"restaurant_profile_id\"=>1),\n array('title' => 'table D',\"restaurant_profile_id\"=>1),\n array('title' => 'table E',\"restaurant_profile_id\"=>1),\n );\n DB::table('tables')->delete();\n DB::table('tables')->insert($sizes);\n }", "private function build_path_child($p_arr, $p_root_obj, $p_tab)\n {\n global $g_dirs;\n\n $l_dao = new isys_cmdb_dao_status($this->database);\n $l_quicky = new isys_ajax_handler_quick_info();\n $l_table = '';\n\n foreach ($p_arr as $l_root_obj => $l_value) {\n $l_object = $l_dao->get_object_by_id($l_root_obj)\n ->get_row();\n $l_object_cmdb_status = $l_dao->get_cmdb_status_as_array($l_object[\"isys_obj__isys_cmdb_status__id\"]);\n $l_object_color = $l_object_cmdb_status[\"isys_cmdb_status__color\"];\n\n $l_table .= \"<table padding=\\\"0px\\\" cellspacing=\\\"0px\\\" style=\\\"position:relative;\\\">\";\n\n $l_table .= \"<tr>\";\n $l_table .= \"<td valign=\\\"top\\\" style=\\\"vertical-align:middle;border:2px solid #\" . $l_object_color . \";background-color:#fff;\\\">\";\n $l_quicky->set_style(\"line-height:20px;padding-left:5px;padding-right:5px;\");\n $l_table .= \" \" . $l_quicky->get_quick_info($l_root_obj, $l_dao->get_obj_name_by_id_as_string($l_root_obj), C__LINK__OBJECT) . \"<br>\";\n $l_table .= \"<span style=\\\"padding-left:5px;padding-right:5px;\\\">(\" . $this->language->get($l_dao->get_objtype_name_by_id_as_string($l_dao->get_objTypeID($l_root_obj))) . \")</span>\";\n $l_table .= \"</td>\";\n $p_tab++;\n\n if (!is_value_in_constants(\n $l_object[\"isys_obj__isys_cmdb_status__id\"],\n ['C__CMDB_STATUS__IN_OPERATION', 'C__CMDB_STATUS__IDOIT_STATUS', 'C__CMDB_STATUS__IDOIT_STATUS_TEMPLATE']\n )) {\n $this->m_inconsistent_arr[$l_object[\"isys_obj__id\"]] = $this->language->get($l_object_cmdb_status[\"isys_cmdb_status__title\"]);\n }\n\n if (is_array($l_value)) {\n $l_table .= \"<td style=\\\"\\\">\";\n $l_table .= $this->build_path_child($l_value, $p_root_obj, $p_tab);\n $l_table .= \"</td>\";\n }\n\n $l_table .= \"</tr>\";\n $l_table .= \"</table>\";\n }\n\n return $l_table;\n }", "private function populateDummyTable() {}", "public function populateJobTables() {\n\t\t$scrapeLog = $this->addLog(JOB_CATEGORY_TABLE);\n\t\t\n\t\t$jobCategories = $this->jobCategoryRepository->getFromXML(BASE_PATH . AD_PATH . SEARCH_LIST_PATH . JOB_CATEGORY_PATH);\n\t\tforeach($jobCategories as $jobCategory) {\n\t\t\t$this->jobCategoryRepository->add($jobCategory);\n\t\t\t\n\t\t\t$this->jobGroupRepository->populateJobTables(BASE_PATH . AD_PATH . SEARCH_LIST_PATH . JOB_GROUP_PATH . $jobCategory->getJobCategoryId(), $jobCategory->getJobCategoryId());\n\t\t}\n\t\t\n\t\t$this->updateLog($scrapeLog);\n\t}", "public function run() {\n DB::table($this->tableName)->delete();\n $jo_parents = array(\n array('name' => 'Cemara Kreatif'),\n array('name' => 'MIM')\n ); \n DB::table($this->tableName)->insert($jo_parents);\n }", "function MyMod_Handle_Files_Path_Table($path,$prencells)\n {\n $files=$this->DirFiles($path);\n sort($files);\n\n if (count($files)==0) { return; }\n\n $table=array();\n array_push\n (\n $table,\n $this->MyMod_Handle_File_Title_Row($path,$prencells)\n );\n\n $comps=preg_split('/\\//',$path);\n foreach ($files as $file)\n {\n array_push($table,$this->MyMod_Handle_File_Row($file,$prencells));\n }\n \n\n return $table;\n }", "private function cleanCoreTables() {\n\n $core_tables = [\n 'glpi_datacenters',\n 'glpi_dcrooms',\n 'glpi_items_racks',\n 'glpi_pdus',\n 'glpi_racks',\n 'glpi_rackmodels',\n 'glpi_racktypes',\n 'glpi_passivedcequipments',\n 'glpi_passivedcequipmenttypes',\n 'glpi_passivedcequipmentmodels',\n ];\n\n foreach ($core_tables as $table) {\n $result = $this->db->query('TRUNCATE ' . DB::quoteName($table));\n\n if (!$result) {\n throw new RuntimeException(\n sprintf('Unable to truncate table \"%s\"', $table)\n );\n }\n }\n }", "public function actionGeneratorall() {\n //$sql = \"select hoscode from chospital_amp where already = 1\";\n $sql = \"select hoscode from chospital_amp where already = 1\";\n $hosData = $this->query_all_db2($sql);\n\n //find cumulative table from mas_mapp_main table with comment value 2\n $sql = \"select * from mas_mapp_main\";\n $cuTable = $this->query_all_db2($sql);\n\n foreach ($cuTable as $cData) {\n $table = $cData['MAIN_TABLE'];\n $sql = \"truncate $table\";\n $this->exec_sql($sql, 2);\n }\n\n foreach ($hosData as $hData) {\n $db_name = 'jhcisdb_' . $hData['hoscode'];\n $db = 'db' . $hData['hoscode'];\n \n $sql = \"call create_f43_table()\";\n $this->exec_sql_db($sql, $db);\n \n foreach ($cuTable as $cData) {\n $table = $cData['MAIN_TABLE'];\n $DATE_START = $cData['DATESTART'];\n $DATE_END = $cData['DATEEND'];\n $mapp_sql = trim($cData['MAPP_QUERY']);\n\n if ($table == 'f43_dental') {\n $sql = \"call cal_table_dental_tmp('$table')\";\n $this->exec_sql_db($sql, $db);\n }else if($table == 'f43_appointment'){\n $sql = \"call cal_table_appointment_tmp('$table')\";\n $this->exec_sql_db($sql, $db);\n }else {\n //generate data from jhcis version to f43 version\n $sql = \"call cal_table_tmp_newver1(\\\"\" . $table . \"\\\",\\\"(\" . $mapp_sql . \")\\\",\\\"\" . $DATE_START . \"\\\",\\\"\" . $DATE_END . \"\\\")\";\n $this->exec_sql_db($sql, $db);\n }\n\n //insert f43 from jhcis database to 43f_generate database\n $sql = \"call replace_into_table('$db_name','$table')\";\n $this->exec_sql($sql, 2);\n\n //drop f43 table in jhcis database\n //$sql = \"call cal_table_tmp_drop('$table','$db_name')\";\n //$this->exec_sql($sql, 2);\n }\n }\n\n return 'All';\n }", "public function run()\n {\n $this->timeStart = microtime(true);\n echo \"Loading memory tables...\\n\";\n foreach ($this->tables as $table => $tableMemory) {\n if (!$this->compareTables($table, $tableMemory)) {\n if (!$this->memorize($table, $tableMemory)) {\n Yii::log(\"Something wrong.\", 'error', 'extensions.CodMtfs.Mtfs');\n }\n } else {\n Yii::log(\"Table {$tableMemory} exist and have same rows structure and count.\", 'error', 'extensions.CodMtfs.Mtfs');\n }\n }\n $timeEnd = microtime(true);\n $executionTime = ($timeEnd - $this->timeStart) / 60;\n echo \"Done in {$executionTime} Mins!...\\n\";\n }", "public function run()\n {\n foreach ($this->tables as $table) {\n $this->generatePermissions($table);\n }\n }", "public function run()\n {\n // reset the table, deleting all the data everytime the function is called\n // Footballer::trancate();\n\n Footballer::create([\n 'name' => 'Sadio Mane',\n 'position' => 'Winger',\n ]);\n Footballer::create([\n 'name' => 'Oxlade Chamberlain',\n 'position' => 'Midfielder',\n ]);\n Footballer::create([\n 'name' => 'Virgil Van Dijk',\n 'position' => 'Defender',\n ]);\n Footballer::create([\n 'name' => 'Allison Becker',\n 'position' => 'Goalkeeper',\n ]);\n }", "function ctools_export_load_object_reset($table = NULL) {\r\n // Reset plugin cache to make sure new include files are picked up.\r\n ctools_include('plugins');\r\n ctools_get_plugins_reset();\r\n if (empty($table)) {\r\n drupal_static_reset('ctools_export_load_object');\r\n drupal_static_reset('ctools_export_load_object_all');\r\n drupal_static_reset('_ctools_export_get_defaults');\r\n }\r\n else {\r\n $cache = &drupal_static('ctools_export_load_object');\r\n $cached_database = &drupal_static('ctools_export_load_object_all');\r\n $cached_defaults = &drupal_static('_ctools_export_get_defaults');\r\n unset($cache[$table]);\r\n unset($cached_database[$table]);\r\n unset($cached_defaults[$table]);\r\n }\r\n}", "private function _generateList()\t{\n\t\tglobal $TCA;\n\n\n\t\t$this->pidSelect = 'pid='.intval($this->id);\n\n\n\t\t$this->tablesInSysFolder = array();\n\t\t\t// Traverse the TCA table array:\n\t\tforeach ($TCA as $tableName => $value) {\n\n\t\t\t// Load full table definitions:\n\t\t\tt3lib_div::loadTCA($tableName);\n\n\t\t\t// for later ... Don't show table if hidden by TCA ctrl section\n\t\t\t// $hideTable = $GLOBALS['TCA'][$tableName]['ctrl']['hideTable'] ? TRUE : FALSE;\n\n\t\t\t/* Setting fields to select: */\n\t\t\t$fields = $this->_makeFieldList($value,$tableName);\n\n\t\t\t/* get user defined columns ... for each table listet in a SysFolder */\n\t\t\tif( isset($this->parentObject->settings['SysFolderContentListAdditionalColumns'][$tableName]) ){\n\n\t\t\t\t$sqlRaw = preg_replace('~[^a-z0-9_,]+~i','',$this->parentObject->settings['SysFolderContentListAdditionalColumns'][$tableName]);\n\t\t\t\t$sqlRawE = t3lib_div::trimExplode(',',$sqlRaw,1);\n\t\t\t\t$fields = array_merge($fields,$sqlRawE);\n\t\t\t}\n\n\t\t\t$orderBy = isset($value['ctrl']['sortby']) ? 'ORDER BY '.$value['ctrl']['sortby'] : ( isset($value['ctrl']['default_sortby']) ? $value['ctrl']['default_sortby'] : 'ORDER BY uid desc' );\n\n\t\t\t$queryParts = array(\n\t\t\t\t'SELECT' => implode(',',$fields),\n\t\t\t\t'FROM' => $tableName,\n\t\t\t\t'WHERE' => $this->pidSelect,\n\t\t\t\t'GROUPBY' => '',\n\t\t\t\t'ORDERBY' => $GLOBALS['TYPO3_DB']->stripOrderBy($orderBy),\n\t\t\t\t'LIMIT' => '0,10'\n\t\t\t);\n\n\t\t\t$result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);\n\t\t\t$dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);\n\n\t\t\t$accRows = false;\n\t\t\tif( $dbCount ){\n\t\t\t\t$this->tablesInSysFolder[$tableName] = array(\n\t\t\t\t\t'TotalItems'=>$this->_getTotalItems($queryParts),\n\t\t\t\t);\n\t\t\t\t$accRows = array();\t// Accumulate rows here\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t\t\t\t\t// In offline workspace, look for alternative record:\n\t\t\t\t\t// t3lib_BEfunc::workspaceOL($table, $row, $GLOBALS['BE_USER']->workspace, TRUE);\n\n\t\t\t\t\tif (is_array($row))\t{\n\t\t\t\t\t\t$accRows = true;\n\t\t\t\t\t\t$this->tablesInSysFolder[$tableName][] = $row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result);\n\t\t\t} /* endif $dbCount */\n\n\n\t\t}/* endforeach */\n\n\t}", "protected function setUpObjectRouteModel()\n {\n $container = $this->getContainer();\n\n $route = $container['model/factory']->get(ObjectRoute::class);\n if ($route->source()->tableExists() === false) {\n $route->source()->createTable();\n }\n }", "protected function _doGenerate()\n {\n if (null === $this->_opts->table) {\n $this->_getLogger()->info(\n 'No table option given, generating all tables'\n );\n\n $tables = array_keys($this->_schema);\n } else {\n $tables = $this->_opts->getAsArray('table');\n }\n\n foreach ($tables as $table) {\n $this->_getLogger()->info('Generating ' . $table . ' DAO');\n $this->_generateDao($table);\n }\n }", "private function createTables() {\n \n foreach($this->G->tableInfo as $table) {\n $this->tables[$table[\"title\"]] = new IdaTable($table[\"title\"]);\n } \n }", "public function initTable(){\n\t\t\t\n\t\t}", "public function updateTables()\n {\n $prefix = $this->getPrefix();\n $charset = $this->wpdb->get_charset_collate();\n\n foreach ($this->config['tables'] as $table => $createStatement) {\n $sql = str_replace(\n ['{prefix}', '{charset}'],\n [$prefix, $charset],\n $createStatement\n );\n dbDelta($sql);\n }\n }", "function set_table($args){\n\t//DEFAULTS\n\tif (! array_key_exists('table_data'\t\t, $args)) { $args['table_data'] = array();}\n\tif (! array_key_exists('name'\t\t\t, $args)) { return 'No name given'; exit;}\n\tif (! array_key_exists('hyrarchical'\t, $args)) { $args['hyrarchical'] = FALSE;}\n\t\n\t//VARIABLES\n\t$tablename = $GLOBALS['tableprefix'] . '_' . $args['name'];\n\t$create_parent_id = ($args['hyrarchical'] == TRUE ? 'parent_id INT Default \\'0\\',' : '');\n\t$create_children_ids = ($args['hyrarchical'] == TRUE ? 'children_ids INT,' : '');\n\t\n\t//Does table already exist?\n\t$sql = \"SELECT * FROM $tablename \";\n\t$exists = mysql_query($sql);\n\t\n\tif (! $exists ){\n\t\t//Create the table and its initial AI id / timestamp \n\t\t$sql = \"CREATE TABLE $tablename (\n\t\t\t\t\tid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\t\tcreation_date TIMESTAMP(8),\n\t\t\t\t\tpublish_date TIMESTAMP(8),\n\t\t\t\t\troworder INT\n\t\t\t\t)\";\n\t\tmysql_query($sql);\n\t\terror_log( \"<p class='log log_\" . (mysql_affected_rows() != -1 ? 'success' : 'failed') . \"'><date>[\" . date('d-m-Y G:i:s') . \"]</date>Table <strong>$tablename</strong> created.</p>\", 3, \"infos.log\");\n\t}\n\t\n\t//Hyrarchy change\n\t$sql = \"SELECT parent_id FROM $tablename\";\n\t$hyr = (mysql_query($sql) ? TRUE : FALSE);\n\tif ($hyr != $args['hyrarchical']){\n\t\tif ($args['hyrarchical']) {\n\t\t\t$sql = \"ALTER TABLE $tablename ADD parent_id INT Default '0'\";\n\t\t\tmysql_query($sql);\n\t\t\t\n\t\t\t$sql = \"ALTER TABLE $tablename ADD children_ids INT Default '0'\";\t\t\t\n\t\t\tmysql_query($sql);\n\t\t\t\n\t\t\terror_log( \" <p class='log log_\" . (mysql_affected_rows() != -1 ? 'success' : 'failed') . \"'><date>[\" . date('d-m-Y G:i:s') . \"]</date>Table <strong>$tablename</strong> has changed its hyrarchical state to <strong>TRUE</strong>.</p>\", 3, \"infos.log\");\n\t\t\t\n\t\t} else {\n\t\t\t$sql = \"ALTER TABLE $tablename DROP COLUMN parent_id\";\n\t\t\tmysql_query($sql);\n\t\t\n\t\t\t$sql = \"ALTER TABLE $tablename DROP COLUMN children_ids\";\n\t\t\tmysql_query($sql);\n\t\t\t\n\t\t\terror_log( \"<p class='log log_\" . (mysql_affected_rows() != -1 ? 'success' : 'failed') . \"'><date>[\" . date('d-m-Y G:i:s') . \"]</date> Table <strong>$tablename</strong> has changed its hyrarchical state to <strong>FALSE</strong>.</p>\", 3, \"infos.log\");\n\t\t}\n\t}\n\t\n\t\n//DEPRICATED/////////////////////////////////////////////////////////////\n\t//Do the columns\n\tif ($args['table_data']) {\n\t\tforeach ($args['table_data'] as $table_data) {\n\t\t\tswitch ($table_data['relation']) {\n\t\t\t\tcase 'self':\n\t\t\t\t\t$args2 = array(\n\t\t\t\t\t\t'table' => $args['name'],\n\t\t\t\t\t\t'relation' => $table_data['relation'],\n\t\t\t\t\t\t'self_name' => $table_data['self_name'],\n\t\t\t\t\t\t'self_definition' => $table_data['self_definition']\n\t\t\t\t\t);\n\t\t\t\t\tadd_table_data($args2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'm2m' || 's2m':\n\t\t\t\t\tif (! array_key_exists('hyrarchical', $table_data)) { $table_data['hyrarchical'] = FALSE;}\n\t\t\t\t\tif (! array_key_exists('table_data', $table_data)) { $table_data['table_data'] = array();}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$args2 = array(\n\t\t\t\t\t\t'table' => $args['name'],\n\t\t\t\t\t\t'relation' => $table_data['relation'],\n\t\t\t\t\t\t'target' => $table_data['target'],\n\t\t\t\t\t\t'hyrarchical' => $table_data['hyrarchical'],\n\t\t\t\t\t\t'table_data' => $table_data['table_data']\n\t\t\t\t\t);\n\t\t\t\t\tadd_table_data($args2);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t}\n\t\n\t\t}\n\t}\n//END DEPRICATED/////////////////////////////////////////////////////////////\n\t\n\t\n}", "function postCreateTable(){\n\t}", "function updateProjectObjects() {\n try {\n $project_objects_table = TABLE_PREFIX . 'project_objects';\n\n DB::execute(\"ALTER TABLE $project_objects_table ADD label_id SMALLINT UNSIGNED NULL DEFAULT NULL AFTER category_id\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD INDEX (label_id)\");\n DB::execute(\"ALTER TABLE $project_objects_table DROP has_time\");\n DB::execute(\"ALTER TABLE $project_objects_table DROP comments_count\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD varchar_field_3 VARCHAR(255) NULL DEFAULT NULL AFTER varchar_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD integer_field_3 INT(11) NULL DEFAULT NULL AFTER integer_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD float_field_3 FLOAT NULL DEFAULT NULL AFTER float_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD text_field_3 LONGTEXT NULL AFTER text_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD date_field_3 DATE NULL DEFAULT NULL AFTER date_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD datetime_field_3 DATETIME NULL DEFAULT NULL AFTER datetime_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD boolean_field_3 TINYINT(1) UNSIGNED NULL DEFAULT NULL AFTER boolean_field_2\");\n\n DB::execute('DROP TABLE ' . TABLE_PREFIX . 'project_object_views');\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "protected function load()\n\t{\n\t\t//---------------------\n\t\t// Your code goes here\n\t\t// --------------------\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t}", "private function buildTables ($tables, $action) {\n\n \n\n // Each different method has a slightly different table make up so we continue the build seperately\n if ($action == 'INSERT' || $action == 'DELETE') {\n\n // Before the table, as this is an INSERT or DELETE we need to add 'INTO' or 'FROM' into the SQL Statement\n $out = ($action == 'INSERT') ? ' INTO' : ' FROM';\n\n // We only have one table with an INSERT and that is a key in the array so we use array_keys \n // and set it to the variable $table.... \n $table = array_keys($tables);\n \n // ....then we simply use position [0] (the only key) as the table name\n $out .= ' `' . $table[0].'`';\n\n \n } // INSERT || DELETE\n\n\n if ($action == 'UPDATE') {\n\n // We only have one table with an INSERT and that is a key in the array so we use array_keys \n // and set it to the variable $table.... \n $table = array_keys($tables);\n \n // ....then we simply use position [0] (the only key) as the table name\n $out = ' `' . $table[0].'`';\n\n // Add ' SET' t the end of the string\n $out .= ' SET';\n\n \n } // UPDATE\n\n\n if ($action == 'SELECT') {\n\n $out = ' FROM';\n // Loop through all the tables in the array - $ket is the table name\n foreach ($tables as $key => $value) {\n\n // We use two variables the wrap the table name in if it is a joined table so clear them of any old data\n $joinType = '';\n $joinOn = '';\n\n \n /** Create the table joins\n *\n * If a join has been specified, create it along with the criteria\n *\n * $joinType\n * Prepends the join type (LEFT, RIGHT etc) to the word 'JOIN'\n *\n * $joinOn\n * Adds the parameters for the join\n *\n * Starts with 'ON ' and then adds the first table.column using \n * $key.'.'.$value['join']['local_key']\n *\n * It the adds ' = ' before adding the second table.column using\n * $value['join']['foreign_table'].'.'.$value['join']['foreign_key']\n *\n **/\n\n // Prepend the join type (LEFT, RIGHT etc) to the word 'JOIN'\n\n $this->alias = (isset($value['alias'])) ? $value['alias'] . ' ' : '';\n $this->join_name = ($this->alias) ? $this->alias: $key;\n\n if(isset($value['join'])) {\n $joinType = $value['join']['join_type'] . ' JOIN';\n $joinOn = 'ON `' . $this->join_name.'`.`'.$value['join']['local_key'] . '` = `' . $value['join']['foreign_table'].'`.`'.$value['join']['foreign_key'] .'`';\n } // if join \n\n // Wrap the table name ($key) with the join parts. The join parts will be empty strings if no join was set\n $out .= $joinType.' `' . $key . '` ' .$this->alias.$joinOn;\n\n } // foreach\n\n } // SELECT\n\n\n\n // Return the tables part of the SQL statement\n return $out;\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n PropertyName::truncate();\n $this->command->info('[property_names] table truncated...');\n\n $this->seed();\n\n $this->command->info('[property_names] table seeded...');\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "private function rebuildLevel()\n\t{\n\t\techo \"Rebuilding \" . $this->OutputPath . PHP_EOL;\n\n\t\t$InstanceFiles = $this->orderInstances();\n\t\t$this->WriteFile = fopen( $this->OutputPath, \"w\" );\n\t\tfwrite( $this->WriteFile, $this->getHeader( sizeof( $InstanceFiles ) ) );\n\n\t\tforeach( $InstanceFiles as $InstanceFile )\n\t\t{\n\t\t\t$this->Instance = json_decode( file_get_contents( $InstanceFile ) );\n\n\t\t\tif( ! $this->Instance || empty( $this->Instance ) )\n\t\t\t{\n\t\t\t\tvar_dump( $InstanceFile );\n\t\t\t\tdie( 'failed to decode json!' );\n\t\t\t}\n\t\t\t$this->processInstance();\n\t\t}\n\n\t\tfclose( $this->WriteFile );\n\t}", "public function FillTable(){\n\n $helpers = Helper::all();\n\n foreach ($helpers as $key=>$helper){\n\n $helper->update(['id'=>$key+1]);\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Property::truncate();\n $this->command->info('[properties] table truncated...');\n\n $this->seed();\n\n $this->command->info('[properties] table seeded...');\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "function rebuildAll(){\n\t\t\t$this -> rebuild($_SERVER['DOCUMENT_ROOT'].\"/\".$this -> rootFolder);\t\n\t\t}", "protected function getCleanableTableList() {}", "public static function createObjects($path = [], $params = [])\n\t{\n\t\tif ($params['clearDb']) {\n\t\t\tself::_dropTables();\n\t\t}\n\n\t\tforeach($path as $root) {\n\t\t\tself::_createObjects($root, $params);\n\t\t}\n\t}", "static private function create_tables(){\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n self::create_views_table();\n }", "private static function refreshNestings(): void\n {\n if ($ids = array_keys (self::$instancesById)) {\n $rows = Application::getInstance()->getVxPDO()->doPreparedQuery(\n sprintf(\"SELECT foldersid, l, r, level FROM folders WHERE foldersid IN (%s)\", implode(',', array_fill(0, count($ids), '?'))),\n $ids\n );\n\n foreach($rows as $row) {\n $instance = self::$instancesById[$row['foldersid']];\n $instance->level = $instance->data['level'] = $row['level'];\n $instance->r = $instance->data['r'] = $row['r'];\n $instance->l = $instance->data['l'] = $row['l'];\n }\n }\n\t}", "public function run()\n {\n $projects = Project::all()->pluck('id');\n\n $projects->each(function ($project) {\n $index = 0;\n\n factory(Column::class, 3)->make()->each(function ($column) use ($project, &$index) {\n $column->project_id = $project;\n $column->index = $index;\n $column->save();\n $index++;\n });\n });\n }", "public function run()\n {\n \\DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n MasterDocument::truncate();\n \\DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n MasterDocument::create([ 'name' => 'MASTER B/L', 'display_name' => 'MB/L']);\n MasterDocument::create([ 'name' => 'HOUSE B/L', 'display_name' => 'HB/L']);\n MasterDocument::create([ 'name' => 'PART OF B/L', 'display_name' => 'PART OFF']);\n MasterDocument::create([ 'name' => 'PEB', 'display_name' => 'PEB']);\n MasterDocument::create([ 'name' => 'SPLIT B/L', 'display_name' => 'SPLIT']);\n MasterDocument::create([ 'name' => 'DELIVERY ORDER', 'display_name' => 'DO']);\n MasterDocument::create([ 'name' => 'CONTAINER AND SEAL', 'display_name' => 'CONTAINER']);\n }", "public function __invoke(): LoadsTables;", "public function run() {\n\t\t$toolbox = R::$toolbox;\n\t\t$adapter = $toolbox->getDatabaseAdapter();\n\t\t$writer = $toolbox->getWriter();\n\t\t$redbean = $toolbox->getRedBean();\n\t\t$pdo = $adapter->getDatabase();\n\t\t$a = new RedBean_AssociationManager( $toolbox );\n\t\t$adapter->exec(\"DROP TABLE IF EXISTS testtable\");\n\t\tasrt(in_array(\"testtable\",$adapter->getCol(\"show tables\")),false);\n\t\t$writer->createTable(\"testtable\");\n\t\tasrt(in_array(\"testtable\",$adapter->getCol(\"show tables\")),true);\n\t\tasrt(count(array_diff($writer->getTables(),$adapter->getCol(\"show tables\"))),0);\n\t\tasrt(count(array_keys($writer->getColumns(\"testtable\"))),1);\n\t\tasrt(in_array(\"id\",array_keys($writer->getColumns(\"testtable\"))),true);\n\t\tasrt(in_array(\"c1\",array_keys($writer->getColumns(\"testtable\"))),false);\n\t\t$writer->addColumn(\"testtable\", \"c1\", 1);\n\t\tasrt(count(array_keys($writer->getColumns(\"testtable\"))),2);\n\t\tasrt(in_array(\"c1\",array_keys($writer->getColumns(\"testtable\"))),true);\n\t\tforeach($writer->sqltype_typeno as $key=>$type) {\n\t\t\tif ($type < 100) {\n\t\t\t\tasrt($writer->code($key),$type);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tasrt($writer->code($key),99);\n\t\t\t}\n\t\t}\n\t\tasrt($writer->code(\"unknown\"),99);\n\t\tasrt($writer->scanType(false),0);\n\t\tasrt($writer->scanType(NULL),0);\n\t\tasrt($writer->scanType(2),1);\n\t\tasrt($writer->scanType(255),1);\n\t\tasrt($writer->scanType(256),2);\n\t\tasrt($writer->scanType(-1),3);\n\t\tasrt($writer->scanType(1.5),3);\n\t\tasrt($writer->scanType(INF),4);\n\t\tasrt($writer->scanType(\"abc\"),4);\n\t\tasrt($writer->scanType(\"2001-10-10\",true),RedBean_QueryWriter_MySQL::C_DATATYPE_SPECIAL_DATE);\n\t\tasrt($writer->scanType(\"2001-10-10 10:00:00\",true),RedBean_QueryWriter_MySQL::C_DATATYPE_SPECIAL_DATETIME);\n\t\tasrt($writer->scanType(\"2001-10-10\"),4);\n\t\tasrt($writer->scanType(\"2001-10-10 10:00:00\"),4);\n\t\tasrt($writer->scanType(\"POINT(1 2)\",true),RedBean_QueryWriter_MySQL::C_DATATYPE_SPECIAL_POINT);\n\t\tasrt($writer->scanType(\"POINT(1 2)\"),4);\n\t\tasrt($writer->scanType(str_repeat(\"lorem ipsum\",100)),5);\n\t\t$writer->widenColumn(\"testtable\", \"c1\", 2);\n\t\t$cols=$writer->getColumns(\"testtable\");\n\t\tasrt($writer->code($cols[\"c1\"]),2);\n\t\t$writer->widenColumn(\"testtable\", \"c1\", 3);\n\t\t$cols=$writer->getColumns(\"testtable\");\n\t\tasrt($writer->code($cols[\"c1\"]),3);\n\t\t$writer->widenColumn(\"testtable\", \"c1\", 4);\n\t\t$cols=$writer->getColumns(\"testtable\");\n\t\tasrt($writer->code($cols[\"c1\"]),4);\n\t\t$writer->widenColumn(\"testtable\", \"c1\", 5);\n\t\t$cols=$writer->getColumns(\"testtable\");\n\t\tasrt($writer->code($cols[\"c1\"]),5);\n\t\t$id = $writer->updateRecord(\"testtable\", array(array(\"property\"=>\"c1\",\"value\"=>\"lorem ipsum\")));\n\t\t$row = $writer->selectRecord(\"testtable\", array(\"id\"=>array($id)));\n\t\tasrt($row[0][\"c1\"],\"lorem ipsum\");\n\t\t$writer->updateRecord(\"testtable\", array(array(\"property\"=>\"c1\",\"value\"=>\"ipsum lorem\")), $id);\n\t\t$row = $writer->selectRecord(\"testtable\", array(\"id\"=>array($id)));\n\t\tasrt($row[0][\"c1\"],\"ipsum lorem\");\n\t\t$writer->selectRecord(\"testtable\", array(\"id\"=>array($id)),null,true);\n\t\t$row = $writer->selectRecord(\"testtable\", array(\"id\"=>array($id)));\n\t\tasrt(empty($row),true);\n\t\t//$pdo->setDebugMode(1);\n\t\t$writer->addColumn(\"testtable\", \"c2\", 2);\n\t\ttry {\n\t\t\t$writer->addUniqueIndex(\"testtable\", array(\"c1\",\"c2\"));\n\t\t\tfail(); //should fail, no content length blob\n\t\t}catch(RedBean_Exception_SQL $e) {\n\t\t\tpass();\n\t\t}\n\t\t$writer->addColumn(\"testtable\", \"c3\", 2);\n\t\ttry {\n\t\t\t$writer->addUniqueIndex(\"testtable\", array(\"c2\",\"c3\"));\n\t\t\tpass(); //should fail, no content length blob\n\t\t}catch(RedBean_Exception_SQL $e) {\n\t\t\tfail();\n\t\t}\n\t\t$a = $adapter->get(\"show index from testtable\");\n\t\tasrt(count($a),3);\n\t\tasrt($a[1][\"Key_name\"],\"UQ_64b283449b9c396053fe1724b4c685a80fd1a54d\");\n\t\tasrt($a[2][\"Key_name\"],\"UQ_64b283449b9c396053fe1724b4c685a80fd1a54d\");\n\t\t//Zero issue (false should be stored as 0 not as '')\n\t\ttestpack(\"Zero issue\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS `zero`\");\n\t\t$bean = $redbean->dispense(\"zero\");\n\t\t$bean->zero = false;\n\t\t$bean->title = \"bla\";\n\t\t$redbean->store($bean);\n\t\tasrt( count($redbean->find(\"zero\",array(),\" zero = 0 \")), 1 );\n\t\tR::store(R::dispense('hack'));\n\t\ttestpack(\"Test RedBean Security - bean interface \");\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\t$bean = $redbean->load(\"page\",\"13; drop table hack\");\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\ttry {\n\t\t\t$bean = $redbean->load(\"page where 1; drop table hack\",1);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\t$bean = $redbean->dispense(\"page\");\n\t\t$evil = \"; drop table hack\";\n\t\t$bean->id = $evil;\n\t\ttry {\n\t\t\t$redbean->store($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\tunset($bean->id);\n\t\t$bean->name = \"\\\"\".$evil;\n\t\ttry {\n\t\t\t$redbean->store($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\t$bean->name = \"'\".$evil;\n\t\ttry {\n\t\t\t$redbean->store($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\t$bean->$evil = 1;\n\t\ttry {\n\t\t\t$redbean->store($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\tunset($bean->$evil);\n\t\t$bean->id = 1;\n\t\t$bean->name = \"\\\"\".$evil;\n\t\ttry {\n\t\t\t$redbean->store($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\t$bean->name = \"'\".$evil;\n\t\ttry {\n\t\t\t$redbean->store($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\t$bean->$evil = 1;\n\t\ttry {\n\t\t\t$redbean->store($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\ttry {\n\t\t\t$redbean->trash($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\ttry {\n\t\t\t$redbean->find(\"::\",array(),\"\");\n\t\t}catch(Exception $e) {\n\t\t\tpass();\n\t\t}\n\t\t$adapter->exec(\"drop table if exists sometable\");\n\t\ttestpack(\"Test RedBean Security - query writer\");\n\t\ttry {\n\t\t\t$writer->createTable(\"sometable` ( `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT , PRIMARY KEY ( `id` ) ) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ; drop table hack; --\");\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\t\t\t\n\t\ttestpack(\"Test ANSI92 issue in clearrelations\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS book_group\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS author_book\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS book\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS author\");\n\t\t$redbean = $toolbox->getRedBean();\n\t\t$a = new RedBean_AssociationManager( $toolbox );\n\t\t$book = $redbean->dispense(\"book\");\n\t\t$author1 = $redbean->dispense(\"author\");\n\t\t$author2 = $redbean->dispense(\"author\");\n\t\t$book->title = \"My First Post\";\n\t\t$author1->name=\"Derek\";\n\t\t$author2->name=\"Whoever\";\n\t\tset1toNAssoc($a,$book,$author1);\n\t\tset1toNAssoc($a,$book, $author2);\n\t\tpass();\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS book_group\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS book_author\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS author_book\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS book\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS author\");\n\t\t$redbean = $toolbox->getRedBean();\n\t\t$a = new RedBean_AssociationManager( $toolbox );\n\t\t$book = $redbean->dispense(\"book\");\n\t\t$author1 = $redbean->dispense(\"author\");\n\t\t$author2 = $redbean->dispense(\"author\");\n\t\t$book->title = \"My First Post\";\n\t\t$author1->name=\"Derek\";\n\t\t$author2->name=\"Whoever\";\n\t\t$a->associate($book,$author1);\n\t\t$a->associate($book, $author2);\n\t\tpass();\n\t\ttestpack(\"Test Association Issue Group keyword (Issues 9 and 10)\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS `book_group`\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS `group`\");\n\t\t$group = $redbean->dispense(\"group\");\n\t\t$group->name =\"mygroup\";\n\t\t$redbean->store( $group );\n\t\ttry {\n\t\t\t$a->associate($group,$book);\n\t\t\tpass();\n\t\t}catch(RedBean_Exception_SQL $e) {\n\t\t\tfail();\n\t\t}\n\t\t//test issue SQL error 23000\n\t\ttry {\n\t\t\t$a->associate($group,$book);\n\t\t\tpass();\n\t\t}catch(RedBean_Exception_SQL $e) {\n\t\t\tfail();\n\t\t}\n\t\tasrt((int)$adapter->getCell(\"select count(*) from book_group\"),1); //just 1 rec!\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS book_group\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS author_book\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS book\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS author\");\n\t\t$redbean = $toolbox->getRedBean();\n\t\t$a = new RedBean_AssociationManager( $toolbox );\n\t\t$book = $redbean->dispense(\"book\");\n\t\t$author1 = $redbean->dispense(\"author\");\n\t\t$author2 = $redbean->dispense(\"author\");\n\t\t$book->title = \"My First Post\";\n\t\t$author1->name=\"Derek\";\n\t\t$author2->name=\"Whoever\";\n\t\t$a->unassociate($book,$author1);\n\t\t$a->unassociate($book, $author2);\n\t\tpass();\n\t\t$redbean->trash($redbean->dispense(\"bla\"));\n\t\tpass();\n\t\t$bean = $redbean->dispense(\"bla\");\n\t\t$bean->name = 1;\n\t\t$bean->id = 2;\n\t\t$redbean->trash($bean);\n\t\tpass();\n\t\t\n\t\ttestpack('Special data types');\n\t\tR::nuke();\n\t\t$bean = R::dispense('bean');\n\t\t$bean->date = 'someday';\n\t\tR::store($bean);\n\t\t$cols = R::getColumns('bean');\n\t\tasrt($cols['date'],'varchar(255)');\n\t\t$bean = R::dispense('bean');\n\t\t$bean->date = '2011-10-10';\n\t\tR::store($bean);\n\t\t$cols = R::getColumns('bean');\n\t\tasrt($cols['date'],'varchar(255)');\n\t\t\n\t\tR::nuke();\n\t\t$bean = R::dispense('bean');\n\t\t$bean->date = '2011-10-10';\n\t\tR::store($bean);\n\t\t$cols = R::getColumns('bean');\n\t\tasrt($cols['date'],'date');\n\t\t\n\t\tR::nuke();\n\t\t$bean = R::dispense('bean');\n\t\t$bean->date = '2011-10-10 10:00:00';\n\t\tR::store($bean);\n\t\t$cols = R::getColumns('bean');\n\t\tasrt($cols['date'],'datetime');\n\t\t$bean = R::dispense('bean');\n\t\t$bean->date = 'soon';\n\t\tR::store($bean);\n\t\t$cols = R::getColumns('bean');\n\t\tasrt($cols['date'],'datetime');\n\t\t$this->setGetSpatial('POINT(1 2)');\n\t\t$this->setGetSpatial('LINESTRING(3 3,4 4)');\n\t\t$this->setGetSpatial('POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7,5 5))');\n\t\t$this->setGetSpatial('MULTIPOINT(0 0,20 20,60 60)');\n\t}", "public function reloadFromConfig($config)\n {\n $this->schema = $config;\n if (!isset($this->schema['create'])) {\n $this->schema['create'] = array();\n }\n if (!isset($this->schema['update'])) {\n $this->schema['update'] = array();\n }\n if (!isset($this->schema['seed'])) {\n $this->schema['seed'] = array();\n }\n $this->tables = array();\n foreach ($this->schema['create'] as $name => $fields) {\n $table = $this->makeTable($name);\n $columns = array_keys($fields);\n foreach ($columns as $name) {\n $table->addColumn(new Property($name));\n }\n $this->addTable($table);\n }\n }", "public function install() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->createTable();\r\n\t}\r\n }", "function init_tables(){\n $db = new PDO('sqlite:history.pyramid.sqlite');\n $db->exec(\"PRAGMA foreign_keys = ON\");\n $db->exec(\"drop table if exists areas\");\n $db->exec(\"drop table if exists codigos\");\n $db->exec(\"drop table if exists outs\");\n $db->exec(\"CREATE TABLE Areas (\n Id INTEGER PRIMARY KEY,\n out_date DATETIME DEFAULT CURRENT_TIMESTAMP,\n name TEXT,\n target INTEGER);\");\n $db->exec(\"CREATE TABLE codigos (\n Id INTEGER PRIMARY KEY,\n out_date DATETIME DEFAULT CURRENT_TIMESTAMP,\n name TEXT,\n target INTEGER);\");\n $db->exec(\"CREATE TABLE outs (\n Id INTEGER PRIMARY KEY,\n out_date DATETIME DEFAULT CURRENT_TIMESTAMP,\n name TEXT,\n target INTEGER);\");\n}", "public function run()\n\t{\n\t\tChildren::truncate();\n\n\t\tChildren::create(['name'=>'Inga']);\n\t\tChildren::create(['name'=>'Heltid']);\n\t\tChildren::create(['name'=>'Delad vårdnad']);\n\t\tChildren::create(['name'=>'Inga vill inte ha']);\n\t\tChildren::create(['name'=>'Inga men vill ha']);\n\t}", "public function main($table)\n {\n $table = $this->loadModel($table);\n $schema = $table->getSchema();\n $mapping = [\n '@timestamp' => ['type' => 'date', 'format' => 'basic_t_time_no_millis||dateOptionalTime||basic_date_time||ordinal_date_time_no_millis||yyyy-MM-dd HH:mm:ss'],\n 'transaction' => ['type' => 'text', 'index' => false],\n 'type' => ['type' => 'text', 'index' => false],\n 'primary_key' => ['type' => 'text', 'index' => false],\n 'source' => ['type' => 'text', 'index' => false],\n 'parent_source' => ['type' => 'text', 'index' => false],\n 'original' => [\n 'properties' => []\n ],\n 'changed' => [\n 'properties' => []\n ],\n 'meta' => [\n 'properties' => [\n 'ip' => ['type' => 'text', 'index' => false],\n 'url' => ['type' => 'text', 'index' => false],\n 'user' => ['type' => 'text', 'index' => false],\n 'app_name' => ['type' => 'text', 'index' => false]\n ]\n ]\n ];\n\n $properties = [];\n foreach ($schema->columns() as $column) {\n $properties[$column] = $this->mapType($schema, $column);\n }\n\n $indexName = $table->getTable();\n $typeName = Inflector::singularize(str_replace('%s', '', $indexName));\n\n if ($table->hasBehavior('AuditLog')) {\n $whitelist = (array)$table->behaviors()->AuditLog->config('whitelist');\n $blacklist = (array)$table->behaviors()->AuditLog->config('blacklist');\n $properties = empty($whitelist) ? $properties : array_intersect_key($properties, array_flip($whitelist));\n $properties = array_diff_key($properties, array_flip($blacklist));\n $indexName = $table->behaviors()->AuditLog->config('index') ?: $indexName;\n $typeName = $table->behaviors()->AuditLog->config('type') ?: $typeName;\n }\n\n $mapping['original']['properties'] = $mapping['changed']['properties'] = $properties;\n $client = ConnectionManager::get('auditlog_elastic');\n $index = $client->getIndex(sprintf($indexName, '-' . gmdate('Y.m.d')));\n $type = $index->getType($typeName);\n $elasticMapping = new ElasticaMapping();\n $elasticMapping->setType($type);\n $elasticMapping->setProperties($mapping);\n\n if ($this->params['dry-run']) {\n $this->out(json_encode($elasticMapping->toArray(), JSON_PRETTY_PRINT));\n return true;\n }\n\n if ($this->params['use-templates']) {\n $template = [\n 'template' => sprintf($indexName, '*'),\n 'mappings' => $elasticMapping->toArray()\n ];\n $response = $client->request('_template/template_' . $type->getName(), Request::PUT, $template);\n $this->out('<success>Successfully created the mapping template</success>');\n return $response->isOk();\n }\n\n if (!$index->exists()) {\n $index->create();\n }\n\n $elasticMapping->send();\n $this->out('<success>Successfully created the mapping</success>');\n return true;\n }", "public function run()\n {\n $data = [\n ['name' => 'Kids'],\n ['name' => 'Husband'],\n ['name' => 'Sister'],\n ];\n\n \\App\\Models\\Relation::truncate();\n\n foreach ($data as $value) {\n \\App\\Models\\Relation::create($value);\n }\n }", "function createTables()\n {\n $sqls = $this->simplexmlObject->xpath(\"//table\");\n foreach($sqls as $sql) {\n try {\n $db = $this->getConnection();\n $db->exec($sql);\n $tablename = $sql->getName();\n print(\"Created $tablename table.\\n\");\n $this->closeConnection($db, $sql);\n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n }\n \n }", "public function reindexAll()\n {\n\n //@todo: indexers should be dynamically injected. Probable via `$this->getIndeces()`\n /** @var St_SphinxSearch_Model_Fulltext $fulltextIndex */\n $fulltextIndex = Mage::getModel('st_sphinxsearch/fulltext');\n\n $fulltextIndex->rebuildIndex();\n\n return;\n /** @var Mage_Core_Model_Resource $resourceSingleton */\n $resourceSingleton = Mage::getSingleton('core/resource');\n\n /** @var Varien_Db_Adapter_Interface $writeAdapater */\n $writeAdapater = $resourceSingleton->getConnection('core_write');\n\n /** @var Varien_Db_Adapter_Interface $readAdapter */\n $readAdapter = $resourceSingleton->getConnection('core_read');\n\n /** @var string $tableName */\n $tableName = $readAdapter->getTableName('st_sphinxsearch_fulltext_tmp');\n\n /** @var Mage_CatalogSearch_Model_Resource_Indexer_Fulltext $indexerFulltext */\n $indexerFulltext = Mage::getResourceModel('catalogsearch/indexer_fulltext');\n\n $fulltextTableName = $indexerFulltext->getTable('fulltext');\n\n $sql = \"CREATE TABLE IF NOT EXISTS `$tableName` LIKE `$fulltextTableName`\";\n\n $writeAdapater->query($sql);\n $t=1;\n }", "protected function tableclass(){\n\n\t\tforeach($this->mapChild($this) as $key => $table ){\n\n\t\t\t$myadrs = $this->address;\n\n\t\t\tif(!in_array($table,$myadrs)){\n\n\t\t\t\tarray_push($myadrs,$table);\n\n\t\t\t\teval('$this->'.$table.' = new $this::$tclass($myadrs);');\n\n\t\t\t}\n\n\t\t\t//print($key . ':' .$table. p);\n\n\t\t}\n\n\t}", "public function run()\n {\n $file = __DIR__.'/data/'.Str::snake(config('biologer.territory')).'_taxa.sql';\n\n if (Taxon::count() === 0 && File::exists($file)) {\n $taxa = File::get($file);\n\n if (empty($taxa)) {\n return;\n }\n\n DB::unprepared($taxa);\n\n Taxon::rebuildAncestry();\n }\n }", "private function prepare_table()\n {\n global $g_dirs;\n\n $l_dao = new isys_cmdb_dao($this->database);\n $l_quicky = new isys_ajax_handler_quick_info();\n\n $l_table = \"<table width=\\\"100%\\\" class=\\\"report_listing\\\">\";\n\n foreach ($this->m_its_arr as $l_obj_id => $l_title) {\n unset($this->m_obj_arr);\n $l_table .= \"<tr style=\\\"\\\"><td onclick=\\\"collapse_it_service('\" . $l_obj_id . \"')\\\" id=\\\"\" . $l_obj_id . \"\\\" class=\\\"report_listing\\\"><img id=\\\"\" . $l_obj_id .\n \"_plusminus\\\" src=\\\"\" . $g_dirs[\"images\"] . \"dtree/nolines_plus.gif\\\" class=\\\"vam\\\">\";\n\n $l_table .= $l_quicky->get_quick_info($l_obj_id, $l_dao->get_obj_name_by_id_as_string($l_obj_id), C__LINK__OBJECT);\n\n $l_table .= \"<img src=\\\"\" . $g_dirs[\"images\"] . \"ajax-loading.gif\\\" id=\\\"ajax_loading_view_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\" class=\\\"vam\\\" /></td></tr>\";\n\n $l_table .= \"<tr id=\\\"childs_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\"><td><div id=\\\"childs_content_\" . $l_obj_id . \"\\\"></div>\";\n $l_table .= \"</td></tr>\";\n }\n\n $l_table .= \"</table>\";\n\n return $l_table;\n }", "public function run()\n {\n DB::table('object_fuels')->insert(['fuel' => 'Gasolina', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);\n DB::table('object_fuels')->insert(['fuel' => 'Etanol', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);\n DB::table('object_fuels')->insert(['fuel' => 'Óleo Diesel', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);\n DB::table('object_fuels')->insert(['fuel' => 'Gás Natural', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);\n DB::table('object_fuels')->insert(['fuel' => 'Etanol / Gasolina', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);\n }", "abstract protected function _listTables();", "private function __createIndex() {\n $lock_file = $this->getTmpPath('lock.dat');\n\n if (file_exists($lock_file)) return false;\n file_put_contents($lock_file, '');\n\n\n\t\tif (function_exists('ignore_user_abort'))\n\t\t\tignore_user_abort();\n\t\tif (function_exists('set_time_limit'))\n\t\t\tset_time_limit(180);\n\n\n\t\t$this->Model->truncateTable();\n\t\tforeach ($this->tables as $table) {\n\t\t\t$className = $this->Register['ModManager']->getModelNameFromModule($table);\n\t\t\t$Model = new $className;\n\t\t\t\n\t\t\tfor ($i = 1; $i < 10000; $i++) {\n\t\t\t\t$records = $Model->getCollection(array(), array('limit' => 100, 'page' => $i));\n\t\t\t\tif (empty($records)) break;\n\n\n\t\t\t\tif (count($records) && is_array($records)) {\n\t\t\t\t\tforeach ($records as $rec) {\n\n\t\t\t\t\t\tswitch ($table) {\n\t\t\t\t\t\t\tcase 'news':\n\t\t\t\t\t\t\tcase 'stat':\n\t\t\t\t\t\t\tcase 'loads':\n\t\t\t\t\t\t\t\t$text = $rec->getTitle() . ' ' . $rec->getMain() . ' ' . $rec->getTags();\n\t\t\t\t\t\t\t\tif (mb_strlen($text) < $this->minInputStr || !is_string($text))\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t$entity_view = '/view/';\n\t\t\t\t\t\t\t\t$module = $table;\n\t\t\t\t\t\t\t\t$entity_id = $rec->getId();\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'posts':\n\t\t\t\t\t\t\t\t$text = $rec->getMessage();\n\t\t\t\t\t\t\t\t$entity_view = '/view_theme/';\n\t\t\t\t\t\t\t\t$module = 'forum';\n\t\t\t\t\t\t\t\t$entity_id = $rec->getId_theme();\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'themes':\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$text = $rec->gettitle() . ' ' . $rec->getMain() . ' ' . $rec->getTags();\n\t\t\t\t\t\t\t\tif (mb_strlen($text) < $this->minInputStr || !is_string($text))\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t$entity_view = '/view/';\n\t\t\t\t\t\t\t\t$module = $table;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t//we must update record if an exists\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t'index' => $text,\n\t\t\t\t\t\t\t'entity_id' => $entity_id,\n\t\t\t\t\t\t\t'entity_title' => $rec->getTitle(),\n\t\t\t\t\t\t\t'entity_table' => $table,\n\t\t\t\t\t\t\t'entity_view' => $entity_view,\n\t\t\t\t\t\t\t'module' => $module,\n\t\t\t\t\t\t\t'date' => new Expr('NOW()'),\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$entity = new SearchEntity($data);\n\t\t\t\t\t\t$entity->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n unlink($lock_file);\n\t}", "public function run()\n {\n app('db.connection')->table('nested_entities')->truncate();\n app('db.connection')->table('nested_entities')->insert([\n 'name' => 'Root',\n 'left_range' => 1,\n 'right_range' => 2,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ]);\n }", "private function updateBaseTable()\n {\n foreach ($this->mergeCollection as $key => $item)\n {\n $query = DB::table($this->baseTable);\n\n foreach ($this->associativePivots as $basePivot => $mergePivot)\n {\n $query = $query->whereIn($basePivot,[$item->$mergePivot]);\n }\n\n if(!in_array($this->primaryKey,$this->associativeColumns) && !in_array($this->primaryKey,$this->associativePivots))\n unset($item->id);\n\n if(!empty($this->associativeColumns)) {\n\n $newItem = new \\stdClass();\n\n foreach ($this->associativeColumns as $baseColumn => $mergeColumn) {\n $newItem->$baseColumn = $item->$mergeColumn;\n }\n\n $item = $newItem;\n }\n\n\n $this->rowUpdatedByMatched += $query->update(get_object_vars($item));\n }\n\n }", "public static function getModifyableTables() {}", "public function run() {\n\n // SETUP ENVIRONMENT\n if (!$this->schemaTableExists()) {\n self::errln(\"Schema table does not exist...creating\");\n $this->runFile('00000_schema.sql');\n }\n\n // TEMPORARY TABLE PRIVILEGE?\n if (!$this->root_connection_setup) {\n if (!$this->hasCreateTemporaryTablePrivilege()) {\n self::errln(sprintf(\"\nUser `%s` has no 'CREATE TEMPORARY TABLE' privilege. It is\nstrongly recommended that privilege is granted.\n\",\n Conf::$SQL_USER));\n $this->setupRootDbConnection();\n }\n }\n\n $this->createTemporaryTable();\n\n $PROTO = new TSSchema();\n $TEMPP = new TSNewSchema();\n\n // FILL TEMPORARY TABLE\n $vat = new BatchedDirListing($this->getUpDir());\n $vat->filterByRegexp('/^[0-9]{5}_.+\\.sql$/');\n\n while (($batch = $vat->nextBatch()) !== false) {\n $objs = array();\n foreach ($batch as $name) {\n $obj = new TSNewSchema();\n $obj->id = $name;\n $objs[] = $obj;\n }\n DB::insertAll($objs);\n }\n\n // DOWNGRADE FIRST\n $res = DB::getAll(\n $PROTO,\n new DBCondIn('id', DB::prepGetAll($TEMPP, null, array('id')), DBCondIn::NOT_IN)\n );\n foreach ($res as $version) {\n $this->runDowngrade($version);\n }\n\n // UPGRADE NEXT\n $res = DB::getAll(\n $TEMPP,\n new DBCondIn('id', DB::prepGetAll($PROTO, null, array('id')), DBCondIn::NOT_IN)\n );\n foreach ($res as $version) {\n $this->runFile($version->id);\n }\n }", "private function createDummyTable() {}", "abstract protected function reloadFiletree(DataContainerInterface $objDc);", "function GenXMLTabEntries($IdxFile, &$iCntTables, &$iCntViews)\n {\n \t$str=\"\";\n \t$iStep=0;\n \t$iCntTables=0;\n \t$iCntViews=0;\n \t$Table=\"\";\n \t$Owner=\"\";\n \n $TableSpace=\"\";\n $OwnerSpace=\"\";\n $DateSpace=-1;\n $IndexSpace=-1;\n $IndexPart =\"\";\n $DatePart =\"\";\n \n $handle = fopen($IdxFile, \"r\");\n while (!feof($handle))\n {\n $buffer = fgets($handle, 4096);\n if( strlen(trim($buffer)) <= 0) continue;\n\n $chars = preg_split('/ /', $buffer, -1, PREG_SPLIT_NO_EMPTY);\n\n for($i=0;$i<count($chars);$i++) //Subtract unwanted white spaces\n $chars[$i] = trim($chars[$i]);\n\n // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Start of a SRC_REP_TAB INFO\n if($chars[0] == \"BEGIN_SRC_REP_TABLES\")\n {\n $str = trim($chars[0]); //Copy name of state for later processing steps\n $iStep = 1;\n $TableSpace = trim($chars[3]);\n $OwnerSpace = trim($chars[2]);\n $DateSpace = -1;\n $IndexSpace = -1;\n $IndexPart =\"\";\n $DatePart =\"\";\n\n continue;\n }\n\n if($chars[0] == \"END_SRC_REP_TABLES\") //End of REP_SRC_TABLE INFO\n {\n $iStep = 0;\n $str = \"\";\n continue;\n }\n\n if($str == \"BEGIN_SRC_REP_TABLES\" && $iStep >= 1)\n {\n $iStep++;\n\n if($iStep >= 4) // Filter for column infos name, and size columns are required\n { \n //Print this to define an icon and a string for this class of object\n if($iStep == 4)\n printf(\"\\n\\n<CLASS_DEF type=\\\"table\\\" classify=\\\"replicate_source\\\" icon=\\\"res/rep_src.png\\\" text=\\\"Source of Replication\\\" />\\n\");\n\n if(trim($chars[0]) == \"INFO\")\n {\n $RepOwner = trim($chars[1]); //Owner of source table that is replicated\n $RepTabName = trim($chars[2]); //Name of source table that is replicated\n\n printf(\"<CLASS type=\\\"table\\\" classify=\\\"replicate_source\\\" owner=\\\"%s\\\" name=\\\"%s\\\" />\\n\"\n ,$RepOwner, $RepTabName);\n continue;\n }\n }\n }\n // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX End of a SRC_REP_TAB INFO XXXXXX\n\n // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Start of a new TABLE SPACE INFO\n if($chars[0] == \"BEGIN_SPACE\" && $chars[1] == \"TABLE\")\n {\n $str = trim($chars[0]); //Copy name of state for later processing steps\n $iStep = 1;\n $TableSpace = trim($chars[3]);\n $OwnerSpace = trim($chars[2]);\n $DateSpace = -1;\n $IndexSpace = -1;\n $IndexPart =\"\";\n $DatePart =\"\";\n\n continue;\n }\n\n #End of Table/View DDL\n if($chars[0] == \"END_SPACE\")\n {\n $iStep = 0;\n $str = \"\";\n #TableSpace=\"\"\n #OwnerSpace=\"\"\n #DateSpace =-1\n #IndexSpace=-1\n #IndexPart =\"\"\n #DatePart =\"\"\n \n continue;\n }\n\n if($str == \"BEGIN_SPACE\" && strlen($TableSpace)>0 && strlen($OwnerSpace)>0 && $iStep >= 1)\n {\n $iStep++;\n \n if($iStep == 4)\n { // Filter for column infos name, and size columns are required\n if(trim($chars[0]) == $TableSpace)\n {\n $DateSpace = trim($chars[4]); //Space used for data on this table\n $DatePart = trim($chars[5]); //Size stated in KB, MB, GB ...\n $IndexSpace= trim($chars[6]); //Space used for index(es) on this table\n $IndexPart = trim($chars[7]); //Size stated in KB, MB, GB ...\n\n continue;\n }\n }\n }\n // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX End of a Table SPACE INFO XXXXXX\n\n \t// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Start of a new Table/View DDL\n \tif($chars[0] == \"BEGIN\" && ($chars[1] == \"TABLE\" || $chars[1] == \"VIEW\"))\n \t{\n \t\t$s = $chars[1]; //Copy owner and table/view name\n \t\t$Owner= $chars[2];\n \t\t$Table= $chars[3];\n \t\t\n \t\t$iStep=1;\n \n \t\tif($s == \"TABLE\")\n {\n \t\t\tprint \"\\n<tab name=\\\"$Table\\\" owner=\\\"$Owner\\\">\\n\";\n \n if($TableSpace == $Table && $OwnerSpace == $Owner)\n {\n print \" <tabsize data=\\\"$DateSpace\\\" datapart=\\\"$DatePart\\\" index=\\\"$IndexSpace\\\" indexpart=\\\"$IndexPart\\\" />\\n\";\n }\n }\n \t\telse\n {\n \t\tif($s == \"VIEW\")\n \t\t{\n //print \"\\n<view name=\\\"\" Table \"\\\" owner=\\\"\" Owner \"\\\"\" \" src=\\\"\" Table \".sql\\\"\" \">\"\n print \"\\n<view name=\\\"$Table\\\" owner=\\\"$Owner\\\" src=\\\"{$Owner}_{$Table}.sql\\\">\\n\";\n }\n }\n \n \t\tcontinue;\n \t}\n \n if(($s == \"TABLE\" || $s == \"VIEW\") && $iStep == 1)\n {\n # Filter for column infos\n if($chars[2] == $Table) #name, Type and length are required arguments\n if(strlen($chars[3]) > 0 && strlen($chars[5]) >0 && strlen($chars[7]) > 0)\n {\n print \" <col name=\\\"$chars[3]\\\" type=\\\"$chars[5]\\\" len=\\\"$chars[7]\\\"\";\n \n if($chars[5] == \"numeric\")\n print \" prec=\\\"$chars[6]\\\" scale=\\\"$chars[8]\\\"\";\n \n if($chars[10] == \"0\")\n print \" nulls=\\\"NOT NULL\\\"\";\n \n print \" />\\n\";\n continue;\n }\n }\n \n \t#End of Table/View DDL\n \tif($chars[0] == \"END\" && $chars[1] == $s && $chars[2] == $Owner && $chars[3] == $Table)\n \t{\n \t\tif($s == \"TABLE\")\n \t\t{\n \t\t\t$iCntTables++;\n \t\t\tprint \"</tab>\";\n \t\t}\n \n \t\tif($s == \"VIEW\")\n \t\t{\n \t\t\t$iCntViews++;\n \t\t\tprint \"</view>\";\n \t\t}\n \n \t\t$s=\"\";\n \t\t$iStep=0;\n \t\t$Table=\"\";\n \t\t$Owner=\"\";\n \t\t\n \t\tcontinue;\n \t}\n \n \tif(($s == \"TABLE\" || $s == \"VIEW\") && $iStep == 1)\n \t{\n // Filter for column infos\n \t\tif($chars[2] == $Table) //name, Type and length are required arguments\n \t\tif(strlen($chars[3]) > 0 && strlen($chars[5]) >0 && strlen($chars[6]) >0)\n \t\t{\n \t\t\tprint \"<col name=\\\"$chars[3]\\\" type=\\\"$chars[5]\\\" len=\\\"$chars[7]\\\"\\n\";\n \t\n \t\t\tif($chars[5] == \"numeric\")\n print \" prec=\\\"$chars[6]\\\" scale=\\\"$chars[8]\\\"\\n\";\n \n \t\t\tif($chars[10] == \"0\")\n print \" nulls=\\\"NOT NULL\\\"\\n\";\n \t\n \t\t\tprint \" />\";\n \t\t\tcontinue;\n \t\t}\n \t}\n // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX End of a Table/View DDL XXXXXX\n } // END OF WHILE for main file loop\n fclose($handle);\n\n return($iCntTables + $iCntViews);\n }", "public function change()\n {\n\n $query =\n <<<'EOD'\nCREATE TABLE core_acl_role (\n id INTEGER,\n name TEXT NOT NULL,\n init_obj_id INTEGER REFERENCES obj (obj_id),\n description TEXT,\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_acl_role');\nSELECT ddl_history_tbl('core_acl_role', 'recreate');\n\nINSERT INTO core_acl_role (id, name, description) VALUES\n (1, 'admin', NULL),\n (2, 'guest', NULL),\n (3, 'user', NULL);\n\nCREATE TABLE core_acl_resource (\n id INTEGER,\n name TEXT NOT NULL,\n description TEXT,\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_acl_resource');\nSELECT ddl_history_tbl('core_acl_resource', 'recreate');\n\n\nINSERT INTO core_acl_resource (id, name, description) VALUES\n (1, 'admin_area', NULL),\n (2, '*', NULL);\n\nCREATE TABLE core_acl_resource_access (\n id INTEGER NOT NULL,\n resource_id INTEGER NOT NULL,\n name TEXT NOT NULL,\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_acl_resource_access');\nSELECT ddl_history_tbl('core_acl_resource_access', 'recreate');\n\nINSERT INTO core_acl_resource_access (id, resource_id, name) VALUES\n (1, 1, '*');\n\n\nCREATE TABLE core_acl_access_list (\n id INTEGER NOT NULL,\n role_id INTEGER NOT NULL,\n resource_id INTEGER NOT NULL,\n access_id INTEGER NOT NULL,\n allowed INTEGER NOT NULL,\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_acl_resource_access');\nSELECT ddl_history_tbl('core_acl_resource_access', 'recreate');\n\n\nINSERT INTO core_acl_access_list (id, role_id, resource_id, access_id, allowed) VALUES\n (1, 1, 1, 1, 1);\n\n\nCREATE TABLE core_acl_role_inherit (\n id INTEGER NOT NULL,\n role_id INTEGER NOT NULL,\n inherit_role_id INTEGER NOT NULL,\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_acl_role_inherit');\nSELECT ddl_history_tbl('core_acl_role_inherit', 'recreate');\n\n\n/*CREATE TYPE core_menu_item_status AS ENUM ('active', 'noactive');*/\n\n\nCREATE TABLE core_menu_item (\n id INTEGER NOT NULL,\n menu_id INTEGER NOT NULL,\n controller_id INTEGER NOT NULL,\n parent_id INTEGER NOT NULL DEFAULT '0',\n alias TEXT NOT NULL,\n title TEXT NOT NULL,\n description TEXT NOT NULL DEFAULT '',\n image TEXT NOT NULL DEFAULT '',\n position INTEGER NOT NULL DEFAULT '1',\n state_id INTEGER NOT NULL REFERENCES ref (obj_id) DEFAULT state_id('core.core_menu_item.active'),\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_menu_item');\nSELECT ddl_history_tbl('core_menu_item', 'recreate');\nSELECT create_state('core.core_menu_item', 'active,noactive', NULL);\n\n\nINSERT INTO core_menu_item (id, menu_id, controller_id, parent_id, alias, title, description, image, position, state_id)\nVALUES\n (1, 1, '-1', 0, '', 'Settings', 'Project settings', '', 5, state_id('core.core_menu_item.active')),\n (2, 1, '-1', 1, '', 'User acccesses', '', '', 1, state_id('core.core_menu_item.active')),\n (3, 1, '6', 2, '', 'Roles', '', '', 1, state_id('core.core_menu_item.active')),\n (4, 1, '-1', 1, '', 'Menu', '', '', 2, state_id('core.core_menu_item.active')),\n (5, 1, '-1', 1, '', 'Mvc', '', '', 3, state_id('core.core_menu_item.active')),\n (7, 1, '2', 4, '', 'Items', '', '', 2, state_id('core.core_menu_item.active')),\n (8, 1, '3', 5, '', 'Modules', '', '', 1, state_id('core.core_menu_item.active')),\n (9, 1, '4', 5, '', 'Controllers', '', '', 2, state_id('core.core_menu_item.active')),\n (10, 1, '5', 5, '', 'Actions', '', '', 3, state_id('core.core_menu_item.active')),\n (11, 1, '1', 4, '', 'Menus', '', '', 1, state_id('core.core_menu_item.active')),\n (12, 1, '7', 2, '', 'Accesses', '', '', 4, state_id('core.core_menu_item.active')),\n (13, 1, '8', 2, '', 'Resources', '', '', 2, state_id('core.core_menu_item.active')),\n (14, 1, '9', 2, '', 'Access list', '', '', 5, state_id('core.core_menu_item.active')),\n (19, 1, '14', 15, '', 'Settings', 'Cron settings', '', 0, state_id('core.core_menu_item.active')),\n (20, 1, '15', 2, '', 'Users', '', '', 5, state_id('core.core_menu_item.active'));\n\n\nCREATE TABLE core_menu_menus (\n id INTEGER NOT NULL,\n name TEXT NOT NULL,\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_menu_item');\nSELECT ddl_history_tbl('core_menu_item', 'recreate');\n\nINSERT INTO core_menu_menus (id, name) VALUES\n (1, 'admin');\n\nCREATE TABLE core_mvc_action (\n id INTEGER NOT NULL,\n controller_id INTEGER NOT NULL,\n name TEXT NOT NULL,\n state_id INTEGER REFERENCES ref (obj_id) DEFAULT state_id('core.core_mvc_action.active'),\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_mvc_action');\nSELECT ddl_history_tbl('core_mvc_action', 'recreate');\nSELECT create_state('core.core_menu_item', 'active,not_active', NULL);\n\n\n/*CREATE TYPE core_mvc_module_status AS ENUM ('active', 'not_active');*/\n\n\nCREATE TABLE core_mvc_module (\n id INTEGER NOT NULL,\n name TEXT NOT NULL,\n state_id INTEGER NOT NULL DEFAULT state_id('core.core_mvc_module.active'),\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_mvc_module');\nSELECT ddl_history_tbl('core_mvc_module', 'recreate');\nSELECT create_state('core.core_mvc_module', 'active,noactive', NULL);\n\n\nINSERT INTO core_mvc_module (id, name, state_id) VALUES\n (1, 'admin', state_id('core.core_mvc_module.active')),\n (2, 'core', state_id('core.core_mvc_module.active')),\n (4, 'user', state_id('core.core_mvc_module.active'));\n\nCREATE TABLE core_mvc_controller (\n id INTEGER NOT NULL,\n module_id INTEGER NOT NULL,\n name TEXT NOT NULL,\n state_id INTEGER NOT NULL DEFAULT state_id('core.core_mvc_module.active'),\n init_obj_id INTEGER REFERENCES obj (obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP\n);\nSELECT create_class('core.core_mvc_controller');\nSELECT ddl_history_tbl('core_mvc_controller', 'recreate');\nSELECT create_state('core.core_mvc_controller', 'active,noactive', NULL);\n\n\nINSERT INTO core_mvc_controller (id, module_id, name, state_id) VALUES\n (1, 2, 'menu-menus', state_id('core.core_mvc_controller.active')),\n (2, 2, 'menu-item', state_id('core.core_mvc_controller.active')),\n (3, 2, 'mvc-module', state_id('core.core_mvc_controller.active')),\n (4, 2, 'mvc-controller', state_id('core.core_mvc_controller.active')),\n (5, 2, 'mvc-action', state_id('core.core_mvc_controller.active')),\n (6, 2, 'acl-role', state_id('core.core_mvc_controller.active')),\n (7, 2, 'acl-access', state_id('core.core_mvc_controller.active')),\n (8, 2, 'acl-resource', state_id('core.core_mvc_controller.active')),\n (9, 2, 'acl-accessList', state_id('core.core_mvc_controller.active')),\n (10, 2, 'acl-roleInherit', state_id('core.core_mvc_controller.active')),\n (14, 3, 'setting', state_id('core.core_mvc_controller.active')),\n (15, 4, 'users', state_id('core.core_mvc_controller.active'));\n\n/*\nCREATE TABLE user_users (\n obj_id integer NOT NULL REFERENCES obj(obj_id),\n email text NOT NULL,\n password text NOT NULL,\n name text NOT NULL,\n core_acl_role_id integer NOT NULL,\n state_id integer NOT NULL REFERENCES ref(obj_id),\n init_obj_id integer REFERENCES obj(obj_id),\n create_time TIMESTAMP,\n update_time TIMESTAMP);\nselect create_class('core.user_users');\n\nINSERT INTO user_users (obj_id,email, password, name, core_acl_role_id, state_id) VALUES\n(6, 'temafey@gmail.com', '$2a$08$GAeqa0pyDZMWBJYdAtKBI.rocjxtQ4RQV9ca1Np02LF6Z6LKUdTNu', 'Artem', 1, state_id('core.user_users.active'));*/\n\n\n/*DROP TRIGGER IF EXISTS ms_refresh_person_ns ON person_ns;\nDROP FUNCTION IF EXISTS ms_refresh_person_ns();\n\nDROP TRIGGER IF EXISTS person_ns_before_insert ON person_ns;\nDROP FUNCTION IF EXISTS person_ns_before_insert();\nDROP TRIGGER IF EXISTS person_ns_before_update ON person_ns;\nDROP FUNCTION IF EXISTS person_ns_before_update();\nDROP TRIGGER IF EXISTS person_ns_odb_after_delete_trigger ON person_ns;\nDROP TRIGGER IF EXISTS person_ns_odb_before_insert_trigger ON person_ns;\nDROP TRIGGER IF EXISTS person_ns_before_change_history_trigger ON person_ns;*/\n\n\ndrop MATERIALIZED view vw_pr;\n\n/*ALTER TABLE person_ns DROP COLUMN auth_key;\nALTER TABLE person_ns DROP COLUMN token;*/\n\n\n\n\nDROP FUNCTION IF EXISTS ms_refresh_person_ns() CASCADE ;\n\ndelete from person_ns\nwhere login not in ('soscredit');\n\nalter table person_ns drop COLUMN type_id;\nalter table person_ns drop COLUMN state_id;\n\n\nDELETE\nFROM ref\nWHERE relname = 'person_ns';\n\n\n\nALTER TABLE person_ns DROP COLUMN update_time;\nALTER TABLE person_ns DROP COLUMN create_time;\n\nALTER TABLE person_ns ADD COLUMN name text;\n\n\nselect create_class('core.person_ns',null);\nSELECT create_state('core.person_ns', 'active,noactive,deleted,blocked', NULL);\n\nalter table person_ns add COLUMN state_id integer DEFAULT state_id('core.person_ns.active');\n\nALTER TABLE person_ns ADD COLUMN update_time TIMESTAMP;\nALTER TABLE person_ns ADD COLUMN create_time TIMESTAMP;\n\n\n\n\nALTER TABLE core_acl_access_list ADD PRIMARY KEY (id);\nCREATE UNIQUE INDEX ON core_acl_access_list (role_id, resource_id, access_id);\n\nCREATE SEQUENCE core_acl_access_list_id_seq;\nALTER TABLE core_acl_access_list ALTER COLUMN id SET DEFAULT nextval('core_acl_access_list_id_seq');\nSELECT setval('core_acl_access_list_id_seq', (SELECT max(id) + 1\n FROM core_acl_access_list));\n\n\nALTER TABLE core_acl_resource ADD PRIMARY KEY (id);\nCREATE UNIQUE INDEX ON core_acl_resource (name);\n\nCREATE SEQUENCE core_acl_resource_id_seq;\nALTER TABLE core_acl_resource ALTER COLUMN id SET DEFAULT nextval('core_acl_resource_id_seq');\nSELECT setval('core_acl_access_list_id_seq', (SELECT max(id) + 1\n FROM core_acl_resource));\n\nALTER TABLE core_acl_resource_access ADD PRIMARY KEY (id);\nCREATE UNIQUE INDEX ON core_acl_resource_access (resource_id, name);\n\nCREATE SEQUENCE core_acl_resource_access_id_seq;\nALTER TABLE core_acl_resource_access ALTER COLUMN id SET DEFAULT nextval('core_acl_resource_access_id_seq');\nSELECT setval('core_acl_resource_access_id_seq', (SELECT max(id) + 1\n FROM core_acl_resource_access));\n\nALTER TABLE core_acl_role ADD PRIMARY KEY (id);\nCREATE UNIQUE INDEX ON core_acl_role (name);\n\nCREATE SEQUENCE core_acl_role_id_seq;\nALTER TABLE core_acl_role ALTER COLUMN id SET DEFAULT nextval('core_acl_role_id_seq');\nSELECT setval('core_acl_role_id_seq', (SELECT max(id) + 1\n FROM core_acl_role));\n\nALTER TABLE core_acl_role_inherit ADD PRIMARY KEY (id);\nCREATE UNIQUE INDEX ON core_acl_role_inherit (role_id, inherit_role_id);\n\n\nCREATE SEQUENCE core_acl_role_inherit_id_seq;\nALTER TABLE core_acl_role_inherit ALTER COLUMN id SET DEFAULT nextval('core_acl_role_inherit_id_seq');\nSELECT setval('core_acl_role_inherit_id_seq', (SELECT max(id) + 1\n FROM core_acl_role_inherit));\n\nALTER TABLE core_menu_item ADD PRIMARY KEY (id);\nCREATE INDEX ON core_menu_item (state_id);\n\nCREATE SEQUENCE core_menu_item_id_seq;\nALTER TABLE core_menu_item ALTER COLUMN id SET DEFAULT nextval('core_menu_item_id_seq');\nSELECT setval('core_menu_item_id_seq', (SELECT max(id) + 1\n FROM core_menu_item));\n\nALTER TABLE core_menu_menus ADD PRIMARY KEY (id);\n\nCREATE SEQUENCE core_menu_menus_id_seq;\nALTER TABLE core_menu_menus ALTER COLUMN id SET DEFAULT nextval('core_menu_menus_id_seq');\nSELECT setval('core_menu_menus_id_seq', (SELECT max(id) + 1\n FROM core_menu_menus));\n\n\nALTER TABLE core_mvc_action ADD PRIMARY KEY (id);\nCREATE UNIQUE INDEX ON core_mvc_action (controller_id, name);\n\n\nCREATE SEQUENCE core_mvc_action_id_seq;\nALTER TABLE core_mvc_action ALTER COLUMN id SET DEFAULT nextval('core_mvc_action_id_seq');\nSELECT setval('core_mvc_action_id_seq', (SELECT max(id) + 1\n FROM core_menu_menus));\n\nALTER TABLE core_mvc_controller ADD PRIMARY KEY (id);\n\nCREATE SEQUENCE core_mvc_controller_id_seq;\nALTER TABLE core_mvc_controller ALTER COLUMN id SET DEFAULT nextval('core_mvc_controller_id_seq');\nSELECT setval('core_mvc_controller_id_seq', (SELECT max(id) + 1\n FROM core_mvc_controller));\n\n\nALTER TABLE core_mvc_module ADD PRIMARY KEY (id);\n\nCREATE SEQUENCE core_mvc_module_id_seq;\nALTER TABLE core_mvc_module ALTER COLUMN id SET DEFAULT nextval('core_mvc_module_id_seq');\nSELECT setval('core_mvc_module_id_seq', (SELECT max(id) + 1\n FROM core_mvc_module));\n\n\nALTER TABLE core_acl_role_inherit ADD FOREIGN KEY (role_id) REFERENCES core_acl_role (id);\nALTER TABLE core_acl_role_inherit ADD FOREIGN KEY (inherit_role_id) REFERENCES core_acl_role_inherit (id);\nALTER TABLE core_acl_resource_access ADD FOREIGN KEY (resource_id) REFERENCES core_acl_resource (id);\nALTER TABLE core_acl_access_list ADD FOREIGN KEY (role_id) REFERENCES core_acl_role (id);\nALTER TABLE core_acl_access_list ADD FOREIGN KEY (resource_id) REFERENCES core_acl_resource (id);\nALTER TABLE core_acl_access_list ADD FOREIGN KEY (access_id) REFERENCES core_acl_resource_access (id);\n\n\nALTER TABLE person_ns ADD COLUMN core_acl_role_id INTEGER NOT NULL REFERENCES core_acl_role (id) DEFAULT 1;\nALTER TABLE person_ns drop column login;\nALTER TABLE person_ns alter column tree set DEFAULT 1;\nALTER TABLE person_ns drop column pathl;\n\n\n\ncreate UNIQUE INDEX person_ns_email_unq on person_ns(email);\n\nselect ddl_history_tbl('person_ns','recreate');\n\nupdate person_ns\nset email = 'soscredit@boss.com';\n\nINSERT INTO person_ns (email,password, name, core_acl_role_id, state_id) VALUES\n ('temafey@gmaill.com','$2a$08$GAeqa0pyDZMWBJYdAtKBI.rocjxtQ4RQV9ca1Np02LF6Z6LKUdTNu', 'Artem', 1,\n state_id('core.person_ns.active'));\n\nINSERT INTO person_ns (email,password, name, core_acl_role_id, state_id) VALUES\n ('fursin.v@gmail.com','$2a$08$GAeqa0pyDZMWBJYdAtKBI.rocjxtQ4RQV9ca1Np02LF6Z6LKUdTNu', 'Victor', 1,\n state_id('core.person_ns.active'));\n\nINSERT INTO person_ns (email,password, name, core_acl_role_id, state_id) VALUES\n ('nemolvlad@gmail.com','$2a$08$GAeqa0pyDZMWBJYdAtKBI.rocjxtQ4RQV9ca1Np02LF6Z6LKUdTNu', 'Oleg', 1,\n state_id('core.person_ns.active'));\n\nEOD;\n $count = $this->execute($query);\n }", "public function run()\n {\n DB::statement(\"TRUNCATE TABLE ls_tipos_descontos CASCADE\");\n \n $data = [\n [\n 'id'=>1,\n 'ls_fontes_id'=>1,\n 'nome'=>'cupom',\n 'created_at'=>new Datetime,\n 'updated_at'=>new Datetime\n ],\n [\n 'id'=>2,\n 'ls_fontes_id'=>1,\n 'nome'=>'metodo_pagamento',\n 'created_at'=>new Datetime,\n 'updated_at'=>new Datetime\n ]\n ];\n \n DB::table('ls_tipos_descontos')->insert($data);\n }", "public function run()\n {\n $this->truncateTables();\n $this->setData();\n }", "public function run()\n {\n \\Illuminate\\Support\\Facades\\DB::table('buckets')->truncate();\n \\Illuminate\\Support\\Facades\\DB::table('shards')->truncate();\n \\Illuminate\\Support\\Facades\\DB::table('table_buckets_to_shards')->truncate();\n\n $bucket1 = \\App\\Models\\Bucket::create(\n [\n 'meta' => 'first'\n ]\n );\n $bucket2 = \\App\\Models\\Bucket::create(\n [\n 'meta' => 'second'\n ]\n );\n\n $shard1 = \\App\\Models\\Shard::create(\n [\n 'name' => 'shard_1',\n 'host' => 'mysql1',\n 'username' => 'default',\n 'db_name' => 'shard1',\n 'password' => 'secret',\n ]\n );\n\n $shard2 = \\App\\Models\\Shard::create(\n [\n 'name' => 'shard_2',\n 'host' => 'mysql2',\n 'username' => 'default',\n 'db_name' => 'shard',\n 'password' => 'secret',\n ]\n );\n\n \\Illuminate\\Support\\Facades\\DB::table('table_buckets_to_shards')->insert(\n [\n [\n 'bucket_id' => $bucket1->id,\n 'shard_id' => $shard1->id\n ],\n [\n 'bucket_id' => $bucket2->id,\n 'shard_id' => $shard2->id\n ]\n ]\n );\n }", "public function run()\n {\n \\Illuminate\\Support\\Facades\\Schema::disableForeignKeyConstraints();\n \\Illuminate\\Support\\Facades\\DB::table('classes')->truncate();\n \\Illuminate\\Support\\Facades\\Schema::enableForeignKeyConstraints();\n\n Grade::insert([\n ['name' => 10, 'sub' => 1],\n ['name' => 10, 'sub' => 2],\n ['name' => 11, 'sub' => 1],\n ['name' => 11, 'sub' => 2],\n ['name' => 12, 'sub' => 1],\n ['name' => 12, 'sub' => 2],\n ]);\n }", "function rebuildDeviceData() {\n\t\tsystemLog::notice('Starting rebuild of device data');\n\t\t$oStmt = dbManager::getInstance()->prepare('SELECT deviceID FROM '.system::getConfig()->getDatabase('wurfl').'.devices WHERE rootDevice = 1');\n\t\tif ( $oStmt->execute() ) {\n\t\t\tforeach ( $oStmt as $row ) {\n\t\t\t\tsystemLog::getInstance()->setSource('rebuild]['.$row['deviceID']);\n\t\t\t\t$oDevice = wurflManager::getInstance($row['deviceID']);\n\t\t\t\tsystemLog::notice('Processing deviceID '.$row['deviceID']);\n\t\t\t\t$oDevice->setModelName($oDevice->getCapabilities()->getCapability('model_name'));\n\t\t\t\t\n\t\t\t\t$oMan = wurflManufacturer::getInstance($oDevice->getCapabilities()->getCapability('brand_name'));\n\t\t\t\tif ( $oMan->getManufacturerID() > 0 ) {\n\t\t\t\t\t$oDevice->setManufacturerID($oMan->getManufacturerID());\n\t\t\t\t}\n\t\t\t\t$oDevice->save();\n\t\t\t}\n\t\t}\n\t}", "public function getTablesModify() {}", "public function tableModify()\n {\n }", "public function tableModify()\n {\n }", "public function tableModify()\n {\n }", "public function tableModify()\n {\n }", "private function generateTables()\n\t\t{\n\t\t\tif ($this->connectFail == False)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t*\tdatabase schema access\n\t\t\t\t*/\n\n\t\t\t\t$content = file_get_contents('dbase.sql');\n\t\t\t\t$queries = explode(\";\\n\\n\", $content);\n\n\t\t\t\tforeach ($queries as $key => $query)\n\t\t\t\t{\n\t\t\t\t\t$er = False;\n\t\t\t\t\t$df = $this->execQuery($query);\n\n\t\t\t\t\t#print $df.\"\\n\".$er.PHP_EOL;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function rebuildIndex()\n {\n $this->elastic->deleteIndex(self::INDEX);\n $this->elastic->addIndexCompanion(self::INDEX);\n }", "public function run()\n {\n DB::table('footers')->insert([\n \t[\n\t 'name' => 'Footer1',\n 'slug' => 'footer1',\n\t 'segment' => [],\n\t 'created_at' => date(\"Y-m-d H:i:s\"),\n\t\t\t\t'updated_at' => date(\"Y-m-d H:i:s\")\n\t\t\t]\n ]);\n\n $parent = DB::table('segments')->whereIn('slug',['profil','toko','beli','jual','bantuan','contacs'])->get();\n DB::table('footers')->whereIn('slug', ['footer1'])\n\t\t\t->update(['segment' => $parent->toArray()]);\n }", "public function run()\n {\n //factory(App\\Models\\Restaurant::class, 10)->create();\n $restaurant = Restaurant::findOrFail(1);\n $tables = $restaurant->tables;\n \n $orders = [];\n foreach($tables as $table){\n for($i = 0;$i<10 ; $i++){\n $order = new Order;\n $order->table_id = $table->id;\n $order->state = mt_rand(0, 2);\n $order->save();\n $orders[] = $order;\n }\n }\n }", "public function process()\n {\n $this->logger->addInfo(\"*** Processing uniques tables ***\");\n foreach ($this->arrTables as $tableName) {\n $this->processTable($tableName);\n }\n\n $this->logger->addInfo(\"*** Processing uniques tables done ***\");\n }", "public function indexTable()\n {\n $this->paginate = array('all', 'order' => array('modified' => 'desc'));\n $contentVariableTables = $this->paginate('ContentVariableTable');\n $this->set(compact('contentVariableTables', $contentVariableTables));\n }" ]
[ "0.6072215", "0.56858027", "0.5578309", "0.55082285", "0.5503615", "0.54640305", "0.5441683", "0.54339826", "0.5413145", "0.5402876", "0.53798383", "0.5377707", "0.53752047", "0.53701526", "0.5356225", "0.535518", "0.5331628", "0.53296167", "0.5320131", "0.53121305", "0.52996355", "0.5291666", "0.528478", "0.52826124", "0.52612376", "0.5250049", "0.5248192", "0.5235547", "0.52324307", "0.52178204", "0.51998574", "0.51938605", "0.51719815", "0.51640075", "0.5156552", "0.5150002", "0.51410294", "0.5138352", "0.5130288", "0.51211476", "0.5112922", "0.51104176", "0.5109046", "0.51074195", "0.5105763", "0.5083558", "0.5081294", "0.5077584", "0.5052463", "0.50349915", "0.50136036", "0.50030035", "0.49621245", "0.49597692", "0.49567613", "0.49491638", "0.49488178", "0.49457493", "0.49418458", "0.49276227", "0.49218968", "0.49116722", "0.49063167", "0.49036214", "0.49027482", "0.48957127", "0.4892412", "0.48917794", "0.48911753", "0.48845863", "0.48827496", "0.48762995", "0.48621833", "0.48620093", "0.48538065", "0.48528582", "0.48505235", "0.484316", "0.48397052", "0.48396584", "0.48394832", "0.4831673", "0.483074", "0.48300707", "0.48197252", "0.4816847", "0.4814207", "0.4810082", "0.48057097", "0.47992685", "0.47915635", "0.47915635", "0.47915635", "0.47915635", "0.47912323", "0.4788258", "0.47875553", "0.4786134", "0.4777874", "0.4773607" ]
0.49556342
55
Prepares fields for creating table
private function _prepareFields() { $result = []; foreach ($this->_fields as $field => $params) { if ($field == 'languageTable') { continue; } $tmp = '`' . $field . '` ' . $params['type']; if (in_array($params['type'], ['char', 'varchar'])) { $length = isset($params['length']) ? $params['length'] : 100; $tmp .= '(' . $length . ')'; } $tmp .= ($params['null']) ? ' NULL' : ' NOT NULL'; $tmp .= ($params['default'] || $params['default'] === 0) ? ' DEFAULT ' . $params['default'] : ''; if ($field == 'id') { $tmp .= ' AUTO_INCREMENT PRIMARY KEY'; } $result[] = $tmp; } return implode(',', $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function prepare_fields()\n {\n }", "protected function initTableFields()\r\n {\r\n $this->addField(self::$ID, STRING, \"\");\r\n $this->addField(self::$USER_ID, STRING, \"\");\r\n $this->addField(self::$LOGIN_TIME, STRING, date('Y-m-d H:i:s'));\r\n $this->addField(self::$LOGOUT_TIME, STRING, date('Y-m-d H:i:s'));\r\n $this->addField(self::$STATUS, INTEGER, USER_ACCESS_TOKEN_STATUS_INVALID);\r\n $this->addField(self::$LONGITUDE, INTEGER, 0);\r\n $this->addField(self::$LATITUDE, INTEGER, 0);\r\n $this->addField(self::$CLIENT_IP, STRING, \"\");\r\n }", "abstract protected function createFields();", "private function prepareTables() {}", "protected function prepareTable($table){\n $date = Factory::getDate();\n\t if(empty($table->id)){\n\t $table->created = $date->toSql();\n\t }\n\t}", "protected function prepareTable($table)\r\n \t{\r\n \t\t// Provide created and modified values\r\n \t \tif (empty($table->id)) {\r\n \t\t\tif (empty($table->created_by)) {\r\n \t\t\t\t$table->created_by = JFactory::getUser()->id;\r\n \t\t\t}\r\n \t\t\tif (empty($this->created)) {\r\n \t\t\t\t$table->created = JFactory::getDate()->toSql();\r\n \t\t\t} \t\t\t\r\n \t\t} else {\r\n \t\t\t$table->modified_by = JFactory::getUser()->id;\r\n \t\t\t$table->modified = JFactory::getDate()->toSql();\r\n \t\t}\r\n \t}", "public abstract function createFields();", "protected function initCreatingFields() : void\n\t{\n\n\t\t$this->creating_fields = ['text', 'user_id', 'parent_id'];\n\n\t}", "function _init_fields()\n\t{\n\t\tif($this->table_name)\n\t\t{\n\t\t\t$this->db_fields = $this->db->list_fields($this->table_name);\n\t\t\t\n\t\t\tforeach($this->db_fields as $field)\n\t\t\t{\n\t\t\t\t$this->{$field} = NULL;\n\t\t\t}\n\t\t}\n\t}", "protected function prepareDetailsTables()\n\t{\n\t}", "public function init()\r\n\t{\r\n\t\tif (count($this->table_fields) < 1)\r\n\t\t\treturn false;\r\n\t\tforeach ($this->table_fields as $table_field) {\r\n\t\t\tif ($table_field->get_primary_key()) {\r\n\t\t\t\t$this->id_field = $table_field->get_name();\r\n\t\t\t}\r\n\t\t\tif ($table_field->get_name_key()) {\r\n\t\t\t\t$this->name_fields[] = $table_field->get_name();\r\n\t\t\t}\r\n\t\t\tif ($table_field->get_unike_key()) {\r\n\t\t\t\t$this->unike_keys[] = $table_field->get_name();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function prepareFieldset();", "function prepareForDb() {\n $this->description = sql_escape($this->description);\n $this->postsHeader = sql_escape($this->postsHeader);\n $this->postBody = sql_escape($this->postBody);\n $this->postsFooter = sql_escape($this->postsFooter);\n $this->formLogged = sql_escape($this->formLogged);\n $this->form = sql_escape($this->form);\n $this->navigation = sql_escape($this->navigation);\n $this->name = sql_escape($this->name);\n $this->nameLin = sql_escape($this->nameLin);\n $this->memberName = sql_escape($this->memberName);\n $this->date = sql_escape($this->date);\n $this->time = sql_escape($this->time); \n $this->nextPage = sql_escape($this->nextPage);\n $this->previousPage =sql_escape($this->previousPage);\n $this->firstPage = sql_escape($this->firstPage);\n $this->lastPage = sql_escape($this->lastPage);\n\t$this->gravDefault = sql_escape($this->gravDefault);\n }", "protected function setupFields()\n {\n }", "private function populateDummyTable() {}", "public function __construct() {\n parent::__construct();\n $this->_table_columns = array(\"id\", \"entry_date\", \"account_type\", \"entry_value\", \"memo\", \"expense\", \"confirm\", \"deleted\", \"create_stamp\", \"modified_stamp\");\n }", "public function fieldCreate()\n\t{\n\t\t$fields=array();\n\t\tforeach($this->getTable()->result_array() as $row)\n\t\t{\n\t\t\tif($row['Extra']!=='auto_increment')\n\t\t\t{\n\t\t\t\t$fields[]=array(\n\t\t\t\t\t'field'=>$row['Field'],\n\t\t\t\t\t'max_length'=>preg_match('/varchar/',$row['Type']) ? (preg_replace('/[A-Za-z()]/','',$row['Type'])!=='' ? '\\'maxlength\\'=>'.preg_replace('/[A-Za-z()]/','',$row['Type']).',' : false) : false,\n\t\t\t\t\t'type'=>preg_match('/text/',$row['Type']) ? 'Area' : 'Field',\n\t\t\t\t\t'required'=>$row['Null']=='NO' ? true : false,\n\t\t\t\t\t'input'=>preg_match('/^(password|pass|passwd|passcode)$/i',$row['Field']) ? 'password' : 'text',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $fields;\n\t}", "private function prepare($arguments)\n {\n \n $data = explode( '|', $arguments );\n \n $this->tableName = $data[0];\n \n $this->className = 'Create'.studly_case(strtolower( $this->tableName )).'Table';\n \n $this->fileName = date('Y_m_d_His').\"_create_\".strtolower($this->tableName).\"_table\";\n \n if( count( array_filter($data) ) > 1 )\n {\n \n array_shift($data);\n \n foreach($data as $list)\n {\n \n $type = explode(':', $list)[0];\n \n $columns = array_filter( explode( ',', explode(':', $list)[1] ) );\n \n if( $type == 'foreign' )\n {\n \n foreach( $columns as $column )\n {\n \n $foreign_key = explode('-', $column)[0];\n $foreign_table = explode('-', $column)[1];\n \n $this->columns .= '\n $table->integer(\\''.$foreign_key.'\\')->unsigned();\n $table->foreign(\\''.$foreign_key.'\\')->references(\\'id\\')->on(\\''.$foreign_table.'\\')->onDelete(\\'cascade\\');';\n \n }\n \n } elseif( $type == \"nullforeign\" )\n {\n \n foreach( $columns as $column )\n {\n \n $foreign_key = explode('-', $column)[0];\n $foreign_table = explode('-', $column)[1];\n \n $this->columns .= '\n $table->integer(\\''.$foreign_key.'\\')->unsigned()->nullable();\n $table->foreign(\\''.$foreign_key.'\\')->references(\\'id\\')->on(\\''.$foreign_table.'\\')->onDelete(\\'set null\\');';\n \n }\n \n } else{\n \n foreach( $columns as $column )\n {\n \n $type = str_replace('tiny', 'tinyInteger', $type);\n $type = str_replace('tinyIntegerInteger', 'tinyInteger', $type);\n $type = str_replace('time', 'timestamp', $type);\n $type = str_replace('timestamptimestamp', 'timestamp', $type);\n \n $this->columns .= '\n $table->'.$type.'(\\''.$column.'\\');';\n \n }\n \n }\n \n }\n \n }\n \n return $data;\n \n }", "protected function storeMappingTablePrepare(): void\n {\n // Create a temporary table with the mapper.\n $this->operationSqls[] = <<<'SQL'\n# Create a temporary table to map values.\nDROP TABLE IF EXISTS `_temporary_mapper`;\nCREATE TABLE `_temporary_mapper` LIKE `value`;\nALTER TABLE `_temporary_mapper`\n DROP `resource_id`,\n ADD `source` longtext COLLATE utf8mb4_unicode_ci\n;\nSQL;\n }", "protected function prepareTable(&$table)\n\t{\n\t}", "protected function prepareTable(&$table) {\n \n // Fix magic qutoes\n if( get_magic_quotes_gpc() ) {\n $table->name = stripcslashes($table->name);\n $table->bio = stripcslashes($table->bio);\n }\n \n // If an alias does not exist, I will generate the new one from the user name.\n if(!$table->alias) {\n $table->alias = $table->name;\n }\n $table->alias = JApplication::stringURLSafe($table->alias);\n }", "private function prepare_fields( $table_configuration ) {\n\t\t$this->key_fields = $table_configuration['key_fields'];\n\t\t$this->range_field = $table_configuration['range_field'];\n\t\t$this->checksum_fields = $table_configuration['checksum_fields'];\n\t\t$this->filter_values = isset( $table_configuration['filter_values'] ) ? $table_configuration['filter_values'] : null;\n\t\t$this->additional_filter_sql = ! empty( $table_configuration['filter_sql'] ) ? $table_configuration['filter_sql'] : '';\n\t\t$this->parent_table = isset( $table_configuration['parent_table'] ) ? $table_configuration['parent_table'] : null;\n\t\t$this->parent_join_field = isset( $table_configuration['parent_join_field'] ) ? $table_configuration['parent_join_field'] : $table_configuration['range_field'];\n\t\t$this->table_join_field = isset( $table_configuration['table_join_field'] ) ? $table_configuration['table_join_field'] : $table_configuration['range_field'];\n\t}", "protected function createFormFields() {\n\t}", "private function prepare()\n {\n $this->selectFields[$this->tableName][] = $this->rootEntityIdentifier;\n\n $sColumns = explode(',', $this->requestParams['sColumns']);\n\n for ($i = 0; $i < $this->iColumns; $i++) {\n\n if ($this->requestParams['mDataProp_' . $i] != null) {\n\n $field = $this->requestParams['mDataProp_' . $i];\n\n if ($sColumns[$i] != '') {\n if ($field != $sColumns[$i]) {\n $field = $sColumns[$i];\n }\n }\n\n // association delimiter found\n if (strstr($field, '.') !== false) {\n\n // separate fields\n $fieldsArray = explode('.', $field);\n // set associations in selectFields[]\n $this->setAssociations($fieldsArray, 0, $this->metadata);\n\n } else {\n\n // no association found\n if ($field !== $this->rootEntityIdentifier) {\n array_push($this->selectFields[$this->tableName], $field);\n }\n\n $this->allFields[] = $this->tableName . '.' . $field;\n\n }\n\n } else {\n\n $this->allFields[] = '';\n\n }\n }\n\n return $this;\n }", "function ReInitTableColumns()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::ReInitTableColumns();\" . \"<HR>\";\n foreach ($this->form_fields as $prefix => $form) {\n foreach ($form as $i => $field) {\n foreach ($field as $param => $value) {\n //if found database parameters\n if (strpos($param, \"dbfield_\") !== false) {\n $columnparam = substr($param, strlen(\"dbfield_\"), strlen($param));\n $this->Storage->setColumnParameter($field[\"field_name\"], trim($columnparam), $value);\n }\n }\n }\n }\n }", "function init(){\n\t\t/*\n\t\t * Redefine this object, call parent then use addField to specify which fields\n\t\t * you are going to use\n\t\t */\n\t\tparent::init();\n\t\t$this->table_name = get_class($this);\n\t}", "public function buildHeaderFields() {}", "protected function _initsTable() {}", "abstract public function create_table($table_name, $fields, $primary_key = TRUE);", "protected function _setup() {\n // $this->_createTable();\n parent::_setup();\n }", "private function createDummyTable() {}", "protected static function genChildDbFieldTableTemplate() { return array(); }", "function create_form_table($args) {\n\t\t$table_name = $args[\"singular_code_name\"];\n\t\t$result = $GLOBALS['db']->query(\"DROP TABLE \".$table_name);\n\t\t$result = $GLOBALS['db']->query(\"CREATE TABLE IF NOT EXISTS \".$table_name.\" (id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY)\");\n\n\t\t$items = $args[\"items\"];\n\n\t\tforeach($items as $item) {\n\t\t\tif($item[\"type\"] == 'input') {\n\t\t\t\tswitch($item[\"var_type\"][0]) {\n\t\t\t\t\tcase 'varchar':\n\t\t\t\t\tcase 'text':\n\t\t\t\t\tcase 'string':\n\n\t\t\t\t\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD \".$item[\"singular_code_name\"].\" VARCHAR(\".$item[\"var_type\"][1].\") NOT NULL\");\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD \".$item[\"singular_code_name\"].\" \".$item[\"var_type\"][0].\"(\".$item[\"var_type\"][1].\") NOT NULL\");\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD reg_date TIMESTAMP\");\n\t}", "public function buildFields() {\n }", "public function init() {\n foreach ($this->_hidden as $col => $name) {\n if ($col == \"transaction_type_id\") {\n parent::createHidden($col);\n }\n }\n\n // Generating fields \n // for Form_Iadmin_TransactionTypeAdd\n foreach ($this->_fields as $col => $name) {\n switch ($col) {\n case \"transaction_type_name\":\n parent::createText($col);\n break;\n case \"nature\":\n parent::createRadioWithoutMultioptions($col);\n break;\n case \"is_adjustment\":\n parent::createCheckbox1($col);\n break;\n default:\n break;\n }\n\n //Generating radio\n // for Form_Iadmin_TransactionTypeAdd\n if (in_array($col, array_keys($this->_radio))) {\n parent::createRadio($col, $this->_radio[$col]);\n }\n }\n }", "private function prepare_data(){\r\n\t\t\t$this->data_table['cols'] = array();\r\n\t\t\t\r\n\t\t\tforeach($this->columns as $column_id => $column_info){\r\n\t\t\t\tswitch($column_info['type']){\r\n\t\t\t\t\tcase 'number':\r\n\t\t\t\t\tcase 'float':\r\n\t\t\t\t\tcase 'currency':\r\n\t\t\t\t\t\t$column_info['type'] = 'number';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$column_info['type'] = 'string';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->data_table['cols'][] = array_merge(array('id' => $column_id), $column_info);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$rows_count = sizeof(reset($this->data));\r\n\t\t\t\r\n\t\t\tfor($i = 0; $i < $rows_count; $i++){\r\n\t\t\t\t$c = array();\r\n\t\t\t\t\r\n\t\t\t\tforeach($this->columns as $column_id => $column_info){\r\n\t\t\t\t\t$value = $this->data[$column_id][$i];\r\n\t\t\t\t\t$c[] = array('v' => $value);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->data_table['rows'][] = array('c' => $c);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->data_table = json_encode($this->data_table);\r\n\t\t}", "protected function _prepareColumns()\n\t{\n\t\t$this->addColumn('id',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('ID'),\n\t\t\t\t\t\t'align' =>'right',\n\t\t\t\t\t\t'width' => '50px',\n\t\t\t\t\t\t'index' => 'id'\n\t\t\t\t)\n\t\t);\n\t\t \n\t\t$this->addColumn('name',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Name'),\n\t\t\t\t\t\t'index' => 'name'\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t$this->addColumn('description',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Description'),\n\t\t\t\t\t\t'index' => 'description'\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t$this->addColumn('percentage',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Percentage'),\n\t\t\t\t\t\t'index' => 'percentage'\n\t\t\t\t)\n\t\t);\n\t\t \n\t\treturn parent::_prepareColumns();\n\t}", "function prepare_field_for_db($field)\n {\n }", "private function setFields()\n\t{\t\n\t\t$sql = '';\n\t\t\n\t\tforeach (array_keys($this->data) as $key)\n\t\t{\n\t\t\t$sql .= '`' . $key . '` = ? , ';\n\t\t}\n\t\t\n\t\t$sql = rtrim($sql, ', ');\n\t\t\n\t\treturn $sql;\n\t}", "protected function prepareTable($table)\n\t{\n\t\t$table->title = htmlspecialchars_decode($table->title, ENT_QUOTES);\n\t\t$nullDate = substr($this->_db->getNullDate(), 0, 10);\n\n\t\t// If customer group id is empty, then set it to null\n\t\tif ($table->customer_group_id === '')\n\t\t{\n\t\t\t$table->customer_group_id = NULL;\n\t\t}\n\n\t\tif ($table->valid_from != $nullDate )\n\t\t{\n\t\t\t$table->valid_from = date('Y-m-d', strtotime($table->valid_from));\n\t\t}\n\n\t\tif ($table->valid_to != $nullDate )\n\t\t{\n\t\t\t$table->valid_to = date('Y-m-d', strtotime($table->valid_to));\n\t\t}\n\n\t\t// Only encode when limit_checkin is an array\n\t\tif (!empty($table->limit_checkin) && is_array($table->limit_checkin))\n\t\t{\n\t\t\t$table->limit_checkin = json_encode($table->limit_checkin);\n\t\t}\n\t}", "protected function initFieldNames()\n {\n $this->field_names = new FieldList(['collections.collections_id', 'title', 'inv_no', '`status`'], ['collections_id', 'title', 'inv_no', '`status`']);\n }", "protected function prepareForValidation()\n {\n\n $attrs = $this->all();\n $attrs['day'] = ucfirst($attrs['day']);\n $hours = $this->transformHoursAndMinutes();\n $attrs['time_start'] = $hours[0];\n $attrs['time_end'] = $hours[1];\n $this->replace($attrs);\n }", "protected function prepare()\n {\n $this->slug = $this->getSubmittedSlug();\n\n if ($this->isNew()) {\n $this->prepForNewEntry();\n } else {\n $this->prepForExistingEntry();\n }\n\n // As part of the prep, we'll apply the date and slug. We'll remove them\n // from the fields array since we don't want it to be in the YAML.\n unset($this->fields['date'], $this->fields['slug']);\n\n $this->fieldset = $this->content->fieldset()->withTaxonomies();\n }", "protected function setUpTable()\n {\n if (!Schema::hasTable($this->TABLE)){\n Schema::create($this->TABLE, function (Blueprint $table) {\n $table->string(self::ID)->primary();\n $table->string(self::TEXT);\n $table->integer(self::DATE);\n $table->string(self::SENDER_ID);\n $table->string(self::RECIPIENT_ID);\n });\n }\n }", "public function build(){\r\n\r\n $columns = '';\r\n\r\n if(!is_null($this->table)){\r\n\r\n //run the drop table query before creating the new one\r\n if($this->_dropifexists){\r\n $this->database->rawQuery('DROP TABLE IF EXISTS '.$this->table.';');\r\n }\r\n \r\n $this->_sqlquery .= 'CREATE TABLE '.$this->table.' ';\r\n\r\n //process columns\r\n foreach($this->_sqlcols as $column => $attributes){\r\n $columns .= $column.' '.join(' ', $attributes).',';\r\n }\r\n\r\n //process primary column\r\n if(!is_null($this->_primary)){\r\n $columns .= 'primary key ('.$this->_primary.')';\r\n }\r\n\r\n //process unique columns\r\n if(count($this->_unique) !== 0){\r\n $columns .= 'UNIQUE ('.join(',', $this->_unique).')';\r\n }\r\n\r\n //foreign key\r\n if(count($this->_fk) !== 0){\r\n $columns .= $this->_parseFKConstraints($this->_fk);\r\n }\r\n\r\n //trim commas\r\n $columns = rtrim($columns, ',');\r\n\r\n $this->_sqlquery .= '('.$columns.')';\r\n }\r\n\r\n return $this->database->rawQuery($this->_sqlquery);\r\n }", "function afterCreateTable(){\n $aData = array(\n array( \"Intranet\", \"INTR\", 1 ),\n array( \"Document Management\", \"DOCU\" ),\n array( \"Email\", \"EMAI\" ),\n array( \"General\", \"GENE\" )\n );\n \n foreach( $aData as $row ){\n $this->id = 0;\n $this->aFields[\"name\"]->value = $row[0];\n $this->aFields[\"code\"]->value = $row[1];\n \n // Default option\n if( array_key_exists( 2, $row ) ) $this->aFields[\"is_default\"]->value = $row[2];\n else $this->aFields[\"is_default\"]->value = 0;\n \n $this->save();\n }\n \n // Make everything point to the default\n $sql = \"SELECT id FROM issue_system WHERE is_default = 1\";\n $db = new DB();\n $db->query( $sql );\n $row = $db->fetchRow();\n $sql = \"UPDATE issue SET issue_system_id = \".$row[\"id\"];\n $db->query( $sql );\n \n }", "public function set_table_vars() {\n\t\tglobal $wpdb;\n\n\t\t$this->table = $wpdb->prefix . self::TABLE_NAME;\n\t\t$this->ms_table = $wpdb->base_prefix . self::MS_TABLE_NAME;\n\n\t\t/* Register the snippet table names with WordPress */\n\t\t$wpdb->snippets = $this->table;\n\t\t$wpdb->ms_snippets = $this->ms_table;\n\n\t\t$wpdb->tables[] = self::TABLE_NAME;\n\t\t$wpdb->ms_global_tables[] = self::MS_TABLE_NAME;\n\t}", "function prepare_field_for_import($field)\n {\n }", "static function setUpColumns($columns)\n {\n $columns->id = Column::AUTO_ID;\n $columns->name = Column::create(Column::STRING + Column::NOT_NULL)->setUnique();\n $columns->address = Column::STRING;\n $columns->createdAt = Column::TIMESTAMP;\n }", "private function _setFieldNames() {\n $this->id = \"id\";\n $this->name = \"name\";\n $this->surveyId = \"survey_id\";\n $this->languageId = \"language_id\";\n $this->deleted = \"deleted\"; \n }", "private static function genParentDbFieldTableTemplate() {\n return array(\n self::ID_KEY => new AccessLayerField(DataTypeName::UNSIGNED_INT),\n self::CREATED_KEY => new AccessLayerField(DataTypeName::TIMESTAMP),\n self::LAST_UPDATED_TIME_KEY => new AccessLayerField(DataTypeName::TIMESTAMP),\n );\n }", "public function prepare($fields)\n {\n foreach ($fields as $key => $values) {\n if (!is_null($values) && array_key_exists($key, array_flip($this->_csvHeader))) {\n foreach ($values as $value) {\n $this->map($value, $values);\n }\n }\n }\n }", "protected function init()\n {\n if (!isset($this['fields'])) {\n $model = $base = [];\n if (isset($this->options['base_model']) && $this->options['base_model']) {\n $base = static::getTableInfo($this->options['base_model']) ? : [];\n }\n if (isset($this->options['table_name']) && (!$base || $this->options['table_name'] != $base['table_name'])) {\n $model = $this->getTableInfo($this->options['table_name']) ? : [];\n }\n \n if ($model && $base) {\n $model['ext_table'] = $model['table_name'];\n $model['ext_fields'] = isset($model['master_fields']) ? $model['master_fields'] : array_keys($model['fields']);\n \n $model['master_table'] = $base['table_name'];\n $model['master_fields'] = isset($base['master_fields']) ? $base['master_fields'] : array_keys($base['fields']);\n }\n \n // merge\n $model = ArrayHelper::merge($base, $model);\n $this->setOption($model);\n }\n }", "function _generateBasicCreateTable($targetDB, $tableName, &$tableFields, $PKFields, $Indexes)\n{\n $dbFormat = new DBFormat($targetDB); //object that contains DB-specific translations\n //print_r ($dbFormat);\n\n $IndexNames = array();\n\n //fix up index names (need to be unique in at least MS SQL)\n //not so good coding practice for performance but items are few in these arrays\n foreach($Indexes as $key => $value){\n $IndexNames[\"{$tableName}_{$key}\"] = $value;\n }\n\n //start building the statement\n $SQL = \"CREATE TABLE `$tableName` (\\n\";\n // print($SQL);\n // print_r($tableFields);\n //add the fields\n foreach($tableFields as $vName => $value){\n if(!is_object($value)){\n print_r($tableFields);\n die(\"m. _generateBasicCreateTable: Field $vName is not a valid ModuleField.\");\n } else {\n if (strtolower(get_class($value)) == 'tablefield'){\n if(!isset($dbFormat->dataTypes[$value->dataType])){\n trigger_error(\"Data type {$value->dataType} not supported.\", E_USER_ERROR);\n }\n $SQL .= \" {$value->name} {$dbFormat->dataTypes[$value->dataType]}\";\n if (!empty($value->dbFlags)){\n $flag = $value->dbFlags;\n foreach($dbFormat->flags as $k=>$v){\n $flag = str_replace($k, $v, $flag);\n }\n $SQL .= \" $flag\";\n }\n $SQL .= \",\\n\";\n\n }\n }\n\n }\n\n //add primary key definiton\n $SQL .= \" {$dbFormat->PKDeclaration}(\\n \";\n $SQL .= implode(\",\\n \", $PKFields);\n $SQL .= \"\\n )\";\n\n //add MySQL indexes:\n //within the CREATE TABLE statement\n if ($targetDB == 'MySQL'){\n\n/*\n if (count($IndexNames) > 0){\n foreach($IndexNames as $key => $value){\n $SQL .= \",\\n INDEX $key (\\n \";\n $SQL .= implode(\",\\n \", $value);\n $SQL .= \"\\n )\";\n }\n }\n*/\n }\n\n //close the statement\n if ($targetDB == 'MySQL'){\n $SQL .= \"\\n) TYPE=InnoDB;\\n\"; //using transacion-capable tables\n } else {\n $SQL .= \"\\n);\\n\";\n }\n\n //add MS SQL Server indexes:\n //with separate CREATE INDEX statements\n if ($targetDB == 'MSSQL'){\n if (count($IndexNames) > 0){\n foreach($IndexNames as $key => $value){\n $SQL .= \"CREATE INDEX $key ON `$tableName` (\\n \";\n $SQL .= implode(\",\\n \", $value);\n $SQL .= \"\\n);\\n\";\n }\n }\n }\n\n unset($dbFormat);\n\n return $SQL;\n}", "private function _set_fields()\n {\n @$this->form_data->question_id = 0;\n\n $this->form_data->category_id = 0;\n $this->form_data->sub_category_id = 0;\n $this->form_data->sub_two_category_id = 0;\n $this->form_data->sub_three_category_id = 0;\n $this->form_data->sub_four_category_id = 0;\n\n $this->form_data->ques_text = '';\n $this->form_data->survey_weight = '';\n $this->form_data->ques_type = '';\n $this->form_data->qus_fixed = 0;\n $this->form_data->ques_expiry_date = '';\n\n\n $this->form_data->filter_question = '';\n $this->form_data->filter_category = 0;\n $this->form_data->filter_type = '';\n $this->form_data->filter_expired = '';\n }", "function OnCreateTable_std($_args)\n {\n $attr_str=($this->PARAMS['unsigned'] ? \"UNSIGNED\" : \"\");\n return [ \n 'fld_seg'=>\"`{$this->fldname}` {$this->PARAMS['_type']} $attr_str {$this->str_required()} \",\n 'add_queries'=>[]\n ];\n }", "protected function populateTable() {\n\t\t$query = \"\n\t\tINSERT INTO `items` VALUES (1, 'Candy', 'Crush', '1924 Sucka Drive', 'Stripper');\n\t\tINSERT INTO `items` VALUES (2, 'John', 'Smith', '9999 The Way', 'Unemployeed');\n\t\t\";\n\t\t$this->PDO->query($query);\n\t}", "function createFields() {\n\tDB::exec(\"DROP TABLE IF EXISTS fields\");\n\t// create fields table\n\tDB::exec(\"CREATE TABLE fields (\n\t\tid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\tname VARCHAR(50) NOT NULL UNIQUE,\n\t\tcontent TEXT\n\t)\");\n\n\toutput(RESULT_INFO, \"Fields setup successfully completed\");\n\treturn 1;\n}", "private function createFields(){\n //Human::log(\"------------- Create fields model \".$this->modelName);\n self::$yetInit[get_class($this)]=true;\n //let's init database.\n $modelName=get_class($this);\n $modelNameManager=$modelName.\"Manager\";\n if(!class_exists($modelNameManager)){\n $modelNameManager=\"DbManager\";\n }\n $rc=new ReflectionClass($modelName);\n $rc->setStaticPropertyValue(\"manager\", new $modelNameManager( $modelName ));\n \n //browse the class properties to find db fields and then store it in a good order (keys first, associations later)\n\t $fields=array();\n foreach ($rc->getProperties() as $field){\n if($field->isPublic()){\n\n\n //get the type from the @var type $field name comment...yes, I'm sure.\n $comments=$field->getDocComment();\n $details=CodeComments::getVariable($comments);\n\n $type=$details[\"type\"];\n $isVector=$details[\"isVector\"];\n $description=$details[\"description\"];\n $fieldName=$field->name;\n\n $fieldObject=$this->getDbField($fieldName,$type,$isVector);\n\n if($fieldObject){\n $fieldObject[\"comments\"]=$description;\n switch($fieldObject[\"type\"]){\n\n case \"OneToOneAssoc\":\n case \"NToNAssoc\":\n //associations at the end\n array_push($fields, $fieldObject);\n break;\n\n default :\n //classic fields at the beginning\n array_unshift($fields, $fieldObject);\n\n }\n\n }\n }\n }\n\t //create the fields\n\t foreach ($fields as $f){\n\t\t$f[\"options\"][Field::COMMENTS]=$f[\"comments\"];\n Field::create($modelName.\".\".$f[\"name\"],$f[\"type\"],$f[\"options\"]);\n //Human::log($this->modelName.\" Create field \".$f[\"name\"]);\n \n\t }\n \n\t //whooho!\n $this->db()->init(); \n }", "public function db_prep_set() {\n if ($this->created_on === null || $this->created_on < new DateTime('0000-00-00')) {\n $this->created_on = DB::T(DB::NOW);\n if (Conf::$USER !== null) {\n $this->created_by = Conf::$USER->id;\n }\n }\n else {\n $this->last_updated_on = DB::T(DB::NOW);\n if (Conf::$USER !== null) {\n $this->last_updated_by = Conf::$USER->id;\n }\n }\n }", "protected function _prep_args() {\n\t\t// this is the data prepared for binding.\n\t\t// these fields are ordered as they are in the table\n\t\t$args = array(\n\t\t\t'the_id' => $this->id,\n\t\t\t'date_created' => $this->date_created,\n\t\t\t'completed' => $this->completed,\n\t\t\t'template_id' => $this->template_id,\n\t\t);\n\n\t\treturn $args;\n\t}", "protected function _prepareColumns()\n {\n $this->addColumn('ticket_id', array(\n 'header' => Mage::helper('inchoo_supportticket')->__('ID'),\n 'width' => '80px',\n 'index' => 'ticket_id'\n ));\n $this->addColumn('subject', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Subject'),\n 'type'=> 'text',\n 'width' => '300px',\n 'index' => 'subject',\n 'escape' => true\n ));\n $this->addColumn('content', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Content'),\n 'type' => 'text',\n 'index' => 'content',\n 'escape' => true\n ));\n $this->addColumn('status', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Status'),\n 'type'=> 'text',\n 'width' => '200px',\n 'index' => 'status',\n 'escape' => true\n ));\n $this->addColumn('created_at', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Created at'),\n 'type' => 'text',\n 'width' => '170px',\n 'index' => 'created_at',\n ));\n return parent::_prepareColumns();\n }", "protected function buildCoreFields(): void\n {\n //====================================================================//\n // Reference\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"increment_id\")\n ->name('Reference')\n ->microData(\"http://schema.org/Invoice\", \"confirmationNumber\")\n ->isReadOnly()\n ->isListed()\n ;\n //====================================================================//\n // Customer Object\n $this->fieldsFactory()->create((string) self::objects()->encode(\"ThirdParty\", SPL_T_ID))\n ->identifier(\"customer_id\")\n ->name('Customer')\n ->microData(\"http://schema.org/Organization\", \"ID\")\n ->isRequired()\n ->isReadOnly()\n ;\n //====================================================================//\n // Customer Email\n $this->fieldsFactory()->create(SPL_T_EMAIL)\n ->identifier(\"customer_email\")\n ->name(\"Email du contact\")\n ->microData(\"http://schema.org/ContactPoint\", \"email\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Order Date\n $this->fieldsFactory()->create(SPL_T_DATETIME)\n ->identifier(\"created_at\")\n ->name(\"Date\")\n ->microData(\"http://schema.org/DataFeedItem\", \"dateCreated\")\n ->isReadOnly()\n ->isListed()\n ;\n }", "protected function _prepareColumns()\n {\n parent::_prepareColumns();\n\n $this->addColumn('attribute_code', array(\n 'header' => Mage::helper('eav')->__('Attribute Code'),\n 'sortable' => true,\n 'index' => 'attribute_code'\n ));\n\n $this->addColumn('frontend_label', array(\n 'header' => Mage::helper('eav')->__('Attribute Label'),\n 'sortable' => true,\n 'index' => 'frontend_label'\n ));\n }", "function prepareFields() {\r\n\t\t$data = array_keys($this->modx->getFieldMeta('msProductData'));\r\n\t\tforeach ($this->resourceArray as $k => $v) {\r\n\t\t\tif (is_array($v) && in_array($k, $data)) {\r\n\t\t\t\t$tmp = $this->resourceArray[$k];\r\n\t\t\t\t$this->resourceArray[$k] = array();\r\n\t\t\t\tforeach ($tmp as $v2) {\r\n\t\t\t\t\tif (!empty($v2)) {\r\n\t\t\t\t\t\t$this->resourceArray[$k][] = array('value' => $v2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (empty($this->resourceArray['vendor'])) {\r\n\t\t\t$this->resourceArray['vendor'] = '';\r\n\t\t}\r\n\t}", "protected function _setupTableName()\n {\n parent::_setupTableName();\t\t\n\t\t $this->_name = $this->getTableName(COMMENT); \n }", "private function _createTable() {\n $query = \"\n CREATE TABLE `seo_metadata` (\n `metadata_id` int(11) NOT NULL auto_increment,\n `seo_id` char(60) NOT NULL,\n `seo_title` varchar(255) NOT NULL,\n `seo_description` varchar(255) NOT NULL,\n `seo_keyword` varchar(255) NOT NULL,\n PRIMARY KEY (`metadata_id`),\n KEY `id_idx` (`id`)\n )\";\n $this->getAdapter()->query( $query );\n }", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\t$table_name \t = $this->table_name;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$query = \"CREATE TABLE {$table_name} (\n\t\t\tid bigint(10) NOT NULL AUTO_INCREMENT,\n\t\t\tname text NOT NULL,\n\t\t\tdate_created datetime NOT NULL,\n\t\t\tdate_modified datetime NOT NULL,\n\t\t\tstatus text NOT NULL,\n\t\t\tical_hash text NOT NULL,\n\t\t\tPRIMARY KEY id (id)\n\t\t) {$charset_collate};\";\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $query );\n\n\t}", "protected function insertTableFields( $p_fields = null ) {\n\t\t$fields = (object) $p_fields;\n\t\t// -----------------------------------------------------------------------------------------\n\t\t// Translate the field object into a column array for the table.\n\t\t// -----------------------------------------------------------------------------------------\n\t\t$return = $this->fields_to_columns($fields);\n\t\tif ( $return['status'] > 200 ) {\n\t\t\treturn $return;\n\t\t}\n\t\t$columns = $return['response'];\n\t\t// -----------------------------------------------------------------------------------------\n\t\t// Format column data with special needs ( gender, phone, email, . . .)\n\t\t// -----------------------------------------------------------------------------------------\n\t\t$return = $this->format_validate($columns);\n\t\tif ( $return['status'] > 200 ) {\n\t\t\treturn $return;\n\t\t}\n\t\t$columns = $return['response'];\n\n\t\treturn $this->insertTable($columns);\n\t}", "public function __construct() {\n parent::__construct();\n $this->tableName = \"variables2\";\n $this->table = \"erp_custom_fields\";\n }", "public function prepare_fields($fields, $type_name)\n {\n }", "public static function prepare($record) {\n $fieldRepo = Field::getRepository();\n /**\n * @var FieldEntity[] $fields\n */\n $fields = $fieldRepo->findBy(['is_hidden' => false, 'organisation' => Apollo::getInstance()->getUser()->getOrganisationId()]);\n /**\n * @var FieldEntity $field\n */\n foreach($fields as $field) {\n $record->findOrCreateData($field->getId());\n }\n }", "abstract public function prepareData();", "public function tableWizard() {}", "private function populateFieldsIntoTable(array $fieldDefList): void\n {\n foreach ( $fieldDefList as $fieldDef )\n {\n $field = null;\n\n switch ( trim($fieldDef->data_type) )\n {\n case self::T_BIGINT:\n case self::T_SMALLINT:\n case self::T_INTEGER:\n $field = $this->newIntegerField($fieldDef);\n break;\n\n case self::T_MONEY:\n case self::T_DOUBLE_PREC:\n case self::T_REAL:\n case self::T_NUMERIC:\n $field = $this->newNumericField($fieldDef);\n break;\n\n case self::T_CHAR:\n case self::T_TEXT:\n case self::T_VARCHAR:\n $field = $this->newCharacterField($fieldDef);\n break;\n\n case self::T_TIMESTAMP:\n case self::T_TIMESTAMP_TZ:\n case self::T_DATE:\n $field = $this->newDateField($fieldDef);\n break;\n\n case self::T_TIME_TZ:\n case self::T_TIME:\n $field = $this->newTimeField($fieldDef);\n break;\n\n // case self::T_ARRAY:\n // $field = $this->newArrayField($fieldDef);\n // break;\n\n case self::T_BOOL:\n $field = $this->newBooleanField($fieldDef);\n break;\n\n case self::T_ENUM:\n $field = $this->newEnumeratedField($fieldDef);\n break;\n\n case self::T_JSON:\n case self::T_JSONB:\n $field = $this->newJSONField($fieldDef);\n break;\n\n case self::T_XML:\n $field = $this->newXMLField($fieldDef);\n break;\n\n case self::T_POINT:\n $field = $this->newPointField($fieldDef);\n break;\n }\n\n if ( ! is_null($field) )\n {\n $this->table->addField($field);\n }\n }\n }", "protected function prepareTable($table)\r\n\t{\r\n\t\t$date = JFactory::getDate();\r\n\t\t$user = JFactory::getUser();\r\n\t\t\r\n\t\tif (isset($table->name))\r\n\t\t{\r\n\t\t\t$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($table->alias) && empty($table->alias))\r\n\t\t{\r\n\t\t\t$table->generateAlias();\r\n\t\t}\r\n\t\t\r\n\t\tif (empty($table->id))\r\n\t\t{\r\n\t\t\t$table->created = $date->toSql();\r\n\t\t\t// set the user\r\n\t\t\tif ($table->created_by == 0 || empty($table->created_by))\r\n\t\t\t{\r\n\t\t\t\t$table->created_by = $user->id;\r\n\t\t\t}\r\n\t\t\t// Set ordering to the last item if not set\r\n\t\t\tif (empty($table->ordering))\r\n\t\t\t{\r\n\t\t\t\t$db = JFactory::getDbo();\r\n\t\t\t\t$query = $db->getQuery(true)\r\n\t\t\t\t\t->select('MAX(ordering)')\r\n\t\t\t\t\t->from($db->quoteName('#__bigbluebutton_meeting'));\r\n\t\t\t\t$db->setQuery($query);\r\n\t\t\t\t$max = $db->loadResult();\r\n\r\n\t\t\t\t$table->ordering = $max + 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$table->modified = $date->toSql();\r\n\t\t\t$table->modified_by = $user->id;\r\n\t\t}\r\n \r\n\t\tif (!empty($table->id))\r\n\t\t{\r\n\t\t\t// Increment the items version number.\r\n\t\t\t$table->version++;\r\n\t\t}\r\n\t}", "function Prepare()\r\n\t{\r\n\t\tif (!$this->Active) return;\r\n\r\n\t\t$act = Server::GetState($this->Name.'_action');\r\n\r\n\t\tif ($this->sorting == ED_SORT_TABLE)\r\n\t\t\t$this->sort = array(Server::GetVar('sort', $this->ds->id) =>\r\n\t\t\t\tServer::GetVar('order', 'ASC'));\r\n\r\n\t\t$this->state = $act == 'edit' ? STATE_EDIT : STATE_CREATE;\r\n\r\n\t\tif ($act == 'Cancel') $this->Reset();\r\n\r\n\t\tif ($act == 'Create')\r\n\t\t{\r\n\t\t\t$insert = array();\r\n\t\t\t$child_id = Server::GetVar('child');\r\n\t\t\t$context = isset($child_id) ? $this->ds->children[$child_id] : $this;\r\n\r\n\t\t\t$fields = $context->ds->FieldInputs;\r\n\t\t\tforeach ($fields as $col => $in)\r\n\t\t\t{\r\n\t\t\t\tif (is_object($in))\r\n\t\t\t\t{\r\n\t\t\t\t\t$value = Server::GetVar($this->Name.'_'.$col);\r\n\t\t\t\t\tif ($in->attr('TYPE') == 'date')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$insert[$col] = date('Y-m-d', strtotime($value));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if($in->attr('TYPE') == 'datetime')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($value[5][0] == 1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//time is in PM\r\n\t\t\t\t\t\t\tif($value[3][0] != 12) $value[3][0] += 12;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$time_portion = \" {$value[3][0]}:{$value[4][0]}:00\";\r\n\t\t\t\t\t\t$insert[$col] = $value[2].'-'.$value[0].'-'.$value[1].$time_portion;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'password' && strlen($value) > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$insert[$col] = md5($value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'file')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (empty($value['tmp_name'])) continue;\r\n\t\t\t\t\t\t$ext = strrchr($value['name'], '.');\r\n\r\n\t\t\t\t\t\t# We move files later because we do not have enough\r\n\t\t\t\t\t\t# data to decide where to put them or what to name them.\r\n\r\n\t\t\t\t\t\t$files[] = array(\r\n\t\t\t\t\t\t\t'src' => $value['tmp_name'],\r\n\t\t\t\t\t\t\t'dst' => $in->attr('VALUE')\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t//$insert[$col] = $ext;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'selects') $insert[$col] = $value;\r\n\t\t\t\t\telse $insert[$col] = $value;\r\n\t\t\t\t}\r\n\t\t\t\telse if (is_numeric($col)) continue;\r\n\t\t\t\telse $insert[$col] = Database::SqlUnquote($in);\r\n\t\t\t\t//I just changed this to 'else' (check the history), because a\r\n\t\t\t\t//numeric value with a string column would not go in eg. 5\r\n\t\t\t\t//instead of '5', if this ends up conflicting, we'll need to\r\n\t\t\t\t//come up with a different solution.\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t{\r\n\t\t\t\tif (!$handler->Create($this, $insert)) { $this->Reset(); return; }\r\n\t\t\t}\r\n\r\n\t\t\t$parent = Server::GetVar('parent');\r\n\r\n\t\t\tif (isset($parent))\r\n\t\t\t{\r\n\t\t\t\t$child = $this->ds->children[Server::GetVar('child')];\r\n\t\t\t\t$insert[$child->child_key] = $parent;\r\n\t\t\t}\r\n\r\n\t\t\t$id = $context->ds->Add($insert);\r\n\t\t\t$insert[$context->ds->id] = $id;\r\n\r\n\t\t\t# Handle all uploads\r\n\r\n\t\t\tif (!empty($files))\r\n\t\t\t{\r\n\t\t\t\t$vp = new VarParser();\r\n\t\t\t\tforeach ($files as $file)\r\n\t\t\t\t{\r\n\t\t\t\t\t# Handler associated\r\n\t\t\t\t\tif (is_object($file['dst']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$file['dst']->Create($file['src'], $insert);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse # Move uploaded file\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$dst = $vp->ParseVars($file['dst'], $insert);\r\n\t\t\t\t\t\tmove_uploaded_file($file['src'], $dst);\r\n\t\t\t\t\t\tchmod($dst, 0777);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t\t$handler->Created($this, $id, $insert);\r\n\r\n\t\t\t$this->Reset();\r\n\t\t}\r\n\r\n\t\telse if ($act == 'Update')\r\n\t\t{\r\n\t\t\t$ci = Server::GetVar('ci');\r\n\r\n\t\t\tif ($this->type == CONTROL_SIMPLE)\r\n\t\t\t{\r\n\t\t\t\tforeach (array_keys($this->ds->FieldInputs) as $name)\r\n\t\t\t\t{\r\n\t\t\t\t\t$vals[$name] = Server::GetVar($name);\r\n\t\t\t\t}\r\n\t\t\t\t$fp = fopen($ci, 'w+');\r\n\t\t\t\tfwrite($fp, serialize($vals));\r\n\t\t\t\tfclose($fp);\r\n\t\t\t}\r\n\t\t\t$child_id = Server::GetVar('child');\r\n\t\t\t$context = $child_id != null ? $this->ds->children[$child_id] : $this;\r\n\t\t\t$update = array();\r\n\t\t\tforeach ($context->ds->FieldInputs as $col => $in)\r\n\t\t\t{\r\n\t\t\t\tif (is_object($in))\r\n\t\t\t\t{\r\n\t\t\t\t\tif (get_class($in) == 'FieldInput' && $in->type == 'label') continue;\r\n\r\n\t\t\t\t\t$value = Server::GetVar($this->Name.'_'.$col);\r\n\r\n\t\t\t\t\tif ($in->attr('TYPE') == 'date')\r\n\t\t\t\t\t\t$update[$col] = date('Y-m-d', strtotime($value));\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'datetime')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($value[5][0] == 1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//time is in PM\r\n\t\t\t\t\t\t\tif ($value[3][0] != 12) $value[3][0] += 12;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$time_portion = \" {$value[3][0]}:{$value[4][0]}:00\";\r\n\t\t\t\t\t\t$update[$col] = $value[2].'-'.$value[0].'-'.$value[1].$time_portion;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'label')\r\n\t\t\t\t\t\tunset($update[$col]);\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'password')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (!empty($value)) $update[$col] = md5($value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'checkbox')\r\n\t\t\t\t\t\t$update[$col] = ($value == 1) ? 1 : 0;\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'selects')\r\n\t\t\t\t\t\t$update[$col] = $value;\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'file')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (!empty($value['tmp_name']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$vp = new VarParser();\r\n\t\t\t\t\t\t\t$src = $value['tmp_name'];\r\n\t\t\t\t\t\t\t$vars = $update;\r\n\t\t\t\t\t\t\t$vars[$this->ds->id] = $ci;\r\n\t\t\t\t\t\t\t$val = $in->attr('VALUE');\r\n\r\n\t\t\t\t\t\t\t# File Handler\r\n\t\t\t\t\t\t\tif (is_object($val)) $val->Update($src, $vars);\r\n\t\t\t\t\t\t\telse # String Based\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$dst = $vp->ParseVars($val, $vars);\r\n\t\t\t\t\t\t\t\tmove_uploaded_file($src, $dst);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tunset($update[$col]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse $update[$col] = $value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (count($this->handlers) > 0)\r\n\t\t\t{\r\n\t\t\t\t$q['match'][$this->ds->id] = $ci;\r\n\t\t\t\t$data = $this->ds->GetOne($q);\r\n\t\t\t\t$update[$this->ds->id] = $ci;\r\n\t\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t\t{\r\n\t\t\t\t\t$res = $handler->Update($this, $ci, $data, $update);\r\n\t\t\t\t\t// Returns false, simple failure.\r\n\t\t\t\t\tif (!$res) { $this->Reset(); return; }\r\n\t\t\t\t\t// Returns an array of errors.\r\n\t\t\t\t\tif (is_array($res))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->state = STATE_EDIT;\r\n\t\t\t\t\t\t$this->Errors = $res;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ($this->type == CONTROL_BOUND)\r\n\t\t\t\t$context->ds->Update(array($context->ds->id => $ci), $update);\r\n\r\n\t\t\t$this->Reset();\r\n\t\t}\r\n\r\n\t\telse if ($act == 'delete')\r\n\t\t{\r\n\t\t\t$ci = Server::GetState($this->Name.'_ci');\r\n\r\n\t\t\t$child_id = Server::GetVar('child');\r\n\t\t\t$context = isset($child_id) ? $this->ds->children[$child_id] : $this;\r\n\r\n\t\t\t$data = $context->ds->GetOne(array($context->ds->id => $ci));\r\n\r\n\t\t\tif (count($this->handlers) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!$handler->Delete($this, $ci, $data)) return;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!empty($context->ds->FieldInputs))\r\n\t\t\tforeach ($context->ds->FieldInputs as $name => $in)\r\n\t\t\t{\r\n\t\t\t\tif (is_object($in) && strtolower(get_class($in)) == 'forminput')\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($in->attr('TYPE') == 'file')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$vp = new VarParser();\r\n\t\t\t\t\t\t$val = $in->attr('VALUE');\r\n\t\t\t\t\t\t# File handler\r\n\t\t\t\t\t\tif (is_object($val))\r\n\t\t\t\t\t\t\t$val->Delete($data);\r\n\t\t\t\t\t\telse # Regular string file\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$files = glob($vp->ParseVars($val, $data).\".*\");\r\n\t\t\t\t\t\t\tforeach ($files as $file) unlink($file);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$context->ds->Remove(array($context->ds->id => $ci));\r\n\t\t}\r\n\r\n\t\tif ($this->type == CONTROL_SIMPLE)\r\n\t\t{\r\n\t\t\t$ci = Server::GetState($this->Name.'_ci');\r\n\r\n\t\t\tif (file_exists($ci))\r\n\t\t\t\t$this->values = unserialize(file_get_contents($ci));\r\n\t\t\telse\r\n\t\t\t\t$this->values = array();\r\n\t\t}\r\n\t}", "static function setUpColumns($columns)\n {\n $columns->id = Column::AUTO_ID;\n $columns->type = Column::STRING;\n $columns->text = Column::STRING + Column::NOT_NULL;\n }", "protected function prepareData()\n {\n parent::prepareData();\n $this->prepareConfigurableProductOptions();\n $this->prepareAttributeSet();\n }", "public static function createTable(){\n if (RBModel::recreateTable(get_called_class()) == false){\n return;\n }\n\n $bean = R::dispense( strtolower(get_called_class()));\n $fields = get_class_vars(get_called_class());\n \n foreach( $fields as $field=>$value){\n\n \n //ignora as variaveis que começam com _\n if ($field[0] == \"_\" || $field == \"id\"){\n continue;\n }\n\n $r = new ReflectionProperty(get_called_class(), $field);\n $comment = strtolower($r->getDocComment());\n\n if (strstr($comment,\"@varchar\")){\n $value = \"\";\n } else\n if (strstr($comment,\"@int\")){\n $value = 0;\n } else\n if (strstr($comment,\"@date\")){\n $value = \"1990-01-01\";\n } else\n if (strstr($comment,\"@datetime\")){\n $value = \"1990-01-01 00:00:00\";\n } else\n if (strstr($comment,\"@double\")){\n $value = 0.0;\n } else\n if (strstr($comment,\"@bool\")){\n $value = false;\n } else\n if (strstr($comment,\"@money\")){\n $value = \"10.00\";\n }\n \n \n $bean->$field = $value;\n }\n \n R::store($bean);\n R::trash($bean);\n }", "protected function prepareFields($fields)\n {\n \t$fields = array_merge([\n Select::make(__('State'), 'state_id')->options(function() {\n return State::newModel()->get()->keyBy->getKey()->map->name->sort()->all();\n })\n ->required()\n ->rules('required')\n ->onlyOnForms(), \n\n ChildSelect::make(__('City'), 'city_id')->options(function ($state) { \n return City::newModel()->whereHas('state', function($query) use ($state) {\n $query->whereKey($state);\n })->get()->keyBy->getKey()->map->name->sort()->all();\n })\n ->parent('state_id')\n ->required()\n ->rules('required')\n ->onlyOnForms(),\n\n ChildSelect::make(__('Property zone'), 'zone_id')->options(function ($city) { \n return Zone::newModel()->whereHas('city', function($query) use ($city) {\n $query->whereKey($city);\n })->get()->keyBy->getKey()->map->name->sort()->all();\n })\n ->parent('city_id')\n ->required()\n ->rules('required')\n ->onlyOnForms(),\n\n BelongsTo::make(__('State'), 'state', State::class)\n ->onlyOnDetail(),\n\n BelongsTo::make(__('City'), 'city', City::class)\n ->onlyOnDetail(),\n\n BelongsTo::make(__('Zone'), 'zone', Zone::class)\n ->onlyOnDetail(),\n\n Targomaan::make([\n Text::make(__('Property Address'), 'address')\n ->nullable()\n ->rules('nullable', 'max:250'),\n ]), \n\n MapMarker::make(__('Google Location'), 'location')\n ->defaultZoom(16)\n ->defaultLatitude(29.609043426461)\n ->defaultLongitude(52.519180021444)\n ->latitude('lat')\n ->longitude('long')\n ->centerCircle(10, 'red', 1, .5),\n ], $fields);\n\n return parent::prepareFields($fields);\n }", "static function setUpColumns($columns)\n {\n $columns->id = Column::AUTO_ID;\n $columns->oneId = OneABBR::columns()->id;\n $columns->createdAt = Column::TIMESTAMP;\n $columns->updatedAt = Column::TIMESTAMP;\n $columns->info = Column::create(Column::STRING)->setIndexed();\n }", "public function prepare_fields($fields, $type_name, $config)\n {\n }", "protected function prepareForValidation()\n {\n $this->merge([\n 'nome' => $this->nome,\n 'nascimento' => convertDateToDatabase($this->nascimento),\n 'cpf' => returnOnlyNumbers($this->cpf),\n 'email' => $this->email,\n ]);\n }", "public function initTable(){\n\t\t\t\n\t\t}", "private function prepareData($fields) {\n \n $insertData = array();\n \n foreach ($fields as $field) {\n if ($this->notManyToManyRelation($field)) {\n \n if($field->multiLanguage) {\n $name = getLocalizedFieldName($field->name);\n } else {\n $name = $field->name;\n }\n $insertData[$name] = $field->value;\n }\n if ($field instanceof PasswordField) {\n $insertData[$field->name] = md5($field->value);\n }\n }\n // auto generated unique id\n unset($insertData[\"id\"]);\n return $insertData;\n }", "protected function _initialize()\r\n {\r\n $this->metadata()->setTablename('funcionario');\r\n $this->metadata()->setPackage('system.application.models.dao');\r\n \r\n # nome_do_membro, nome_da_coluna, tipo, comprimento, opcoes\r\n \r\n $this->metadata()->addField('id', 'id', 'int', 11, array('primary' => true, 'notnull' => true, 'autoincrement' => true));\r\n $this->metadata()->addField('nome', 'nome', 'varchar', 255, array());\r\n $this->metadata()->addField('login', 'login', 'varchar', 45, array());\r\n $this->metadata()->addField('senha', 'senha', 'varchar', 255, array());\r\n $this->metadata()->addField('email', 'email', 'varchar', 255, array());\r\n $this->metadata()->addField('lotacao', 'lotacao', 'varchar', 45, array());\r\n\r\n \r\n }", "private function createTables()\n {\n $this->createConfigsTable();\n $this->createServersTable();\n $this->createSearchesTable();\n }", "function create_table($table_name, $field_name, $field_type, $field_length){\n // $sql_chk = db::query(\"SELECT COUNT(*) AS TOTAL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG='\".strtoupper(db::$_dbName).\"' AND TABLE_NAME = '\".$table_name.\"'\");\n // $rec_chk = db::fetch_array($sql_chk);\n // if($rec_chk['TOTAL'] > 0)\n // {\n // echo \"<script>alert('ตาราง \".$table_name.\" ถูกใช้งานแล้ว กรุณาตรวจสอบ'); window.location.href='\".$_SERVER['HTTP_REFERER'].\"';</script>\";\n // db::db_close();\n // exit;\n // }\n\n $field_length = $field_length == \"\" ? \"\" : \"(\".$field_length.\")\";\n\n $sql_create = \" CREATE TABLE [dbo].[\".$table_name.\"]([\".$field_name.\"] \".$field_type.\" \".$field_length.\" NOT NULL, PRIMARY KEY ([\".$field_name.\"]))\";\n\n }", "public function prepareVars()\n {\n if ($this->showLogRelations !== null) {\n $this->showLogRelations = (array) $this->showLogRelations;\n }\n\n $this->vars['name'] = $this->formField->getName();\n $this->vars['model'] = $this->model;\n $this->vars['showUndoChangesButton'] = $this->showUndoChangesButton;\n }", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n\t\tif ( $wpdb->get_var( \"SHOW TABLES LIKE '$this->table_name'\" ) == $this->table_name ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$sql = \"CREATE TABLE \" . $this->table_name . \" (\n\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\n\t\tuser_id bigint(20) NOT NULL,\n\t\tusername varchar(50) NOT NULL,\n\t\temail varchar(50) NOT NULL,\n\t\tname mediumtext NOT NULL,\n\t\tproduct_count bigint(20) NOT NULL,\n\t\tsales_value mediumtext NOT NULL,\n\t\tsales_count bigint(20) NOT NULL,\n\t\tstatus mediumtext NOT NULL,\n\t\tnotes longtext NOT NULL,\n\t\tdate_created datetime NOT NULL,\n\t\tPRIMARY KEY (id),\n\t\tUNIQUE KEY email (email),\n\t\tKEY user (user_id)\n\t\t) CHARACTER SET utf8 COLLATE utf8_general_ci;\";\n\n\t\tdbDelta( $sql );\n\n\t\tupdate_option( $this->table_name . '_db_version', $this->version );\n\t}", "protected function _initAllFIeld() \n\t{\n\t\t$sql = 'select COLUMN_NAME from information_schema.COLUMNS where table_name = \"' . $this->table.'\"\n\t\t\t\tAND `TABLE_SCHEMA`=\"'. $this->db .'\";';\n\n\t\t$this->_fields = array_column($this->_getSelectResult($sql), 'COLUMN_NAME');\n\t}", "public function createTable()\n\t{\n\t\t$table = $this->getTableName();\n\t\t$indexes = $this->defineIndexes();\n\t\t$columns = array();\n\n\t\t// Add any Foreign Key columns\n\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t{\n\t\t\t$required = !empty($config['required']);\n\t\t\t$columns[$config[2]] = array('column' => ColumnType::Int, 'required' => $required);\n\n\t\t\t// Add unique index for this column?\n\t\t\t// (foreign keys already get indexed, so we're only concerned with whether it should be unique)\n\t\t\tif (!empty($config['unique']))\n\t\t\t{\n\t\t\t\t$indexes[] = array('columns' => array($config[2]), 'unique' => true);\n\t\t\t}\n\t\t}\n\n\t\t// Add all other columns\n\t\tforeach ($this->defineAttributes() as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\n\t\t\t// Add (unique) index for this column?\n\t\t\t$indexed = !empty($config['indexed']);\n\t\t\t$unique = !empty($config['unique']);\n\n\t\t\tif ($unique || $indexed)\n\t\t\t{\n\t\t\t\t$indexes[] = array('columns' => array($name), 'unique' => $unique);\n\t\t\t}\n\n\t\t\t$columns[$name] = $config;\n\t\t}\n\n\t\t// Create the table\n\t\tblx()->db->createCommand()->createTable($table, $columns);\n\n\t\t// Create the indexes\n\t\tforeach ($indexes as $index)\n\t\t{\n\t\t\t$columns = ArrayHelper::stringToArray($index['columns']);\n\t\t\t$unique = !empty($index['unique']);\n\t\t\t$name = \"{$table}_\".implode('_', $columns).($unique ? '_unique' : '').'_idx';\n\t\t\tblx()->db->createCommand()->createIndex($name, $table, implode(',', $columns), $unique);\n\t\t}\n\t}", "protected function buildTimestampFields(): void\n {\n //====================================================================//\n // Creation Date\n $this->fieldsFactory()->create(SPL_T_DATETIME)\n ->identifier(\"createdAt\")\n ->name(\"Created\")\n ->group(\"Meta\")\n ->microData(\"http://schema.org/DataFeedItem\", \"dateCreated\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Last Change Date\n $this->fieldsFactory()->create(SPL_T_DATETIME)\n ->identifier(\"updatedAt\")\n ->name(\"Updated\")\n ->group(\"Meta\")\n ->microData(\"http://schema.org/DataFeedItem\", \"dateModified\")\n ->isReadOnly()\n ;\n }", "protected function setDbalInputFieldsToRender() {}", "private function initDbFieldTables($init_params) {\n // Fail because 'parentDbFieldTable' or 'childDbFieldTable' already exists\n assert(!isset($this->parentDbFieldTable) && !isset($this->childDbFieldTable));\n\n // Initialize parent db field table\n $this->parentDbFieldTable = self::genParentDbFieldTableTemplate();\n $this->bindValuesToDbTable($init_params, $this->parentDbFieldTable);\n\n // Initialize child db field table\n $this->childDbFieldTable = static::genChildDbFieldTable($init_params);\n }", "private function _set_fields()\n {\n @$this->form_data->survey_id = 0;\n $this->form_data->survey_title = '';\n $this->form_data->survey_description = '';\n $this->form_data->survey_status = 'open';\n $this->form_data->survey_anms = 'yes';\n $this->form_data->survey_expiry_date = '';\n $this->form_data->question_ids = array();\n\n $this->form_data->filter_survey_title = '';\n $this->form_data->filter_status = '';\n }", "private function load_columns_information() {\n $query = \"SELECT ordinal_position,\n column_name,\n data_type,\n is_nullable::boolean::integer\n FROM information_schema.columns\n WHERE table_schema = 'public'\n AND table_name = '{$this->get_table_name()}';\";\n $this->columns_information = DB::fetch_all($query);\n\n // Cria os campos da tabela no objeto corrente\n foreach($this->columns_information as $column) {\n $this->$column['column_name'] = null;\n $this->{'_' . $column['column_name']} = null;\n }\n }", "function __initTransSchema() {\n\t\t$fields = $this->settings[$this->model->alias]['fields'];\n\t\t$primary = $this->model->primaryKey;\n\t\t$results = array();\n\t\t$schema = $this->model->_schema;\n\t\t$results = am($results, $this->__setSchemaField($primary, $schema[$primary]));\n\t\tforeach ($schema as $fieldname => $descArray) {\n\t\t\tif (!empty($fields)) {\n\t\t\t\tif (array_key_exists($fieldname, $fields)) {\n\t\t\t\t\t$results = am($results, $this->__setSchemaField($fieldname, $descArray));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($fieldname !== $primary) {\n\t\t\t\t\t$results = am($results, $this->__setSchemaField($fieldname, $descArray));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->__transSchema = $results;\n\t}", "protected function _prepareColumns()\n {\n $this->addColumn('hourbelt_id', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('ID'),\n 'width' => '50px',\n 'index' => 'hourbelt_id',\n ));\n\n $this->addColumn('name', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Nombre Franja'),\n 'index' => 'name',\n ));\n\n $this->addColumn('start', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Hora Inicio'),\n 'index' => 'start',\n ));\n\n $this->addColumn('finish', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Hora Fin'),\n 'index' => 'finish',\n ));\n\n return parent::_prepareColumns();\n }" ]
[ "0.7561982", "0.7187256", "0.70173806", "0.69331765", "0.6853927", "0.68362314", "0.682143", "0.6810845", "0.6804216", "0.6694266", "0.6557606", "0.6472645", "0.6404355", "0.6376897", "0.63358164", "0.6272882", "0.62642586", "0.6234991", "0.61894464", "0.6179652", "0.6174749", "0.6153646", "0.61536264", "0.6152408", "0.61410534", "0.6124498", "0.6116816", "0.6080059", "0.60735524", "0.6065123", "0.60635877", "0.60619146", "0.60619104", "0.60417235", "0.60295516", "0.60268044", "0.60111994", "0.6009503", "0.6007035", "0.6004942", "0.60035586", "0.599035", "0.5984093", "0.59759885", "0.5968471", "0.59678775", "0.5947461", "0.5944369", "0.59233683", "0.59168684", "0.59107304", "0.59095854", "0.5907916", "0.59042305", "0.5903992", "0.5900513", "0.58931154", "0.5887755", "0.5881576", "0.58611226", "0.58599627", "0.5857099", "0.58522046", "0.58504874", "0.58256954", "0.58243465", "0.5824233", "0.58140326", "0.58053297", "0.58008575", "0.5800393", "0.5787989", "0.578473", "0.57840574", "0.5781589", "0.57736313", "0.5766018", "0.5755107", "0.57544136", "0.5753703", "0.5753546", "0.5753543", "0.57458675", "0.57433045", "0.5739302", "0.573792", "0.5736281", "0.5733741", "0.57288295", "0.5722801", "0.5721189", "0.5721004", "0.56989723", "0.56918466", "0.5682971", "0.56816447", "0.5677319", "0.56758416", "0.5674883", "0.5673965" ]
0.64188796
12
Drops all tables in database
private static function _dropTables() { MySQL::query(" SET FOREIGN_KEY_CHECKS = 0; SET GROUP_CONCAT_MAX_LEN=32768; SET @views = NULL; SELECT GROUP_CONCAT('`', TABLE_NAME, '`') INTO @views FROM information_schema.views WHERE table_schema = (SELECT DATABASE()); SELECT IFNULL(@views,'dummy') INTO @views; SET @views = CONCAT('DROP VIEW IF EXISTS ', @views); PREPARE stmt FROM @views; EXECUTE stmt; DEALLOCATE PREPARE stmt; SET FOREIGN_KEY_CHECKS = 1; "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dropAllTables()\n {\n $this->connection->statement($this->grammar->compileDropAllForeignKeys());\n\n $this->connection->statement($this->grammar->compileDropAllTables());\n }", "protected function dropDatabaseTables()\n {\n $this->useCamundaDatabase(function() {\n if ($tables = DB::select('SHOW TABLES')) {\n $this->line('Dropping existing database tables...');\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n foreach ($tables as $table) {\n $array = get_object_vars($table);\n Schema::drop($array[key($array)]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n\n $this->info('All tables dropped.');\n }\n });\n }", "public function dropAllTables()\n {\n $tables = [];\n\n foreach ($this->getAllTables() as $row) {\n $row = (array)$row;\n\n $tables[] = reset($row);\n }\n\n if (empty($tables)) {\n return;\n }\n\n $this->disableForeignKeyConstraints();\n\n $this->getConnection()->statement(\n $this->grammar->compileDropAllTables($tables)\n );\n\n $this->enableForeignKeyConstraints();\n }", "public function dropAllTables()\n {\n $tables = [];\n\n $excludedTables = $this->connection->getConfig('dont_drop') ?? ['spatial_ref_sys'];\n\n foreach ($this->getAllTables() as $row) {\n $row = (array) $row;\n\n $table = reset($row);\n\n if (! in_array($table, $excludedTables)) {\n $tables[] = $table;\n }\n }\n\n if (empty($tables)) {\n return;\n }\n\n $this->connection->statement(\n $this->grammar->compileDropAllTables($tables)\n );\n }", "public function dropAllTables()\n {\n $tables = [];\n\n $excludedTables = $this->connection->getConfig('dont_drop') ?? ['spatial_ref_sys'];\n\n foreach ($this->getAllTables() as $row) {\n $row = (array) $row;\n\n $table = reset($row);\n\n if (! in_array($table, $excludedTables)) {\n $tables[] = $table;\n }\n }\n\n if (empty($tables)) {\n return;\n }\n\n $this->connection->statement(\n $this->grammar->compileDropAllTables($tables)\n );\n }", "public function deleteTables()\n {\n $db = Core::$db;\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_forms\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_form_placeholders\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_form_templates\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_templates\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_sets\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_set_placeholders\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_set_placeholder_opts\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_set_resources\");\n $db->execute();\n }", "private function delete_tables()\n {\n global $wpdb;\n\n // this needs to occur at this level, and not in the\n foreach ($this->tables as $tablename) {\n $sql = 'DROP TABLE IF EXISTS ' . $tablename;\n $wpdb->query($sql);\n }\n }", "public function deleteTables () {\n $this->usersDB->deleteTables();\n $this->categoriesDB->deleteTables();\n $this->itemsDB->deleteTables();\n }", "public function wipeAll() {\n\t\tforeach($this->getTables() as $t) {\n\t\t\tforeach($this->getKeys($t) as $k) {\n\t\t\t\t$this->adapter->exec(\"ALTER TABLE \\\"{$k['FKTABLE_NAME']}\\\" DROP FOREIGN KEY \\\"{$k['FK_NAME']}\\\"\");\n\t\t\t}\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t\tforeach($this->getTables() as $t) {\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t}", "function drop_all_tables($db)\n{\n $db->query(\"SET foreign_key_checks = 0\");\n\n if ($result = $db->query(\"SHOW TABLES\")) {\n while ($row = $result->fetch_array(MYSQLI_NUM)) {\n $db->query(\"DROP TABLE IF EXISTS \" . $row[0]);\n }\n }\n\n $db->query(\"SET foreign_key_checks = 1\");\n}", "public function dropAllTables()\n {\n throw new LogicException('This database driver does not support dropping all tables.');\n }", "public function deleteTables()\n {\n Artisan::call('db:wipe');\n Artisan::call('migrate');\n\n }", "private function purgeTables()\n\t{\t\n\t\t$this->db->query(\"DELETE FROM categories\");\n\t\t$this->db->query(\"DELETE FROM album_art\");\n\t\t$this->db->query(\"TRUNCATE TABLE albums\");\n\t\t\n\t}", "public function delete_tables()\n\t{\n\t\tglobal $wpdb;\n\t\t$wpdb->query( 'DROP TABLE '.self::$site_table.';' );\n\t}", "public function dropAllData()\n {\n $database_name = $this->conn->getDatabase();\n\n $tables = $this->conn->query(\"SELECT concat('DROP TABLE IF EXISTS ', table_name, ';') FROM information_schema.tables WHERE table_schema = '$database_name';\")->fetchAll();\n\n $queries = \"SET FOREIGN_KEY_CHECKS=0;\\n\";\n\n foreach ($tables as $aTable){\n $queries .= reset($aTable);\n }\n\n $this->conn->executeQuery($queries);\n\n $editora_structure = file_get_contents(__DIR__ .'/../../../../data/editora.sql');\n\n $this->conn->executeQuery($editora_structure);\n }", "public function truncateTables()\n {\n $tables = [\n 'properties',\n 'users',\n ];\n\n DB::unprepared('TRUNCATE TABLE ' . implode(',', $tables) . ' RESTART IDENTITY CASCADE');\n }", "function dropOldTables(Sqlite3 $db)\n{\n\t$drop_script = \"DROP TABLE \";\n\tforeach (['airports', 'carriers', 'statistics', 'statistics_flights', 'statistics_delays', 'statistics_minutes_delayed'] as $table_name) {\n\t //echo \"\\tDropping \" . $table_name . PHP_EOL;\n\t $db->query($drop_script . $table_name);\n\t}\n\t//echo 'Done.' . PHP_EOL;\n}", "public function actionDrop()\n {\n $dbName = Yii::$app->db->createCommand('SELECT DATABASE()')->queryScalar();\n if ($this->confirm('This will drop all tables of current database [' . $dbName . '].')) {\n Yii::$app->db->createCommand(\"SET foreign_key_checks = 0\")->execute();\n $tables = Yii::$app->db->schema->getTableNames();\n foreach ($tables as $table) {\n $this->stdout('Dropping table ' . $table . PHP_EOL, Console::FG_RED);\n Yii::$app->db->createCommand()->dropTable($table)->execute();\n }\n Yii::$app->db->createCommand(\"SET foreign_key_checks = 1\")->execute();\n }\n }", "function delete() {\n\t\t$sqlStatements = array();\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS tags\";\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS siteViews\";\n\t\texecuteSqlStatements($sqlStatements);\n\t}", "public function uninstall(){\n MergeRequestComment::dropTable();\n MergeRequest::dropTable();\n CommitCache::dropTable();\n Repo::dropTable();\n Project::dropTable();\n }", "public function clearDb ()\n {\n // Empty tables and reset auto-increment values\n $this->_dbh->query('SET FOREIGN_KEY_CHECKS = 0');\n foreach (self::$dbTables as $table) {\n $stmt = $this->_dbh->prepare('TRUNCATE `' . $table . '`');\n $stmt->execute();\n $stmt = $this->_dbh->prepare('ALTER TABLE `' . $table . '` AUTO_INCREMENT = 1');\n $stmt->execute();\n }\n // Re-enable checks only if set as such in config\n $config = parse_ini_file('config/AcToBs.ini', true);\n if (isset($config['checks']['fk_constraints']) && $config['checks']['fk_constraints'] == 1) {\n $this->_dbh->query('SET FOREIGN_KEY_CHECKS = 1');\n }\n // Delete denormalized tables\n foreach (self::$dbDenormalizedTables as $table) {\n $stmt = $this->_dbh->prepare('DROP TABLE IF EXISTS `' . $table . '`');\n $stmt->execute();\n }\n // Delete non-standard taxonomic ranks\n $stmt = $this->_dbh->prepare(\n 'DELETE FROM `taxonomic_rank` WHERE `standard` = ?');\n $stmt->execute(array(\n 0\n ));\n unset($stmt);\n }", "public static function dropTables()\n\t{\n\t}", "private function cleanDatabase()\n {\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach($this->tables as $table)\n {\n\n DB::table($table)->truncate();\n\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n\n\n }", "function dropTables(Doctrine\\DBAL\\Connection $connection)\n{\n $connection->query('SET FOREIGN_KEY_CHECKS=0');\n foreach ($connection->getSchemaManager()->listTableNames() as $table) {\n $connection->getSchemaManager()->dropTable($table);\n }\n $connection->query('SET FOREIGN_KEY_CHECKS=1');\n}", "public function cleanupDatabase() {\n\t\t\tif ( !$this->getTableExists() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$sQuery = \"\n\t\t\t\tDELETE from `%s`\n\t\t\t\tWHERE\n\t\t\t\t\t`day_id`\t\t\t!= '0'\n\t\t\t\t\tAND `created_at`\t< '%s'\n\t\t\t\";\n\t\t\t$sQuery = sprintf( $sQuery,\n\t\t\t\t$this->getTableName(),\n\t\t\t\t( $this->loadDP()->time() - 31*DAY_IN_SECONDS )\n\t\t\t);\n\t\t\t$this->loadDbProcessor()->doSql( $sQuery );\n\t\t}", "public function deleteAll()\n {\n $query = 'TRUNCATE TABLE `'. $this->getTableName() .'`';\n $this->db->sql_query($query);\n }", "public function clear_tables()\n\t{\n\t\tglobal $wpdb;\n\t\t$wpdb->query( 'DELETE FROM '.self::$site_table.';' );\n\t}", "protected function dropDatabaseTable(): void\n {\n /** @var Connection $connection */\n $connection = $this->container->get(Connection::class);\n\n if (method_exists($connection, 'executeStatement')) {\n $connection->executeStatement('SET FOREIGN_KEY_CHECKS=0;');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_order`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_serial`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_media`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_download_history`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_video`');\n $connection->executeStatement('ALTER TABLE `product` DROP COLUMN `esd`');\n $connection->executeStatement('SET FOREIGN_KEY_CHECKS=1;');\n } else {\n $connection->exec('SET FOREIGN_KEY_CHECKS=0;');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_order`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_serial`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_media`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_download_history`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_video`');\n $connection->exec('ALTER TABLE `product` DROP COLUMN `esd`');\n $connection->exec('SET FOREIGN_KEY_CHECKS=1;');\n }\n }", "function clear() {\n\n switch ($this->type) {\n case 'sqlite':\n case 'mysql':\n $query[0] = 'DROP TABLE `enrolled`;';\n\n $query[1] = 'DROP TABLE `paid`;';\n\n $query[2] = 'DROP TABLE `admin`;';\n\n $query[3] = 'DROP TABLE `log`';\n\n $query[4] = 'DROP TABLE `stage`';\n\n\t\t\t\t$query[5] = 'DROP TABLE `guest`';\n\n break;\n\n default:\n throw new Exception($this->type . \" is not a valid database type.\");\n break;\n\n }\n\n foreach ($query as $drop) {\n $this->query($drop);\n }\n\n /**\n * Integrity Checking goes here\n */\n\n }", "public function tearDown()\n {\n $this->schema()->drop('users');\n $this->schema()->drop('users32');\n $this->schema()->drop('usersb');\n $this->schema()->drop('posts');\n $this->schema()->drop('posts32');\n $this->schema()->drop('postsb');\n $this->schema()->drop('rolesb');\n $this->schema()->drop('roles32');\n $this->schema()->drop('user32_role32');\n $this->schema()->drop('userb_roleb');\n }", "protected static function dropTable(): void\n {\n $pdo = static::getDb();\n $pdo->query('DROP TABLE IF EXISTS ' . Store\\MySQL::DEFAULT_TABLE);\n }", "public function destroy() {\n $this->connection->schema()->dropTable($this->mapTable);\n $this->connection->schema()->dropTable($this->messageTable);\n }", "private function dropAndCreateTables(){\n \n $migration = new MikeMigration($this::genPrefix(10));\n $save = 0;\n\n // Prepare Dropped Tables\n if($this->droppedTables){\n $save++;\n foreach($this->droppedTables as $item){\n\n $migration->up(\"\\t\\t\" . 'Schema::dropIfExists(\"'.$this->appPrefix.'_'.$item[\"name\"].'\"); ');\n\n $migration->down($this::prepareTableBlueprint($item));\n\n \n // Delete Model\n Storage::disk('models')->delete($this->appNamePath.'/'.$item[\"name\"].'.php');\n // Delete Controller\n Storage::disk('controllers')->delete($this->appNamePath.'/'.$item[\"name\"].'Controller.php');\n // Delete Routes\n //...\n\n }\n }\n // Prepare New Tables \n if($this->newTables){\n $save++;\n foreach($this->newTables as $item){\n\n\n $migration->up($this::prepareTableBlueprint($item));\n\n $migration->down(\"\\t\\t\" . 'Schema::dropIfExists(\"'.$this->appPrefix.'_'.$item[\"name\"].'\"); ');\n\n }\n }\n // If Exist Dropped pr New Tables \n if($save > 0){\n $migration->save();\n }\n \n\n\n }", "public function afterTearDown()\n {\n $this->schema()->dropIfExists('users');\n $this->schema()->dropIfExists('friends');\n $this->schema()->dropIfExists('posts');\n $this->schema()->dropIfExists('comments');\n $this->schema()->dropIfExists('photos');\n $this->schema()->dropIfExists('invalid_kids');\n $this->schema()->dropIfExists('profiles');\n }", "protected function _clearSchema()\n {\n\n // Show all tables in the installation.\n foreach (get_db()->query('SHOW TABLES')->fetchAll() as $row) {\n\n // Extract the table name.\n $rv = array_values($row);\n $table = $rv[0];\n\n // If the table is a Neatline table, drop it.\n if (in_array('neatline', explode('_', $table))) {\n $this->db->query(\"DROP TABLE $table\");\n }\n\n }\n\n }", "public function testDrop()\n {\n // make sure all tables were created\n $this->fixture->setup();\n $tables = $this->fixture->getDBObject()->fetchList('SHOW TABLES');\n $this->assertEquals(6, \\count($tables));\n\n // remove all tables\n $this->fixture->drop();\n\n // check that all tables were removed\n $tables = $this->fixture->getDBObject()->fetchList('SHOW TABLES');\n $this->assertEquals(0, \\count($tables));\n }", "public static function unlockTables(){\n\t $statement = App::getDBO()->prepare('UNLOCK TABLES');\n\t\tApp::getDBO()->query();\n\t}", "public function unlockTables(): void\n {\n $sql = 'unlock tables';\n\n $this->executeNone($sql);\n }", "public static function uninstall() {\n $sql = 'DROP TABLE IF EXISTS `'.self::tableName.'`;';\n db_query($sql);\n }", "protected function removeTables() {\n while(!empty($this->_tableDeleteQueue)) {\n $deleted = array();\n foreach($this->_tableDeleteQueue as $table => $fields) {\n $this->removeTable($table);\n // if the error code is 00000, the execution of the sql was successful\n // and the table was deleted\n // if it's not 00000, try to delete this table in the next round\n if($this->errorCode() === \"00000\") {\n $deleted[] = $table;\n }\n }\n foreach($deleted as $deletedTable) {\n unset($this->_tableDeleteQueue[$deletedTable]);\n }\n }\n $this->_tableDeleteQueue = array();\n }", "public function down() {\n\n\t\t$query = 'DROP TABLE sites;';\n\n\t\ttry {\n\t\t\tself::$pdo->exec( $query );\n\t\t} catch ( PDOException $exception ) {\n\t\t\tEE::error( 'Encountered Error while dropping table: ' . $exception->getMessage(), false );\n\t\t}\n\t}", "function cp_delete_db_tables() {\r\n global $wpdb, $app_db_tables;\r\n\r\n echo '<p class=\"info\">';\r\n\r\n foreach ( $app_db_tables as $key => $value ) {\r\n $sql = \"DROP TABLE IF EXISTS \". $wpdb->prefix . $value;\r\n $wpdb->query($sql);\r\n\r\n printf( __(\"Table '%s' has been deleted.\", 'appthemes'), $value);\r\n echo '<br/>';\r\n }\r\n\r\n echo '</p>';\r\n}", "public function destroy()\n {\n $db = XenForo_Application::get('db');\n $db->query('DROP TABLE `' . self::DB_TABLE . '`');\n }", "function deleteall() {\n\t\t$this->_query( \"DELETE FROM $0\" );\n\t}", "public function dropTable()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\t// Does the table exist?\n\t\tif (blx()->db->getSchema()->getTable('{{'.$table.'}}'))\n\t\t{\n\t\t\tblx()->db->createCommand()->dropTable($table);\n\t\t}\n\t}", "public function cleanRoleAndPermissionTables() : void\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('roles')->truncate();\n DB::table('permissions')->truncate();\n DB::table('role_has_permissions')->truncate();\n DB::table('model_has_roles')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function truncateAll(): void\n {\n $tables = [\n Newsletter::TABLE_NAME,\n Link::TABLE_NAME,\n Log::TABLE_NAME,\n Queue::TABLE_NAME,\n ];\n foreach ($tables as $table) {\n DatabaseUtility::getConnectionForTable($table)->truncate($table);\n }\n }", "protected function tearDown(): void\n {\n foreach (['default'] as $connection) {\n $this->schema($connection)->drop('users');\n $this->schema($connection)->drop('friends');\n $this->schema($connection)->drop('posts');\n $this->schema($connection)->drop('photos');\n }\n\n Relation::morphMap([], false);\n }", "public function uninstall()\n\t{\n\t\t$this->db->query(\"\n\t\t\tDROP TABLE \".Kohana::config('database.default.table_prefix').\"sharing_site;\n\t\t\t\");\n\t\t$this->db->query(\"\n\t\t\tDROP TABLE \".Kohana::config('database.default.table_prefix').\"sharing_incident;\n\t\t\t\");\n\n\t}", "protected function removeTables()\n {\n $this->dropTableIfExists('{{%hubspottoolbox_accesstoken}}');\n }", "public static function drop()\n {\n global $wpdb;\n $tableName = static::getTableName($wpdb->prefix);\n\n $sql = \"DROP TABLE IF EXISTS $tableName;\";\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\n $wpdb->query($sql);\n \\delete_option($tableName . '_version');\n }", "protected function tearDown(): void\n {\n $this->schema()->drop('users');\n $this->schema()->drop('users_created_at');\n $this->schema()->drop('users_updated_at');\n }", "protected function _after()\n {\n $this->_adapter->execute('drop table if exists comments;\n drop table if exists posts_tags;\n drop table if exists posts;\n drop table if exists tags;\n drop table if exists profiles;\n drop table if exists credentials;\n drop table if exists people;\n ');\n parent::_after();\n }", "protected function dropSchemas()\n {\n }", "function deleteDatabase()\n{\n // codes to perform during unistallation\n $free_book_table = $GLOBALS['wpdb']->prefix . 'free_books';\n $sale_book_table = $GLOBALS['wpdb']->prefix . 'sale_books';\n $GLOBALS['wpdb']->query(\"DROP TABLE IF EXISTS `\" . $free_book_table . \"`\");\n $GLOBALS['wpdb']->query(\"DROP TABLE IF EXISTS `\" . $sale_book_table . \"`\");\n}", "private function truncate()\n {\n // Désactivation des contraintes FK\n $this->co->executeQuery('SET foreign_key_checks = 0');\n // On tronque\n $this->co->executeQuery('TRUNCATE TABLE casting');\n $this->co->executeQuery('TRUNCATE TABLE department');\n $this->co->executeQuery('TRUNCATE TABLE genre');\n $this->co->executeQuery('TRUNCATE TABLE job');\n $this->co->executeQuery('TRUNCATE TABLE movie');\n $this->co->executeQuery('TRUNCATE TABLE movie_genre');\n $this->co->executeQuery('TRUNCATE TABLE person');\n $this->co->executeQuery('TRUNCATE TABLE review');\n $this->co->executeQuery('TRUNCATE TABLE team');\n $this->co->executeQuery('TRUNCATE TABLE user');\n }", "public static function cleanDatabase()\n\t{\n\t\tself::checkTestEnv();\n\t\techo \"\\nPersistenceTestHelper: cleaning database\\n\";\n\n\t\trequire path('sys').'cli/dependencies'.EXT;\n\t\tif (!self::checkTableExists('laravel_migrations')) {\n\t\t\techo \"PersistenceTestHelper: creating migrations table\\n\";\n\t\t\tCommand::run(array('migrate:install'));\n\t\t\techo \"\\n\";\n\t\t}\n\n\t\tCommand::run(array('migrate:reset'));\n\t\tCommand::run(array('migrate'));\n\n\t\techo \"PersistenceTestHelper: database cleaned!\\n\";\n\t}", "private function truncateDatabaseTables(array $ignore_tables=[]){\n $tables = DB::connection()->getDoctrineSchemaManager()->listTableNames();\n foreach($tables as $table){\n if(in_array($table, $ignore_tables)){\n // don't want to truncate the these table\n continue;\n }\n DB::table($table)->truncate();\n }\n }", "private function drop_tables($tables) {\n\t\tforeach ($tables as $table) $this->sql_exec('DROP TABLE IF EXISTS '.UpdraftPlus_Manipulation_Functions::backquote($table), 1, '', false);\n\t}", "public function uninstall() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->deleteTable();\r\n\t}\r\n }", "function truncate_database($db, $excluded_names)\n{\n $excluded_names[] = 'sqlite_sequence';\n $excluded_names[] = 'sqlite_master';\n $excluded_names = array_unique($excluded_names);\n\n $db->exec(\"PRAGMA writable_schema = 1;\");\n $db->exec(\"DELETE FROM sqlite_master WHERE type = 'table' AND name NOT IN ('\" . join(\"', '\", $excluded_names) . \"');\");\n $db->exec(\"DELETE FROM sqlite_master WHERE type = 'index';\");\n $db->exec(\"DELETE FROM sqlite_master WHERE type = 'trigger';\");\n $db->exec(\"PRAGMA writable_schema = 0;\");\n\n $in_transaction = $db->inTransaction();\n if ($in_transaction) {\n $db->commit();\n }\n $db->exec(\"VACUUM\");\n if ($in_transaction) {\n $db->beginTransaction();\n }\n}", "function plugin_remove_database() {\n\n global $wpdb;\n\n\n\n $trips_tbl=$wpdb->prefix.'tb_trips_tbl';\n\n $sql_1 = \"DROP TABLE IF EXISTS $trips_tbl\";\n\n\n\n $tb_contacts_tbl=$wpdb->prefix.'tb_contacts_tbl';\n\n $sql_4 = \"DROP TABLE IF EXISTS $tb_contacts_tbl\";\n\n\n\n $tb_booking_tbl=$wpdb->prefix.'tb_booking_tbl';\n\n $sql_5 = \"DROP TABLE IF EXISTS $tb_booking_tbl\";\n\n\n\n\n\n $tb_zoho_crm_auth=$wpdb->prefix.'tb_zoho_crm_auth';\n\n $sql_2 = \"DROP TABLE IF EXISTS $tb_zoho_crm_auth\";\n\n $tb_zoho_books_auth=$wpdb->prefix.'tb_zoho_books_auth';\n\n $sql_3 = \"DROP TABLE IF EXISTS $tb_zoho_books_auth\";\n\n\n\n $wpdb->query($sql_1);\n\n $wpdb->query($sql_4);\n\n $wpdb->query($sql_5);\n\n\n\n $wpdb->query($sql_2);\n\n $wpdb->query($sql_3);\n\n delete_option(\"my_plugin_db_version\");\n\n }", "public static function truncate()\n {\n include self::dbFile();\n $pdo = self::createPDO($dbuser, $dbpass);\n $pdo->query(\"DROP DATABASE IF EXISTS $dbname\");\n $pdo->query(\"DROP DATABASE IF EXISTS {$dbname}_test\");\n $pdo->query(\"CREATE DATABASE $dbname\");\n $pdo->query(\"CREATE DATABASE {$dbname}_test\");\n }", "public function deleteAll(){\n try {\n $this->getTable()->delete();\n } catch (\\Exception $e) {\n $this->handleException($e);\n }\n return;\n }", "public static function dbClear(){\n\t\tif (App::runningUnitTests()) {\n\t\t\tself::clearModelTables(TestSettings::$modelTables);\n\t\t\tself::clearTables(TestSettings::$pivotTables);\n\t\t}\n\t}", "static function deleteAll()\n {\n $GLOBALS['DB']->exec(\"DELETE FROM stores;\");\n $GLOBALS['DB']->exec(\"DELETE FROM stores_brands;\");\n }", "public function safeDown()\n {\n $this->dropTable($this->tableName);\n }", "protected function resetExistingTables()\n {\n $this->existingTables = null;\n }", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "abstract protected function dropTableDb(string $table, array $options = []);", "public static function dbClearTable($table){\n\t\tif (App::runningUnitTests()) {\n\t\t\tif (DB::table($table)->count() != 0) {\n\t\t\t\t//Turn foreign key checks off <- USE WITH CAUTION!\n\t\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t\t\t//Delete all entries & reset indexes\n\t\t\t\tDB::table($table)->truncate();\n\t\t\t\t//Turn foreign key checks on <- SHOULD RESET ANYWAY BUT JUST TO MAKE SURE!\n\t\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t\t\t}\n\t\t}\n\t}", "public function wp_clean_sql()\n\t{\n\t\t$bdd = Bdd::getInstance();\n\n\t\t$sql = $bdd->dbh->prepare(\"SHOW TABLES LIKE '\".$this->_table_prefix.\"%'\");\n\t\t$sql->execute();\n\t\t$tables = $sql->fetchAll();\n\n\t\tforeach ($tables as $table)\t{\n\t\t\t$table_name = $table[0];\n\n\t\t\t// To rename the table\n\t\t\t$sql1 = $bdd->dbh->prepare(\"DROP TABLE `{$table_name}`\");\n\t\t\t$sql1->execute();\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function cleanVisitorTable($database = \"\"){\n\t\t\n\t\t$sql = \"TRUNCATE TABLE visitor\"; \n\t\t\n\t\ttry{\n\t\t\t\n\t\t\t$query = $database->exec($sql);\n\t\t\t\n\t\t\techo 'Succesfully ran rhe clean up operation.';\n\t\t\t\n\t\t} catch(PDOException $error){\n\t\t\n\t\t\techo 'Error with query. '.$error->getMessage();\n\t\t\n\t\t}\n\t\t\n\t}", "function dropTables($tableNames) {\n\n $tableNames = (array)$tableNames;\n $db = $this->getDb();\n foreach ($tableNames as $tableName) {\n $db->exec('DROP TABLE IF EXISTS ' . $tableName);\n }\n\n\n }", "function myplugin_deactivate_dbtables( $tables )\n{\n\tglobal $wpdb;\n\t\n\tforeach ($tables as $table_name => $sql) {\n\n\t\tif ($wpdb->get_var(\"SHOW TABLES LIKE '\".$table_name.\"'\") == $table_name) {\n\n\t\t\t$wpdb->query( \"DROP TABLE \".$table_name.\"\" );\n\t\t}\n\t}\n}", "function uninstall() {\r\n SQLExec('DROP TABLE IF EXISTS products');\r\n SQLExec('DROP TABLE IF EXISTS product_categories');\r\n SQLExec('DROP TABLE IF EXISTS shopping_list_items');\r\n parent::uninstall();\r\n }", "protected function truncateTables()\n {\n \\DB::table('cities')->truncate();\n \\DB::table('states')->truncate();\n }", "public function drop()\r\n\t{\r\n\t\t$this->db->drop('users');\r\n\t}", "public function dropDatabase($name)\r\n {\r\n $sql = <<<SQL\r\nBEGIN\r\n -- user_tables contains also materialized views\r\n FOR I IN (SELECT table_name FROM user_tables WHERE table_name NOT IN (SELECT mview_name FROM user_mviews))\r\n LOOP \r\n EXECUTE IMMEDIATE 'DROP TABLE \"'||I.table_name||'\" CASCADE CONSTRAINTS';\r\n END LOOP;\r\n \r\n FOR I IN (SELECT SEQUENCE_NAME FROM USER_SEQUENCES)\r\n LOOP\r\n EXECUTE IMMEDIATE 'DROP SEQUENCE \"'||I.SEQUENCE_NAME||'\"';\r\n END LOOP;\r\nEND;\r\n\r\nSQL;\r\n\r\n $this->conn->exec($sql);\r\n\r\n if ($this->conn->getAttribute(Doctrine_Core::ATTR_EMULATE_DATABASE)) {\r\n $username = $name;\r\n $this->conn->exec('DROP USER ' . $username . ' CASCADE');\r\n }\r\n }", "public static function deleteAll() {\n // Initiate implicit tx if explicit one doesn't exist\n $is_implicit_tx = false;\n if (self::$numTransactions == 0) {\n $is_implicit_tx = true; \n self::beginTx();\n }\n\n // Fail because 'databaseHandle' wasn't initialized by 'beginTx()' \n assert(isset(self::$databaseHandle));\n\n try {\n $sql_records = static::fetchAll();\n foreach ($sql_records as $record) {\n $record->delete();\n } \n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n\n // Close implicit tx\n if ($is_implicit_tx) {\n self::endTx();\n }\n }", "protected function tearDown(): void\n {\n $this->_connection->dropTable($this->_tableName);\n $this->_connection->resetDdlCache($this->_tableName);\n $this->_connection = null;\n }", "public function dropTable()\n {\n try {\n $table = self::$table_name;\n $SQL = <<<EOD\n SET foreign_key_checks = 0;\n DROP TABLE IF EXISTS `$table`;\n SET foreign_key_checks = 1;\nEOD;\n $this->app['db']->query($SQL);\n $this->app['monolog']->addInfo(\"Drop table 'contact_address'\", array(__METHOD__, __LINE__));\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }", "public static function down()\n {\n Schema::dropIfExists(static::getTableName());\n }", "public function tearDown(): void\n {\n $this->schema($this->schemaName)->drop('users');\n $this->schema($this->schemaName)->drop('emails');\n $this->schema($this->schemaName)->drop('phones');\n $this->schema($this->schemaName)->drop('role_users');\n $this->schema($this->schemaName)->drop('roles');\n $this->schema($this->schemaName)->drop('permission_roles');\n $this->schema($this->schemaName)->drop('permissions');\n $this->schema($this->schemaName)->drop('tasks');\n $this->schema($this->schemaName)->drop('locations');\n $this->schema($this->schemaName)->drop('assignments');\n $this->schema($this->schemaName)->drop('jobs');\n\n Relation::morphMap([], false);\n\n parent::tearDown();\n }", "public function safeDown()\n {\n //return false;\n $this->dropTable($this->tablePost);\n $this->dropTable($this->tableUser);\n }", "public function dropAllViews()\n {\n $this->connection->statement($this->grammar->compileDropAllViews());\n }", "protected function tearDown(): void\n {\n $this->schema('default')->drop('users');\n }", "function clear_table($table, $dbh)\n{\n\ttry {\n\t $dbh->beginTransaction();\n\n\t $stmt = $dbh->prepare(\"TRUNCATE TABLE $table\");\n\n\t $stmt->execute();\n\n\t $dbh->commit();\n\t} catch(PDOException $ex) {\n\t //Something went wrong rollback!\n\t $dbh->rollBack();\n\t echo $ex->getMessage();\n\t} \n}", "protected function _teardownDb()\n {\n list ($host, $port, $db) = $this->_getUrlParts();\n $db = trim($db, '/');\n \n try {\n Sopha_Db::deleteDb($db, $host, $port);\n } catch (Sopha_Db_Exception $e) {\n if ($e->getCode() != 404) {\n throw $e;\n }\n }\n }", "private function cleanUpDatabase(){\n\t\t$this->cleanUpSessions();\n\t\t// reports older 90 days\n\t\t$this->cleanUpReports();\n\t\t// delete unregistered users without actions older 30 days\n\t\t$this->cleanUpUsers();\n\t}", "private function dropDataTable(Datastore $db)\n {\n $stmt = $db->prepare('DROP TABLE ' . $this->dataTableName());\n $db->execute($stmt);\n }", "public function uninstallDB()\n {\n Db::getInstance()->execute('DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'onehop_sms_rulesets`;');\n return Db::getInstance()->execute('DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'onehop_sms_templates`;');\n }", "public function deleteTablesAndEvents() {\r\n\t\t// drop additional tables for extension module\r\n\t\t$tableNames = ['zasilkovna_weight_rules', 'zasilkovna_shipping_rules', 'zasilkovna_orders'];\r\n\t\tforeach ($tableNames as $shortTableName) {\r\n\t\t\t$sql = 'DROP TABLE `' . DB_PREFIX . $shortTableName . '`;';\r\n\t\t\t$this->db->query($sql);\r\n\t\t}\r\n\t\t// remove events registered for \"zasilkovna\" plugin\r\n\t\t$this->load->model('setting/event');\r\n\t\t$this->model_setting_event->deleteEventByCode(self::EVENT_CODE);\r\n\t}", "function dropTable($table);", "function caldera_forms_pro_drop_tables(){\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . 'cf_pro_messages';\n\t$sql = \"DROP TABLE IF EXISTS $table_name\";\n\t$wpdb->query($sql);\n\tdelete_option('cf_pro_db_v');\n}", "public function down(Kohana_Database $db)\n\t{\n\t\t$db->query(NULL, 'DROP TABLE `stores`;');\n\t\t$db->query(NULL, 'DROP TABLE `store_inventories`;');\n\t\t$db->query(NULL, 'DROP TABLE `store_restocks`;');\n\t\t$db->query(NULL, 'DROP TABLE `user_shops`;');\n\t}", "public function down()\n\t{\nDB::query(\n\"drop table haal;\");\nDB::query(\n\"drop table kandidaat;\");\nDB::query(\n\"drop table haaletaja;\");\nDB::query(\n\"drop table partei;\");\nDB::query(\n\"drop table valimisringkond;\");\n\t}", "function jr_delete_db_tables() {\r\n\tglobal $wpdb, $jr_db_tables;\r\n\r\n\t$db_tables = array_merge( $jr_db_tables, $jr_legacy_db_tables );\r\n\r\n\tforeach ( $db_tables as $key => $value ) :\r\n\t\tscb_uninstall_table($value);\r\n\r\n\t\tprintf(__(\"Table '%s' has been deleted.\", APP_TD), $value);\r\n\t\techo '<br/>';\r\n\tendforeach;\r\n\r\n\tscb_uninstall_table('app_pop_daily');\r\n\t_e(\"Table 'app_pop_daily' has been deleted.\", APP_TD);\r\n\r\n\tscb_uninstall_table('app_pop_total');\r\n\t_e(\"Table 'app_pop_total' has been deleted.\", APP_TD);\r\n\r\n}" ]
[ "0.85429484", "0.8260869", "0.80875415", "0.79009515", "0.79009515", "0.7862313", "0.7780345", "0.76803994", "0.76673484", "0.7567037", "0.75477666", "0.7537774", "0.7439563", "0.7435206", "0.74069387", "0.7373744", "0.7367524", "0.73212117", "0.7268296", "0.72202784", "0.7218114", "0.7174954", "0.7170325", "0.71402645", "0.7109909", "0.7097354", "0.7034437", "0.70020026", "0.70001006", "0.6994271", "0.6984138", "0.6970749", "0.6949813", "0.6945128", "0.6888328", "0.6827051", "0.6811674", "0.6811386", "0.6810994", "0.6805605", "0.6781533", "0.67649907", "0.6756741", "0.6680941", "0.6680114", "0.66722906", "0.6647085", "0.66443944", "0.6643882", "0.6634394", "0.6629712", "0.6627023", "0.6619615", "0.6598519", "0.6597738", "0.65966094", "0.6591607", "0.65530974", "0.65232706", "0.6522418", "0.6508874", "0.6502364", "0.6499284", "0.64985126", "0.64883614", "0.6473156", "0.6464894", "0.64530134", "0.6429419", "0.6429419", "0.6429419", "0.6420116", "0.64196724", "0.6414059", "0.64110804", "0.6403553", "0.64029795", "0.6400171", "0.6388361", "0.6384078", "0.6383301", "0.6371154", "0.6368905", "0.63599", "0.63496816", "0.63473487", "0.63421345", "0.6333693", "0.6330179", "0.632868", "0.6323384", "0.6313706", "0.63136137", "0.63132584", "0.631022", "0.6310035", "0.63094527", "0.6302729", "0.6301445", "0.6296979" ]
0.6886267
35
Display a listing of the resource.
public function index() { $data['MainMenus'] = MenuSystem::where('menu_system_part', 'ApplicantsAppointment')->with('MainMenu')->first(); $data['Menus'] = MenuSystem::ActiveMenu()->get(); $data['RecruitmentPositions'] = RecruitmentPosition::where('recruitment_position_status', 1)->get(); $data['Genders'] = Gender::where('gender_status', 1)->get(); $data['NamePrefixs'] = NamePrefix::where('name_prefix_status', 1)->get(); $data['Provinces'] = Provinces::where('provinces_status', 1)->get(); $data['JobQuestions'] = JobQuestion::where('job_question_status', 1)->orderBy('job_question_z_index')->get(); $data['LanguageTypes'] = LanguageType::where('language_type_status', 1)->get(); $data['TypeDocumentDrivers'] = TypeDocumentDriver::where('type_doc_driver_status', 1)->get(); $data['TypeJobNews'] = TypeJobNew::where('type_job_new_status', 1)->get(); $data['StatusJobApps'] = [ 0 => 'รอเรียกสัมภาษณ์งาน', 1 => 'ผ่านสัมภาษณ์งานรอบแรก', 2 => 'ผ่านการทดสอบข้อสอบ (เตรียมทดสอบขับรถ)', 3 => 'ตกการทดสอบข้อสอบ (ให้ทดสอบขับรถ) (เตรียมทดสอบขับรถ)', 4 => 'ผ่านการทดสอบขับรถ', 90 => 'ตกการทดสอบรอบแรก', 91 => 'ตกการทดสอบข้อสอบ (กลับบ้าน)', 92 => 'ตกการทดสอบขับรถ', 98 => 'ให้กลับมาทดสอบใหม่ได้', 99 => 'ห้ามกลับมาสมัครใหม่' ]; if (Helper::CheckPermissionMenu('ApplicantsAppointment', '1')) { return view('admin.ApplicantsAppointment.applicants_appointment', $data); } else { return redirect('admin/'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "function listing() {\r\n\r\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446377", "0.7361922", "0.72984487", "0.7248631", "0.7162871", "0.7148215", "0.7131838", "0.71028054", "0.7102395", "0.70988023", "0.7048243", "0.6993516", "0.6989079", "0.69341344", "0.69001913", "0.6899167", "0.68920904", "0.6887188", "0.68661547", "0.6849159", "0.683002", "0.6801792", "0.6796645", "0.67952746", "0.678579", "0.6760132", "0.6741144", "0.67304057", "0.6726034", "0.6723304", "0.6723304", "0.6723304", "0.67188966", "0.67061126", "0.67046595", "0.67042124", "0.6664004", "0.6663109", "0.66603667", "0.66595376", "0.6656908", "0.66536283", "0.6648508", "0.6619696", "0.66191936", "0.66145146", "0.66056865", "0.6600895", "0.66007215", "0.6593214", "0.6587006", "0.6585572", "0.6584028", "0.65802413", "0.65751636", "0.6574276", "0.6572553", "0.65703243", "0.6569474", "0.6563628", "0.6563418", "0.65516967", "0.655156", "0.65460885", "0.65367365", "0.6533626", "0.6533064", "0.6527408", "0.65251255", "0.6524834", "0.65202224", "0.6517302", "0.65167385", "0.6516062", "0.65148616", "0.6506742", "0.65018", "0.6501768", "0.6494415", "0.64921784", "0.6486631", "0.6485237", "0.6484199", "0.64841217", "0.6479556", "0.6478558", "0.6469807", "0.646858", "0.64683306", "0.6466808", "0.64637285", "0.64616066", "0.6458575", "0.6457558", "0.64535207", "0.64534074", "0.64524984", "0.64491946", "0.6448726", "0.6447211", "0.64461327" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n {\n return view('url.form');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75936973", "0.75936973", "0.7585464", "0.7576766", "0.7571166", "0.7498768", "0.7434969", "0.7432511", "0.7387868", "0.7351811", "0.7336364", "0.73113805", "0.7293885", "0.72812635", "0.7273037", "0.72410345", "0.7228987", "0.7225174", "0.718589", "0.71786976", "0.7172516", "0.71492815", "0.7143504", "0.7143484", "0.71349627", "0.71274126", "0.7122271", "0.7115064", "0.7115064", "0.7115064", "0.7110841", "0.70930386", "0.70841706", "0.7079425", "0.7079275", "0.70567256", "0.70567256", "0.7054091", "0.70386195", "0.7038531", "0.7034834", "0.7032825", "0.7029208", "0.70263356", "0.7025177", "0.7018699", "0.70156187", "0.7004536", "0.7002615", "0.7000439", "0.69960874", "0.6992934", "0.6991493", "0.6988563", "0.698635", "0.69649065", "0.6963641", "0.69552153", "0.6950279", "0.69498897", "0.69465077", "0.6943029", "0.6940043", "0.6939427", "0.69359136", "0.69359136", "0.69357383", "0.6933012", "0.6929994", "0.69270134", "0.69259113", "0.6923401", "0.6917057", "0.69144267", "0.6911519", "0.6909902", "0.690978", "0.6905855", "0.6903688", "0.6900189", "0.68999064", "0.6898482", "0.6893158", "0.6892387", "0.6891021", "0.68905854", "0.6890334", "0.6890334", "0.68871844", "0.68864834", "0.68854547", "0.6881966", "0.68814063", "0.68788683", "0.68738896", "0.6871671", "0.68716353", "0.68688464", "0.6868651", "0.68685114", "0.686829" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72875285", "0.71454394", "0.71323526", "0.6639812", "0.6620611", "0.6568348", "0.6526527", "0.6509403", "0.64499927", "0.6375791", "0.63739914", "0.6365971", "0.6365971", "0.6365971", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667" ]
0.0
-1
Display the specified resource.
public function show($id) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7855416", "0.769519", "0.72748375", "0.724256", "0.7173659", "0.7064689", "0.70549816", "0.6985127", "0.6949479", "0.69474626", "0.694228", "0.6929372", "0.6903047", "0.6899655", "0.6899655", "0.688039", "0.68649715", "0.68618995", "0.68586665", "0.68477386", "0.68366665", "0.6812782", "0.6807947", "0.68078786", "0.6803727", "0.6796845", "0.67935634", "0.67935634", "0.67894953", "0.67862976", "0.67815566", "0.6777874", "0.67700446", "0.6764179", "0.6747784", "0.6747784", "0.67476946", "0.6746584", "0.67417157", "0.67370653", "0.6727131", "0.6714694", "0.66953164", "0.6693583", "0.6690321", "0.66898996", "0.6689058", "0.66865313", "0.6684526", "0.66717213", "0.6670211", "0.6666833", "0.6666833", "0.66633433", "0.6663041", "0.6661699", "0.6658396", "0.6657984", "0.665473", "0.6644314", "0.66343915", "0.6633082", "0.6629606", "0.6629606", "0.6620677", "0.6620635", "0.66180485", "0.66171867", "0.6612161", "0.6610249", "0.660762", "0.6597593", "0.6596027", "0.6595597", "0.65925545", "0.65920216", "0.65896076", "0.65822965", "0.6581996", "0.65817595", "0.65770084", "0.65768373", "0.6575926", "0.65713066", "0.6569505", "0.656938", "0.65680295", "0.65636957", "0.65636957", "0.65624565", "0.65597314", "0.6559697", "0.65576696", "0.65573514", "0.65564495", "0.6556307", "0.655628", "0.65558994", "0.6549784", "0.6549675", "0.65461886" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Call the CI_Model constructor
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n // Call the CI_Model constructor\n parent::__construct();\n }", "public function __construct()\n {\n // Call the CI_Model constructor\n parent::__construct();\n }", "function __construct() {\r\n parent::Model();\r\n }", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->load->model('Model');\n\t}", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->load->model('Model');\n\t}", "function __construct()\r\n {\r\n parent::Model();\r\n }", "function __construct()\n {\n // 呼叫模型(Model)的建構函數\n parent::__construct();\n \n }", "function __construct() {\n // Call the Model constructor \n parent::__construct();\n }", "function __construct () {\n\t\t$this->_model = new Model();\n\t}", "function __construct()\n {\n parent::Model();\n }", "function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }", "function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }", "function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }", "function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }", "function __construc()\r\n\t{\r\n\t\tparent::Model();\r\n\t}", "function __construct(){\n\t\tparent::__construct();\n\t\t\t$this->set_model();\n\t}", "public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }", "function __construct() {\n parent::__construct();\n $this->load->model('Callcenter_model');\n }", "public function __construct()\n {\n parent::Model();\n\n }", "public function __construct() {\n // Call the Model constructor\n parent::__construct();\n }", "function __construct()\n {\n parent::__construct();\n // $this->load->model('');\n }", "function __construct()\n\t\t{\n\t\t\t// Call the Model constructor\n\t\t\tparent::__construct();\n\t\t $this->load->database();\t\n\t\t}", "public function __construct()\n\t{\n\t\tif (!$this->model_name)\n\t\t{\n\t\t\t$this->model_name = str_replace('Model_', '', get_class($this));\n\t\t}\n\t\t$this->model_name = strtolower($this->model_name);\n\t\t\n\t\t$this->_initialize_db();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->load->model('data');\n\t}", "public function __construct()\n\t{\n\t\t//MVC: makes CodeIgniter style $this->load->model() available to my controllers\n\t\t$this->load = new modelLoader($this);\n\t}", "public function __construct(){\n parent::__construct();\n $this->load->model(\"Cuartel_model\");\n\n\t}", "public function __construct() {\n parent::__construct();\n $this->load->model('data_model');\n }", "public function __construct() {\n parent::__construct();\n $this->load->model('Thematic_model');\n }", "public function __construct()\n {\n \t parent::__construct();\n \t $this->load->model('Modelo');\n }", "function __construct()\n {\n parent::__construct();\n /* LOAD MODEL */\n $this->load->model('report_abuse_model');\n }", "private function __construct($model)\r\n {\r\n\r\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('LeBabeModel');\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('LeBabeModel');\n\t}", "public function __construct()\r\n\t{\r\n\t\tparent::__construct();\r\n\t\t\r\n\t\t$this->load->model(array('user_model','program_model'));\r\n\t\t\r\n\t}", "function __construct()\n {\n parent::__construct();\n\n\t\t$this->load->model('floatplan_model');\n\t\t$this->load->model('user_model');\n }", "function __construct()\n {\n parent::__construct(); \n // load model\n $this->load->model(array('Mcourse'));\n }", "public function __construct()\n\t\t{\n\t\t\t// $this->_database_connection = 'special_connection';\n\n\t\t\t// you can disable the use of timestamps. This way, MY_Model won't try to set a created_at and updated_at value on create methods. Also, if you pass it an array as calue, it tells MY_Model, that the first element is a created_at field type, the second element is a updated_at field type (and the third element is a deleted_at field type if $this->soft_deletes is set to TRUE)\n\t\t\t$this->timestamps = FALSE;\n\n\t\t\t// you can enable (TRUE) or disable (FALSE) the \"soft delete\" on records. Default is FALSE, which means that when you delete a row, that one is gone forever\n\t $this->soft_deletes = FALSE;\n\n\t // you can set how the model returns you the result: as 'array' or as 'object'. the default value is 'object'\n\t\t\t$this->return_as = 'object' | 'array';\n\n\n\t\t\t// you can set relationships between tables\n\t\t\t// $this->has_one['room_list'] = array('room_list','rl_id','rl_id');\n\t\t\t// $this->has_one['Sched_day'] = array('sched_day','sd_id','sd_id');\n\t\t\t// $this->has_one['subject'] = array('subjects','subj_id','subj_id');\n\n\t\t\n\t\t\t// you can also use caching. If you want to use the set_cache('...') method, but you want to change the way the caching is made you can use the following properties:\n\n\t\t\t$this->cache_driver = 'file';\n\t\t\t//By default, MY_Model uses the files (CodeIgniter's file driver) to cache result. If you want to change the way it stores the cache, you can change the $cache_driver property to whatever CodeIgniter cache driver you want to use.\n\n\t\t\t$this->cache_prefix = 'currv';\n\t\t\t//With $cache_prefix, you can prefix the name of the caches. By default any cache made by MY_Model starts with 'mm' + _ + \"name chosen for cache\"\n\n\t\t\tparent::__construct();\n\t\t}", "public function __construct()\n {\n $this->model = new BaseModel;\n }", "public function __construct() {\r\n parent::__construct();\r\n $this->load->model(array(\r\n 'app_model'\r\n ));\r\n }", "public function __construct($model) \n {\n parent::__construct($model);\n }", "public function __construct()\n\t{\n parent::__construct();\n\t\t$this->load->library('form_validation');\n\t\t$this->load->model('mdata');\n }", "function __construct() {\n parent::__construct();\n $this->load->model('Demo');\n }", "public function __construct() {\n\t\tparent::__construct();\n\n\t\t$this->load->model('example_model');\n\t}", "function __construct()\n {\n parent::__construct();\n $this->load->Model('PlanificacionModel');\n }", "public function __construct()\n {\n parent::__construct();\n\n\t\t$this->load->model(\"options_model\");\n\t\t$this->load->model(\"selections_model\");\n\t\t$this->load->model(\"info_model\");\n\t\t$this->load->model(\"dealer_model\");\n\t\t$this->load->library(\"encrypt\");\n\t\t$this->load->model(\"promocode_model\");\n\t}", "public function __construct() {\n parent::__construct();\n $this->load->model(array('dt_diag_klsf_model','dt_obat_model','dt_pasien_model','dt_pemeriksaan_model','dt_proses_model','dt_thpan_model'));\n }", "function __construct()\n {\n // Call the Model constructor\n parent::Model();\n $this->load->database('default'); \n }", "function __construct()\n {\n // Call the Model constructor\n parent::Model();\n $this->load->database('default'); \n }", "function __construct()\n {\n // Call the Model constructor\n parent::Model();\n $this->load->database('default'); \n }", "public function __construct()\n {\n parent::__construct();\n //自动加载相对应的数据模型\n if ($this->auto_load_model) {\n $model_name = $this->model_name ? $this->model_name . '_model' : $this->router->fetch_class() . '_model';\n $this->load->model($model_name, 'model');\n }\n $this->_set_user();\n $this->_check_resource();\n }", "public function __construct() {\n parent::__construct();\n $this->load->database();\n $this->load->model(\"base_model\");\n }", "public function __construct()\r\n\t{\r\n\tparent::__construct();\r\n\t\r\n\t//load database libray manually\r\n\t$this->load->database();\r\n\t\r\n\t//load Model\r\n\t$this->load->model('Hello_Model');\r\n\t}", "public function __construct(){\n //load constructor CI_Model\n parent::__construct();\n \n //load database\n $this->load->database();\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('User_model');\n\t}", "public function __construct() {\n // Call the CI_Model constructor\n parent::__construct();\n $this->load->database();\n }", "function __construct()\n {\n parent::__construct();\n $this->load->model(['encuentros_model']);\n }", "public function __construct() {\n\n parent::__construct();\n\n // Load models\n $this->load->model(\"attributesModel\", \"attributes\");\n\n }", "public function __construct() {\n parent::__construct();\n $this->load->model(\"modelo_base\");\n \n }", "public function __construct(){\n\n parent::__construct();\n $this->load->model('User_model','user');\n $this->load->model('Sys_model','sys');\n $this->load->model('Article_model','article');\n $this->load->model('System_model','system');\n }", "public function __construct()\n {\n parent::__construct();\n \t$this->load->model('Common_model');\n }", "public function __construct()\n {\n parent::__construct();\n $this->load->model('toko_model');\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model(\"mahasiswa_model\");\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->load->model(['m_voting', 'm_master', 'm_prospects', 'm_factors']);\n }", "public function __construct()\n {\n parent::__construct();\n //$this->load->model('test_model'); yeh \n //$this->load->helper('url_helper');\n\t\t\t\t $this->load->model(\"test_model\",\"m\");\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('Students_activities_model','sam');\n\t}", "public function __construct() {\r\n\t\tparent::__construct();\r\n\t\t$this->load->model(\"bibliotecaModel\");\r\n\t}", "function __construct()\n {\n parent::__construct();\n\t\t$this->load->model('Dash_Board_Model');\n\t\t \n }", "public function __construct(Model $model) {\n parent::__construct($model);\n \n }", "function __construct() {\r\n parent::__construct();\r\n $this->load->model(\"Siswa\"); //constructor yang dipanggil ketika memanggil siswa.php untuk melakukan pemanggilan pada model : siswa_model.php yang ada di folder models\r\n }", "function __construct()\n {\n parent::__construct();\n $this->load->model('BH');\n\n }", "public function __construct() {\n // load our model\n $this->userModel = $this->model('User'); // will check models folder for User.php\n }", "public function __construct() {\r\n parent::__construct();\r\n $this->load->model('Opportunity_model');\r\n }", "public function __construct()\n\t{\n\t\t// \\ladybug_dump($model);\n\t}", "function __construct(){\n\t\t\tparent::__construct();\n\t\t\t$this->load->model('Campaings_model');\n\t}", "function __construct()\n {\n parent::__construct();\n $this->load->model('payment_method_model', 'payment_method');\n }", "public function __construct()\n {\n parent::__construct();\n $this->load->helper(array('form','url'));\n $this->load->library(array('session', 'form_validation', 'email'));\n $this->load->database();\n $this->load->model('Init_models');\n }", "function __construct() {\n parent::__construct();\n $this->load->model('flightModel');\n $this->load->model('flight');\n $this->load->model('wackyModel');\n $this->load->model('fleetModel');\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t$this->load->model('colleges_model', 'colleges');\n\t\t// $this->load->model('programs');\n\t\t$this->load->model('courses_model', 'courses');\n\t\t$this->load->model('user_model', 'user');\n\t\t$this->load->model('forms_model', 'forms');\n\t\t$this->load->model('evaluation_model', 'evaluation');\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->load->model('User_model'); //load database model.\n $this->load->model('Form_data_model'); //load database model.\n }", "public function __construct(){\n parent::__construct();\n\t\t$this->load->model('notification_model');\n\t\t$this->load->model('cities_model');\n\t\t$this->load->model('areas_model');\n\t\t$this->load->model('groups_model');\n }", "public function __construct()\r\n\t{\r\n\t\t// Call the CI_Model constructor\r\n\t\tparent::__construct();\r\n\t\t$this->load->model(\"usuario_model\");\r\n\t}", "public function __construct() {\n parent::__construct(); \n $this->load->model('IPEModel');\n }", "public function __construct()\n {\n // Call the CI_Model constructor\n parent::__construct();\n $this->load->model('Profile_model');\n\n }", "public function __construct() {\n parent::__construct();\n $this->load->model('Channel_model');\n $this->load->model('UserRegister_model');\n $this->load->model('Loginrecord_model');\n $this->load->model('Paylog_model');\n }", "function __construct()\n {\n parent::__construct();\n\t\t$this->load->model('common','common');\n }", "function __construct()\r\n {\r\n parent::__construct();\r\n $this->load->model('subbab1_model');\r\n }", "public function __construct() {\n parent::__construct();\n $this->load->model('M_FluktuasiHarga');\n $this->load->model('M_Komoditas');\n $this->load->model('M_Lokasi');\n }", "function __construct(){\n parent::__construct();\n $this->check_isvalidated();\n $this->load->model('admin_model');\n $this->load->model('anggota_model');\n $this->load->model('pokok_wajib_model');\n $this->load->model('tabarok_a_model');\n $this->load->model('tarekah_a_model');\n $this->load->model('tarekah_b_model');\t\t\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// Your own constructor code\n\t\t//$this->load->model('access_url_model');\n\t\t$this->load->model('tst_model', 'tst');\n\t}", "function __construct() {\n\t\t$this->cotizacionModel = new cotizacionModel();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t\tif(!$this->session->userdata('name')) {\n\t\t\tredirect(redirect('login'));\n\t\t}\n\t\t$this->load->model('ProductsModel');\n\t\t$this->load->model('ProductCategoriesModel');\n\t\t$this->load->model('StockModel');\n\t\t$this->load->model('CustomerModel');\n\t\t$this->load->model('InvoiceModel');\n\t\t$this->load->model('CompanyModel');\n\t\t$this->load->model('DeliveryOrderModel');\n\t\t$this->load->model('ReturnsModel');\n\t}", "public function __construct()\n\t{\n\t\t// Assign the CodeIgniter super-object\n\t\t$this->CI =& get_instance();\n\t\t$this->CI->load->model('ContratanteDB');\n\t}", "function\t__construct()\t{\n\t\t\t\t/* contrutor da classe pai */\n\t\t\t\tparent::__construct();\n\t\t\t\t/* abaixo deverão ser carregados helpers, libraries e models utilizados\n\t\t\t\t\t por este model */\n\t\t}", "public function __construct() {\n parent::__construct('md_rent_car', 'md_order');\n $this->log->log_debug('RentCarAffairModel model be initialized');\n }", "public function __construct()\n {\n // All of my models are like this\n parent::__construct(get_class($this));\n // Calling methods to get the relevant data\n $this->generateNewsData();\n $this->generateAnalyticsData();\n $this->generatePostsData();\n }", "public function __construct(){\n $this->sliderModel = $this->model('Slider');\n $this->siteInfoModel = $this->model('SiteInfo');\n $this->officeModel = $this->model('Office');\n $this->categoryModel = $this->model('Category');\n $this->brandModel = $this->model('Brands');\n $this->productModel = $this->model('Products');\n $this->imgModel = $this->model('Image');\n }", "function __construct(){\n\t\tparent::__construct();\n\t\t$this->load->model('daftarmodel');\n\t}", "function __construct()\n {\n parent::__construct();\n\n $this->load->model('custom/ServiceStatus/NetworkOutage_model');\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('Students_activities_model', 'sam');\n\n\t}", "public function __construct() {\n parent::__construct();\n $this->load->model('libreta_model');\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t// $this->load->model('colleges');\n\t\t// $this->load->model('programs');\n\t\t$this->load->model('courses_model', 'courses');\n\t\t$this->load->model('user_model', 'user');\n\t\t$this->load->model('forms_model', 'forms');\n\t\t$this->load->model('evaluation_model', 'evaluation');\n\t}" ]
[ "0.8478336", "0.8478336", "0.81615126", "0.8117826", "0.8117826", "0.80994266", "0.8051992", "0.8007743", "0.79728657", "0.7956983", "0.7944228", "0.7944228", "0.7944228", "0.7944228", "0.7891693", "0.7883193", "0.7849891", "0.7808865", "0.7793594", "0.7751989", "0.773839", "0.77268946", "0.7670276", "0.7657678", "0.76429194", "0.7612435", "0.7611017", "0.75930434", "0.75844216", "0.75723594", "0.75681573", "0.7560089", "0.7560089", "0.7549137", "0.7543959", "0.7536697", "0.7535247", "0.7531432", "0.7508008", "0.7496409", "0.7493452", "0.7482874", "0.74826145", "0.74813837", "0.7475223", "0.7468955", "0.7464571", "0.7464571", "0.7464571", "0.7441789", "0.74338335", "0.74310344", "0.7412331", "0.7402904", "0.73988914", "0.73916084", "0.7388016", "0.73868775", "0.73861545", "0.73859817", "0.7382552", "0.737817", "0.7376017", "0.73748714", "0.7373381", "0.73726946", "0.73722637", "0.7369021", "0.73644865", "0.7359956", "0.735978", "0.73588014", "0.73587704", "0.7356164", "0.7349405", "0.7347448", "0.7345184", "0.73440474", "0.73420835", "0.7340078", "0.73332465", "0.7330444", "0.73258346", "0.73241174", "0.73205066", "0.7320245", "0.7318567", "0.73143095", "0.7307136", "0.73064774", "0.7302943", "0.7300816", "0.7300289", "0.72999614", "0.7298045", "0.7297087", "0.72967243", "0.7291957", "0.72821987", "0.72789335", "0.7278296" ]
0.0
-1
fungsi untuk ambil tabel admins
public function renamepxrajal($id){ $this->load->library('multipledb'); // loading library. $query2 = $this->multipledb->db->query("SELECT * FROM pxrajal2014 where dateregistrate like '".$id."%' group by NAMARUANGAN"); // running query using library. $this->multipledb->save();// calling library function. if ($query2!= null){ return $query2; } else{ return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function admin() {\r\n $ruta = new Ruta($this->adapter);\r\n\r\n //Conseguimos todos los usuarios\r\n $allrut = $ruta->getAll();\r\n //Cargamos la vista index y le pasamos valores\r\n $this->view(\"Ruta/admin\", array(\"allrut\" => $allrut));\r\n \r\n }", "public function actionAdmin()\n {\n $query = \"SELECT * FROM vartotojai WHERE klase = :klase\";\n $vartotojai = Yii::$app->db_prod->createCommand($query, [':klase' => self::KLASE_ADMINISTRATORIUS])->queryAll();\n foreach ($vartotojai as $vartotojas) {\n if ($this->adminExists($vartotojas['id'])) {\n continue;\n }\n\n $admin = new Admin([\n 'scenario' => Admin::SCENARIO_SYSTEM_MIGRATES_ADMIN_DATA,\n 'id' => $vartotojas['id'],\n 'name' => $vartotojas['vardas'],\n 'surname' => $vartotojas['pavarde'],\n 'email' => $vartotojas['elpastas'],\n 'phone' => $vartotojas['telefonai'],\n 'password_reset_token' => Admin::DEFAULT_PASSWORD_RESET_TOKEN,\n 'admin' => Admin::IS_ADMIN,\n 'archived' => $this->convertArchiveStatus($vartotojas['archive_status']),\n 'created_at' => strtotime($vartotojas['data']),\n 'updated_at' => strtotime($vartotojas['data']),\n ]);\n\n $admin->generateAuthKey();\n\n if ($this->hadOldPassword($vartotojas['raw_password'])) {\n $admin->setPassword($vartotojas['raw_password']);\n } else {\n $admin->setPassword(self::DEFAULT_PASSWORD);\n }\n\n $this->fixValidationErrors($admin);\n $admin->validate();\n if ($admin->errors) {\n $this->writeToCSV(Admin::tableName(), $admin->errors, $admin->id);\n continue;\n }\n\n $admin->detachBehaviors(); // Remove timestamp behaviour\n $admin->save(false);\n }\n }", "public function admin() {\r\n $Conductor = new Conductor($this->adapter);\r\n\r\n //Conseguimos todos los usuarios\r\n $allCon = $Conductor->getAllUsers();\r\n //Cargamos la vista index y le pasamos valores\r\n $this->view(\"Conductor/admin\", array(\"allCon\" => $allCon));\r\n \r\n }", "public function administrator(){\n\t\t$this->verify();\n\t\t$data['title']=\"Administrator\";\n\t\t$data['admin_list']=$this->admin_model->fetch_admin();\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('administrator/administrator', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "public function adminMatters(){\n\n }", "public function checkAdmin();", "public function adminPermisionListing()\n\t\t\t{\n\t\t\t\t$cls\t\t\t=\tnew adminUser();\n\t\t\t\t$cls->unsetSelectionRetention(array($this->getPageName()));\n\t\t\t\t $_SESSION['pid']\t=\t$_GET['id'];\n\t\t\t\t \n\t\t\t}", "public function relatorio4(){\n $this->isAdmin();\n }", "public function listarAdmin()\n {\n $sql = \"SELECT US.nombre,CO.problema,CO.tipo_problema,CO.solucion, CO.modo_contacto, CO.tipo_estado \n FROM usuarios US JOIN consulta CO\n ON US.idusuarios = CO.idusuario\n WHERE CO.tipo_estado = 'Ejecutado'\";\n return ejecutarConsulta($sql);\n\n }", "function adminUsers()\n {\n $userLogged = Auth::check(['administrateur']);\n \n $userManager = new UserManager();\n $listUsers = $userManager->getListUsers();\n require'../app/Views/backViews/user/backAdminUsersView.php';\n }", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Error.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Error::error($error);\n return;\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "function admin()\r\n\t{\r\n\t\t$this->permiso_model->need_admin_permition_level();\t\r\n\t\t\r\n\t\t$data = array();\r\n\t\t$data['main_content'] = 'admin_index';\r\n\r\n\t\t$this->load->model('tutor_model');\r\n\t\t$data['num_tutor'] = $this->tutor_model->count_all();\r\n\t\t\r\n\t\t$this->load->model('alumno_model');\r\n\t\t$data['num_alumno'] = $this->alumno_model->count_all();\r\n\t\t\r\n\t\t$this->load->model('tarea_model');\r\n\t\t$data['num_tarea'] = $this->tarea_model->count_all();\r\n\r\n\t\t$this->load->model('grupo_model');\r\n\t\t$data['num_grupo'] = $this->grupo_model->count_all();\r\n\r\n\t\t$this->load->view('includes/template',$data);\r\n\t}", "public function administration()\n {\n\t\t// user connecter\n\t\tif (!$this->isUserConnected()) {\n\t\t\theader('Location: '.BASE_URL);\n\t\t\treturn ;\n\t\t}\n\t\t// user admin\n\t\tif ($this->getUserInfo('droit') != 'ARW' && $this->getUserInfo('droit') != 'MASTER') {\n\t\t\theader('Location: '.BASE_URL);\n\t\t\treturn ;\n\t\t}\n\n $this->loadModel('user');\n\n $result = $this->getModel()->getAllUsersInfos();\n\n\t\t$arrobj = new ArrayObject($result);\n for($i = $arrobj->getIterator(); $i->valid(); $i->next())\n {\n \t$usersInfos[] = array(\n \t\t'subject' => $i->current()->subject->getUri(),\n \t\t'pseudo' => $i->current()->pseudo->getValue(),\n \t\t'givenName' => $this->getModel()->getUserInfo($i->current()->pseudo->getValue(), 'givenName'),\n \t\t'familyName' => $this->getModel()->getUserInfo($i->current()->pseudo->getValue(), 'familyName'),\n \t\t'droit' => $i->current()->droit->getValue()\n \t\t);\n }\n\n \t$this->set('userPseudo', $this->getUserInfo('pseudo'));\n\n \t$this->set('usersInfos', $usersInfos);\n\n // On set la variable a afficher sur dans la vue\n $this->set('title', 'Administration des utilisateurs');\n // On fait le rendu de la vue signup.php\n $this->render('adminUser');\n }", "public function display_admin_list() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n if ($this->checkPrivileges('admin', '0') == TRUE) {\n\t\t\t if ($this->lang->line('admin_admin_users_list') != '') \n\t\t $this->data['heading']= stripslashes($this->lang->line('admin_admin_users_list')); \n\t\t else $this->data['heading'] = 'Admin Users List';\n $condition = array();\n $this->data['admin_users'] = $this->admin_model->get_all_details(ADMIN, $condition);\n $this->load->view(ADMIN_ENC_URL.'/adminsettings/display_admin', $this->data);\n } else {\n redirect(ADMIN_ENC_URL);\n }\n }\n }", "function afficherAdmins(){\n\t\t$sql=\"SElECT * From administrateur\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\n\t}", "public function actionAdministrador(){\n\t\t//total inscritos\n\t\t//total comunicaciones\n\t\t//pendientes de revisar?\n\t\tif( Yii::app()->user->rol == 1 || Yii::app()->user->rol == 2){\t\t\n\t\t\t$edicion = Dato::model()->find('clave = \"edicion\"');\n\t\t\t$pagado = $this->totalpagado();\n\n\t\t\t$total = $this->totalPagar();\n\n\t\t\t$comunicaciones = $this->totalComunicaciones();\n\n\t\t\t$norevisadas = $this->pendientesRevisar();\n\n\t\t\t$inscritos = $this->totalInscritos();\n\t\t\t\n\t\t\t$datos = $this->totalInscritosGrafica();\n\t\t\t$this->render('administrador', array(\n\t\t\t\t'total'=>$total, \n\t\t\t\t'pagado' => $pagado,\n\t\t\t\t'inscritos'=>$inscritos,\n\t\t\t\t'comunicaciones'=>$comunicaciones,\n\t\t\t\t'norevisadas'=>$norevisadas,\n\t\t\t\t'edicion' => $edicion->valor,\n\t\t\t\t'datos' => $datos,\n\t\t\t\t)\n\t\t\t);\n\t\t}else{\n\t\t\tYii::app()->end();\n\t\t}\n\t}", "public function adminOnly();", "public function adminOnly();", "public function allAdminList(){\n $result = $this->adminModel->getAllAdmin();\n foreach ($result as $row){\n $data[] = array('AdminID'=>$row->adminID,'Email'=>$row->email,'role'=>$row->type,\n );\n }\n $this->view('admins/allAdminList',$data);\n\n }", "public function getAdministrator() {}", "public function crearadmin()\n {\n //busca en la tabla usuarios los campos donde el alias sea igual a admin si no encuentra nada devuelve null\n $usuarios = R::findOne('usuarios', 'alias=?', [\n \"admin\"\n ]);\n \n \n // ok es igual a true siempre y cuando usuarios sea distinto de null\n $ok = ($usuarios == null );\n if ($ok) {\n // crea la tabla usuarios\n $usuarios = R::dispense('usuarios');\n //crea los campos de la tabla usuarios\n $usuarios->nombre=\"admin\";\n $usuarios->primer_apellido=\"admin\";\n $usuarios->segundo_apellido=\"admin\";\n $usuarios-> fecha_nacimiento=\"1998/03/12\";\n $usuarios->fecha_de_registro=date('Y-m-d');\n $usuarios->email=\"admin@gmail.com\";\n $usuarios->telefono=\"6734687\";\n $usuarios->contrasena=password_hash(\"admin\", PASSWORD_DEFAULT);\n $usuarios->confirmar_contrasena=password_hash(\"admin\", PASSWORD_DEFAULT);\n $usuarios->alias=\"admin\";\n $usuarios->foto = null;\n //almacena los datos en la tabla usuarios\n R::store($usuarios);\n \n \n \n \n }\n \n \n \n \n \n \n }", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Menu::showMenu($error);\n return;\n }\n // see if we need to do anything to the db\n if(isset($_REQUEST['newadmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->department_id = $_REQUEST['department_id'];\n $admin->username = $_REQUEST['username'];\n $admin->save();\n }else if (isset($_REQUEST['deladmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->id = $_REQUEST['id'];\n $admin->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Menu::showMenu($error);\n return;\n }\n // see if we need to do anything to the db\n if(isset($_REQUEST['newadmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->department_id = $_REQUEST['department_id'];\n $admin->username = $_REQUEST['username'];\n $admin->save();\n }else if (isset($_REQUEST['deladmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->id = $_REQUEST['id'];\n $admin->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "public function admin_index(){\n\n\n\t\t\t// On liste toutes les utilisateurs\n\t\t\t$users = $this->User->find('all');\n\n\t\t\tif(!empty($users)){\n\t\t\t\t// Si on a des bacs, on liste les bacs\n\t\t\t\t$this->set(compact('users'));\n\t\t\t\t\n\t\t\t}\n\n\t\t}", "public static function get_admins();", "public function isAdmin();", "public function index() {\n $this->ograniczDostepTylkoDlaAdmina();\n $db = $this->registry->db; \n $login = isset($_SESSION['user']) ? $_SESSION['user'] : '';\n if ($db::isUserInRole($login, 'admin')) {\n $this->registry->template->results = $db::getTypyUrzadzenList();\n }\n //else\n //{\n //$thisd ->registry->template->results = $db::getUrzadeniaListByLogin($login); \n //}\n $this->registry->template->show('typy_urzadzen/typy_urzadzen_index');\n }", "public function isAdmin() {}", "public function all()\n {\n if (!$this->isLogged())\n {\n header('Location: ' . ROOT_URL);\n exit; \n }\n else{\n\n $this->oUtil->oAdd_Admins = $this->oModel->getAll();\n\n $this->oUtil->getView('admin');\n }\n }", "function mod_core_admin() {\n\t\tglobal $NeptuneCore;\n\t\tglobal $NeptuneSQL;\n\t\tglobal $NeptuneAdmin;\n\t\t\n\t\tif (!isset($NeptuneCore)) {\n\t\t\t$NeptuneCore = new NeptuneCore();\n\t\t}\t\n\t\tif (!isset($NeptuneSQL)) {\n\t\t\t$NeptuneSQL = new NeptuneSQL();\n\t\t}\t\n\t\tif (!isset($NeptuneAdmin)) {\n\t\t\t$NeptuneAdmin = new NeptuneAdmin();\n\t\t}\t\n\t\t\n\t\t\n\t\tif (neptune_get_permissions() >= 3) {\n\t\t\t$query = $NeptuneCore->var_get(\"system\",\"query\");\n\t\t\tif (@isset($query[1]) && @isset($query[2])) {\n\t\t\t\t$AdminFunction = \"acp_\" . $query[1] . \"_\" . $query[2];\n\t\t\t\t\n\t\t\t\t$AdminFunction();\n\t\t\t} else {\n\t\t\t\t$NeptuneAdmin->run();\n\t\t\t}\n\t\t} else {\n\t\t\t$NeptuneCore->title($NeptuneCore->var_get(\"locale\",\"accessdenied\"));\n\t\t\t$NeptuneCore->neptune_echo(\"<p>\" . $NeptuneCore->var_get(\"locale\",\"nopermission\") . \"</p>\");\n\t\t\t\n\t\t\theader(\"HTTP/1.1 403 Forbidden\");\n\t\t}\n\t}", "function get_super_admins()\n {\n }", "public function GetAdmin ();", "function admin_member() {\n\n\t\t}", "function index_superusuarios() {\n\t\t$conditions = array('Administrativo.perfil' => '0'); \n\t\t$order = array('Administrativo.nombre' => 'ASC');\n\t\t$administrativos=$this->Administrativo->find('all', array ('conditions' => $conditions, 'order' => $order));\t\t\n\t\t$perfil=$this->Perfil->find('all');\n\t\tforeach ($perfil as $p){\n\t\t\t$perfiles[$p['Perfil']['id']]=$p['Perfil']['perfil'];\n\t\t}\n\t\t$perfiles[0]='SuperAdministrador';\n\t\t$this->set('perfiles', $perfiles);\n\t\t$this->set('administrativos', $administrativos);\n\t}", "public function listmobilisateuradminAction() {\n\n $sessionutilisateur = new Zend_Session_Namespace('utilisateur');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmcadmin');\n \n if (!isset($sessionutilisateur->login)) {$this->_redirect('/administration/login');}\nif($sessionutilisateur->confirmation != \"\"){$this->_redirect('/administration/confirmation');}\n\n $mobilisateur = new Application_Model_EuMobilisateurMapper();\n //$this->view->entries = $mobilisateur->fetchAllByCanton($sessionutilisateur->id_utilisateur);\n $this->view->entries = $mobilisateur->fetchAll();\n\n $this->view->tabletri = 1;\n }", "public function page_default_administration()\n\t{\n\t\tFsb::$tpl->set_file('adm_index.html');\n\n\t\t// Les 5 derniers logs administratifs\n\t\t$logs = Log::read(Log::ADMIN, 5);\n\t\tforeach ($logs['rows'] AS $log)\n\t\t{\n\t\t\tFsb::$tpl->set_blocks('log', array(\n\t\t\t\t'STR' =>\t$log['errstr'],\n\t\t\t\t'INFO' =>\tsprintf(Fsb::$session->lang('adm_list_log_info'), htmlspecialchars($log['u_nickname']), Fsb::$session->print_date($log['log_time'])),\n\t\t\t));\n\t\t}\n\n\t\t// On affiche tous les comptes ?\n\t\t$show_all = (Http::request('show_all')) ? true : false;\n\n\t\t// Liste des comptes en attente de validation\n\t\t$sql = 'SELECT u_id, u_nickname, u_joined, u_register_ip\n\t\t\t\tFROM ' . SQL_PREFIX . 'users\n\t\t\t\tWHERE u_activated = 0\n\t\t\t\t\tAND u_confirm_hash = \\'.\\'\n\t\t\t\t\tAND u_id <> ' . VISITOR_ID . '\n\t\t\t\tORDER BY u_joined DESC\n\t\t\t\t' . (($show_all) ? '' : 'LIMIT 5');\n\t\t$result = Fsb::$db->query($sql);\n\t\twhile ($row = Fsb::$db->row($result))\n\t\t{\n\t\t\tFsb::$tpl->set_blocks('wait', array(\n\t\t\t\t'NICKNAME' =>\t\thtmlspecialchars($row['u_nickname']),\n\t\t\t\t'JOINED_IP' =>\t\tsprintf(Fsb::$session->lang('adm_joined_ip'), Fsb::$session->print_date($row['u_joined']), $row['u_register_ip']),\n\n\t\t\t\t'U_EDIT' =>\t\t\tsid(ROOT . 'index.' . PHPEXT . '?p=modo&amp;module=user&amp;id=' . $row['u_id']),\n\t\t\t\t'U_VALIDATE' =>\t\tsid('index.' . PHPEXT . '?mode=validate&amp;id=' . $row['u_id']),\n\t\t\t));\n\t\t}\n\t\tFsb::$db->free($result);\n\n\t\t// Liste des membres en ligne\n\t\t$sql = 'SELECT s.s_id, s.s_ip, s.s_page, s.s_user_agent, u.u_nickname, u.u_color, u.u_activate_hidden, b.bot_id, b.bot_name\n\t\t\tFROM ' . SQL_PREFIX . 'sessions s\n\t\t\tLEFT JOIN ' . SQL_PREFIX . 'users u\n\t\t\t\tON u.u_id = s.s_id\n\t\t\tLEFT JOIN ' . SQL_PREFIX . 'bots b\n\t\t\t\tON s.s_bot = b.bot_id\n\t\t\tWHERE s.s_time > ' . intval(CURRENT_TIME - 300) . '\n\t\t\tORDER BY u.u_auth DESC, u.u_nickname, s.s_id';\n\t\t$result = Fsb::$db->query($sql);\n\t\t$id_array = array();\n\t\t$ip_array = array();\n\t\t$f_idx = $t_idx = $p_idx = array();\n\t\t$logged = array('users' => array(), 'visitors' => array());\n\t\twhile ($row = Fsb::$db->row($result))\n\t\t{\n\t\t\tif (!is_null($row['bot_id']) || $row['s_id'] == VISITOR_ID)\n\t\t\t{\n\t\t\t\tif (in_array($row['s_ip'], $ip_array))\n\t\t\t\t{\n\t\t\t\t\tcontinue ;\n\t\t\t\t}\n\t\t\t\t$ip_array[] = $row['s_ip'];\n\t\t\t\t$type = 'visitors';\n\n\t\t\t\t// Les bots ont leur propre couleur\n\t\t\t\tif (!is_null($row['bot_id']))\n\t\t\t\t{\n\t\t\t\t\t$row['u_color'] = 'class=\"bot\"';\n\t\t\t\t\t$row['u_nickname'] = $row['bot_name'];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (in_array($row['s_id'], $id_array))\n\t\t\t\t{\n\t\t\t\t\tcontinue ;\n\t\t\t\t}\n\t\t\t\t$id_array[] = $row['s_id'];\n\t\t\t\t$type = 'users';\n\t\t\t}\n\n\t\t\t// Position du membre sur le forum\n\t\t\t$id = null;\n\t\t\t$method = 'forums';\n\t\t\tif (strpos($row['s_page'], 'admin/') !== false)\n\t\t\t{\n\t\t\t\t$location = Fsb::$session->lang('adm_location_adm');\n\t\t\t\t$url = 'admin/index.' . PHPEXT;\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$page = basename($row['s_page']);\n\t\t\t\t$url = '';\n\t\t\t\t$location = '';\n\t\t\t\tif (preg_match('#^index\\.' . PHPEXT . '\\?p=([a-z0-9_]+)(&.*?)*$#', $page, $match) || preg_match('#^(forum|topic|sujet)-([0-9]+)-([0-9]+)\\.html$#i', $page, $match))\n\t\t\t\t{\n\t\t\t\t\t$url = $match[0];\n\t\t\t\t\tswitch ($match[1])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'forum' :\n\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_forum');\n\t\t\t\t\t\t\tif (count($match) == 4)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$id = $match[2];\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\tpreg_match('#f_id=([0-9]+)#', $page, $match);\n\t\t\t\t\t\t\t\t$id = (isset($match[1])) ? $match[1] : null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($id) $f_idx[] = $id;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'topic' :\n\t\t\t\t\t\tcase 'sujet' :\n\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_topic');\n\t\t\t\t\t\t\tif (count($match) == 4)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$method = 'topics';\n\t\t\t\t\t\t\t\t$id = $match[2];\n\t\t\t\t\t\t\t\t$t_idx[] = $id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (preg_match('#t_id=([0-9]+)#', $page, $match))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$method = 'topics';\n\t\t\t\t\t\t\t\t$id = (isset($match[1])) ? $match[1] : null;\n\t\t\t\t\t\t\t\tif ($id) $t_idx[] = $id;\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$method = 'posts';\n\t\t\t\t\t\t\t\tpreg_match('#p_id=([0-9]+)#', $page, $match);\n\t\t\t\t\t\t\t\t$id = (isset($match[1])) ? $match[1] : null;\n\t\t\t\t\t\t\t\tif ($id) $p_idx[] = $id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'post' :\n\t\t\t\t\t\t\tpreg_match('#mode=([a-z_]+)#', $page, $mode);\n\t\t\t\t\t\t\tpreg_match('#id=([0-9]+)#', $page, $match);\n\t\t\t\t\t\t\t$id = (isset($match[1])) ? $match[1] : null;\n\t\t\t\t\t\t\tswitch ($mode[1])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase 'topic' :\n\t\t\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_post_new');\n\t\t\t\t\t\t\t\t\tif ($id) $f_idx[] = $id;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'reply' :\n\t\t\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_post_reply');\n\t\t\t\t\t\t\t\t\tif ($id) $t_idx[] = $id;\n\t\t\t\t\t\t\t\t\t$method = 'topics';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'edit' :\n\t\t\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_post_edit');\n\t\t\t\t\t\t\t\t\tif ($id) $p_idx[] = $id;\n\t\t\t\t\t\t\t\t\t$method = 'posts';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'mp' :\n\t\t\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_mp_write');\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'calendar_add' :\n\t\t\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_calendar_event');\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'calendar_edit' :\n\t\t\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_calendar_event_edit');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\tif (Fsb::$session->lang('adm_location_' . $match[1]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_' . $match[1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!$location)\n\t\t\t\t{\n\t\t\t\t\t$location = Fsb::$session->lang('adm_location_index');\n\t\t\t\t\t$url = 'index.' . PHPEXT;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$logged[$type][] = array(\n\t\t\t\t'nickname' =>\t\tHtml::nickname($row['u_nickname'], $row['s_id'], $row['u_color']),\n\t\t\t\t'agent' =>\t\t\t$row['s_user_agent'],\n\t\t\t\t'ip' =>\t\t\t\t$row['s_ip'],\n\t\t\t\t'location' =>\t\t$location,\n\t\t\t\t'url' =>\t\t\tsid(ROOT . $url),\n\t\t\t\t'method' =>\t\t\t$method,\n\t\t\t\t'id' =>\t\t\t\t$id,\n\t\t\t);\n\n\n\t\t}\n\t\tFsb::$db->free($result);\n\n\t\t// On recupere une liste des forums pour connaitre la position du membre sur le forum\n\t\t$forums = array();\n\t\tif ($f_idx)\n\t\t{\n\t\t\t$sql = 'SELECT f.f_id, f.f_name, cat.f_id AS cat_id, cat.f_name AS cat_name\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'forums f\n\t\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'forums cat\n\t\t\t\t\t\tON f.f_cat_id = cat.f_id\n\t\t\t\t\tWHERE f.f_id IN (' . implode(', ', $f_idx) . ')';\n\t\t\t$result = Fsb::$db->query($sql, 'forums_');\n\t\t\t$forums = Fsb::$db->rows($result, 'assoc', 'f_id');\n\t\t}\n\n\t\t// On recupere une liste des sujets pour connaitre la position du membre sur le forum\n\t\t$topics = array();\n\t\tif ($t_idx)\n\t\t{\n\t\t\t$sql = 'SELECT f.f_id, f.f_name, cat.f_id AS cat_id, cat.f_name AS cat_name, t.t_id, t.t_title\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'topics t\n\t\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'forums f\n\t\t\t\t\t\tON f.f_id = t.f_id\n\t\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'forums cat\n\t\t\t\t\t\tON f.f_cat_id = cat.f_id\n\t\t\t\t\tWHERE t.t_id IN (' . implode(', ', $t_idx) . ')';\n\t\t\t$result = Fsb::$db->query($sql, 'forums_');\n\t\t\t$topics = Fsb::$db->rows($result, 'assoc', 't_id');\n\t\t}\n\n\t\t// On recupere une liste des messages pour connaitre la position du membre sur le forum\n\t\t$posts = array();\n\t\tif ($p_idx)\n\t\t{\n\t\t\t$sql = 'SELECT f.f_id, f.f_name, cat.f_id AS cat_id, cat.f_name AS cat_name, p.p_id, t.t_id, t.t_title\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'posts p\n\t\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'topics t\n\t\t\t\t\t\tON p.t_id = t.t_id\n\t\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'forums f\n\t\t\t\t\t\tON f.f_id = p.f_id\n\t\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'forums cat\n\t\t\t\t\t\tON f.f_cat_id = cat.f_id\n\t\t\t\t\tWHERE p.p_id IN (' . implode(', ', $p_idx) . ')';\n\t\t\t$result = Fsb::$db->query($sql, 'forums_');\n\t\t\t$posts = Fsb::$db->rows($result, 'assoc', 'p_id');\n\t\t}\n\n\t\t// On affiche les membres en ligne\n\t\tforeach ($logged AS $type => $list)\n\t\t{\n\t\t\tif ($list)\n\t\t\t{\n\t\t\t\tFsb::$tpl->set_blocks('logged', array(\n\t\t\t\t\t'TITLE' =>\t\tFsb::$session->lang('adm_list_logged_' . $type),\n\t\t\t\t));\n\n\t\t\t\tforeach ($list AS $u)\n\t\t\t\t{\n\t\t\t\t\t// On definit si on cherche la liste des forums dans $forums ou $topics\n\t\t\t\t\t$m = $u['method'];\n\t\t\t\t\t$data_exists = ($u['id'] && isset(${$m}[$u['id']])) ? true : false;\n\t\t\t\t\t$topic_exists = ($data_exists && isset(${$m}[$u['id']]['t_title'])) ? true : false;\n\n\t\t\t\t\tFsb::$tpl->set_blocks('logged.u', array(\n\t\t\t\t\t\t'NICKNAME' =>\t\t$u['nickname'],\n\t\t\t\t\t\t'AGENT' =>\t\t\t$u['agent'],\n\t\t\t\t\t\t'IP' =>\t\t\t\t$u['ip'],\n\t\t\t\t\t\t'LOCATION' =>\t\t$u['location'],\n\t\t\t\t\t\t'URL' =>\t\t\t$u['url'],\n\t\t\t\t\t\t'CAT_NAME' =>\t\t($data_exists) ? ${$m}[$u['id']]['cat_name'] : null,\n\t\t\t\t\t\t'FORUM_NAME' =>\t\t($data_exists) ? ${$m}[$u['id']]['f_name'] : null,\n\t\t\t\t\t\t'TOPIC_NAME' =>\t\t($topic_exists) ? Parser::title(${$m}[$u['id']]['t_title']) : '',\n\t\t\t\t\t\t'U_CAT' =>\t\t\t($data_exists) ? sid(ROOT . 'index.' . PHPEXT . '?p=index&amp;cat=' . ${$m}[$u['id']]['cat_id']) : null,\n\t\t\t\t\t\t'U_FORUM' =>\t\t($data_exists) ? sid(ROOT . 'index.' . PHPEXT . '?p=forum&amp;f_id=' . ${$m}[$u['id']]['f_id']) : null,\n\t\t\t\t\t\t'U_TOPIC' =>\t\t($topic_exists) ? sid(ROOT . 'index.' . PHPEXT . '?p=topic&amp;t_id=' . ${$m}[$u['id']]['t_id']) : null,\n\t\t\t\t\t\t'U_IP' =>\t\t\tsid(ROOT . 'index.' . PHPEXT . '?p=modo&amp;module=ip&amp;ip=' . $u['ip']),\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// On verifie si le SDK n'a pas ete desactive\n\t\tif(intval(Fsb::$cfg->get('disable_sdk')))\n\t\t{\n\t\t\tFsb::$tpl->set_switch('sdk_disabled');\n\t\t}\n\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'FSB_SUPPORT' =>\t\t'http://www.fire-soft-board.com',\n\t\t\t'FSB_LANG_SUPPORT' =>\tFsb::$session->lang('fsb_lang_support'),\n\t\t\t'NEW_VERSION' =>\t\t(!is_last_version(Fsb::$cfg->get('fsb_version'), Fsb::$cfg->get('fsb_last_version'))) ? sprintf(Fsb::$session->lang('adm_fsb_new_version'), Fsb::$cfg->get('fsb_version'), Fsb::$cfg->get('fsb_last_version')) : null,\n\t\t\t'SHOW_ALL' =>\t\t\t$show_all,\n\t\t\t'ROOT_SUPPORT' => \t\tsprintf(Fsb::$session->lang('adm_root_support_active_explain'), 'index.' . PHPEXT . '?p=mods_manager'),\n\n\t\t\t'U_SHOW_ALL' =>\t\t\tsid('index.' . PHPEXT . '?show_all=true'),\n\t\t\t'U_CHECK_VERSION' =>\tsid('index.' . PHPEXT . '?mode=version'),\n\t\t));\n\t}", "public function get_adminlist(){\n \n \t\t$sql4=\"SELECT * FROM admin\";\n\t $result4 = mysqli_query($this->db,$sql4);\n\t while($adminlist_data = mysqli_fetch_array($result4)){\n echo '<tr>\n <td>'.$adminlist_data[\"admin_id\"].'</td>\n <td>'.$adminlist_data[\"name\"].'</td>\n <td>'.$adminlist_data[\"password\"].'</td>\n <td>'.$adminlist_data[\"admin_type\"].'</td>\n <td>'.$adminlist_data[\"journal_id\"].'</td>\n <td class=\"text-center\">\n <a href=\"about_admin.php?admin_id='.$adminlist_data[\"admin_id\"].'\" title=\"Edit\"><i class=\"fa fa-edit\"></i></a>\n </td>\n <td class=\"text-center\">\n <a href=\"delete.php?admin_id='.$adminlist_data[\"admin_id\"].'&type=admin\" title=\"Delete\"><i class=\"fa fa-trash-o\"></i></a>\n </td>\n </tr>';\n }\n return true;\n \t}", "public static function getAdminsList()\n {\n $data_to_load = [];\n if(DatabaseManager::fetchInto(\"main\", $data_to_load, \"SELECT * FROM `admin_users`\") === false)\n Status::message(Status::ERROR, \"Couldn't retrieve `admin_users` from DB\");\n \n Status::message(Status::SUCCESS, $data_to_load);\n }", "function abmUsuarios()\n {\n $this->checkCredentials();\n $users = $this->modelUser->getAllUsers();\n $this->view->showAbmUsuarios($users);\n }", "public function adminControl()\n {\n $row = $this->currentUserData();\n if(isset($_SESSION['sess_user_type']) &&\n $_SESSION['sess_user_type'] == 'admin' && $row['user_type'] == 'admin'){\n return true;\n }\n }", "function opciones_admin(){\n\tif ($_SESSION[\"tipo_user\"] === \"admin\"){\n\t\t$href = [\"miembros\", \"biografia\", \"discografia\", \"conciertos\", \"usuarios\", \"backup\",\"restore\",\"borrarBD\", \"log\", \"logout\"];\n\t\t$name = [\"Editar miembros Grupo\", \"Editar biografía\", \"Editar discografía\", \"Editar conciertos\", \"Editar usuarios\", \"BackUp\",\"Restore\",\"Borrar BD\",\"Ver log del servidor\", \"Desconectarse\"];\n\t\techo '<div id=\"panel_control\" align=\"center\">';\n\t\t\techo '<div class=\"login\">';\n\t\t\t\techo \"<ul>\";\n\t\t\t\tforeach($href as $i => $val){\n\t\t\t\t\techo \"<li><a href='dashboard.php?accion=$val#panel_control'>{$name[$i]}</a></li>\";\n\t\t\t\t}\n\t\t\t\techo \"</ul>\";\n\t\t\techo \"</div>\";\n\t\techo \"</div>\";\n\t\t\n\t\tacciones();\n\t}\n}", "function bacaDataadmin($field, $id_admin_agt) {\n $query = \"SELECT * FROM admin WHERE id_admin = '$id_admin_agt'\";\n $hasil = mysql_query($query);\n $data = mysql_fetch_array($hasil);\n if ($field == 'username')\n return $data['username'];\n else if ($field == 'password')\n return $data['password'];\n }", "public function indexAdmin()\n {\n $nodos = $this->mdlnodo->consultarnodos();\n require APP . 'view/_templates/headeradminodos.php';\n require APP . 'view/proyecto/admin/index.php';\n\t\t require APP . 'view/_footer/footeradminnodos.php';\n }", "public function adminmenu()\n {\n\n $vue = new ViewAdmin(\"Administration\");\n $vue->generer(array());\n }", "function index_usuarios() {\n\t\t$conditions = array('Administrativo.perfil >' => '0'); \n\t\t$order = array('Administrativo.nombre' => 'ASC');\n\t\t$administrativos=$this->Administrativo->find('all', array ('conditions' => $conditions, 'order' => $order));\t\t\n\t\t$perfil=$this->Perfil->find('all');\n\t\tforeach ($perfil as $p){\n\t\t\t$perfiles[$p['Perfil']['id']]=$p['Perfil']['perfil'];\n\t\t}\n\t\t$perfiles[0]='SuperAdministrador';\n\t\t$this->set('perfiles', $perfiles);\n\t\t$this->set('administrativos', $administrativos);\n\t}", "public function admin_index() {\n\t\t$this->layout=\"admindefault\";\n\t\t$this->adminsessionchecked();\n\t\t$this->User->recursive = 0;\n\t\t$this->Paginator->settings=array(\n\t\t\t'conditions'=>array(\n\t\t\t\t'User.is_deleted'=>'0'\n\t\t\t)\n\t\t);\n\t\t$this->set('users', $this->Paginator->paginate());\n\t\t//$this->set('allowedimage',$this->allowedimageType);\n\t}", "function show_admin_data($root)\n{\n?>\n<h2 class=\"heading\" align=\"center\">Administrasi Data</h2>\n<?php\n\t$sql = 'SELECT nim, nama, alamat FROM ' . MHS;\n\t$res = mysql_query($sql);\n\t\n\tif ($res)\n\t{\n\t\t$num = mysql_num_rows($res);\n\t\tif ($num)\n\t\t{\n?>\n<div class=\"container\">\n\t<div class=\"row clearfix\">\n\t\t<div class=\"col-md-12 column\">\n\t\t<table class=\"table\">\n\t\t\t<a href=\"<?php echo $root;?>&amp;act=add\">Tambah Data </a>\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th>#</th>\n\t\t\t\t<th>NIM</th>\n\t\t\t\t<th>Nama</th>\n\t\t\t\t<th>Alamat</th>\n\t\t\t\t<th>Menu</th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t<?php\n\t\t\t$i = 1;\n\t\t\twhile ($row = mysql_fetch_row($res))\n\t\t\t{\n\t\t\t\t$bg = (($i % 2) != 0) ? '' : 'even';\n\t\t\t\t$id = $row[0]; ?>\n\t\t\t\t<tr class=\"<?php echo $bg;?>\">\n\t\t\t\t\t<td width=\"2%\"><?php echo $i;?></td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<a href=\"<?php echo $root;?>&amp;act=view&amp;id=<?php echo $id;?>\" title=\"Lihat Data\"><?php echo $id;?></a>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td><?php echo $row[1];?></td>\n\t\t\t\t\t<td><?php echo $row[2];?></td>\n\t\t\t\t\t<td>\n\t\t\t\t\t| <a href=\"<?php echo $root;?>&amp;act=edit&amp;id=<?php echo $id;?>\">Edit</a> |\n\t\t\t\t\t<a href=\"delete.php\">Hapus</a>\n\t\t\t\t\t<!--\n\t\t\t\t\tLengkapi kode PHP untuk membuat link hapus data\n\t\t\t\t\t-->\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<?php\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t?>\n\t\t\t</tbody>\n\t\t</table>\n\t\t</div>\n\t</div>\n</div>\n\t\t<?php\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo 'Beluma ada data, isi <a href=\"'.$root.'&amp;act=add\">di sini</a>';\n\t\t}\n\t\t@mysql_close($res);\n\t}\n}", "private function administer(): array {\n return [\n 'title' => $this->t('Administer Team'),\n 'restrict access' => TRUE,\n ];\n }", "public function showAdmins() { \n\t\n return View('admin.admins');\n\t\t\t\n }", "function get_admin()\n {\n return DB::table(\"admin_tbl\")->get();\n }", "function editAdminsManagement($id_users, $pseudo, $lastname, $firstname, $email, $roleusers){\n $managementAdminsEdition = new \\Project\\Models\\ManagementAdminManager();\n $managementEditionAdmins = $managementAdminsEdition->adminsManagementEdition($id_users, $pseudo, $lastname, $firstname, $email, $roleusers);\n\n header(\"Location: administration.php?action=managementAdmin&id=$id_users\");\n \n \n }", "public function isAdministrador(){ return false; }", "public function IsAdmin ();", "public function isAdmin()\n {\n }", "public function actionAdmin() {\n $searchModel = new OfertasLaboralesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('admin', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function admin()\n {\n if ($this->loggedIn()) {\n $data['flights'] = $this->modalPage->getFlights();\n $data['name'] = $_SESSION['user_name'];\n $data['title'] = 'dashboard ' . $_SESSION['user_name'];\n $this->view(\"dashboard/\" . $_SESSION['user_role'], $data);\n\n } else {\n redirect('users/login');\n }\n\n }", "public function admin_index() {\n\t\t\t$this->layout = \"default2\";\n\t\t\t$users = $this->User->find('all', array(\n\t\t\t\t'fields'=>array('id', 'username', 'mail', 'groups_id')\n\t\t\t\t)\n\t\t\t);\n\t \t\t$this->set(compact('users'));\n\t\t}", "protected function addAdmins(){\n\t\t\n\t\t$users = $this->getOption('users');\n\t\tif (!$users) $this->setError('noUsers');\n\t\tforeach ($users as $userid)\n\t\t\tif (!is_numeric($userid) || !$this->doesUserExists($userid,$this->isDebug())) throw new ForumMException('user id ('.$userid.') is invalid');\t\t\n\t\t\n\t\tif ($this->isError()) return;\n\t\t\n\t\t$name = $this->getName();\n\t\tif (!$name){\n\t\t\t$this->retrieveForumInfo($this->getId(),$this->isDebug());\n\t\t\t$name = $this->getName();\n\t\t} \n\t\t\n\t\t$this->retrieveForumPermissions($name,$this->isDebug());\n\t\t\n\t\t$this->setAdmins($users,$this->isDebug());\t\t\n\t}", "function Admin_authetic(){\n\t\t\t\n\t\tif(!$_SESSION['adminid']) {\n\t\t\t$this->redirectUrl(\"login.php\");\n\t\t}\n\t}", "function ShowAdministrar($peliculas, $generos){\n if (isset($_SESSION['email'])){\n $this->setUserBasicsToSmarty();\n $this->smarty->display('templates/admin.tpl');\n }else{\n $this->ReLocalizar(\"login\");\n }\n }", "function adminUserList()\n {\n $arrClms = array(\n 'pkAdminID',\n 'AdminUserName',\n 'AdminCountry',\n 'AdminRegion'\n );\n $varWhr = \"AdminType = 'user-admin'\";\n $varOrderBy = 'AdminUserName ASC ';\n $arrRes = $this->select(TABLE_ADMIN, $arrClms, $varWhr);\n //pre($arrRes);\n return $arrRes;\n }", "function managementAdminAll(){\n $Admins = new \\Project\\Models\\ManagementAdminManager();\n $allAdmin = $Admins->allManagementAdmin();\n\n require 'app/views/back/managementAdmin.php';\n }", "public function isAdmin(){\n\t\tparent::isAdmin();\n\t}", "public function indexHistorialAdmin()\n { \n \n $username = $this->getRequest()->getSession()->read('id'); //obtiene el nombre de usuario actualmente logueado\n \n /*Inicia seguridad*/\n $seguridad = $this->loadModel('Seguridad');\n $carne = $this->request->getSession()->read('id');\n $rolActual = $seguridad->getRol($carne);\n if ($carne != ''){\n $resultado = $seguridad->getPermiso($carne,13);\n $rolAdecuado = false;\n if($rolActual == 1 || $rolActual == 2){\n $rolAdecuado = true;\n }\n if($resultado != 1 || !$rolAdecuado){\n return $this->redirect(['controller' => 'Inicio','action' => 'fail']);\n }\n }\n else{\n return $this->redirect(['controller' => 'Inicio','action' => 'fail']);\n\n }\n /*Cierra la seguridad*/\n \n $idActual = $this->Solicitudes->getIDUsuario($username); //obtiene el id de usuario actualmente logueado\n \n $todo = $this->Solicitudes->getIndexValues(); //carga el index con todas las solicitudes existentes \n \n \n $this->paginate = [\n 'contain' => ['Usuarios', 'Grupos']\n ];\n $estado = $this->get_estado_ronda();\n $this->set(compact('todo','estado'));\n $this->set('rolActual',$rolActual);\n }", "function visible_to_admin_user()\n\t{\n\t\treturn true;\n\t}", "public function indexAdmin()\n {\n //\n $providers = DB::table('users')\n ->where('roles_id', '=', 1)\n ->orWhere('roles_id', '=', 4)\n ->get();\n //dd($providers);\n return view('map.adminmap')->with('parameters', Parameters::all()->sortBy('id'))\n ->with('parkingtypes', ParkingType::all()->sortBy('id'))->with('providers', $providers);\n\n }", "protected function isAdminUser() {}", "function VisibleToAdminUser()\n {\n\tinclude (\"dom.php\");\n return $this->CheckPermission($pavad.' Use');\n }", "function anuncios_admin() {\n\t\tinclude('anuncios_admin.php');\n\t}", "function is_user_admin()\n {\n }", "function isAdmin(){\n global $db;\n\n $admins = ['M1593201513@hotmail.fr', 'client@client.com']; //Tableau des emails des admins\n $user = $_SESSION['user'] ?? false; \n\n //On va rafraichir la session avec la BDD au cas ou on changerai le role d'un utilisateur alors qu'il est connecté\n if ($user){\n $_SESSION['user'] = $db->query('SELECT * FROM user WHERE id = '.$user['id'])->fetch();\n $user = $_SESSION['user'];\n }\n\n\n if ($user && in_array($user['email'], $admins)){\n return true; //La fonction s'arréte et retourne true si l'utilisateur est un admin\n }\n\n //Pour rendre cette partie plus dynamique, on peut ajouter une colonne rôle sur la table user\n //Par défaut, un inscrit aura la rôle \"user\"\n //Sur le dashboard, on pourrait ajouter une page listant les utilisateurs et permettant de changer son rôle\n //On aura donc une action \"promouvoir en admin\" où il faudra faire un UPDATE sur le user dans la table pour changer son rôle en \"admin\"\n //On pourra ensuite ajouter un if dans cette fonction pour vérifier si le rôle du user est bien admin\n if ($user && $user['role']=== 'admin'){\n return true;\n }\n\n\n return false; //Le user n'est pas admin\n}", "public function adminPanel()\n {\n $userManager = new UserManager;\n $infoUser = $userManager->getInfo($_SESSION['id_user']);\n if ($_SESSION['id_user'] == $infoUser['id'] and $infoUser['rank_id'] == 1) {\n $postManager = new PostManager;\n $commentManager = new CommentManager;\n $findPost = $postManager->getPosts();\n $commentReport = $commentManager->getReport();\n $unpublished = $commentManager->getUnpublished();\n require('Views/Backend/panelAdminView.php');\n } else {\n throw new Exception('Vous n\\'êtes pas autorisé à faire cela');\n }\n }", "function admin_index(){\r\n\t $this->__requireRole(ROLE_TUTOR);\r\n//\t $this->Scenariosetup->bindModel(array('hasOne' => array('Player')));\r\n\t $this->set('scenariosetups', $this->Scenariosetup->findAll());\r\n\t $this->set('usedParametersets', $this->UsedParameterset->findAll());\r\n\t $this->render();\r\n\t}", "public function getAdministrator() {\n\n return database::getInstance()->select('staff',\"*\");\n\n\n }", "function isAdmin(){\n$user = $this->loadUser(Yii::app()->user->user_id);\nreturn intval($user->user_role_id) == 1;\n}", "function addAdminMenu()\n\t{\n\t\tglobal $tpl, $tree, $rbacsystem, $lng;\n\n\t\tinclude_once(\"./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php\");\n\t\t$gl = new ilGroupedListGUI();\n\n\t\t$objects = $tree->getChilds(SYSTEM_FOLDER_ID);\n\t\tforeach($objects as $object)\n\t\t{\n\t\t\t$new_objects[$object[\"title\"].\":\".$object[\"child\"]]\n\t\t\t\t= $object;\n\t\t\t//have to set it manually as translation type of main node cannot be \"sys\" as this type is a orgu itself.\n\t\t\tif($object[\"type\"] == \"orgu\")\n\t\t\t\t$new_objects[$object[\"title\"].\":\".$object[\"child\"]][\"title\"] = $lng->txt(\"obj_orgu\");\n\t\t}\n\n\t\t// add entry for switching to repository admin\n\t\t// note: please see showChilds methods which prevents infinite look\n\t\t$new_objects[$lng->txt(\"repository_admin\").\":\".ROOT_FOLDER_ID] =\n\t\t\tarray(\n\t\t\t\t\"tree\" => 1,\n\t\t\t\t\"child\" => ROOT_FOLDER_ID,\n\t\t\t\t\"ref_id\" => ROOT_FOLDER_ID,\n\t\t\t\t\"depth\" => 3,\n\t\t\t\t\"type\" => \"root\",\n\t\t\t\t\"title\" => $lng->txt(\"repository_admin\"),\n\t\t\t\t\"description\" => $lng->txt(\"repository_admin_desc\"),\n\t\t\t\t\"desc\" => $lng->txt(\"repository_admin_desc\"),\n\t\t\t);\n\n//$nd = $tree->getNodeData(SYSTEM_FOLDER_ID);\n//var_dump($nd);\n\t\t$new_objects[$lng->txt(\"general_settings\").\":\".SYSTEM_FOLDER_ID] =\n\t\t\tarray(\n\t\t\t\t\"tree\" => 1,\n\t\t\t\t\"child\" => SYSTEM_FOLDER_ID,\n\t\t\t\t\"ref_id\" => SYSTEM_FOLDER_ID,\n\t\t\t\t\"depth\" => 2,\n\t\t\t\t\"type\" => \"adm\",\n\t\t\t\t\"title\" => $lng->txt(\"general_settings\"),\n\t\t\t);\n\t\tksort($new_objects);\n\n\t\t// determine items to show\n\t\t$items = array();\n\t\tforeach ($new_objects as $c)\n\t\t{\n\t\t\t// check visibility\n\t\t\tif ($tree->getParentId($c[\"ref_id\"]) == ROOT_FOLDER_ID && $c[\"type\"] != \"adm\" &&\n\t\t\t\t$_GET[\"admin_mode\"] != \"repository\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// these objects may exist due to test cases that didnt clear\n\t\t\t// data properly\n\t\t\tif ($c[\"type\"] == \"\" || $c[\"type\"] == \"objf\" ||\n\t\t\t\t$c[\"type\"] == \"xxx\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$accessible = $rbacsystem->checkAccess('visible,read', $c[\"ref_id\"]);\n\t\t\tif (!$accessible)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($c[\"ref_id\"] == ROOT_FOLDER_ID &&\n\t\t\t\t!$rbacsystem->checkAccess('write', $c[\"ref_id\"]))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($c[\"type\"] == \"rolf\" && $c[\"ref_id\"] != ROLE_FOLDER_ID)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$items[] = $c;\n\t\t}\n\n\t\t$titems = array();\n\t\tforeach ($items as $i)\n\t\t{\n\t\t\t$titems[$i[\"type\"]] = $i;\n\t\t}\n\t\t// admin menu layout\n\t\t$layout = array(\n\t\t\t1 => array(\n\t\t\t\t\"adn\" =>\n\t\t\t\t\tarray(\"xaad\", \"xaec\",\"xaed\", \"xaes\", \"xaep\", \"xacp\", \"xata\", \"xamd\", \"xast\"),\n\t\t\t\t\"basic\" =>\n\t\t\t\t\tarray(\"adm\", \"stys\", \"adve\", \"lngf\", \"hlps\", \"accs\", \"cmps\", \"extt\"),\n\t\t\t\t\"user_administration\" =>\n\t\t\t\t\tarray(\"usrf\", 'tos', \"rolf\", \"auth\", \"ps\", \"orgu\"),\n\t\t\t\t\"learning_outcomes\" =>\n\t\t\t\t\tarray(\"skmg\", \"cert\", \"trac\")\n\t\t\t),\n\t\t\t2 => array(\n\t\t\t\t\"user_services\" =>\n\t\t\t\t\tarray(\"pdts\", \"prfa\", \"nwss\", \"awra\", \"cadm\", \"cals\", \"mail\"),\n\t\t\t\t\"content_services\" =>\n\t\t\t\t\tarray(\"seas\", \"mds\", \"tags\", \"taxs\", 'ecss', \"pays\", \"otpl\"),\n\t\t\t\t\"maintenance\" =>\n\t\t\t\t\tarray('sysc', \"recf\", 'logs', \"root\")\n\t\t\t),\n\t\t\t3 => array(\n\t\t\t\t\"container\" =>\n\t\t\t\t\tarray(\"reps\", \"crss\", \"grps\", \"prgs\"),\n\t\t\t\t\"content_objects\" =>\n\t\t\t\t\tarray(\"bibs\", \"blga\", \"chta\", \"excs\", \"facs\", \"frma\",\n\t\t\t\t\t\t\"lrss\", \"mcts\", \"mobs\", \"svyf\", \"assf\", \"wbrs\", \"wiks\")\n\t\t\t)\n\t\t);\n\n\t\t// now get all items and groups that are accessible\n\t\t$groups = array();\n\t\tfor ($i = 1; $i <= 3; $i++)\n\t\t{\n\t\t\t$groups[$i] = array();\n\t\t\tforeach ($layout[$i] as $group => $entries)\n\t\t\t{\n\t\t\t\t$groups[$i][$group] = array();\n\t\t\t\t$entries_since_last_sep = false;\n\t\t\t\tforeach ($entries as $e)\n\t\t\t\t{\n\t\t\t\t\tif ($e == \"---\" || $titems[$e][\"type\"] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($e == \"---\" && $entries_since_last_sep)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$groups[$i][$group][] = $e;\n\t\t\t\t\t\t\t$entries_since_last_sep = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($e != \"---\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$groups[$i][$group][] = $e;\n\t\t\t\t\t\t\t$entries_since_last_sep = true;\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\tinclude_once(\"./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php\");\n\t\t$gl = new ilGroupedListGUI();\n\n\t\tfor ($i = 1; $i <= 3; $i++)\n\t\t{\n\t\t\tif ($i > 1)\n\t\t\t{\n//\t\t\t\t$gl->nextColumn();\n\t\t\t}\n\t\t\tforeach ($groups[$i] as $group => $entries)\n\t\t\t{\n\t\t\t\tif (count($entries) > 0)\n\t\t\t\t{\n\t\t\t\t\t$gl->addGroupHeader($lng->txt(\"adm_\".$group));\n\n\t\t\t\t\tforeach ($entries as $e)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($e == \"---\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$gl->addSeparator();\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$path = ilObject::_getIcon(\"\", \"tiny\", $titems[$e][\"type\"]);\n\t\t\t\t\t\t\t$icon = ($path != \"\")\n\t\t\t\t\t\t\t\t? ilUtil::img($path).\" \"\n\t\t\t\t\t\t\t\t: \"\";\n\n\t\t\t\t\t\t\tif ($_GET[\"admin_mode\"] == \"settings\" && $titems[$e][\"ref_id\"] == ROOT_FOLDER_ID)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$gl->addEntry($icon.$titems[$e][\"title\"],\n\t\t\t\t\t\t\t\t\t\"ilias.php?baseClass=ilAdministrationGUI&amp;ref_id=\".\n\t\t\t\t\t\t\t\t\t$titems[$e][\"ref_id\"].\"&amp;admin_mode=repository\",\n\t\t\t\t\t\t\t\t\t\"_top\", \"\", \"\", \"mm_adm_rep\",\n\t\t\t\t\t\t\t\t\tilHelp::getMainMenuTooltip(\"mm_adm_rep\"),\n\t\t\t\t\t\t\t\t\t\"bottom center\", \"top center\", false);\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$gl->addEntry($icon.$titems[$e][\"title\"],\n\t\t\t\t\t\t\t\t\t\"ilias.php?baseClass=ilAdministrationGUI&amp;ref_id=\".\n\t\t\t\t\t\t\t\t\t$titems[$e][\"ref_id\"].\"&amp;cmd=jump\",\n\t\t\t\t\t\t\t\t\t\"_top\", \"\", \"\", \"mm_adm_\".$titems[$e][\"type\"],\n\t\t\t\t\t\t\t\t\tilHelp::getMainMenuTooltip(\"mm_adm_\".$titems[$e][\"type\"]),\n\t\t\t\t\t\t\t\t\t\"bottom center\", \"top center\", false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//$gl->addSeparator();\n\n\t\t$tpl->setLeftNavContent(\"<div id='adn_adm_side_menu'>\".$gl->getHTML().\"</div>\");\n\t}", "public function get_list_admin()\n {\n $this->db->where('type', 1);\n $query = $this->db->get('user');\n return $query->result();\n }", "public function displayAdminPanel() {}", "public static function getAll() {\n global $lC_Database, $lC_Language, $_module;\n\n $lC_Language->loadIniFile('administrators.php');\n \n $media = $_GET['media'];\n \n /* Filtering */\n $aWhere = \"\";\n if ($_GET['aSearch'] != \"\") {\n $aWhere = \"where id = '\" . (int)$_GET['aSearch'] . \"'\";\n } \n\n $Qadmins = $lC_Database->query('select * from :table_administrators ' . $aWhere . ' order by user_name');\n $Qadmins->bindTable(':table_administrators', TABLE_ADMINISTRATORS);\n $Qadmins->execute();\n\n $result = array('entries' => array());\n $result = array('aaData' => array());\n $cnt = 0;\n while ( $Qadmins->next() ) {\n $group = self::getGroupName($Qadmins->valueInt('access_group_id')) ;\n $color = ($odd == $cnt%2) ? 'purple-bg' : 'green-bg';\n if ($Qadmins->valueInt('access_group_id') == 1) $color = 'red-bg';\n\n $last = '<td>' . $Qadmins->valueProtected('last_name') . '</td>';\n $first = '<td>' . $Qadmins->valueProtected('first_name') . '</td>';\n $user = '<td>' . $Qadmins->valueProtected('user_name') . '</td>';\n $group = '<td><small class=\"tag ' . $color . '\">' . self::getGroupName($Qadmins->valueInt('access_group_id')) . '</small></td>';\n $action = '<td class=\"align-right vertical-center\"><span class=\"button-group compact\">\n <a href=\"' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? '#' : 'javascript://\" onclick=\"editAdmin(\\'' . $Qadmins->valueInt('id') . '\\')') . '\" class=\"button icon-pencil ' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? 'disabled' : NULL) . '\">' . (($media === 'mobile-portrait' || $media === 'mobile-landscape') ? NULL : $lC_Language->get('icon_edit')) . '</a>\n <a href=\"' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? '#' : 'javascript://\" onclick=\"deleteAdmin(\\'' . $Qadmins->valueInt('id') . '\\', \\'' . urlencode($Qadmins->valueProtected('user_name')) . '\\')') . '\" class=\"button icon-trash with-tooltip ' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? 'disabled' : NULL) . '\" title=\"' . $lC_Language->get('icon_delete') . '\"></a></span></td>';\n\n $result['aaData'][] = array(\"$last\", \"$first\", \"$user\", \"$group\", \"$action\");\n $result['entries'][] = $Qadmins->toArray();\n $cnt++;\n }\n $Qadmins->freeResult();\n\n return $result;\n }", "public function administrador()\n {\n return false;\n }", "public function adminTeacher(){\n\n }", "public function isAdmin(){\n $user = \\Auth::user();//ambil data user yang login dan berusaha akses menu di bawah\n return $user->isAdmin;//kembalikan nilai bahwa user ini admin atau bukan..\n }", "function superadmin_view($id=NULL) {\n\t\t$this->set('meta_title','User Group Details');\n\t\t$this->id= (int)$id;\n\t\tif(!$this->id) {\n\t\t\t$this->Session->setFlash('Invalid admin user id.');\n\t\t\t$this->redirect(array('controller'=>'roles','action' => \"index\")); \n\t\t}\n\t\t$this->set('data',$this->Role->read('',$id));\n\t}", "public function adminusers()\n\t{\n\n\t\t$data['pageTitle'] = 'Zingmobile-VPN New Admin Users List';\n\t\t$row=$this->model_users->adminuserList();\n\t\t$data['rows']=$row;\n\t\t$this->load->view('header',$data);\n\t\t$this->load->view('menu');\n\t\t$this->load->view('adminusers');\n\t\t$this->load->view('footer');\n\n\t}", "public function admin()\n {\n $this->template_admin->displayad('admin');\n }", "function userAdmin( )\n {\n return $this->UserAdmin ;\n }", "private function get_admins_info() {\n $stm=$this->uSup->get_com_admins_to_notify_about_requests(\"user_id\",$this->company_id);\n\n $q_user_id=\"(1=0 \";\n /** @noinspection PhpUndefinedMethodInspection */\n while($admin=$stm->fetch(PDO::FETCH_OBJ)) {\n $q_user_id.=\" OR u235_users.user_id='\".$admin->user_id.\"' \";\n }\n $q_user_id.=\")\";\n try {\n /** @noinspection PhpUndefinedMethodInspection */\n $stm=$this->uFunc->pdo(\"uAuth\")->prepare(\"SELECT DISTINCT\n firstname,\n secondname,\n email\n FROM\n u235_users\n JOIN \n u235_usersinfo\n ON\n u235_users.user_id=u235_usersinfo.user_id AND\n u235_usersinfo.status=u235_users.status\n WHERE\n \" .$q_user_id. \" AND \n u235_users.status='active' AND\n u235_usersinfo.site_id=:site_id\n \");\n $site_id=site_id;\n /** @noinspection PhpUndefinedMethodInspection */$stm->bindParam(':site_id', $site_id,PDO::PARAM_INT);\n /** @noinspection PhpUndefinedMethodInspection */$stm->execute();\n }\n catch(PDOException $e) {$this->uFunc->error('120'/*.$e->getMessage()*/);}\n\n return $stm;\n }", "function setAdmin() {\n\t\t$this->_extension_high = \"\";\n\t\t$this->_extension_low = \"\";\n\t\t$this->_deptname = \"\";\n\t\t$this->_sections = array(\"*\");\n\t}", "public function in_admin($admin = \\null)\n {\n }", "static function getAllAdmin()\n {\n\n $con=Database::getConnection();\n $req=$con->prepare('SELECT * FROM admin a, partners p WHERE a.idPart=p._idPart');\n $req->execute(array());\n return $req->fetchAll();\n }", "function view_perm_users()\n\t{\n\t\t//-----------------------------------------\n\t\t// Check for a valid ID\n\t\t//-----------------------------------------\n\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя произвести изменения в масках доступа этому ID, пожалуйста, попытайтесь еще раз\");\n\t\t}\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'where' => \"perm_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\tif ( ! $perms = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя произвести изменения в масках доступа этому ID, пожалуйста, попытайтесь еще раз\");\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Get all members using that ID then!\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Сведения о пользователе\" , \"50%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Действие\" , \"50%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= \"<script language='javascript' type='text/javascript'>\n\t\t\t\t\t\t <!--\n\t\t\t\t\t\t function pop_close_and_stop( id )\n\t\t\t\t\t\t {\n\t\t\t\t\t\t \topener.location = \\\"{$this->ipsclass->base_url}&section=content&act=mem&code=doform&mid=\\\" + id;\n\t\t\t\t\t\t \tself.close();\n\t\t\t\t\t\t }\n\t\t\t\t\t\t //-->\n\t\t\t\t\t\t </script>\";\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Используется пользователями: \" . $perms['perm_name'] );\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'id, name, email, posts, org_perm_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'members',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"(org_perm_id IS NOT NULL AND org_perm_id != '')\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'name' ) );\n\t\t$outer = $this->ipsclass->DB->simple_exec();\n\n\t\twhile( $r = $this->ipsclass->DB->fetch_row($outer) )\n\t\t{\n\t\t\t$exp_pid = explode( \",\", $r['org_perm_id'] );\n\n\t\t\tforeach( explode( \",\", $r['org_perm_id'] ) as $pid )\n\t\t\t{\n\t\t\t\tif ( $pid == $this->ipsclass->input['id'] )\n\t\t\t\t{\n\t\t\t\t\tif ( count($exp_pid) > 1 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$extra = \"<li>Также используются: <em style='color:red'>\";\n\n\t\t\t\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'where' => \"perm_id IN (\".$this->ipsclass->clean_perm_string($r['org_perm_id']).\") AND perm_id <> {$this->ipsclass->input['id']}\" ) );\n\t\t\t\t\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t\t\t\t\twhile ( $mr = $this->ipsclass->DB->fetch_row() )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$extra .= $mr['perm_name'].\",\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$extra = preg_replace( \"/,$/\", \"\", $extra );\n\n\t\t\t\t\t\t$extra .= \"</em>\";\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$extra = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<div style='font-weight:bold;font-size:11px;padding-bottom:6px;margin-bottom:3px;border-bottom:1px solid #000'>{$r['name']}</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <li>Сообщений: {$r['posts']}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <li>Email: {$r['email']}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $extra\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"&#149;&nbsp;<a href='{$this->ipsclass->base_url}&amp;{$this->ipsclass->form_code}&amp;code=remove_mask&amp;id={$r['id']}&amp;pid=$pid' title='Удалить эту маску доступа у пользователя (без удаления других масок доступа)'>Удалить эту маску</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <br />&#149;&nbsp;<a href='{$this->ipsclass->base_url}&amp;{$this->ipsclass->form_code}&amp;code=remove_mask&amp;id={$r['id']}&amp;pid=all' title='Удалить все дополнительные маски'>Удалить все дополнительные маски</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <br /><br />&#149;&nbsp;<a href='javascript:pop_close_and_stop(\\\"{$r['id']}\\\");'>Изменить пользователя</a>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->admin->print_popup();\n\t}", "public function admin()\r\t{\r\t\t$id = NULL;\r\t\t$id || $id = $this->session->userdata('a_id');\r\t\t$this->db->limit(1);\r\t\t$query = $this->db->select('*')\r\t\t ->where('a_id', $id)\r\t\t ->get('admin');\r\t\treturn $query->row_array();\r\t}", "function getAllAdmins(){\n $sql = \"SELECT * FROM admin\";\n return getALl($sql);\n}", "function addAdminsAsRecipients(){\n $sql = \"SELECT name FROM user WHERE is_admin = 1\";\n $db = new DB();\n $db->query( $sql );\n while( $row = $db->fetchRow()){\n $this->AddRecipient($row[\"name\"]);\n }\n }", "function generateAdminList() {\n //$pageTags = array();\n //$pageTags['USERNAME'] = \"Username\";\n //$pageTags['DEPARTMENT'] = \"Department\";\n\n PHPWS_Core::initCoreClass('DBPager.php');\n $pager = new DBPager('sysinventory_admin','Sysinventory_Admin');\n\n $pager->setModule('sysinventory');\n $pager->setTemplate('admin_pager.tpl');\n $pager->setLink('index.php?module=sysinventory');\n $pager->setEmptyMessage('No admins found.');\n $pager->addToggle('class=\"toggle1\"');\n $pager->addToggle('class=\"toggle2\"');\n //$pager->addPageTags($pageTags);\n\n $pager->db->addJoin('left outer','sysinventory_admin','sysinventory_department','department_id','id');\n $pager->db->addColumn('sysinventory_department.description');\n $pager->db->addColumn('sysinventory_admin.username');\n $pager->db->addColumn('sysinventory_admin.id');\n $pager->addRowTags('get_row_tags');\n return $pager->get();\n }", "function generateAdminList() {\n //$pageTags = array();\n //$pageTags['USERNAME'] = \"Username\";\n //$pageTags['DEPARTMENT'] = \"Department\";\n\n PHPWS_Core::initCoreClass('DBPager.php');\n $pager = new DBPager('sysinventory_admin','Sysinventory_Admin');\n\n $pager->setModule('sysinventory');\n $pager->setTemplate('admin_pager.tpl');\n $pager->setLink('index.php?module=sysinventory');\n $pager->setEmptyMessage('No admins found.');\n $pager->addToggle('class=\"toggle1\"');\n $pager->addToggle('class=\"toggle2\"');\n //$pager->addPageTags($pageTags);\n\n $pager->db->addJoin('left outer','sysinventory_admin','sysinventory_department','department_id','id');\n $pager->db->addColumn('sysinventory_department.description');\n $pager->db->addColumn('sysinventory_admin.username');\n $pager->db->addColumn('sysinventory_admin.id');\n $pager->addRowTags('get_row_tags');\n return $pager->get();\n }", "public function index()\n {\n if(isset($_SESSION['user_id'])):\n $this->id = $_SESSION['user_id'];\n else:\n $this->id = 0;\n endif;\n $this->_user->listar_permisos($this->id,ACCESS_VIEW);\n $this->_view->titulo = 'ADMIN | Listado de usuarios';\n $this->_view->user = $this->_user->findAll('user');\n $this->_view->loadView('index','admin');\n\n }", "function xanthia_admin_view()\n{\n\t/** Security check - important to do this as early as possible to avoid\n\t * potential security holes or just too much wasted processing. For the\n\t * main function we want to check that the user has at least edit privilege\n\t * for some item within this component, or else they won't be able to do\n\t * anything and so we refuse access altogether. The lowest level of access\n\t * for administration depends on the particular module, but it is generally\n\t * either 'edit' or 'delete'\n\t */\n\tif (!pnSecAuthAction(0, 'Xanthia::', '::', ACCESS_EDIT)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n\t}\n\n\t// Load user API\n\tif (!pnModAPILoad('Xanthia','user')) {\n pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_XA_APILOADFAILED));\n pnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n return true;\n \t}\n\n\t// Load admin API\n\tif (!pnModAPILoad('Xanthia', 'admin')) {\n pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_XA_APILOADFAILED));\n pnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n return true;\n \t}\n\n\t// Create output object - this object will store all of our output so that\n\t// we can return it easily when required\n\t$pnRender =& new pnRender('Xanthia');\n\n\t// As Admin output changes often, we do not want caching.\n\t$pnRender->caching = false;\n\n $pnRender->assign('showhelp', pnModGetVar('Xanthia','help'));\n\n\t// Themes\n\t// Get a list of all themes in the themes dir\n\t$allthemes = pnModAPIFunc('Xanthia','user','getAllThemes');\n\t// Get a list of all themes in database\n\t$allskins = pnModAPIFunc('Xanthia','user','getAllSkins');\n\n\t$skins = array();\n if ($allskins) {\n\t foreach($allskins as $allskin) {\n\t $skins[] = $allskin['name'];\n\t }\n\t}\n\n // Generate an Authorization ID\n $authid = pnSecGenAuthKey();\n\t$pnRender->assign('authid', $authid);\n\n if ($allthemes){\n //Start Foreach\n foreach($allthemes as $themes) {\n // Add applicable actions\n $actions = array();\n\n \t\tswitch ($themes) {\n //If theme is active in Xanthia then show the edit theme link\n\t\t case in_array($themes, $skins):\n $state = 1;\n break;\n //If theme is not active in Xanthia then show the add theme link \n\t\t\t default:\n $state = 0;\n break;\n\t\t\t}\n \n\t $theme[] = array('state' => $state,\n\t\t\t\t\t\t 'themename' => $themes);\n //End Foreach\n }\n }\n\t$pnRender->assign('theme', $theme);\n // Return the output that has been generated to the template\n return $pnRender->fetch('xanthiaadminviewmain.htm');\n}", "function showAdminHome($page) {\n $ChangePermissionCombo = $this->generateChangePermissionCombo();\n if (!$ChangePermissionCombo) {\n $ChangePermissionCombo = \"[\" . $_SESSION['user_login']['role_name'] . \"]\";\n }\n echo \"<table width='100%' align='center' border='0' cellpadding='0' cellspacing='0'>\n\n\n\n\n\n\n\n \t\t\t \t<tr><td id='topcenter'>\n\n\n\n\n\n\n\n \t\t\t\t\t<div id='topleft'></div>\n\n\n\n\n\n\n\n \t\t\t\t\t<div id='topright'></div>\n\n\n\n\n\n\n\n \t\t\t\t</td></tr>\n\n\n\n\n\n\n\n <tr>\n\n\n\n\n\n\n\n <td valign='top' class='header'>\n\n\n\n\n\n\n\n <table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>\n\n\n\n\n\n\n\n <tr>\n\n\n\n\n\n\n\n \t <td width='100%' class='titleAdmin'><div>Xin chào [ \" . $_SESSION['user_login']['fullname'] . \",<a id='welcome' href='#' onclick=\\\"window.location='logout.php';\\\">Thoát</a> ] - Quyền truy cập [ \" . $ChangePermissionCombo . \" ]&nbsp;-&nbsp;<a id='welcome' href='./'>Trang chủ</a></div></td>\n\n\n\n\n\n\n\n </tr>\n\n\n\n\n\n\n\n </table>\n\n\n\n\n\n\n\n </td>\n\n\n\n\n\n\n\n </tr>\";\n//echo \"<div style='padding-left:10px;padding-bottom:5px;text-align:right !important'>Chào mừng[<b> \".$_SESSION['user_login']['fullname'].\" </b>] - Quyền truy cập \".$ChangePermissionCombo.\" &nbsp;-&nbsp;<a id='welcome' href='#' onclick=\\\"window.location='logout.php';\\\"><b>Thoát hệ thống</b></a></div>\";\n echo \"<tr><td colspan='3' class='menu'>\";\n echo $this->showMenu($page);\n echo \"</td></tr>\";\n echo \"</table>\";\n//echo \"</table>\";\n/*\n\n\n\n\n\n\n\nif($_SESSION[\"user_login\"][\"is_show_menu_left\"])\n\n\n\n\n\n\n\n{\n\n\n\n\n\n\n\necho \"<div class='menuleft'>\";\n\n\n\n\n\n\n\necho $this->showMenu_left($page);\n\n\n\n\n\n\n\necho\"</div>\";\n\n\n\n\n\n\n\n}\n\n\n\n\n\n\n\nelse{\n\n\n\n\n\n\n\n$style=\"style='width:100%';\";\n\n\n\n\n\n\n\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n*/\n echo \"<div>\";\n }", "function xanthia_admin_main()\n{\n\t/** Security check - important to do this as early as possible to avoid\n\t* potential security holes or just too much wasted processing. For the\n\t* main function we want to check that the user has at least edit privilege\n\t* for some item within this component, or else they won't be able to do\n\t* anything and so we refuse access altogether. The lowest level of access\n\t* for administration depends on the particular module, but it is generally\n\t* either 'edit' or 'delete'\n\t*/\n if (!pnSecAuthAction(0, 'Xanthia::', '::', ACCESS_EDIT)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n // Load user API\n\tif (!pnModAPILoad('Xanthia','user')) {\t \n pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_XA_APILOADFAILED));\n pnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n return true;\n\t}\n // Return the Admin View Function\n\t//return xanthia_adminmenu();\n\treturn xanthia_admin_view();\n}", "public function createAdmin() { return view('panel.users.create.admin'); }" ]
[ "0.7363447", "0.7138362", "0.7036324", "0.6950922", "0.6947685", "0.69246817", "0.69183743", "0.6896221", "0.68960756", "0.6863333", "0.68180937", "0.68125015", "0.6782088", "0.67739654", "0.67555", "0.67380995", "0.6737278", "0.6737278", "0.672899", "0.6712076", "0.67006594", "0.66984147", "0.66984147", "0.66902727", "0.6683075", "0.6660529", "0.6649897", "0.6649321", "0.6642599", "0.6636293", "0.6619613", "0.6618945", "0.65982926", "0.6591932", "0.6588684", "0.6584276", "0.6574065", "0.65674394", "0.65585923", "0.6546181", "0.65428543", "0.65245956", "0.6514066", "0.6513214", "0.651152", "0.65073055", "0.6499373", "0.6496751", "0.6493139", "0.6489405", "0.64868474", "0.64864296", "0.64843345", "0.64815", "0.64767975", "0.6466789", "0.646107", "0.6460489", "0.6452856", "0.64520943", "0.64491564", "0.6447312", "0.64421666", "0.6436596", "0.6433744", "0.6433424", "0.64316756", "0.6409265", "0.6408242", "0.6405854", "0.6403693", "0.6401294", "0.64011765", "0.6400818", "0.6400412", "0.63997424", "0.63834614", "0.6368141", "0.6368011", "0.63630223", "0.6358328", "0.635588", "0.6355465", "0.63508356", "0.63445526", "0.6325917", "0.63257676", "0.63224775", "0.63205665", "0.6320498", "0.6306125", "0.6303934", "0.6287298", "0.6261973", "0.6260414", "0.6260414", "0.6255606", "0.625401", "0.6252112", "0.6251439", "0.625035" ]
0.0
-1
Tracer dans des logs specifiques
function citrace_post_edition($tableau){ // contourner le cas d'un double appel du pipeline sur la meme table avec la meme action static $actions = array(); if (isset($tableau['args']['table'])){ $table = $tableau['args']['table']; if ($actions AND isset($tableau['args']['action']) AND in_array($table.'/'.$tableau['args']['action'],$actions)) return $tableau; else $actions[] = $table.'/'.$tableau['args']['action']; } // action sur un article if (isset($tableau['args']['action']) AND isset($tableau['args']['table']) AND $tableau['args']['table']=='spip_articles') { $id_article = intval($tableau['args']['id_objet']); if ($id_article>0) { include_spip('inc/texte'); $row = sql_fetsel('*', 'spip_articles', 'id_article='.$id_article); $id_rubrique = $row['id_rubrique']; $article_msg = '('.interdire_scripts(supprimer_numero($row['titre'])).')'." - id_rubrique:".$id_rubrique; $citrace = charger_fonction('citrace', 'inc'); // instituer un article if ($tableau['args']['action']=='instituer' AND isset($tableau['args']['statut_ancien'])){ if ($row['statut'] != $tableau['args']['statut_ancien']){ $article_msg .= " - statut_new:".$row['statut']." - statut_old:".$tableau['args']['statut_ancien']." - date_publication:".$row['date']." (meta post_dates :".$GLOBALS['meta']["post_dates"].")"; $action = "changement de statut de l'article"; // publication d'un article if ($row['statut'] == 'publie') $action = "publication article"; // depublication d'un article elseif ($tableau['args']['statut_ancien'] == 'publie') $action = "depublication article"; // mise a la poubelle d'un article if ($row['statut'] == 'poubelle') $action = "poubelle article"; $citrace('article', $id_article, $action, $article_msg, $id_rubrique); } } // modifier un article elseif ($tableau['args']['action']=='modifier'){ // uniquement pour les articles publies if ($row['statut'] == 'publie') $citrace('article', $id_article, 'modification article', $article_msg, $id_rubrique); } } } // action sur une rubrique if (isset($tableau['args']['action']) AND isset($tableau['args']['table']) AND $tableau['args']['table']=='spip_rubriques') { $id_rubrique = intval($tableau['args']['id_objet']); if ($id_rubrique>0) { include_spip('inc/texte'); $row = sql_fetsel('*', 'spip_rubriques', 'id_rubrique='.$id_rubrique); $rubrique_msg = '('.interdire_scripts(supprimer_numero($row['titre'])).')'; // modifier un rubrique if ($tableau['args']['action']=='modifier'){ // uniquement pour les rubriques publies if ($row['statut'] == 'publie'){ $citrace = charger_fonction('citrace', 'inc'); $citrace('rubrique', $id_rubrique, 'modification rubrique', $rubrique_msg, $id_rubrique); } } } } // action sur un document ou une image if (isset($tableau['args']['operation']) AND ((isset($tableau['args']['table']) AND $tableau['args']['table']=='spip_documents') OR (isset($tableau['args']['table_objet']) AND $tableau['args']['table_objet']=='documents'))) { $id_document = intval($tableau['args']['id_objet']); if ($id_document>0) { $row = sql_fetsel('*', 'spip_documents', 'id_document='.$id_document); $document_msg = '('.$row['fichier'].')'; // ajout ou remplacement de document ou d'image if ($tableau['args']['operation']=='ajouter_document'){ // le pipeline n'indique pas si c'est un remplacement, aussi il faut indiquer date et maj $commentaire = $document_msg." - champ date:".$row['date']." - champ maj:".$row['maj']; // le pipeline ne passe pas le lien, aussi il faut les indiquer $commentaire .= " - liens :"; $id_rubrique = ''; $res = sql_select('*', 'spip_documents_liens', 'id_document='.$id_document); while ($row = sql_fetch($res)){ $commentaire .= " ".$row['objet'].$row['id_objet']; if (!$id_rubrique) $id_rubrique = citrace_rubrique_de_objet($row['objet'], $row['id_objet']); } $citrace = charger_fonction('citrace', 'inc'); $citrace('document', $id_document, 'ajouter document', $commentaire, $id_rubrique); } // delier un document ou une image if ($tableau['args']['operation']=='delier_document'){ if (isset($tableau['args']['objet']) AND isset($tableau['args']['id'])) { $commentaire = $document_msg." - lien : ".$tableau['args']['objet'].$tableau['args']['id']; $id_rubrique = citrace_rubrique_de_objet($tableau['args']['objet'], $tableau['args']['id']); $citrace = charger_fonction('citrace', 'inc'); $citrace('document', $id_document, 'delier document', $commentaire, $id_rubrique); } } // supprimer un document ou une image if ($tableau['args']['operation']=='supprimer_document'){ $commentaire = $id_document; $citrace = charger_fonction('citrace', 'inc'); $citrace('document', $id_document, 'supprimer document', $commentaire); } } } // action sur un forum if (isset($tableau['args']['action']) AND in_array($tableau['args']['action'], array('instituer','modifier')) AND isset($tableau['args']['table']) AND $tableau['args']['table']=='spip_forum') { $id_forum = intval($tableau['args']['id_objet']); if ($id_forum>0) { $row = sql_fetsel('*', 'spip_forum', 'id_forum='.$id_forum); // forum public uniquement if (substr($row['statut'],0,3)!='pri') { $commentaire = 'statut:'.$row['statut']; $f_objet = ''; $f_id_objet = ''; if (spip_version()>=3) { $f_objet = $row['objet']; $f_id_objet = $row['id_objet']; } else { if (intval($row['id_article'])>0){ $f_objet = 'article'; $f_id_objet = $row['id_article']; } elseif (intval($row['id_rubrique'])>0){ $f_objet = 'rubrique'; $f_id_objet = $row['id_rubrique']; } elseif (intval($row['id_breve'])>0){ $f_objet = 'breve'; $f_id_objet = $row['id_breve']; } } $accepter_forum = $GLOBALS['meta']["forums_publics"]; if ($f_objet=='article'){ $art_accepter_forum = sql_getfetsel('accepter_forum', 'spip_articles', "id_article = ". intval($f_id_objet)); if ($art_accepter_forum) $accepter_forum = $art_accepter_forum; } $commentaire .= " - lien: ".$f_objet.$f_id_objet." (accepter_forum: ".$accepter_forum.")"; $id_rubrique = citrace_rubrique_de_objet($f_objet, $f_id_objet); $citrace = charger_fonction('citrace', 'inc'); $citrace('forum', $id_forum, ($row['statut']=='publie' ? 'publication ' : 'depublication').'forum', $commentaire, $id_rubrique); } } } return $tableau; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trace_log()\n {\n $messages = func_get_args();\n\n foreach ($messages as $message) {\n $level = 'info';\n\n if ($message instanceof Exception) {\n $level = 'error';\n }\n elseif (is_array($message) || is_object($message)) {\n $message = print_r($message, true);\n }\n\n Log::$level($message);\n }\n }", "function traceMe()\n{\n // So basic\n $stdoutHandler = new StreamHandler('php://stdout');\n $errorFileHandler = new StreamHandler(__DIR__ . '/multiple.streams.log', Logger::WARNING);\n $errorFileHandler->pushProcessor(new MemoryUsageProcessor());\n\n $logger = new Logger('phpdx-experiments-multiple.streams');\n $logger->pushHandler($stdoutHandler);\n $logger->pushHandler($errorFileHandler);\n $logger->pushProcessor(new IntrospectionProcessor());\n\n $logger->debug('look context data', ['foo' => 'bar']);\n $logger->info('you will see this in stdout, but not the file');\n $logger->warning('warning goes to stdout and the file');\n $logger->error('error is handled by both handlers as well', ['serious' => 'error']);\n}", "public function testOrgApacheSlingTracerInternalLogTracer()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.tracer.internal.LogTracer';\n\n $crawler = $client->request('POST', $path);\n }", "public function logTrace()\n {\n $output = new Output(Output::MODE_FILE, $this->getLogPath());\n $output->open();\n \\DebugHelper::dump()->showtrace($output);\n $output->close();\n }", "public function tracer(LoggerInterface $log)\n {\n $this->tracer = $log;\n \n if ($this->matcher instanceof TraceableInterface) {\n $this->matcher->tracer($log);\n }\n \n foreach ($this->controllers as $controller) {\n if ($controller instanceof TraceableInterface) {\n $controller->tracer($log);\n }\n }\n }", "function _trace($message) {\n if ($trace = TRUE) {\n _log($message);\n } \n}", "public function printTSlog() {}", "public function printTSlog() {}", "protected function _logTraffic() {\n if ('testing' !== APPLICATION_ENV) {\n $lastRequest = $this->_client->getLastRequest();\n $lastResponse = $this->_client->getLastResponse();\n $filename = date('Y-m-d') . '-gofilex.log';\n $logMessage = \"\\n\";\n $logMessage .= '[REQUEST]' . \"\\n\";\n $logMessage .= $lastRequest . \"\\n\\n\";\n $logMessage .= '[RESPONSE]' . \"\\n\";\n $logMessage .= $lastResponse . \"\\n\\n\";\n\n $logger = Garp_Log::factory($filename);\n $logger->log($logMessage, Garp_Log::INFO);\n }\n }", "public static function debugTrail() {}", "public function trace()\n {\n if (!$this->cfg['collect']) {\n return;\n }\n $args = \\func_get_args();\n $meta = $this->internal->getMetaVals(\n $args,\n array(\n 'caption' => 'trace',\n 'channel' => $this->cfg['channelName'],\n 'columns' => array('file','line','function'),\n )\n );\n $backtrace = $this->errorHandler->backtrace();\n // toss \"internal\" frames\n for ($i = 1, $count = \\count($backtrace)-1; $i < $count; $i++) {\n $frame = $backtrace[$i];\n $function = isset($frame['function']) ? $frame['function'] : '';\n if (!\\preg_match('/^'.\\preg_quote(__CLASS__).'(::|->)/', $function)) {\n break;\n }\n }\n $backtrace = \\array_slice($backtrace, $i-1);\n // keep the calling file & line, but toss ->trace or ::_trace\n unset($backtrace[0]['function']);\n $this->appendLog('trace', array($backtrace), $meta);\n }", "public function tlog($text);", "public function logPerformance();", "public function logPerformance();", "public function withLog($entry);", "public static function traza() {\n global $config;\n \n if ( ! isset($config['debug_file'])) return;\n\t $texto = date(\"Ymd-H:i:s \") . $_SERVER['REMOTE_ADDR'];\n\t foreach (func_get_args() as $arg) {\n\t\t $texto .= ' - ' . var_export($arg, true);\n\t }\n\t file_put_contents($config['debug_file'], $texto . \"\\n\", FILE_APPEND);\n }", "public function getTrace();", "final function getTrace();", "function atkTrace($msg=\"\")\n{\n\tglobal $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_GET_VARS, $HTTP_COOKIE_VARS, $HTTP_POST_VARS;\n\n\t$log = \"\\n\".str_repeat(\"=\", 5).\"\\n\";\n\t$log.= \"Trace triggered: \".$msg.\"\\n\";\n\t$log.= date(\"r\").\"\\n\";\n\t$log.= $HTTP_SERVER_VARS[\"REMOTE_ADDR\"].\"\\n\";\n\t$log.= $HTTP_SERVER_VARS[\"SCRIPT_URL\"].\"\\n\";\n\t$log.= \"\\nSessioninfo: \".\"session_name(): \".session_name().\" session_id(): \".session_id().\" SID: \".SID.\" REQUEST: \".$_REQUEST[session_name()].\" COOKIE: \".$_COOKIE[session_name()].\"\\n\";\n\t$log.= \"\\n\\nHTTP_SERVER_VARS:\\n\";\n\t$log.= var_export($HTTP_SERVER_VARS, true);\n\t$log.= \"\\n\\nHTTP_SESSION_VARS:\\n\";\n\t$log.= var_export($HTTP_SESSION_VARS, true);\n\t$log.= \"\\n\\nHTTP_COOKIE_VARS:\\n\";\n\t$log.= var_export($HTTP_COOKIE_VARS, true);\n\t$log.= \"\\n\\nHTTP_POST_VARS:\\n\";\n\t$log.= var_export($HTTP_POST_VARS, true);\n\t$log.= \"\\n\\nHTTP_GET_VARS:\\n\";\n\t$log.= var_export($HTTP_GET_VARS, true);\n\n\t$log.= \"\\n\\nSession file info:\\n\";\n\t$log.= var_export(stat(session_save_path().\"/sess_\".session_id()), true);\n\n\t$tmpfile = tempnam(\"/tmp\",atkconfig(\"identifier\").\"_trace_\");\n\t$fp = fopen($tmpfile,\"a\");\n\tfwrite($fp, $log);\n\tfclose($fp);\n}", "public function log()\n {\n $this->appendLog('log', \\func_get_args());\n }", "public function log($log);", "public function trace($message)\n {\n }", "protected function log() {\n }", "public static function trace($str) \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::trace($str);\t\t\n\t}", "public function getLog();", "public function init_trace()\n {\n }", "abstract public function load_logger();", "public function log() {\n // data we are going to log\n $variables = func_get_args();\n $trace = debug_backtrace(null, 1);\n Yii::info(VarDumper::dump($this));\n $this->debugInternal($variables, $trace);\n }", "public static function getServiceLogEntries() {\n /*\n * EXAMPLE OF LOG OUTPUT:\n\n -- Logs begin at Thu 2018-09-06 22:51:06 CEST. --\n Sep 08 21:44:51 domain.tld syslog-identifier-from-service-file[21204]: info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[58]\n Sep 08 21:44:51 domain.tld syslog-identifier-from-service-file[21204]: Creating key {00000000-0000-0000-0000-d9b836b4f65b} with creation date 2018-09-08 19:44:51Z, activation date 2018-09-08 19:44:51Z, and expiration date 2018-12-07 19:44:51Z.\n Sep 08 21:44:51 domain.tld syslog-identifier-from-service-file[21204]: warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]\n Sep 08 21:44:51 domain.tld syslog-identifier-from-service-file[21204]: No XML encryptor configured. Key {00000000-0000-0000-0000-d9b836b4f65b} may be persisted to storage in unencrypted form.\n Sep 08 21:44:51 domain.tld syslog-identifier-from-service-file[21204]: info: AppNamespace.AppName.Scheduling.ScheduledServiceHostService[0]\n Sep 08 21:44:51 domain.tld syslog-identifier-from-service-file[21204]: Scheduled service AppNamespace.AppName.Services.ScheduledTransactionsHostedService. Next occurence: 09/08/2018 19:45:00 +00:00\n Sep 08 21:44:51 domain.tld syslog-identifier-from-service-file[21204]: Hosting environment: Production\n Sep 08 21:44:51 domain.tld syslog-identifier-from-service-file[21204]: Content root path: /var/www/vhosts/domain.tld/htdocs\n Sep 08 21:44:51 domain.tld syslog-identifier-from-service-file[21204]: Now listening on: http://localhost:5000\n Sep 08 21:44:51 domain.tld syslog-identifier-from-service-file[21204]: Application started. Press Ctrl+C to shut down.\n\n */\n\n\n $entry = new stdClass();\n $entry->timestamp = time();\n $entry->type = 'error';\n $entry->message = 'There was an error';\n\n return [ $entry ];\n }", "public function logAs($type, $target);", "protected function AutoLog(){\r\n \r\n //DEPRECATED for test\r\n \r\n }", "function lDebug(string $msg):void\n{\n $args = func_get_args();\n\n \\Log::debug(' ######## Start DEBUG ####### ');\n $trace = debug_backtrace();\n \\Log::debug(' FILE : '.$trace[0]['file'].'');\n \\Log::debug(' LINE : '.$trace[0]['line'].'');\n \\Log::debug(' FUNCTION : '.$trace[1]['function'].'');\n \\Log::debug(' CLASS : '.$trace[1]['class'].'');\n if (is_array($args)) {\n foreach ($args as $string) {\n \\Log::debug(' >>>> Start Message <<<< ');\n \\Log::debug($string);\n \\Log::debug(' >>>> END Message <<<< ');\n }\n }\n \\Log::debug('######## End DEBUG #######');\n}", "function trace($txt, $isArray=false){\n\t// this is helpful on a remote server if you don't\n\t//have access to the log files\n\t//\n\t$log = new cLOG(\"../tests/upload.txt\", false);\n\t//$log->clear();\n\tif($isArray){\n\t\t$log->printr($txt);\n\t}else{\n\t\t$log->write($txt);\n\t}\n\n\t//echo \"$txt<br>\";\n}", "function changeLogs() {\n\n }", "function log()\n {\n }", "private static function _initLog()\n {\n if (!empty(self::$config->log->servers)) {\n $servers = self::$config->log->servers->toArray();\n } else {\n $servers = self::LOG_SERVERS;\n }\n\n if (php_sapi_name() == 'cli') {\n $extra = [\n 'command' => implode(' ', $_SERVER['argv']),\n 'mem' => memory_get_usage(true),\n ];\n } elseif (isset($_REQUEST['udid'])) {\n //for app request\n $extra = [\n 'h' => $_SERVER['HTTP_HOST'] ?? '',\n 'uri' => $_SERVER['REQUEST_URI'] ?? '',\n 'v' => $_REQUEST['v'] ?? '',\n 'd' => $_REQUEST['udid'] ?? '',\n 't' => $_REQUEST['mytoken'] ?? $_REQUEST['mytoken_sid'] ?? '',\n 'os' => $_REQUEST['device_os'] ?? '',\n 'm' => $_REQUEST['device_model'] ?? '',\n 'p' => $_REQUEST['platform'] ?? '',\n 'l' => $_REQUEST['language'] ?? '',\n 'real_ip' => \\Util::getClientIp(),\n ];\n } else {\n //pc or other ?\n $extra = [\n 'h' => $_SERVER['HTTP_HOST'] ?? '',\n 'uri' => $_SERVER['REQUEST_URI'] ?? '',\n 'v' => $_REQUEST['v'] ?? '',\n 't' => $_REQUEST['mytoken'] ?? $_REQUEST['mytoken_sid'] ?? '',\n 'p' => $_REQUEST['platform'] ?? '',\n 'l' => $_REQUEST['language'] ?? '',\n 'ua' => $_SERVER['HTTP_USER_AGENT'] ?? '',\n 'real_ip' => \\Util::getClientIp(),\n ];\n }\n\n if (\\Yaf\\ENVIRON != 'product') {\n \\Log::setLogFile(self::$config->log->path);\n }\n\n LoggerHandler::setServers($servers);\n LoggerHandler::setEnv(\\YAF\\ENVIRON);\n LoggerHandler::setExtra($extra);\n LoggerHandler::setUniqueId($_REQUEST['preRequestId'] ?? self::$request->header('preRequestId'));\n }", "public static function trace()\n\t{\n\t\tob_start();\n\t\tdebug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t$trace = ob_get_clean();\n\t\t$trace = str_replace('#','<br/><div><b><u>',$trace);\n\t\t$trace = str_replace('called at [','called at : </u></b><ul><li>File : ',$trace);\n\t\t$trace = preg_replace('/:([0-9]*)\\]/','</li><li>Ligne : $1</li></ul></div>',$trace);\n\t\techo $trace;\n\t\treturn $trace;\n\t}", "public function log($log) {\n //$this->log = $log;\n }", "function trace($level, $message) {\n global $logfile, $loglevel, $timezone;\n \n if ($loglevel < $level) return;\n \n if ($logfile == \"syslog\") {\n syslog($level, $message);\n } else {\n $now = new DateTime();\n $now->setTimezone(new DateTimeZone($timezone));\n $message = $now->format('Y-m-d H:i:s') . \" \" . $message;\n if ($logfile == \"stdout\")\n echo $message;\n else\n file_put_contents($logfile, $message, FILE_APPEND);\n }\n }", "function Trace($msg)\r\n{\r\n\tglobal $debug;\r\n\tif ($debug) echo $msg;\r\n}", "protected function addLog() {\n\t\t$oLog = PHP_Beautifier_Common::getLog();\n\t\t$oLogConsole = Log::factory('console', '', 'php_beautifier', array(\n\t\t\t\t'stream' => STDERR,\n\t\t\t), PEAR_LOG_DEBUG);\n\t\t$oLog->addChild($oLogConsole);\n\t}", "function ttp_lms_log( $tag = \"\", $msg = \"\") {\n\tlog( $tag, $msg );\n}", "protected function printLogMgm() {}", "function scaffold_log() {\n\t$args = func_get_args();\n\tforeach ($args as $arg) {\n\t\t$msg = print_r($arg, true);\n\t\terror_log($msg);\n\t}\n}", "public function toLogEntry();", "protected function _initLog()\n {\n }", "function track_log_entries($type=array()) {\r\n $args = func_get_args();\r\n $mkt_id ='';\r\n //if one of the arguments is marketing ID, then we need to filter by it\r\n foreach($args as $arg){\r\n if(isset($arg['EMAIL_MARKETING_ID_VALUE'])){\r\n $mkt_id = $arg['EMAIL_MARKETING_ID_VALUE'];\r\n }\r\n }\r\n\t\tif (empty($type)) \r\n\t\t\t$type[0]='targeted';\r\n\t\t$this->load_relationship('log_entries');\r\n\t\t$query_array = $this->log_entries->getQuery(true);\r\n\t\t$query_array['select'] =\"SELECT campaign_log.* \";\r\n\t\t$query_array['where'] = $query_array['where']. \" AND activity_type='{$type[0]}' AND archived=0\";\r\n //add filtering by marketing id, if it exists\r\n if (!empty($mkt_id)) $query_array['where'] = $query_array['where']. \" AND marketing_id ='$mkt_id' \";\r\n\t\treturn (implode(\" \",$query_array));\r\n\t}", "public static function traceBegin() \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::traceBegin();\t\t\n\t}", "public static function trace($s)\n {\n if($_SERVER['SERVER_NAME'] == 'localhost')\n {\n ///NEED TO UPDATE PERMISSIONS TO BE ABLE TO WRITE FILES :(\n // open file\n if(self::$LOG_PATH == '') self::$LOG_PATH = self::$DEFAULT_PATH;\n $filePath = $_SERVER['DOCUMENT_ROOT'].'/utils/loggers/'.self::$LOG_PATH;\n\n $contents = file_get_contents($filePath);\n $mode = (strlen($contents) > self::LOG_LIMIT) ? 'w' : 'a';\n $fd = fopen($filePath, $mode) or die('could not open or create phplog file!');\n\n // write string\n fwrite($fd, $s . \"\\r\\n\");\n// fwrite($fd, 'count: '.strlen($contents) . \"\\r\\n\");\n\n // close file\n fclose($fd);\n }\n }", "function trace_sql()\n {\n if (!defined('OCTOBER_NO_EVENT_LOGGING')) {\n define('OCTOBER_NO_EVENT_LOGGING', 1);\n }\n\n if (!defined('OCTOBER_TRACING_SQL')) {\n define('OCTOBER_TRACING_SQL', 1);\n }\n else {\n return;\n }\n\n Event::listen('illuminate.query', function ($query, $bindings, $time, $name) {\n $data = compact('bindings', 'time', 'name');\n\n foreach ($bindings as $i => $binding) {\n if ($binding instanceof \\DateTime) {\n $bindings[$i] = $binding->format('\\'Y-m-d H:i:s\\'');\n } elseif (is_string($binding)) {\n $bindings[$i] = \"'$binding'\";\n }\n }\n\n $query = str_replace(['%', '?'], ['%%', '%s'], $query);\n $query = vsprintf($query, $bindings);\n\n traceLog($query);\n });\n }", "public static function tracer(string $method): void\n {\n if (!static::hasNewRelic()) {\n return;\n }\n\n newrelic_add_custom_tracer($method);\n }", "public function addLog($data);", "public function debug($var){\n\t\t////$this->core->log($var);\n\t}", "function log($cxn,$class,$id,$folder=NULL)\r\n {\r\n \r\n }", "public static function addTracer(string $method): void\n {\n if (!static::hasNewRelic()) {\n return;\n }\n\n newrelic_add_custom_tracer($method);\n }", "protected function getLogEntries() {}", "public function logger(Varien_Event_Observer $observer)\n {\n $controller = $observer->getEvent()->getControllerAction();\n $request = $controller->getRequest();\n\n //Watchdog if off => RETURN;\n //We don't log this extension actions => RETURN;\n if ((Mage::helper('foggyline_watchdog')->isModuleEnabled() == false)\n || ($request->getControllerModule() == 'Foggyline_Watchdog_Adminhtml')\n ) {\n return;\n }\n\n //We are in admin area, but admin logging is off => RETURN;\n if ((Mage::getDesign()->getArea() == 'adminhtml')\n && (Mage::helper('foggyline_watchdog')->isLogBackendActions() == false)\n ) {\n return;\n }\n\n //We are in frontend area, but frontend logging is off => RETURN;\n if ((Mage::getDesign()->getArea() == 'frontend')\n && (Mage::helper('foggyline_watchdog')->isLogFrontendActions() == false)\n ) {\n return;\n }\n\n //If user login detected\n $user = Mage::getSingleton('admin/session')->getUser();\n\n //If customer login detected\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n\n $log = Mage::getModel('foggyline_watchdog/action');\n\n $log->setWebsiteId(Mage::app()->getWebsite()->getId());\n $log->setStoreId(Mage::app()->getStore()->getId());\n\n $log->setTriggeredAt(Mage::getModel('core/date')->timestamp(time()));\n\n if ($user && $user->getId()) {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_USER);\n $log->setTriggeredById($user->getId());\n } elseif ($customer && $customer->getId()) {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_CUSTOMER);\n $log->setTriggeredById($customer->getId());\n } else {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_GUEST);\n $log->setTriggeredById(null);\n }\n\n $log->setControllerModule($request->getControllerModule());\n $log->setFullActionName($request->getControllerModule());\n $log->setClientIp($request->getClientIp());\n $log->setControllerName($request->getControllerName());\n $log->setActionName($request->getActionName());\n $log->setControllerModule($request->getControllerModule());\n $log->setRequestMethod($request->getMethod());\n\n //We are in 'adminhtml' area and \"lbparams\" is ON\n if (Mage::getDesign()->getArea() == 'adminhtml'\n && Mage::helper('foggyline_watchdog')->isLogBackendActions()\n && Mage::helper('foggyline_watchdog')->isLogBackendParams()\n ) {\n $log->setRequestParams(Mage::helper('core')->encrypt(serialize($request->getParams())));\n }\n\n //We are in 'frontend' area and \"lfparams\" is ON\n if (Mage::getDesign()->getArea() == 'frontend'\n && Mage::helper('foggyline_watchdog')->isLogFrontendActions()\n && Mage::helper('foggyline_watchdog')->isLogFrontendParams()\n ) {\n $log->setRequestParams(Mage::helper('core')->encrypt(serialize($request->getParams())));\n }\n\n //In case of other areas, we don't log request params\n\n try {\n $log->save();\n } catch (Exception $e) {\n //If you cant save, die silently, not a big deal\n Mage::logException($e);\n }\n }", "public function __invoke($param)\n {\n $this->addLog($param);\n }", "protected static function MergeLogs()\n {\n }", "function loginfo($level, $tag, $info){\t$this->tracemsg($level, \"$tag($info)\");\n}", "public static function tracerAndIntegrations()\n {\n self::tracerOnce();\n IntegrationsLoader::load();\n }", "function d() {\n $variables = func_get_args();\n $trace = debug_backtrace(null, 1);\n \\Yii::$app->logger->debugInternal($variables, $trace);\n }", "public final function withLog ()\n {\n\n $this->withLog = true;\n\n }", "private static function initRootSpan(Tracer $tracer)\n {\n $options = ['start_time' => Time::now()];\n if ('cli' === PHP_SAPI) {\n $operationName = isset($_SERVER['argv'][0]) ? basename($_SERVER['argv'][0]) : 'cli.command';\n $span = $tracer->startRootSpan(\n $operationName,\n StartSpanOptions::create($options)\n )->getSpan();\n $span->setTag(Tag::SPAN_TYPE, Type::CLI);\n } else {\n $operationName = 'web.request';\n $span = $tracer->startRootSpan(\n $operationName,\n StartSpanOptionsFactory::createForWebRequest(\n $tracer,\n $options,\n Request::getHeaders()\n )\n )->getSpan();\n $span->setTag(Tag::SPAN_TYPE, Type::WEB_SERVLET);\n if (isset($_SERVER['REQUEST_METHOD'])) {\n $span->setTag(Tag::HTTP_METHOD, $_SERVER['REQUEST_METHOD']);\n }\n if (isset($_SERVER['REQUEST_URI'])) {\n $span->setTag(Tag::HTTP_URL, $_SERVER['REQUEST_URI']);\n }\n // Status code defaults to 200, will be later on changed when http_response_code will be called\n $span->setTag(Tag::HTTP_STATUS_CODE, 200);\n }\n $span->setIntegration(WebIntegration::getInstance());\n $span->setTraceAnalyticsCandidate();\n $span->setTag(Tag::SERVICE_NAME, \\ddtrace_config_app_name($operationName));\n\n dd_trace('header', function () use ($span) {\n $args = func_get_args();\n\n // header ( string $header [, bool $replace = TRUE [, int $http_response_code ]] ) : void\n $argsCount = count($args);\n\n $parsedHttpStatusCode = null;\n if ($argsCount === 1) {\n $result = header($args[0]);\n $parsedHttpStatusCode = Bootstrap::parseStatusCode($args[0]);\n } elseif ($argsCount === 2) {\n $result = header($args[0], $args[1]);\n $parsedHttpStatusCode = Bootstrap::parseStatusCode($args[0]);\n } else {\n $result = header($args[0], $args[1], $args[2]);\n // header() function can override the current status code\n $parsedHttpStatusCode = $args[2] === null ? Bootstrap::parseStatusCode($args[0]) : $args[2];\n }\n\n if (null !== $parsedHttpStatusCode) {\n $span->setTag(Tag::HTTP_STATUS_CODE, $parsedHttpStatusCode);\n }\n\n return $result;\n });\n\n dd_trace('http_response_code', function () use ($span) {\n $args = func_get_args();\n if (isset($args[0])) {\n $httpStatusCode = $args[0];\n\n if (is_numeric($httpStatusCode)) {\n $span->setTag(Tag::HTTP_STATUS_CODE, $httpStatusCode);\n }\n }\n\n return dd_trace_forward_call();\n });\n }", "public function log(array $fields = [], $timestamp = null)\n {\n foreach($fields as $field) {\n $this->span->annotate($field, $timestamp);\n }\n }", "public function d() {\n // data we are going to log\n $variables = func_get_args();\n $trace = debug_backtrace(null, 1);\n\n $this->debugInternal($variables, $trace);\n }", "public function trace($msg, $category='application'){\n\t\tif($this->_debug)\n\t\t\t$this->log($msg, 7, $category);\n\t}", "function log()\n\t{\n\t\tcall_user_func_array(array($this->server, 'log'), func_get_args());\n\t}", "public function trace($msg, $obj=null) {\n if ($this->logLevel <= Logger::TRACE) {\n $this->log(Logger::TRACE, $msg, $obj);\n }\n }", "public function log($obj);", "private function _logAnalytics($subject) {\n $clientIP = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ?\n $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];\n $analyticsData = array();\n $principalValues = array_values($subject->getPrincipal());\n if(count($principalValues) > 0)\n $analyticsData['user'] = $principalValues[0]; \n //$subject->getPrincipal(); // Get the user from the principal\n $analyticsData['time'] = time(); \n $analyticsData['session'] = session_id(); \n $analyticsData['page'] = 'login'; \n $analyticsData['UA'] = $_SERVER['HTTP_USER_AGENT'];\n $analyticsData['ip'] = $clientIP;\n $GLOBALS['routeLogger']->info(json_encode($analyticsData));\n }", "function trace( $message )\n{\n\t$registry = Registry::getInstance();\n\tif ( $registry->keyExists( 'trace_messages' ) )\n\t{\n\t\t$trace_messages = $registry->get( 'trace_messages' );\n\t}\n\t$trace_messages[] = $message;\n\t$registry->set( \"trace_messages\", $trace_messages );\n}", "public function log($text)\n {\n }", "public function debugToFile() {\n // data we are going to log\n $variables = func_get_args();\n $logFile = $variables[0];\n $trace = debug_backtrace(null, 1);\n $this->debugInternal(array_slice($variables, 1), $trace, $logFile);\n }", "public function logs($id);", "public function write_log($operation, $info_to_log){}", "public function beforeLogMethodAdvice()\n {\n }", "function mytrace($s)\r\n{\r\n\t// see constants.php for TRACE_ENABLED flag\r\n\t\r\n\t// turn off trace?\r\n\tif (isset($_REQUEST[QS_DEBUG]))\r\n\t{\r\n\t\tif ($_REQUEST[QS_DEBUG]==\"0\") \r\n\t\t{\r\n\t\t\t$_SESSION[QS_DEBUG]=\"\";\r\n\t\t} \r\n\t}\r\n\t\r\n\t// Turn ON trace?\r\n\tif (isset($_REQUEST[QS_DEBUG]))\r\n\t{\r\n\t\tif ($_REQUEST[QS_DEBUG]==\"1\") \r\n\t\t{\r\n\t\t\t$_SESSION[QS_DEBUG]=\"1\";\r\n\t\t\t\r\n\t\t\tOutBR($s);\r\n\t\t\treturn;\r\n\t\t} \r\n\t}\r\n\t\r\n\tif (TRACE_ENABLED) \r\n\t{\r\n\t\t$_SESSION[QS_DEBUG]=\"1\";\r\n\t\t\r\n\t\tOutBR($s);\r\n\t\treturn;\r\n\t} \r\n\t\r\n\tif (isset($_SESSION[QS_DEBUG]))\r\n\t{\r\n\t\tif ($_SESSION[QS_DEBUG]==\"1\") \r\n\t\t{\r\n\t\t\t$_SESSION[QS_DEBUG]=\"1\";\r\n\t\t\t\r\n\t\t\tOutBR($s);\r\n\t\t\treturn;\r\n\t\t} \r\n\t}\r\n\t\r\n}", "public function timingLog($type, $params=null)\n {\n $type = \"[PID \" . getmypid() .\"] \" . $type;\n $this->log(\\Psr\\Log\\LogLevel::DEBUG,$type,$params);\n }", "public function __construct() {\n\t\t$view_event = ( isset( \\REALTY_BLOC_LOG::$option['view_event'] ) ? \\REALTY_BLOC_LOG::$option['view_event'] : array() );\n\n\t\t// Property Page view log\n\t\tif ( isset( $view_event['property'] ) and $view_event['property'] == \"on\" ) {\n\t\t\tadd_action( 'rb_page_view_property_log', array( $this, 'save_property' ), 10, 5 );\n\t\t}\n\n\t\t// building Page View log\n\t\tif ( isset( $view_event['building'] ) and $view_event['building'] == \"on\" ) {\n\t\t\tadd_action( 'rb_page_view_building_log', array( $this, 'save_building' ), 10, 5 );\n\t\t}\n\t}", "function get_trace(){\n\t\tglobal $database_queries,$database_query_count,$is_connected_to_db,$global_link;\n\t\treturn(\"<div style='width:100%'></div>\".$this->get_shadow(\"<h1>Mysql Trace information</h1>Note: this information s for debug purposes only, and will not be shown in the final product.<br/>Query Count:\".\n\t\t\t'db used:'.$this->dbdatabase.'<br/>Connected to Database:'.(int)$is_connected_to_db.'<br/>Link:'.$global_link.'<br/> Query Count: '.\n\t\t\t$database_query_count.'<br/>'.$database_queries,$this->default_style,'center','80%'));\n\t}", "public static function debug() {\n $args = func_get_args();\n self::log(count($args) === 1 ? current($args) : $args);\n }", "public static function logging()\n {\n }", "function log_event( $plugin_name, $log_msg, $log_type, $file, $line ) {\t\t$allowed = get_transient( 'ti_log_allowed' );\n\t\tif ( is_array( $allowed ) && in_array( $plugin_name, $allowed ) ) {\n\t\t\t$logs = get_transient( 'ti_log' . $plugin_name );\n\t\t\tif ( ! $logs ) {\n\t\t\t\t$logs = array();\n\t\t\t}\n\t\t\t$logs[] = array(\n\t\t\t\t'type' => $log_type,\n\t\t\t\t'msg' => $log_msg,\n\t\t\t\t'time' => date( 'F j, Y H:i:s', current_time( 'timestamp', true ) ),\n\t\t\t\t'file' => $file,\n\t\t\t\t'line' => $line,\n\t\t\t);\n\t\t\t// keep only the last LOG_LENGTH logs\n\t\t\t$logs = array_slice( $logs, 0 - self::LOG_LENGTH );\n\t\t\tset_transient( 'ti_log' . $plugin_name, $logs, self::LOG_OPTION_EXPIRY_MINS * MINUTE_IN_SECONDS );\n\t\t}\n\t}", "final public function getTraceAsString()\n {\n return 'trace';\n }", "public static function log($request, $timestamp = 0, $move_head = false)\n {\n\n }", "function logMe($comment, $status_id = 0, $data = array(), $update_process = 0) {\n\n if (!class_exists('systemToolkit')) {\n return; // not loaded (cache fix)\n }\n $toolkit = systemToolkit::getInstance();\n $centerLogMapper = $toolkit->getMapper('log', 'log');\n\n if(count($data)) {\n ob_start();\n $i = 1;\n foreach($data as $d) {\n var_dump($d);\n if($i < count($data)) {\n echo \"<br />===<br />\";\n }\n $i++;\n }\n $err_content = ob_get_contents();\n ob_end_clean();\n $comment .= \"<br />{$err_content}\";\n }\n\n $log = $centerLogMapper->create();\n $log->setTime(new SQLFunction('UNIX_TIMESTAMP'));\n $log->setModule($toolkit->getRequest()->getModule());\n $log->setAction($toolkit->getRequest()->getAction());\n $log->setComment($comment);\n $log->setStatus($status_id);\n if ($user = systemToolkit::getInstance()->getUser()) {\n $log->setUser($user);\n }\n if ($update_process) {\n $log->setProcessId($update_process);\n }\n $centerLogMapper->save($log);\n}", "function getTraceId($span)\n{\n $traceId = $span->getContext()->getTraceId();\n $xrayTraceId = '1-' . substr($traceId, 0, 8) . '-' . substr($traceId, 8);\n echo 'Final trace ID: ' . json_encode(['traceId' => $xrayTraceId]);\n}", "function &getLog()\r\n\t{\r\n\t\treturn Logger::getLogger('phase.compiler.PhaseParser');\r\n\t}", "public function setTrace($cat) {\n $this->cat= $cat;\n }", "public function setTrace($cat) {\n $this->cat= $cat;\n }", "private static function logging()\n {\n $files = ['Handler', 'Exception', 'Log'];\n $folder = static::$root.'Logging'.'/';\n\n self::call($files, $folder);\n }", "private function _log($msg)\n\t{\n\t\t$this->EE->TMPL->log_item(\"Low Events: {$msg}\");\n\t}", "function createLogHelper($className) {\n // TODO: Bring startLogger and pauseLogger static calls to here\n if (strstr($className, '__ref')) {\n return;\n }\n\n // XXX: Expensive call (hell, hasn't stopped me yet)\n if (DEBUG == true) {\n $dbg = debug_backtrace();\n $lineNumber = $dbg[1]['line'];\n $fileName = $dbg[1]['file'];\n debugMsg(\"Intercepting new $className on line $lineNumber of $fileName\");\n }\n\n $destClassName = \"__ref\".$className;\n \n // Get a list of methods to be transplanted from original class\n $srcOriginal = sourceArray($className);\n\n\n // \n injectMethodLogger($className, $srcOriginal);\n\n // Create a '__ref' prefixed class that resembles the old one\n // Possible replacement? class_alias($className, $destClassName);\n //transplantMethods($destClassName, $srcOriginal);\n\n // Bind the logging __call() method to the class with the original name.\n // Each call will be dispatched to the '__ref' prefixed object.\n // Additionally, remove all the original methods so that __call() is invoked.\n //setLoggerMethods($className, $destClassName, $srcOriginal);\n debugMsg(\"Creating new $className object\\n\");\n}", "function log4server($o, $formaterFlag=true){\n if(QA || CLI_LOG_ON) {\n log4task($o, $formaterFlag);\n }\n}", "public function log() {\r\n\t\t$this->resource->log();\r\n\t}", "public function log($msg)\n {\n }", "function acf_dev_log()\n{\n}", "public function log ($txt)\n\t{\n\t\t$this->addQueryLog (\"/* \" . $txt . \" */\");\n\t}", "public function test_format_2()\n {\n $SIMPLE_FORMAT =\n \"[%datetime%] %channel%.%level_name% %context% %context.leftover% %context.response% %context.action% \n %context.referer% %context.ip% %context.user% %context.logId% %context.leftover% %context.response% \n %context.payload% %context.controller% %extra% %extra.date% %extra.leftover% %message%\\n\";\n $SIMPLE_DATE = \"Y-m-d H:i:s\";\n\n global $logId;\n $logId = '1565630222-621879';\n\n $config = [\n \"~credit_card\",\n ];\n\n Config::set(\"LToolkit.log.scrubber\", $config);\n\n $date = DateTime::createFromFormat($SIMPLE_DATE, \"2019-08-12 17:17:02\");\n\n $data = [\"date\" => $date];\n $response = \"\";\n for ($i=0; $i < 705; $i++) {\n $response .= $i;\n }\n\n $record = [\n \"message\" => \"Start execution\",\n \"context\" => [\n \"mode\" => CustomLogFormatter::MODE_FULL,\n \"response\" => $response\n ],\n \"level\"=> 200,\n \"level_name\" => \"INFO\",\n \"channel\" => \"local-ernesto\",\n \"datetime\" => $date,\n \"extra\" => $data\n ];\n\n $object = new CustomLogFormatter($SIMPLE_FORMAT, $SIMPLE_DATE, false, true);\n\n $method = self::getMethod(\"format\", CustomLogFormatter::class);\n $result = $method->invokeArgs($object, [$record]);\n\n self::assertIsString($result);\n }", "function trace(){\n $r = array_map(create_function('$a', 'return (isset($a[\"class\"])?$a[\"class\"].$a[\"type\"]:\"\").$a[\"function\"].\"(\".@join(\",\",$a[\"args\"]).\");, Row: \".@$a[\"line\"];'), debug_backtrace(false));\n array_shift($r);\n return $r;\n}" ]
[ "0.65726215", "0.62468714", "0.6219746", "0.61476016", "0.60355645", "0.60224307", "0.5945792", "0.5945792", "0.5928763", "0.591869", "0.59010994", "0.58449465", "0.5810534", "0.5810534", "0.58001477", "0.579619", "0.5741589", "0.5688559", "0.565708", "0.56501", "0.5623212", "0.56202406", "0.56171054", "0.55725133", "0.5569398", "0.5536259", "0.5526483", "0.5516615", "0.54935724", "0.54762053", "0.5449071", "0.5444787", "0.543914", "0.5438663", "0.54168725", "0.54167676", "0.5407158", "0.54008615", "0.53988945", "0.5396071", "0.5395551", "0.5384076", "0.53726447", "0.53533506", "0.5341861", "0.5341364", "0.5340253", "0.53338", "0.532196", "0.5319599", "0.5312583", "0.53094584", "0.5307527", "0.52802813", "0.52723134", "0.5272116", "0.526247", "0.52613527", "0.5256522", "0.52560365", "0.52448916", "0.52337986", "0.5226264", "0.52193034", "0.5219297", "0.5212633", "0.5212055", "0.52057415", "0.5198814", "0.5191351", "0.5183431", "0.5179961", "0.51789165", "0.5176524", "0.5173515", "0.51647377", "0.5161947", "0.5159291", "0.51541746", "0.5139489", "0.5136567", "0.51299214", "0.5126703", "0.5124036", "0.5121732", "0.51080924", "0.5107095", "0.50999165", "0.50916725", "0.5089587", "0.5089587", "0.5071828", "0.50689965", "0.5068972", "0.5055408", "0.505073", "0.50480205", "0.5044126", "0.5034088", "0.50207907", "0.5020645" ]
0.0
-1
contourner le cas d'un double appel du pipeline sur la meme table avec la meme action
function citrace_pre_edition($tableau){ static $actions = array(); if (isset($tableau['args']['table'])){ $table = $tableau['args']['table']; if ($actions AND isset($tableau['args']['action']) AND in_array($table.'/'.$tableau['args']['action'],$actions)) return $tableau; else $actions[] = $table.'/'.$tableau['args']['action']; } // changement de rubrique pour un article publie if (isset($tableau['args']['action']) AND $tableau['args']['action']=='instituer' AND isset($tableau['args']['table']) AND $tableau['args']['table']=='spip_articles') { $id_article = intval($tableau['args']['id_objet']); if ($id_article>0) { include_spip('inc/texte'); $row = sql_fetsel('*', 'spip_articles', 'id_article='.$id_article); if ($row){ $old_rubrique = $row['id_rubrique']; if ($row['statut']=='publie'){ $new_rubrique = (isset($tableau['data']['id_rubrique']) ? intval($tableau['data']['id_rubrique']) : 0); if ($new_rubrique>=1 AND $new_rubrique!=$old_rubrique){ $commentaire = '('.interdire_scripts(supprimer_numero($row['titre'])).')'." - id_rubrique_new:".$new_rubrique." - id_rubrique_old:".$old_rubrique; $citrace = charger_fonction('citrace', 'inc'); $citrace('article', $id_article, 'changement de rubrique pour article', $commentaire, $new_rubrique); } } } } } // changement de statut ou de l'email d'un auteur if (isset($tableau['args']['action']) AND isset($tableau['args']['table']) AND $tableau['args']['table']=='spip_auteurs') { $id_auteur = intval($tableau['args']['id_objet']); if ($id_auteur>0) { include_spip('inc/texte'); $row = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$id_auteur); if ($row){ // changement de statut d'un auteur if ($tableau['args']['action']=='instituer'){ $old_statut = $row['statut']; $new_statut = (isset($tableau['data']['statut']) ? $tableau['data']['statut'] : ''); $old_webmestre = $row['webmestre']; $new_webmestre = (isset($tableau['data']['webmestre']) ? $tableau['data']['webmestre'] : ''); if ($new_statut AND $new_statut!=$old_statut){ $commentaire = interdire_scripts(supprimer_numero($row['nom'])) .' ('.interdire_scripts($row['email']).')' ." - statut_new:".$new_statut." - statut_old:".$old_statut ." - webmestre_new:".$new_webmestre." - webmestre_old:".$old_webmestre; $citrace = charger_fonction('citrace', 'inc'); $citrace('auteur', $id_auteur, "changement de statut pour l'auteur", $commentaire); } } // modifier l'email d'un auteur if ($tableau['args']['action']=='modifier'){ $old_email = $row['email']; $new_email = (isset($tableau['data']['email']) ? $tableau['data']['email'] : ''); if ($new_email!=$old_email){ $commentaire = '('.interdire_scripts(supprimer_numero($row['nom'])).')' ." - email_new:".$new_email." - email_old:".$old_email; $citrace = charger_fonction('citrace', 'inc'); $citrace('auteur', $id_auteur, "changement d'email pour l'auteur", $commentaire); } } } } } // changement de date de publication (ou de depublication) d'un article if (isset($tableau['args']['action']) AND isset($tableau['args']['table']) AND $tableau['args']['table']=='spip_articles') { $id_article = intval($tableau['args']['id_objet']); if ($id_article>0) { // lors du changement de statut, la date de publication est tracee par le pipeline post_edition // aussi ne pas doublonner if (!isset($tableau['data']['statut']) OR !isset($tableau['args']['statut_ancien']) OR $tableau['data']['statut'] == $tableau['args']['statut_ancien']){ include_spip('inc/texte'); $row = sql_fetsel('*', 'spip_articles', 'id_article='.$id_article); $date_old = $row['date']; $id_rubrique = $row['id_rubrique']; if (isset($tableau['data']['date']) AND $date_old != $tableau['data']['date']){ $article_msg = '('.interdire_scripts(supprimer_numero($row['titre'])).')'." - id_rubrique:".$id_rubrique; $article_msg .= " - date_publication:".$tableau['data']['date']." - date_publication_old:".$date_old." (meta post_dates :".$GLOBALS['meta']["post_dates"].")"; $citrace = charger_fonction('citrace', 'inc'); $citrace('article', $id_article, 'modifier_date', $article_msg, $id_rubrique); } } } } return $tableau; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function citrace_post_edition($tableau){\n\t// contourner le cas d'un double appel du pipeline sur la meme table avec la meme action\n\tstatic $actions = array();\n\tif (isset($tableau['args']['table'])){\n\t\t$table = $tableau['args']['table'];\n\t\tif ($actions AND isset($tableau['args']['action']) AND in_array($table.'/'.$tableau['args']['action'],$actions)) \n\t\t\treturn $tableau;\n\t\telse\n\t\t\t$actions[] = $table.'/'.$tableau['args']['action'];\n\t}\n\t\n\t// action sur un article\n\tif (isset($tableau['args']['action']) \n\t AND isset($tableau['args']['table']) AND $tableau['args']['table']=='spip_articles') {\n\t \t$id_article = intval($tableau['args']['id_objet']);\n\t\t if ($id_article>0) {\n\t\t\t\tinclude_spip('inc/texte');\n\t\t\t\t$row = sql_fetsel('*', 'spip_articles', 'id_article='.$id_article);\n\t\t\t\t$id_rubrique = $row['id_rubrique'];\n\t\t\t\t$article_msg = '('.interdire_scripts(supprimer_numero($row['titre'])).')'.\" - id_rubrique:\".$id_rubrique;\n\n\t\t\t\t$citrace = charger_fonction('citrace', 'inc');\n\t\t\t\t\n\t\t\t\t// instituer un article\n\t\t\t\tif ($tableau['args']['action']=='instituer' AND isset($tableau['args']['statut_ancien'])){\n\t\t \t\tif ($row['statut'] != $tableau['args']['statut_ancien']){\n\t\t\t\t\t\t$article_msg .= \" - statut_new:\".$row['statut'].\" - statut_old:\".$tableau['args']['statut_ancien'].\" - date_publication:\".$row['date'].\" (meta post_dates :\".$GLOBALS['meta'][\"post_dates\"].\")\";\n\t\t\t\t\t\t$action = \"changement de statut de l'article\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t// publication d'un article\n\t\t\t \t\tif ($row['statut'] == 'publie')\n\t\t\t\t\t\t\t$action = \"publication article\";\n\t\t\t\t\t\t// depublication d'un article\n\t\t\t \t\telseif ($tableau['args']['statut_ancien'] == 'publie')\n\t\t\t\t\t\t\t$action = \"depublication article\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// mise a la poubelle d'un article\n\t\t\t \t\tif ($row['statut'] == 'poubelle')\n\t\t\t\t\t\t\t$action = \"poubelle article\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$citrace('article', $id_article, $action, $article_msg, $id_rubrique);\n\t\t \t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t// modifier un article\n\t\t\t\telseif ($tableau['args']['action']=='modifier'){\n\t\t\t\t\t// uniquement pour les articles publies\n\t\t \t\tif ($row['statut'] == 'publie')\n\t\t\t\t\t\t$citrace('article', $id_article, 'modification article', $article_msg, $id_rubrique);\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n }\t\n\n\t// action sur une rubrique\n\tif (isset($tableau['args']['action']) \n\t AND isset($tableau['args']['table']) AND $tableau['args']['table']=='spip_rubriques') {\n\t \t$id_rubrique = intval($tableau['args']['id_objet']);\n\t\t if ($id_rubrique>0) {\n\t\t\t\tinclude_spip('inc/texte');\n\t\t\t\t$row = sql_fetsel('*', 'spip_rubriques', 'id_rubrique='.$id_rubrique);\n\t\t\t\t$rubrique_msg = '('.interdire_scripts(supprimer_numero($row['titre'])).')';\n\t\t\t\t\n\t\t\t\t// modifier un rubrique\n\t\t\t\tif ($tableau['args']['action']=='modifier'){\n\t\t\t\t\t// uniquement pour les rubriques publies\n\t\t \t\tif ($row['statut'] == 'publie'){\n\t\t\t\t\t\t$citrace = charger_fonction('citrace', 'inc');\n\t\t\t\t\t\t$citrace('rubrique', $id_rubrique, 'modification rubrique', $rubrique_msg, $id_rubrique);\n\t\t \t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n }\t\n \n // action sur un document ou une image\n\tif (isset($tableau['args']['operation']) \n\t\tAND ((isset($tableau['args']['table']) AND $tableau['args']['table']=='spip_documents') \n\t\t\tOR (isset($tableau['args']['table_objet']) AND $tableau['args']['table_objet']=='documents'))) {\n\t\t$id_document = intval($tableau['args']['id_objet']);\n\t\tif ($id_document>0) {\n\t\t\t$row = sql_fetsel('*', 'spip_documents', 'id_document='.$id_document);\n\t\t\t$document_msg = '('.$row['fichier'].')';\n\n\t\t // ajout ou remplacement de document ou d'image\n\t\t\tif ($tableau['args']['operation']=='ajouter_document'){\n\t\t\t\t\t\t\t\n\t\t\t\t// le pipeline n'indique pas si c'est un remplacement, aussi il faut indiquer date et maj\n\t\t\t\t$commentaire = $document_msg.\" - champ date:\".$row['date'].\" - champ maj:\".$row['maj'];\n\t\n\t\t\t\t// le pipeline ne passe pas le lien, aussi il faut les indiquer\n\t\t\t\t$commentaire .= \" - liens :\";\n\t\t\t\t$id_rubrique = '';\n\t\t\t\t$res = sql_select('*', 'spip_documents_liens', 'id_document='.$id_document);\n\t\t\t\twhile ($row = sql_fetch($res)){\n\t\t\t\t\t$commentaire .= \" \".$row['objet'].$row['id_objet'];\n\t\t\t\t\tif (!$id_rubrique)\n\t\t\t\t\t\t$id_rubrique = citrace_rubrique_de_objet($row['objet'], $row['id_objet']);\n\t\t\t\t}\n\n\t\t\t\t$citrace = charger_fonction('citrace', 'inc');\n\t\t\t\t$citrace('document', $id_document, 'ajouter document', $commentaire, $id_rubrique);\n\t\t\t}\n\t\t\t\n\t\t // delier un document ou une image\n\t\t\tif ($tableau['args']['operation']=='delier_document'){\n\t\t\t\tif (isset($tableau['args']['objet']) AND isset($tableau['args']['id'])) {\n\t\t\t\t\t$commentaire = $document_msg.\" - lien : \".$tableau['args']['objet'].$tableau['args']['id'];\n\t\t\t\t\t$id_rubrique = citrace_rubrique_de_objet($tableau['args']['objet'], $tableau['args']['id']);\n\t\t\t\t\t$citrace = charger_fonction('citrace', 'inc');\n\t\t\t\t\t$citrace('document', $id_document, 'delier document', $commentaire, $id_rubrique);\n\t\t\t\t}\n\t\t\t}\n\n\t\t // supprimer un document ou une image\n\t\t\tif ($tableau['args']['operation']=='supprimer_document'){\n\t\t\t\t$commentaire = $id_document;\n\t\t\t\t$citrace = charger_fonction('citrace', 'inc');\n\t\t\t\t$citrace('document', $id_document, 'supprimer document', $commentaire);\n\t\t\t}\n\t\t}\n\t}\n\n\t// action sur un forum\n\tif (isset($tableau['args']['action']) AND in_array($tableau['args']['action'], array('instituer','modifier'))\n\t AND isset($tableau['args']['table']) AND $tableau['args']['table']=='spip_forum') {\n\n \t$id_forum = intval($tableau['args']['id_objet']);\n\t if ($id_forum>0) {\n\t\t\t$row = sql_fetsel('*', 'spip_forum', 'id_forum='.$id_forum);\n\n\t\t\t// forum public uniquement\n\t\t\tif (substr($row['statut'],0,3)!='pri') {\t\t\t\t\t\t\t\t\n\t\t\t\t$commentaire = 'statut:'.$row['statut'];\n\t\t\t\t$f_objet = '';\n\t\t\t\t$f_id_objet = '';\n\t\t\t\t\n\t\t\t\tif (spip_version()>=3) {\n\t\t\t\t\t$f_objet = $row['objet'];\n\t\t\t\t\t$f_id_objet = $row['id_objet'];\n\t\t\t\t} else {\n\t\t\t\t\tif (intval($row['id_article'])>0){\n\t\t\t\t\t\t$f_objet = 'article';\n\t\t\t\t\t\t$f_id_objet = $row['id_article'];\n\t\t\t\t\t} elseif (intval($row['id_rubrique'])>0){\n\t\t\t\t\t\t$f_objet = 'rubrique';\n\t\t\t\t\t\t$f_id_objet = $row['id_rubrique'];\n\t\t\t\t\t} elseif (intval($row['id_breve'])>0){\n\t\t\t\t\t\t$f_objet = 'breve';\n\t\t\t\t\t\t$f_id_objet = $row['id_breve'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$accepter_forum = $GLOBALS['meta'][\"forums_publics\"];\n\t\t\t\tif ($f_objet=='article'){\n\t\t\t\t\t$art_accepter_forum = sql_getfetsel('accepter_forum', 'spip_articles', \"id_article = \". intval($f_id_objet));\n\t\t\t\t\tif ($art_accepter_forum)\n\t\t\t\t\t\t$accepter_forum = $art_accepter_forum;\n\t\t\t\t}\n\n\t\t\t\t$commentaire .= \" - lien: \".$f_objet.$f_id_objet.\" (accepter_forum: \".$accepter_forum.\")\";\n\n\t\t\t\t$id_rubrique = citrace_rubrique_de_objet($f_objet, $f_id_objet);\n\t\t\t\t\n\t\t\t\t$citrace = charger_fonction('citrace', 'inc');\n\t\t\t\t$citrace('forum', $id_forum, ($row['statut']=='publie' ? 'publication ' : 'depublication').'forum', $commentaire, $id_rubrique);\n\t\t\t}\n\t\t}\n }\t\n\t\n\treturn $tableau;\n}", "public function paroleAction() {\n\t\t \t\t\t\t\n\t\t\n\t}", "public function trasnaction(){\n\n\t}", "public function pesquisarParteInteressadaAction()\n {\n }", "public function insertStatAndRoyalitiesAction(){\n \n }", "public function run()\n {\n $distler = Person::where('lastName','Distler')->first();\n\n $weihnachtsgeschichte = new App\\Models\\Opus;\n $weihnachtsgeschichte['title'] = \"Die Weihnachtsgeschichte\";\n $weihnachtsgeschichte['opusNumber'] = \"10\"; \n $weihnachtsgeschichte->composer()->associate($distler);\n $weihnachtsgeschichte->save();\n\n $ros = Piece::where('title','Es ist ein Ros entsprungen')->first();\n $ros->opus()->associate($weihnachtsgeschichte); \n $ros->save();\n }", "public function run()\n {\n $_ = \\DB::statement('SELECT @@GLOBAL.foreign_key_checks');\n \\DB::statement('set foreign_key_checks = 0');\n \\Milestone\\Appframe\\Model\\ResourceActionMethod::query()\n ->create([\t'id' => '803301', \t'resource_action' => '803201', \t'type' => 'Form', \t'idn1' => '800901', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803302', \t'resource_action' => '803202', \t'type' => 'List', \t'idn1' => '802201', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803303', \t'resource_action' => '803203', \t'type' => 'Form', \t'idn1' => '800902', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803304', \t'resource_action' => '803204', \t'type' => 'List', \t'idn1' => '802202', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803305', \t'resource_action' => '803205', \t'type' => 'ManageRelation', \t'idn1' => '800804', \t'idn2' => '802201', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803306', \t'resource_action' => '803206', \t'type' => 'ListRelation', \t'idn1' => '800805', \t'idn2' => '802209', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803307', \t'resource_action' => '803207', \t'type' => 'ListRelation', \t'idn1' => '802203', \t'idn2' => '802204', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803308', \t'resource_action' => '803208', \t'type' => 'List', \t'idn1' => '802204', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803309', \t'resource_action' => '803209', \t'type' => 'List', \t'idn1' => '802207', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803310', \t'resource_action' => '803210', \t'type' => 'FormWithData', \t'idn1' => '800903', \t'idn2' => '802701', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803311', \t'resource_action' => '803211', \t'type' => 'FormWithData', \t'idn1' => '800904', \t'idn2' => '802701', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803312', \t'resource_action' => '803212', \t'type' => 'Data', \t'idn1' => '802701', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803313', \t'resource_action' => '803213', \t'type' => 'FormWithData', \t'idn1' => '800905', \t'idn2' => '802701', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803314', \t'resource_action' => '803214', \t'type' => 'ListRelation', \t'idn1' => '800806', \t'idn2' => '802210', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803315', \t'resource_action' => '803215', \t'type' => 'Form', \t'idn1' => '800906', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803316', \t'resource_action' => '803216', \t'type' => 'List', \t'idn1' => '802211', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803317', \t'resource_action' => '803217', \t'type' => 'List', \t'idn1' => '802212', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803318', \t'resource_action' => '803218', \t'type' => 'ListRelation', \t'idn1' => '800813', \t'idn2' => '802210', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803319', \t'resource_action' => '803219', \t'type' => 'ListRelation', \t'idn1' => '800813', \t'idn2' => '802207', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803320', \t'resource_action' => '803220', \t'type' => 'ListRelation', \t'idn1' => '800813', \t'idn2' => '802204', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803321', \t'resource_action' => '803221', \t'type' => 'AddRelation', \t'idn1' => '800809', \t'idn2' => '800902', \t'idn3' => '801006', \t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803322', \t'resource_action' => '803222', \t'type' => 'FormWithData', \t'idn1' => '800901', \t'idn2' => '802702', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803323', \t'resource_action' => '803223', \t'type' => 'FormWithData', \t'idn1' => '800906', \t'idn2' => '802704', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803324', \t'resource_action' => '803224', \t'type' => 'FormWithData', \t'idn1' => '800902', \t'idn2' => '802703', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803325', \t'resource_action' => '803225', \t'type' => 'List', \t'idn1' => '802213', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803326', \t'resource_action' => '803226', \t'type' => 'FormWithData', \t'idn1' => '800907', \t'idn2' => '802705', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803327', \t'resource_action' => '803227', \t'type' => 'FormWithData', \t'idn1' => '800908', \t'idn2' => '802701', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803328', \t'resource_action' => '803228', \t'type' => 'Form', \t'idn1' => '800909', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803329', \t'resource_action' => '803229', \t'type' => 'List', \t'idn1' => '802216', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803330', \t'resource_action' => '803230', \t'type' => 'FormWithData', \t'idn1' => '800909', \t'idn2' => '802706', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803331', \t'resource_action' => '803231', \t'type' => 'ManageRelation', \t'idn1' => '800815', \t'idn2' => '802216', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803332', \t'resource_action' => '803232', \t'type' => 'ManageRelation', \t'idn1' => '800814', \t'idn2' => '802202', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803333', \t'resource_action' => '803233', \t'type' => 'ManageRelation', \t'idn1' => '800801', \t'idn2' => '802202', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803334', \t'resource_action' => '803234', \t'type' => 'ManageRelation', \t'idn1' => '800816', \t'idn2' => '802201', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803335', \t'resource_action' => '803235', \t'type' => 'ManageRelation', \t'idn1' => '800817', \t'idn2' => '802216', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803336', \t'resource_action' => '803236', \t'type' => 'List', \t'idn1' => '802217', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803337', \t'resource_action' => '803237', \t'type' => 'List', \t'idn1' => '802218', \t\t\t\t\t\t\t\t\t\t\t\t])\n ;\n \\DB::statement('set foreign_key_checks = ' . $_);\n }", "public function run()\n {\n App\\Specialty::find(1)->experts()->create([//idol 전문가1호\n 'sns' => '페이스북',\n // 'company_id' => null,\n ]);\n\n App\\Specialty::find(1)->experts()->create([//idol 전문가1호\n 'sns' => '페이스북',\n 'company_id' => 1,\n ]);\n }", "public function attaquerAdversaire() {\n\n }", "public function step_2()\n {\n }", "public function pesquisarAction() {\r\n \r\n }", "public function relatorioAction() { \r\n \r\n }", "public function testActionUseCase2()\n {\n // person and target\n\n // workflow, rule and action\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n 'runnable_once' => true,\n 'run_interval' => 0,\n ]);\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n\n $action1->rules()->sync([ $rule1->getKey(), $rule2->getKey()]); //\n\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $this->user->getKey(),\n 'tag_id' => $this->tag->getKey(),\n 'taggable_id' => $this->person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //// first time run ////\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //// second run must failed ////\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n 'info' => 'Already run once!',\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }", "public function run()\n {\n $psn1 = new pasien();\n $psn1->id = \"1\";\n $psn1->nama = \"arif\";\n $psn1->alamat = \"Sidoarjo\";\n $psn1->save(); \n\n $psn2 = new pasien();\n $psn2->id = \"2\";\n $psn2->nama = \"ade\";\n $psn2->alamat = \"Surabaya\";\n $psn2->save(); \n }", "protected function _prepareRowsAction() {\n \n }", "public function run()\n {\n\n\n $type = new CarType();\n $type->name = 'Saloon';\n $type->save();\n\n $type2 = new CarType();\n $type2->name = 'Minibus';\n $type2->save();\n }", "public function run()\n {\n //Many to Many relacija\n factory(App\\Projekti::class, 6)->create()->each(function ($u) {\n $u->tags()->save(factory(App\\Tag::class)->make());\n });\n }", "function action_outline_supp_row_dist()\n{\n\t//$arg = $securiser_action();\n\t$arg = _request('arg');\n\n\t$arg = explode(':',$arg);\n\t$id_form = $arg[0];\n\t$id_donnee = $arg[1];\n\t\n\t//Forms_supprimer_donnee($id_form,$id_donnee);\n\tForms_arbre_supprimer_donnee($id_form,$id_donnee,false);\n\n\tif ($redirect = urldecode(_request('redirect'))){\n\t\tinclude_spip('inc/headers');\n\t\tredirige_par_entete(str_replace('&amp;','&',$redirect));\n\t}\n}", "public function otherAction() {\n\t}", "public function salidaAction()\n {\n \n }", "public function take_action()\n {\n }", "public function take_action()\n {\n }", "public function run() {\n\t\t$toolbox = R::$toolbox;\n\t\t$adapter = $toolbox->getDatabaseAdapter();\n\t\t$writer = $toolbox->getWriter();\n\t\t$redbean = $toolbox->getRedBean();\n\t\t$pdo = $adapter->getDatabase();\n\t\t$a = new RedBean_AssociationManager( $toolbox );\n\t\t$post = $redbean->dispense('post');\n\t\t$post->title = 'title';\n\t\t$redbean->store($post);\n\t\t$page = $redbean->dispense('page');\n\t\t$page->name = 'title';\n\t\t$redbean->store($page);\t\t\n\t\t$page = $redbean->dispense(\"page\");\n\t\t$page->name = \"John's page\";\n\t\t$idpage = $redbean->store($page);\n\t\t$page2 = $redbean->dispense(\"page\");\n\t\t$page2->name = \"John's second page\";\n\t\t$idpage2 = $redbean->store($page2);\n\t\t$a->associate($page, $page2);\n\t\t$redbean->freeze( true );\n\t\t$page = $redbean->dispense(\"page\");\n\t\t$page->sections = 10;\n\t\t$page->name = \"half a page\";\n\t\ttry {\n\t\t\t$id = $redbean->store($page);\n\t\t\tfail();\n\t\t}catch(RedBean_Exception_SQL $e) {\n\t\t\tpass();\n\t\t}\n\t\t$post = $redbean->dispense(\"post\");\n\t\t$post->title = \"existing table\";\n\t\ttry {\n\t\t\t$id = $redbean->store($post);\n\t\t\tpass();\n\t\t}catch(RedBean_Exception_SQL $e) {\n\t\t\tfail();\n\t\t}\n\t\tasrt(in_array(\"name\",array_keys($writer->getColumns(\"page\"))),true);\n\t\tasrt(in_array(\"sections\",array_keys($writer->getColumns(\"page\"))),false);\n\t\t$newtype = $redbean->dispense(\"newtype\");\n\t\t$newtype->property=1;\n\t\ttry {\n\t\t\t$id = $redbean->store($newtype);\n\t\t\tfail();\n\t\t}catch(RedBean_Exception_SQL $e) {\n\t\t\tpass();\n\t\t}\n\t\t$logger = RedBean_Plugin_QueryLogger::getInstanceAndAttach( $adapter );\n\t\t//now log and make sure no 'describe SQL' happens\n\t\t$page = $redbean->dispense(\"page\");\n\t\t$page->name = \"just another page that has been frozen...\";\n\t\t$id = $redbean->store($page);\n\t\t$page = $redbean->load(\"page\", $id);\n\t\t$page->name = \"just a frozen page...\";\n\t\t$redbean->store($page);\n\t\t$page2 = $redbean->dispense(\"page\");\n\t\t$page2->name = \"an associated frozen page\";\n\t\t$a->associate($page, $page2);\n\t\t$a->related($page, \"page\");\n\t\t$a->unassociate($page, $page2);\n\t\t$a->clearRelations($page,\"page\");\n\t\t$items = $redbean->find(\"page\",array(),array(\"1\"));\n\t\t$redbean->trash($page);\n\t\t$redbean->freeze( false );\n\t\tasrt(count($logger->grep(\"SELECT\"))>0,true);\n\t\tasrt(count($logger->grep(\"describe\"))<1,true);\n\t\tasrt(is_array($logger->getLogs()),true);\n\t}", "public function run()\n {\n\n $detail = new Detail();\n $detail->name = 'Sin Gestion';\n $detail->status_id = 1;\n $detail->save();\n\n // Potencial Cliente = 1\n\n $detail = new Detail();\n $detail->name = 'En Gestion';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Positivo con Correo';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Positivo sin Correo';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'No Contesta';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Solicitud de Muestras';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Agregado';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Correo por Confirmar';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Devuelto';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Envia lista de Precio';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Envio de Catalogo';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Futuros Productos';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Posible';\n $detail->status_id = 1;\n $detail->save();\n\n\n\n // Muestras = 2\n\n\n $detail = new Detail();\n $detail->name = 'Sin Contactar';\n $detail->status_id = 2;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Por Concretar Venta';\n $detail->status_id = 2;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'En Seguimiento';\n $detail->status_id = 2;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Muestras';\n $detail->status_id = 2;\n $detail->save();\n\n // Rechazos = 3\n $detail = new Detail();\n $detail->name = 'Usan Tomates Naturales';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Precio';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Usan Salsa para Pizza';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Usan Concentrado';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Usan otro Producto';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Presetacion';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Rechazado';\n $detail->status_id = 3;\n $detail->save();\n\n\n // Clientes Activos = 4\n\n $detail = new Detail();\n $detail->name = 'Baja';\n $detail->status_id = 4;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Promesa de Compra';\n $detail->status_id = 4;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Venta';\n $detail->status_id = 4;\n $detail->save();\n\n\n // Bajas = 5\n\n\n $detail = new Detail();\n $detail->name = 'Precio';\n $detail->status_id = 5;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Motivos Administrativos';\n $detail->status_id = 5;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Falta de Seguimiento';\n $detail->status_id = 5;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Calidad del Producto';\n $detail->status_id = 5;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Otros';\n $detail->status_id = 5;\n $detail->save();\n\n }", "public function busquedaAction() {\n }", "public function contrato()\r\n\t{\r\n\t}", "public function run()\n {\n //on peut créer des produit de démonstration \n $produit = new Produit();\n $produit->nom = \"Jean\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Jean\";\n $produit->photo_avatar = \"littleJean.png\";\n $produit->photo_principal = \"Jean.png\";\n $produit->category_id = 8;\n $produit->save();\n \n $produit = new Produit();\n $produit->nom = \"Amber\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Amber\";\n $produit->photo_avatar = \"littleAmber.png\";\n $produit->photo_principal = \"Amber.png\";\n $produit->category_id = 32;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Lisa\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Lisa\";\n $produit->photo_avatar = \"littleLisa.png\";\n $produit->photo_principal = \"Lisa.png\";\n $produit->category_id = 30;\n\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Kaeya\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Kaeya\";\n $produit->photo_avatar = \"littleKaeya.png\";\n $produit->photo_principal = \"Kaeya.png\";\n $produit->category_id = 13;\n\n $produit->save();\n \n $produit = new Produit();\n $produit->nom = \"Barbara\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Barbara\";\n $produit->photo_avatar = \"littleBarbara.png\";\n $produit->photo_principal = \"Barbara.png\";\n $produit->category_id = 20;\n\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Diluc\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Diluc\";\n $produit->photo_avatar = \"littleDiluc.png\";\n $produit->photo_principal = \"Diluc.png\";\n $produit->category_id = 34;\n\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Razor\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Razor\";\n $produit->photo_avatar = \"littleRazor.png\";\n $produit->photo_principal = \"Razor.png\";\n $produit->category_id = 29;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Venti\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Venti\";\n $produit->photo_avatar = \"littleVenti.png\";\n $produit->photo_principal = \"Venti.png\";\n $produit->category_id = 7;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Klee\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Klee\";\n $produit->photo_avatar = \"littleKlee.png\";\n $produit->photo_principal = \"Klee.png\";\n $produit->category_id = 35;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Bennett\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Bennett\";\n $produit->photo_avatar = \"littleBennett.png\";\n $produit->photo_principal = \"Bennett.png\";\n $produit->category_id =33;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Noelle\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Noelle\";\n $produit->photo_avatar = \"littleNoelle.png\";\n $produit->photo_principal = \"Noelle.png\";\n $produit->category_id = 24;\n $produit->save();\n \n\n $produit = new Produit();\n $produit->nom = \"Fischl\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Fischl\";\n $produit->photo_avatar = \"littleFischl.png\";\n $produit->photo_principal = \"Fischl.png\";\n $produit->category_id = 27;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Sucrose\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Sucrose\";\n $produit->photo_avatar = \"littleSucrose.png\";\n $produit->photo_principal = \"Sucrose.png\";\n $produit->category_id = 10;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Mona\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Mona\";\n $produit->photo_avatar = \"littleMona.png\";\n $produit->photo_principal = \"Mona.png\";\n $produit->category_id = 20;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Diona\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Diona\";\n $produit->photo_avatar = \"littleDiona.png\";\n $produit->photo_principal = \"Diona.png\";\n $produit->category_id = 12;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Albedo\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Albedo\";\n $produit->photo_avatar = \"littleAlbedo.png\";\n $produit->photo_principal = \"Albedo.png\";\n $produit->category_id = 23;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Xiao\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Xiao\";\n $produit->photo_avatar = \"littleXiao.png\";\n $produit->photo_principal = \"Xiao.png\";\n $produit->category_id = 11;\n $produit->save();\n \n\n $produit = new Produit();\n $produit->nom = \"Beidou\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Beidou\";\n $produit->photo_avatar = \"littleBeidou.png\";\n $produit->photo_principal = \"Beidou.png\";\n $produit->category_id = 29;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Ningguang\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Ningguang\";\n $produit->photo_avatar = \"littleNingguang.png\";\n $produit->photo_principal = \"Ningguang.png\";\n $produit->category_id = 25;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Xiangling\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Xiangling\";\n $produit->photo_avatar = \"littleXiangling.png\";\n $produit->photo_principal = \"Xiangling.png\";\n $produit->category_id = 36;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Xingqiu\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Xingqiu\";\n $produit->photo_avatar = \"littleXingqiu.png\";\n $produit->photo_principal = \"Xingqiu.png\";\n $produit->category_id = 18;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Chongyun\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Chongyun\";\n $produit->photo_avatar = \"littleChongyun.png\";\n $produit->photo_principal = \"Chongyun.png\";\n $produit->category_id = 14;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Qiqi\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Qiqi\";\n $produit->photo_avatar = \"littleQiqi.png\";\n $produit->photo_principal = \"Qiqi.png\";\n $produit->category_id = 13;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Keqing\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Keqing\";\n $produit->photo_avatar = \"littleKeqing.png\";\n $produit->photo_principal = \"Keqing.png\";\n $produit->category_id = 28;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Tartaglia\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Tartaglia\";\n $produit->photo_avatar = \"littleTartaglia.png\";\n $produit->photo_principal = \"Tartaglia.png\";\n $produit->category_id = 17;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Zhongli\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Zhongli\";\n $produit->photo_avatar = \"littleZhongli.png\";\n $produit->photo_principal = \"Zhongli.png\";\n $produit->category_id = 26;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Xinyan\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Xinyan\";\n $produit->photo_avatar = \"littleXinyan.png\";\n $produit->photo_principal = \"Xinyan.png\";\n $produit->category_id = 34;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Ganyu\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Ganyu\";\n $produit->photo_avatar = \"littleGanyu.png\";\n $produit->photo_principal = \"Ganyu.png\";\n $produit->category_id = 12;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"HuTao\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de HuTao\";\n $produit->photo_avatar = \"littleHuTao.png\";\n $produit->photo_principal = \"HuTao.png\";\n $produit->category_id = 36;\n $produit->save();\n\n $produit = new Produit();\n $produit->nom = \"Rosalia\";\n $produit->prix_ht = \"25\";\n $produit->description = \"Description de Rosalia\";\n $produit->photo_avatar = \"littleRosalia.png\";\n $produit->photo_principal = \"Rosalia.png\";\n $produit->category_id = 16;\n $produit->save();\n\n\n \n\n\n \n }", "function pasAction() {\n\t\t$this -> vue -> pasAction();\n\t}", "public function run()\n {\n $expertise1 = new Expertise();\n $expertise1->name = 'Politik';\n $expertise1->save();\n\n $expertise2 = new Expertise();\n $expertise2->name = 'Sport';\n $expertise2->save();\n\n $expertise3 = new Expertise();\n $expertise3->name = 'Musik';\n $expertise3->save();\n }", "public function run()\n {\n //Hacemos una relación many 2 many en la tabla curso-docente\n /* DB::table('curso_docente')->insert([\n 'curso_id'=>1,\n 'docente_id'=>1\n ]);\n\n //Hacemos una relación many 2 many en la tabla alumno-curso\n DB::table('alumno_curso')->insert([\n 'alumno_id'=>1,\n 'curso_id'=>1\n ]);\n\n //Hacemos una relación many 2 many en la tabla categoria-curso\n DB::table('categoria_curso')->insert([\n 'categoria_id'=>1,\n 'curso_id'=>1,\n 'porcentaje'=>100\n ]);\n\n DB::table('categoria_curso')->insert([\n 'categoria_id'=>1,\n 'curso_id'=>3,\n 'porcentaje'=>100\n ]);*/\n\n DB::table('categoria_curso')->insert([\n 'categoria_id'=>1,\n 'curso_id'=>12,\n ]);\n\n DB::table('curso_tag')->insert([\n 'tag_id'=>2,\n 'curso_id'=>12,\n ]);\n\n }", "public function run()\n {\n $pais = new Paise();\n $pais->nombre = \"Argentina\";\n $pais->nombreCorto = \"ARG\";\n $pais->capital = \"Buenos Aires\";\n $pais->nacionalidad = \"Argentina\";\n $pais->idiomas = \"Espaniol\";\n $pais->save();\n\n $persona = new Persona();\n $persona->documento = rand(1,100);\n $persona->nombre = \"Tomas\";\n $persona->direccion = \"Mitre 323\";\n $persona->foto = \"acaHayUnaFoto\";\n $persona->save();\n\n $empleado = new Empleado();\n $empleado->cargo = \"supervisor\";\n $empleado->sector = \"Clientes\";\n $empleado->save();\n\n $sectore = new Sectore();\n $sectore->nombreSector = \"Clientes\";\n $sectore->codigoSector = \"111\";\n $sectore->responsableSector = 1;\n $sectore->save();\n\n $cliente = new Cliente();\n $cliente->categoria = \"ORO\";\n $cliente->empleado_id = 1;\n $cliente->numeroPais_id = 1;\n $cliente->save();\n\n $duenio = new Duenio();\n $duenio->numeroPais = \"ARG\";\n $duenio->verificaciónFinanciera = \"si\";\n $duenio->verificaciónJudicial = \"si\";\n $duenio->calificacionRiesgo = 1;\n $duenio->verificador = 1;\n $duenio->save();\n\n $subastador = new Subastadore();\n $subastador->matricula = \"3245432\";\n $subastador->region = \"Sur\";\n $subastador->persona_id = 1;\n $subastador->save();\n\n $subasta = new Subasta();\n $subasta->ubicacion = \"Alvear 239\";\n $subasta->fecha = \"2021-06-07\";\n $subasta->horaInicio = \"10:35\";\n $subasta->horaFin = \"18:25\";\n $subasta->estado = \"abierta\";\n $subasta->capacidadAsistentes = 2;\n $subasta->tieneDeposito = \"si\";\n $subasta->seguridadPropia = \"si\";\n $subasta->categoria = \"comun\";\n $subasta->subastador_id = 1;\n $subasta->save();\n\n $producto = new Producto();\n $producto->fecha = \"2021-06-07\";\n $producto->disponible = \"si\";\n $producto->descripcionCatalogo = \"esto es una descripcion\";\n $producto->descripcionCompleta = \"esto es una descripcion\";\n $producto->cantidad = \"cantidad\";\n $producto->artista_obra = \"artista_obra\";\n $producto->fecha_obra = \"25/06/1956\";\n $producto->historia_obra = \"historia_obra\";\n $producto->revisor_id = 1;\n $producto->duenio_id = 1;\n $producto->save();\n\n $foto = new Foto();\n $foto->foto = \"acaHayUnaFoto\";\n $foto->producto_id = 1;\n $foto->save();\n\n $catalogo = new Catalogo();\n $catalogo->descripcion = \"descripcion\";\n $catalogo->responsable_id = 1;\n $catalogo->subasta_id = 1;\n $catalogo->save();\n\n $itemscatalogo = new ItemsCatalogo();\n $itemscatalogo->precioBase = 45;\n $itemscatalogo->comision = 3;\n $itemscatalogo->subastado = \"si\";\n $itemscatalogo->catalogo_id = 1;\n $itemscatalogo->producto_id = 1;\n $itemscatalogo->save();\n\n $asistente = new Asistente();\n $asistente->numeroPostor = 1;\n $asistente->cliente_id = 1;\n $asistente->subasta_id = 1;\n $asistente->save();\n\n $pujo = new Pujo();\n $pujo->asistente_id = 1;\n $pujo->item_id = 1;\n $pujo->save();\n\n $registrodesubasta = new RegistroDeSubasta();\n $registrodesubasta->importe = 5000;\n $registrodesubasta->comision = 10;\n $registrodesubasta->subasta_id = 1;\n $registrodesubasta->duenio_id = 1;\n $registrodesubasta->producto_id = 1;\n $registrodesubasta->cliente_id = 1;\n $registrodesubasta->save();\n\n // //\\App\\Models\\User::factory()->count(5)->create(); \n // //\\App\\Models\\Persona::factory()->count(5)->create();\n // // \\App\\Models\\Catalogo::factory()->count(5)->create(); \n // // \\App\\Models\\Cliente::factory()->count(5)->create(); \n // // \\App\\Models\\Subasta::factory()->count(5)->create(); \n // // \\App\\Models\\ItemsCatalogo::factory()->count(5)->create();\n }", "public function run()\n {\n //Both\n $rabies = new \\App\\Shot();\n $rabies->shotName = 'Rabies';\n $rabies->species = 'Both';\n $rabies->save();\n\n $bordetella = new \\App\\Shot();\n $bordetella->shotName = \"Bordetella\";\n $bordetella->species = 'Both';\n $bordetella->save();\n\n //Cat\n $panleukopenia = new \\App\\Shot();\n $panleukopenia->shotName = \"Panleukopenia\";\n $panleukopenia->species = 'Cat';\n $panleukopenia->save();\n\n $rhinotracheitis = new \\App\\Shot();\n $rhinotracheitis->shotName = \"Rhinotracheitis\";\n $rhinotracheitis->species = 'Cat';\n $rhinotracheitis->save();\n\n $calicivirus = new \\App\\Shot();\n $calicivirus->shotName = \"Calicivirus\";\n $calicivirus->species = 'Cat';\n $calicivirus->save();\n\n $feline_leukemia = new \\App\\Shot();\n $feline_leukemia->shotName = \"Feline Leukemia\";\n $feline_leukemia->species = 'Cat';\n $feline_leukemia->save();\n\n $chlamydophila = new \\App\\Shot();\n $chlamydophila->shotName = \"Chlamydophila\";\n $chlamydophila->species = 'Cat';\n $chlamydophila->save();\n\n $feline_infectious_peritonitis = new \\App\\Shot();\n $feline_infectious_peritonitis->shotName = \"Feline Infectious Peritonitis\";\n $feline_infectious_peritonitis->species = 'Cat';\n $feline_infectious_peritonitis->save();\n\n $giardia = new \\App\\Shot();\n $giardia->shotName = \"Giardia\";\n $giardia->species = 'Cat';\n $giardia->save();\n\n $feline_immunodeficiency_virus = new \\App\\Shot();\n $feline_immunodeficiency_virus->shotName = \"Feline Immunodeficiency Virus\";\n $feline_immunodeficiency_virus->species = 'Cat';\n $feline_immunodeficiency_virus->save();\n\n // Dog\n $canine_distemper = new \\App\\Shot();\n $canine_distemper->shotName = \"Canine Distemper\";\n $canine_distemper->species = 'Dog';\n $canine_distemper->save();\n\n $measles = new \\App\\Shot();\n $measles->shotName = \"Measles\";\n $measles->species = 'Dog';\n $measles->save();\n\n $parvovirus = new \\App\\Shot();\n $parvovirus->shotName = \"Parvovirus\";\n $parvovirus->species = 'Dog';\n $parvovirus->save();\n\n $hepatitis = new \\App\\Shot();\n $hepatitis->shotName = \"Hepatitis\";\n $hepatitis->species = 'Dog';\n $hepatitis->save();\n\n $CAV2 = new \\App\\Shot();\n $CAV2->shotName = \"CAV2\";\n $CAV2->species = 'Dog';\n $CAV2->save();\n\n $parainfluenza = new \\App\\Shot();\n $parainfluenza->shotName = \"Parainfluenza\";\n $parainfluenza->species = 'Dog';\n $parainfluenza->save();\n\n $leptospirosis = new \\App\\Shot();\n $leptospirosis->shotName = \"Leptospirosis\";\n $leptospirosis->species = 'Dog';\n $leptospirosis->save();\n\n $coronavirus = new \\App\\Shot();\n $coronavirus->shotName = \"Coronavirus\";\n $coronavirus->species = 'Dog';\n $coronavirus->save();\n \n $lyme = new \\App\\Shot();\n $lyme->shotName = \"Lyme\";\n $lyme->species = 'Dog';\n $lyme->save(); \n\n }", "public function pipeline() {\n return $this->belongsTo(PipelinePhase::class);\n }", "function sevenconcepts_pre_insertion($flux){\n if ($flux['args']['table']=='spip_auteurs'){\n include_spip('cextras_pipelines');\n $champs_extras=champs_extras_objet(table_objet_sql('auteur'));\n foreach($champs_extras as $value){\n $flux['data'][$value['options']['nom']]=_request($value['options']['nom']); \n }\n $flux['data']['name']=_request('nom_inscription'); \n }\nreturn $flux;\n}", "public function run()\n {\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Doloroso a la palpación profunda'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Signo de descompresión'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Hiperestesia cutánea'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Contractura muscular'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Masa abdominal'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Signo de Murphy'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Dolor en punto costovertebral'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Hepatomegalia'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Hígado no palpable'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Superficie hepática irregular'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Hígado pétreo'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Esplenomegalia'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Ptosis renal'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Superficie abollada del riñón'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Hiperalgesia cutánea'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Hemorroide externa trombosada'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Hemorroide interna'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Pólipos rectales'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save();\n\n $candy_palpation = new candy_palpation; $candy_palpation->palpation_ai_medic_id = 0; $candy_palpation->tx_palpation_value = 'Hipertrofia prostática'; $candy_palpation->tx_palpation_status = 1; $candy_palpation->created_at = time(); $candy_palpation->updated_at = time(); $candy_palpation->save(); \n }", "private function insert2Action(){\n\t\t$p = $this -> filterRecvParam($this -> getRequest() -> getParams());\n\t\t$this -> actParam = $p;\n\t\t//Forward only if an error occurs\n\t\tif(isset($p['error'])){\t\t\n\t\t\t//$this -> loadBikeModelsBrands();\n\t\t\t$this -> view -> error = $p['error'];\n\t\t\t//$this -> render('insert1');\n\t\t\t//$this -> _forward('insert', null, null, array('error' => $error));\n\t\t\t$this -> insert1Action();\n\t\t}\t\t\n\t\telse{\t\t\t\n\t\t\t//Set session namespace\n\t\t\t$this -> loadBikeCat();\n\t\t\t$this -> adminNS -> bikeAds = $p;\t\t\t\n\t\t\t$this -> view -> bike = $p;\n\t\t\t//$this -> view -> bikePhoto = $this -> bikeNS -> bikePhoto;\n\t\t\t\n\t\t\t$this -> render('insert2');\t\n\t\t}\t\n\t}", "public function run()\n {\n \n\n\n\n $filter = new Filter();\n $filter->name = \"Activity\";\n $filter->description = \"Category filter for product colors\";\n $filter->active = true;\n $filter->user_id = 1;\n $filter->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Activity')->first()->id;\n $page->name = 'Training';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Activity')->first()->id;\n $page->name = 'Running';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Activity')->first()->id;\n $page->name = 'Fishing';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Activity')->first()->id;\n $page->name = 'Gardening';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Activity')->first()->id;\n $page->name = 'Hiking';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Activity')->first()->id;\n $page->name = 'Racing';\n $page->save();\n \n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Activity')->first()->id;\n $page->name = 'Workwear';\n $page->save();\n \n $filter = new Filter();\n $filter->name = \"Colors\";\n $filter->description = \"Category filter for product colors\";\n $filter->active = true;\n $filter->user_id = 1;\n $filter->save();\n\n $page = new Attribute();\n $page->name = \"Colors\";\n $page->description = \"Attribute for product colors\";\n $page->active = true;\n $page->user_id = 1;\n $page->save();\n\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Colors')->first()->id;\n $page->value = 'Black';\n $page->hex = '#000';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Colors')->first()->id;\n $page->name = 'Black';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Colors')->first()->id;\n $page->value = 'Arctic White';\n $page->hex = 'white';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Colors')->first()->id;\n $page->name = 'White';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Colors')->first()->id;\n $page->value = 'Storm Gray';\n $page->hex = '#878c93';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Colors')->first()->id;\n $page->name = 'gray';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Colors')->first()->id;\n $page->value = 'Polar Blue';\n $page->hex = '#2781c2';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Colors')->first()->id;\n $page->name = 'polar-blue';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Colors')->first()->id;\n $page->value = 'Midnight Blue';\n $page->hex = '#1b3c68';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Colors')->first()->id;\n $page->name = 'midnight-blue';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Colors')->first()->id;\n $page->value = 'Gray Twist';\n $page->hex = '#74787d';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Colors')->first()->id;\n $page->name = 'gray-twist';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Colors')->first()->id;\n $page->value = 'Baja Red';\n $page->hex = '#f94845';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Colors')->first()->id;\n $page->name = 'baja-red';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Colors')->first()->id;\n $page->value = 'Charged Coral Twist';\n $page->hex = '#f94845';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Colors')->first()->id;\n $page->name = 'charged-coral-twist';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Colors')->first()->id;\n $page->value = 'Teal Teal Punch Twist';\n $page->hex = '#24a2a8';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Colors')->first()->id;\n $page->name = 'teal-teal-punch-twist';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Colors')->first()->id;\n $page->value = 'Cabana Green';\n $page->hex = '#009a71';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Colors')->first()->id;\n $page->name = 'cabana-green';\n $page->save();\n\n\n $filter = new Filter();\n $filter->name = \"Sizes\";\n $filter->description = \"Category filter for product sizes\";\n $filter->active = true;\n $filter->user_id = 1;\n $filter->save();\n\n $page = new Attribute();\n $page->name = \"Sizes\";\n $page->description = \"Attribute for product sizes\";\n $page->active = true;\n $page->user_id = 1;\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Sizes')->first()->id;\n $page->value = 'XS';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Sizes')->first()->id;\n $page->name = 'XS';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Sizes')->first()->id;\n $page->value = 'S';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Sizes')->first()->id;\n $page->name = 'S';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Sizes')->first()->id;\n $page->value = 'M';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Sizes')->first()->id;\n $page->name = 'M';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Sizes')->first()->id;\n $page->value = 'L';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Sizes')->first()->id;\n $page->name = 'L';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Sizes')->first()->id;\n $page->value = 'XL';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Sizes')->first()->id;\n $page->name = 'XL';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Sizes')->first()->id;\n $page->value = 'XXL';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Sizes')->first()->id;\n $page->name = 'XXL';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Sizes')->first()->id;\n $page->value = 'XXXL';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Sizes')->first()->id;\n $page->name = 'XXXL';\n $page->save();\n\n $page = new AttributeValue();\n $page->attribute_id = Attribute::where('name', 'Sizes')->first()->id;\n $page->value = 'XXXXL';\n $page->save();\n\n $page = new FilterTag();\n $page->filter_id = Filter::where('name', 'Sizes')->first()->id;\n $page->name = 'XXXXL';\n $page->save();\n\n\n \n }", "public function run()\n {\n //\n $chantier= new Chantier();\n $chantier->id=1;\n $chantier->libelle=\"PHB\";\n $chantier->id_pays=110;\n $chantier->save();\n\n $chantier= new Chantier();\n $chantier->id=2;\n $chantier->libelle=\"AZITO\";\n $chantier->id_pays=110;\n $chantier->save();\n\n $chantier= new Chantier();\n $chantier->id=3;\n $chantier->libelle=\"PAHSA\";\n $chantier->id_pays=110;\n $chantier->save();\n }", "public function run()\n {\n Parcours::truncate();\n\n Parcours::create(['nomParcours'=>\"Informatique\",'sigleParcours'=>\"INFO\",'idDiplome'=>1]);\n Parcours::create(['nomParcours'=>\"Calcul Scientifque\",'sigleParcours'=>\"CS\",'idDiplome'=>2]);\n }", "public function run()\n {\n $location = new App\\Location();\n $location->name = '';\n $location->province_id = ;\n $location->save();\n $address = new App\\Address();\n $address->street = '';\n $address->location_id = $location->id;\n $address->save();\n $person = new App\\Person();\n $person->name = '';\n $person->dni = '';\n $person->birthdate = '';\n $person->address_id = $address->id;\n $person->birthdate = Auditor::inRandomOrder()->first()->person_id;\n $person->save();\n $patient = new App\\Patient();\n $patient->person_id = $person->id;\n $patient->save();\n $expedient = new Expedient();\n $expedient->client_id = 1;\n $expedient->patient_id = $patient->id;\n $expedient->save();\n $diagnosisType = new DiagnosisType();\n $diagnosisType->name = '';\n $diagnosisType->save();\n $diagnosis = new Diagnosis();\n $diagnosis->diagnosisType_id = $diagnosisType->id;\n $diagnosis->expedient_id = $expedient->id;\n $diagnosis->save();\n $audit = new App\\Audit();\n $audit->expedient_id = $expedient->id;\n $audit->conclution = '';\n $audit->save();\n $recommendation = new App\\Recommendation();\n $recommendation->name = '';\n $recommendation->save();\n $audit->recommendations()->attach($recommendation);\n $auditRecommendation = new App\\AuditRecommendation();\n $auditRecommendation->recommendation_id = $audit->id;\n $auditRecommendation->audit_id = $recommendation->id;\n $auditRecommendation->save();\n $objective= new App\\Objective();\n $objective->name = '';\n $objective->save();\n $audit->objectives()->sync($objective);\n\n }", "public function run()\n {\n //\n $coPro = new copros();\n $coPro ->name = \"Mars\";\n $coPro ->cp = \"75017\";\n $coPro ->ville = \"paris\";\n $coPro ->save();\n\n\n $coPro = new copros();\n $coPro ->name = \"heart\";\n $coPro ->cp = \"75017\";\n $coPro ->ville = \"paris\";\n $coPro ->save();\n\n $coPro = new copros();\n $coPro ->name = \"Maria\";\n $coPro ->cp = \"78190\";\n $coPro ->ville = \"Trappes\";\n $coPro ->save();\n\n $coPro = new copros();\n $coPro ->name = \"terria\";\n $coPro ->cp = \"78317\";\n $coPro ->ville = \"saint-germain\";\n $coPro ->save();\n }", "public function step_1()\n {\n }", "public function run()\n {\n //creando varias instancias de la tabla cola\n // $cola= new cola;\n //$cola->id_cola=\"1\";\n //$cola->vehiculo_id=\"120\";\n // $cola->parqueo_id=\"1\";\n //$cola->save();\n\n\n }", "public function run()\n {\n \n /* #################################################*/\n /* Table: est_estado_ticket */\n /* ################################################*/\n\n $estadoTicket=new Est_estado_ticket();\n\n $estadoTicket->est_nombre=\"Nuevo\";\n $estadoTicket->est_descripcion=\"Estado asignado por el administrador.\";\n $estadoTicket->est_orden=1;\n $estadoTicket->est_estado=1;\n $estadoTicket->est_usu_creacion=1;\n $estadoTicket->est_usu_modificacion=1;\n $estadoTicket->save();\n\n $estadoTicket=new Est_estado_ticket();\n $estadoTicket->est_nombre=\"En Proceso\";\n $estadoTicket->est_descripcion=\"Estado cuando pasa a En Proceso\";\n $estadoTicket->est_orden=2;\n $estadoTicket->est_estado=1;\n $estadoTicket->est_usu_creacion=1;\n $estadoTicket->est_usu_modificacion=1;\n $estadoTicket->save();\n\n $estadoTicket=new Est_estado_ticket();\n $estadoTicket->est_nombre=\"En Espera\";\n $estadoTicket->est_descripcion=\"Estado el proceso esta en lista de espera\";\n $estadoTicket->est_orden=3;\n $estadoTicket->est_estado=1;\n $estadoTicket->est_usu_creacion=1;\n $estadoTicket->est_usu_modificacion=1;\n $estadoTicket->save();\n \n $estadoTicket=new Est_estado_ticket();\n $estadoTicket->est_nombre=\"Resuelto\";\n $estadoTicket->est_descripcion=\"Estado el proceso esta en lista de espera\";\n $estadoTicket->est_orden=4;\n $estadoTicket->est_estado=1;\n $estadoTicket->est_usu_creacion=1;\n $estadoTicket->est_usu_modificacion=1;\n $estadoTicket->save();\n\n\n /* #################################################*/\n /* Table: nip_nivel_prioridads */\n /* ################################################*/\n $prioridadTicket=new Nip_nivel_prioridad();\n $prioridadTicket->nip_nombre='Bajo';\n $prioridadTicket->nip_descripcion='Nivel prioridad Bajo';\n $prioridadTicket->nip_estado=1;\n $prioridadTicket->nip_usu_creacion=1;\n $prioridadTicket->nip_usu_modificacion=1;\n $prioridadTicket->save();\n\n $prioridadTicket=new Nip_nivel_prioridad();\n $prioridadTicket->nip_nombre='Normal';\n $prioridadTicket->nip_descripcion='Nivel prioridad normal';\n $prioridadTicket->nip_estado=1;\n $prioridadTicket->nip_usu_creacion=1;\n $prioridadTicket->nip_usu_modificacion=1;\n $prioridadTicket->save();\n\n $prioridadTicket=new Nip_nivel_prioridad();\n $prioridadTicket->nip_nombre='Alto';\n $prioridadTicket->nip_descripcion='nivel prioridad Alto';\n $prioridadTicket->nip_estado=1;\n $prioridadTicket->nip_usu_creacion=1;\n $prioridadTicket->nip_usu_modificacion=1;\n $prioridadTicket->save();\n\n $prioridadTicket=new Nip_nivel_prioridad();\n $prioridadTicket->nip_nombre='Urgente';\n $prioridadTicket->nip_descripcion='nivel Prioridad Urgente';\n $prioridadTicket->nip_estado=1;\n $prioridadTicket->nip_usu_creacion=1;\n $prioridadTicket->nip_usu_modificacion=1;\n $prioridadTicket->save();\n\n\n /* #################################################*/\n /* Table: rol_rols */\n /* ################################################*/\n $rolUsuario=new Rol_rol();\n $rolUsuario->rol_nombre='Administrador';\n $rolUsuario->rol_descripcion='Usuario con rol de administrador del sistema. Tiene acceso total al sistema';\n $rolUsuario->rol_estado=1;\n $rolUsuario->rol_usu_creacion=1;\n $rolUsuario->rol_usu_modificacion=1;\n $rolUsuario->save();\n\n $rolUsuario=new Rol_rol();\n $rolUsuario->rol_nombre='Usuario Final';\n $rolUsuario->rol_descripcion='Usuario que tiene acceso restringido al sistema. Solamente puede registrar tickets y consultarlos.';\n $rolUsuario->rol_estado=1;\n $rolUsuario->rol_usu_creacion=1;\n $rolUsuario->rol_usu_modificacion=1;\n $rolUsuario->save();\n\n }", "public function run()\n {\n //\n $tipo_act = new TipoActividad();\n $tipo_act->tipo= \"Examen\";\n $tipo_act->save();\n\n $tipo_act = new TipoActividad();\n $tipo_act->tipo= \"Tarea\";\n $tipo_act->save();\n\n $tipo_act = new TipoActividad();\n $tipo_act->tipo= \"Concurso\";\n $tipo_act->save();\n\n }", "protected function afterFind()\n {\n $this->actions = explode(',', $this->actions);\n parent::afterFind();\n }", "public function run()\n\t{\n\t\tDB::table('menu_responsibility')->delete();\n \n DB::table('menu_responsibility')->insert(array(\n array('id'=>'1000','menu_id'=>'1000','responsibility_id'=>'1000'),\n array('id'=>'1001','menu_id'=>'1001','responsibility_id'=>'1001')\n ));\n\t}", "public function run()\n {\n $espada = $this->espada->pegarArma();\n $clava = $this->clava->pegarArma();\n\n $orc = new \\RPGImusica\\Entity\\Orc([],$clava);\n $humano = new \\RPGImusica\\Entity\\Humano([],$espada);\n\n $orc->save();\n $humano->save();\n\n\n\n }", "public function run()\n {\n //PRODUCTO 1\n $producto = new Producto();\n $producto->producto = 'Audífonos'; \n $producto->precio = '4500.00';\n $producto->save();\n\n //PRODUCTO 2\n $producto2 = new Producto();\n $producto2->producto = 'Smartwatch'; \n $producto2->precio = '2000.00';\n $producto2->save();\n\n //PRODUCTO 3\n $producto3 = new Producto();\n $producto3->producto = 'Teatro en Casa'; \n $producto3->precio = '5000.00';\n $producto3->save();\n\n //PRODUCTO 4\n $producto4 = new Producto();\n $producto4->producto = 'Smart TV'; \n $producto4->precio = '1200.00';\n $producto4->save();\n\n //PRODUCTO 5\n $producto5 = new Producto();\n $producto5->producto = 'Smartphone'; \n $producto5->precio = '7500.00';\n $producto5->save();\n }", "public function run()\n {\n DB::table('secteurs')->insert([\n 'libelle' => 'secteur nord', \n ]);\n DB::table('secteurs')->insert([\n 'libelle' => 'secteur sud ', \n ]);\n \n DB::table('secteurs')->insert([\n 'libelle' => 'secteur est ', \n ]); \n \n DB::table('secteurs')->insert([\n 'libelle' => 'secteur ouest', \n ]);\n }", "public function run()\n {\n $proveedor = new Proveedor;\n $proveedor->nombre = 'centro de acopio';\n //privilegios\n $proveedor->save();\n\n $proveedor = new Proveedor;\n $proveedor->nombre = 'centro de distribucion';\n //privilegios\n $proveedor->save();\n\n $proveedor = new Proveedor;\n $proveedor->nombre = 'clap';\n //privilegios\n $proveedor->save();\n }", "public function testActionUseCase3()\n {\n\n // person, user, and target\n $user = factory(UserEloquent::class)->create();\n $person = factory(PersonEloquent::class)->create([\n 'is_pre_approved' => 0,\n 'is_primary' => 0,\n ]);\n $leadTypeId = LeadTypeEloquent::where('label', 'own')->where('user_id', null)->first()->getKey();\n $stageId = StageEloquent::where('label', 'prospect')->where('user_id', null)->first()->getKey();\n $stageLeadId = StageEloquent::where('label', 'lead')->where('user_id', null)->first()->getKey();\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $stageId,\n 'lead_type_id' => $leadTypeId,\n ]);\n $tag = TagEloquent::find(10);\n $person->tags()->attach($tag->getKey(), ['user_id' => $user->getKey()]);\n\n // workflow, rule, action and object\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_pre_approved',\n 'value' => '1',\n ]);\n $action2 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'person_contexts',\n 'target_field' => 'stage_id',\n 'value' => $stageLeadId,\n ]);\n $workflow->actions()->sync([$action1->getKey(), $action2->getKey()]); //\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $tag->getKey(),\n ]);\n\n\n // // parent rule\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'not preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '0'\n ]);\n\n // dependent rule\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'is prospect person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.stage_id',\n 'value' => $stageId,\n 'parent_id' => $rule1->getKey(),\n ]);\n $action1->rules()->sync([ $rule1->getKey()]);\n $action2->rules()->sync([ $rule2->getKey()]);\n\n\n\n //// first time run ////\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action2->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n //// check should failed /////\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action2->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => $person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $person->getKey(), //$leadContext->getKey(),\n 'info' => 'Dependent rule(s) not meet!',\n ]);\n $this->notSeeInDatabase('person_contexts',[\n 'id' => $leadContext->getKey(),\n $action2->target_field => $action2->value,\n ]);\n\n //// second run, run action 1 first /////\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n $this->assertEquals($status, 0);\n //echo $output->fetch();\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(),\n 'object_id' => $person->getKey(),\n ]);\n // check updated by status\n $this->seeInDatabase('persons',[\n 'id' => $person->getKey(),\n $action1->target_field => $action1->value,\n ]);\n\n //// second run, run action 2 then ///\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action2->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action2->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $person->getKey(), //$leadContext->getKey(),\n ]);\n // check updated by status\n $this->seeInDatabase('person_contexts',[\n 'id' => $leadContext->getKey(),\n $action2->target_field => $action2->value,\n ]);\n\n $this->cleanUpRecords(new PersonObserver, $person);\n }", "public function entity() {\n return $this->belongsTo(PipelineEntity::class);\n }", "public function run()\n {\n // CATEGORIA POSTRES\n\n $catalogo = new Catalogue();\n $catalogo->titulo = \"Enrollado de Chirimoya\";\n $catalogo->categoria = \"postres\";\n $catalogo->descripcion = \"Bizcochuelo de vainilla, relleno con tres capas, manjar, chantilly y pulpa de chirimoya, cubierto con fudge. Pídelo en su versión de 6 a 8 porciones.\";\n $catalogo->imagen = \"enrolladochirimoya.jpg\";\n $catalogo->save();\n\n $catalogo1 = new Catalogue();\n $catalogo1->titulo = \"Cheescake de zarzamoras\";\n $catalogo1->categoria = \"postres\";\n $catalogo1->descripcion = \"Una base de galleta rellena de una crema de queso y trozos de zarzamoras con el dulce clásico del cheescake, cubierto con mermelada y frutos.\";\n $catalogo1->imagen = \"cheescake.jpg\";\n $catalogo1->save();\n\n $catalogo2 = new Catalogue();\n $catalogo2->titulo = \"Crema Volteada\";\n $catalogo2->categoria = \"postres\";\n $catalogo2->descripcion = \"La más cremosa versión horneada con caramelo y un delicioso aroma a vainilla. Pídela desde 22cms\";\n $catalogo2->imagen = \"cremavolteada.jpg\";\n $catalogo2->save();\n\n $catalogo3 = new Catalogue();\n $catalogo3->titulo = \"Explosión de fresas\";\n $catalogo3->categoria = \"postres\";\n $catalogo3->descripcion = \"Bizcochuelo de vainilla embebido en un almíbar de fresas con licor, rellena con una capa de mermelada de fresas hecha en casa, una segunda capa de chantilly con fresas en trozos; cubierta en chantilly y decorada con fresas maceradas en jalea.\";\n $catalogo3->imagen = \"explosionfresa.jpg\";\n $catalogo3->save();\n\n $catalogo4 = new Catalogue();\n $catalogo4->titulo = \"Tarta de durazno\";\n $catalogo4->categoria = \"postres\";\n $catalogo4->descripcion = \"Una galleta horneada rellena con una crema pastelera de vainilla, cubierta con duraznos en jalea.\";\n $catalogo4->imagen = \"tartadurazno.jpg\";\n $catalogo4->save();\n\n $catalogo5 = new Catalogue();\n $catalogo5->titulo = \"Tartaleta de Fresas\";\n $catalogo5->categoria = \"postres\";\n $catalogo5->descripcion = \"Una galleta horneada rellena con una crema pastelera de vainilla, cubierta con fresas en jalea y decorada con copos de chantilly.\";\n $catalogo5->imagen = \"tartaletafresa.jpg\";\n $catalogo5->save();\n\n $catalogo6 = new Catalogue();\n $catalogo6->titulo = \"Torta húmeda de chocolate\";\n $catalogo6->categoria = \"postres\";\n $catalogo6->descripcion = \"Queque húmedo de chocolate embebido en un almíbar de chocolate, rellena con dos capas de fudge, cubierta con fudge. Pídela desde su versión mini (10 porciones).\";\n $catalogo6->imagen = \"tortahumeda.jpg\";\n $catalogo6->save();\n\n $catalogo7 = new Catalogue();\n $catalogo7->titulo = \"Tres Leches\";\n $catalogo7->categoria = \"postres\";\n $catalogo7->descripcion = \"Un suave bizcochuelo de vainilla o chocolate, embebido en nuestra deliciosa preparación de tres leches, rellena y cubierta de chantilly y envuelta en una deliciosa corona de chocolate bitter. Pídela desde su versión mini (10 porciones)\";\n $catalogo7->imagen = \"tresleches.jpg\";\n $catalogo7->save();\n\n\n //BODAS\n\n\n $catalogo8 = new Catalogue();\n $catalogo8->titulo = \"Naked\";\n $catalogo8->categoria = \"bodas\";\n $catalogo8->descripcion = \"Una torta en tendencia, pese a su sencillez luce super elegante, decorada con flores naturales o de tela.\";\n $catalogo8->imagen = \"naked.jpg\";\n $catalogo8->save();\n\n $catalogo9 = new Catalogue();\n $catalogo9->titulo = \"Azul\";\n $catalogo9->categoria = \"bodas\";\n $catalogo9->descripcion = \"Si deseas tematizar una torta y salir del blanco convencional he aquí la idea principal, una hermosa torta de bodas con azul metalizado.\";\n $catalogo9->imagen = \"azul.jpg\";\n $catalogo9->save();\n\n \n $catalogo10 = new Catalogue();\n $catalogo10->titulo = \"B&A\";\n $catalogo10->categoria = \"bodas\";\n $catalogo10->descripcion = \"Una torta ejecutada para la celebración de Bodas de Oro, aplicaciones de fondant.\";\n $catalogo10->imagen = \"bya.jpg\";\n $catalogo10->save();\n\n $catalogo11 = new Catalogue();\n $catalogo11->titulo = \"Love Gaby\";\n $catalogo11->categoria = \"bodas\";\n $catalogo11->descripcion = \"Una delicada versión que incluye acolchado, perlas y rosas, predominando el color perla\";\n $catalogo11->imagen = \"lovegaby.jpg\";\n $catalogo11->save();\n\n \n $catalogo12 = new Catalogue();\n $catalogo12->titulo = \"Love Volados\";\n $catalogo12->categoria = \"bodas\";\n $catalogo12->descripcion = \"Hermosa versión de bodas con flores y unos volados que envuelven todo el pastel para un efecto diferente. Aplicaciones en fondant\";\n $catalogo12->imagen = \"lovevolado.jpg\";\n $catalogo12->save();\n\n $catalogo13 = new Catalogue();\n $catalogo13->titulo = \"Siluetas\";\n $catalogo13->categoria = \"bodas\";\n $catalogo13->descripcion = \"Una idea para personalizar tu boda, usando siluetas de los novios en fotos reales, hará de ese recuerdo algo muy especial.\";\n $catalogo13->imagen = \"silueta.jpg\";\n $catalogo13->save();\n\n \n $catalogo14 = new Catalogue();\n $catalogo14->titulo = \"Mesa de Postres\";\n $catalogo14->categoria = \"bodas\";\n $catalogo14->descripcion = \"Una idea para complementar tu recepción una mesa completa de mini postres para el deleite de tus invitados.\";\n $catalogo14->imagen = \"mesapostre.jpg\";\n $catalogo14->save();\n\n //INFANTILES\n\n $catalogo15 = new Catalogue();\n $catalogo15->titulo = \"Mario Bross\";\n $catalogo15->categoria = \"infantiles\";\n $catalogo15->descripcion = \"El fontanero engreído de niños y adultos. Torta de 20 porciones\";\n $catalogo15->imagen = \"mariobross.jpg\";\n $catalogo15->save();\n\n \n $catalogo16 = new Catalogue();\n $catalogo16->titulo = \"Mickey\";\n $catalogo16->categoria = \"infantiles\";\n $catalogo16->descripcion = \"Aunque pasen los años este ratón seguirá robando el corazón de nuestros pequeños. Torta de 30 porciones (2 pisos) la cabecita de Mickey en chocolate forrado.\";\n $catalogo16->imagen = \"mickey.jpg\";\n $catalogo16->save();\n\n $catalogo17 = new Catalogue();\n $catalogo17->titulo = \"Spiderman\";\n $catalogo17->categoria = \"infantiles\";\n $catalogo17->descripcion = \"El super héroe favorito de muchos. Torta de 30 porciones\";\n $catalogo17->imagen = \"spiderman.jpg\";\n $catalogo17->save();\n\n \n $catalogo18 = new Catalogue();\n $catalogo18->titulo = \"Unicornio\";\n $catalogo18->categoria = \"infantiles\";\n $catalogo18->descripcion = \"Llevando a un mundo de sueños, color y fantasía. Torta de 20 porciones\";\n $catalogo18->imagen = \"unicornio.jpg\";\n $catalogo18->save();\n\n $catalogo19 = new Catalogue();\n $catalogo19->titulo = \"Hot Wheels\";\n $catalogo19->categoria = \"infantiles\";\n $catalogo19->descripcion = \"Para los amantes de la velocidad y por supuesto para los coleccionistas. Torta de 3 pisos (80 porciones)\";\n $catalogo19->imagen = \"hotwheels.jpg\";\n $catalogo19->save();\n\n \n $catalogo20 = new Catalogue();\n $catalogo20->titulo = \"Jasmine\";\n $catalogo20->categoria = \"infantiles\";\n $catalogo20->descripcion = \"Una princesa con el temperamento de su mascota. Torta de 2 pisos (50 porciones)\";\n $catalogo20->imagen = \"jasmine.jpg\";\n $catalogo20->save();\n\n $catalogo21 = new Catalogue();\n $catalogo21->titulo = \"Angry Birds\";\n $catalogo21->categoria = \"infantiles\";\n $catalogo21->descripcion = \"El clásico juego que conquistó a grandes y pequeños. Torta de 20 porciones\";\n $catalogo21->imagen = \"angrybirds.jpg\";\n $catalogo21->save();\n\n \n $catalogo22 = new Catalogue();\n $catalogo22->titulo = \"Blanca Nieves\";\n $catalogo22->categoria = \"infantiles\";\n $catalogo22->descripcion = \"No podría faltar nuestra primera princesa Disney. Temática blanca nieves, torta de 4 pisos (110 porciones) y dulces tematizados.\";\n $catalogo22->imagen = \"blancanieve.jpg\";\n $catalogo22->save();\n\n\n // Bocaditos\n\n\n $catalogo23 = new Catalogue();\n $catalogo23->titulo = \"Alfajores de Maicena\";\n $catalogo23->categoria = \"bocaditos\";\n $catalogo23->descripcion = \"Dos galletitas de maicena con una fina y delicada consistencia que se deshace en la boca rellenas con manjar de leche.\";\n $catalogo23->imagen = \"alfajore.jpg\";\n $catalogo23->save();\n\n \n $catalogo24 = new Catalogue();\n $catalogo24->titulo = \"Empanaditas de carne\";\n $catalogo24->categoria = \"bocaditos\";\n $catalogo24->descripcion = \"Una Deliciosa masa saladita rellena de un guiso con carne, pasas, ají amarillo, llevadas al horno. No podrás parar de comerlas.\";\n $catalogo24->imagen = \"empanada.jpg\";\n $catalogo24->save();\n\n $catalogo25 = new Catalogue();\n $catalogo25->titulo = \"Enrolladitos de hot dog\";\n $catalogo25->categoria = \"bocaditos\";\n $catalogo25->descripcion = \"Masa de hojaldre rellena de hot dog de ternera, llevada al horno, simplemente Yumi¡¡¡.\";\n $catalogo25->imagen = \"enrollado.jpg\";\n $catalogo25->save();\n\n \n $catalogo26 = new Catalogue();\n $catalogo26->titulo = \"Fresas Crocantes\";\n $catalogo26->categoria = \"bocaditos\";\n $catalogo26->descripcion = \"Dulces fresas cubiertas en chocolate bitter, la combinación de ambos ingredientes al paladar no tiene descripción.\";\n $catalogo26->imagen = \"fresacrocante.jpg\";\n $catalogo26->save();\n\n $catalogo27 = new Catalogue();\n $catalogo27->titulo = \"Mini pye de manzana\";\n $catalogo27->categoria = \"bocaditos\";\n $catalogo27->descripcion = \"Un clásico postre en un bocado, la deliciosa galletita se mezcla con el sabor de aquella manzana horneada con canela, azúcar y clavo.\";\n $catalogo27->imagen = \"minipye.jpg\";\n $catalogo27->save();\n\n \n $catalogo28 = new Catalogue();\n $catalogo28->titulo = \"Trufas de chocolate\";\n $catalogo28->categoria = \"bocaditos\";\n $catalogo28->descripcion = \"Pequeñas bolitas elaboradas con galletas, castañas y un toquecito de licor, cubiertas con una capita de chocolate bitter.\";\n $catalogo28->imagen = \"trufas.jpg\";\n $catalogo28->save();\n\n $catalogo29 = new Catalogue();\n $catalogo29->titulo = \"Rolatines de jamón y queso\";\n $catalogo29->categoria = \"bocaditos\";\n $catalogo29->descripcion = \"Pequeños piononos de pan pulman relleno de jamón y queso en rolatines.\";\n $catalogo29->imagen = \"rolatines.jpg\";\n $catalogo29->save();\n\n \n $catalogo30 = new Catalogue();\n $catalogo30->titulo = \"Petit pan con pollo\";\n $catalogo30->categoria = \"bocaditos\";\n $catalogo30->descripcion = \"Clásico sandwish y el favorito de muchos, un suave pancito de yema relleno de pollo deshilachado con apio y mayonesa de la casa.\";\n $catalogo30->imagen = \"petit.jpg\";\n $catalogo30->save();\n\n\n \n\n }", "public function run()\n {\n DB::table('promotion')->insert(['prod_id' => 1, 'rule' => 'price*((int)(quantity/2)+quantity%2)',]);\n DB::table('promotion')->insert(['prod_id' => 2, 'rule' => 'price*((int)(quantity/3)*2 + quantity%3)',]);\n \n }", "protected function hook_beforeSave(){}", "private function warnForThroughRelations()\n {\n $this->warn(\"| Make sure that the \\\"{$this->parent}\\\" model has the foreign key \\\"\".Str::lower($this->farParent).\"_id\\\" and the \\\"{$this->throughChild}\\\" model has the foreign key \\\"\".Str::lower($this->parent).\"_id\\\"\\n\");\n }", "abstract protected function action(AbstractDb $collection): Phrase;", "public function run()\n {\n //\n $pub=new \\App\\Pub();\n $pub->name = 'Idaho Press-Tribune';\n $pub->color = '004401';\n $pub->site_id=2;\n $pub->save();\n\n $pub=new \\App\\Pub();\n $pub->name = 'Idaho State Journal';\n $pub->color = '931B1D';\n $pub->site_id=3;\n $pub->save();\n\n }", "public function run()\n {\n \n $better1 = new Better();\n $better1->name = \"Petras\";\n $better1->surname = \"Petraitis\";\n $better1->bet = 2050.15;\n $better1->horse_id = 1;\n $better1->save();\n\n $better2 = new Better();\n $better2->name = \"Jonas\";\n $better2->surname = \"Jonaitis\";\n $better2->bet = 560.54;\n $better2->horse_id = 1;\n $better2->save(); \n }", "public function run()\n {\n factory(App\\Models\\Algeco::class, 20)->create()->each(function ($algeco){ \n\n \t$contratALG = \\App\\Models\\Contrat::create(\n [\n 'num_contrat' => '9453755',\n 'name_contrat' => 'Algeco',\n 'intercalaire' => 'A00'.rand(1,100),\n 'type_contrat' => 6,\n 'local_id' => null,\n 'algeco_id' => null,\n 'logement_id' => null\n ]);\n\n \t$contratALG->algeco()->associate($algeco->id);\n $contratALG->save();\n });\n\n /*$contratALGTest = \\App\\Models\\Contrat::create(\n [\n 'num_contrat' => '9453755',\n 'name_contrat' => 'Algeco',\n 'intercalaire' => 'A0000',\n 'type_contrat' => 6,\n 'local_id' => null,\n 'algeco_id' => null,\n 'logement_id' => null\n ]);\n $contratALGTest->algeco()->associate(1);\n $contratALGTest->save();*/\n }", "function performRedirect() {\n if($this->action == 'add' && !empty($this->request->data['VettingStep']['plugin'])) {\n // Redirect to the appropriate plugin to set up whatever it wants\n \n $pluginName = filter_var($this->request->data['VettingStep']['plugin'],FILTER_SANITIZE_SPECIAL_CHARS);\n $modelName = $pluginName;\n $pluginModelName = $pluginName . \".\" . $modelName;\n \n $target = array();\n $target['plugin'] = Inflector::underscore($pluginName);\n $target['controller'] = Inflector::tableize($modelName);\n $target['action'] = 'edit';\n $target[] = $this->_targetid;\n \n $this->redirect($target);\n } else {\n parent::performRedirect();\n }\n }", "public function recordAction() {\n\t\t \t\t\t\t\n\t\t\n\t}", "public function testActionUseCase1()\n {\n // person data\n\n // workflow data\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey()\n ]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type rent',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n app(WorkflowService::class)->syncActions($workflow, $action1);\n\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\necho $output->fetch();\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n $this->seeInDatabase('persons',[\n 'id' => $this->person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n // TODO: check to ES action_logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }", "public function dictaphoneAction() {\n\t\t$this->initInstance(); \t\t\t\t\n\t\t\n\t}", "public function run()\n {\n /*\n $tipo = new Tipo();\n $tipo->nome = 'Pessoa Juridica';\n $tipo->save();\n */\n\n $empresa = new Empresa();\n $empresa->nome = 'Hecato';\n $empresa->email = 'hecato@hecato.com.br';\n $empresa->informacoes = 'Hecato';\n $empresa->site = 'hecato.com.br';\n $empresa->aniversario_fundacao = now();\n $empresa->tipo_id = 2;\n $empresa->save();\n\n $empresa = new Empresa();\n $empresa->nome = 'Empresa Teste ' . str_random(12);\n $empresa->email = 'empresa@'.str_random(12).'.com.br';\n $empresa->informacoes = 'Empresa Teste ' . str_random(12);\n $empresa->site = 'empresa@'.str_random(12).'.com.br';\n $empresa->aniversario_fundacao = now();\n $empresa->tipo_id = 2;\n $empresa->save();\n\n $config = new Config();\n $config->config_id = 1;\n $config->empresa_id = $empresa->id;\n $config->valor = 100.00;\n $config->save();\n\n/*\n $pessoa = new Pessoa();\n $pessoa->nome = 'Empresa Teste ' . str_random(12);\n $pessoa->informacoes = 'Empresa Teste ' . str_random(12);\n $pessoa->site = 'empresa@'.str_random(12).'.com.br';\n $pessoa->tipo_id = $tipo->id;\n $pessoa->save();\n*/\n\n }", "public function run()\n {\n\n \tProfissional::insert(\n [ \n 'id_pessoa' => 1,\n 'codigo_cadastro' => '1231231',\n ],\n [ \n \t'id_pessoa' => 3,\n \t'codigo_cadastro' => '9999999',\n \t]\n );\n }", "public function step_3()\n {\n }", "public function run()\n {\n // Model::unguard();\n Parish::updateOrCreate([\n\t\t\t'name'=>'parroquia test',\n\t\t],\n []);\n }", "public function Action_TraiterRequete()\n\t{\n\t\tif (isset($_POST[\"requete\"]))\n\t\t{\n\t\t\t$Requete = $this->DecoderJson($_POST[\"requete\"]);\n\t\t\tif (isset($Requete[\"action\"]) && isset($Requete[\"donnees\"]))\n\t\t\t{\n\t\t\t\t$NomMethode = \"Action_\" . $Requete[\"action\"];\n\t\t\t\tif (!in_array($NomMethode, array(\"Action_TraiterRequete\", \"Action_RepondreReussite\", \"Action_RepondreEchec\"))\n\t\t\t\t\t&& method_exists($this, $NomMethode)\n\t\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\teval(\"\\$this->$NomMethode(\\$Requete[\\\"donnees\\\"]);\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->Action_RepondreEchec(\"Action inconnue !\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->Action_RepondreEchec(\"Action non définie ou incorrectement définie !\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->Action_RepondreEchec(\"Requête non définie !\");\n\t\t}\n\t}", "public function prepareEventBeforeMerge()\n {\n // если голова не знает о пенальти, то счет по пенальти попадет в счет матча и будет задвоение\n if (isset($this->item['statP']['is_penalty']) && ! isset($this->item['headP']['is_penalty']) && isset($this->item['headP']['score_home']) && isset($this->item['headP']['score_away']))\n {\n $this->item['headP']['penalty_home'] = $this->item['headP']['score_home'];\n $this->item['headP']['penalty_away'] = $this->item['headP']['score_away'];\n unset($this->item['headP']['score_home']);\n unset($this->item['headP']['score_away']);\n }\n }", "public function handle()\n {\n $etl1 = new Etl;\n $etl2 = new Etl;\n $etl3 = new Etl;\n $etl4 = new Etl;\n $etl5 = new Etl;\n $etl6 = new Etl;\n $etl7 = new Etl;\n $etl8 = new Etl;\n $etl9 = new Etl;\n $etl10 = new Etl;\n $etl11 = new Etl;\n $etl12 = new Etl;\n $etl13 = new Etl;\n $etl14 = new Etl;\n try {\n // var_dump('Entra a try');\n $etl1->extract('query','select * from categorias',['connection'=> self::fuente,])\n ->transform('trim',['type'=>'both'])->load('insert_update','tbl_categoria',['connection'=>self::destino,'key'=>['id'],'columns'=>[\n 'id'=>'id',\n 'nombre'=>'nombre_categoria',\n 'descripcion'=>'descripcion',\n 'created_at' => 'created_at',\n 'updated_at'=> 'updated_at'\n ],'timestamps' => false])->run();\n\n $etl2->extract('table','proveedores',['connection'=> self::fuente])->transform('trim',['type'=>'both'])->load('insert_update','tbl_proveedor',['connection'=>self::destino,'timestamps' => false])->run();\n\n $etl3->extract('table','marcas',['connection'=> self::fuente])->transform('trim',['type'=>'both'])->load('insert_update','tbl_marca',['connection'=>self::destino,'columns'=>[\n 'id'=>'id',\n 'nombre' => 'nombre_marca',\n 'created_at' => 'created_at',\n 'updated_at'=> 'updated_at'],'timestamps' => false])->run();\n\n $etl4->extract('table','productos',['connection'=> self::fuente])\n ->transform('trim',['type'=>'both'])->load('insert_update','tbl_producto',['connection'=>self::destino,'columns'=>[\n 'id'=>'id',\n 'nombre' => 'nombre',\n 'codigo'=>'codigo_producto',\n 'descripcion'=>'descripcion_producto',\n 'precio'=>'precio_producto',\n 'existencias'=>'existencia_producto',\n 'precio_con_descuento'=>'precio_con_descuento',\n 'marcas_id'=>'marca_id',\n 'categorias_id'=>'categoria_id',\n 'created_at' => 'created_at',\n 'updated_at'=> 'updated_at'],'timestamps' => false])->run();\n\n $etl5->extract('table','producto_proveedor',['connection'=> self::fuente])\n ->transform('trim',['type'=>'both'])->load('insert_update','tbl_producto_proveedor',['connection'=>self::destino,'columns'=>[\n 'id'=>'id',\n 'producto_id' => 'producto_id',\n 'proveedor_id'=>'proveedor_id',\n 'created_at' => 'created_at',\n 'updated_at'=> 'updated_at'],'timestamps' => false])->run();\n\n $etl6->extract('query','select * from pedidos_list',['connection'=> self::fuente])\n ->transform('trim',['type'=>'both'])->load('insert_update','tbl_pedido',['connection'=>self::destino,'columns'=>[\n 'id'=>'id',\n 'codigo' => 'codigo_pedido',\n 'fecha'=>'fecha_solicitud',\n 'comentario'=>'comentario_pedido',\n 'created_at' => 'created_at',\n 'updated_at'=> 'updated_at'],'timestamps' => false])->run();\n\n $etl7->extract('table','pedido_producto',['connection'=> self::fuente])\n ->transform('trim',['type'=>'both'])->load('insert_update','tbl_producto_pedido',['connection'=>self::destino,'timestamps' => false])->run();\n\n $etl8->extract('table','tipos',['connection'=> self::fuente])\n ->transform('trim',['type'=>'both'])->load('insert_update','tbl_tipo_salida',['connection'=>self::destino,'timestamps' => false])->run();\n\n $etl9->extract('table','salidas',['connection'=> self::fuente])\n ->transform('trim',['type'=>'both'])->load('insert_update','tbl_salida',['connection'=>self::destino,'columns'=>[\n 'id'=>'id',\n 'fecha_emision'=>'fecha_emision',\n 'total'=>'total',\n 'comentario'=>'comentario',\n 'correlativo_factura'=>'correlativo_factura',\n 'tipo_factura'=>'tipo_factura',\n 'costo'=>'costo',\n 'total_iva'=>'total_iva',\n 'tipo_id'=>'tipo_id',\n 'created_at' => 'created_at',\n 'updated_at'=> 'updated_at'\n ],'timestamps' => false])->run();\n\n\n $etl10->extract('query','select d.id idDetalle,d.pedido_producto_id,d.total totalDetalle,d.total_con_descuento totalDescuentoDetalle,d.cantidad_vendida cantidadVendidaDetalle,d.existencias existenciasDetalle,d.comentario comentarioDetalle,d.costo costoDetalle,d.salida_id salidaDetalle,d.created_at createdDetalle,d.updated_at updatedDetalle,pp.id,pp.pedido_id pedidoProducto from detalles as d LEFT JOIN pedido_producto as pp on d.pedido_producto_id = pp.id',['connection'=> self::fuente])\n ->transform('trim',['type'=>'both'])->load('insert_update','tbl_detalle',['connection'=>self::destino,'columns'=>[\n 'idDetalle'=>'id',\n 'totalDetalle'=>'total_detalle',\n 'totalDescuentoDetalle'=>'total_con_desc',\n 'cantidadVendidaDetalle'=>'cantidad_vendida',\n 'existenciasDetalle'=>'existencias',\n 'comentarioDetalle'=>'comentario',\n 'costoDetalle'=>'costo',\n 'pedidoProducto'=>'pedido_id',\n 'salidaDetalle' => 'salida_id',\n 'createdDetalle' => 'created_at',\n 'updatedDetalle'=> 'updated_at'\n ],'timestamps' => false])->run();\n\n $etl11->extract('table','compradores',['connection'=> self::fuente])\n ->transform('trim',['type'=>'both'])->load('insert_update','tbl_comprador',['connection'=>self::destino,'columns'=>[\n 'id'=>'id',\n 'nombre' => 'nombre',\n 'email'=> 'email',\n 'nit'=> 'nit',\n 'dui'=> 'dui',\n 'telefono'=>'telefono',\n 'direccion'=>'direccion',\n 'cuenta'=>'cuenta',\n 'created_at' => 'created_at',\n 'updated_at'=> 'updated_at'\n ],'timestamps' => false])->run();\n\n $etl12->extract('table','comprador_salida',['connection'=> self::fuente])\n ->transform('trim',['type'=>'both'])->load('insert_update','tbl_salida_comprador',['connection'=>self::destino,'columns'=>[\n 'id'=>'id',\n 'salida_id' => 'salida_id',\n 'comprador_id'=> 'comprador_id',\n 'created_at' => 'created_at',\n 'updated_at'=> 'updated_at'\n ],'timestamps' => false])->run();\n\n $etl13->extract('table','entidades',['connection'=> self::fuente])\n ->transform('trim',['type'=>'both'])->load('insert_update','tbl_entidad',['connection'=>self::destino,'timestamps' => false])->run();\n\n // //PROBANDO SI HACE MATCH CORRECTAMENTE A PESAR DE TENER EN DIFERENTE POSICION LOS CAMPOS\n $etl14->extract('table','entidad_salida',['connection'=> self::fuente])\n ->transform('trim',['type'=>'both'])->load('insert_update','tbl_salida_entidad',['connection'=>self::destino,'timestamps' => false])->run();\n\n $this->info('Exito al cargar los datos.');\n $this->info('|200');\n\n \n } catch (Exception $e) {\n var_dump($e->getMessage());\n $this->error('Ha ocurrido un error en la transferencia. Intente de nuevo, error:'+$e->getMessage());\n $this->info('|500');\n }\n \n }", "public function run()\n {\n //factory(Expedient::class, 50)->create(); //creted on the audit factory one to one\n }", "public function postSave() {}", "public function run()\n {\n $competecia = new Competencia;\n $competecia->nombre = 'Natación con aletas - Dinámica con aletas (Masculino)';\n $competecia->fecha = '2017-11-16 08:00:00';\n $competecia->lugar = 'Rodadero';\n $competecia->categoria_id = 1;\n $competecia->sede_id = 1;\n $competecia->estadocompetencia_id = 2;\n $competecia->save();\n\n $competecia = new Competencia;\n $competecia->nombre = 'Apnea - Dinámica con aletas (Femenino)';\n $competecia->fecha = '2017-11-16 08:00:00';\n $competecia->lugar = 'Rodadero';\n $competecia->categoria_id = 2;\n $competecia->sede_id = 1;\n $competecia->estadocompetencia_id = 2;\n $competecia->save();\n\n }", "public function run()\n {\n DB::table('editorial_book')->insert([\n 'editorial_id' => 4,\n 'book_id' \t\t=> 1,\n 'type' \t\t=> 1\n ]);\n DB::table('editorial_book')->insert([\n 'editorial_id' => 3,\n 'book_id' \t\t=> 2,\n 'type' \t\t=>1\n ]);\n DB::table('editorial_book')->insert([\n 'editorial_id' => 2,\n 'book_id' => 3,\n 'type' =>1\n ]);\n }", "public function run()\n {\n $acopio = new Acopio();\n $acopio->nombre = \"Centro de Acopio 1\";\n $acopio->save();\n\n $acopio = new Acopio();\n $acopio->nombre = \"Centro de Acopio 2\";\n $acopio->save();\n }", "protected function audit_record($action = false,$area = false,$id = false,$data = false){\n\t\treturn;\n\t}", "protected function hook_afterSave(){}", "public function handle()\n {\n $primaryTable = $this->argument('primary_table');\n $secondaryTables = $this->argument('secondary_tables');\n// dd($primaryTable);\n \\Eloquent::unguard();\n\n $connection = env('GENERATION_CONNECTION');\n $viewFolder = $this->argument('folder');\n $basePath = env('BASE_PATH');\n $modelFrontEnd = '';\n $importModelFrontEnd = [];\n $fieldsFrontEnd = [];\n $viewRoutes = '';\n $pivotFields = $this->getFields($connection,$primaryTable);\n\n// $primaryTable\n// $secondaryTables\n $withSecondary = '';\n $modelRelationSecondary = '';\n $importModelSecondary = '';\n\n if (DB::connection($connection)->select('show columns from ' . $primaryTable)[0]->Field == 'id') {\n $modelPrimary = $this->getModelName($primaryTable);\n $modelFrontEnd = $modelPrimary;\n $modelRelationPrimary='\n public function '.lcfirst($modelPrimary).'()\n {\n return $this->hasMany(\\'App\\\\'.$modelPrimary.'\\');\n }\n';\n\n $withPrimary = \"'\".lcfirst($modelPrimary).\"'\";\n $importModelPrimary =\"use App\\\\\".$modelPrimary.\";\\n\";\n\n foreach ($secondaryTables as $secondaryTable) {\n $modelSecondary = $this->getModelName(explode(\"=\", $secondaryTable)[1]);\n\n $importModelSecondary .=\"use App\\\\\".$modelSecondary.\";\\n\";\n $importModelFrontEnd[] = lcfirst($modelSecondary);\n\n\n if ($withSecondary != '') {\n $withSecondary.=\",'\".lcfirst($modelSecondary).\"'\";\n }else{\n $withSecondary.=\"'\".lcfirst($modelSecondary).\"'\";\n }\n\n $modelRelationSecondary.='\n\n public function '.lcfirst($modelSecondary).'()\n {\n return $this->belongsTo(\\'App\\\\'.$modelSecondary.'\\');\n }\n ';\n \\App\\Console\\Commands\\MVC\\Model::get($connection,explode(\"=\", $secondaryTable)[1],$modelRelationPrimary,$basePath);\n $fieldsSecondary = $this->getFields($connection,explode(\"=\", $secondaryTable)[1]);\n \\App\\Console\\Commands\\MVC\\Controller::get($fieldsSecondary,$modelSecondary,$importModelPrimary,$withPrimary,$basePath);\n\n }\n $fieldsPrimary = $this->getFields($connection,$primaryTable);\n $fieldsFrontEnd = $fieldsPrimary;\n \\App\\Console\\Commands\\MVC\\Model::get($connection,$primaryTable,$modelRelationSecondary,$basePath);\n \\App\\Console\\Commands\\MVC\\Controller::get($fieldsPrimary,$modelPrimary,$importModelSecondary,$withSecondary,$basePath);\n\n }else{\n $modelSecondary1 = $this->getModelName(explode(\"=\", $secondaryTables[0])[1]);\n $modelSecondary2 = $this->getModelName(explode(\"=\", $secondaryTables[1])[1]);\n\n $modelFrontEnd = $modelSecondary1;\n\n $importModelSecondary1 =\"use App\\\\\".$modelSecondary1.\";\\n\";\n $importModelSecondary2 =\"use App\\\\\".$modelSecondary2.\";\\n\";\n\n $importModelFrontEnd = [lcfirst($modelSecondary1),lcfirst($modelSecondary2),];\n\n $withSecondary1=\"'\".lcfirst($modelSecondary1).\"'\";\n $withSecondary2=\"'\".lcfirst($modelSecondary2).\"'\";\n\n $modelRelationSecondary1='\n\n public function '.lcfirst($modelSecondary1).'()\n {\n return $this->belongsToMany(\\'App\\\\'.$modelSecondary1.'\\');\n }\n';\n\n $modelRelationSecondary2='\n\n public function '.lcfirst($modelSecondary2).'()\n {\n return $this->belongsToMany(\\'App\\\\'.$modelSecondary2.'\\');\n }\n';\n\n \\App\\Console\\Commands\\MVC\\Model::get($connection,explode(\"=\", $secondaryTables[0])[1],$modelRelationSecondary2,$basePath);\n \\App\\Console\\Commands\\MVC\\Model::get($connection,explode(\"=\", $secondaryTables[1])[1],$modelRelationSecondary1,$basePath);\n\n $fieldsSecondary1 = $this->getFields($connection,explode(\"=\", $secondaryTables[0])[1]);\n $fieldsSecondary2 = $this->getFields($connection,explode(\"=\", $secondaryTables[1])[1]);\n\n $fieldsFrontEnd = $fieldsSecondary1;\n $attachmentDetachment = '\n public function attach()\n {\n $'.lcfirst($modelSecondary1).' = '.$modelSecondary1.'::find(request(\\''.lcfirst($modelSecondary1).'_id\\'));\n try{\n $'.lcfirst($modelSecondary1).'->'.lcfirst($modelSecondary2).'s()->attach(request(\\''.lcfirst($modelSecondary1).'_id\\'));\n return redirect()->action(\\''.$modelSecondary1.'Controller@show\\',[\\''.lcfirst($modelSecondary1).'_id\\' => request(\\''.lcfirst($modelSecondary1).'_id\\')]);\n } catch (\\Illuminate\\Database\\QueryException $e) {\n return response()->json([\\'status\\' => \\'error\\', \\'message\\' => $e->getMessage()]);\n }\n }\n\n public function detach(){\n $'.lcfirst($modelSecondary1).' = '.$modelSecondary1.'::find(request(\\''.lcfirst($modelSecondary1).'_id\\'));\n try{\n $'.lcfirst($modelSecondary1).'->'.lcfirst($modelSecondary2).'s()->detach(request(\\''.lcfirst($modelSecondary1).'_id\\'));\n return redirect()->action(\\''.$modelSecondary1.'Controller@show\\',[\\''.lcfirst($modelSecondary1).'_id\\' => request(\\''.lcfirst($modelSecondary1).'_id\\')]);\n } catch (\\Illuminate\\Database\\QueryException $e) {\n return response()->json([\\'status\\' => \\'error\\', \\'message\\' => $e->getMessage()]);\n }\n }\n';\n\n $attachmentDetachmentAPIRoutes = '\n Route::get(\\''.strtolower($modelSecondary1).'/'.strtolower($modelSecondary2).'/attach\\', \\''.$modelSecondary1.'Controller@attach\\');\n Route::get(\\''.strtolower($modelSecondary1).'/'.strtolower($modelSecondary2).'/detach\\', \\''.$modelSecondary1.'Controller@detach\\');\n';\n\n $viewRoutes .= '\n\\'/api/'.strtolower($modelSecondary1) .'/'.strtolower($modelSecondary2) .'/attach?'.lcfirst($modelSecondary1).'_id=\\'+'.lcfirst($modelSecondary1).'_id+\\'&'.lcfirst($modelSecondary2).'_id=\\'+'.lcfirst($modelSecondary2).'_id\n\\'/api/'.strtolower($modelSecondary1) .'/'.strtolower($modelSecondary2) .'/detach?'.lcfirst($modelSecondary1).'_id=\\'+'.lcfirst($modelSecondary1).'_id+\\'&'.lcfirst($modelSecondary2).'_id=\\'+'.lcfirst($modelSecondary2).'_id\n';\n\n $apiRouteFile = fopen($basePath.\"/routes/api.php\", \"a\") or die(\"Unable to open file!\");\n fwrite($apiRouteFile, $attachmentDetachmentAPIRoutes);\n fclose($apiRouteFile);\n\n $attachmentDetachmentFrontEndRoutes = '';\n\n \\App\\Console\\Commands\\MVC\\Controller::get($fieldsSecondary1,$modelSecondary1,$importModelSecondary2,$withSecondary2,$basePath,$attachmentDetachment);\n \\App\\Console\\Commands\\MVC\\Controller::get($fieldsSecondary2,$modelSecondary2,$importModelSecondary1,$withSecondary1,$basePath);\n }\n\n// todo: craft routes for the attach and detach whenever there is such a thing to be written at the end of the relevant files\n if (env('FRONTEND_TYPE') == 'external') {\n\\Log::info('hitting front');\n\\Log::info(env('FRONTEND_PATH'));\n $viewPath = env('FRONTEND_PATH').'/src/components/'.$viewFolder;\n $viewRoutePath = '/var/www/erengplay/storage/logs/router.js';\n $viewRoutes .= '\nimport '.$modelFrontEnd.' from \\'./components/'.$viewFolder.'/index.vue\\'\n {\n path: \\'/'.strtolower($modelFrontEnd).'\\',\n name: \\''.$modelFrontEnd.'\\',\n component: '.$modelFrontEnd.',\n beforeEnter: ifAuthenticated,\n },\n';\n\n }else{\n\\Log::info('hitting back');\n $viewPath = $basePath.'/resources/assets/js/components/'.$viewFolder;\n $viewRoutePath = $basePath.'/resources/assets/js/router/index.js';\n $viewRoutes .= '\nimport '.$modelFrontEnd.' from \\'./components/'.$viewFolder.'/index.vue\\'\n {\n path: \\'/'.strtolower($modelFrontEnd).'\\',\n name: \\''.$modelFrontEnd.'\\',\n component: '.$modelFrontEnd.',\n beforeEnter: ifAuthenticated,\n },\n';\n }\n\n\n \\App\\Console\\Commands\\MVC\\View::get($connection,$fieldsFrontEnd,$modelFrontEnd,$importModelFrontEnd,$viewPath);\n // \\App\\Console\\Commands\\MVC\\View::get($connection,$pivotFields,$modelFrontEnd,$importModelFrontEnd,'/var/www/erengplay/storage/logs');\n $this->generateViewRoutes($viewRoutePath,$viewRoutes);\n }", "private function perform () {\n\t\tif ( $this->performed ) {\n\t\t\tthrow new Controller\\DoubleRenderException( 'Can only render or redirect once per action' );\n\t\t}\n\n\t\t$this->performed = true;\n\t}", "public function afterSave(){\r\n parent::afterSave();\r\n if($this->isNewRecord){\r\n $class = Strategy::getClass('Aro');\r\n $aro = new $class();\r\n $aro->model = get_class($this);\r\n $aro->foreign_key = $this->getPrimaryKey();\r\n if(!$aro->save())\r\n throw new RuntimeError(\"Unable to save Aro-Collection\");\r\n }\r\n }", "public function run()\n {\n $artesano = new Artesano();\n $artesano->categoria = \"avanzado\";\n $artesano->discapacidad = true;\n $artesano->persona_id = Persona::where('rfc','OOVB640922HOCSRR02')->first()->id;\n $artesano->save();\n\n $artesano = new Artesano();\n $artesano->categoria = \"avanzado\";\n $artesano->discapacidad = true;\n $artesano->persona_id = Persona::where('rfc','LOGE800624MQTPTS03')->first()->id;\n $artesano->save();\n\n $artesano = new Artesano();\n $artesano->categoria = \"intermedio\";\n $artesano->discapacidad = false;\n $artesano->persona_id = Persona::where('rfc','SARR770306MCSNSS02')->first()->id;\n $artesano->save();\n\n $artesano = new Artesano();\n $artesano->categoria = \"intermedio\";\n $artesano->discapacidad = false;\n $artesano->persona_id = Persona::where('rfc','AABF780518MJCLRL04')->first()->id;\n $artesano->save();\n\n $artesano = new Artesano();\n $artesano->categoria = \"principiante\";\n $artesano->discapacidad = false;\n $artesano->persona_id = Persona::where('rfc','MACA870903HSPRDB04')->first()->id;\n $artesano->save();\n\n\t\t$artesano = new Artesano();\n $artesano->categoria = \"avanzado\";\n $artesano->discapacidad = false;\n $artesano->persona_id = Persona::where('rfc','AABF890415MHGLTR07')->first()->id;\n $artesano->save();\n\n $artesano = new Artesano();\n $artesano->categoria = \"avanzado\";\n $artesano->discapacidad = true;\n $artesano->persona_id = Persona::where('rfc','CURJ860410HDFRMN04')->first()->id;\n $artesano->save();\n\n }", "public function run()\n {\n $cat = new Categorie();\n $cat->nom ='Santé';\n $cat->save();\n\n $cat = new Categorie();\n $cat->nom ='Commerce';\n $cat->save();\n\n $cat = new Categorie();\n $cat->nom ='Social';\n $cat->save();\n }", "public function run()\n {\n //factory(App\\Models\\CatCentroReclusion::class, 10)->create();\n /* factory(App\\Models\\Persona::class, 10)->create();\n factory(App\\Models\\Desaparecido::class, 10)->create();\n factory(App\\Models\\Domicilio::class, 10)->create();\n factory(App\\Models\\Familiar::class, 10)->create();\n factory(App\\Models\\Antecedente::class, 10)->create();\n factory(App\\Models\\Documento::class, 10)->create();*/\n\n //factory(\\App\\Models\\Plan::class, 3)->create()->each(function ($planes) {\n //planes->auditorias()->save(factory(\\App\\Models\\Auditoria::class)->make());\n\n\n //factory(App\\Models\\Cedula::class, 10)->create()->each(function ($cedula){\n //$cedula->desaparecidos()->save(factory(App\\Models\\Desaparecido::class)->make());\n //});\n\n /* factory(App\\Models\\Cedula::class, 10)->create()->each(function ($cedula){\n $cedula->desaparecidos()->save(factory(App\\Models\\Desaparecido::class)->make());\n });\n\n\n // factory(App\\Models\\Persona::class, 5)->create()->each(function ($persona){\n //$persona->desaparecidos()->save(factory(App\\Models\\Desaparecido::class)->make());\n //});\n\n\n // factory(App\\Models\\Desaparecido::class, 10)->create()->each(function ($desaparecido){\n // $desaparecido->domicilios()->save(factory(App\\Models\\Domicilio::class)->make());\n // });\n\n\n factory(App\\Models\\Desaparecido::class, 10)->create()->each(function ($desaparecido){\n $desaparecido->domicilios()->save(factory(App\\Models\\Domicilio::class)->make());\n });\n*/\n\n\n\n }", "function jo($entity) {\n $entity->setEntityId(($entity->getEntityId() +1));\n }", "function act_tipo_salida(){\n\t\t$u= new Tipo_salida();\n\t\t$related = $u->from_array($_POST);\n\n\t\t// save with the related objects\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo \"<html> <script>alert(\\\"Se han actualizado los datos del Tipo de Salida.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "public function rechercherUn() {\n\n // query to read single record\n $query = \"SELECT * FROM \" . $this->sNomTable . \"\n LEFT JOIN panier ON idPanier = iNoPanier\n LEFT JOIN produit ON idProduit = iNoProduit\n WHERE iNoPanier = :iNoPanier\";\n\n // prepare query statement\n $stmt = $this->oConnexion->prepare($query);\n\n // bind id of product to be updated\n $stmt->bindParam(\":iNoPanier\", $this->iNoPanier);\n\n // execute query\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->idContenuPanier = $row['idContenuPanier'];\n $this->iQteProduit = $row['iQteProduit'];\n\n // Produit\n $this->iNoProduit = $row['iNoProduit'];\n $this->sSKUProduit = $row['sSKUProduit'];\n $this->sNomProduit = $row['sNomProduit'];\n $this->sMarque = $row['sMarque'];\n $this->fPrixProduit = $row['fPrixProduit'];\n $this->fPrixSolde = $row['fPrixSolde'];\n $this->sDescCourteProduit = $row['sDescCourteProduit'];\n $this->sDescLongProduit = $row['sDescLongProduit'];\n $this->sCouleur = $row['sCouleur'];\n $this->sCapacite = $row['sCapacite'];\n $this->sDateAjout = $row['sDateAjout'];\n $this->bAfficheProduit = $row['bAfficheProduit'];\n $this->iNoCategorie = $row['iNoCategorie'];\n $this->sNomCategorie = $row['sNomCategorie'];\n $this->sUrlCategorie = $row['sUrlCategorie'];\n\n // Panier\n $this->iNoPanier = $row['iNoPanier'];\n $this->sNumPanier = $row['sNumPanier'];\n $this->sDateModification = $row['sDateModification'];\n }", "public function run()\n {\n Plano_Profissional::create([\n 'profissional_id' => 1,\n 'plano_id' => 1 \n ]);\n \n Plano_Profissional::create([\n 'profissional_id' => 1,\n 'plano_id' => 3 \n ]);\n\n Plano_Profissional::create([\n 'profissional_id' => 10,\n 'plano_id' => 1 \n ]);\n \n Plano_Profissional::create([\n 'profissional_id' => 18,\n 'plano_id' => 1 \n ]);\n }", "private function processGrammarAction($row) {\r\n \r\n $timer = Debug::GetTimer(); \r\n \r\n $row['event']['action'] = Grammar::getAction($row);\r\n $row['event']['object'] = Grammar::getObject($row);\r\n \r\n if ($row['title'] == \"Loco link removed\") {\r\n $row['event']['action'] = \"removed\";\r\n $row['event']['object'] = \"linked locomotive\";\r\n $row['event']['article'] = \"a\";\r\n $row['event']['preposition'] = \"from\";\r\n }\r\n \r\n Debug::LogEvent(__METHOD__, $timer);\r\n \r\n return $row;\r\n \r\n }", "public function run()\n {\n $a1 = new Aliment();\n $a1->nom = 'Avocat';\n $a1->id_createur = 1;\n $a1->nom_photo = 'avocat.jpg';\n $a1->save();\n\n $a2 = new Aliment();\n $a2->nom = 'Jus de citron';\n $a2->id_createur = 1;\n $a2->nom_photo = 'jus-citron.jpg';\n $a2->save();\n\n $a3 = new Aliment();\n $a3->nom = 'Jus de citron vert';\n $a3->id_createur = 1;\n $a3->save();\n\n $a4 = new Aliment();\n $a4->nom = 'Sel';\n $a4->id_createur = 1;\n $a4->save();\n\n $a5 = new Aliment();\n $a5->nom = 'Poivre';\n $a5->id_createur = 1;\n $a5->save();\n\n $a6 = new Aliment();\n $a6->nom = 'Sucre';\n $a6->id_createur = 1;\n $a6->save();\n\n $a7 = new Aliment();\n $a7->nom = 'Crème liquide';\n $a7->id_createur = 1;\n $a7->nom_photo = '67338_w100h100c1cx350cy350.jpg';\n $a7->save();\n\n $a8 = new Aliment();\n $a8->nom = 'Carotte';\n $a8->id_createur = 1;\n $a8->nom_photo = '67370_w100h100c1cx350cy350.jpg';\n $a8->save();\n\n $a9 = new Aliment();\n $a9->nom = 'Lait';\n $a9->id_createur = 1;\n $a9->nom_photo = '67388_w100h100c1cx350cy350.jpg';\n $a9->save();\n\n $a10 = new Aliment();\n $a10->nom = 'Pomme de terre';\n $a10->id_createur = 1;\n $a10->nom_photo = '67419_w100h100c1cx350cy350.jpg';\n $a10->save();\n\n $a11 = new Aliment();\n $a11->nom = 'Ail';\n $a11->id_createur = 1;\n $a11->nom_photo = '67514_w100h100c1cx350cy350.jpg';\n $a11->save();\n\n $a12 = new Aliment();\n $a12->nom = 'Bouillon de poulet';\n $a12->id_createur = 1;\n $a12->nom_photo = '67586_w100h100c1cx350cy350.jpg';\n $a12->save();\n\n $a13 = new Aliment();\n $a13->nom = 'Oignon';\n $a13->id_createur = 1;\n $a13->nom_photo = '67621_w100h100c1cx350cy350.jpg';\n $a13->save();\n\n $a14 = new Aliment();\n $a14->nom = 'Persil';\n $a14->id_createur = 1;\n $a14->nom_photo = '67650_w100h100c1cx350cy350.jpg';\n $a14->save();\n \n $a15 = new Aliment();\n $a15->nom = 'Muscade';\n $a15->id_createur = 1;\n $a15->nom_photo = '67662_w100h100c1cx350cy350.jpg';\n $a15->save();\n\n $a16 = new Aliment();\n $a16->nom = 'Potiron';\n $a16->id_createur = 1;\n $a16->nom_photo = '67669_w100h100c1cx350cy350.jpg';\n $a16->save();\n\n $a17 = new Aliment();\n $a17->nom = 'Farine';\n $a17->id_createur = 1;\n $a17->nom_photo = '67682_w100h100c1cx350cy350.jpg';\n $a17->save();\n\n $a18 = new Aliment();\n $a18->nom = 'Eau';\n $a18->id_createur = 1;\n $a18->nom_photo = '4032097-le-verre-deau-verre-deau-png-300_240.png';\n $a18->save();\n\n $a19 = new Aliment();\n $a19->nom = 'Huile d\\'olive';\n $a19->id_createur = 1;\n $a19->nom_photo = 'i90929-.jpeg';\n $a19->save();\n\n $a20 = new Aliment();\n $a20->nom = 'Levure';\n $a20->id_createur = 1;\n $a20->nom_photo = 'Fotolia_54848946_S_levure_boulanger.jpg';\n $a20->save();\n\n $a21 = new Aliment();\n $a21->nom = 'Chocolat';\n $a21->id_createur = 1;\n $a21->nom_photo = '67423_w100h100c1cx350cy350.jpg';\n $a21->save();\n\n $a22 = new Aliment();\n $a22->nom = 'Oeuf';\n $a22->id_createur = 1;\n $a22->nom_photo = '67505_w100h100c1cx350cy350.jpg';\n $a22->save();\n\n $a23 = new Aliment();\n $a23->nom = 'Beurre doux';\n $a23->id_createur = 1;\n $a23->nom_photo = '68919_w100h100c1cxt0cyt0cxb300cyb300.jpg';\n $a23->save();\n\n $a24 = new Aliment();\n $a24->nom = 'Spaghetti';\n $a24->id_createur = 1;\n $a24->nom_photo = '2202014_1010_5_x700.jpg';\n $a24->save();\n\n $a25 = new Aliment();\n $a25->nom = 'Pecorino Romano';\n $a25->id_createur = 1;\n $a25->nom_photo = '12-pecorino-romano_001.jpg';\n $a25->save();\n\n $a26 = new Aliment();\n $a26->nom = 'Joue de porc séchée';\n $a26->id_createur = 1;\n $a26->nom_photo = 'guanciale.jpg';\n $a26->save();\n\n $a27 = new Aliment();\n $a27->nom = 'Jaune d\\'oeuf';\n $a27->id_createur = 1;\n $a27->nom_photo = 'jaune_oeuf.jpg';\n $a27->save();\n }", "public function caststep2Action(){\n\t\ttry{\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t$identity = $sm->get('AuthService')->getIdentity();\n\t\t\t\n\t\t\t$config = $sm->get('Config');\n\t\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\tif($request->isPost()){\n\t\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\t\n\t\t\t\t$jobPacketTable = $sm->get('Order\\Model\\JobPacketTable');\n\t\t\t\t\n\t\t\t\tif($jobPacketTable->checkMilestoneCanBeCompleted($posts['milestone_id'], $posts['steps_completed'])){\n\t\t\t\t\n\t\t\t\t\t$data = array('milestone_id' => $posts['milestone_id'], 'steps_completed' => $posts['steps_completed'], 'stp2_client_reviewed' => 2, 'job_id' => $posts['job_id']);\n\t\t\t\t\t\n\t\t\t\t\t$castTable = $sm->get('Order\\Model\\CastTable');\n\t\t\t\t\t\n\t\t\t\t\techo $castTable->saveCastStep($data);\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\techo 0;\n\t\t\t\texit;\n\t\t\t}\n\t\t\texit;\n\t\t}catch(Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n\t}", "public function run()\n {\n $sexo = new Sexo();\n $sexo->concepto='mujer';\n $sexo->orden=1;\n $sexo->save();\n\n $sexo = new Sexo();\n $sexo->concepto='hombre';\n $sexo->orden=2;\n $sexo->save();\n }", "public function run()\n {\n DB::table('objectifs')->insert([\n 'objet' => 'depeche',\n 'date'=>'2019-02-03',\n 'note'=>'cour vite',\n 'statut'=>1,\n 'contact_id'=>1\n\n ]);\n\n DB::table('objectifs')->insert([\n 'objet' => 'depecherrrr',\n 'date'=>'2019-02-03',\n 'note'=>'cour vite chaud',\n 'statut'=>0,\n 'contact_id'=>1\n \n ]);\n }", "protected function _prepareMassaction(){\r\n return $this;\r\n }", "public function run()\n {\n $sps1 = new Specialist([\n \t'nama'=>\"Specialist 1\",\n \t'isActive'=>1,\n ]);\n $sps1->save();\n\n $sps2 = new Specialist([\n \t'nama'=>\"Specialist 2\",\n \t'isActive'=>1,\n ]);\n $sps2->save();\n \n $sps3 = new Specialist([\n \t'nama'=>\"Specialist 3\",\n \t'isActive'=>1,\n ]);\n $sps3->save();\n }", "protected function _postSave()\r\n\t{\r\n\t}", "protected function beforeInserting()\n {\n }", "public function run()\n {\n \\DB::table('tipo_propuesta_negocio')->insert(['tipo_propuesta_negocio' => 'VENTA NUEVO']);\n \\DB::table('tipo_propuesta_negocio')->insert(['tipo_propuesta_negocio' => 'VENTA USADO']);\n \\DB::table('tipo_propuesta_negocio')->insert(['tipo_propuesta_negocio' => 'VENTA NUEVO / TOMA USADO']);\n \\DB::table('tipo_propuesta_negocio')->insert(['tipo_propuesta_negocio' => 'VENTA USADO / TOMA USADO']);\n }", "public function run()\n {\n DB::table('competicion')->delete();\n $competicion = new Competicion([\n 'nombre' => 'Liga'\n ]);\n $competicion->save();\n \n $competicion = new Competicion([\n 'nombre' => 'Copa'\n ]);\n $competicion->save();\n\n\n $competicion = new Competicion([\n 'nombre' => 'Amistoso'\n ]);\n $competicion->save();\n }", "public function run()\n {\n $type_blood = new BloodType;\n $type_blood->blood_type = \"A\";\n $type_blood->save();\n\n $type_blood = new BloodType;\n $type_blood->blood_type = \"AB\";\n $type_blood->save();\n\n\n $type_blood = new BloodType;\n $type_blood->blood_type = \"B\";\n $type_blood->save();\n\n $type_blood = new BloodType;\n $type_blood->blood_type = \"O\";\n $type_blood->save();\n\n }" ]
[ "0.6138471", "0.5660434", "0.5500155", "0.54886764", "0.54646075", "0.53724855", "0.5192728", "0.5156804", "0.50902253", "0.5086478", "0.50551593", "0.5044759", "0.5038298", "0.5037647", "0.50212735", "0.5002799", "0.49996892", "0.49627292", "0.49574596", "0.49515373", "0.49503356", "0.49503356", "0.49447754", "0.49193066", "0.4910322", "0.49057293", "0.48914796", "0.48841578", "0.48810965", "0.48771983", "0.48666108", "0.48652196", "0.4864426", "0.48591176", "0.48583084", "0.48556513", "0.48508814", "0.48503116", "0.48377064", "0.48149934", "0.48038712", "0.48005208", "0.47975776", "0.47944343", "0.47941697", "0.47878975", "0.47665578", "0.47619146", "0.47579864", "0.475325", "0.47419608", "0.4737306", "0.47330782", "0.47314194", "0.4731064", "0.4729716", "0.47293323", "0.47162035", "0.47146437", "0.47143337", "0.47112486", "0.47071415", "0.46981105", "0.46960893", "0.46953493", "0.4684835", "0.4674872", "0.46735936", "0.46721262", "0.46716508", "0.46671215", "0.46666795", "0.46656433", "0.46606907", "0.4659865", "0.46589488", "0.4656765", "0.46539256", "0.46516207", "0.4650613", "0.46501505", "0.46442762", "0.46407694", "0.46398202", "0.46367675", "0.4635742", "0.46341673", "0.4632925", "0.4632156", "0.46303743", "0.4629419", "0.46278685", "0.46265638", "0.46250388", "0.4624946", "0.46198714", "0.46153587", "0.46091947", "0.4609157", "0.46087858", "0.4608636" ]
0.0
-1